1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_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 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 pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
54 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 pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
69 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 CoordinatorSetDisplayPowerModeResult = Result<(), i32>;
99
100pub trait CoordinatorProxyInterface: Send + Sync {
101 type ImportImageResponseFut: std::future::Future<Output = Result<CoordinatorImportImageResult, fidl::Error>>
102 + Send;
103 fn r#import_image(
104 &self,
105 image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
106 buffer_collection_id: &BufferCollectionId,
107 buffer_index: u32,
108 image_id: &ImageId,
109 ) -> Self::ImportImageResponseFut;
110 fn r#release_image(&self, image_id: &ImageId) -> Result<(), fidl::Error>;
111 fn r#import_event(&self, event: fidl::Event, id: &EventId) -> Result<(), fidl::Error>;
112 fn r#release_event(&self, id: &EventId) -> Result<(), fidl::Error>;
113 type CreateLayerResponseFut: std::future::Future<Output = Result<CoordinatorCreateLayerResult, fidl::Error>>
114 + Send;
115 fn r#create_layer(&self) -> Self::CreateLayerResponseFut;
116 fn r#destroy_layer(&self, layer_id: &LayerId) -> Result<(), fidl::Error>;
117 fn r#set_display_mode(
118 &self,
119 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
120 mode: &fidl_fuchsia_hardware_display_types::Mode,
121 ) -> Result<(), fidl::Error>;
122 fn r#set_display_color_conversion(
123 &self,
124 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
125 preoffsets: &[f32; 3],
126 coefficients: &[f32; 9],
127 postoffsets: &[f32; 3],
128 ) -> Result<(), fidl::Error>;
129 fn r#set_display_layers(
130 &self,
131 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
132 layer_ids: &[LayerId],
133 ) -> Result<(), fidl::Error>;
134 fn r#set_layer_primary_config(
135 &self,
136 layer_id: &LayerId,
137 image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
138 ) -> Result<(), fidl::Error>;
139 fn r#set_layer_primary_position(
140 &self,
141 layer_id: &LayerId,
142 image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
143 image_source: &fidl_fuchsia_math::RectU,
144 display_destination: &fidl_fuchsia_math::RectU,
145 ) -> Result<(), fidl::Error>;
146 fn r#set_layer_primary_alpha(
147 &self,
148 layer_id: &LayerId,
149 mode: fidl_fuchsia_hardware_display_types::AlphaMode,
150 val: f32,
151 ) -> Result<(), fidl::Error>;
152 fn r#set_layer_color_config(
153 &self,
154 layer_id: &LayerId,
155 color: &fidl_fuchsia_hardware_display_types::Color,
156 display_destination: &fidl_fuchsia_math::RectU,
157 ) -> Result<(), fidl::Error>;
158 fn r#set_layer_image2(
159 &self,
160 layer_id: &LayerId,
161 image_id: &ImageId,
162 wait_event_id: &EventId,
163 ) -> Result<(), fidl::Error>;
164 type CheckConfigResponseFut: std::future::Future<
165 Output = Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error>,
166 > + Send;
167 fn r#check_config(&self) -> Self::CheckConfigResponseFut;
168 fn r#discard_config(&self) -> Result<(), fidl::Error>;
169 type GetLatestAppliedConfigStampResponseFut: std::future::Future<Output = Result<ConfigStamp, fidl::Error>>
170 + Send;
171 fn r#get_latest_applied_config_stamp(&self) -> Self::GetLatestAppliedConfigStampResponseFut;
172 fn r#apply_config3(&self, payload: CoordinatorApplyConfig3Request) -> Result<(), fidl::Error>;
173 fn r#acknowledge_vsync(&self, cookie: u64) -> Result<(), fidl::Error>;
174 fn r#set_virtcon_mode(&self, mode: VirtconMode) -> Result<(), fidl::Error>;
175 type ImportBufferCollectionResponseFut: std::future::Future<Output = Result<CoordinatorImportBufferCollectionResult, fidl::Error>>
176 + Send;
177 fn r#import_buffer_collection(
178 &self,
179 buffer_collection_id: &BufferCollectionId,
180 buffer_collection_token: fidl::endpoints::ClientEnd<
181 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
182 >,
183 ) -> Self::ImportBufferCollectionResponseFut;
184 fn r#release_buffer_collection(
185 &self,
186 buffer_collection_id: &BufferCollectionId,
187 ) -> Result<(), fidl::Error>;
188 type SetBufferCollectionConstraintsResponseFut: std::future::Future<
189 Output = Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error>,
190 > + Send;
191 fn r#set_buffer_collection_constraints(
192 &self,
193 buffer_collection_id: &BufferCollectionId,
194 buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
195 ) -> Self::SetBufferCollectionConstraintsResponseFut;
196 type IsCaptureSupportedResponseFut: std::future::Future<Output = Result<CoordinatorIsCaptureSupportedResult, fidl::Error>>
197 + Send;
198 fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut;
199 type StartCaptureResponseFut: std::future::Future<Output = Result<CoordinatorStartCaptureResult, fidl::Error>>
200 + Send;
201 fn r#start_capture(
202 &self,
203 signal_event_id: &EventId,
204 image_id: &ImageId,
205 ) -> Self::StartCaptureResponseFut;
206 type SetMinimumRgbResponseFut: std::future::Future<Output = Result<CoordinatorSetMinimumRgbResult, fidl::Error>>
207 + Send;
208 fn r#set_minimum_rgb(&self, minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut;
209 type SetDisplayPowerModeResponseFut: std::future::Future<Output = Result<CoordinatorSetDisplayPowerModeResult, fidl::Error>>
210 + Send;
211 fn r#set_display_power_mode(
212 &self,
213 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
214 power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
215 ) -> Self::SetDisplayPowerModeResponseFut;
216}
217#[derive(Debug)]
218#[cfg(target_os = "fuchsia")]
219pub struct CoordinatorSynchronousProxy {
220 client: fidl::client::sync::Client,
221}
222
223#[cfg(target_os = "fuchsia")]
224impl fidl::endpoints::SynchronousProxy for CoordinatorSynchronousProxy {
225 type Proxy = CoordinatorProxy;
226 type Protocol = CoordinatorMarker;
227
228 fn from_channel(inner: fidl::Channel) -> Self {
229 Self::new(inner)
230 }
231
232 fn into_channel(self) -> fidl::Channel {
233 self.client.into_channel()
234 }
235
236 fn as_channel(&self) -> &fidl::Channel {
237 self.client.as_channel()
238 }
239}
240
241#[cfg(target_os = "fuchsia")]
242impl CoordinatorSynchronousProxy {
243 pub fn new(channel: fidl::Channel) -> Self {
244 let protocol_name = <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
245 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
246 }
247
248 pub fn into_channel(self) -> fidl::Channel {
249 self.client.into_channel()
250 }
251
252 pub fn wait_for_event(
255 &self,
256 deadline: zx::MonotonicInstant,
257 ) -> Result<CoordinatorEvent, fidl::Error> {
258 CoordinatorEvent::decode(self.client.wait_for_event(deadline)?)
259 }
260
261 pub fn r#import_image(
271 &self,
272 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
273 mut buffer_collection_id: &BufferCollectionId,
274 mut buffer_index: u32,
275 mut image_id: &ImageId,
276 ___deadline: zx::MonotonicInstant,
277 ) -> Result<CoordinatorImportImageResult, fidl::Error> {
278 let _response = self.client.send_query::<
279 CoordinatorImportImageRequest,
280 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
281 >(
282 (image_metadata, buffer_collection_id, buffer_index, image_id,),
283 0x3a8636eb9656b4f4,
284 fidl::encoding::DynamicFlags::empty(),
285 ___deadline,
286 )?;
287 Ok(_response.map(|x| x))
288 }
289
290 pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
303 self.client.send::<CoordinatorReleaseImageRequest>(
304 (image_id,),
305 0x477192230517504,
306 fidl::encoding::DynamicFlags::empty(),
307 )
308 }
309
310 pub fn r#import_event(
319 &self,
320 mut event: fidl::Event,
321 mut id: &EventId,
322 ) -> Result<(), fidl::Error> {
323 self.client.send::<CoordinatorImportEventRequest>(
324 (event, id),
325 0x2864e5dc59390543,
326 fidl::encoding::DynamicFlags::empty(),
327 )
328 }
329
330 pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
337 self.client.send::<CoordinatorReleaseEventRequest>(
338 (id,),
339 0x32508c2101606b87,
340 fidl::encoding::DynamicFlags::empty(),
341 )
342 }
343
344 pub fn r#create_layer(
352 &self,
353 ___deadline: zx::MonotonicInstant,
354 ) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
355 let _response = self.client.send_query::<
356 fidl::encoding::EmptyPayload,
357 fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>,
358 >(
359 (),
360 0x2137cfd788a3496b,
361 fidl::encoding::DynamicFlags::empty(),
362 ___deadline,
363 )?;
364 Ok(_response.map(|x| x.layer_id))
365 }
366
367 pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
371 self.client.send::<CoordinatorDestroyLayerRequest>(
372 (layer_id,),
373 0x386e12d092bea2f8,
374 fidl::encoding::DynamicFlags::empty(),
375 )
376 }
377
378 pub fn r#set_display_mode(
380 &self,
381 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
382 mut mode: &fidl_fuchsia_hardware_display_types::Mode,
383 ) -> Result<(), fidl::Error> {
384 self.client.send::<CoordinatorSetDisplayModeRequest>(
385 (display_id, mode),
386 0xbde3c59ee9c1777,
387 fidl::encoding::DynamicFlags::empty(),
388 )
389 }
390
391 pub fn r#set_display_color_conversion(
418 &self,
419 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
420 mut preoffsets: &[f32; 3],
421 mut coefficients: &[f32; 9],
422 mut postoffsets: &[f32; 3],
423 ) -> Result<(), fidl::Error> {
424 self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
425 (display_id, preoffsets, coefficients, postoffsets),
426 0x2f18186a987d51aa,
427 fidl::encoding::DynamicFlags::empty(),
428 )
429 }
430
431 pub fn r#set_display_layers(
433 &self,
434 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
435 mut layer_ids: &[LayerId],
436 ) -> Result<(), fidl::Error> {
437 self.client.send::<CoordinatorSetDisplayLayersRequest>(
438 (display_id, layer_ids),
439 0x190e0f6f93be1d89,
440 fidl::encoding::DynamicFlags::empty(),
441 )
442 }
443
444 pub fn r#set_layer_primary_config(
453 &self,
454 mut layer_id: &LayerId,
455 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
456 ) -> Result<(), fidl::Error> {
457 self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
458 (layer_id, image_metadata),
459 0x68d89ebd518b45b9,
460 fidl::encoding::DynamicFlags::empty(),
461 )
462 }
463
464 pub fn r#set_layer_primary_position(
472 &self,
473 mut layer_id: &LayerId,
474 mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
475 mut image_source: &fidl_fuchsia_math::RectU,
476 mut display_destination: &fidl_fuchsia_math::RectU,
477 ) -> Result<(), fidl::Error> {
478 self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
479 (layer_id, image_source_transformation, image_source, display_destination),
480 0x27b192b5a43851e2,
481 fidl::encoding::DynamicFlags::empty(),
482 )
483 }
484
485 pub fn r#set_layer_primary_alpha(
501 &self,
502 mut layer_id: &LayerId,
503 mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
504 mut val: f32,
505 ) -> Result<(), fidl::Error> {
506 self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
507 (layer_id, mode, val),
508 0x104cf2b18b27296d,
509 fidl::encoding::DynamicFlags::empty(),
510 )
511 }
512
513 pub fn r#set_layer_color_config(
517 &self,
518 mut layer_id: &LayerId,
519 mut color: &fidl_fuchsia_hardware_display_types::Color,
520 mut display_destination: &fidl_fuchsia_math::RectU,
521 ) -> Result<(), fidl::Error> {
522 self.client.send::<CoordinatorSetLayerColorConfigRequest>(
523 (layer_id, color, display_destination),
524 0x2fa91e9a2a01875f,
525 fidl::encoding::DynamicFlags::empty(),
526 )
527 }
528
529 pub fn r#set_layer_image2(
568 &self,
569 mut layer_id: &LayerId,
570 mut image_id: &ImageId,
571 mut wait_event_id: &EventId,
572 ) -> Result<(), fidl::Error> {
573 self.client.send::<CoordinatorSetLayerImage2Request>(
574 (layer_id, image_id, wait_event_id),
575 0x53c6376dfc13a971,
576 fidl::encoding::DynamicFlags::empty(),
577 )
578 }
579
580 pub fn r#check_config(
589 &self,
590 ___deadline: zx::MonotonicInstant,
591 ) -> Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error> {
592 let _response = self
593 .client
594 .send_query::<fidl::encoding::EmptyPayload, CoordinatorCheckConfigResponse>(
595 (),
596 0x2bcfb4eb16878158,
597 fidl::encoding::DynamicFlags::empty(),
598 ___deadline,
599 )?;
600 Ok(_response.res)
601 }
602
603 pub fn r#discard_config(&self) -> Result<(), fidl::Error> {
605 self.client.send::<fidl::encoding::EmptyPayload>(
606 (),
607 0x1673399e9231dedf,
608 fidl::encoding::DynamicFlags::empty(),
609 )
610 }
611
612 pub fn r#get_latest_applied_config_stamp(
618 &self,
619 ___deadline: zx::MonotonicInstant,
620 ) -> Result<ConfigStamp, fidl::Error> {
621 let _response = self.client.send_query::<
622 fidl::encoding::EmptyPayload,
623 CoordinatorGetLatestAppliedConfigStampResponse,
624 >(
625 (),
626 0x76a50c0537265f65,
627 fidl::encoding::DynamicFlags::empty(),
628 ___deadline,
629 )?;
630 Ok(_response.stamp)
631 }
632
633 pub fn r#apply_config3(
640 &self,
641 mut payload: CoordinatorApplyConfig3Request,
642 ) -> Result<(), fidl::Error> {
643 self.client.send::<CoordinatorApplyConfig3Request>(
644 &mut payload,
645 0x7f0fe0e4f062a67e,
646 fidl::encoding::DynamicFlags::empty(),
647 )
648 }
649
650 pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
652 self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
653 (cookie,),
654 0x25e921d26107d6ef,
655 fidl::encoding::DynamicFlags::empty(),
656 )
657 }
658
659 pub fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
663 self.client.send::<CoordinatorSetVirtconModeRequest>(
664 (mode,),
665 0x4fe0721526068f00,
666 fidl::encoding::DynamicFlags::empty(),
667 )
668 }
669
670 pub fn r#import_buffer_collection(
673 &self,
674 mut buffer_collection_id: &BufferCollectionId,
675 mut buffer_collection_token: fidl::endpoints::ClientEnd<
676 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
677 >,
678 ___deadline: zx::MonotonicInstant,
679 ) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
680 let _response = self.client.send_query::<
681 CoordinatorImportBufferCollectionRequest,
682 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
683 >(
684 (buffer_collection_id, buffer_collection_token,),
685 0x30d06f510e7f4601,
686 fidl::encoding::DynamicFlags::empty(),
687 ___deadline,
688 )?;
689 Ok(_response.map(|x| x))
690 }
691
692 pub fn r#release_buffer_collection(
694 &self,
695 mut buffer_collection_id: &BufferCollectionId,
696 ) -> Result<(), fidl::Error> {
697 self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
698 (buffer_collection_id,),
699 0x1c7dd5f8b0690be0,
700 fidl::encoding::DynamicFlags::empty(),
701 )
702 }
703
704 pub fn r#set_buffer_collection_constraints(
707 &self,
708 mut buffer_collection_id: &BufferCollectionId,
709 mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
710 ___deadline: zx::MonotonicInstant,
711 ) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
712 let _response = self.client.send_query::<
713 CoordinatorSetBufferCollectionConstraintsRequest,
714 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
715 >(
716 (buffer_collection_id, buffer_usage,),
717 0x509a4ee9af6035df,
718 fidl::encoding::DynamicFlags::empty(),
719 ___deadline,
720 )?;
721 Ok(_response.map(|x| x))
722 }
723
724 pub fn r#is_capture_supported(
726 &self,
727 ___deadline: zx::MonotonicInstant,
728 ) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
729 let _response = self.client.send_query::<
730 fidl::encoding::EmptyPayload,
731 fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
732 >(
733 (),
734 0x4ca407277277971b,
735 fidl::encoding::DynamicFlags::empty(),
736 ___deadline,
737 )?;
738 Ok(_response.map(|x| x.supported))
739 }
740
741 pub fn r#start_capture(
747 &self,
748 mut signal_event_id: &EventId,
749 mut image_id: &ImageId,
750 ___deadline: zx::MonotonicInstant,
751 ) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
752 let _response = self.client.send_query::<
753 CoordinatorStartCaptureRequest,
754 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
755 >(
756 (signal_event_id, image_id,),
757 0x35cb38f19d96a8db,
758 fidl::encoding::DynamicFlags::empty(),
759 ___deadline,
760 )?;
761 Ok(_response.map(|x| x))
762 }
763
764 pub fn r#set_minimum_rgb(
775 &self,
776 mut minimum_rgb: u8,
777 ___deadline: zx::MonotonicInstant,
778 ) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
779 let _response = self.client.send_query::<
780 CoordinatorSetMinimumRgbRequest,
781 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
782 >(
783 (minimum_rgb,),
784 0x1b49251437038b0b,
785 fidl::encoding::DynamicFlags::empty(),
786 ___deadline,
787 )?;
788 Ok(_response.map(|x| x))
789 }
790
791 pub fn r#set_display_power_mode(
808 &self,
809 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
810 mut power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
811 ___deadline: zx::MonotonicInstant,
812 ) -> Result<CoordinatorSetDisplayPowerModeResult, fidl::Error> {
813 let _response = self.client.send_query::<
814 CoordinatorSetDisplayPowerModeRequest,
815 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
816 >(
817 (display_id, power_mode,),
818 0xf4672f055072c92,
819 fidl::encoding::DynamicFlags::empty(),
820 ___deadline,
821 )?;
822 Ok(_response.map(|x| x))
823 }
824}
825
826#[cfg(target_os = "fuchsia")]
827impl From<CoordinatorSynchronousProxy> for zx::NullableHandle {
828 fn from(value: CoordinatorSynchronousProxy) -> Self {
829 value.into_channel().into()
830 }
831}
832
833#[cfg(target_os = "fuchsia")]
834impl From<fidl::Channel> for CoordinatorSynchronousProxy {
835 fn from(value: fidl::Channel) -> Self {
836 Self::new(value)
837 }
838}
839
840#[cfg(target_os = "fuchsia")]
841impl fidl::endpoints::FromClient for CoordinatorSynchronousProxy {
842 type Protocol = CoordinatorMarker;
843
844 fn from_client(value: fidl::endpoints::ClientEnd<CoordinatorMarker>) -> Self {
845 Self::new(value.into_channel())
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 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 pub fn take_event_stream(&self) -> CoordinatorEventStream {
883 CoordinatorEventStream { event_receiver: self.client.take_event_receiver() }
884 }
885
886 pub fn r#import_image(
896 &self,
897 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
898 mut buffer_collection_id: &BufferCollectionId,
899 mut buffer_index: u32,
900 mut image_id: &ImageId,
901 ) -> fidl::client::QueryResponseFut<
902 CoordinatorImportImageResult,
903 fidl::encoding::DefaultFuchsiaResourceDialect,
904 > {
905 CoordinatorProxyInterface::r#import_image(
906 self,
907 image_metadata,
908 buffer_collection_id,
909 buffer_index,
910 image_id,
911 )
912 }
913
914 pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
927 CoordinatorProxyInterface::r#release_image(self, image_id)
928 }
929
930 pub fn r#import_event(
939 &self,
940 mut event: fidl::Event,
941 mut id: &EventId,
942 ) -> Result<(), fidl::Error> {
943 CoordinatorProxyInterface::r#import_event(self, event, id)
944 }
945
946 pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
953 CoordinatorProxyInterface::r#release_event(self, id)
954 }
955
956 pub fn r#create_layer(
964 &self,
965 ) -> fidl::client::QueryResponseFut<
966 CoordinatorCreateLayerResult,
967 fidl::encoding::DefaultFuchsiaResourceDialect,
968 > {
969 CoordinatorProxyInterface::r#create_layer(self)
970 }
971
972 pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
976 CoordinatorProxyInterface::r#destroy_layer(self, layer_id)
977 }
978
979 pub fn r#set_display_mode(
981 &self,
982 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
983 mut mode: &fidl_fuchsia_hardware_display_types::Mode,
984 ) -> Result<(), fidl::Error> {
985 CoordinatorProxyInterface::r#set_display_mode(self, display_id, mode)
986 }
987
988 pub fn r#set_display_color_conversion(
1015 &self,
1016 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1017 mut preoffsets: &[f32; 3],
1018 mut coefficients: &[f32; 9],
1019 mut postoffsets: &[f32; 3],
1020 ) -> Result<(), fidl::Error> {
1021 CoordinatorProxyInterface::r#set_display_color_conversion(
1022 self,
1023 display_id,
1024 preoffsets,
1025 coefficients,
1026 postoffsets,
1027 )
1028 }
1029
1030 pub fn r#set_display_layers(
1032 &self,
1033 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1034 mut layer_ids: &[LayerId],
1035 ) -> Result<(), fidl::Error> {
1036 CoordinatorProxyInterface::r#set_display_layers(self, display_id, layer_ids)
1037 }
1038
1039 pub fn r#set_layer_primary_config(
1048 &self,
1049 mut layer_id: &LayerId,
1050 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1051 ) -> Result<(), fidl::Error> {
1052 CoordinatorProxyInterface::r#set_layer_primary_config(self, layer_id, image_metadata)
1053 }
1054
1055 pub fn r#set_layer_primary_position(
1063 &self,
1064 mut layer_id: &LayerId,
1065 mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
1066 mut image_source: &fidl_fuchsia_math::RectU,
1067 mut display_destination: &fidl_fuchsia_math::RectU,
1068 ) -> Result<(), fidl::Error> {
1069 CoordinatorProxyInterface::r#set_layer_primary_position(
1070 self,
1071 layer_id,
1072 image_source_transformation,
1073 image_source,
1074 display_destination,
1075 )
1076 }
1077
1078 pub fn r#set_layer_primary_alpha(
1094 &self,
1095 mut layer_id: &LayerId,
1096 mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
1097 mut val: f32,
1098 ) -> Result<(), fidl::Error> {
1099 CoordinatorProxyInterface::r#set_layer_primary_alpha(self, layer_id, mode, val)
1100 }
1101
1102 pub fn r#set_layer_color_config(
1106 &self,
1107 mut layer_id: &LayerId,
1108 mut color: &fidl_fuchsia_hardware_display_types::Color,
1109 mut display_destination: &fidl_fuchsia_math::RectU,
1110 ) -> Result<(), fidl::Error> {
1111 CoordinatorProxyInterface::r#set_layer_color_config(
1112 self,
1113 layer_id,
1114 color,
1115 display_destination,
1116 )
1117 }
1118
1119 pub fn r#set_layer_image2(
1158 &self,
1159 mut layer_id: &LayerId,
1160 mut image_id: &ImageId,
1161 mut wait_event_id: &EventId,
1162 ) -> Result<(), fidl::Error> {
1163 CoordinatorProxyInterface::r#set_layer_image2(self, layer_id, image_id, wait_event_id)
1164 }
1165
1166 pub fn r#check_config(
1175 &self,
1176 ) -> fidl::client::QueryResponseFut<
1177 fidl_fuchsia_hardware_display_types::ConfigResult,
1178 fidl::encoding::DefaultFuchsiaResourceDialect,
1179 > {
1180 CoordinatorProxyInterface::r#check_config(self)
1181 }
1182
1183 pub fn r#discard_config(&self) -> Result<(), fidl::Error> {
1185 CoordinatorProxyInterface::r#discard_config(self)
1186 }
1187
1188 pub fn r#get_latest_applied_config_stamp(
1194 &self,
1195 ) -> fidl::client::QueryResponseFut<ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>
1196 {
1197 CoordinatorProxyInterface::r#get_latest_applied_config_stamp(self)
1198 }
1199
1200 pub fn r#apply_config3(
1207 &self,
1208 mut payload: CoordinatorApplyConfig3Request,
1209 ) -> Result<(), fidl::Error> {
1210 CoordinatorProxyInterface::r#apply_config3(self, payload)
1211 }
1212
1213 pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
1215 CoordinatorProxyInterface::r#acknowledge_vsync(self, cookie)
1216 }
1217
1218 pub fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
1222 CoordinatorProxyInterface::r#set_virtcon_mode(self, mode)
1223 }
1224
1225 pub fn r#import_buffer_collection(
1228 &self,
1229 mut buffer_collection_id: &BufferCollectionId,
1230 mut buffer_collection_token: fidl::endpoints::ClientEnd<
1231 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
1232 >,
1233 ) -> fidl::client::QueryResponseFut<
1234 CoordinatorImportBufferCollectionResult,
1235 fidl::encoding::DefaultFuchsiaResourceDialect,
1236 > {
1237 CoordinatorProxyInterface::r#import_buffer_collection(
1238 self,
1239 buffer_collection_id,
1240 buffer_collection_token,
1241 )
1242 }
1243
1244 pub fn r#release_buffer_collection(
1246 &self,
1247 mut buffer_collection_id: &BufferCollectionId,
1248 ) -> Result<(), fidl::Error> {
1249 CoordinatorProxyInterface::r#release_buffer_collection(self, buffer_collection_id)
1250 }
1251
1252 pub fn r#set_buffer_collection_constraints(
1255 &self,
1256 mut buffer_collection_id: &BufferCollectionId,
1257 mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
1258 ) -> fidl::client::QueryResponseFut<
1259 CoordinatorSetBufferCollectionConstraintsResult,
1260 fidl::encoding::DefaultFuchsiaResourceDialect,
1261 > {
1262 CoordinatorProxyInterface::r#set_buffer_collection_constraints(
1263 self,
1264 buffer_collection_id,
1265 buffer_usage,
1266 )
1267 }
1268
1269 pub fn r#is_capture_supported(
1271 &self,
1272 ) -> fidl::client::QueryResponseFut<
1273 CoordinatorIsCaptureSupportedResult,
1274 fidl::encoding::DefaultFuchsiaResourceDialect,
1275 > {
1276 CoordinatorProxyInterface::r#is_capture_supported(self)
1277 }
1278
1279 pub fn r#start_capture(
1285 &self,
1286 mut signal_event_id: &EventId,
1287 mut image_id: &ImageId,
1288 ) -> fidl::client::QueryResponseFut<
1289 CoordinatorStartCaptureResult,
1290 fidl::encoding::DefaultFuchsiaResourceDialect,
1291 > {
1292 CoordinatorProxyInterface::r#start_capture(self, signal_event_id, image_id)
1293 }
1294
1295 pub fn r#set_minimum_rgb(
1306 &self,
1307 mut minimum_rgb: u8,
1308 ) -> fidl::client::QueryResponseFut<
1309 CoordinatorSetMinimumRgbResult,
1310 fidl::encoding::DefaultFuchsiaResourceDialect,
1311 > {
1312 CoordinatorProxyInterface::r#set_minimum_rgb(self, minimum_rgb)
1313 }
1314
1315 pub fn r#set_display_power_mode(
1332 &self,
1333 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1334 mut power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
1335 ) -> fidl::client::QueryResponseFut<
1336 CoordinatorSetDisplayPowerModeResult,
1337 fidl::encoding::DefaultFuchsiaResourceDialect,
1338 > {
1339 CoordinatorProxyInterface::r#set_display_power_mode(self, display_id, power_mode)
1340 }
1341}
1342
1343impl CoordinatorProxyInterface for CoordinatorProxy {
1344 type ImportImageResponseFut = fidl::client::QueryResponseFut<
1345 CoordinatorImportImageResult,
1346 fidl::encoding::DefaultFuchsiaResourceDialect,
1347 >;
1348 fn r#import_image(
1349 &self,
1350 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1351 mut buffer_collection_id: &BufferCollectionId,
1352 mut buffer_index: u32,
1353 mut image_id: &ImageId,
1354 ) -> Self::ImportImageResponseFut {
1355 fn _decode(
1356 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1357 ) -> Result<CoordinatorImportImageResult, fidl::Error> {
1358 let _response = fidl::client::decode_transaction_body::<
1359 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1360 fidl::encoding::DefaultFuchsiaResourceDialect,
1361 0x3a8636eb9656b4f4,
1362 >(_buf?)?;
1363 Ok(_response.map(|x| x))
1364 }
1365 self.client
1366 .send_query_and_decode::<CoordinatorImportImageRequest, CoordinatorImportImageResult>(
1367 (image_metadata, buffer_collection_id, buffer_index, image_id),
1368 0x3a8636eb9656b4f4,
1369 fidl::encoding::DynamicFlags::empty(),
1370 _decode,
1371 )
1372 }
1373
1374 fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
1375 self.client.send::<CoordinatorReleaseImageRequest>(
1376 (image_id,),
1377 0x477192230517504,
1378 fidl::encoding::DynamicFlags::empty(),
1379 )
1380 }
1381
1382 fn r#import_event(&self, mut event: fidl::Event, mut id: &EventId) -> Result<(), fidl::Error> {
1383 self.client.send::<CoordinatorImportEventRequest>(
1384 (event, id),
1385 0x2864e5dc59390543,
1386 fidl::encoding::DynamicFlags::empty(),
1387 )
1388 }
1389
1390 fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
1391 self.client.send::<CoordinatorReleaseEventRequest>(
1392 (id,),
1393 0x32508c2101606b87,
1394 fidl::encoding::DynamicFlags::empty(),
1395 )
1396 }
1397
1398 type CreateLayerResponseFut = fidl::client::QueryResponseFut<
1399 CoordinatorCreateLayerResult,
1400 fidl::encoding::DefaultFuchsiaResourceDialect,
1401 >;
1402 fn r#create_layer(&self) -> Self::CreateLayerResponseFut {
1403 fn _decode(
1404 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1405 ) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
1406 let _response = fidl::client::decode_transaction_body::<
1407 fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>,
1408 fidl::encoding::DefaultFuchsiaResourceDialect,
1409 0x2137cfd788a3496b,
1410 >(_buf?)?;
1411 Ok(_response.map(|x| x.layer_id))
1412 }
1413 self.client
1414 .send_query_and_decode::<fidl::encoding::EmptyPayload, CoordinatorCreateLayerResult>(
1415 (),
1416 0x2137cfd788a3496b,
1417 fidl::encoding::DynamicFlags::empty(),
1418 _decode,
1419 )
1420 }
1421
1422 fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
1423 self.client.send::<CoordinatorDestroyLayerRequest>(
1424 (layer_id,),
1425 0x386e12d092bea2f8,
1426 fidl::encoding::DynamicFlags::empty(),
1427 )
1428 }
1429
1430 fn r#set_display_mode(
1431 &self,
1432 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1433 mut mode: &fidl_fuchsia_hardware_display_types::Mode,
1434 ) -> Result<(), fidl::Error> {
1435 self.client.send::<CoordinatorSetDisplayModeRequest>(
1436 (display_id, mode),
1437 0xbde3c59ee9c1777,
1438 fidl::encoding::DynamicFlags::empty(),
1439 )
1440 }
1441
1442 fn r#set_display_color_conversion(
1443 &self,
1444 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1445 mut preoffsets: &[f32; 3],
1446 mut coefficients: &[f32; 9],
1447 mut postoffsets: &[f32; 3],
1448 ) -> Result<(), fidl::Error> {
1449 self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
1450 (display_id, preoffsets, coefficients, postoffsets),
1451 0x2f18186a987d51aa,
1452 fidl::encoding::DynamicFlags::empty(),
1453 )
1454 }
1455
1456 fn r#set_display_layers(
1457 &self,
1458 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1459 mut layer_ids: &[LayerId],
1460 ) -> Result<(), fidl::Error> {
1461 self.client.send::<CoordinatorSetDisplayLayersRequest>(
1462 (display_id, layer_ids),
1463 0x190e0f6f93be1d89,
1464 fidl::encoding::DynamicFlags::empty(),
1465 )
1466 }
1467
1468 fn r#set_layer_primary_config(
1469 &self,
1470 mut layer_id: &LayerId,
1471 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1472 ) -> Result<(), fidl::Error> {
1473 self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
1474 (layer_id, image_metadata),
1475 0x68d89ebd518b45b9,
1476 fidl::encoding::DynamicFlags::empty(),
1477 )
1478 }
1479
1480 fn r#set_layer_primary_position(
1481 &self,
1482 mut layer_id: &LayerId,
1483 mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
1484 mut image_source: &fidl_fuchsia_math::RectU,
1485 mut display_destination: &fidl_fuchsia_math::RectU,
1486 ) -> Result<(), fidl::Error> {
1487 self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
1488 (layer_id, image_source_transformation, image_source, display_destination),
1489 0x27b192b5a43851e2,
1490 fidl::encoding::DynamicFlags::empty(),
1491 )
1492 }
1493
1494 fn r#set_layer_primary_alpha(
1495 &self,
1496 mut layer_id: &LayerId,
1497 mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
1498 mut val: f32,
1499 ) -> Result<(), fidl::Error> {
1500 self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
1501 (layer_id, mode, val),
1502 0x104cf2b18b27296d,
1503 fidl::encoding::DynamicFlags::empty(),
1504 )
1505 }
1506
1507 fn r#set_layer_color_config(
1508 &self,
1509 mut layer_id: &LayerId,
1510 mut color: &fidl_fuchsia_hardware_display_types::Color,
1511 mut display_destination: &fidl_fuchsia_math::RectU,
1512 ) -> Result<(), fidl::Error> {
1513 self.client.send::<CoordinatorSetLayerColorConfigRequest>(
1514 (layer_id, color, display_destination),
1515 0x2fa91e9a2a01875f,
1516 fidl::encoding::DynamicFlags::empty(),
1517 )
1518 }
1519
1520 fn r#set_layer_image2(
1521 &self,
1522 mut layer_id: &LayerId,
1523 mut image_id: &ImageId,
1524 mut wait_event_id: &EventId,
1525 ) -> Result<(), fidl::Error> {
1526 self.client.send::<CoordinatorSetLayerImage2Request>(
1527 (layer_id, image_id, wait_event_id),
1528 0x53c6376dfc13a971,
1529 fidl::encoding::DynamicFlags::empty(),
1530 )
1531 }
1532
1533 type CheckConfigResponseFut = fidl::client::QueryResponseFut<
1534 fidl_fuchsia_hardware_display_types::ConfigResult,
1535 fidl::encoding::DefaultFuchsiaResourceDialect,
1536 >;
1537 fn r#check_config(&self) -> Self::CheckConfigResponseFut {
1538 fn _decode(
1539 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1540 ) -> Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error> {
1541 let _response = fidl::client::decode_transaction_body::<
1542 CoordinatorCheckConfigResponse,
1543 fidl::encoding::DefaultFuchsiaResourceDialect,
1544 0x2bcfb4eb16878158,
1545 >(_buf?)?;
1546 Ok(_response.res)
1547 }
1548 self.client.send_query_and_decode::<
1549 fidl::encoding::EmptyPayload,
1550 fidl_fuchsia_hardware_display_types::ConfigResult,
1551 >(
1552 (),
1553 0x2bcfb4eb16878158,
1554 fidl::encoding::DynamicFlags::empty(),
1555 _decode,
1556 )
1557 }
1558
1559 fn r#discard_config(&self) -> Result<(), fidl::Error> {
1560 self.client.send::<fidl::encoding::EmptyPayload>(
1561 (),
1562 0x1673399e9231dedf,
1563 fidl::encoding::DynamicFlags::empty(),
1564 )
1565 }
1566
1567 type GetLatestAppliedConfigStampResponseFut =
1568 fidl::client::QueryResponseFut<ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1569 fn r#get_latest_applied_config_stamp(&self) -> Self::GetLatestAppliedConfigStampResponseFut {
1570 fn _decode(
1571 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1572 ) -> Result<ConfigStamp, fidl::Error> {
1573 let _response = fidl::client::decode_transaction_body::<
1574 CoordinatorGetLatestAppliedConfigStampResponse,
1575 fidl::encoding::DefaultFuchsiaResourceDialect,
1576 0x76a50c0537265f65,
1577 >(_buf?)?;
1578 Ok(_response.stamp)
1579 }
1580 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConfigStamp>(
1581 (),
1582 0x76a50c0537265f65,
1583 fidl::encoding::DynamicFlags::empty(),
1584 _decode,
1585 )
1586 }
1587
1588 fn r#apply_config3(
1589 &self,
1590 mut payload: CoordinatorApplyConfig3Request,
1591 ) -> Result<(), fidl::Error> {
1592 self.client.send::<CoordinatorApplyConfig3Request>(
1593 &mut payload,
1594 0x7f0fe0e4f062a67e,
1595 fidl::encoding::DynamicFlags::empty(),
1596 )
1597 }
1598
1599 fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
1600 self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
1601 (cookie,),
1602 0x25e921d26107d6ef,
1603 fidl::encoding::DynamicFlags::empty(),
1604 )
1605 }
1606
1607 fn r#set_virtcon_mode(&self, mut mode: VirtconMode) -> Result<(), fidl::Error> {
1608 self.client.send::<CoordinatorSetVirtconModeRequest>(
1609 (mode,),
1610 0x4fe0721526068f00,
1611 fidl::encoding::DynamicFlags::empty(),
1612 )
1613 }
1614
1615 type ImportBufferCollectionResponseFut = fidl::client::QueryResponseFut<
1616 CoordinatorImportBufferCollectionResult,
1617 fidl::encoding::DefaultFuchsiaResourceDialect,
1618 >;
1619 fn r#import_buffer_collection(
1620 &self,
1621 mut buffer_collection_id: &BufferCollectionId,
1622 mut buffer_collection_token: fidl::endpoints::ClientEnd<
1623 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
1624 >,
1625 ) -> Self::ImportBufferCollectionResponseFut {
1626 fn _decode(
1627 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1628 ) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
1629 let _response = fidl::client::decode_transaction_body::<
1630 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1631 fidl::encoding::DefaultFuchsiaResourceDialect,
1632 0x30d06f510e7f4601,
1633 >(_buf?)?;
1634 Ok(_response.map(|x| x))
1635 }
1636 self.client.send_query_and_decode::<
1637 CoordinatorImportBufferCollectionRequest,
1638 CoordinatorImportBufferCollectionResult,
1639 >(
1640 (buffer_collection_id, buffer_collection_token,),
1641 0x30d06f510e7f4601,
1642 fidl::encoding::DynamicFlags::empty(),
1643 _decode,
1644 )
1645 }
1646
1647 fn r#release_buffer_collection(
1648 &self,
1649 mut buffer_collection_id: &BufferCollectionId,
1650 ) -> Result<(), fidl::Error> {
1651 self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
1652 (buffer_collection_id,),
1653 0x1c7dd5f8b0690be0,
1654 fidl::encoding::DynamicFlags::empty(),
1655 )
1656 }
1657
1658 type SetBufferCollectionConstraintsResponseFut = fidl::client::QueryResponseFut<
1659 CoordinatorSetBufferCollectionConstraintsResult,
1660 fidl::encoding::DefaultFuchsiaResourceDialect,
1661 >;
1662 fn r#set_buffer_collection_constraints(
1663 &self,
1664 mut buffer_collection_id: &BufferCollectionId,
1665 mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
1666 ) -> Self::SetBufferCollectionConstraintsResponseFut {
1667 fn _decode(
1668 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1669 ) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
1670 let _response = fidl::client::decode_transaction_body::<
1671 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1672 fidl::encoding::DefaultFuchsiaResourceDialect,
1673 0x509a4ee9af6035df,
1674 >(_buf?)?;
1675 Ok(_response.map(|x| x))
1676 }
1677 self.client.send_query_and_decode::<
1678 CoordinatorSetBufferCollectionConstraintsRequest,
1679 CoordinatorSetBufferCollectionConstraintsResult,
1680 >(
1681 (buffer_collection_id, buffer_usage,),
1682 0x509a4ee9af6035df,
1683 fidl::encoding::DynamicFlags::empty(),
1684 _decode,
1685 )
1686 }
1687
1688 type IsCaptureSupportedResponseFut = fidl::client::QueryResponseFut<
1689 CoordinatorIsCaptureSupportedResult,
1690 fidl::encoding::DefaultFuchsiaResourceDialect,
1691 >;
1692 fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut {
1693 fn _decode(
1694 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1695 ) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
1696 let _response = fidl::client::decode_transaction_body::<
1697 fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
1698 fidl::encoding::DefaultFuchsiaResourceDialect,
1699 0x4ca407277277971b,
1700 >(_buf?)?;
1701 Ok(_response.map(|x| x.supported))
1702 }
1703 self.client.send_query_and_decode::<
1704 fidl::encoding::EmptyPayload,
1705 CoordinatorIsCaptureSupportedResult,
1706 >(
1707 (),
1708 0x4ca407277277971b,
1709 fidl::encoding::DynamicFlags::empty(),
1710 _decode,
1711 )
1712 }
1713
1714 type StartCaptureResponseFut = fidl::client::QueryResponseFut<
1715 CoordinatorStartCaptureResult,
1716 fidl::encoding::DefaultFuchsiaResourceDialect,
1717 >;
1718 fn r#start_capture(
1719 &self,
1720 mut signal_event_id: &EventId,
1721 mut image_id: &ImageId,
1722 ) -> Self::StartCaptureResponseFut {
1723 fn _decode(
1724 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1725 ) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
1726 let _response = fidl::client::decode_transaction_body::<
1727 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1728 fidl::encoding::DefaultFuchsiaResourceDialect,
1729 0x35cb38f19d96a8db,
1730 >(_buf?)?;
1731 Ok(_response.map(|x| x))
1732 }
1733 self.client
1734 .send_query_and_decode::<CoordinatorStartCaptureRequest, CoordinatorStartCaptureResult>(
1735 (signal_event_id, image_id),
1736 0x35cb38f19d96a8db,
1737 fidl::encoding::DynamicFlags::empty(),
1738 _decode,
1739 )
1740 }
1741
1742 type SetMinimumRgbResponseFut = fidl::client::QueryResponseFut<
1743 CoordinatorSetMinimumRgbResult,
1744 fidl::encoding::DefaultFuchsiaResourceDialect,
1745 >;
1746 fn r#set_minimum_rgb(&self, mut minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut {
1747 fn _decode(
1748 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1749 ) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
1750 let _response = fidl::client::decode_transaction_body::<
1751 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1752 fidl::encoding::DefaultFuchsiaResourceDialect,
1753 0x1b49251437038b0b,
1754 >(_buf?)?;
1755 Ok(_response.map(|x| x))
1756 }
1757 self.client.send_query_and_decode::<
1758 CoordinatorSetMinimumRgbRequest,
1759 CoordinatorSetMinimumRgbResult,
1760 >(
1761 (minimum_rgb,),
1762 0x1b49251437038b0b,
1763 fidl::encoding::DynamicFlags::empty(),
1764 _decode,
1765 )
1766 }
1767
1768 type SetDisplayPowerModeResponseFut = fidl::client::QueryResponseFut<
1769 CoordinatorSetDisplayPowerModeResult,
1770 fidl::encoding::DefaultFuchsiaResourceDialect,
1771 >;
1772 fn r#set_display_power_mode(
1773 &self,
1774 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1775 mut power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
1776 ) -> Self::SetDisplayPowerModeResponseFut {
1777 fn _decode(
1778 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1779 ) -> Result<CoordinatorSetDisplayPowerModeResult, fidl::Error> {
1780 let _response = fidl::client::decode_transaction_body::<
1781 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1782 fidl::encoding::DefaultFuchsiaResourceDialect,
1783 0xf4672f055072c92,
1784 >(_buf?)?;
1785 Ok(_response.map(|x| x))
1786 }
1787 self.client.send_query_and_decode::<
1788 CoordinatorSetDisplayPowerModeRequest,
1789 CoordinatorSetDisplayPowerModeResult,
1790 >(
1791 (display_id, power_mode,),
1792 0xf4672f055072c92,
1793 fidl::encoding::DynamicFlags::empty(),
1794 _decode,
1795 )
1796 }
1797}
1798
1799pub struct CoordinatorEventStream {
1800 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1801}
1802
1803impl std::marker::Unpin for CoordinatorEventStream {}
1804
1805impl futures::stream::FusedStream for CoordinatorEventStream {
1806 fn is_terminated(&self) -> bool {
1807 self.event_receiver.is_terminated()
1808 }
1809}
1810
1811impl futures::Stream for CoordinatorEventStream {
1812 type Item = Result<CoordinatorEvent, fidl::Error>;
1813
1814 fn poll_next(
1815 mut self: std::pin::Pin<&mut Self>,
1816 cx: &mut std::task::Context<'_>,
1817 ) -> std::task::Poll<Option<Self::Item>> {
1818 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1819 &mut self.event_receiver,
1820 cx
1821 )?) {
1822 Some(buf) => std::task::Poll::Ready(Some(CoordinatorEvent::decode(buf))),
1823 None => std::task::Poll::Ready(None),
1824 }
1825 }
1826}
1827
1828#[derive(Debug)]
1829pub enum CoordinatorEvent {}
1830
1831impl CoordinatorEvent {
1832 fn decode(
1834 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1835 ) -> Result<CoordinatorEvent, fidl::Error> {
1836 let (bytes, _handles) = buf.split_mut();
1837 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1838 debug_assert_eq!(tx_header.tx_id, 0);
1839 match tx_header.ordinal {
1840 _ => Err(fidl::Error::UnknownOrdinal {
1841 ordinal: tx_header.ordinal,
1842 protocol_name: <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1843 }),
1844 }
1845 }
1846}
1847
1848pub struct CoordinatorRequestStream {
1850 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1851 is_terminated: bool,
1852}
1853
1854impl std::marker::Unpin for CoordinatorRequestStream {}
1855
1856impl futures::stream::FusedStream for CoordinatorRequestStream {
1857 fn is_terminated(&self) -> bool {
1858 self.is_terminated
1859 }
1860}
1861
1862impl fidl::endpoints::RequestStream for CoordinatorRequestStream {
1863 type Protocol = CoordinatorMarker;
1864 type ControlHandle = CoordinatorControlHandle;
1865
1866 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1867 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1868 }
1869
1870 fn control_handle(&self) -> Self::ControlHandle {
1871 CoordinatorControlHandle { inner: self.inner.clone() }
1872 }
1873
1874 fn into_inner(
1875 self,
1876 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1877 {
1878 (self.inner, self.is_terminated)
1879 }
1880
1881 fn from_inner(
1882 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1883 is_terminated: bool,
1884 ) -> Self {
1885 Self { inner, is_terminated }
1886 }
1887}
1888
1889impl futures::Stream for CoordinatorRequestStream {
1890 type Item = Result<CoordinatorRequest, fidl::Error>;
1891
1892 fn poll_next(
1893 mut self: std::pin::Pin<&mut Self>,
1894 cx: &mut std::task::Context<'_>,
1895 ) -> std::task::Poll<Option<Self::Item>> {
1896 let this = &mut *self;
1897 if this.inner.check_shutdown(cx) {
1898 this.is_terminated = true;
1899 return std::task::Poll::Ready(None);
1900 }
1901 if this.is_terminated {
1902 panic!("polled CoordinatorRequestStream after completion");
1903 }
1904 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1905 |bytes, handles| {
1906 match this.inner.channel().read_etc(cx, bytes, handles) {
1907 std::task::Poll::Ready(Ok(())) => {}
1908 std::task::Poll::Pending => return std::task::Poll::Pending,
1909 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1910 this.is_terminated = true;
1911 return std::task::Poll::Ready(None);
1912 }
1913 std::task::Poll::Ready(Err(e)) => {
1914 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1915 e.into(),
1916 ))));
1917 }
1918 }
1919
1920 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1922
1923 std::task::Poll::Ready(Some(match header.ordinal {
1924 0x3a8636eb9656b4f4 => {
1925 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1926 let mut req = fidl::new_empty!(
1927 CoordinatorImportImageRequest,
1928 fidl::encoding::DefaultFuchsiaResourceDialect
1929 );
1930 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportImageRequest>(&header, _body_bytes, handles, &mut req)?;
1931 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1932 Ok(CoordinatorRequest::ImportImage {
1933 image_metadata: req.image_metadata,
1934 buffer_collection_id: req.buffer_collection_id,
1935 buffer_index: req.buffer_index,
1936 image_id: req.image_id,
1937
1938 responder: CoordinatorImportImageResponder {
1939 control_handle: std::mem::ManuallyDrop::new(control_handle),
1940 tx_id: header.tx_id,
1941 },
1942 })
1943 }
1944 0x477192230517504 => {
1945 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1946 let mut req = fidl::new_empty!(
1947 CoordinatorReleaseImageRequest,
1948 fidl::encoding::DefaultFuchsiaResourceDialect
1949 );
1950 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseImageRequest>(&header, _body_bytes, handles, &mut req)?;
1951 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1952 Ok(CoordinatorRequest::ReleaseImage {
1953 image_id: req.image_id,
1954
1955 control_handle,
1956 })
1957 }
1958 0x2864e5dc59390543 => {
1959 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1960 let mut req = fidl::new_empty!(
1961 CoordinatorImportEventRequest,
1962 fidl::encoding::DefaultFuchsiaResourceDialect
1963 );
1964 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportEventRequest>(&header, _body_bytes, handles, &mut req)?;
1965 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1966 Ok(CoordinatorRequest::ImportEvent {
1967 event: req.event,
1968 id: req.id,
1969
1970 control_handle,
1971 })
1972 }
1973 0x32508c2101606b87 => {
1974 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1975 let mut req = fidl::new_empty!(
1976 CoordinatorReleaseEventRequest,
1977 fidl::encoding::DefaultFuchsiaResourceDialect
1978 );
1979 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseEventRequest>(&header, _body_bytes, handles, &mut req)?;
1980 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1981 Ok(CoordinatorRequest::ReleaseEvent { id: req.id, control_handle })
1982 }
1983 0x2137cfd788a3496b => {
1984 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1985 let mut req = fidl::new_empty!(
1986 fidl::encoding::EmptyPayload,
1987 fidl::encoding::DefaultFuchsiaResourceDialect
1988 );
1989 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1990 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1991 Ok(CoordinatorRequest::CreateLayer {
1992 responder: CoordinatorCreateLayerResponder {
1993 control_handle: std::mem::ManuallyDrop::new(control_handle),
1994 tx_id: header.tx_id,
1995 },
1996 })
1997 }
1998 0x386e12d092bea2f8 => {
1999 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2000 let mut req = fidl::new_empty!(
2001 CoordinatorDestroyLayerRequest,
2002 fidl::encoding::DefaultFuchsiaResourceDialect
2003 );
2004 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorDestroyLayerRequest>(&header, _body_bytes, handles, &mut req)?;
2005 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2006 Ok(CoordinatorRequest::DestroyLayer {
2007 layer_id: req.layer_id,
2008
2009 control_handle,
2010 })
2011 }
2012 0xbde3c59ee9c1777 => {
2013 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2014 let mut req = fidl::new_empty!(
2015 CoordinatorSetDisplayModeRequest,
2016 fidl::encoding::DefaultFuchsiaResourceDialect
2017 );
2018 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayModeRequest>(&header, _body_bytes, handles, &mut req)?;
2019 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2020 Ok(CoordinatorRequest::SetDisplayMode {
2021 display_id: req.display_id,
2022 mode: req.mode,
2023
2024 control_handle,
2025 })
2026 }
2027 0x2f18186a987d51aa => {
2028 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2029 let mut req = fidl::new_empty!(
2030 CoordinatorSetDisplayColorConversionRequest,
2031 fidl::encoding::DefaultFuchsiaResourceDialect
2032 );
2033 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayColorConversionRequest>(&header, _body_bytes, handles, &mut req)?;
2034 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2035 Ok(CoordinatorRequest::SetDisplayColorConversion {
2036 display_id: req.display_id,
2037 preoffsets: req.preoffsets,
2038 coefficients: req.coefficients,
2039 postoffsets: req.postoffsets,
2040
2041 control_handle,
2042 })
2043 }
2044 0x190e0f6f93be1d89 => {
2045 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2046 let mut req = fidl::new_empty!(
2047 CoordinatorSetDisplayLayersRequest,
2048 fidl::encoding::DefaultFuchsiaResourceDialect
2049 );
2050 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayLayersRequest>(&header, _body_bytes, handles, &mut req)?;
2051 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2052 Ok(CoordinatorRequest::SetDisplayLayers {
2053 display_id: req.display_id,
2054 layer_ids: req.layer_ids,
2055
2056 control_handle,
2057 })
2058 }
2059 0x68d89ebd518b45b9 => {
2060 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2061 let mut req = fidl::new_empty!(
2062 CoordinatorSetLayerPrimaryConfigRequest,
2063 fidl::encoding::DefaultFuchsiaResourceDialect
2064 );
2065 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2066 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2067 Ok(CoordinatorRequest::SetLayerPrimaryConfig {
2068 layer_id: req.layer_id,
2069 image_metadata: req.image_metadata,
2070
2071 control_handle,
2072 })
2073 }
2074 0x27b192b5a43851e2 => {
2075 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2076 let mut req = fidl::new_empty!(
2077 CoordinatorSetLayerPrimaryPositionRequest,
2078 fidl::encoding::DefaultFuchsiaResourceDialect
2079 );
2080 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryPositionRequest>(&header, _body_bytes, handles, &mut req)?;
2081 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2082 Ok(CoordinatorRequest::SetLayerPrimaryPosition {
2083 layer_id: req.layer_id,
2084 image_source_transformation: req.image_source_transformation,
2085 image_source: req.image_source,
2086 display_destination: req.display_destination,
2087
2088 control_handle,
2089 })
2090 }
2091 0x104cf2b18b27296d => {
2092 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2093 let mut req = fidl::new_empty!(
2094 CoordinatorSetLayerPrimaryAlphaRequest,
2095 fidl::encoding::DefaultFuchsiaResourceDialect
2096 );
2097 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryAlphaRequest>(&header, _body_bytes, handles, &mut req)?;
2098 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2099 Ok(CoordinatorRequest::SetLayerPrimaryAlpha {
2100 layer_id: req.layer_id,
2101 mode: req.mode,
2102 val: req.val,
2103
2104 control_handle,
2105 })
2106 }
2107 0x2fa91e9a2a01875f => {
2108 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2109 let mut req = fidl::new_empty!(
2110 CoordinatorSetLayerColorConfigRequest,
2111 fidl::encoding::DefaultFuchsiaResourceDialect
2112 );
2113 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerColorConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2114 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2115 Ok(CoordinatorRequest::SetLayerColorConfig {
2116 layer_id: req.layer_id,
2117 color: req.color,
2118 display_destination: req.display_destination,
2119
2120 control_handle,
2121 })
2122 }
2123 0x53c6376dfc13a971 => {
2124 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2125 let mut req = fidl::new_empty!(
2126 CoordinatorSetLayerImage2Request,
2127 fidl::encoding::DefaultFuchsiaResourceDialect
2128 );
2129 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerImage2Request>(&header, _body_bytes, handles, &mut req)?;
2130 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2131 Ok(CoordinatorRequest::SetLayerImage2 {
2132 layer_id: req.layer_id,
2133 image_id: req.image_id,
2134 wait_event_id: req.wait_event_id,
2135
2136 control_handle,
2137 })
2138 }
2139 0x2bcfb4eb16878158 => {
2140 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2141 let mut req = fidl::new_empty!(
2142 fidl::encoding::EmptyPayload,
2143 fidl::encoding::DefaultFuchsiaResourceDialect
2144 );
2145 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2146 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2147 Ok(CoordinatorRequest::CheckConfig {
2148 responder: CoordinatorCheckConfigResponder {
2149 control_handle: std::mem::ManuallyDrop::new(control_handle),
2150 tx_id: header.tx_id,
2151 },
2152 })
2153 }
2154 0x1673399e9231dedf => {
2155 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2156 let mut req = fidl::new_empty!(
2157 fidl::encoding::EmptyPayload,
2158 fidl::encoding::DefaultFuchsiaResourceDialect
2159 );
2160 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2161 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2162 Ok(CoordinatorRequest::DiscardConfig { control_handle })
2163 }
2164 0x76a50c0537265f65 => {
2165 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2166 let mut req = fidl::new_empty!(
2167 fidl::encoding::EmptyPayload,
2168 fidl::encoding::DefaultFuchsiaResourceDialect
2169 );
2170 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2171 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2172 Ok(CoordinatorRequest::GetLatestAppliedConfigStamp {
2173 responder: CoordinatorGetLatestAppliedConfigStampResponder {
2174 control_handle: std::mem::ManuallyDrop::new(control_handle),
2175 tx_id: header.tx_id,
2176 },
2177 })
2178 }
2179 0x7f0fe0e4f062a67e => {
2180 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2181 let mut req = fidl::new_empty!(
2182 CoordinatorApplyConfig3Request,
2183 fidl::encoding::DefaultFuchsiaResourceDialect
2184 );
2185 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorApplyConfig3Request>(&header, _body_bytes, handles, &mut req)?;
2186 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2187 Ok(CoordinatorRequest::ApplyConfig3 { payload: req, control_handle })
2188 }
2189 0x25e921d26107d6ef => {
2190 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2191 let mut req = fidl::new_empty!(
2192 CoordinatorAcknowledgeVsyncRequest,
2193 fidl::encoding::DefaultFuchsiaResourceDialect
2194 );
2195 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorAcknowledgeVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
2196 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2197 Ok(CoordinatorRequest::AcknowledgeVsync {
2198 cookie: req.cookie,
2199
2200 control_handle,
2201 })
2202 }
2203 0x4fe0721526068f00 => {
2204 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2205 let mut req = fidl::new_empty!(
2206 CoordinatorSetVirtconModeRequest,
2207 fidl::encoding::DefaultFuchsiaResourceDialect
2208 );
2209 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetVirtconModeRequest>(&header, _body_bytes, handles, &mut req)?;
2210 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2211 Ok(CoordinatorRequest::SetVirtconMode { mode: req.mode, control_handle })
2212 }
2213 0x30d06f510e7f4601 => {
2214 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2215 let mut req = fidl::new_empty!(
2216 CoordinatorImportBufferCollectionRequest,
2217 fidl::encoding::DefaultFuchsiaResourceDialect
2218 );
2219 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2220 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2221 Ok(CoordinatorRequest::ImportBufferCollection {
2222 buffer_collection_id: req.buffer_collection_id,
2223 buffer_collection_token: req.buffer_collection_token,
2224
2225 responder: CoordinatorImportBufferCollectionResponder {
2226 control_handle: std::mem::ManuallyDrop::new(control_handle),
2227 tx_id: header.tx_id,
2228 },
2229 })
2230 }
2231 0x1c7dd5f8b0690be0 => {
2232 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2233 let mut req = fidl::new_empty!(
2234 CoordinatorReleaseBufferCollectionRequest,
2235 fidl::encoding::DefaultFuchsiaResourceDialect
2236 );
2237 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2238 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2239 Ok(CoordinatorRequest::ReleaseBufferCollection {
2240 buffer_collection_id: req.buffer_collection_id,
2241
2242 control_handle,
2243 })
2244 }
2245 0x509a4ee9af6035df => {
2246 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2247 let mut req = fidl::new_empty!(
2248 CoordinatorSetBufferCollectionConstraintsRequest,
2249 fidl::encoding::DefaultFuchsiaResourceDialect
2250 );
2251 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetBufferCollectionConstraintsRequest>(&header, _body_bytes, handles, &mut req)?;
2252 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2253 Ok(CoordinatorRequest::SetBufferCollectionConstraints {
2254 buffer_collection_id: req.buffer_collection_id,
2255 buffer_usage: req.buffer_usage,
2256
2257 responder: CoordinatorSetBufferCollectionConstraintsResponder {
2258 control_handle: std::mem::ManuallyDrop::new(control_handle),
2259 tx_id: header.tx_id,
2260 },
2261 })
2262 }
2263 0x4ca407277277971b => {
2264 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2265 let mut req = fidl::new_empty!(
2266 fidl::encoding::EmptyPayload,
2267 fidl::encoding::DefaultFuchsiaResourceDialect
2268 );
2269 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2270 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2271 Ok(CoordinatorRequest::IsCaptureSupported {
2272 responder: CoordinatorIsCaptureSupportedResponder {
2273 control_handle: std::mem::ManuallyDrop::new(control_handle),
2274 tx_id: header.tx_id,
2275 },
2276 })
2277 }
2278 0x35cb38f19d96a8db => {
2279 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2280 let mut req = fidl::new_empty!(
2281 CoordinatorStartCaptureRequest,
2282 fidl::encoding::DefaultFuchsiaResourceDialect
2283 );
2284 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorStartCaptureRequest>(&header, _body_bytes, handles, &mut req)?;
2285 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2286 Ok(CoordinatorRequest::StartCapture {
2287 signal_event_id: req.signal_event_id,
2288 image_id: req.image_id,
2289
2290 responder: CoordinatorStartCaptureResponder {
2291 control_handle: std::mem::ManuallyDrop::new(control_handle),
2292 tx_id: header.tx_id,
2293 },
2294 })
2295 }
2296 0x1b49251437038b0b => {
2297 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2298 let mut req = fidl::new_empty!(
2299 CoordinatorSetMinimumRgbRequest,
2300 fidl::encoding::DefaultFuchsiaResourceDialect
2301 );
2302 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetMinimumRgbRequest>(&header, _body_bytes, handles, &mut req)?;
2303 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2304 Ok(CoordinatorRequest::SetMinimumRgb {
2305 minimum_rgb: req.minimum_rgb,
2306
2307 responder: CoordinatorSetMinimumRgbResponder {
2308 control_handle: std::mem::ManuallyDrop::new(control_handle),
2309 tx_id: header.tx_id,
2310 },
2311 })
2312 }
2313 0xf4672f055072c92 => {
2314 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2315 let mut req = fidl::new_empty!(
2316 CoordinatorSetDisplayPowerModeRequest,
2317 fidl::encoding::DefaultFuchsiaResourceDialect
2318 );
2319 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayPowerModeRequest>(&header, _body_bytes, handles, &mut req)?;
2320 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2321 Ok(CoordinatorRequest::SetDisplayPowerMode {
2322 display_id: req.display_id,
2323 power_mode: req.power_mode,
2324
2325 responder: CoordinatorSetDisplayPowerModeResponder {
2326 control_handle: std::mem::ManuallyDrop::new(control_handle),
2327 tx_id: header.tx_id,
2328 },
2329 })
2330 }
2331 _ => Err(fidl::Error::UnknownOrdinal {
2332 ordinal: header.ordinal,
2333 protocol_name:
2334 <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2335 }),
2336 }))
2337 },
2338 )
2339 }
2340}
2341
2342#[derive(Debug)]
2364pub enum CoordinatorRequest {
2365 ImportImage {
2375 image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
2376 buffer_collection_id: BufferCollectionId,
2377 buffer_index: u32,
2378 image_id: ImageId,
2379 responder: CoordinatorImportImageResponder,
2380 },
2381 ReleaseImage { image_id: ImageId, control_handle: CoordinatorControlHandle },
2394 ImportEvent { event: fidl::Event, id: EventId, control_handle: CoordinatorControlHandle },
2403 ReleaseEvent { id: EventId, control_handle: CoordinatorControlHandle },
2410 CreateLayer { responder: CoordinatorCreateLayerResponder },
2418 DestroyLayer { layer_id: LayerId, control_handle: CoordinatorControlHandle },
2422 SetDisplayMode {
2424 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2425 mode: fidl_fuchsia_hardware_display_types::Mode,
2426 control_handle: CoordinatorControlHandle,
2427 },
2428 SetDisplayColorConversion {
2455 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2456 preoffsets: [f32; 3],
2457 coefficients: [f32; 9],
2458 postoffsets: [f32; 3],
2459 control_handle: CoordinatorControlHandle,
2460 },
2461 SetDisplayLayers {
2463 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2464 layer_ids: Vec<LayerId>,
2465 control_handle: CoordinatorControlHandle,
2466 },
2467 SetLayerPrimaryConfig {
2476 layer_id: LayerId,
2477 image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
2478 control_handle: CoordinatorControlHandle,
2479 },
2480 SetLayerPrimaryPosition {
2488 layer_id: LayerId,
2489 image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
2490 image_source: fidl_fuchsia_math::RectU,
2491 display_destination: fidl_fuchsia_math::RectU,
2492 control_handle: CoordinatorControlHandle,
2493 },
2494 SetLayerPrimaryAlpha {
2510 layer_id: LayerId,
2511 mode: fidl_fuchsia_hardware_display_types::AlphaMode,
2512 val: f32,
2513 control_handle: CoordinatorControlHandle,
2514 },
2515 SetLayerColorConfig {
2519 layer_id: LayerId,
2520 color: fidl_fuchsia_hardware_display_types::Color,
2521 display_destination: fidl_fuchsia_math::RectU,
2522 control_handle: CoordinatorControlHandle,
2523 },
2524 SetLayerImage2 {
2563 layer_id: LayerId,
2564 image_id: ImageId,
2565 wait_event_id: EventId,
2566 control_handle: CoordinatorControlHandle,
2567 },
2568 CheckConfig { responder: CoordinatorCheckConfigResponder },
2577 DiscardConfig { control_handle: CoordinatorControlHandle },
2579 GetLatestAppliedConfigStamp { responder: CoordinatorGetLatestAppliedConfigStampResponder },
2585 ApplyConfig3 {
2592 payload: CoordinatorApplyConfig3Request,
2593 control_handle: CoordinatorControlHandle,
2594 },
2595 AcknowledgeVsync { cookie: u64, control_handle: CoordinatorControlHandle },
2597 SetVirtconMode { mode: VirtconMode, control_handle: CoordinatorControlHandle },
2601 ImportBufferCollection {
2604 buffer_collection_id: BufferCollectionId,
2605 buffer_collection_token:
2606 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2607 responder: CoordinatorImportBufferCollectionResponder,
2608 },
2609 ReleaseBufferCollection {
2611 buffer_collection_id: BufferCollectionId,
2612 control_handle: CoordinatorControlHandle,
2613 },
2614 SetBufferCollectionConstraints {
2617 buffer_collection_id: BufferCollectionId,
2618 buffer_usage: fidl_fuchsia_hardware_display_types::ImageBufferUsage,
2619 responder: CoordinatorSetBufferCollectionConstraintsResponder,
2620 },
2621 IsCaptureSupported { responder: CoordinatorIsCaptureSupportedResponder },
2623 StartCapture {
2629 signal_event_id: EventId,
2630 image_id: ImageId,
2631 responder: CoordinatorStartCaptureResponder,
2632 },
2633 SetMinimumRgb { minimum_rgb: u8, responder: CoordinatorSetMinimumRgbResponder },
2644 SetDisplayPowerMode {
2661 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2662 power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
2663 responder: CoordinatorSetDisplayPowerModeResponder,
2664 },
2665}
2666
2667impl CoordinatorRequest {
2668 #[allow(irrefutable_let_patterns)]
2669 pub fn into_import_image(
2670 self,
2671 ) -> Option<(
2672 fidl_fuchsia_hardware_display_types::ImageMetadata,
2673 BufferCollectionId,
2674 u32,
2675 ImageId,
2676 CoordinatorImportImageResponder,
2677 )> {
2678 if let CoordinatorRequest::ImportImage {
2679 image_metadata,
2680 buffer_collection_id,
2681 buffer_index,
2682 image_id,
2683 responder,
2684 } = self
2685 {
2686 Some((image_metadata, buffer_collection_id, buffer_index, image_id, responder))
2687 } else {
2688 None
2689 }
2690 }
2691
2692 #[allow(irrefutable_let_patterns)]
2693 pub fn into_release_image(self) -> Option<(ImageId, CoordinatorControlHandle)> {
2694 if let CoordinatorRequest::ReleaseImage { image_id, control_handle } = self {
2695 Some((image_id, control_handle))
2696 } else {
2697 None
2698 }
2699 }
2700
2701 #[allow(irrefutable_let_patterns)]
2702 pub fn into_import_event(self) -> Option<(fidl::Event, EventId, CoordinatorControlHandle)> {
2703 if let CoordinatorRequest::ImportEvent { event, id, control_handle } = self {
2704 Some((event, id, control_handle))
2705 } else {
2706 None
2707 }
2708 }
2709
2710 #[allow(irrefutable_let_patterns)]
2711 pub fn into_release_event(self) -> Option<(EventId, CoordinatorControlHandle)> {
2712 if let CoordinatorRequest::ReleaseEvent { id, control_handle } = self {
2713 Some((id, control_handle))
2714 } else {
2715 None
2716 }
2717 }
2718
2719 #[allow(irrefutable_let_patterns)]
2720 pub fn into_create_layer(self) -> Option<(CoordinatorCreateLayerResponder)> {
2721 if let CoordinatorRequest::CreateLayer { responder } = self {
2722 Some((responder))
2723 } else {
2724 None
2725 }
2726 }
2727
2728 #[allow(irrefutable_let_patterns)]
2729 pub fn into_destroy_layer(self) -> Option<(LayerId, CoordinatorControlHandle)> {
2730 if let CoordinatorRequest::DestroyLayer { layer_id, control_handle } = self {
2731 Some((layer_id, control_handle))
2732 } else {
2733 None
2734 }
2735 }
2736
2737 #[allow(irrefutable_let_patterns)]
2738 pub fn into_set_display_mode(
2739 self,
2740 ) -> Option<(
2741 fidl_fuchsia_hardware_display_types::DisplayId,
2742 fidl_fuchsia_hardware_display_types::Mode,
2743 CoordinatorControlHandle,
2744 )> {
2745 if let CoordinatorRequest::SetDisplayMode { display_id, mode, control_handle } = self {
2746 Some((display_id, mode, control_handle))
2747 } else {
2748 None
2749 }
2750 }
2751
2752 #[allow(irrefutable_let_patterns)]
2753 pub fn into_set_display_color_conversion(
2754 self,
2755 ) -> Option<(
2756 fidl_fuchsia_hardware_display_types::DisplayId,
2757 [f32; 3],
2758 [f32; 9],
2759 [f32; 3],
2760 CoordinatorControlHandle,
2761 )> {
2762 if let CoordinatorRequest::SetDisplayColorConversion {
2763 display_id,
2764 preoffsets,
2765 coefficients,
2766 postoffsets,
2767 control_handle,
2768 } = self
2769 {
2770 Some((display_id, preoffsets, coefficients, postoffsets, control_handle))
2771 } else {
2772 None
2773 }
2774 }
2775
2776 #[allow(irrefutable_let_patterns)]
2777 pub fn into_set_display_layers(
2778 self,
2779 ) -> Option<(
2780 fidl_fuchsia_hardware_display_types::DisplayId,
2781 Vec<LayerId>,
2782 CoordinatorControlHandle,
2783 )> {
2784 if let CoordinatorRequest::SetDisplayLayers { display_id, layer_ids, control_handle } = self
2785 {
2786 Some((display_id, layer_ids, control_handle))
2787 } else {
2788 None
2789 }
2790 }
2791
2792 #[allow(irrefutable_let_patterns)]
2793 pub fn into_set_layer_primary_config(
2794 self,
2795 ) -> Option<(
2796 LayerId,
2797 fidl_fuchsia_hardware_display_types::ImageMetadata,
2798 CoordinatorControlHandle,
2799 )> {
2800 if let CoordinatorRequest::SetLayerPrimaryConfig {
2801 layer_id,
2802 image_metadata,
2803 control_handle,
2804 } = self
2805 {
2806 Some((layer_id, image_metadata, control_handle))
2807 } else {
2808 None
2809 }
2810 }
2811
2812 #[allow(irrefutable_let_patterns)]
2813 pub fn into_set_layer_primary_position(
2814 self,
2815 ) -> Option<(
2816 LayerId,
2817 fidl_fuchsia_hardware_display_types::CoordinateTransformation,
2818 fidl_fuchsia_math::RectU,
2819 fidl_fuchsia_math::RectU,
2820 CoordinatorControlHandle,
2821 )> {
2822 if let CoordinatorRequest::SetLayerPrimaryPosition {
2823 layer_id,
2824 image_source_transformation,
2825 image_source,
2826 display_destination,
2827 control_handle,
2828 } = self
2829 {
2830 Some((
2831 layer_id,
2832 image_source_transformation,
2833 image_source,
2834 display_destination,
2835 control_handle,
2836 ))
2837 } else {
2838 None
2839 }
2840 }
2841
2842 #[allow(irrefutable_let_patterns)]
2843 pub fn into_set_layer_primary_alpha(
2844 self,
2845 ) -> Option<(
2846 LayerId,
2847 fidl_fuchsia_hardware_display_types::AlphaMode,
2848 f32,
2849 CoordinatorControlHandle,
2850 )> {
2851 if let CoordinatorRequest::SetLayerPrimaryAlpha { layer_id, mode, val, control_handle } =
2852 self
2853 {
2854 Some((layer_id, mode, val, control_handle))
2855 } else {
2856 None
2857 }
2858 }
2859
2860 #[allow(irrefutable_let_patterns)]
2861 pub fn into_set_layer_color_config(
2862 self,
2863 ) -> Option<(
2864 LayerId,
2865 fidl_fuchsia_hardware_display_types::Color,
2866 fidl_fuchsia_math::RectU,
2867 CoordinatorControlHandle,
2868 )> {
2869 if let CoordinatorRequest::SetLayerColorConfig {
2870 layer_id,
2871 color,
2872 display_destination,
2873 control_handle,
2874 } = self
2875 {
2876 Some((layer_id, color, display_destination, control_handle))
2877 } else {
2878 None
2879 }
2880 }
2881
2882 #[allow(irrefutable_let_patterns)]
2883 pub fn into_set_layer_image2(
2884 self,
2885 ) -> Option<(LayerId, ImageId, EventId, CoordinatorControlHandle)> {
2886 if let CoordinatorRequest::SetLayerImage2 {
2887 layer_id,
2888 image_id,
2889 wait_event_id,
2890 control_handle,
2891 } = self
2892 {
2893 Some((layer_id, image_id, wait_event_id, control_handle))
2894 } else {
2895 None
2896 }
2897 }
2898
2899 #[allow(irrefutable_let_patterns)]
2900 pub fn into_check_config(self) -> Option<(CoordinatorCheckConfigResponder)> {
2901 if let CoordinatorRequest::CheckConfig { responder } = self {
2902 Some((responder))
2903 } else {
2904 None
2905 }
2906 }
2907
2908 #[allow(irrefutable_let_patterns)]
2909 pub fn into_discard_config(self) -> Option<(CoordinatorControlHandle)> {
2910 if let CoordinatorRequest::DiscardConfig { control_handle } = self {
2911 Some((control_handle))
2912 } else {
2913 None
2914 }
2915 }
2916
2917 #[allow(irrefutable_let_patterns)]
2918 pub fn into_get_latest_applied_config_stamp(
2919 self,
2920 ) -> Option<(CoordinatorGetLatestAppliedConfigStampResponder)> {
2921 if let CoordinatorRequest::GetLatestAppliedConfigStamp { responder } = self {
2922 Some((responder))
2923 } else {
2924 None
2925 }
2926 }
2927
2928 #[allow(irrefutable_let_patterns)]
2929 pub fn into_apply_config3(
2930 self,
2931 ) -> Option<(CoordinatorApplyConfig3Request, CoordinatorControlHandle)> {
2932 if let CoordinatorRequest::ApplyConfig3 { payload, control_handle } = self {
2933 Some((payload, control_handle))
2934 } else {
2935 None
2936 }
2937 }
2938
2939 #[allow(irrefutable_let_patterns)]
2940 pub fn into_acknowledge_vsync(self) -> Option<(u64, CoordinatorControlHandle)> {
2941 if let CoordinatorRequest::AcknowledgeVsync { cookie, control_handle } = self {
2942 Some((cookie, control_handle))
2943 } else {
2944 None
2945 }
2946 }
2947
2948 #[allow(irrefutable_let_patterns)]
2949 pub fn into_set_virtcon_mode(self) -> Option<(VirtconMode, CoordinatorControlHandle)> {
2950 if let CoordinatorRequest::SetVirtconMode { mode, control_handle } = self {
2951 Some((mode, control_handle))
2952 } else {
2953 None
2954 }
2955 }
2956
2957 #[allow(irrefutable_let_patterns)]
2958 pub fn into_import_buffer_collection(
2959 self,
2960 ) -> Option<(
2961 BufferCollectionId,
2962 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2963 CoordinatorImportBufferCollectionResponder,
2964 )> {
2965 if let CoordinatorRequest::ImportBufferCollection {
2966 buffer_collection_id,
2967 buffer_collection_token,
2968 responder,
2969 } = self
2970 {
2971 Some((buffer_collection_id, buffer_collection_token, responder))
2972 } else {
2973 None
2974 }
2975 }
2976
2977 #[allow(irrefutable_let_patterns)]
2978 pub fn into_release_buffer_collection(
2979 self,
2980 ) -> Option<(BufferCollectionId, CoordinatorControlHandle)> {
2981 if let CoordinatorRequest::ReleaseBufferCollection {
2982 buffer_collection_id,
2983 control_handle,
2984 } = self
2985 {
2986 Some((buffer_collection_id, control_handle))
2987 } else {
2988 None
2989 }
2990 }
2991
2992 #[allow(irrefutable_let_patterns)]
2993 pub fn into_set_buffer_collection_constraints(
2994 self,
2995 ) -> Option<(
2996 BufferCollectionId,
2997 fidl_fuchsia_hardware_display_types::ImageBufferUsage,
2998 CoordinatorSetBufferCollectionConstraintsResponder,
2999 )> {
3000 if let CoordinatorRequest::SetBufferCollectionConstraints {
3001 buffer_collection_id,
3002 buffer_usage,
3003 responder,
3004 } = self
3005 {
3006 Some((buffer_collection_id, buffer_usage, responder))
3007 } else {
3008 None
3009 }
3010 }
3011
3012 #[allow(irrefutable_let_patterns)]
3013 pub fn into_is_capture_supported(self) -> Option<(CoordinatorIsCaptureSupportedResponder)> {
3014 if let CoordinatorRequest::IsCaptureSupported { responder } = self {
3015 Some((responder))
3016 } else {
3017 None
3018 }
3019 }
3020
3021 #[allow(irrefutable_let_patterns)]
3022 pub fn into_start_capture(
3023 self,
3024 ) -> Option<(EventId, ImageId, CoordinatorStartCaptureResponder)> {
3025 if let CoordinatorRequest::StartCapture { signal_event_id, image_id, responder } = self {
3026 Some((signal_event_id, image_id, responder))
3027 } else {
3028 None
3029 }
3030 }
3031
3032 #[allow(irrefutable_let_patterns)]
3033 pub fn into_set_minimum_rgb(self) -> Option<(u8, CoordinatorSetMinimumRgbResponder)> {
3034 if let CoordinatorRequest::SetMinimumRgb { minimum_rgb, responder } = self {
3035 Some((minimum_rgb, responder))
3036 } else {
3037 None
3038 }
3039 }
3040
3041 #[allow(irrefutable_let_patterns)]
3042 pub fn into_set_display_power_mode(
3043 self,
3044 ) -> Option<(
3045 fidl_fuchsia_hardware_display_types::DisplayId,
3046 fidl_fuchsia_hardware_display_types::PowerMode,
3047 CoordinatorSetDisplayPowerModeResponder,
3048 )> {
3049 if let CoordinatorRequest::SetDisplayPowerMode { display_id, power_mode, responder } = self
3050 {
3051 Some((display_id, power_mode, responder))
3052 } else {
3053 None
3054 }
3055 }
3056
3057 pub fn method_name(&self) -> &'static str {
3059 match *self {
3060 CoordinatorRequest::ImportImage { .. } => "import_image",
3061 CoordinatorRequest::ReleaseImage { .. } => "release_image",
3062 CoordinatorRequest::ImportEvent { .. } => "import_event",
3063 CoordinatorRequest::ReleaseEvent { .. } => "release_event",
3064 CoordinatorRequest::CreateLayer { .. } => "create_layer",
3065 CoordinatorRequest::DestroyLayer { .. } => "destroy_layer",
3066 CoordinatorRequest::SetDisplayMode { .. } => "set_display_mode",
3067 CoordinatorRequest::SetDisplayColorConversion { .. } => "set_display_color_conversion",
3068 CoordinatorRequest::SetDisplayLayers { .. } => "set_display_layers",
3069 CoordinatorRequest::SetLayerPrimaryConfig { .. } => "set_layer_primary_config",
3070 CoordinatorRequest::SetLayerPrimaryPosition { .. } => "set_layer_primary_position",
3071 CoordinatorRequest::SetLayerPrimaryAlpha { .. } => "set_layer_primary_alpha",
3072 CoordinatorRequest::SetLayerColorConfig { .. } => "set_layer_color_config",
3073 CoordinatorRequest::SetLayerImage2 { .. } => "set_layer_image2",
3074 CoordinatorRequest::CheckConfig { .. } => "check_config",
3075 CoordinatorRequest::DiscardConfig { .. } => "discard_config",
3076 CoordinatorRequest::GetLatestAppliedConfigStamp { .. } => {
3077 "get_latest_applied_config_stamp"
3078 }
3079 CoordinatorRequest::ApplyConfig3 { .. } => "apply_config3",
3080 CoordinatorRequest::AcknowledgeVsync { .. } => "acknowledge_vsync",
3081 CoordinatorRequest::SetVirtconMode { .. } => "set_virtcon_mode",
3082 CoordinatorRequest::ImportBufferCollection { .. } => "import_buffer_collection",
3083 CoordinatorRequest::ReleaseBufferCollection { .. } => "release_buffer_collection",
3084 CoordinatorRequest::SetBufferCollectionConstraints { .. } => {
3085 "set_buffer_collection_constraints"
3086 }
3087 CoordinatorRequest::IsCaptureSupported { .. } => "is_capture_supported",
3088 CoordinatorRequest::StartCapture { .. } => "start_capture",
3089 CoordinatorRequest::SetMinimumRgb { .. } => "set_minimum_rgb",
3090 CoordinatorRequest::SetDisplayPowerMode { .. } => "set_display_power_mode",
3091 }
3092 }
3093}
3094
3095#[derive(Debug, Clone)]
3096pub struct CoordinatorControlHandle {
3097 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3098}
3099
3100impl fidl::endpoints::ControlHandle for CoordinatorControlHandle {
3101 fn shutdown(&self) {
3102 self.inner.shutdown()
3103 }
3104
3105 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3106 self.inner.shutdown_with_epitaph(status)
3107 }
3108
3109 fn is_closed(&self) -> bool {
3110 self.inner.channel().is_closed()
3111 }
3112 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3113 self.inner.channel().on_closed()
3114 }
3115
3116 #[cfg(target_os = "fuchsia")]
3117 fn signal_peer(
3118 &self,
3119 clear_mask: zx::Signals,
3120 set_mask: zx::Signals,
3121 ) -> Result<(), zx_status::Status> {
3122 use fidl::Peered;
3123 self.inner.channel().signal_peer(clear_mask, set_mask)
3124 }
3125}
3126
3127impl CoordinatorControlHandle {}
3128
3129#[must_use = "FIDL methods require a response to be sent"]
3130#[derive(Debug)]
3131pub struct CoordinatorImportImageResponder {
3132 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3133 tx_id: u32,
3134}
3135
3136impl std::ops::Drop for CoordinatorImportImageResponder {
3140 fn drop(&mut self) {
3141 self.control_handle.shutdown();
3142 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3144 }
3145}
3146
3147impl fidl::endpoints::Responder for CoordinatorImportImageResponder {
3148 type ControlHandle = CoordinatorControlHandle;
3149
3150 fn control_handle(&self) -> &CoordinatorControlHandle {
3151 &self.control_handle
3152 }
3153
3154 fn drop_without_shutdown(mut self) {
3155 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3157 std::mem::forget(self);
3159 }
3160}
3161
3162impl CoordinatorImportImageResponder {
3163 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3167 let _result = self.send_raw(result);
3168 if _result.is_err() {
3169 self.control_handle.shutdown();
3170 }
3171 self.drop_without_shutdown();
3172 _result
3173 }
3174
3175 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3177 let _result = self.send_raw(result);
3178 self.drop_without_shutdown();
3179 _result
3180 }
3181
3182 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3183 self.control_handle
3184 .inner
3185 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3186 result,
3187 self.tx_id,
3188 0x3a8636eb9656b4f4,
3189 fidl::encoding::DynamicFlags::empty(),
3190 )
3191 }
3192}
3193
3194#[must_use = "FIDL methods require a response to be sent"]
3195#[derive(Debug)]
3196pub struct CoordinatorCreateLayerResponder {
3197 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3198 tx_id: u32,
3199}
3200
3201impl std::ops::Drop for CoordinatorCreateLayerResponder {
3205 fn drop(&mut self) {
3206 self.control_handle.shutdown();
3207 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3209 }
3210}
3211
3212impl fidl::endpoints::Responder for CoordinatorCreateLayerResponder {
3213 type ControlHandle = CoordinatorControlHandle;
3214
3215 fn control_handle(&self) -> &CoordinatorControlHandle {
3216 &self.control_handle
3217 }
3218
3219 fn drop_without_shutdown(mut self) {
3220 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3222 std::mem::forget(self);
3224 }
3225}
3226
3227impl CoordinatorCreateLayerResponder {
3228 pub fn send(self, mut result: Result<&LayerId, i32>) -> Result<(), fidl::Error> {
3232 let _result = self.send_raw(result);
3233 if _result.is_err() {
3234 self.control_handle.shutdown();
3235 }
3236 self.drop_without_shutdown();
3237 _result
3238 }
3239
3240 pub fn send_no_shutdown_on_err(
3242 self,
3243 mut result: Result<&LayerId, i32>,
3244 ) -> Result<(), fidl::Error> {
3245 let _result = self.send_raw(result);
3246 self.drop_without_shutdown();
3247 _result
3248 }
3249
3250 fn send_raw(&self, mut result: Result<&LayerId, i32>) -> Result<(), fidl::Error> {
3251 self.control_handle
3252 .inner
3253 .send::<fidl::encoding::ResultType<CoordinatorCreateLayerResponse, i32>>(
3254 result.map(|layer_id| (layer_id,)),
3255 self.tx_id,
3256 0x2137cfd788a3496b,
3257 fidl::encoding::DynamicFlags::empty(),
3258 )
3259 }
3260}
3261
3262#[must_use = "FIDL methods require a response to be sent"]
3263#[derive(Debug)]
3264pub struct CoordinatorCheckConfigResponder {
3265 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3266 tx_id: u32,
3267}
3268
3269impl std::ops::Drop for CoordinatorCheckConfigResponder {
3273 fn drop(&mut self) {
3274 self.control_handle.shutdown();
3275 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3277 }
3278}
3279
3280impl fidl::endpoints::Responder for CoordinatorCheckConfigResponder {
3281 type ControlHandle = CoordinatorControlHandle;
3282
3283 fn control_handle(&self) -> &CoordinatorControlHandle {
3284 &self.control_handle
3285 }
3286
3287 fn drop_without_shutdown(mut self) {
3288 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3290 std::mem::forget(self);
3292 }
3293}
3294
3295impl CoordinatorCheckConfigResponder {
3296 pub fn send(
3300 self,
3301 mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3302 ) -> Result<(), fidl::Error> {
3303 let _result = self.send_raw(res);
3304 if _result.is_err() {
3305 self.control_handle.shutdown();
3306 }
3307 self.drop_without_shutdown();
3308 _result
3309 }
3310
3311 pub fn send_no_shutdown_on_err(
3313 self,
3314 mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3315 ) -> Result<(), fidl::Error> {
3316 let _result = self.send_raw(res);
3317 self.drop_without_shutdown();
3318 _result
3319 }
3320
3321 fn send_raw(
3322 &self,
3323 mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3324 ) -> Result<(), fidl::Error> {
3325 self.control_handle.inner.send::<CoordinatorCheckConfigResponse>(
3326 (res,),
3327 self.tx_id,
3328 0x2bcfb4eb16878158,
3329 fidl::encoding::DynamicFlags::empty(),
3330 )
3331 }
3332}
3333
3334#[must_use = "FIDL methods require a response to be sent"]
3335#[derive(Debug)]
3336pub struct CoordinatorGetLatestAppliedConfigStampResponder {
3337 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3338 tx_id: u32,
3339}
3340
3341impl std::ops::Drop for CoordinatorGetLatestAppliedConfigStampResponder {
3345 fn drop(&mut self) {
3346 self.control_handle.shutdown();
3347 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3349 }
3350}
3351
3352impl fidl::endpoints::Responder for CoordinatorGetLatestAppliedConfigStampResponder {
3353 type ControlHandle = CoordinatorControlHandle;
3354
3355 fn control_handle(&self) -> &CoordinatorControlHandle {
3356 &self.control_handle
3357 }
3358
3359 fn drop_without_shutdown(mut self) {
3360 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3362 std::mem::forget(self);
3364 }
3365}
3366
3367impl CoordinatorGetLatestAppliedConfigStampResponder {
3368 pub fn send(self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3372 let _result = self.send_raw(stamp);
3373 if _result.is_err() {
3374 self.control_handle.shutdown();
3375 }
3376 self.drop_without_shutdown();
3377 _result
3378 }
3379
3380 pub fn send_no_shutdown_on_err(self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3382 let _result = self.send_raw(stamp);
3383 self.drop_without_shutdown();
3384 _result
3385 }
3386
3387 fn send_raw(&self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3388 self.control_handle.inner.send::<CoordinatorGetLatestAppliedConfigStampResponse>(
3389 (stamp,),
3390 self.tx_id,
3391 0x76a50c0537265f65,
3392 fidl::encoding::DynamicFlags::empty(),
3393 )
3394 }
3395}
3396
3397#[must_use = "FIDL methods require a response to be sent"]
3398#[derive(Debug)]
3399pub struct CoordinatorImportBufferCollectionResponder {
3400 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3401 tx_id: u32,
3402}
3403
3404impl std::ops::Drop for CoordinatorImportBufferCollectionResponder {
3408 fn drop(&mut self) {
3409 self.control_handle.shutdown();
3410 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3412 }
3413}
3414
3415impl fidl::endpoints::Responder for CoordinatorImportBufferCollectionResponder {
3416 type ControlHandle = CoordinatorControlHandle;
3417
3418 fn control_handle(&self) -> &CoordinatorControlHandle {
3419 &self.control_handle
3420 }
3421
3422 fn drop_without_shutdown(mut self) {
3423 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3425 std::mem::forget(self);
3427 }
3428}
3429
3430impl CoordinatorImportBufferCollectionResponder {
3431 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3435 let _result = self.send_raw(result);
3436 if _result.is_err() {
3437 self.control_handle.shutdown();
3438 }
3439 self.drop_without_shutdown();
3440 _result
3441 }
3442
3443 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3445 let _result = self.send_raw(result);
3446 self.drop_without_shutdown();
3447 _result
3448 }
3449
3450 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3451 self.control_handle
3452 .inner
3453 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3454 result,
3455 self.tx_id,
3456 0x30d06f510e7f4601,
3457 fidl::encoding::DynamicFlags::empty(),
3458 )
3459 }
3460}
3461
3462#[must_use = "FIDL methods require a response to be sent"]
3463#[derive(Debug)]
3464pub struct CoordinatorSetBufferCollectionConstraintsResponder {
3465 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3466 tx_id: u32,
3467}
3468
3469impl std::ops::Drop for CoordinatorSetBufferCollectionConstraintsResponder {
3473 fn drop(&mut self) {
3474 self.control_handle.shutdown();
3475 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3477 }
3478}
3479
3480impl fidl::endpoints::Responder for CoordinatorSetBufferCollectionConstraintsResponder {
3481 type ControlHandle = CoordinatorControlHandle;
3482
3483 fn control_handle(&self) -> &CoordinatorControlHandle {
3484 &self.control_handle
3485 }
3486
3487 fn drop_without_shutdown(mut self) {
3488 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3490 std::mem::forget(self);
3492 }
3493}
3494
3495impl CoordinatorSetBufferCollectionConstraintsResponder {
3496 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3500 let _result = self.send_raw(result);
3501 if _result.is_err() {
3502 self.control_handle.shutdown();
3503 }
3504 self.drop_without_shutdown();
3505 _result
3506 }
3507
3508 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3510 let _result = self.send_raw(result);
3511 self.drop_without_shutdown();
3512 _result
3513 }
3514
3515 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3516 self.control_handle
3517 .inner
3518 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3519 result,
3520 self.tx_id,
3521 0x509a4ee9af6035df,
3522 fidl::encoding::DynamicFlags::empty(),
3523 )
3524 }
3525}
3526
3527#[must_use = "FIDL methods require a response to be sent"]
3528#[derive(Debug)]
3529pub struct CoordinatorIsCaptureSupportedResponder {
3530 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3531 tx_id: u32,
3532}
3533
3534impl std::ops::Drop for CoordinatorIsCaptureSupportedResponder {
3538 fn drop(&mut self) {
3539 self.control_handle.shutdown();
3540 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3542 }
3543}
3544
3545impl fidl::endpoints::Responder for CoordinatorIsCaptureSupportedResponder {
3546 type ControlHandle = CoordinatorControlHandle;
3547
3548 fn control_handle(&self) -> &CoordinatorControlHandle {
3549 &self.control_handle
3550 }
3551
3552 fn drop_without_shutdown(mut self) {
3553 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3555 std::mem::forget(self);
3557 }
3558}
3559
3560impl CoordinatorIsCaptureSupportedResponder {
3561 pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3565 let _result = self.send_raw(result);
3566 if _result.is_err() {
3567 self.control_handle.shutdown();
3568 }
3569 self.drop_without_shutdown();
3570 _result
3571 }
3572
3573 pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3575 let _result = self.send_raw(result);
3576 self.drop_without_shutdown();
3577 _result
3578 }
3579
3580 fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3581 self.control_handle.inner.send::<fidl::encoding::ResultType<
3582 CoordinatorIsCaptureSupportedResponse,
3583 i32,
3584 >>(
3585 result.map(|supported| (supported,)),
3586 self.tx_id,
3587 0x4ca407277277971b,
3588 fidl::encoding::DynamicFlags::empty(),
3589 )
3590 }
3591}
3592
3593#[must_use = "FIDL methods require a response to be sent"]
3594#[derive(Debug)]
3595pub struct CoordinatorStartCaptureResponder {
3596 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3597 tx_id: u32,
3598}
3599
3600impl std::ops::Drop for CoordinatorStartCaptureResponder {
3604 fn drop(&mut self) {
3605 self.control_handle.shutdown();
3606 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3608 }
3609}
3610
3611impl fidl::endpoints::Responder for CoordinatorStartCaptureResponder {
3612 type ControlHandle = CoordinatorControlHandle;
3613
3614 fn control_handle(&self) -> &CoordinatorControlHandle {
3615 &self.control_handle
3616 }
3617
3618 fn drop_without_shutdown(mut self) {
3619 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3621 std::mem::forget(self);
3623 }
3624}
3625
3626impl CoordinatorStartCaptureResponder {
3627 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3631 let _result = self.send_raw(result);
3632 if _result.is_err() {
3633 self.control_handle.shutdown();
3634 }
3635 self.drop_without_shutdown();
3636 _result
3637 }
3638
3639 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3641 let _result = self.send_raw(result);
3642 self.drop_without_shutdown();
3643 _result
3644 }
3645
3646 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3647 self.control_handle
3648 .inner
3649 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3650 result,
3651 self.tx_id,
3652 0x35cb38f19d96a8db,
3653 fidl::encoding::DynamicFlags::empty(),
3654 )
3655 }
3656}
3657
3658#[must_use = "FIDL methods require a response to be sent"]
3659#[derive(Debug)]
3660pub struct CoordinatorSetMinimumRgbResponder {
3661 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3662 tx_id: u32,
3663}
3664
3665impl std::ops::Drop for CoordinatorSetMinimumRgbResponder {
3669 fn drop(&mut self) {
3670 self.control_handle.shutdown();
3671 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3673 }
3674}
3675
3676impl fidl::endpoints::Responder for CoordinatorSetMinimumRgbResponder {
3677 type ControlHandle = CoordinatorControlHandle;
3678
3679 fn control_handle(&self) -> &CoordinatorControlHandle {
3680 &self.control_handle
3681 }
3682
3683 fn drop_without_shutdown(mut self) {
3684 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3686 std::mem::forget(self);
3688 }
3689}
3690
3691impl CoordinatorSetMinimumRgbResponder {
3692 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3696 let _result = self.send_raw(result);
3697 if _result.is_err() {
3698 self.control_handle.shutdown();
3699 }
3700 self.drop_without_shutdown();
3701 _result
3702 }
3703
3704 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3706 let _result = self.send_raw(result);
3707 self.drop_without_shutdown();
3708 _result
3709 }
3710
3711 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3712 self.control_handle
3713 .inner
3714 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3715 result,
3716 self.tx_id,
3717 0x1b49251437038b0b,
3718 fidl::encoding::DynamicFlags::empty(),
3719 )
3720 }
3721}
3722
3723#[must_use = "FIDL methods require a response to be sent"]
3724#[derive(Debug)]
3725pub struct CoordinatorSetDisplayPowerModeResponder {
3726 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3727 tx_id: u32,
3728}
3729
3730impl std::ops::Drop for CoordinatorSetDisplayPowerModeResponder {
3734 fn drop(&mut self) {
3735 self.control_handle.shutdown();
3736 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3738 }
3739}
3740
3741impl fidl::endpoints::Responder for CoordinatorSetDisplayPowerModeResponder {
3742 type ControlHandle = CoordinatorControlHandle;
3743
3744 fn control_handle(&self) -> &CoordinatorControlHandle {
3745 &self.control_handle
3746 }
3747
3748 fn drop_without_shutdown(mut self) {
3749 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3751 std::mem::forget(self);
3753 }
3754}
3755
3756impl CoordinatorSetDisplayPowerModeResponder {
3757 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3761 let _result = self.send_raw(result);
3762 if _result.is_err() {
3763 self.control_handle.shutdown();
3764 }
3765 self.drop_without_shutdown();
3766 _result
3767 }
3768
3769 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3771 let _result = self.send_raw(result);
3772 self.drop_without_shutdown();
3773 _result
3774 }
3775
3776 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3777 self.control_handle
3778 .inner
3779 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3780 result,
3781 self.tx_id,
3782 0xf4672f055072c92,
3783 fidl::encoding::DynamicFlags::empty(),
3784 )
3785 }
3786}
3787
3788#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3789pub struct CoordinatorListenerMarker;
3790
3791impl fidl::endpoints::ProtocolMarker for CoordinatorListenerMarker {
3792 type Proxy = CoordinatorListenerProxy;
3793 type RequestStream = CoordinatorListenerRequestStream;
3794 #[cfg(target_os = "fuchsia")]
3795 type SynchronousProxy = CoordinatorListenerSynchronousProxy;
3796
3797 const DEBUG_NAME: &'static str = "(anonymous) CoordinatorListener";
3798}
3799
3800pub trait CoordinatorListenerProxyInterface: Send + Sync {
3801 fn r#on_displays_changed(
3802 &self,
3803 added: &[Info],
3804 removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3805 ) -> Result<(), fidl::Error>;
3806 fn r#on_vsync(
3807 &self,
3808 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
3809 timestamp: fidl::MonotonicInstant,
3810 applied_config_stamp: &ConfigStamp,
3811 cookie: &VsyncAckCookie,
3812 ) -> Result<(), fidl::Error>;
3813 fn r#on_client_ownership_change(&self, has_ownership: bool) -> Result<(), fidl::Error>;
3814}
3815#[derive(Debug)]
3816#[cfg(target_os = "fuchsia")]
3817pub struct CoordinatorListenerSynchronousProxy {
3818 client: fidl::client::sync::Client,
3819}
3820
3821#[cfg(target_os = "fuchsia")]
3822impl fidl::endpoints::SynchronousProxy for CoordinatorListenerSynchronousProxy {
3823 type Proxy = CoordinatorListenerProxy;
3824 type Protocol = CoordinatorListenerMarker;
3825
3826 fn from_channel(inner: fidl::Channel) -> Self {
3827 Self::new(inner)
3828 }
3829
3830 fn into_channel(self) -> fidl::Channel {
3831 self.client.into_channel()
3832 }
3833
3834 fn as_channel(&self) -> &fidl::Channel {
3835 self.client.as_channel()
3836 }
3837}
3838
3839#[cfg(target_os = "fuchsia")]
3840impl CoordinatorListenerSynchronousProxy {
3841 pub fn new(channel: fidl::Channel) -> Self {
3842 let protocol_name =
3843 <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3844 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3845 }
3846
3847 pub fn into_channel(self) -> fidl::Channel {
3848 self.client.into_channel()
3849 }
3850
3851 pub fn wait_for_event(
3854 &self,
3855 deadline: zx::MonotonicInstant,
3856 ) -> Result<CoordinatorListenerEvent, fidl::Error> {
3857 CoordinatorListenerEvent::decode(self.client.wait_for_event(deadline)?)
3858 }
3859
3860 pub fn r#on_displays_changed(
3871 &self,
3872 mut added: &[Info],
3873 mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3874 ) -> Result<(), fidl::Error> {
3875 self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
3876 (added, removed),
3877 0x248fbe90c338a94f,
3878 fidl::encoding::DynamicFlags::empty(),
3879 )
3880 }
3881
3882 pub fn r#on_vsync(
3899 &self,
3900 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
3901 mut timestamp: fidl::MonotonicInstant,
3902 mut applied_config_stamp: &ConfigStamp,
3903 mut cookie: &VsyncAckCookie,
3904 ) -> Result<(), fidl::Error> {
3905 self.client.send::<CoordinatorListenerOnVsyncRequest>(
3906 (display_id, timestamp, applied_config_stamp, cookie),
3907 0x249e9b8da7a7ac47,
3908 fidl::encoding::DynamicFlags::empty(),
3909 )
3910 }
3911
3912 pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
3921 self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
3922 (has_ownership,),
3923 0x1acd2ae683153d5e,
3924 fidl::encoding::DynamicFlags::empty(),
3925 )
3926 }
3927}
3928
3929#[cfg(target_os = "fuchsia")]
3930impl From<CoordinatorListenerSynchronousProxy> for zx::NullableHandle {
3931 fn from(value: CoordinatorListenerSynchronousProxy) -> Self {
3932 value.into_channel().into()
3933 }
3934}
3935
3936#[cfg(target_os = "fuchsia")]
3937impl From<fidl::Channel> for CoordinatorListenerSynchronousProxy {
3938 fn from(value: fidl::Channel) -> Self {
3939 Self::new(value)
3940 }
3941}
3942
3943#[cfg(target_os = "fuchsia")]
3944impl fidl::endpoints::FromClient for CoordinatorListenerSynchronousProxy {
3945 type Protocol = CoordinatorListenerMarker;
3946
3947 fn from_client(value: fidl::endpoints::ClientEnd<CoordinatorListenerMarker>) -> Self {
3948 Self::new(value.into_channel())
3949 }
3950}
3951
3952#[derive(Debug, Clone)]
3953pub struct CoordinatorListenerProxy {
3954 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3955}
3956
3957impl fidl::endpoints::Proxy for CoordinatorListenerProxy {
3958 type Protocol = CoordinatorListenerMarker;
3959
3960 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3961 Self::new(inner)
3962 }
3963
3964 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3965 self.client.into_channel().map_err(|client| Self { client })
3966 }
3967
3968 fn as_channel(&self) -> &::fidl::AsyncChannel {
3969 self.client.as_channel()
3970 }
3971}
3972
3973impl CoordinatorListenerProxy {
3974 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3976 let protocol_name =
3977 <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3978 Self { client: fidl::client::Client::new(channel, protocol_name) }
3979 }
3980
3981 pub fn take_event_stream(&self) -> CoordinatorListenerEventStream {
3987 CoordinatorListenerEventStream { event_receiver: self.client.take_event_receiver() }
3988 }
3989
3990 pub fn r#on_displays_changed(
4001 &self,
4002 mut added: &[Info],
4003 mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
4004 ) -> Result<(), fidl::Error> {
4005 CoordinatorListenerProxyInterface::r#on_displays_changed(self, added, removed)
4006 }
4007
4008 pub fn r#on_vsync(
4025 &self,
4026 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
4027 mut timestamp: fidl::MonotonicInstant,
4028 mut applied_config_stamp: &ConfigStamp,
4029 mut cookie: &VsyncAckCookie,
4030 ) -> Result<(), fidl::Error> {
4031 CoordinatorListenerProxyInterface::r#on_vsync(
4032 self,
4033 display_id,
4034 timestamp,
4035 applied_config_stamp,
4036 cookie,
4037 )
4038 }
4039
4040 pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
4049 CoordinatorListenerProxyInterface::r#on_client_ownership_change(self, has_ownership)
4050 }
4051}
4052
4053impl CoordinatorListenerProxyInterface for CoordinatorListenerProxy {
4054 fn r#on_displays_changed(
4055 &self,
4056 mut added: &[Info],
4057 mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
4058 ) -> Result<(), fidl::Error> {
4059 self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
4060 (added, removed),
4061 0x248fbe90c338a94f,
4062 fidl::encoding::DynamicFlags::empty(),
4063 )
4064 }
4065
4066 fn r#on_vsync(
4067 &self,
4068 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
4069 mut timestamp: fidl::MonotonicInstant,
4070 mut applied_config_stamp: &ConfigStamp,
4071 mut cookie: &VsyncAckCookie,
4072 ) -> Result<(), fidl::Error> {
4073 self.client.send::<CoordinatorListenerOnVsyncRequest>(
4074 (display_id, timestamp, applied_config_stamp, cookie),
4075 0x249e9b8da7a7ac47,
4076 fidl::encoding::DynamicFlags::empty(),
4077 )
4078 }
4079
4080 fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
4081 self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
4082 (has_ownership,),
4083 0x1acd2ae683153d5e,
4084 fidl::encoding::DynamicFlags::empty(),
4085 )
4086 }
4087}
4088
4089pub struct CoordinatorListenerEventStream {
4090 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4091}
4092
4093impl std::marker::Unpin for CoordinatorListenerEventStream {}
4094
4095impl futures::stream::FusedStream for CoordinatorListenerEventStream {
4096 fn is_terminated(&self) -> bool {
4097 self.event_receiver.is_terminated()
4098 }
4099}
4100
4101impl futures::Stream for CoordinatorListenerEventStream {
4102 type Item = Result<CoordinatorListenerEvent, fidl::Error>;
4103
4104 fn poll_next(
4105 mut self: std::pin::Pin<&mut Self>,
4106 cx: &mut std::task::Context<'_>,
4107 ) -> std::task::Poll<Option<Self::Item>> {
4108 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4109 &mut self.event_receiver,
4110 cx
4111 )?) {
4112 Some(buf) => std::task::Poll::Ready(Some(CoordinatorListenerEvent::decode(buf))),
4113 None => std::task::Poll::Ready(None),
4114 }
4115 }
4116}
4117
4118#[derive(Debug)]
4119pub enum CoordinatorListenerEvent {
4120 #[non_exhaustive]
4121 _UnknownEvent {
4122 ordinal: u64,
4124 },
4125}
4126
4127impl CoordinatorListenerEvent {
4128 fn decode(
4130 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4131 ) -> Result<CoordinatorListenerEvent, fidl::Error> {
4132 let (bytes, _handles) = buf.split_mut();
4133 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4134 debug_assert_eq!(tx_header.tx_id, 0);
4135 match tx_header.ordinal {
4136 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4137 Ok(CoordinatorListenerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4138 }
4139 _ => Err(fidl::Error::UnknownOrdinal {
4140 ordinal: tx_header.ordinal,
4141 protocol_name:
4142 <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4143 }),
4144 }
4145 }
4146}
4147
4148pub struct CoordinatorListenerRequestStream {
4150 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4151 is_terminated: bool,
4152}
4153
4154impl std::marker::Unpin for CoordinatorListenerRequestStream {}
4155
4156impl futures::stream::FusedStream for CoordinatorListenerRequestStream {
4157 fn is_terminated(&self) -> bool {
4158 self.is_terminated
4159 }
4160}
4161
4162impl fidl::endpoints::RequestStream for CoordinatorListenerRequestStream {
4163 type Protocol = CoordinatorListenerMarker;
4164 type ControlHandle = CoordinatorListenerControlHandle;
4165
4166 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4167 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4168 }
4169
4170 fn control_handle(&self) -> Self::ControlHandle {
4171 CoordinatorListenerControlHandle { inner: self.inner.clone() }
4172 }
4173
4174 fn into_inner(
4175 self,
4176 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4177 {
4178 (self.inner, self.is_terminated)
4179 }
4180
4181 fn from_inner(
4182 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4183 is_terminated: bool,
4184 ) -> Self {
4185 Self { inner, is_terminated }
4186 }
4187}
4188
4189impl futures::Stream for CoordinatorListenerRequestStream {
4190 type Item = Result<CoordinatorListenerRequest, fidl::Error>;
4191
4192 fn poll_next(
4193 mut self: std::pin::Pin<&mut Self>,
4194 cx: &mut std::task::Context<'_>,
4195 ) -> std::task::Poll<Option<Self::Item>> {
4196 let this = &mut *self;
4197 if this.inner.check_shutdown(cx) {
4198 this.is_terminated = true;
4199 return std::task::Poll::Ready(None);
4200 }
4201 if this.is_terminated {
4202 panic!("polled CoordinatorListenerRequestStream after completion");
4203 }
4204 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4205 |bytes, handles| {
4206 match this.inner.channel().read_etc(cx, bytes, handles) {
4207 std::task::Poll::Ready(Ok(())) => {}
4208 std::task::Poll::Pending => return std::task::Poll::Pending,
4209 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4210 this.is_terminated = true;
4211 return std::task::Poll::Ready(None);
4212 }
4213 std::task::Poll::Ready(Err(e)) => {
4214 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4215 e.into(),
4216 ))));
4217 }
4218 }
4219
4220 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4222
4223 std::task::Poll::Ready(Some(match header.ordinal {
4224 0x248fbe90c338a94f => {
4225 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4226 let mut req = fidl::new_empty!(CoordinatorListenerOnDisplaysChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4227 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnDisplaysChangedRequest>(&header, _body_bytes, handles, &mut req)?;
4228 let control_handle = CoordinatorListenerControlHandle {
4229 inner: this.inner.clone(),
4230 };
4231 Ok(CoordinatorListenerRequest::OnDisplaysChanged {added: req.added,
4232removed: req.removed,
4233
4234 control_handle,
4235 })
4236 }
4237 0x249e9b8da7a7ac47 => {
4238 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4239 let mut req = fidl::new_empty!(CoordinatorListenerOnVsyncRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4240 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
4241 let control_handle = CoordinatorListenerControlHandle {
4242 inner: this.inner.clone(),
4243 };
4244 Ok(CoordinatorListenerRequest::OnVsync {display_id: req.display_id,
4245timestamp: req.timestamp,
4246applied_config_stamp: req.applied_config_stamp,
4247cookie: req.cookie,
4248
4249 control_handle,
4250 })
4251 }
4252 0x1acd2ae683153d5e => {
4253 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4254 let mut req = fidl::new_empty!(CoordinatorListenerOnClientOwnershipChangeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4255 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnClientOwnershipChangeRequest>(&header, _body_bytes, handles, &mut req)?;
4256 let control_handle = CoordinatorListenerControlHandle {
4257 inner: this.inner.clone(),
4258 };
4259 Ok(CoordinatorListenerRequest::OnClientOwnershipChange {has_ownership: req.has_ownership,
4260
4261 control_handle,
4262 })
4263 }
4264 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4265 Ok(CoordinatorListenerRequest::_UnknownMethod {
4266 ordinal: header.ordinal,
4267 control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
4268 method_type: fidl::MethodType::OneWay,
4269 })
4270 }
4271 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4272 this.inner.send_framework_err(
4273 fidl::encoding::FrameworkErr::UnknownMethod,
4274 header.tx_id,
4275 header.ordinal,
4276 header.dynamic_flags(),
4277 (bytes, handles),
4278 )?;
4279 Ok(CoordinatorListenerRequest::_UnknownMethod {
4280 ordinal: header.ordinal,
4281 control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
4282 method_type: fidl::MethodType::TwoWay,
4283 })
4284 }
4285 _ => Err(fidl::Error::UnknownOrdinal {
4286 ordinal: header.ordinal,
4287 protocol_name: <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4288 }),
4289 }))
4290 },
4291 )
4292 }
4293}
4294
4295#[derive(Debug)]
4299pub enum CoordinatorListenerRequest {
4300 OnDisplaysChanged {
4311 added: Vec<Info>,
4312 removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
4313 control_handle: CoordinatorListenerControlHandle,
4314 },
4315 OnVsync {
4332 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
4333 timestamp: fidl::MonotonicInstant,
4334 applied_config_stamp: ConfigStamp,
4335 cookie: VsyncAckCookie,
4336 control_handle: CoordinatorListenerControlHandle,
4337 },
4338 OnClientOwnershipChange {
4347 has_ownership: bool,
4348 control_handle: CoordinatorListenerControlHandle,
4349 },
4350 #[non_exhaustive]
4352 _UnknownMethod {
4353 ordinal: u64,
4355 control_handle: CoordinatorListenerControlHandle,
4356 method_type: fidl::MethodType,
4357 },
4358}
4359
4360impl CoordinatorListenerRequest {
4361 #[allow(irrefutable_let_patterns)]
4362 pub fn into_on_displays_changed(
4363 self,
4364 ) -> Option<(
4365 Vec<Info>,
4366 Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
4367 CoordinatorListenerControlHandle,
4368 )> {
4369 if let CoordinatorListenerRequest::OnDisplaysChanged { added, removed, control_handle } =
4370 self
4371 {
4372 Some((added, removed, control_handle))
4373 } else {
4374 None
4375 }
4376 }
4377
4378 #[allow(irrefutable_let_patterns)]
4379 pub fn into_on_vsync(
4380 self,
4381 ) -> Option<(
4382 fidl_fuchsia_hardware_display_types::DisplayId,
4383 fidl::MonotonicInstant,
4384 ConfigStamp,
4385 VsyncAckCookie,
4386 CoordinatorListenerControlHandle,
4387 )> {
4388 if let CoordinatorListenerRequest::OnVsync {
4389 display_id,
4390 timestamp,
4391 applied_config_stamp,
4392 cookie,
4393 control_handle,
4394 } = self
4395 {
4396 Some((display_id, timestamp, applied_config_stamp, cookie, control_handle))
4397 } else {
4398 None
4399 }
4400 }
4401
4402 #[allow(irrefutable_let_patterns)]
4403 pub fn into_on_client_ownership_change(
4404 self,
4405 ) -> Option<(bool, CoordinatorListenerControlHandle)> {
4406 if let CoordinatorListenerRequest::OnClientOwnershipChange {
4407 has_ownership,
4408 control_handle,
4409 } = self
4410 {
4411 Some((has_ownership, control_handle))
4412 } else {
4413 None
4414 }
4415 }
4416
4417 pub fn method_name(&self) -> &'static str {
4419 match *self {
4420 CoordinatorListenerRequest::OnDisplaysChanged { .. } => "on_displays_changed",
4421 CoordinatorListenerRequest::OnVsync { .. } => "on_vsync",
4422 CoordinatorListenerRequest::OnClientOwnershipChange { .. } => {
4423 "on_client_ownership_change"
4424 }
4425 CoordinatorListenerRequest::_UnknownMethod {
4426 method_type: fidl::MethodType::OneWay,
4427 ..
4428 } => "unknown one-way method",
4429 CoordinatorListenerRequest::_UnknownMethod {
4430 method_type: fidl::MethodType::TwoWay,
4431 ..
4432 } => "unknown two-way method",
4433 }
4434 }
4435}
4436
4437#[derive(Debug, Clone)]
4438pub struct CoordinatorListenerControlHandle {
4439 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4440}
4441
4442impl fidl::endpoints::ControlHandle for CoordinatorListenerControlHandle {
4443 fn shutdown(&self) {
4444 self.inner.shutdown()
4445 }
4446
4447 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4448 self.inner.shutdown_with_epitaph(status)
4449 }
4450
4451 fn is_closed(&self) -> bool {
4452 self.inner.channel().is_closed()
4453 }
4454 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4455 self.inner.channel().on_closed()
4456 }
4457
4458 #[cfg(target_os = "fuchsia")]
4459 fn signal_peer(
4460 &self,
4461 clear_mask: zx::Signals,
4462 set_mask: zx::Signals,
4463 ) -> Result<(), zx_status::Status> {
4464 use fidl::Peered;
4465 self.inner.channel().signal_peer(clear_mask, set_mask)
4466 }
4467}
4468
4469impl CoordinatorListenerControlHandle {}
4470
4471#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4472pub struct ProviderMarker;
4473
4474impl fidl::endpoints::ProtocolMarker for ProviderMarker {
4475 type Proxy = ProviderProxy;
4476 type RequestStream = ProviderRequestStream;
4477 #[cfg(target_os = "fuchsia")]
4478 type SynchronousProxy = ProviderSynchronousProxy;
4479
4480 const DEBUG_NAME: &'static str = "fuchsia.hardware.display.Provider";
4481}
4482impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
4483pub type ProviderOpenCoordinatorWithListenerForVirtconResult = Result<(), i32>;
4484pub type ProviderOpenCoordinatorWithListenerForPrimaryResult = Result<(), i32>;
4485
4486pub trait ProviderProxyInterface: Send + Sync {
4487 type OpenCoordinatorWithListenerForVirtconResponseFut: std::future::Future<
4488 Output = Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error>,
4489 > + Send;
4490 fn r#open_coordinator_with_listener_for_virtcon(
4491 &self,
4492 payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4493 ) -> Self::OpenCoordinatorWithListenerForVirtconResponseFut;
4494 type OpenCoordinatorWithListenerForPrimaryResponseFut: std::future::Future<
4495 Output = Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error>,
4496 > + Send;
4497 fn r#open_coordinator_with_listener_for_primary(
4498 &self,
4499 payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4500 ) -> Self::OpenCoordinatorWithListenerForPrimaryResponseFut;
4501}
4502#[derive(Debug)]
4503#[cfg(target_os = "fuchsia")]
4504pub struct ProviderSynchronousProxy {
4505 client: fidl::client::sync::Client,
4506}
4507
4508#[cfg(target_os = "fuchsia")]
4509impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
4510 type Proxy = ProviderProxy;
4511 type Protocol = ProviderMarker;
4512
4513 fn from_channel(inner: fidl::Channel) -> Self {
4514 Self::new(inner)
4515 }
4516
4517 fn into_channel(self) -> fidl::Channel {
4518 self.client.into_channel()
4519 }
4520
4521 fn as_channel(&self) -> &fidl::Channel {
4522 self.client.as_channel()
4523 }
4524}
4525
4526#[cfg(target_os = "fuchsia")]
4527impl ProviderSynchronousProxy {
4528 pub fn new(channel: fidl::Channel) -> Self {
4529 let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4530 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4531 }
4532
4533 pub fn into_channel(self) -> fidl::Channel {
4534 self.client.into_channel()
4535 }
4536
4537 pub fn wait_for_event(
4540 &self,
4541 deadline: zx::MonotonicInstant,
4542 ) -> Result<ProviderEvent, fidl::Error> {
4543 ProviderEvent::decode(self.client.wait_for_event(deadline)?)
4544 }
4545
4546 pub fn r#open_coordinator_with_listener_for_virtcon(
4556 &self,
4557 mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4558 ___deadline: zx::MonotonicInstant,
4559 ) -> Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error> {
4560 let _response = self.client.send_query::<
4561 ProviderOpenCoordinatorWithListenerForVirtconRequest,
4562 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4563 >(
4564 &mut payload,
4565 0x154ac672633d9ec7,
4566 fidl::encoding::DynamicFlags::empty(),
4567 ___deadline,
4568 )?;
4569 Ok(_response.map(|x| x))
4570 }
4571
4572 pub fn r#open_coordinator_with_listener_for_primary(
4582 &self,
4583 mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4584 ___deadline: zx::MonotonicInstant,
4585 ) -> Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error> {
4586 let _response = self.client.send_query::<
4587 ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4588 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4589 >(
4590 &mut payload,
4591 0x635b6087ce4f6bfa,
4592 fidl::encoding::DynamicFlags::empty(),
4593 ___deadline,
4594 )?;
4595 Ok(_response.map(|x| x))
4596 }
4597}
4598
4599#[cfg(target_os = "fuchsia")]
4600impl From<ProviderSynchronousProxy> for zx::NullableHandle {
4601 fn from(value: ProviderSynchronousProxy) -> Self {
4602 value.into_channel().into()
4603 }
4604}
4605
4606#[cfg(target_os = "fuchsia")]
4607impl From<fidl::Channel> for ProviderSynchronousProxy {
4608 fn from(value: fidl::Channel) -> Self {
4609 Self::new(value)
4610 }
4611}
4612
4613#[cfg(target_os = "fuchsia")]
4614impl fidl::endpoints::FromClient for ProviderSynchronousProxy {
4615 type Protocol = ProviderMarker;
4616
4617 fn from_client(value: fidl::endpoints::ClientEnd<ProviderMarker>) -> Self {
4618 Self::new(value.into_channel())
4619 }
4620}
4621
4622#[derive(Debug, Clone)]
4623pub struct ProviderProxy {
4624 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4625}
4626
4627impl fidl::endpoints::Proxy for ProviderProxy {
4628 type Protocol = ProviderMarker;
4629
4630 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4631 Self::new(inner)
4632 }
4633
4634 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4635 self.client.into_channel().map_err(|client| Self { client })
4636 }
4637
4638 fn as_channel(&self) -> &::fidl::AsyncChannel {
4639 self.client.as_channel()
4640 }
4641}
4642
4643impl ProviderProxy {
4644 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4646 let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4647 Self { client: fidl::client::Client::new(channel, protocol_name) }
4648 }
4649
4650 pub fn take_event_stream(&self) -> ProviderEventStream {
4656 ProviderEventStream { event_receiver: self.client.take_event_receiver() }
4657 }
4658
4659 pub fn r#open_coordinator_with_listener_for_virtcon(
4669 &self,
4670 mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4671 ) -> fidl::client::QueryResponseFut<
4672 ProviderOpenCoordinatorWithListenerForVirtconResult,
4673 fidl::encoding::DefaultFuchsiaResourceDialect,
4674 > {
4675 ProviderProxyInterface::r#open_coordinator_with_listener_for_virtcon(self, payload)
4676 }
4677
4678 pub fn r#open_coordinator_with_listener_for_primary(
4688 &self,
4689 mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4690 ) -> fidl::client::QueryResponseFut<
4691 ProviderOpenCoordinatorWithListenerForPrimaryResult,
4692 fidl::encoding::DefaultFuchsiaResourceDialect,
4693 > {
4694 ProviderProxyInterface::r#open_coordinator_with_listener_for_primary(self, payload)
4695 }
4696}
4697
4698impl ProviderProxyInterface for ProviderProxy {
4699 type OpenCoordinatorWithListenerForVirtconResponseFut = fidl::client::QueryResponseFut<
4700 ProviderOpenCoordinatorWithListenerForVirtconResult,
4701 fidl::encoding::DefaultFuchsiaResourceDialect,
4702 >;
4703 fn r#open_coordinator_with_listener_for_virtcon(
4704 &self,
4705 mut payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4706 ) -> Self::OpenCoordinatorWithListenerForVirtconResponseFut {
4707 fn _decode(
4708 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4709 ) -> Result<ProviderOpenCoordinatorWithListenerForVirtconResult, fidl::Error> {
4710 let _response = fidl::client::decode_transaction_body::<
4711 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4712 fidl::encoding::DefaultFuchsiaResourceDialect,
4713 0x154ac672633d9ec7,
4714 >(_buf?)?;
4715 Ok(_response.map(|x| x))
4716 }
4717 self.client.send_query_and_decode::<
4718 ProviderOpenCoordinatorWithListenerForVirtconRequest,
4719 ProviderOpenCoordinatorWithListenerForVirtconResult,
4720 >(
4721 &mut payload,
4722 0x154ac672633d9ec7,
4723 fidl::encoding::DynamicFlags::empty(),
4724 _decode,
4725 )
4726 }
4727
4728 type OpenCoordinatorWithListenerForPrimaryResponseFut = fidl::client::QueryResponseFut<
4729 ProviderOpenCoordinatorWithListenerForPrimaryResult,
4730 fidl::encoding::DefaultFuchsiaResourceDialect,
4731 >;
4732 fn r#open_coordinator_with_listener_for_primary(
4733 &self,
4734 mut payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4735 ) -> Self::OpenCoordinatorWithListenerForPrimaryResponseFut {
4736 fn _decode(
4737 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4738 ) -> Result<ProviderOpenCoordinatorWithListenerForPrimaryResult, fidl::Error> {
4739 let _response = fidl::client::decode_transaction_body::<
4740 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4741 fidl::encoding::DefaultFuchsiaResourceDialect,
4742 0x635b6087ce4f6bfa,
4743 >(_buf?)?;
4744 Ok(_response.map(|x| x))
4745 }
4746 self.client.send_query_and_decode::<
4747 ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4748 ProviderOpenCoordinatorWithListenerForPrimaryResult,
4749 >(
4750 &mut payload,
4751 0x635b6087ce4f6bfa,
4752 fidl::encoding::DynamicFlags::empty(),
4753 _decode,
4754 )
4755 }
4756}
4757
4758pub struct ProviderEventStream {
4759 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4760}
4761
4762impl std::marker::Unpin for ProviderEventStream {}
4763
4764impl futures::stream::FusedStream for ProviderEventStream {
4765 fn is_terminated(&self) -> bool {
4766 self.event_receiver.is_terminated()
4767 }
4768}
4769
4770impl futures::Stream for ProviderEventStream {
4771 type Item = Result<ProviderEvent, fidl::Error>;
4772
4773 fn poll_next(
4774 mut self: std::pin::Pin<&mut Self>,
4775 cx: &mut std::task::Context<'_>,
4776 ) -> std::task::Poll<Option<Self::Item>> {
4777 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4778 &mut self.event_receiver,
4779 cx
4780 )?) {
4781 Some(buf) => std::task::Poll::Ready(Some(ProviderEvent::decode(buf))),
4782 None => std::task::Poll::Ready(None),
4783 }
4784 }
4785}
4786
4787#[derive(Debug)]
4788pub enum ProviderEvent {}
4789
4790impl ProviderEvent {
4791 fn decode(
4793 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4794 ) -> Result<ProviderEvent, fidl::Error> {
4795 let (bytes, _handles) = buf.split_mut();
4796 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4797 debug_assert_eq!(tx_header.tx_id, 0);
4798 match tx_header.ordinal {
4799 _ => Err(fidl::Error::UnknownOrdinal {
4800 ordinal: tx_header.ordinal,
4801 protocol_name: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4802 }),
4803 }
4804 }
4805}
4806
4807pub struct ProviderRequestStream {
4809 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4810 is_terminated: bool,
4811}
4812
4813impl std::marker::Unpin for ProviderRequestStream {}
4814
4815impl futures::stream::FusedStream for ProviderRequestStream {
4816 fn is_terminated(&self) -> bool {
4817 self.is_terminated
4818 }
4819}
4820
4821impl fidl::endpoints::RequestStream for ProviderRequestStream {
4822 type Protocol = ProviderMarker;
4823 type ControlHandle = ProviderControlHandle;
4824
4825 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4826 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4827 }
4828
4829 fn control_handle(&self) -> Self::ControlHandle {
4830 ProviderControlHandle { inner: self.inner.clone() }
4831 }
4832
4833 fn into_inner(
4834 self,
4835 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4836 {
4837 (self.inner, self.is_terminated)
4838 }
4839
4840 fn from_inner(
4841 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4842 is_terminated: bool,
4843 ) -> Self {
4844 Self { inner, is_terminated }
4845 }
4846}
4847
4848impl futures::Stream for ProviderRequestStream {
4849 type Item = Result<ProviderRequest, fidl::Error>;
4850
4851 fn poll_next(
4852 mut self: std::pin::Pin<&mut Self>,
4853 cx: &mut std::task::Context<'_>,
4854 ) -> std::task::Poll<Option<Self::Item>> {
4855 let this = &mut *self;
4856 if this.inner.check_shutdown(cx) {
4857 this.is_terminated = true;
4858 return std::task::Poll::Ready(None);
4859 }
4860 if this.is_terminated {
4861 panic!("polled ProviderRequestStream after completion");
4862 }
4863 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4864 |bytes, handles| {
4865 match this.inner.channel().read_etc(cx, bytes, handles) {
4866 std::task::Poll::Ready(Ok(())) => {}
4867 std::task::Poll::Pending => return std::task::Poll::Pending,
4868 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4869 this.is_terminated = true;
4870 return std::task::Poll::Ready(None);
4871 }
4872 std::task::Poll::Ready(Err(e)) => {
4873 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4874 e.into(),
4875 ))));
4876 }
4877 }
4878
4879 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4881
4882 std::task::Poll::Ready(Some(match header.ordinal {
4883 0x154ac672633d9ec7 => {
4884 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4885 let mut req = fidl::new_empty!(
4886 ProviderOpenCoordinatorWithListenerForVirtconRequest,
4887 fidl::encoding::DefaultFuchsiaResourceDialect
4888 );
4889 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorWithListenerForVirtconRequest>(&header, _body_bytes, handles, &mut req)?;
4890 let control_handle = ProviderControlHandle { inner: this.inner.clone() };
4891 Ok(ProviderRequest::OpenCoordinatorWithListenerForVirtcon {
4892 payload: req,
4893 responder: ProviderOpenCoordinatorWithListenerForVirtconResponder {
4894 control_handle: std::mem::ManuallyDrop::new(control_handle),
4895 tx_id: header.tx_id,
4896 },
4897 })
4898 }
4899 0x635b6087ce4f6bfa => {
4900 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4901 let mut req = fidl::new_empty!(
4902 ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4903 fidl::encoding::DefaultFuchsiaResourceDialect
4904 );
4905 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorWithListenerForPrimaryRequest>(&header, _body_bytes, handles, &mut req)?;
4906 let control_handle = ProviderControlHandle { inner: this.inner.clone() };
4907 Ok(ProviderRequest::OpenCoordinatorWithListenerForPrimary {
4908 payload: req,
4909 responder: ProviderOpenCoordinatorWithListenerForPrimaryResponder {
4910 control_handle: std::mem::ManuallyDrop::new(control_handle),
4911 tx_id: header.tx_id,
4912 },
4913 })
4914 }
4915 _ => Err(fidl::Error::UnknownOrdinal {
4916 ordinal: header.ordinal,
4917 protocol_name:
4918 <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4919 }),
4920 }))
4921 },
4922 )
4923 }
4924}
4925
4926#[derive(Debug)]
4933pub enum ProviderRequest {
4934 OpenCoordinatorWithListenerForVirtcon {
4944 payload: ProviderOpenCoordinatorWithListenerForVirtconRequest,
4945 responder: ProviderOpenCoordinatorWithListenerForVirtconResponder,
4946 },
4947 OpenCoordinatorWithListenerForPrimary {
4957 payload: ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4958 responder: ProviderOpenCoordinatorWithListenerForPrimaryResponder,
4959 },
4960}
4961
4962impl ProviderRequest {
4963 #[allow(irrefutable_let_patterns)]
4964 pub fn into_open_coordinator_with_listener_for_virtcon(
4965 self,
4966 ) -> Option<(
4967 ProviderOpenCoordinatorWithListenerForVirtconRequest,
4968 ProviderOpenCoordinatorWithListenerForVirtconResponder,
4969 )> {
4970 if let ProviderRequest::OpenCoordinatorWithListenerForVirtcon { payload, responder } = self
4971 {
4972 Some((payload, responder))
4973 } else {
4974 None
4975 }
4976 }
4977
4978 #[allow(irrefutable_let_patterns)]
4979 pub fn into_open_coordinator_with_listener_for_primary(
4980 self,
4981 ) -> Option<(
4982 ProviderOpenCoordinatorWithListenerForPrimaryRequest,
4983 ProviderOpenCoordinatorWithListenerForPrimaryResponder,
4984 )> {
4985 if let ProviderRequest::OpenCoordinatorWithListenerForPrimary { payload, responder } = self
4986 {
4987 Some((payload, responder))
4988 } else {
4989 None
4990 }
4991 }
4992
4993 pub fn method_name(&self) -> &'static str {
4995 match *self {
4996 ProviderRequest::OpenCoordinatorWithListenerForVirtcon { .. } => {
4997 "open_coordinator_with_listener_for_virtcon"
4998 }
4999 ProviderRequest::OpenCoordinatorWithListenerForPrimary { .. } => {
5000 "open_coordinator_with_listener_for_primary"
5001 }
5002 }
5003 }
5004}
5005
5006#[derive(Debug, Clone)]
5007pub struct ProviderControlHandle {
5008 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5009}
5010
5011impl fidl::endpoints::ControlHandle for ProviderControlHandle {
5012 fn shutdown(&self) {
5013 self.inner.shutdown()
5014 }
5015
5016 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5017 self.inner.shutdown_with_epitaph(status)
5018 }
5019
5020 fn is_closed(&self) -> bool {
5021 self.inner.channel().is_closed()
5022 }
5023 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5024 self.inner.channel().on_closed()
5025 }
5026
5027 #[cfg(target_os = "fuchsia")]
5028 fn signal_peer(
5029 &self,
5030 clear_mask: zx::Signals,
5031 set_mask: zx::Signals,
5032 ) -> Result<(), zx_status::Status> {
5033 use fidl::Peered;
5034 self.inner.channel().signal_peer(clear_mask, set_mask)
5035 }
5036}
5037
5038impl ProviderControlHandle {}
5039
5040#[must_use = "FIDL methods require a response to be sent"]
5041#[derive(Debug)]
5042pub struct ProviderOpenCoordinatorWithListenerForVirtconResponder {
5043 control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
5044 tx_id: u32,
5045}
5046
5047impl std::ops::Drop for ProviderOpenCoordinatorWithListenerForVirtconResponder {
5051 fn drop(&mut self) {
5052 self.control_handle.shutdown();
5053 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5055 }
5056}
5057
5058impl fidl::endpoints::Responder for ProviderOpenCoordinatorWithListenerForVirtconResponder {
5059 type ControlHandle = ProviderControlHandle;
5060
5061 fn control_handle(&self) -> &ProviderControlHandle {
5062 &self.control_handle
5063 }
5064
5065 fn drop_without_shutdown(mut self) {
5066 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5068 std::mem::forget(self);
5070 }
5071}
5072
5073impl ProviderOpenCoordinatorWithListenerForVirtconResponder {
5074 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5078 let _result = self.send_raw(result);
5079 if _result.is_err() {
5080 self.control_handle.shutdown();
5081 }
5082 self.drop_without_shutdown();
5083 _result
5084 }
5085
5086 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5088 let _result = self.send_raw(result);
5089 self.drop_without_shutdown();
5090 _result
5091 }
5092
5093 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5094 self.control_handle
5095 .inner
5096 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5097 result,
5098 self.tx_id,
5099 0x154ac672633d9ec7,
5100 fidl::encoding::DynamicFlags::empty(),
5101 )
5102 }
5103}
5104
5105#[must_use = "FIDL methods require a response to be sent"]
5106#[derive(Debug)]
5107pub struct ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5108 control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
5109 tx_id: u32,
5110}
5111
5112impl std::ops::Drop for ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5116 fn drop(&mut self) {
5117 self.control_handle.shutdown();
5118 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5120 }
5121}
5122
5123impl fidl::endpoints::Responder for ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5124 type ControlHandle = ProviderControlHandle;
5125
5126 fn control_handle(&self) -> &ProviderControlHandle {
5127 &self.control_handle
5128 }
5129
5130 fn drop_without_shutdown(mut self) {
5131 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5133 std::mem::forget(self);
5135 }
5136}
5137
5138impl ProviderOpenCoordinatorWithListenerForPrimaryResponder {
5139 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5143 let _result = self.send_raw(result);
5144 if _result.is_err() {
5145 self.control_handle.shutdown();
5146 }
5147 self.drop_without_shutdown();
5148 _result
5149 }
5150
5151 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5153 let _result = self.send_raw(result);
5154 self.drop_without_shutdown();
5155 _result
5156 }
5157
5158 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5159 self.control_handle
5160 .inner
5161 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5162 result,
5163 self.tx_id,
5164 0x635b6087ce4f6bfa,
5165 fidl::encoding::DynamicFlags::empty(),
5166 )
5167 }
5168}
5169
5170#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5171pub struct ServiceMarker;
5172
5173#[cfg(target_os = "fuchsia")]
5174impl fidl::endpoints::ServiceMarker for ServiceMarker {
5175 type Proxy = ServiceProxy;
5176 type Request = ServiceRequest;
5177 const SERVICE_NAME: &'static str = "fuchsia.hardware.display.Service";
5178}
5179
5180#[cfg(target_os = "fuchsia")]
5183pub enum ServiceRequest {
5184 Provider(ProviderRequestStream),
5185}
5186
5187#[cfg(target_os = "fuchsia")]
5188impl fidl::endpoints::ServiceRequest for ServiceRequest {
5189 type Service = ServiceMarker;
5190
5191 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
5192 match name {
5193 "provider" => Self::Provider(
5194 <ProviderRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
5195 ),
5196 _ => panic!("no such member protocol name for service Service"),
5197 }
5198 }
5199
5200 fn member_names() -> &'static [&'static str] {
5201 &["provider"]
5202 }
5203}
5204#[cfg(target_os = "fuchsia")]
5205pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
5206
5207#[cfg(target_os = "fuchsia")]
5208impl fidl::endpoints::ServiceProxy for ServiceProxy {
5209 type Service = ServiceMarker;
5210
5211 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
5212 Self(opener)
5213 }
5214}
5215
5216#[cfg(target_os = "fuchsia")]
5217impl ServiceProxy {
5218 pub fn connect_to_provider(&self) -> Result<ProviderProxy, fidl::Error> {
5219 let (proxy, server_end) = fidl::endpoints::create_proxy::<ProviderMarker>();
5220 self.connect_channel_to_provider(server_end)?;
5221 Ok(proxy)
5222 }
5223
5224 pub fn connect_to_provider_sync(&self) -> Result<ProviderSynchronousProxy, fidl::Error> {
5227 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ProviderMarker>();
5228 self.connect_channel_to_provider(server_end)?;
5229 Ok(proxy)
5230 }
5231
5232 pub fn connect_channel_to_provider(
5235 &self,
5236 server_end: fidl::endpoints::ServerEnd<ProviderMarker>,
5237 ) -> Result<(), fidl::Error> {
5238 self.0.open_member("provider", server_end.into_channel())
5239 }
5240
5241 pub fn instance_name(&self) -> &str {
5242 self.0.instance_name()
5243 }
5244}
5245
5246mod internal {
5247 use super::*;
5248
5249 impl fidl::encoding::ResourceTypeMarker for CoordinatorImportBufferCollectionRequest {
5250 type Borrowed<'a> = &'a mut Self;
5251 fn take_or_borrow<'a>(
5252 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5253 ) -> Self::Borrowed<'a> {
5254 value
5255 }
5256 }
5257
5258 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportBufferCollectionRequest {
5259 type Owned = Self;
5260
5261 #[inline(always)]
5262 fn inline_align(_context: fidl::encoding::Context) -> usize {
5263 8
5264 }
5265
5266 #[inline(always)]
5267 fn inline_size(_context: fidl::encoding::Context) -> usize {
5268 16
5269 }
5270 }
5271
5272 unsafe impl
5273 fidl::encoding::Encode<
5274 CoordinatorImportBufferCollectionRequest,
5275 fidl::encoding::DefaultFuchsiaResourceDialect,
5276 > for &mut CoordinatorImportBufferCollectionRequest
5277 {
5278 #[inline]
5279 unsafe fn encode(
5280 self,
5281 encoder: &mut fidl::encoding::Encoder<
5282 '_,
5283 fidl::encoding::DefaultFuchsiaResourceDialect,
5284 >,
5285 offset: usize,
5286 _depth: fidl::encoding::Depth,
5287 ) -> fidl::Result<()> {
5288 encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
5289 fidl::encoding::Encode::<
5291 CoordinatorImportBufferCollectionRequest,
5292 fidl::encoding::DefaultFuchsiaResourceDialect,
5293 >::encode(
5294 (
5295 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(
5296 &self.buffer_collection_id,
5297 ),
5298 <fidl::encoding::Endpoint<
5299 fidl::endpoints::ClientEnd<
5300 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5301 >,
5302 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5303 &mut self.buffer_collection_token,
5304 ),
5305 ),
5306 encoder,
5307 offset,
5308 _depth,
5309 )
5310 }
5311 }
5312 unsafe impl<
5313 T0: fidl::encoding::Encode<BufferCollectionId, fidl::encoding::DefaultFuchsiaResourceDialect>,
5314 T1: fidl::encoding::Encode<
5315 fidl::encoding::Endpoint<
5316 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5317 >,
5318 fidl::encoding::DefaultFuchsiaResourceDialect,
5319 >,
5320 >
5321 fidl::encoding::Encode<
5322 CoordinatorImportBufferCollectionRequest,
5323 fidl::encoding::DefaultFuchsiaResourceDialect,
5324 > for (T0, T1)
5325 {
5326 #[inline]
5327 unsafe fn encode(
5328 self,
5329 encoder: &mut fidl::encoding::Encoder<
5330 '_,
5331 fidl::encoding::DefaultFuchsiaResourceDialect,
5332 >,
5333 offset: usize,
5334 depth: fidl::encoding::Depth,
5335 ) -> fidl::Result<()> {
5336 encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
5337 unsafe {
5340 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5341 (ptr as *mut u64).write_unaligned(0);
5342 }
5343 self.0.encode(encoder, offset + 0, depth)?;
5345 self.1.encode(encoder, offset + 8, depth)?;
5346 Ok(())
5347 }
5348 }
5349
5350 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5351 for CoordinatorImportBufferCollectionRequest
5352 {
5353 #[inline(always)]
5354 fn new_empty() -> Self {
5355 Self {
5356 buffer_collection_id: fidl::new_empty!(
5357 BufferCollectionId,
5358 fidl::encoding::DefaultFuchsiaResourceDialect
5359 ),
5360 buffer_collection_token: fidl::new_empty!(
5361 fidl::encoding::Endpoint<
5362 fidl::endpoints::ClientEnd<
5363 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5364 >,
5365 >,
5366 fidl::encoding::DefaultFuchsiaResourceDialect
5367 ),
5368 }
5369 }
5370
5371 #[inline]
5372 unsafe fn decode(
5373 &mut self,
5374 decoder: &mut fidl::encoding::Decoder<
5375 '_,
5376 fidl::encoding::DefaultFuchsiaResourceDialect,
5377 >,
5378 offset: usize,
5379 _depth: fidl::encoding::Depth,
5380 ) -> fidl::Result<()> {
5381 decoder.debug_check_bounds::<Self>(offset);
5382 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5384 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5385 let mask = 0xffffffff00000000u64;
5386 let maskedval = padval & mask;
5387 if maskedval != 0 {
5388 return Err(fidl::Error::NonZeroPadding {
5389 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5390 });
5391 }
5392 fidl::decode!(
5393 BufferCollectionId,
5394 fidl::encoding::DefaultFuchsiaResourceDialect,
5395 &mut self.buffer_collection_id,
5396 decoder,
5397 offset + 0,
5398 _depth
5399 )?;
5400 fidl::decode!(
5401 fidl::encoding::Endpoint<
5402 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5403 >,
5404 fidl::encoding::DefaultFuchsiaResourceDialect,
5405 &mut self.buffer_collection_token,
5406 decoder,
5407 offset + 8,
5408 _depth
5409 )?;
5410 Ok(())
5411 }
5412 }
5413
5414 impl fidl::encoding::ResourceTypeMarker for CoordinatorImportEventRequest {
5415 type Borrowed<'a> = &'a mut Self;
5416 fn take_or_borrow<'a>(
5417 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5418 ) -> Self::Borrowed<'a> {
5419 value
5420 }
5421 }
5422
5423 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportEventRequest {
5424 type Owned = Self;
5425
5426 #[inline(always)]
5427 fn inline_align(_context: fidl::encoding::Context) -> usize {
5428 8
5429 }
5430
5431 #[inline(always)]
5432 fn inline_size(_context: fidl::encoding::Context) -> usize {
5433 16
5434 }
5435 }
5436
5437 unsafe impl
5438 fidl::encoding::Encode<
5439 CoordinatorImportEventRequest,
5440 fidl::encoding::DefaultFuchsiaResourceDialect,
5441 > for &mut CoordinatorImportEventRequest
5442 {
5443 #[inline]
5444 unsafe fn encode(
5445 self,
5446 encoder: &mut fidl::encoding::Encoder<
5447 '_,
5448 fidl::encoding::DefaultFuchsiaResourceDialect,
5449 >,
5450 offset: usize,
5451 _depth: fidl::encoding::Depth,
5452 ) -> fidl::Result<()> {
5453 encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
5454 fidl::encoding::Encode::<
5456 CoordinatorImportEventRequest,
5457 fidl::encoding::DefaultFuchsiaResourceDialect,
5458 >::encode(
5459 (
5460 <fidl::encoding::HandleType<
5461 fidl::Event,
5462 { fidl::ObjectType::EVENT.into_raw() },
5463 2147483648,
5464 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5465 &mut self.event
5466 ),
5467 <EventId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
5468 ),
5469 encoder,
5470 offset,
5471 _depth,
5472 )
5473 }
5474 }
5475 unsafe impl<
5476 T0: fidl::encoding::Encode<
5477 fidl::encoding::HandleType<
5478 fidl::Event,
5479 { fidl::ObjectType::EVENT.into_raw() },
5480 2147483648,
5481 >,
5482 fidl::encoding::DefaultFuchsiaResourceDialect,
5483 >,
5484 T1: fidl::encoding::Encode<EventId, fidl::encoding::DefaultFuchsiaResourceDialect>,
5485 >
5486 fidl::encoding::Encode<
5487 CoordinatorImportEventRequest,
5488 fidl::encoding::DefaultFuchsiaResourceDialect,
5489 > for (T0, T1)
5490 {
5491 #[inline]
5492 unsafe fn encode(
5493 self,
5494 encoder: &mut fidl::encoding::Encoder<
5495 '_,
5496 fidl::encoding::DefaultFuchsiaResourceDialect,
5497 >,
5498 offset: usize,
5499 depth: fidl::encoding::Depth,
5500 ) -> fidl::Result<()> {
5501 encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
5502 unsafe {
5505 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5506 (ptr as *mut u64).write_unaligned(0);
5507 }
5508 self.0.encode(encoder, offset + 0, depth)?;
5510 self.1.encode(encoder, offset + 8, depth)?;
5511 Ok(())
5512 }
5513 }
5514
5515 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5516 for CoordinatorImportEventRequest
5517 {
5518 #[inline(always)]
5519 fn new_empty() -> Self {
5520 Self {
5521 event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5522 id: fidl::new_empty!(EventId, fidl::encoding::DefaultFuchsiaResourceDialect),
5523 }
5524 }
5525
5526 #[inline]
5527 unsafe fn decode(
5528 &mut self,
5529 decoder: &mut fidl::encoding::Decoder<
5530 '_,
5531 fidl::encoding::DefaultFuchsiaResourceDialect,
5532 >,
5533 offset: usize,
5534 _depth: fidl::encoding::Depth,
5535 ) -> fidl::Result<()> {
5536 decoder.debug_check_bounds::<Self>(offset);
5537 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5539 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5540 let mask = 0xffffffff00000000u64;
5541 let maskedval = padval & mask;
5542 if maskedval != 0 {
5543 return Err(fidl::Error::NonZeroPadding {
5544 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5545 });
5546 }
5547 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
5548 fidl::decode!(
5549 EventId,
5550 fidl::encoding::DefaultFuchsiaResourceDialect,
5551 &mut self.id,
5552 decoder,
5553 offset + 8,
5554 _depth
5555 )?;
5556 Ok(())
5557 }
5558 }
5559
5560 impl CoordinatorApplyConfig3Request {
5561 #[inline(always)]
5562 fn max_ordinal_present(&self) -> u64 {
5563 if let Some(_) = self.stamp {
5564 return 1;
5565 }
5566 0
5567 }
5568 }
5569
5570 impl fidl::encoding::ResourceTypeMarker for CoordinatorApplyConfig3Request {
5571 type Borrowed<'a> = &'a mut Self;
5572 fn take_or_borrow<'a>(
5573 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5574 ) -> Self::Borrowed<'a> {
5575 value
5576 }
5577 }
5578
5579 unsafe impl fidl::encoding::TypeMarker for CoordinatorApplyConfig3Request {
5580 type Owned = Self;
5581
5582 #[inline(always)]
5583 fn inline_align(_context: fidl::encoding::Context) -> usize {
5584 8
5585 }
5586
5587 #[inline(always)]
5588 fn inline_size(_context: fidl::encoding::Context) -> usize {
5589 16
5590 }
5591 }
5592
5593 unsafe impl
5594 fidl::encoding::Encode<
5595 CoordinatorApplyConfig3Request,
5596 fidl::encoding::DefaultFuchsiaResourceDialect,
5597 > for &mut CoordinatorApplyConfig3Request
5598 {
5599 unsafe fn encode(
5600 self,
5601 encoder: &mut fidl::encoding::Encoder<
5602 '_,
5603 fidl::encoding::DefaultFuchsiaResourceDialect,
5604 >,
5605 offset: usize,
5606 mut depth: fidl::encoding::Depth,
5607 ) -> fidl::Result<()> {
5608 encoder.debug_check_bounds::<CoordinatorApplyConfig3Request>(offset);
5609 let max_ordinal: u64 = self.max_ordinal_present();
5611 encoder.write_num(max_ordinal, offset);
5612 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5613 if max_ordinal == 0 {
5615 return Ok(());
5616 }
5617 depth.increment()?;
5618 let envelope_size = 8;
5619 let bytes_len = max_ordinal as usize * envelope_size;
5620 #[allow(unused_variables)]
5621 let offset = encoder.out_of_line_offset(bytes_len);
5622 let mut _prev_end_offset: usize = 0;
5623 if 1 > max_ordinal {
5624 return Ok(());
5625 }
5626
5627 let cur_offset: usize = (1 - 1) * envelope_size;
5630
5631 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5633
5634 fidl::encoding::encode_in_envelope_optional::<
5639 ConfigStamp,
5640 fidl::encoding::DefaultFuchsiaResourceDialect,
5641 >(
5642 self.stamp.as_ref().map(<ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow),
5643 encoder,
5644 offset + cur_offset,
5645 depth,
5646 )?;
5647
5648 _prev_end_offset = cur_offset + envelope_size;
5649
5650 Ok(())
5651 }
5652 }
5653
5654 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5655 for CoordinatorApplyConfig3Request
5656 {
5657 #[inline(always)]
5658 fn new_empty() -> Self {
5659 Self::default()
5660 }
5661
5662 unsafe fn decode(
5663 &mut self,
5664 decoder: &mut fidl::encoding::Decoder<
5665 '_,
5666 fidl::encoding::DefaultFuchsiaResourceDialect,
5667 >,
5668 offset: usize,
5669 mut depth: fidl::encoding::Depth,
5670 ) -> fidl::Result<()> {
5671 decoder.debug_check_bounds::<Self>(offset);
5672 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5673 None => return Err(fidl::Error::NotNullable),
5674 Some(len) => len,
5675 };
5676 if len == 0 {
5678 return Ok(());
5679 };
5680 depth.increment()?;
5681 let envelope_size = 8;
5682 let bytes_len = len * envelope_size;
5683 let offset = decoder.out_of_line_offset(bytes_len)?;
5684 let mut _next_ordinal_to_read = 0;
5686 let mut next_offset = offset;
5687 let end_offset = offset + bytes_len;
5688 _next_ordinal_to_read += 1;
5689 if next_offset >= end_offset {
5690 return Ok(());
5691 }
5692
5693 while _next_ordinal_to_read < 1 {
5695 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5696 _next_ordinal_to_read += 1;
5697 next_offset += envelope_size;
5698 }
5699
5700 let next_out_of_line = decoder.next_out_of_line();
5701 let handles_before = decoder.remaining_handles();
5702 if let Some((inlined, num_bytes, num_handles)) =
5703 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5704 {
5705 let member_inline_size =
5706 <ConfigStamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5707 if inlined != (member_inline_size <= 4) {
5708 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5709 }
5710 let inner_offset;
5711 let mut inner_depth = depth.clone();
5712 if inlined {
5713 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5714 inner_offset = next_offset;
5715 } else {
5716 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5717 inner_depth.increment()?;
5718 }
5719 let val_ref = self.stamp.get_or_insert_with(|| {
5720 fidl::new_empty!(ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect)
5721 });
5722 fidl::decode!(
5723 ConfigStamp,
5724 fidl::encoding::DefaultFuchsiaResourceDialect,
5725 val_ref,
5726 decoder,
5727 inner_offset,
5728 inner_depth
5729 )?;
5730 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5731 {
5732 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5733 }
5734 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5735 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5736 }
5737 }
5738
5739 next_offset += envelope_size;
5740
5741 while next_offset < end_offset {
5743 _next_ordinal_to_read += 1;
5744 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5745 next_offset += envelope_size;
5746 }
5747
5748 Ok(())
5749 }
5750 }
5751
5752 impl ProviderOpenCoordinatorWithListenerForPrimaryRequest {
5753 #[inline(always)]
5754 fn max_ordinal_present(&self) -> u64 {
5755 if let Some(_) = self.coordinator_listener {
5756 return 2;
5757 }
5758 if let Some(_) = self.coordinator {
5759 return 1;
5760 }
5761 0
5762 }
5763 }
5764
5765 impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorWithListenerForPrimaryRequest {
5766 type Borrowed<'a> = &'a mut Self;
5767 fn take_or_borrow<'a>(
5768 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5769 ) -> Self::Borrowed<'a> {
5770 value
5771 }
5772 }
5773
5774 unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorWithListenerForPrimaryRequest {
5775 type Owned = Self;
5776
5777 #[inline(always)]
5778 fn inline_align(_context: fidl::encoding::Context) -> usize {
5779 8
5780 }
5781
5782 #[inline(always)]
5783 fn inline_size(_context: fidl::encoding::Context) -> usize {
5784 16
5785 }
5786 }
5787
5788 unsafe impl
5789 fidl::encoding::Encode<
5790 ProviderOpenCoordinatorWithListenerForPrimaryRequest,
5791 fidl::encoding::DefaultFuchsiaResourceDialect,
5792 > for &mut ProviderOpenCoordinatorWithListenerForPrimaryRequest
5793 {
5794 unsafe fn encode(
5795 self,
5796 encoder: &mut fidl::encoding::Encoder<
5797 '_,
5798 fidl::encoding::DefaultFuchsiaResourceDialect,
5799 >,
5800 offset: usize,
5801 mut depth: fidl::encoding::Depth,
5802 ) -> fidl::Result<()> {
5803 encoder
5804 .debug_check_bounds::<ProviderOpenCoordinatorWithListenerForPrimaryRequest>(offset);
5805 let max_ordinal: u64 = self.max_ordinal_present();
5807 encoder.write_num(max_ordinal, offset);
5808 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5809 if max_ordinal == 0 {
5811 return Ok(());
5812 }
5813 depth.increment()?;
5814 let envelope_size = 8;
5815 let bytes_len = max_ordinal as usize * envelope_size;
5816 #[allow(unused_variables)]
5817 let offset = encoder.out_of_line_offset(bytes_len);
5818 let mut _prev_end_offset: usize = 0;
5819 if 1 > max_ordinal {
5820 return Ok(());
5821 }
5822
5823 let cur_offset: usize = (1 - 1) * envelope_size;
5826
5827 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5829
5830 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5835 self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5836 encoder, offset + cur_offset, depth
5837 )?;
5838
5839 _prev_end_offset = cur_offset + envelope_size;
5840 if 2 > max_ordinal {
5841 return Ok(());
5842 }
5843
5844 let cur_offset: usize = (2 - 1) * envelope_size;
5847
5848 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5850
5851 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5856 self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5857 encoder, offset + cur_offset, depth
5858 )?;
5859
5860 _prev_end_offset = cur_offset + envelope_size;
5861
5862 Ok(())
5863 }
5864 }
5865
5866 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5867 for ProviderOpenCoordinatorWithListenerForPrimaryRequest
5868 {
5869 #[inline(always)]
5870 fn new_empty() -> Self {
5871 Self::default()
5872 }
5873
5874 unsafe fn decode(
5875 &mut self,
5876 decoder: &mut fidl::encoding::Decoder<
5877 '_,
5878 fidl::encoding::DefaultFuchsiaResourceDialect,
5879 >,
5880 offset: usize,
5881 mut depth: fidl::encoding::Depth,
5882 ) -> fidl::Result<()> {
5883 decoder.debug_check_bounds::<Self>(offset);
5884 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5885 None => return Err(fidl::Error::NotNullable),
5886 Some(len) => len,
5887 };
5888 if len == 0 {
5890 return Ok(());
5891 };
5892 depth.increment()?;
5893 let envelope_size = 8;
5894 let bytes_len = len * envelope_size;
5895 let offset = decoder.out_of_line_offset(bytes_len)?;
5896 let mut _next_ordinal_to_read = 0;
5898 let mut next_offset = offset;
5899 let end_offset = offset + bytes_len;
5900 _next_ordinal_to_read += 1;
5901 if next_offset >= end_offset {
5902 return Ok(());
5903 }
5904
5905 while _next_ordinal_to_read < 1 {
5907 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5908 _next_ordinal_to_read += 1;
5909 next_offset += envelope_size;
5910 }
5911
5912 let next_out_of_line = decoder.next_out_of_line();
5913 let handles_before = decoder.remaining_handles();
5914 if let Some((inlined, num_bytes, num_handles)) =
5915 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5916 {
5917 let member_inline_size = <fidl::encoding::Endpoint<
5918 fidl::endpoints::ServerEnd<CoordinatorMarker>,
5919 > as fidl::encoding::TypeMarker>::inline_size(
5920 decoder.context
5921 );
5922 if inlined != (member_inline_size <= 4) {
5923 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5924 }
5925 let inner_offset;
5926 let mut inner_depth = depth.clone();
5927 if inlined {
5928 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5929 inner_offset = next_offset;
5930 } else {
5931 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5932 inner_depth.increment()?;
5933 }
5934 let val_ref = self.coordinator.get_or_insert_with(|| {
5935 fidl::new_empty!(
5936 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
5937 fidl::encoding::DefaultFuchsiaResourceDialect
5938 )
5939 });
5940 fidl::decode!(
5941 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
5942 fidl::encoding::DefaultFuchsiaResourceDialect,
5943 val_ref,
5944 decoder,
5945 inner_offset,
5946 inner_depth
5947 )?;
5948 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5949 {
5950 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5951 }
5952 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5953 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5954 }
5955 }
5956
5957 next_offset += envelope_size;
5958 _next_ordinal_to_read += 1;
5959 if next_offset >= end_offset {
5960 return Ok(());
5961 }
5962
5963 while _next_ordinal_to_read < 2 {
5965 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5966 _next_ordinal_to_read += 1;
5967 next_offset += envelope_size;
5968 }
5969
5970 let next_out_of_line = decoder.next_out_of_line();
5971 let handles_before = decoder.remaining_handles();
5972 if let Some((inlined, num_bytes, num_handles)) =
5973 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5974 {
5975 let member_inline_size = <fidl::encoding::Endpoint<
5976 fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
5977 > as fidl::encoding::TypeMarker>::inline_size(
5978 decoder.context
5979 );
5980 if inlined != (member_inline_size <= 4) {
5981 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5982 }
5983 let inner_offset;
5984 let mut inner_depth = depth.clone();
5985 if inlined {
5986 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5987 inner_offset = next_offset;
5988 } else {
5989 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5990 inner_depth.increment()?;
5991 }
5992 let val_ref = self.coordinator_listener.get_or_insert_with(|| {
5993 fidl::new_empty!(
5994 fidl::encoding::Endpoint<
5995 fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
5996 >,
5997 fidl::encoding::DefaultFuchsiaResourceDialect
5998 )
5999 });
6000 fidl::decode!(
6001 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
6002 fidl::encoding::DefaultFuchsiaResourceDialect,
6003 val_ref,
6004 decoder,
6005 inner_offset,
6006 inner_depth
6007 )?;
6008 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6009 {
6010 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6011 }
6012 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6013 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6014 }
6015 }
6016
6017 next_offset += envelope_size;
6018
6019 while next_offset < end_offset {
6021 _next_ordinal_to_read += 1;
6022 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6023 next_offset += envelope_size;
6024 }
6025
6026 Ok(())
6027 }
6028 }
6029
6030 impl ProviderOpenCoordinatorWithListenerForVirtconRequest {
6031 #[inline(always)]
6032 fn max_ordinal_present(&self) -> u64 {
6033 if let Some(_) = self.coordinator_listener {
6034 return 2;
6035 }
6036 if let Some(_) = self.coordinator {
6037 return 1;
6038 }
6039 0
6040 }
6041 }
6042
6043 impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorWithListenerForVirtconRequest {
6044 type Borrowed<'a> = &'a mut Self;
6045 fn take_or_borrow<'a>(
6046 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6047 ) -> Self::Borrowed<'a> {
6048 value
6049 }
6050 }
6051
6052 unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorWithListenerForVirtconRequest {
6053 type Owned = Self;
6054
6055 #[inline(always)]
6056 fn inline_align(_context: fidl::encoding::Context) -> usize {
6057 8
6058 }
6059
6060 #[inline(always)]
6061 fn inline_size(_context: fidl::encoding::Context) -> usize {
6062 16
6063 }
6064 }
6065
6066 unsafe impl
6067 fidl::encoding::Encode<
6068 ProviderOpenCoordinatorWithListenerForVirtconRequest,
6069 fidl::encoding::DefaultFuchsiaResourceDialect,
6070 > for &mut ProviderOpenCoordinatorWithListenerForVirtconRequest
6071 {
6072 unsafe fn encode(
6073 self,
6074 encoder: &mut fidl::encoding::Encoder<
6075 '_,
6076 fidl::encoding::DefaultFuchsiaResourceDialect,
6077 >,
6078 offset: usize,
6079 mut depth: fidl::encoding::Depth,
6080 ) -> fidl::Result<()> {
6081 encoder
6082 .debug_check_bounds::<ProviderOpenCoordinatorWithListenerForVirtconRequest>(offset);
6083 let max_ordinal: u64 = self.max_ordinal_present();
6085 encoder.write_num(max_ordinal, offset);
6086 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6087 if max_ordinal == 0 {
6089 return Ok(());
6090 }
6091 depth.increment()?;
6092 let envelope_size = 8;
6093 let bytes_len = max_ordinal as usize * envelope_size;
6094 #[allow(unused_variables)]
6095 let offset = encoder.out_of_line_offset(bytes_len);
6096 let mut _prev_end_offset: usize = 0;
6097 if 1 > max_ordinal {
6098 return Ok(());
6099 }
6100
6101 let cur_offset: usize = (1 - 1) * envelope_size;
6104
6105 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6107
6108 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6113 self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6114 encoder, offset + cur_offset, depth
6115 )?;
6116
6117 _prev_end_offset = cur_offset + envelope_size;
6118 if 2 > max_ordinal {
6119 return Ok(());
6120 }
6121
6122 let cur_offset: usize = (2 - 1) * envelope_size;
6125
6126 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6128
6129 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
6134 self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
6135 encoder, offset + cur_offset, depth
6136 )?;
6137
6138 _prev_end_offset = cur_offset + envelope_size;
6139
6140 Ok(())
6141 }
6142 }
6143
6144 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6145 for ProviderOpenCoordinatorWithListenerForVirtconRequest
6146 {
6147 #[inline(always)]
6148 fn new_empty() -> Self {
6149 Self::default()
6150 }
6151
6152 unsafe fn decode(
6153 &mut self,
6154 decoder: &mut fidl::encoding::Decoder<
6155 '_,
6156 fidl::encoding::DefaultFuchsiaResourceDialect,
6157 >,
6158 offset: usize,
6159 mut depth: fidl::encoding::Depth,
6160 ) -> fidl::Result<()> {
6161 decoder.debug_check_bounds::<Self>(offset);
6162 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6163 None => return Err(fidl::Error::NotNullable),
6164 Some(len) => len,
6165 };
6166 if len == 0 {
6168 return Ok(());
6169 };
6170 depth.increment()?;
6171 let envelope_size = 8;
6172 let bytes_len = len * envelope_size;
6173 let offset = decoder.out_of_line_offset(bytes_len)?;
6174 let mut _next_ordinal_to_read = 0;
6176 let mut next_offset = offset;
6177 let end_offset = offset + bytes_len;
6178 _next_ordinal_to_read += 1;
6179 if next_offset >= end_offset {
6180 return Ok(());
6181 }
6182
6183 while _next_ordinal_to_read < 1 {
6185 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6186 _next_ordinal_to_read += 1;
6187 next_offset += envelope_size;
6188 }
6189
6190 let next_out_of_line = decoder.next_out_of_line();
6191 let handles_before = decoder.remaining_handles();
6192 if let Some((inlined, num_bytes, num_handles)) =
6193 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6194 {
6195 let member_inline_size = <fidl::encoding::Endpoint<
6196 fidl::endpoints::ServerEnd<CoordinatorMarker>,
6197 > as fidl::encoding::TypeMarker>::inline_size(
6198 decoder.context
6199 );
6200 if inlined != (member_inline_size <= 4) {
6201 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6202 }
6203 let inner_offset;
6204 let mut inner_depth = depth.clone();
6205 if inlined {
6206 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6207 inner_offset = next_offset;
6208 } else {
6209 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6210 inner_depth.increment()?;
6211 }
6212 let val_ref = self.coordinator.get_or_insert_with(|| {
6213 fidl::new_empty!(
6214 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
6215 fidl::encoding::DefaultFuchsiaResourceDialect
6216 )
6217 });
6218 fidl::decode!(
6219 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
6220 fidl::encoding::DefaultFuchsiaResourceDialect,
6221 val_ref,
6222 decoder,
6223 inner_offset,
6224 inner_depth
6225 )?;
6226 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6227 {
6228 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6229 }
6230 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6231 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6232 }
6233 }
6234
6235 next_offset += envelope_size;
6236 _next_ordinal_to_read += 1;
6237 if next_offset >= end_offset {
6238 return Ok(());
6239 }
6240
6241 while _next_ordinal_to_read < 2 {
6243 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6244 _next_ordinal_to_read += 1;
6245 next_offset += envelope_size;
6246 }
6247
6248 let next_out_of_line = decoder.next_out_of_line();
6249 let handles_before = decoder.remaining_handles();
6250 if let Some((inlined, num_bytes, num_handles)) =
6251 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6252 {
6253 let member_inline_size = <fidl::encoding::Endpoint<
6254 fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
6255 > as fidl::encoding::TypeMarker>::inline_size(
6256 decoder.context
6257 );
6258 if inlined != (member_inline_size <= 4) {
6259 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6260 }
6261 let inner_offset;
6262 let mut inner_depth = depth.clone();
6263 if inlined {
6264 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6265 inner_offset = next_offset;
6266 } else {
6267 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6268 inner_depth.increment()?;
6269 }
6270 let val_ref = self.coordinator_listener.get_or_insert_with(|| {
6271 fidl::new_empty!(
6272 fidl::encoding::Endpoint<
6273 fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
6274 >,
6275 fidl::encoding::DefaultFuchsiaResourceDialect
6276 )
6277 });
6278 fidl::decode!(
6279 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
6280 fidl::encoding::DefaultFuchsiaResourceDialect,
6281 val_ref,
6282 decoder,
6283 inner_offset,
6284 inner_depth
6285 )?;
6286 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6287 {
6288 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6289 }
6290 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6291 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6292 }
6293 }
6294
6295 next_offset += envelope_size;
6296
6297 while next_offset < end_offset {
6299 _next_ordinal_to_read += 1;
6300 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6301 next_offset += envelope_size;
6302 }
6303
6304 Ok(())
6305 }
6306 }
6307}