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 CoordinatorCommitConfigRequest {
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 CoordinatorCommitConfigRequest
47{
48}
49
50#[derive(Debug, Default, PartialEq)]
51pub struct ProviderOpenCoordinatorRequest {
52 pub coordinator: Option<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
54 pub coordinator_listener: Option<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
56 pub priority: Option<ClientPriority>,
58 #[doc(hidden)]
59 pub __source_breaking: fidl::marker::SourceBreaking,
60}
61
62impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
63 for ProviderOpenCoordinatorRequest
64{
65}
66
67#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
68pub struct CoordinatorMarker;
69
70impl fidl::endpoints::ProtocolMarker for CoordinatorMarker {
71 type Proxy = CoordinatorProxy;
72 type RequestStream = CoordinatorRequestStream;
73 #[cfg(target_os = "fuchsia")]
74 type SynchronousProxy = CoordinatorSynchronousProxy;
75
76 const DEBUG_NAME: &'static str = "(anonymous) Coordinator";
77}
78pub type CoordinatorImportImageResult = Result<(), i32>;
79pub type CoordinatorCreateLayerResult = Result<(), i32>;
80pub type CoordinatorImportBufferCollectionResult = Result<(), i32>;
81pub type CoordinatorSetBufferCollectionConstraintsResult = Result<(), i32>;
82pub type CoordinatorIsCaptureSupportedResult = Result<bool, i32>;
83pub type CoordinatorStartCaptureResult = Result<(), i32>;
84pub type CoordinatorSetMinimumRgbResult = Result<(), i32>;
85pub type CoordinatorSetDisplayPowerModeResult = Result<(), i32>;
86
87pub trait CoordinatorProxyInterface: Send + Sync {
88 type ImportImageResponseFut: std::future::Future<Output = Result<CoordinatorImportImageResult, fidl::Error>>
89 + Send;
90 fn r#import_image(
91 &self,
92 image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
93 buffer_collection_id: &BufferCollectionId,
94 buffer_index: u32,
95 image_id: &ImageId,
96 ) -> Self::ImportImageResponseFut;
97 fn r#release_image(&self, image_id: &ImageId) -> Result<(), fidl::Error>;
98 fn r#import_event(&self, event: fidl::Event, id: &EventId) -> Result<(), fidl::Error>;
99 fn r#release_event(&self, id: &EventId) -> Result<(), fidl::Error>;
100 type CreateLayerResponseFut: std::future::Future<Output = Result<CoordinatorCreateLayerResult, fidl::Error>>
101 + Send;
102 fn r#create_layer(&self, layer_id: &LayerId) -> Self::CreateLayerResponseFut;
103 fn r#destroy_layer(&self, layer_id: &LayerId) -> Result<(), fidl::Error>;
104 fn r#set_display_mode(
105 &self,
106 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
107 mode: &fidl_fuchsia_hardware_display_types::Mode,
108 ) -> Result<(), fidl::Error>;
109 fn r#set_display_color_conversion(
110 &self,
111 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
112 preoffsets: &[f32; 3],
113 coefficients: &[f32; 9],
114 postoffsets: &[f32; 3],
115 ) -> Result<(), fidl::Error>;
116 fn r#set_display_layers(
117 &self,
118 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
119 layer_ids: &[LayerId],
120 ) -> Result<(), fidl::Error>;
121 fn r#set_layer_primary_config(
122 &self,
123 layer_id: &LayerId,
124 image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
125 ) -> Result<(), fidl::Error>;
126 fn r#set_layer_primary_position(
127 &self,
128 layer_id: &LayerId,
129 image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
130 image_source: &fidl_fuchsia_math::RectU,
131 display_destination: &fidl_fuchsia_math::RectU,
132 ) -> Result<(), fidl::Error>;
133 fn r#set_layer_primary_alpha(
134 &self,
135 layer_id: &LayerId,
136 mode: fidl_fuchsia_hardware_display_types::AlphaMode,
137 val: f32,
138 ) -> Result<(), fidl::Error>;
139 fn r#set_layer_color_config(
140 &self,
141 layer_id: &LayerId,
142 color: &fidl_fuchsia_hardware_display_types::Color,
143 display_destination: &fidl_fuchsia_math::RectU,
144 ) -> Result<(), fidl::Error>;
145 fn r#set_layer_image2(
146 &self,
147 layer_id: &LayerId,
148 image_id: &ImageId,
149 wait_event_id: &EventId,
150 ) -> Result<(), fidl::Error>;
151 type CheckConfigResponseFut: std::future::Future<
152 Output = Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error>,
153 > + Send;
154 fn r#check_config(&self) -> Self::CheckConfigResponseFut;
155 fn r#discard_config(&self) -> Result<(), fidl::Error>;
156 type GetLatestCommittedConfigStampResponseFut: std::future::Future<Output = Result<ConfigStamp, fidl::Error>>
157 + Send;
158 fn r#get_latest_committed_config_stamp(&self)
159 -> Self::GetLatestCommittedConfigStampResponseFut;
160 fn r#commit_config(&self, payload: CoordinatorCommitConfigRequest) -> Result<(), fidl::Error>;
161 fn r#acknowledge_vsync(&self, cookie: u64) -> Result<(), fidl::Error>;
162 type ImportBufferCollectionResponseFut: std::future::Future<Output = Result<CoordinatorImportBufferCollectionResult, fidl::Error>>
163 + Send;
164 fn r#import_buffer_collection(
165 &self,
166 buffer_collection_id: &BufferCollectionId,
167 buffer_collection_token: fidl::endpoints::ClientEnd<
168 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
169 >,
170 ) -> Self::ImportBufferCollectionResponseFut;
171 fn r#release_buffer_collection(
172 &self,
173 buffer_collection_id: &BufferCollectionId,
174 ) -> Result<(), fidl::Error>;
175 type SetBufferCollectionConstraintsResponseFut: std::future::Future<
176 Output = Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error>,
177 > + Send;
178 fn r#set_buffer_collection_constraints(
179 &self,
180 buffer_collection_id: &BufferCollectionId,
181 buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
182 ) -> Self::SetBufferCollectionConstraintsResponseFut;
183 type IsCaptureSupportedResponseFut: std::future::Future<Output = Result<CoordinatorIsCaptureSupportedResult, fidl::Error>>
184 + Send;
185 fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut;
186 type StartCaptureResponseFut: std::future::Future<Output = Result<CoordinatorStartCaptureResult, fidl::Error>>
187 + Send;
188 fn r#start_capture(
189 &self,
190 signal_event_id: &EventId,
191 image_id: &ImageId,
192 ) -> Self::StartCaptureResponseFut;
193 type SetMinimumRgbResponseFut: std::future::Future<Output = Result<CoordinatorSetMinimumRgbResult, fidl::Error>>
194 + Send;
195 fn r#set_minimum_rgb(&self, minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut;
196 type SetDisplayPowerModeResponseFut: std::future::Future<Output = Result<CoordinatorSetDisplayPowerModeResult, fidl::Error>>
197 + Send;
198 fn r#set_display_power_mode(
199 &self,
200 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
201 power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
202 ) -> Self::SetDisplayPowerModeResponseFut;
203}
204#[derive(Debug)]
205#[cfg(target_os = "fuchsia")]
206pub struct CoordinatorSynchronousProxy {
207 client: fidl::client::sync::Client,
208}
209
210#[cfg(target_os = "fuchsia")]
211impl fidl::endpoints::SynchronousProxy for CoordinatorSynchronousProxy {
212 type Proxy = CoordinatorProxy;
213 type Protocol = CoordinatorMarker;
214
215 fn from_channel(inner: fidl::Channel) -> Self {
216 Self::new(inner)
217 }
218
219 fn into_channel(self) -> fidl::Channel {
220 self.client.into_channel()
221 }
222
223 fn as_channel(&self) -> &fidl::Channel {
224 self.client.as_channel()
225 }
226}
227
228#[cfg(target_os = "fuchsia")]
229impl CoordinatorSynchronousProxy {
230 pub fn new(channel: fidl::Channel) -> Self {
231 Self { client: fidl::client::sync::Client::new(channel) }
232 }
233
234 pub fn into_channel(self) -> fidl::Channel {
235 self.client.into_channel()
236 }
237
238 pub fn wait_for_event(
241 &self,
242 deadline: zx::MonotonicInstant,
243 ) -> Result<CoordinatorEvent, fidl::Error> {
244 CoordinatorEvent::decode(self.client.wait_for_event::<CoordinatorMarker>(deadline)?)
245 }
246
247 pub fn r#import_image(
262 &self,
263 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
264 mut buffer_collection_id: &BufferCollectionId,
265 mut buffer_index: u32,
266 mut image_id: &ImageId,
267 ___deadline: zx::MonotonicInstant,
268 ) -> Result<CoordinatorImportImageResult, fidl::Error> {
269 let _response = self.client.send_query::<
270 CoordinatorImportImageRequest,
271 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
272 CoordinatorMarker,
273 >(
274 (image_metadata, buffer_collection_id, buffer_index, image_id,),
275 0x3a8636eb9656b4f4,
276 fidl::encoding::DynamicFlags::empty(),
277 ___deadline,
278 )?;
279 Ok(_response.map(|x| x))
280 }
281
282 pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
295 self.client.send::<CoordinatorReleaseImageRequest>(
296 (image_id,),
297 0x477192230517504,
298 fidl::encoding::DynamicFlags::empty(),
299 )
300 }
301
302 pub fn r#import_event(
311 &self,
312 mut event: fidl::Event,
313 mut id: &EventId,
314 ) -> Result<(), fidl::Error> {
315 self.client.send::<CoordinatorImportEventRequest>(
316 (event, id),
317 0x2864e5dc59390543,
318 fidl::encoding::DynamicFlags::empty(),
319 )
320 }
321
322 pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
329 self.client.send::<CoordinatorReleaseEventRequest>(
330 (id,),
331 0x32508c2101606b87,
332 fidl::encoding::DynamicFlags::empty(),
333 )
334 }
335
336 pub fn r#create_layer(
348 &self,
349 mut layer_id: &LayerId,
350 ___deadline: zx::MonotonicInstant,
351 ) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
352 let _response = self.client.send_query::<
353 CoordinatorCreateLayerRequest,
354 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
355 CoordinatorMarker,
356 >(
357 (layer_id,),
358 0x2137cfd788a3496b,
359 fidl::encoding::DynamicFlags::empty(),
360 ___deadline,
361 )?;
362 Ok(_response.map(|x| x))
363 }
364
365 pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
369 self.client.send::<CoordinatorDestroyLayerRequest>(
370 (layer_id,),
371 0x386e12d092bea2f8,
372 fidl::encoding::DynamicFlags::empty(),
373 )
374 }
375
376 pub fn r#set_display_mode(
378 &self,
379 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
380 mut mode: &fidl_fuchsia_hardware_display_types::Mode,
381 ) -> Result<(), fidl::Error> {
382 self.client.send::<CoordinatorSetDisplayModeRequest>(
383 (display_id, mode),
384 0xbde3c59ee9c1777,
385 fidl::encoding::DynamicFlags::empty(),
386 )
387 }
388
389 pub fn r#set_display_color_conversion(
416 &self,
417 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
418 mut preoffsets: &[f32; 3],
419 mut coefficients: &[f32; 9],
420 mut postoffsets: &[f32; 3],
421 ) -> Result<(), fidl::Error> {
422 self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
423 (display_id, preoffsets, coefficients, postoffsets),
424 0x2f18186a987d51aa,
425 fidl::encoding::DynamicFlags::empty(),
426 )
427 }
428
429 pub fn r#set_display_layers(
431 &self,
432 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
433 mut layer_ids: &[LayerId],
434 ) -> Result<(), fidl::Error> {
435 self.client.send::<CoordinatorSetDisplayLayersRequest>(
436 (display_id, layer_ids),
437 0x190e0f6f93be1d89,
438 fidl::encoding::DynamicFlags::empty(),
439 )
440 }
441
442 pub fn r#set_layer_primary_config(
451 &self,
452 mut layer_id: &LayerId,
453 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
454 ) -> Result<(), fidl::Error> {
455 self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
456 (layer_id, image_metadata),
457 0x68d89ebd518b45b9,
458 fidl::encoding::DynamicFlags::empty(),
459 )
460 }
461
462 pub fn r#set_layer_primary_position(
470 &self,
471 mut layer_id: &LayerId,
472 mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
473 mut image_source: &fidl_fuchsia_math::RectU,
474 mut display_destination: &fidl_fuchsia_math::RectU,
475 ) -> Result<(), fidl::Error> {
476 self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
477 (layer_id, image_source_transformation, image_source, display_destination),
478 0x27b192b5a43851e2,
479 fidl::encoding::DynamicFlags::empty(),
480 )
481 }
482
483 pub fn r#set_layer_primary_alpha(
499 &self,
500 mut layer_id: &LayerId,
501 mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
502 mut val: f32,
503 ) -> Result<(), fidl::Error> {
504 self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
505 (layer_id, mode, val),
506 0x104cf2b18b27296d,
507 fidl::encoding::DynamicFlags::empty(),
508 )
509 }
510
511 pub fn r#set_layer_color_config(
515 &self,
516 mut layer_id: &LayerId,
517 mut color: &fidl_fuchsia_hardware_display_types::Color,
518 mut display_destination: &fidl_fuchsia_math::RectU,
519 ) -> Result<(), fidl::Error> {
520 self.client.send::<CoordinatorSetLayerColorConfigRequest>(
521 (layer_id, color, display_destination),
522 0x2fa91e9a2a01875f,
523 fidl::encoding::DynamicFlags::empty(),
524 )
525 }
526
527 pub fn r#set_layer_image2(
566 &self,
567 mut layer_id: &LayerId,
568 mut image_id: &ImageId,
569 mut wait_event_id: &EventId,
570 ) -> Result<(), fidl::Error> {
571 self.client.send::<CoordinatorSetLayerImage2Request>(
572 (layer_id, image_id, wait_event_id),
573 0x53c6376dfc13a971,
574 fidl::encoding::DynamicFlags::empty(),
575 )
576 }
577
578 pub fn r#check_config(
587 &self,
588 ___deadline: zx::MonotonicInstant,
589 ) -> Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error> {
590 let _response = self.client.send_query::<
591 fidl::encoding::EmptyPayload,
592 CoordinatorCheckConfigResponse,
593 CoordinatorMarker,
594 >(
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_committed_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 CoordinatorGetLatestCommittedConfigStampResponse,
624 CoordinatorMarker,
625 >(
626 (),
627 0x2a441f2c81af5d66,
628 fidl::encoding::DynamicFlags::empty(),
629 ___deadline,
630 )?;
631 Ok(_response.stamp)
632 }
633
634 pub fn r#commit_config(
641 &self,
642 mut payload: CoordinatorCommitConfigRequest,
643 ) -> Result<(), fidl::Error> {
644 self.client.send::<CoordinatorCommitConfigRequest>(
645 &mut payload,
646 0x4489cbd2fcfbaeaf,
647 fidl::encoding::DynamicFlags::empty(),
648 )
649 }
650
651 pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
653 self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
654 (cookie,),
655 0x25e921d26107d6ef,
656 fidl::encoding::DynamicFlags::empty(),
657 )
658 }
659
660 pub fn r#import_buffer_collection(
663 &self,
664 mut buffer_collection_id: &BufferCollectionId,
665 mut buffer_collection_token: fidl::endpoints::ClientEnd<
666 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
667 >,
668 ___deadline: zx::MonotonicInstant,
669 ) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
670 let _response = self.client.send_query::<
671 CoordinatorImportBufferCollectionRequest,
672 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
673 CoordinatorMarker,
674 >(
675 (buffer_collection_id, buffer_collection_token,),
676 0x30d06f510e7f4601,
677 fidl::encoding::DynamicFlags::empty(),
678 ___deadline,
679 )?;
680 Ok(_response.map(|x| x))
681 }
682
683 pub fn r#release_buffer_collection(
685 &self,
686 mut buffer_collection_id: &BufferCollectionId,
687 ) -> Result<(), fidl::Error> {
688 self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
689 (buffer_collection_id,),
690 0x1c7dd5f8b0690be0,
691 fidl::encoding::DynamicFlags::empty(),
692 )
693 }
694
695 pub fn r#set_buffer_collection_constraints(
698 &self,
699 mut buffer_collection_id: &BufferCollectionId,
700 mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
701 ___deadline: zx::MonotonicInstant,
702 ) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
703 let _response = self.client.send_query::<
704 CoordinatorSetBufferCollectionConstraintsRequest,
705 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
706 CoordinatorMarker,
707 >(
708 (buffer_collection_id, buffer_usage,),
709 0x509a4ee9af6035df,
710 fidl::encoding::DynamicFlags::empty(),
711 ___deadline,
712 )?;
713 Ok(_response.map(|x| x))
714 }
715
716 pub fn r#is_capture_supported(
718 &self,
719 ___deadline: zx::MonotonicInstant,
720 ) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
721 let _response = self.client.send_query::<
722 fidl::encoding::EmptyPayload,
723 fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
724 CoordinatorMarker,
725 >(
726 (),
727 0x4ca407277277971b,
728 fidl::encoding::DynamicFlags::empty(),
729 ___deadline,
730 )?;
731 Ok(_response.map(|x| x.supported))
732 }
733
734 pub fn r#start_capture(
740 &self,
741 mut signal_event_id: &EventId,
742 mut image_id: &ImageId,
743 ___deadline: zx::MonotonicInstant,
744 ) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
745 let _response = self.client.send_query::<
746 CoordinatorStartCaptureRequest,
747 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
748 CoordinatorMarker,
749 >(
750 (signal_event_id, image_id,),
751 0x35cb38f19d96a8db,
752 fidl::encoding::DynamicFlags::empty(),
753 ___deadline,
754 )?;
755 Ok(_response.map(|x| x))
756 }
757
758 pub fn r#set_minimum_rgb(
769 &self,
770 mut minimum_rgb: u8,
771 ___deadline: zx::MonotonicInstant,
772 ) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
773 let _response = self.client.send_query::<
774 CoordinatorSetMinimumRgbRequest,
775 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
776 CoordinatorMarker,
777 >(
778 (minimum_rgb,),
779 0x1b49251437038b0b,
780 fidl::encoding::DynamicFlags::empty(),
781 ___deadline,
782 )?;
783 Ok(_response.map(|x| x))
784 }
785
786 pub fn r#set_display_power_mode(
803 &self,
804 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
805 mut power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
806 ___deadline: zx::MonotonicInstant,
807 ) -> Result<CoordinatorSetDisplayPowerModeResult, fidl::Error> {
808 let _response = self.client.send_query::<
809 CoordinatorSetDisplayPowerModeRequest,
810 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
811 CoordinatorMarker,
812 >(
813 (display_id, power_mode,),
814 0xf4672f055072c92,
815 fidl::encoding::DynamicFlags::empty(),
816 ___deadline,
817 )?;
818 Ok(_response.map(|x| x))
819 }
820}
821
822#[cfg(target_os = "fuchsia")]
823impl From<CoordinatorSynchronousProxy> for zx::NullableHandle {
824 fn from(value: CoordinatorSynchronousProxy) -> Self {
825 value.into_channel().into()
826 }
827}
828
829#[cfg(target_os = "fuchsia")]
830impl From<fidl::Channel> for CoordinatorSynchronousProxy {
831 fn from(value: fidl::Channel) -> Self {
832 Self::new(value)
833 }
834}
835
836#[cfg(target_os = "fuchsia")]
837impl fidl::endpoints::FromClient for CoordinatorSynchronousProxy {
838 type Protocol = CoordinatorMarker;
839
840 fn from_client(value: fidl::endpoints::ClientEnd<CoordinatorMarker>) -> Self {
841 Self::new(value.into_channel())
842 }
843}
844
845#[derive(Debug, Clone)]
846pub struct CoordinatorProxy {
847 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
848}
849
850impl fidl::endpoints::Proxy for CoordinatorProxy {
851 type Protocol = CoordinatorMarker;
852
853 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
854 Self::new(inner)
855 }
856
857 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
858 self.client.into_channel().map_err(|client| Self { client })
859 }
860
861 fn as_channel(&self) -> &::fidl::AsyncChannel {
862 self.client.as_channel()
863 }
864}
865
866impl CoordinatorProxy {
867 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
869 let protocol_name = <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
870 Self { client: fidl::client::Client::new(channel, protocol_name) }
871 }
872
873 pub fn take_event_stream(&self) -> CoordinatorEventStream {
879 CoordinatorEventStream { event_receiver: self.client.take_event_receiver() }
880 }
881
882 pub fn r#import_image(
897 &self,
898 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
899 mut buffer_collection_id: &BufferCollectionId,
900 mut buffer_index: u32,
901 mut image_id: &ImageId,
902 ) -> fidl::client::QueryResponseFut<
903 CoordinatorImportImageResult,
904 fidl::encoding::DefaultFuchsiaResourceDialect,
905 > {
906 CoordinatorProxyInterface::r#import_image(
907 self,
908 image_metadata,
909 buffer_collection_id,
910 buffer_index,
911 image_id,
912 )
913 }
914
915 pub fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
928 CoordinatorProxyInterface::r#release_image(self, image_id)
929 }
930
931 pub fn r#import_event(
940 &self,
941 mut event: fidl::Event,
942 mut id: &EventId,
943 ) -> Result<(), fidl::Error> {
944 CoordinatorProxyInterface::r#import_event(self, event, id)
945 }
946
947 pub fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
954 CoordinatorProxyInterface::r#release_event(self, id)
955 }
956
957 pub fn r#create_layer(
969 &self,
970 mut layer_id: &LayerId,
971 ) -> fidl::client::QueryResponseFut<
972 CoordinatorCreateLayerResult,
973 fidl::encoding::DefaultFuchsiaResourceDialect,
974 > {
975 CoordinatorProxyInterface::r#create_layer(self, layer_id)
976 }
977
978 pub fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
982 CoordinatorProxyInterface::r#destroy_layer(self, layer_id)
983 }
984
985 pub fn r#set_display_mode(
987 &self,
988 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
989 mut mode: &fidl_fuchsia_hardware_display_types::Mode,
990 ) -> Result<(), fidl::Error> {
991 CoordinatorProxyInterface::r#set_display_mode(self, display_id, mode)
992 }
993
994 pub fn r#set_display_color_conversion(
1021 &self,
1022 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1023 mut preoffsets: &[f32; 3],
1024 mut coefficients: &[f32; 9],
1025 mut postoffsets: &[f32; 3],
1026 ) -> Result<(), fidl::Error> {
1027 CoordinatorProxyInterface::r#set_display_color_conversion(
1028 self,
1029 display_id,
1030 preoffsets,
1031 coefficients,
1032 postoffsets,
1033 )
1034 }
1035
1036 pub fn r#set_display_layers(
1038 &self,
1039 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1040 mut layer_ids: &[LayerId],
1041 ) -> Result<(), fidl::Error> {
1042 CoordinatorProxyInterface::r#set_display_layers(self, display_id, layer_ids)
1043 }
1044
1045 pub fn r#set_layer_primary_config(
1054 &self,
1055 mut layer_id: &LayerId,
1056 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1057 ) -> Result<(), fidl::Error> {
1058 CoordinatorProxyInterface::r#set_layer_primary_config(self, layer_id, image_metadata)
1059 }
1060
1061 pub fn r#set_layer_primary_position(
1069 &self,
1070 mut layer_id: &LayerId,
1071 mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
1072 mut image_source: &fidl_fuchsia_math::RectU,
1073 mut display_destination: &fidl_fuchsia_math::RectU,
1074 ) -> Result<(), fidl::Error> {
1075 CoordinatorProxyInterface::r#set_layer_primary_position(
1076 self,
1077 layer_id,
1078 image_source_transformation,
1079 image_source,
1080 display_destination,
1081 )
1082 }
1083
1084 pub fn r#set_layer_primary_alpha(
1100 &self,
1101 mut layer_id: &LayerId,
1102 mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
1103 mut val: f32,
1104 ) -> Result<(), fidl::Error> {
1105 CoordinatorProxyInterface::r#set_layer_primary_alpha(self, layer_id, mode, val)
1106 }
1107
1108 pub fn r#set_layer_color_config(
1112 &self,
1113 mut layer_id: &LayerId,
1114 mut color: &fidl_fuchsia_hardware_display_types::Color,
1115 mut display_destination: &fidl_fuchsia_math::RectU,
1116 ) -> Result<(), fidl::Error> {
1117 CoordinatorProxyInterface::r#set_layer_color_config(
1118 self,
1119 layer_id,
1120 color,
1121 display_destination,
1122 )
1123 }
1124
1125 pub fn r#set_layer_image2(
1164 &self,
1165 mut layer_id: &LayerId,
1166 mut image_id: &ImageId,
1167 mut wait_event_id: &EventId,
1168 ) -> Result<(), fidl::Error> {
1169 CoordinatorProxyInterface::r#set_layer_image2(self, layer_id, image_id, wait_event_id)
1170 }
1171
1172 pub fn r#check_config(
1181 &self,
1182 ) -> fidl::client::QueryResponseFut<
1183 fidl_fuchsia_hardware_display_types::ConfigResult,
1184 fidl::encoding::DefaultFuchsiaResourceDialect,
1185 > {
1186 CoordinatorProxyInterface::r#check_config(self)
1187 }
1188
1189 pub fn r#discard_config(&self) -> Result<(), fidl::Error> {
1191 CoordinatorProxyInterface::r#discard_config(self)
1192 }
1193
1194 pub fn r#get_latest_committed_config_stamp(
1200 &self,
1201 ) -> fidl::client::QueryResponseFut<ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>
1202 {
1203 CoordinatorProxyInterface::r#get_latest_committed_config_stamp(self)
1204 }
1205
1206 pub fn r#commit_config(
1213 &self,
1214 mut payload: CoordinatorCommitConfigRequest,
1215 ) -> Result<(), fidl::Error> {
1216 CoordinatorProxyInterface::r#commit_config(self, payload)
1217 }
1218
1219 pub fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
1221 CoordinatorProxyInterface::r#acknowledge_vsync(self, cookie)
1222 }
1223
1224 pub fn r#import_buffer_collection(
1227 &self,
1228 mut buffer_collection_id: &BufferCollectionId,
1229 mut buffer_collection_token: fidl::endpoints::ClientEnd<
1230 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
1231 >,
1232 ) -> fidl::client::QueryResponseFut<
1233 CoordinatorImportBufferCollectionResult,
1234 fidl::encoding::DefaultFuchsiaResourceDialect,
1235 > {
1236 CoordinatorProxyInterface::r#import_buffer_collection(
1237 self,
1238 buffer_collection_id,
1239 buffer_collection_token,
1240 )
1241 }
1242
1243 pub fn r#release_buffer_collection(
1245 &self,
1246 mut buffer_collection_id: &BufferCollectionId,
1247 ) -> Result<(), fidl::Error> {
1248 CoordinatorProxyInterface::r#release_buffer_collection(self, buffer_collection_id)
1249 }
1250
1251 pub fn r#set_buffer_collection_constraints(
1254 &self,
1255 mut buffer_collection_id: &BufferCollectionId,
1256 mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
1257 ) -> fidl::client::QueryResponseFut<
1258 CoordinatorSetBufferCollectionConstraintsResult,
1259 fidl::encoding::DefaultFuchsiaResourceDialect,
1260 > {
1261 CoordinatorProxyInterface::r#set_buffer_collection_constraints(
1262 self,
1263 buffer_collection_id,
1264 buffer_usage,
1265 )
1266 }
1267
1268 pub fn r#is_capture_supported(
1270 &self,
1271 ) -> fidl::client::QueryResponseFut<
1272 CoordinatorIsCaptureSupportedResult,
1273 fidl::encoding::DefaultFuchsiaResourceDialect,
1274 > {
1275 CoordinatorProxyInterface::r#is_capture_supported(self)
1276 }
1277
1278 pub fn r#start_capture(
1284 &self,
1285 mut signal_event_id: &EventId,
1286 mut image_id: &ImageId,
1287 ) -> fidl::client::QueryResponseFut<
1288 CoordinatorStartCaptureResult,
1289 fidl::encoding::DefaultFuchsiaResourceDialect,
1290 > {
1291 CoordinatorProxyInterface::r#start_capture(self, signal_event_id, image_id)
1292 }
1293
1294 pub fn r#set_minimum_rgb(
1305 &self,
1306 mut minimum_rgb: u8,
1307 ) -> fidl::client::QueryResponseFut<
1308 CoordinatorSetMinimumRgbResult,
1309 fidl::encoding::DefaultFuchsiaResourceDialect,
1310 > {
1311 CoordinatorProxyInterface::r#set_minimum_rgb(self, minimum_rgb)
1312 }
1313
1314 pub fn r#set_display_power_mode(
1331 &self,
1332 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1333 mut power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
1334 ) -> fidl::client::QueryResponseFut<
1335 CoordinatorSetDisplayPowerModeResult,
1336 fidl::encoding::DefaultFuchsiaResourceDialect,
1337 > {
1338 CoordinatorProxyInterface::r#set_display_power_mode(self, display_id, power_mode)
1339 }
1340}
1341
1342impl CoordinatorProxyInterface for CoordinatorProxy {
1343 type ImportImageResponseFut = fidl::client::QueryResponseFut<
1344 CoordinatorImportImageResult,
1345 fidl::encoding::DefaultFuchsiaResourceDialect,
1346 >;
1347 fn r#import_image(
1348 &self,
1349 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1350 mut buffer_collection_id: &BufferCollectionId,
1351 mut buffer_index: u32,
1352 mut image_id: &ImageId,
1353 ) -> Self::ImportImageResponseFut {
1354 fn _decode(
1355 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1356 ) -> Result<CoordinatorImportImageResult, fidl::Error> {
1357 let _response = fidl::client::decode_transaction_body::<
1358 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1359 fidl::encoding::DefaultFuchsiaResourceDialect,
1360 0x3a8636eb9656b4f4,
1361 >(_buf?)?;
1362 Ok(_response.map(|x| x))
1363 }
1364 self.client
1365 .send_query_and_decode::<CoordinatorImportImageRequest, CoordinatorImportImageResult>(
1366 (image_metadata, buffer_collection_id, buffer_index, image_id),
1367 0x3a8636eb9656b4f4,
1368 fidl::encoding::DynamicFlags::empty(),
1369 _decode,
1370 )
1371 }
1372
1373 fn r#release_image(&self, mut image_id: &ImageId) -> Result<(), fidl::Error> {
1374 self.client.send::<CoordinatorReleaseImageRequest>(
1375 (image_id,),
1376 0x477192230517504,
1377 fidl::encoding::DynamicFlags::empty(),
1378 )
1379 }
1380
1381 fn r#import_event(&self, mut event: fidl::Event, mut id: &EventId) -> Result<(), fidl::Error> {
1382 self.client.send::<CoordinatorImportEventRequest>(
1383 (event, id),
1384 0x2864e5dc59390543,
1385 fidl::encoding::DynamicFlags::empty(),
1386 )
1387 }
1388
1389 fn r#release_event(&self, mut id: &EventId) -> Result<(), fidl::Error> {
1390 self.client.send::<CoordinatorReleaseEventRequest>(
1391 (id,),
1392 0x32508c2101606b87,
1393 fidl::encoding::DynamicFlags::empty(),
1394 )
1395 }
1396
1397 type CreateLayerResponseFut = fidl::client::QueryResponseFut<
1398 CoordinatorCreateLayerResult,
1399 fidl::encoding::DefaultFuchsiaResourceDialect,
1400 >;
1401 fn r#create_layer(&self, mut layer_id: &LayerId) -> Self::CreateLayerResponseFut {
1402 fn _decode(
1403 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1404 ) -> Result<CoordinatorCreateLayerResult, fidl::Error> {
1405 let _response = fidl::client::decode_transaction_body::<
1406 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1407 fidl::encoding::DefaultFuchsiaResourceDialect,
1408 0x2137cfd788a3496b,
1409 >(_buf?)?;
1410 Ok(_response.map(|x| x))
1411 }
1412 self.client
1413 .send_query_and_decode::<CoordinatorCreateLayerRequest, CoordinatorCreateLayerResult>(
1414 (layer_id,),
1415 0x2137cfd788a3496b,
1416 fidl::encoding::DynamicFlags::empty(),
1417 _decode,
1418 )
1419 }
1420
1421 fn r#destroy_layer(&self, mut layer_id: &LayerId) -> Result<(), fidl::Error> {
1422 self.client.send::<CoordinatorDestroyLayerRequest>(
1423 (layer_id,),
1424 0x386e12d092bea2f8,
1425 fidl::encoding::DynamicFlags::empty(),
1426 )
1427 }
1428
1429 fn r#set_display_mode(
1430 &self,
1431 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1432 mut mode: &fidl_fuchsia_hardware_display_types::Mode,
1433 ) -> Result<(), fidl::Error> {
1434 self.client.send::<CoordinatorSetDisplayModeRequest>(
1435 (display_id, mode),
1436 0xbde3c59ee9c1777,
1437 fidl::encoding::DynamicFlags::empty(),
1438 )
1439 }
1440
1441 fn r#set_display_color_conversion(
1442 &self,
1443 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1444 mut preoffsets: &[f32; 3],
1445 mut coefficients: &[f32; 9],
1446 mut postoffsets: &[f32; 3],
1447 ) -> Result<(), fidl::Error> {
1448 self.client.send::<CoordinatorSetDisplayColorConversionRequest>(
1449 (display_id, preoffsets, coefficients, postoffsets),
1450 0x2f18186a987d51aa,
1451 fidl::encoding::DynamicFlags::empty(),
1452 )
1453 }
1454
1455 fn r#set_display_layers(
1456 &self,
1457 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1458 mut layer_ids: &[LayerId],
1459 ) -> Result<(), fidl::Error> {
1460 self.client.send::<CoordinatorSetDisplayLayersRequest>(
1461 (display_id, layer_ids),
1462 0x190e0f6f93be1d89,
1463 fidl::encoding::DynamicFlags::empty(),
1464 )
1465 }
1466
1467 fn r#set_layer_primary_config(
1468 &self,
1469 mut layer_id: &LayerId,
1470 mut image_metadata: &fidl_fuchsia_hardware_display_types::ImageMetadata,
1471 ) -> Result<(), fidl::Error> {
1472 self.client.send::<CoordinatorSetLayerPrimaryConfigRequest>(
1473 (layer_id, image_metadata),
1474 0x68d89ebd518b45b9,
1475 fidl::encoding::DynamicFlags::empty(),
1476 )
1477 }
1478
1479 fn r#set_layer_primary_position(
1480 &self,
1481 mut layer_id: &LayerId,
1482 mut image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
1483 mut image_source: &fidl_fuchsia_math::RectU,
1484 mut display_destination: &fidl_fuchsia_math::RectU,
1485 ) -> Result<(), fidl::Error> {
1486 self.client.send::<CoordinatorSetLayerPrimaryPositionRequest>(
1487 (layer_id, image_source_transformation, image_source, display_destination),
1488 0x27b192b5a43851e2,
1489 fidl::encoding::DynamicFlags::empty(),
1490 )
1491 }
1492
1493 fn r#set_layer_primary_alpha(
1494 &self,
1495 mut layer_id: &LayerId,
1496 mut mode: fidl_fuchsia_hardware_display_types::AlphaMode,
1497 mut val: f32,
1498 ) -> Result<(), fidl::Error> {
1499 self.client.send::<CoordinatorSetLayerPrimaryAlphaRequest>(
1500 (layer_id, mode, val),
1501 0x104cf2b18b27296d,
1502 fidl::encoding::DynamicFlags::empty(),
1503 )
1504 }
1505
1506 fn r#set_layer_color_config(
1507 &self,
1508 mut layer_id: &LayerId,
1509 mut color: &fidl_fuchsia_hardware_display_types::Color,
1510 mut display_destination: &fidl_fuchsia_math::RectU,
1511 ) -> Result<(), fidl::Error> {
1512 self.client.send::<CoordinatorSetLayerColorConfigRequest>(
1513 (layer_id, color, display_destination),
1514 0x2fa91e9a2a01875f,
1515 fidl::encoding::DynamicFlags::empty(),
1516 )
1517 }
1518
1519 fn r#set_layer_image2(
1520 &self,
1521 mut layer_id: &LayerId,
1522 mut image_id: &ImageId,
1523 mut wait_event_id: &EventId,
1524 ) -> Result<(), fidl::Error> {
1525 self.client.send::<CoordinatorSetLayerImage2Request>(
1526 (layer_id, image_id, wait_event_id),
1527 0x53c6376dfc13a971,
1528 fidl::encoding::DynamicFlags::empty(),
1529 )
1530 }
1531
1532 type CheckConfigResponseFut = fidl::client::QueryResponseFut<
1533 fidl_fuchsia_hardware_display_types::ConfigResult,
1534 fidl::encoding::DefaultFuchsiaResourceDialect,
1535 >;
1536 fn r#check_config(&self) -> Self::CheckConfigResponseFut {
1537 fn _decode(
1538 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1539 ) -> Result<fidl_fuchsia_hardware_display_types::ConfigResult, fidl::Error> {
1540 let _response = fidl::client::decode_transaction_body::<
1541 CoordinatorCheckConfigResponse,
1542 fidl::encoding::DefaultFuchsiaResourceDialect,
1543 0x2bcfb4eb16878158,
1544 >(_buf?)?;
1545 Ok(_response.res)
1546 }
1547 self.client.send_query_and_decode::<
1548 fidl::encoding::EmptyPayload,
1549 fidl_fuchsia_hardware_display_types::ConfigResult,
1550 >(
1551 (),
1552 0x2bcfb4eb16878158,
1553 fidl::encoding::DynamicFlags::empty(),
1554 _decode,
1555 )
1556 }
1557
1558 fn r#discard_config(&self) -> Result<(), fidl::Error> {
1559 self.client.send::<fidl::encoding::EmptyPayload>(
1560 (),
1561 0x1673399e9231dedf,
1562 fidl::encoding::DynamicFlags::empty(),
1563 )
1564 }
1565
1566 type GetLatestCommittedConfigStampResponseFut =
1567 fidl::client::QueryResponseFut<ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1568 fn r#get_latest_committed_config_stamp(
1569 &self,
1570 ) -> Self::GetLatestCommittedConfigStampResponseFut {
1571 fn _decode(
1572 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1573 ) -> Result<ConfigStamp, fidl::Error> {
1574 let _response = fidl::client::decode_transaction_body::<
1575 CoordinatorGetLatestCommittedConfigStampResponse,
1576 fidl::encoding::DefaultFuchsiaResourceDialect,
1577 0x2a441f2c81af5d66,
1578 >(_buf?)?;
1579 Ok(_response.stamp)
1580 }
1581 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConfigStamp>(
1582 (),
1583 0x2a441f2c81af5d66,
1584 fidl::encoding::DynamicFlags::empty(),
1585 _decode,
1586 )
1587 }
1588
1589 fn r#commit_config(
1590 &self,
1591 mut payload: CoordinatorCommitConfigRequest,
1592 ) -> Result<(), fidl::Error> {
1593 self.client.send::<CoordinatorCommitConfigRequest>(
1594 &mut payload,
1595 0x4489cbd2fcfbaeaf,
1596 fidl::encoding::DynamicFlags::empty(),
1597 )
1598 }
1599
1600 fn r#acknowledge_vsync(&self, mut cookie: u64) -> Result<(), fidl::Error> {
1601 self.client.send::<CoordinatorAcknowledgeVsyncRequest>(
1602 (cookie,),
1603 0x25e921d26107d6ef,
1604 fidl::encoding::DynamicFlags::empty(),
1605 )
1606 }
1607
1608 type ImportBufferCollectionResponseFut = fidl::client::QueryResponseFut<
1609 CoordinatorImportBufferCollectionResult,
1610 fidl::encoding::DefaultFuchsiaResourceDialect,
1611 >;
1612 fn r#import_buffer_collection(
1613 &self,
1614 mut buffer_collection_id: &BufferCollectionId,
1615 mut buffer_collection_token: fidl::endpoints::ClientEnd<
1616 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
1617 >,
1618 ) -> Self::ImportBufferCollectionResponseFut {
1619 fn _decode(
1620 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1621 ) -> Result<CoordinatorImportBufferCollectionResult, fidl::Error> {
1622 let _response = fidl::client::decode_transaction_body::<
1623 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1624 fidl::encoding::DefaultFuchsiaResourceDialect,
1625 0x30d06f510e7f4601,
1626 >(_buf?)?;
1627 Ok(_response.map(|x| x))
1628 }
1629 self.client.send_query_and_decode::<
1630 CoordinatorImportBufferCollectionRequest,
1631 CoordinatorImportBufferCollectionResult,
1632 >(
1633 (buffer_collection_id, buffer_collection_token,),
1634 0x30d06f510e7f4601,
1635 fidl::encoding::DynamicFlags::empty(),
1636 _decode,
1637 )
1638 }
1639
1640 fn r#release_buffer_collection(
1641 &self,
1642 mut buffer_collection_id: &BufferCollectionId,
1643 ) -> Result<(), fidl::Error> {
1644 self.client.send::<CoordinatorReleaseBufferCollectionRequest>(
1645 (buffer_collection_id,),
1646 0x1c7dd5f8b0690be0,
1647 fidl::encoding::DynamicFlags::empty(),
1648 )
1649 }
1650
1651 type SetBufferCollectionConstraintsResponseFut = fidl::client::QueryResponseFut<
1652 CoordinatorSetBufferCollectionConstraintsResult,
1653 fidl::encoding::DefaultFuchsiaResourceDialect,
1654 >;
1655 fn r#set_buffer_collection_constraints(
1656 &self,
1657 mut buffer_collection_id: &BufferCollectionId,
1658 mut buffer_usage: &fidl_fuchsia_hardware_display_types::ImageBufferUsage,
1659 ) -> Self::SetBufferCollectionConstraintsResponseFut {
1660 fn _decode(
1661 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1662 ) -> Result<CoordinatorSetBufferCollectionConstraintsResult, fidl::Error> {
1663 let _response = fidl::client::decode_transaction_body::<
1664 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1665 fidl::encoding::DefaultFuchsiaResourceDialect,
1666 0x509a4ee9af6035df,
1667 >(_buf?)?;
1668 Ok(_response.map(|x| x))
1669 }
1670 self.client.send_query_and_decode::<
1671 CoordinatorSetBufferCollectionConstraintsRequest,
1672 CoordinatorSetBufferCollectionConstraintsResult,
1673 >(
1674 (buffer_collection_id, buffer_usage,),
1675 0x509a4ee9af6035df,
1676 fidl::encoding::DynamicFlags::empty(),
1677 _decode,
1678 )
1679 }
1680
1681 type IsCaptureSupportedResponseFut = fidl::client::QueryResponseFut<
1682 CoordinatorIsCaptureSupportedResult,
1683 fidl::encoding::DefaultFuchsiaResourceDialect,
1684 >;
1685 fn r#is_capture_supported(&self) -> Self::IsCaptureSupportedResponseFut {
1686 fn _decode(
1687 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1688 ) -> Result<CoordinatorIsCaptureSupportedResult, fidl::Error> {
1689 let _response = fidl::client::decode_transaction_body::<
1690 fidl::encoding::ResultType<CoordinatorIsCaptureSupportedResponse, i32>,
1691 fidl::encoding::DefaultFuchsiaResourceDialect,
1692 0x4ca407277277971b,
1693 >(_buf?)?;
1694 Ok(_response.map(|x| x.supported))
1695 }
1696 self.client.send_query_and_decode::<
1697 fidl::encoding::EmptyPayload,
1698 CoordinatorIsCaptureSupportedResult,
1699 >(
1700 (),
1701 0x4ca407277277971b,
1702 fidl::encoding::DynamicFlags::empty(),
1703 _decode,
1704 )
1705 }
1706
1707 type StartCaptureResponseFut = fidl::client::QueryResponseFut<
1708 CoordinatorStartCaptureResult,
1709 fidl::encoding::DefaultFuchsiaResourceDialect,
1710 >;
1711 fn r#start_capture(
1712 &self,
1713 mut signal_event_id: &EventId,
1714 mut image_id: &ImageId,
1715 ) -> Self::StartCaptureResponseFut {
1716 fn _decode(
1717 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1718 ) -> Result<CoordinatorStartCaptureResult, fidl::Error> {
1719 let _response = fidl::client::decode_transaction_body::<
1720 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1721 fidl::encoding::DefaultFuchsiaResourceDialect,
1722 0x35cb38f19d96a8db,
1723 >(_buf?)?;
1724 Ok(_response.map(|x| x))
1725 }
1726 self.client
1727 .send_query_and_decode::<CoordinatorStartCaptureRequest, CoordinatorStartCaptureResult>(
1728 (signal_event_id, image_id),
1729 0x35cb38f19d96a8db,
1730 fidl::encoding::DynamicFlags::empty(),
1731 _decode,
1732 )
1733 }
1734
1735 type SetMinimumRgbResponseFut = fidl::client::QueryResponseFut<
1736 CoordinatorSetMinimumRgbResult,
1737 fidl::encoding::DefaultFuchsiaResourceDialect,
1738 >;
1739 fn r#set_minimum_rgb(&self, mut minimum_rgb: u8) -> Self::SetMinimumRgbResponseFut {
1740 fn _decode(
1741 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1742 ) -> Result<CoordinatorSetMinimumRgbResult, fidl::Error> {
1743 let _response = fidl::client::decode_transaction_body::<
1744 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1745 fidl::encoding::DefaultFuchsiaResourceDialect,
1746 0x1b49251437038b0b,
1747 >(_buf?)?;
1748 Ok(_response.map(|x| x))
1749 }
1750 self.client.send_query_and_decode::<
1751 CoordinatorSetMinimumRgbRequest,
1752 CoordinatorSetMinimumRgbResult,
1753 >(
1754 (minimum_rgb,),
1755 0x1b49251437038b0b,
1756 fidl::encoding::DynamicFlags::empty(),
1757 _decode,
1758 )
1759 }
1760
1761 type SetDisplayPowerModeResponseFut = fidl::client::QueryResponseFut<
1762 CoordinatorSetDisplayPowerModeResult,
1763 fidl::encoding::DefaultFuchsiaResourceDialect,
1764 >;
1765 fn r#set_display_power_mode(
1766 &self,
1767 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
1768 mut power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
1769 ) -> Self::SetDisplayPowerModeResponseFut {
1770 fn _decode(
1771 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1772 ) -> Result<CoordinatorSetDisplayPowerModeResult, fidl::Error> {
1773 let _response = fidl::client::decode_transaction_body::<
1774 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1775 fidl::encoding::DefaultFuchsiaResourceDialect,
1776 0xf4672f055072c92,
1777 >(_buf?)?;
1778 Ok(_response.map(|x| x))
1779 }
1780 self.client.send_query_and_decode::<
1781 CoordinatorSetDisplayPowerModeRequest,
1782 CoordinatorSetDisplayPowerModeResult,
1783 >(
1784 (display_id, power_mode,),
1785 0xf4672f055072c92,
1786 fidl::encoding::DynamicFlags::empty(),
1787 _decode,
1788 )
1789 }
1790}
1791
1792pub struct CoordinatorEventStream {
1793 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1794}
1795
1796impl std::marker::Unpin for CoordinatorEventStream {}
1797
1798impl futures::stream::FusedStream for CoordinatorEventStream {
1799 fn is_terminated(&self) -> bool {
1800 self.event_receiver.is_terminated()
1801 }
1802}
1803
1804impl futures::Stream for CoordinatorEventStream {
1805 type Item = Result<CoordinatorEvent, fidl::Error>;
1806
1807 fn poll_next(
1808 mut self: std::pin::Pin<&mut Self>,
1809 cx: &mut std::task::Context<'_>,
1810 ) -> std::task::Poll<Option<Self::Item>> {
1811 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1812 &mut self.event_receiver,
1813 cx
1814 )?) {
1815 Some(buf) => std::task::Poll::Ready(Some(CoordinatorEvent::decode(buf))),
1816 None => std::task::Poll::Ready(None),
1817 }
1818 }
1819}
1820
1821#[derive(Debug)]
1822pub enum CoordinatorEvent {}
1823
1824impl CoordinatorEvent {
1825 fn decode(
1827 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1828 ) -> Result<CoordinatorEvent, fidl::Error> {
1829 let (bytes, _handles) = buf.split_mut();
1830 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1831 debug_assert_eq!(tx_header.tx_id, 0);
1832 match tx_header.ordinal {
1833 _ => Err(fidl::Error::UnknownOrdinal {
1834 ordinal: tx_header.ordinal,
1835 protocol_name: <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1836 }),
1837 }
1838 }
1839}
1840
1841pub struct CoordinatorRequestStream {
1843 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1844 is_terminated: bool,
1845}
1846
1847impl std::marker::Unpin for CoordinatorRequestStream {}
1848
1849impl futures::stream::FusedStream for CoordinatorRequestStream {
1850 fn is_terminated(&self) -> bool {
1851 self.is_terminated
1852 }
1853}
1854
1855impl fidl::endpoints::RequestStream for CoordinatorRequestStream {
1856 type Protocol = CoordinatorMarker;
1857 type ControlHandle = CoordinatorControlHandle;
1858
1859 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1860 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1861 }
1862
1863 fn control_handle(&self) -> Self::ControlHandle {
1864 CoordinatorControlHandle { inner: self.inner.clone() }
1865 }
1866
1867 fn into_inner(
1868 self,
1869 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1870 {
1871 (self.inner, self.is_terminated)
1872 }
1873
1874 fn from_inner(
1875 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1876 is_terminated: bool,
1877 ) -> Self {
1878 Self { inner, is_terminated }
1879 }
1880}
1881
1882impl futures::Stream for CoordinatorRequestStream {
1883 type Item = Result<CoordinatorRequest, fidl::Error>;
1884
1885 fn poll_next(
1886 mut self: std::pin::Pin<&mut Self>,
1887 cx: &mut std::task::Context<'_>,
1888 ) -> std::task::Poll<Option<Self::Item>> {
1889 let this = &mut *self;
1890 if this.inner.check_shutdown(cx) {
1891 this.is_terminated = true;
1892 return std::task::Poll::Ready(None);
1893 }
1894 if this.is_terminated {
1895 panic!("polled CoordinatorRequestStream after completion");
1896 }
1897 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1898 |bytes, handles| {
1899 match this.inner.channel().read_etc(cx, bytes, handles) {
1900 std::task::Poll::Ready(Ok(())) => {}
1901 std::task::Poll::Pending => return std::task::Poll::Pending,
1902 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1903 this.is_terminated = true;
1904 return std::task::Poll::Ready(None);
1905 }
1906 std::task::Poll::Ready(Err(e)) => {
1907 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1908 e.into(),
1909 ))));
1910 }
1911 }
1912
1913 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1915
1916 std::task::Poll::Ready(Some(match header.ordinal {
1917 0x3a8636eb9656b4f4 => {
1918 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1919 let mut req = fidl::new_empty!(
1920 CoordinatorImportImageRequest,
1921 fidl::encoding::DefaultFuchsiaResourceDialect
1922 );
1923 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportImageRequest>(&header, _body_bytes, handles, &mut req)?;
1924 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1925 Ok(CoordinatorRequest::ImportImage {
1926 image_metadata: req.image_metadata,
1927 buffer_collection_id: req.buffer_collection_id,
1928 buffer_index: req.buffer_index,
1929 image_id: req.image_id,
1930
1931 responder: CoordinatorImportImageResponder {
1932 control_handle: std::mem::ManuallyDrop::new(control_handle),
1933 tx_id: header.tx_id,
1934 },
1935 })
1936 }
1937 0x477192230517504 => {
1938 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1939 let mut req = fidl::new_empty!(
1940 CoordinatorReleaseImageRequest,
1941 fidl::encoding::DefaultFuchsiaResourceDialect
1942 );
1943 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseImageRequest>(&header, _body_bytes, handles, &mut req)?;
1944 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1945 Ok(CoordinatorRequest::ReleaseImage {
1946 image_id: req.image_id,
1947
1948 control_handle,
1949 })
1950 }
1951 0x2864e5dc59390543 => {
1952 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1953 let mut req = fidl::new_empty!(
1954 CoordinatorImportEventRequest,
1955 fidl::encoding::DefaultFuchsiaResourceDialect
1956 );
1957 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportEventRequest>(&header, _body_bytes, handles, &mut req)?;
1958 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1959 Ok(CoordinatorRequest::ImportEvent {
1960 event: req.event,
1961 id: req.id,
1962
1963 control_handle,
1964 })
1965 }
1966 0x32508c2101606b87 => {
1967 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1968 let mut req = fidl::new_empty!(
1969 CoordinatorReleaseEventRequest,
1970 fidl::encoding::DefaultFuchsiaResourceDialect
1971 );
1972 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseEventRequest>(&header, _body_bytes, handles, &mut req)?;
1973 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1974 Ok(CoordinatorRequest::ReleaseEvent { id: req.id, control_handle })
1975 }
1976 0x2137cfd788a3496b => {
1977 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1978 let mut req = fidl::new_empty!(
1979 CoordinatorCreateLayerRequest,
1980 fidl::encoding::DefaultFuchsiaResourceDialect
1981 );
1982 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorCreateLayerRequest>(&header, _body_bytes, handles, &mut req)?;
1983 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
1984 Ok(CoordinatorRequest::CreateLayer {
1985 layer_id: req.layer_id,
1986
1987 responder: CoordinatorCreateLayerResponder {
1988 control_handle: std::mem::ManuallyDrop::new(control_handle),
1989 tx_id: header.tx_id,
1990 },
1991 })
1992 }
1993 0x386e12d092bea2f8 => {
1994 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1995 let mut req = fidl::new_empty!(
1996 CoordinatorDestroyLayerRequest,
1997 fidl::encoding::DefaultFuchsiaResourceDialect
1998 );
1999 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorDestroyLayerRequest>(&header, _body_bytes, handles, &mut req)?;
2000 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2001 Ok(CoordinatorRequest::DestroyLayer {
2002 layer_id: req.layer_id,
2003
2004 control_handle,
2005 })
2006 }
2007 0xbde3c59ee9c1777 => {
2008 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2009 let mut req = fidl::new_empty!(
2010 CoordinatorSetDisplayModeRequest,
2011 fidl::encoding::DefaultFuchsiaResourceDialect
2012 );
2013 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayModeRequest>(&header, _body_bytes, handles, &mut req)?;
2014 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2015 Ok(CoordinatorRequest::SetDisplayMode {
2016 display_id: req.display_id,
2017 mode: req.mode,
2018
2019 control_handle,
2020 })
2021 }
2022 0x2f18186a987d51aa => {
2023 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2024 let mut req = fidl::new_empty!(
2025 CoordinatorSetDisplayColorConversionRequest,
2026 fidl::encoding::DefaultFuchsiaResourceDialect
2027 );
2028 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayColorConversionRequest>(&header, _body_bytes, handles, &mut req)?;
2029 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2030 Ok(CoordinatorRequest::SetDisplayColorConversion {
2031 display_id: req.display_id,
2032 preoffsets: req.preoffsets,
2033 coefficients: req.coefficients,
2034 postoffsets: req.postoffsets,
2035
2036 control_handle,
2037 })
2038 }
2039 0x190e0f6f93be1d89 => {
2040 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2041 let mut req = fidl::new_empty!(
2042 CoordinatorSetDisplayLayersRequest,
2043 fidl::encoding::DefaultFuchsiaResourceDialect
2044 );
2045 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayLayersRequest>(&header, _body_bytes, handles, &mut req)?;
2046 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2047 Ok(CoordinatorRequest::SetDisplayLayers {
2048 display_id: req.display_id,
2049 layer_ids: req.layer_ids,
2050
2051 control_handle,
2052 })
2053 }
2054 0x68d89ebd518b45b9 => {
2055 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2056 let mut req = fidl::new_empty!(
2057 CoordinatorSetLayerPrimaryConfigRequest,
2058 fidl::encoding::DefaultFuchsiaResourceDialect
2059 );
2060 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2061 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2062 Ok(CoordinatorRequest::SetLayerPrimaryConfig {
2063 layer_id: req.layer_id,
2064 image_metadata: req.image_metadata,
2065
2066 control_handle,
2067 })
2068 }
2069 0x27b192b5a43851e2 => {
2070 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2071 let mut req = fidl::new_empty!(
2072 CoordinatorSetLayerPrimaryPositionRequest,
2073 fidl::encoding::DefaultFuchsiaResourceDialect
2074 );
2075 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryPositionRequest>(&header, _body_bytes, handles, &mut req)?;
2076 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2077 Ok(CoordinatorRequest::SetLayerPrimaryPosition {
2078 layer_id: req.layer_id,
2079 image_source_transformation: req.image_source_transformation,
2080 image_source: req.image_source,
2081 display_destination: req.display_destination,
2082
2083 control_handle,
2084 })
2085 }
2086 0x104cf2b18b27296d => {
2087 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2088 let mut req = fidl::new_empty!(
2089 CoordinatorSetLayerPrimaryAlphaRequest,
2090 fidl::encoding::DefaultFuchsiaResourceDialect
2091 );
2092 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerPrimaryAlphaRequest>(&header, _body_bytes, handles, &mut req)?;
2093 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2094 Ok(CoordinatorRequest::SetLayerPrimaryAlpha {
2095 layer_id: req.layer_id,
2096 mode: req.mode,
2097 val: req.val,
2098
2099 control_handle,
2100 })
2101 }
2102 0x2fa91e9a2a01875f => {
2103 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2104 let mut req = fidl::new_empty!(
2105 CoordinatorSetLayerColorConfigRequest,
2106 fidl::encoding::DefaultFuchsiaResourceDialect
2107 );
2108 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerColorConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2109 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2110 Ok(CoordinatorRequest::SetLayerColorConfig {
2111 layer_id: req.layer_id,
2112 color: req.color,
2113 display_destination: req.display_destination,
2114
2115 control_handle,
2116 })
2117 }
2118 0x53c6376dfc13a971 => {
2119 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2120 let mut req = fidl::new_empty!(
2121 CoordinatorSetLayerImage2Request,
2122 fidl::encoding::DefaultFuchsiaResourceDialect
2123 );
2124 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetLayerImage2Request>(&header, _body_bytes, handles, &mut req)?;
2125 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2126 Ok(CoordinatorRequest::SetLayerImage2 {
2127 layer_id: req.layer_id,
2128 image_id: req.image_id,
2129 wait_event_id: req.wait_event_id,
2130
2131 control_handle,
2132 })
2133 }
2134 0x2bcfb4eb16878158 => {
2135 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2136 let mut req = fidl::new_empty!(
2137 fidl::encoding::EmptyPayload,
2138 fidl::encoding::DefaultFuchsiaResourceDialect
2139 );
2140 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2141 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2142 Ok(CoordinatorRequest::CheckConfig {
2143 responder: CoordinatorCheckConfigResponder {
2144 control_handle: std::mem::ManuallyDrop::new(control_handle),
2145 tx_id: header.tx_id,
2146 },
2147 })
2148 }
2149 0x1673399e9231dedf => {
2150 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2151 let mut req = fidl::new_empty!(
2152 fidl::encoding::EmptyPayload,
2153 fidl::encoding::DefaultFuchsiaResourceDialect
2154 );
2155 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2156 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2157 Ok(CoordinatorRequest::DiscardConfig { control_handle })
2158 }
2159 0x2a441f2c81af5d66 => {
2160 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2161 let mut req = fidl::new_empty!(
2162 fidl::encoding::EmptyPayload,
2163 fidl::encoding::DefaultFuchsiaResourceDialect
2164 );
2165 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2166 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2167 Ok(CoordinatorRequest::GetLatestCommittedConfigStamp {
2168 responder: CoordinatorGetLatestCommittedConfigStampResponder {
2169 control_handle: std::mem::ManuallyDrop::new(control_handle),
2170 tx_id: header.tx_id,
2171 },
2172 })
2173 }
2174 0x4489cbd2fcfbaeaf => {
2175 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2176 let mut req = fidl::new_empty!(
2177 CoordinatorCommitConfigRequest,
2178 fidl::encoding::DefaultFuchsiaResourceDialect
2179 );
2180 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorCommitConfigRequest>(&header, _body_bytes, handles, &mut req)?;
2181 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2182 Ok(CoordinatorRequest::CommitConfig { payload: req, control_handle })
2183 }
2184 0x25e921d26107d6ef => {
2185 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2186 let mut req = fidl::new_empty!(
2187 CoordinatorAcknowledgeVsyncRequest,
2188 fidl::encoding::DefaultFuchsiaResourceDialect
2189 );
2190 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorAcknowledgeVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
2191 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2192 Ok(CoordinatorRequest::AcknowledgeVsync {
2193 cookie: req.cookie,
2194
2195 control_handle,
2196 })
2197 }
2198 0x30d06f510e7f4601 => {
2199 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2200 let mut req = fidl::new_empty!(
2201 CoordinatorImportBufferCollectionRequest,
2202 fidl::encoding::DefaultFuchsiaResourceDialect
2203 );
2204 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorImportBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2205 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2206 Ok(CoordinatorRequest::ImportBufferCollection {
2207 buffer_collection_id: req.buffer_collection_id,
2208 buffer_collection_token: req.buffer_collection_token,
2209
2210 responder: CoordinatorImportBufferCollectionResponder {
2211 control_handle: std::mem::ManuallyDrop::new(control_handle),
2212 tx_id: header.tx_id,
2213 },
2214 })
2215 }
2216 0x1c7dd5f8b0690be0 => {
2217 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2218 let mut req = fidl::new_empty!(
2219 CoordinatorReleaseBufferCollectionRequest,
2220 fidl::encoding::DefaultFuchsiaResourceDialect
2221 );
2222 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorReleaseBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2223 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2224 Ok(CoordinatorRequest::ReleaseBufferCollection {
2225 buffer_collection_id: req.buffer_collection_id,
2226
2227 control_handle,
2228 })
2229 }
2230 0x509a4ee9af6035df => {
2231 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2232 let mut req = fidl::new_empty!(
2233 CoordinatorSetBufferCollectionConstraintsRequest,
2234 fidl::encoding::DefaultFuchsiaResourceDialect
2235 );
2236 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetBufferCollectionConstraintsRequest>(&header, _body_bytes, handles, &mut req)?;
2237 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2238 Ok(CoordinatorRequest::SetBufferCollectionConstraints {
2239 buffer_collection_id: req.buffer_collection_id,
2240 buffer_usage: req.buffer_usage,
2241
2242 responder: CoordinatorSetBufferCollectionConstraintsResponder {
2243 control_handle: std::mem::ManuallyDrop::new(control_handle),
2244 tx_id: header.tx_id,
2245 },
2246 })
2247 }
2248 0x4ca407277277971b => {
2249 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2250 let mut req = fidl::new_empty!(
2251 fidl::encoding::EmptyPayload,
2252 fidl::encoding::DefaultFuchsiaResourceDialect
2253 );
2254 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2255 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2256 Ok(CoordinatorRequest::IsCaptureSupported {
2257 responder: CoordinatorIsCaptureSupportedResponder {
2258 control_handle: std::mem::ManuallyDrop::new(control_handle),
2259 tx_id: header.tx_id,
2260 },
2261 })
2262 }
2263 0x35cb38f19d96a8db => {
2264 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2265 let mut req = fidl::new_empty!(
2266 CoordinatorStartCaptureRequest,
2267 fidl::encoding::DefaultFuchsiaResourceDialect
2268 );
2269 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorStartCaptureRequest>(&header, _body_bytes, handles, &mut req)?;
2270 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2271 Ok(CoordinatorRequest::StartCapture {
2272 signal_event_id: req.signal_event_id,
2273 image_id: req.image_id,
2274
2275 responder: CoordinatorStartCaptureResponder {
2276 control_handle: std::mem::ManuallyDrop::new(control_handle),
2277 tx_id: header.tx_id,
2278 },
2279 })
2280 }
2281 0x1b49251437038b0b => {
2282 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2283 let mut req = fidl::new_empty!(
2284 CoordinatorSetMinimumRgbRequest,
2285 fidl::encoding::DefaultFuchsiaResourceDialect
2286 );
2287 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetMinimumRgbRequest>(&header, _body_bytes, handles, &mut req)?;
2288 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2289 Ok(CoordinatorRequest::SetMinimumRgb {
2290 minimum_rgb: req.minimum_rgb,
2291
2292 responder: CoordinatorSetMinimumRgbResponder {
2293 control_handle: std::mem::ManuallyDrop::new(control_handle),
2294 tx_id: header.tx_id,
2295 },
2296 })
2297 }
2298 0xf4672f055072c92 => {
2299 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2300 let mut req = fidl::new_empty!(
2301 CoordinatorSetDisplayPowerModeRequest,
2302 fidl::encoding::DefaultFuchsiaResourceDialect
2303 );
2304 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorSetDisplayPowerModeRequest>(&header, _body_bytes, handles, &mut req)?;
2305 let control_handle = CoordinatorControlHandle { inner: this.inner.clone() };
2306 Ok(CoordinatorRequest::SetDisplayPowerMode {
2307 display_id: req.display_id,
2308 power_mode: req.power_mode,
2309
2310 responder: CoordinatorSetDisplayPowerModeResponder {
2311 control_handle: std::mem::ManuallyDrop::new(control_handle),
2312 tx_id: header.tx_id,
2313 },
2314 })
2315 }
2316 _ => Err(fidl::Error::UnknownOrdinal {
2317 ordinal: header.ordinal,
2318 protocol_name:
2319 <CoordinatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2320 }),
2321 }))
2322 },
2323 )
2324 }
2325}
2326
2327#[derive(Debug)]
2349pub enum CoordinatorRequest {
2350 ImportImage {
2365 image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
2366 buffer_collection_id: BufferCollectionId,
2367 buffer_index: u32,
2368 image_id: ImageId,
2369 responder: CoordinatorImportImageResponder,
2370 },
2371 ReleaseImage { image_id: ImageId, control_handle: CoordinatorControlHandle },
2384 ImportEvent { event: fidl::Event, id: EventId, control_handle: CoordinatorControlHandle },
2393 ReleaseEvent { id: EventId, control_handle: CoordinatorControlHandle },
2400 CreateLayer { layer_id: LayerId, responder: CoordinatorCreateLayerResponder },
2412 DestroyLayer { layer_id: LayerId, control_handle: CoordinatorControlHandle },
2416 SetDisplayMode {
2418 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2419 mode: fidl_fuchsia_hardware_display_types::Mode,
2420 control_handle: CoordinatorControlHandle,
2421 },
2422 SetDisplayColorConversion {
2449 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2450 preoffsets: [f32; 3],
2451 coefficients: [f32; 9],
2452 postoffsets: [f32; 3],
2453 control_handle: CoordinatorControlHandle,
2454 },
2455 SetDisplayLayers {
2457 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2458 layer_ids: Vec<LayerId>,
2459 control_handle: CoordinatorControlHandle,
2460 },
2461 SetLayerPrimaryConfig {
2470 layer_id: LayerId,
2471 image_metadata: fidl_fuchsia_hardware_display_types::ImageMetadata,
2472 control_handle: CoordinatorControlHandle,
2473 },
2474 SetLayerPrimaryPosition {
2482 layer_id: LayerId,
2483 image_source_transformation: fidl_fuchsia_hardware_display_types::CoordinateTransformation,
2484 image_source: fidl_fuchsia_math::RectU,
2485 display_destination: fidl_fuchsia_math::RectU,
2486 control_handle: CoordinatorControlHandle,
2487 },
2488 SetLayerPrimaryAlpha {
2504 layer_id: LayerId,
2505 mode: fidl_fuchsia_hardware_display_types::AlphaMode,
2506 val: f32,
2507 control_handle: CoordinatorControlHandle,
2508 },
2509 SetLayerColorConfig {
2513 layer_id: LayerId,
2514 color: fidl_fuchsia_hardware_display_types::Color,
2515 display_destination: fidl_fuchsia_math::RectU,
2516 control_handle: CoordinatorControlHandle,
2517 },
2518 SetLayerImage2 {
2557 layer_id: LayerId,
2558 image_id: ImageId,
2559 wait_event_id: EventId,
2560 control_handle: CoordinatorControlHandle,
2561 },
2562 CheckConfig { responder: CoordinatorCheckConfigResponder },
2571 DiscardConfig { control_handle: CoordinatorControlHandle },
2573 GetLatestCommittedConfigStamp { responder: CoordinatorGetLatestCommittedConfigStampResponder },
2579 CommitConfig {
2586 payload: CoordinatorCommitConfigRequest,
2587 control_handle: CoordinatorControlHandle,
2588 },
2589 AcknowledgeVsync { cookie: u64, control_handle: CoordinatorControlHandle },
2591 ImportBufferCollection {
2594 buffer_collection_id: BufferCollectionId,
2595 buffer_collection_token:
2596 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2597 responder: CoordinatorImportBufferCollectionResponder,
2598 },
2599 ReleaseBufferCollection {
2601 buffer_collection_id: BufferCollectionId,
2602 control_handle: CoordinatorControlHandle,
2603 },
2604 SetBufferCollectionConstraints {
2607 buffer_collection_id: BufferCollectionId,
2608 buffer_usage: fidl_fuchsia_hardware_display_types::ImageBufferUsage,
2609 responder: CoordinatorSetBufferCollectionConstraintsResponder,
2610 },
2611 IsCaptureSupported { responder: CoordinatorIsCaptureSupportedResponder },
2613 StartCapture {
2619 signal_event_id: EventId,
2620 image_id: ImageId,
2621 responder: CoordinatorStartCaptureResponder,
2622 },
2623 SetMinimumRgb { minimum_rgb: u8, responder: CoordinatorSetMinimumRgbResponder },
2634 SetDisplayPowerMode {
2651 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
2652 power_mode: fidl_fuchsia_hardware_display_types::PowerMode,
2653 responder: CoordinatorSetDisplayPowerModeResponder,
2654 },
2655}
2656
2657impl CoordinatorRequest {
2658 #[allow(irrefutable_let_patterns)]
2659 pub fn into_import_image(
2660 self,
2661 ) -> Option<(
2662 fidl_fuchsia_hardware_display_types::ImageMetadata,
2663 BufferCollectionId,
2664 u32,
2665 ImageId,
2666 CoordinatorImportImageResponder,
2667 )> {
2668 if let CoordinatorRequest::ImportImage {
2669 image_metadata,
2670 buffer_collection_id,
2671 buffer_index,
2672 image_id,
2673 responder,
2674 } = self
2675 {
2676 Some((image_metadata, buffer_collection_id, buffer_index, image_id, responder))
2677 } else {
2678 None
2679 }
2680 }
2681
2682 #[allow(irrefutable_let_patterns)]
2683 pub fn into_release_image(self) -> Option<(ImageId, CoordinatorControlHandle)> {
2684 if let CoordinatorRequest::ReleaseImage { image_id, control_handle } = self {
2685 Some((image_id, control_handle))
2686 } else {
2687 None
2688 }
2689 }
2690
2691 #[allow(irrefutable_let_patterns)]
2692 pub fn into_import_event(self) -> Option<(fidl::Event, EventId, CoordinatorControlHandle)> {
2693 if let CoordinatorRequest::ImportEvent { event, id, control_handle } = self {
2694 Some((event, id, control_handle))
2695 } else {
2696 None
2697 }
2698 }
2699
2700 #[allow(irrefutable_let_patterns)]
2701 pub fn into_release_event(self) -> Option<(EventId, CoordinatorControlHandle)> {
2702 if let CoordinatorRequest::ReleaseEvent { id, control_handle } = self {
2703 Some((id, control_handle))
2704 } else {
2705 None
2706 }
2707 }
2708
2709 #[allow(irrefutable_let_patterns)]
2710 pub fn into_create_layer(self) -> Option<(LayerId, CoordinatorCreateLayerResponder)> {
2711 if let CoordinatorRequest::CreateLayer { layer_id, responder } = self {
2712 Some((layer_id, responder))
2713 } else {
2714 None
2715 }
2716 }
2717
2718 #[allow(irrefutable_let_patterns)]
2719 pub fn into_destroy_layer(self) -> Option<(LayerId, CoordinatorControlHandle)> {
2720 if let CoordinatorRequest::DestroyLayer { layer_id, control_handle } = self {
2721 Some((layer_id, control_handle))
2722 } else {
2723 None
2724 }
2725 }
2726
2727 #[allow(irrefutable_let_patterns)]
2728 pub fn into_set_display_mode(
2729 self,
2730 ) -> Option<(
2731 fidl_fuchsia_hardware_display_types::DisplayId,
2732 fidl_fuchsia_hardware_display_types::Mode,
2733 CoordinatorControlHandle,
2734 )> {
2735 if let CoordinatorRequest::SetDisplayMode { display_id, mode, control_handle } = self {
2736 Some((display_id, mode, control_handle))
2737 } else {
2738 None
2739 }
2740 }
2741
2742 #[allow(irrefutable_let_patterns)]
2743 pub fn into_set_display_color_conversion(
2744 self,
2745 ) -> Option<(
2746 fidl_fuchsia_hardware_display_types::DisplayId,
2747 [f32; 3],
2748 [f32; 9],
2749 [f32; 3],
2750 CoordinatorControlHandle,
2751 )> {
2752 if let CoordinatorRequest::SetDisplayColorConversion {
2753 display_id,
2754 preoffsets,
2755 coefficients,
2756 postoffsets,
2757 control_handle,
2758 } = self
2759 {
2760 Some((display_id, preoffsets, coefficients, postoffsets, control_handle))
2761 } else {
2762 None
2763 }
2764 }
2765
2766 #[allow(irrefutable_let_patterns)]
2767 pub fn into_set_display_layers(
2768 self,
2769 ) -> Option<(
2770 fidl_fuchsia_hardware_display_types::DisplayId,
2771 Vec<LayerId>,
2772 CoordinatorControlHandle,
2773 )> {
2774 if let CoordinatorRequest::SetDisplayLayers { display_id, layer_ids, control_handle } = self
2775 {
2776 Some((display_id, layer_ids, control_handle))
2777 } else {
2778 None
2779 }
2780 }
2781
2782 #[allow(irrefutable_let_patterns)]
2783 pub fn into_set_layer_primary_config(
2784 self,
2785 ) -> Option<(
2786 LayerId,
2787 fidl_fuchsia_hardware_display_types::ImageMetadata,
2788 CoordinatorControlHandle,
2789 )> {
2790 if let CoordinatorRequest::SetLayerPrimaryConfig {
2791 layer_id,
2792 image_metadata,
2793 control_handle,
2794 } = self
2795 {
2796 Some((layer_id, image_metadata, control_handle))
2797 } else {
2798 None
2799 }
2800 }
2801
2802 #[allow(irrefutable_let_patterns)]
2803 pub fn into_set_layer_primary_position(
2804 self,
2805 ) -> Option<(
2806 LayerId,
2807 fidl_fuchsia_hardware_display_types::CoordinateTransformation,
2808 fidl_fuchsia_math::RectU,
2809 fidl_fuchsia_math::RectU,
2810 CoordinatorControlHandle,
2811 )> {
2812 if let CoordinatorRequest::SetLayerPrimaryPosition {
2813 layer_id,
2814 image_source_transformation,
2815 image_source,
2816 display_destination,
2817 control_handle,
2818 } = self
2819 {
2820 Some((
2821 layer_id,
2822 image_source_transformation,
2823 image_source,
2824 display_destination,
2825 control_handle,
2826 ))
2827 } else {
2828 None
2829 }
2830 }
2831
2832 #[allow(irrefutable_let_patterns)]
2833 pub fn into_set_layer_primary_alpha(
2834 self,
2835 ) -> Option<(
2836 LayerId,
2837 fidl_fuchsia_hardware_display_types::AlphaMode,
2838 f32,
2839 CoordinatorControlHandle,
2840 )> {
2841 if let CoordinatorRequest::SetLayerPrimaryAlpha { layer_id, mode, val, control_handle } =
2842 self
2843 {
2844 Some((layer_id, mode, val, control_handle))
2845 } else {
2846 None
2847 }
2848 }
2849
2850 #[allow(irrefutable_let_patterns)]
2851 pub fn into_set_layer_color_config(
2852 self,
2853 ) -> Option<(
2854 LayerId,
2855 fidl_fuchsia_hardware_display_types::Color,
2856 fidl_fuchsia_math::RectU,
2857 CoordinatorControlHandle,
2858 )> {
2859 if let CoordinatorRequest::SetLayerColorConfig {
2860 layer_id,
2861 color,
2862 display_destination,
2863 control_handle,
2864 } = self
2865 {
2866 Some((layer_id, color, display_destination, control_handle))
2867 } else {
2868 None
2869 }
2870 }
2871
2872 #[allow(irrefutable_let_patterns)]
2873 pub fn into_set_layer_image2(
2874 self,
2875 ) -> Option<(LayerId, ImageId, EventId, CoordinatorControlHandle)> {
2876 if let CoordinatorRequest::SetLayerImage2 {
2877 layer_id,
2878 image_id,
2879 wait_event_id,
2880 control_handle,
2881 } = self
2882 {
2883 Some((layer_id, image_id, wait_event_id, control_handle))
2884 } else {
2885 None
2886 }
2887 }
2888
2889 #[allow(irrefutable_let_patterns)]
2890 pub fn into_check_config(self) -> Option<(CoordinatorCheckConfigResponder)> {
2891 if let CoordinatorRequest::CheckConfig { responder } = self {
2892 Some((responder))
2893 } else {
2894 None
2895 }
2896 }
2897
2898 #[allow(irrefutable_let_patterns)]
2899 pub fn into_discard_config(self) -> Option<(CoordinatorControlHandle)> {
2900 if let CoordinatorRequest::DiscardConfig { control_handle } = self {
2901 Some((control_handle))
2902 } else {
2903 None
2904 }
2905 }
2906
2907 #[allow(irrefutable_let_patterns)]
2908 pub fn into_get_latest_committed_config_stamp(
2909 self,
2910 ) -> Option<(CoordinatorGetLatestCommittedConfigStampResponder)> {
2911 if let CoordinatorRequest::GetLatestCommittedConfigStamp { responder } = self {
2912 Some((responder))
2913 } else {
2914 None
2915 }
2916 }
2917
2918 #[allow(irrefutable_let_patterns)]
2919 pub fn into_commit_config(
2920 self,
2921 ) -> Option<(CoordinatorCommitConfigRequest, CoordinatorControlHandle)> {
2922 if let CoordinatorRequest::CommitConfig { payload, control_handle } = self {
2923 Some((payload, control_handle))
2924 } else {
2925 None
2926 }
2927 }
2928
2929 #[allow(irrefutable_let_patterns)]
2930 pub fn into_acknowledge_vsync(self) -> Option<(u64, CoordinatorControlHandle)> {
2931 if let CoordinatorRequest::AcknowledgeVsync { cookie, control_handle } = self {
2932 Some((cookie, control_handle))
2933 } else {
2934 None
2935 }
2936 }
2937
2938 #[allow(irrefutable_let_patterns)]
2939 pub fn into_import_buffer_collection(
2940 self,
2941 ) -> Option<(
2942 BufferCollectionId,
2943 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
2944 CoordinatorImportBufferCollectionResponder,
2945 )> {
2946 if let CoordinatorRequest::ImportBufferCollection {
2947 buffer_collection_id,
2948 buffer_collection_token,
2949 responder,
2950 } = self
2951 {
2952 Some((buffer_collection_id, buffer_collection_token, responder))
2953 } else {
2954 None
2955 }
2956 }
2957
2958 #[allow(irrefutable_let_patterns)]
2959 pub fn into_release_buffer_collection(
2960 self,
2961 ) -> Option<(BufferCollectionId, CoordinatorControlHandle)> {
2962 if let CoordinatorRequest::ReleaseBufferCollection {
2963 buffer_collection_id,
2964 control_handle,
2965 } = self
2966 {
2967 Some((buffer_collection_id, control_handle))
2968 } else {
2969 None
2970 }
2971 }
2972
2973 #[allow(irrefutable_let_patterns)]
2974 pub fn into_set_buffer_collection_constraints(
2975 self,
2976 ) -> Option<(
2977 BufferCollectionId,
2978 fidl_fuchsia_hardware_display_types::ImageBufferUsage,
2979 CoordinatorSetBufferCollectionConstraintsResponder,
2980 )> {
2981 if let CoordinatorRequest::SetBufferCollectionConstraints {
2982 buffer_collection_id,
2983 buffer_usage,
2984 responder,
2985 } = self
2986 {
2987 Some((buffer_collection_id, buffer_usage, responder))
2988 } else {
2989 None
2990 }
2991 }
2992
2993 #[allow(irrefutable_let_patterns)]
2994 pub fn into_is_capture_supported(self) -> Option<(CoordinatorIsCaptureSupportedResponder)> {
2995 if let CoordinatorRequest::IsCaptureSupported { responder } = self {
2996 Some((responder))
2997 } else {
2998 None
2999 }
3000 }
3001
3002 #[allow(irrefutable_let_patterns)]
3003 pub fn into_start_capture(
3004 self,
3005 ) -> Option<(EventId, ImageId, CoordinatorStartCaptureResponder)> {
3006 if let CoordinatorRequest::StartCapture { signal_event_id, image_id, responder } = self {
3007 Some((signal_event_id, image_id, responder))
3008 } else {
3009 None
3010 }
3011 }
3012
3013 #[allow(irrefutable_let_patterns)]
3014 pub fn into_set_minimum_rgb(self) -> Option<(u8, CoordinatorSetMinimumRgbResponder)> {
3015 if let CoordinatorRequest::SetMinimumRgb { minimum_rgb, responder } = self {
3016 Some((minimum_rgb, responder))
3017 } else {
3018 None
3019 }
3020 }
3021
3022 #[allow(irrefutable_let_patterns)]
3023 pub fn into_set_display_power_mode(
3024 self,
3025 ) -> Option<(
3026 fidl_fuchsia_hardware_display_types::DisplayId,
3027 fidl_fuchsia_hardware_display_types::PowerMode,
3028 CoordinatorSetDisplayPowerModeResponder,
3029 )> {
3030 if let CoordinatorRequest::SetDisplayPowerMode { display_id, power_mode, responder } = self
3031 {
3032 Some((display_id, power_mode, responder))
3033 } else {
3034 None
3035 }
3036 }
3037
3038 pub fn method_name(&self) -> &'static str {
3040 match *self {
3041 CoordinatorRequest::ImportImage { .. } => "import_image",
3042 CoordinatorRequest::ReleaseImage { .. } => "release_image",
3043 CoordinatorRequest::ImportEvent { .. } => "import_event",
3044 CoordinatorRequest::ReleaseEvent { .. } => "release_event",
3045 CoordinatorRequest::CreateLayer { .. } => "create_layer",
3046 CoordinatorRequest::DestroyLayer { .. } => "destroy_layer",
3047 CoordinatorRequest::SetDisplayMode { .. } => "set_display_mode",
3048 CoordinatorRequest::SetDisplayColorConversion { .. } => "set_display_color_conversion",
3049 CoordinatorRequest::SetDisplayLayers { .. } => "set_display_layers",
3050 CoordinatorRequest::SetLayerPrimaryConfig { .. } => "set_layer_primary_config",
3051 CoordinatorRequest::SetLayerPrimaryPosition { .. } => "set_layer_primary_position",
3052 CoordinatorRequest::SetLayerPrimaryAlpha { .. } => "set_layer_primary_alpha",
3053 CoordinatorRequest::SetLayerColorConfig { .. } => "set_layer_color_config",
3054 CoordinatorRequest::SetLayerImage2 { .. } => "set_layer_image2",
3055 CoordinatorRequest::CheckConfig { .. } => "check_config",
3056 CoordinatorRequest::DiscardConfig { .. } => "discard_config",
3057 CoordinatorRequest::GetLatestCommittedConfigStamp { .. } => {
3058 "get_latest_committed_config_stamp"
3059 }
3060 CoordinatorRequest::CommitConfig { .. } => "commit_config",
3061 CoordinatorRequest::AcknowledgeVsync { .. } => "acknowledge_vsync",
3062 CoordinatorRequest::ImportBufferCollection { .. } => "import_buffer_collection",
3063 CoordinatorRequest::ReleaseBufferCollection { .. } => "release_buffer_collection",
3064 CoordinatorRequest::SetBufferCollectionConstraints { .. } => {
3065 "set_buffer_collection_constraints"
3066 }
3067 CoordinatorRequest::IsCaptureSupported { .. } => "is_capture_supported",
3068 CoordinatorRequest::StartCapture { .. } => "start_capture",
3069 CoordinatorRequest::SetMinimumRgb { .. } => "set_minimum_rgb",
3070 CoordinatorRequest::SetDisplayPowerMode { .. } => "set_display_power_mode",
3071 }
3072 }
3073}
3074
3075#[derive(Debug, Clone)]
3076pub struct CoordinatorControlHandle {
3077 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3078}
3079
3080impl fidl::endpoints::ControlHandle for CoordinatorControlHandle {
3081 fn shutdown(&self) {
3082 self.inner.shutdown()
3083 }
3084
3085 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3086 self.inner.shutdown_with_epitaph(status)
3087 }
3088
3089 fn is_closed(&self) -> bool {
3090 self.inner.channel().is_closed()
3091 }
3092 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3093 self.inner.channel().on_closed()
3094 }
3095
3096 #[cfg(target_os = "fuchsia")]
3097 fn signal_peer(
3098 &self,
3099 clear_mask: zx::Signals,
3100 set_mask: zx::Signals,
3101 ) -> Result<(), zx_status::Status> {
3102 use fidl::Peered;
3103 self.inner.channel().signal_peer(clear_mask, set_mask)
3104 }
3105}
3106
3107impl CoordinatorControlHandle {}
3108
3109#[must_use = "FIDL methods require a response to be sent"]
3110#[derive(Debug)]
3111pub struct CoordinatorImportImageResponder {
3112 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3113 tx_id: u32,
3114}
3115
3116impl std::ops::Drop for CoordinatorImportImageResponder {
3120 fn drop(&mut self) {
3121 self.control_handle.shutdown();
3122 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3124 }
3125}
3126
3127impl fidl::endpoints::Responder for CoordinatorImportImageResponder {
3128 type ControlHandle = CoordinatorControlHandle;
3129
3130 fn control_handle(&self) -> &CoordinatorControlHandle {
3131 &self.control_handle
3132 }
3133
3134 fn drop_without_shutdown(mut self) {
3135 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3137 std::mem::forget(self);
3139 }
3140}
3141
3142impl CoordinatorImportImageResponder {
3143 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3147 let _result = self.send_raw(result);
3148 if _result.is_err() {
3149 self.control_handle.shutdown();
3150 }
3151 self.drop_without_shutdown();
3152 _result
3153 }
3154
3155 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3157 let _result = self.send_raw(result);
3158 self.drop_without_shutdown();
3159 _result
3160 }
3161
3162 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3163 self.control_handle
3164 .inner
3165 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3166 result,
3167 self.tx_id,
3168 0x3a8636eb9656b4f4,
3169 fidl::encoding::DynamicFlags::empty(),
3170 )
3171 }
3172}
3173
3174#[must_use = "FIDL methods require a response to be sent"]
3175#[derive(Debug)]
3176pub struct CoordinatorCreateLayerResponder {
3177 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3178 tx_id: u32,
3179}
3180
3181impl std::ops::Drop for CoordinatorCreateLayerResponder {
3185 fn drop(&mut self) {
3186 self.control_handle.shutdown();
3187 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3189 }
3190}
3191
3192impl fidl::endpoints::Responder for CoordinatorCreateLayerResponder {
3193 type ControlHandle = CoordinatorControlHandle;
3194
3195 fn control_handle(&self) -> &CoordinatorControlHandle {
3196 &self.control_handle
3197 }
3198
3199 fn drop_without_shutdown(mut self) {
3200 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3202 std::mem::forget(self);
3204 }
3205}
3206
3207impl CoordinatorCreateLayerResponder {
3208 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3212 let _result = self.send_raw(result);
3213 if _result.is_err() {
3214 self.control_handle.shutdown();
3215 }
3216 self.drop_without_shutdown();
3217 _result
3218 }
3219
3220 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3222 let _result = self.send_raw(result);
3223 self.drop_without_shutdown();
3224 _result
3225 }
3226
3227 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3228 self.control_handle
3229 .inner
3230 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3231 result,
3232 self.tx_id,
3233 0x2137cfd788a3496b,
3234 fidl::encoding::DynamicFlags::empty(),
3235 )
3236 }
3237}
3238
3239#[must_use = "FIDL methods require a response to be sent"]
3240#[derive(Debug)]
3241pub struct CoordinatorCheckConfigResponder {
3242 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3243 tx_id: u32,
3244}
3245
3246impl std::ops::Drop for CoordinatorCheckConfigResponder {
3250 fn drop(&mut self) {
3251 self.control_handle.shutdown();
3252 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3254 }
3255}
3256
3257impl fidl::endpoints::Responder for CoordinatorCheckConfigResponder {
3258 type ControlHandle = CoordinatorControlHandle;
3259
3260 fn control_handle(&self) -> &CoordinatorControlHandle {
3261 &self.control_handle
3262 }
3263
3264 fn drop_without_shutdown(mut self) {
3265 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3267 std::mem::forget(self);
3269 }
3270}
3271
3272impl CoordinatorCheckConfigResponder {
3273 pub fn send(
3277 self,
3278 mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3279 ) -> Result<(), fidl::Error> {
3280 let _result = self.send_raw(res);
3281 if _result.is_err() {
3282 self.control_handle.shutdown();
3283 }
3284 self.drop_without_shutdown();
3285 _result
3286 }
3287
3288 pub fn send_no_shutdown_on_err(
3290 self,
3291 mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3292 ) -> Result<(), fidl::Error> {
3293 let _result = self.send_raw(res);
3294 self.drop_without_shutdown();
3295 _result
3296 }
3297
3298 fn send_raw(
3299 &self,
3300 mut res: fidl_fuchsia_hardware_display_types::ConfigResult,
3301 ) -> Result<(), fidl::Error> {
3302 self.control_handle.inner.send::<CoordinatorCheckConfigResponse>(
3303 (res,),
3304 self.tx_id,
3305 0x2bcfb4eb16878158,
3306 fidl::encoding::DynamicFlags::empty(),
3307 )
3308 }
3309}
3310
3311#[must_use = "FIDL methods require a response to be sent"]
3312#[derive(Debug)]
3313pub struct CoordinatorGetLatestCommittedConfigStampResponder {
3314 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3315 tx_id: u32,
3316}
3317
3318impl std::ops::Drop for CoordinatorGetLatestCommittedConfigStampResponder {
3322 fn drop(&mut self) {
3323 self.control_handle.shutdown();
3324 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3326 }
3327}
3328
3329impl fidl::endpoints::Responder for CoordinatorGetLatestCommittedConfigStampResponder {
3330 type ControlHandle = CoordinatorControlHandle;
3331
3332 fn control_handle(&self) -> &CoordinatorControlHandle {
3333 &self.control_handle
3334 }
3335
3336 fn drop_without_shutdown(mut self) {
3337 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3339 std::mem::forget(self);
3341 }
3342}
3343
3344impl CoordinatorGetLatestCommittedConfigStampResponder {
3345 pub fn send(self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3349 let _result = self.send_raw(stamp);
3350 if _result.is_err() {
3351 self.control_handle.shutdown();
3352 }
3353 self.drop_without_shutdown();
3354 _result
3355 }
3356
3357 pub fn send_no_shutdown_on_err(self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3359 let _result = self.send_raw(stamp);
3360 self.drop_without_shutdown();
3361 _result
3362 }
3363
3364 fn send_raw(&self, mut stamp: &ConfigStamp) -> Result<(), fidl::Error> {
3365 self.control_handle.inner.send::<CoordinatorGetLatestCommittedConfigStampResponse>(
3366 (stamp,),
3367 self.tx_id,
3368 0x2a441f2c81af5d66,
3369 fidl::encoding::DynamicFlags::empty(),
3370 )
3371 }
3372}
3373
3374#[must_use = "FIDL methods require a response to be sent"]
3375#[derive(Debug)]
3376pub struct CoordinatorImportBufferCollectionResponder {
3377 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3378 tx_id: u32,
3379}
3380
3381impl std::ops::Drop for CoordinatorImportBufferCollectionResponder {
3385 fn drop(&mut self) {
3386 self.control_handle.shutdown();
3387 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3389 }
3390}
3391
3392impl fidl::endpoints::Responder for CoordinatorImportBufferCollectionResponder {
3393 type ControlHandle = CoordinatorControlHandle;
3394
3395 fn control_handle(&self) -> &CoordinatorControlHandle {
3396 &self.control_handle
3397 }
3398
3399 fn drop_without_shutdown(mut self) {
3400 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3402 std::mem::forget(self);
3404 }
3405}
3406
3407impl CoordinatorImportBufferCollectionResponder {
3408 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3412 let _result = self.send_raw(result);
3413 if _result.is_err() {
3414 self.control_handle.shutdown();
3415 }
3416 self.drop_without_shutdown();
3417 _result
3418 }
3419
3420 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3422 let _result = self.send_raw(result);
3423 self.drop_without_shutdown();
3424 _result
3425 }
3426
3427 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3428 self.control_handle
3429 .inner
3430 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3431 result,
3432 self.tx_id,
3433 0x30d06f510e7f4601,
3434 fidl::encoding::DynamicFlags::empty(),
3435 )
3436 }
3437}
3438
3439#[must_use = "FIDL methods require a response to be sent"]
3440#[derive(Debug)]
3441pub struct CoordinatorSetBufferCollectionConstraintsResponder {
3442 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3443 tx_id: u32,
3444}
3445
3446impl std::ops::Drop for CoordinatorSetBufferCollectionConstraintsResponder {
3450 fn drop(&mut self) {
3451 self.control_handle.shutdown();
3452 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3454 }
3455}
3456
3457impl fidl::endpoints::Responder for CoordinatorSetBufferCollectionConstraintsResponder {
3458 type ControlHandle = CoordinatorControlHandle;
3459
3460 fn control_handle(&self) -> &CoordinatorControlHandle {
3461 &self.control_handle
3462 }
3463
3464 fn drop_without_shutdown(mut self) {
3465 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3467 std::mem::forget(self);
3469 }
3470}
3471
3472impl CoordinatorSetBufferCollectionConstraintsResponder {
3473 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3477 let _result = self.send_raw(result);
3478 if _result.is_err() {
3479 self.control_handle.shutdown();
3480 }
3481 self.drop_without_shutdown();
3482 _result
3483 }
3484
3485 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3487 let _result = self.send_raw(result);
3488 self.drop_without_shutdown();
3489 _result
3490 }
3491
3492 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3493 self.control_handle
3494 .inner
3495 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3496 result,
3497 self.tx_id,
3498 0x509a4ee9af6035df,
3499 fidl::encoding::DynamicFlags::empty(),
3500 )
3501 }
3502}
3503
3504#[must_use = "FIDL methods require a response to be sent"]
3505#[derive(Debug)]
3506pub struct CoordinatorIsCaptureSupportedResponder {
3507 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3508 tx_id: u32,
3509}
3510
3511impl std::ops::Drop for CoordinatorIsCaptureSupportedResponder {
3515 fn drop(&mut self) {
3516 self.control_handle.shutdown();
3517 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3519 }
3520}
3521
3522impl fidl::endpoints::Responder for CoordinatorIsCaptureSupportedResponder {
3523 type ControlHandle = CoordinatorControlHandle;
3524
3525 fn control_handle(&self) -> &CoordinatorControlHandle {
3526 &self.control_handle
3527 }
3528
3529 fn drop_without_shutdown(mut self) {
3530 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3532 std::mem::forget(self);
3534 }
3535}
3536
3537impl CoordinatorIsCaptureSupportedResponder {
3538 pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3542 let _result = self.send_raw(result);
3543 if _result.is_err() {
3544 self.control_handle.shutdown();
3545 }
3546 self.drop_without_shutdown();
3547 _result
3548 }
3549
3550 pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3552 let _result = self.send_raw(result);
3553 self.drop_without_shutdown();
3554 _result
3555 }
3556
3557 fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3558 self.control_handle.inner.send::<fidl::encoding::ResultType<
3559 CoordinatorIsCaptureSupportedResponse,
3560 i32,
3561 >>(
3562 result.map(|supported| (supported,)),
3563 self.tx_id,
3564 0x4ca407277277971b,
3565 fidl::encoding::DynamicFlags::empty(),
3566 )
3567 }
3568}
3569
3570#[must_use = "FIDL methods require a response to be sent"]
3571#[derive(Debug)]
3572pub struct CoordinatorStartCaptureResponder {
3573 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3574 tx_id: u32,
3575}
3576
3577impl std::ops::Drop for CoordinatorStartCaptureResponder {
3581 fn drop(&mut self) {
3582 self.control_handle.shutdown();
3583 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3585 }
3586}
3587
3588impl fidl::endpoints::Responder for CoordinatorStartCaptureResponder {
3589 type ControlHandle = CoordinatorControlHandle;
3590
3591 fn control_handle(&self) -> &CoordinatorControlHandle {
3592 &self.control_handle
3593 }
3594
3595 fn drop_without_shutdown(mut self) {
3596 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3598 std::mem::forget(self);
3600 }
3601}
3602
3603impl CoordinatorStartCaptureResponder {
3604 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3608 let _result = self.send_raw(result);
3609 if _result.is_err() {
3610 self.control_handle.shutdown();
3611 }
3612 self.drop_without_shutdown();
3613 _result
3614 }
3615
3616 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3618 let _result = self.send_raw(result);
3619 self.drop_without_shutdown();
3620 _result
3621 }
3622
3623 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3624 self.control_handle
3625 .inner
3626 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3627 result,
3628 self.tx_id,
3629 0x35cb38f19d96a8db,
3630 fidl::encoding::DynamicFlags::empty(),
3631 )
3632 }
3633}
3634
3635#[must_use = "FIDL methods require a response to be sent"]
3636#[derive(Debug)]
3637pub struct CoordinatorSetMinimumRgbResponder {
3638 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3639 tx_id: u32,
3640}
3641
3642impl std::ops::Drop for CoordinatorSetMinimumRgbResponder {
3646 fn drop(&mut self) {
3647 self.control_handle.shutdown();
3648 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3650 }
3651}
3652
3653impl fidl::endpoints::Responder for CoordinatorSetMinimumRgbResponder {
3654 type ControlHandle = CoordinatorControlHandle;
3655
3656 fn control_handle(&self) -> &CoordinatorControlHandle {
3657 &self.control_handle
3658 }
3659
3660 fn drop_without_shutdown(mut self) {
3661 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3663 std::mem::forget(self);
3665 }
3666}
3667
3668impl CoordinatorSetMinimumRgbResponder {
3669 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3673 let _result = self.send_raw(result);
3674 if _result.is_err() {
3675 self.control_handle.shutdown();
3676 }
3677 self.drop_without_shutdown();
3678 _result
3679 }
3680
3681 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3683 let _result = self.send_raw(result);
3684 self.drop_without_shutdown();
3685 _result
3686 }
3687
3688 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3689 self.control_handle
3690 .inner
3691 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3692 result,
3693 self.tx_id,
3694 0x1b49251437038b0b,
3695 fidl::encoding::DynamicFlags::empty(),
3696 )
3697 }
3698}
3699
3700#[must_use = "FIDL methods require a response to be sent"]
3701#[derive(Debug)]
3702pub struct CoordinatorSetDisplayPowerModeResponder {
3703 control_handle: std::mem::ManuallyDrop<CoordinatorControlHandle>,
3704 tx_id: u32,
3705}
3706
3707impl std::ops::Drop for CoordinatorSetDisplayPowerModeResponder {
3711 fn drop(&mut self) {
3712 self.control_handle.shutdown();
3713 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3715 }
3716}
3717
3718impl fidl::endpoints::Responder for CoordinatorSetDisplayPowerModeResponder {
3719 type ControlHandle = CoordinatorControlHandle;
3720
3721 fn control_handle(&self) -> &CoordinatorControlHandle {
3722 &self.control_handle
3723 }
3724
3725 fn drop_without_shutdown(mut self) {
3726 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3728 std::mem::forget(self);
3730 }
3731}
3732
3733impl CoordinatorSetDisplayPowerModeResponder {
3734 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3738 let _result = self.send_raw(result);
3739 if _result.is_err() {
3740 self.control_handle.shutdown();
3741 }
3742 self.drop_without_shutdown();
3743 _result
3744 }
3745
3746 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3748 let _result = self.send_raw(result);
3749 self.drop_without_shutdown();
3750 _result
3751 }
3752
3753 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3754 self.control_handle
3755 .inner
3756 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3757 result,
3758 self.tx_id,
3759 0xf4672f055072c92,
3760 fidl::encoding::DynamicFlags::empty(),
3761 )
3762 }
3763}
3764
3765#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3766pub struct CoordinatorListenerMarker;
3767
3768impl fidl::endpoints::ProtocolMarker for CoordinatorListenerMarker {
3769 type Proxy = CoordinatorListenerProxy;
3770 type RequestStream = CoordinatorListenerRequestStream;
3771 #[cfg(target_os = "fuchsia")]
3772 type SynchronousProxy = CoordinatorListenerSynchronousProxy;
3773
3774 const DEBUG_NAME: &'static str = "(anonymous) CoordinatorListener";
3775}
3776
3777pub trait CoordinatorListenerProxyInterface: Send + Sync {
3778 fn r#on_displays_changed(
3779 &self,
3780 added: &[Info],
3781 removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3782 ) -> Result<(), fidl::Error>;
3783 fn r#on_vsync(
3784 &self,
3785 display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
3786 timestamp: fidl::MonotonicInstant,
3787 displayed_config_stamp: &ConfigStamp,
3788 cookie: &VsyncAckCookie,
3789 ) -> Result<(), fidl::Error>;
3790 fn r#on_client_ownership_change(&self, has_ownership: bool) -> Result<(), fidl::Error>;
3791}
3792#[derive(Debug)]
3793#[cfg(target_os = "fuchsia")]
3794pub struct CoordinatorListenerSynchronousProxy {
3795 client: fidl::client::sync::Client,
3796}
3797
3798#[cfg(target_os = "fuchsia")]
3799impl fidl::endpoints::SynchronousProxy for CoordinatorListenerSynchronousProxy {
3800 type Proxy = CoordinatorListenerProxy;
3801 type Protocol = CoordinatorListenerMarker;
3802
3803 fn from_channel(inner: fidl::Channel) -> Self {
3804 Self::new(inner)
3805 }
3806
3807 fn into_channel(self) -> fidl::Channel {
3808 self.client.into_channel()
3809 }
3810
3811 fn as_channel(&self) -> &fidl::Channel {
3812 self.client.as_channel()
3813 }
3814}
3815
3816#[cfg(target_os = "fuchsia")]
3817impl CoordinatorListenerSynchronousProxy {
3818 pub fn new(channel: fidl::Channel) -> Self {
3819 Self { client: fidl::client::sync::Client::new(channel) }
3820 }
3821
3822 pub fn into_channel(self) -> fidl::Channel {
3823 self.client.into_channel()
3824 }
3825
3826 pub fn wait_for_event(
3829 &self,
3830 deadline: zx::MonotonicInstant,
3831 ) -> Result<CoordinatorListenerEvent, fidl::Error> {
3832 CoordinatorListenerEvent::decode(
3833 self.client.wait_for_event::<CoordinatorListenerMarker>(deadline)?,
3834 )
3835 }
3836
3837 pub fn r#on_displays_changed(
3848 &self,
3849 mut added: &[Info],
3850 mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3851 ) -> Result<(), fidl::Error> {
3852 self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
3853 (added, removed),
3854 0x248fbe90c338a94f,
3855 fidl::encoding::DynamicFlags::empty(),
3856 )
3857 }
3858
3859 pub fn r#on_vsync(
3876 &self,
3877 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
3878 mut timestamp: fidl::MonotonicInstant,
3879 mut displayed_config_stamp: &ConfigStamp,
3880 mut cookie: &VsyncAckCookie,
3881 ) -> Result<(), fidl::Error> {
3882 self.client.send::<CoordinatorListenerOnVsyncRequest>(
3883 (display_id, timestamp, displayed_config_stamp, cookie),
3884 0x249e9b8da7a7ac47,
3885 fidl::encoding::DynamicFlags::empty(),
3886 )
3887 }
3888
3889 pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
3898 self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
3899 (has_ownership,),
3900 0x1acd2ae683153d5e,
3901 fidl::encoding::DynamicFlags::empty(),
3902 )
3903 }
3904}
3905
3906#[cfg(target_os = "fuchsia")]
3907impl From<CoordinatorListenerSynchronousProxy> for zx::NullableHandle {
3908 fn from(value: CoordinatorListenerSynchronousProxy) -> Self {
3909 value.into_channel().into()
3910 }
3911}
3912
3913#[cfg(target_os = "fuchsia")]
3914impl From<fidl::Channel> for CoordinatorListenerSynchronousProxy {
3915 fn from(value: fidl::Channel) -> Self {
3916 Self::new(value)
3917 }
3918}
3919
3920#[cfg(target_os = "fuchsia")]
3921impl fidl::endpoints::FromClient for CoordinatorListenerSynchronousProxy {
3922 type Protocol = CoordinatorListenerMarker;
3923
3924 fn from_client(value: fidl::endpoints::ClientEnd<CoordinatorListenerMarker>) -> Self {
3925 Self::new(value.into_channel())
3926 }
3927}
3928
3929#[derive(Debug, Clone)]
3930pub struct CoordinatorListenerProxy {
3931 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3932}
3933
3934impl fidl::endpoints::Proxy for CoordinatorListenerProxy {
3935 type Protocol = CoordinatorListenerMarker;
3936
3937 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3938 Self::new(inner)
3939 }
3940
3941 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3942 self.client.into_channel().map_err(|client| Self { client })
3943 }
3944
3945 fn as_channel(&self) -> &::fidl::AsyncChannel {
3946 self.client.as_channel()
3947 }
3948}
3949
3950impl CoordinatorListenerProxy {
3951 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3953 let protocol_name =
3954 <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3955 Self { client: fidl::client::Client::new(channel, protocol_name) }
3956 }
3957
3958 pub fn take_event_stream(&self) -> CoordinatorListenerEventStream {
3964 CoordinatorListenerEventStream { event_receiver: self.client.take_event_receiver() }
3965 }
3966
3967 pub fn r#on_displays_changed(
3978 &self,
3979 mut added: &[Info],
3980 mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
3981 ) -> Result<(), fidl::Error> {
3982 CoordinatorListenerProxyInterface::r#on_displays_changed(self, added, removed)
3983 }
3984
3985 pub fn r#on_vsync(
4002 &self,
4003 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
4004 mut timestamp: fidl::MonotonicInstant,
4005 mut displayed_config_stamp: &ConfigStamp,
4006 mut cookie: &VsyncAckCookie,
4007 ) -> Result<(), fidl::Error> {
4008 CoordinatorListenerProxyInterface::r#on_vsync(
4009 self,
4010 display_id,
4011 timestamp,
4012 displayed_config_stamp,
4013 cookie,
4014 )
4015 }
4016
4017 pub fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
4026 CoordinatorListenerProxyInterface::r#on_client_ownership_change(self, has_ownership)
4027 }
4028}
4029
4030impl CoordinatorListenerProxyInterface for CoordinatorListenerProxy {
4031 fn r#on_displays_changed(
4032 &self,
4033 mut added: &[Info],
4034 mut removed: &[fidl_fuchsia_hardware_display_types::DisplayId],
4035 ) -> Result<(), fidl::Error> {
4036 self.client.send::<CoordinatorListenerOnDisplaysChangedRequest>(
4037 (added, removed),
4038 0x248fbe90c338a94f,
4039 fidl::encoding::DynamicFlags::empty(),
4040 )
4041 }
4042
4043 fn r#on_vsync(
4044 &self,
4045 mut display_id: &fidl_fuchsia_hardware_display_types::DisplayId,
4046 mut timestamp: fidl::MonotonicInstant,
4047 mut displayed_config_stamp: &ConfigStamp,
4048 mut cookie: &VsyncAckCookie,
4049 ) -> Result<(), fidl::Error> {
4050 self.client.send::<CoordinatorListenerOnVsyncRequest>(
4051 (display_id, timestamp, displayed_config_stamp, cookie),
4052 0x249e9b8da7a7ac47,
4053 fidl::encoding::DynamicFlags::empty(),
4054 )
4055 }
4056
4057 fn r#on_client_ownership_change(&self, mut has_ownership: bool) -> Result<(), fidl::Error> {
4058 self.client.send::<CoordinatorListenerOnClientOwnershipChangeRequest>(
4059 (has_ownership,),
4060 0x1acd2ae683153d5e,
4061 fidl::encoding::DynamicFlags::empty(),
4062 )
4063 }
4064}
4065
4066pub struct CoordinatorListenerEventStream {
4067 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4068}
4069
4070impl std::marker::Unpin for CoordinatorListenerEventStream {}
4071
4072impl futures::stream::FusedStream for CoordinatorListenerEventStream {
4073 fn is_terminated(&self) -> bool {
4074 self.event_receiver.is_terminated()
4075 }
4076}
4077
4078impl futures::Stream for CoordinatorListenerEventStream {
4079 type Item = Result<CoordinatorListenerEvent, fidl::Error>;
4080
4081 fn poll_next(
4082 mut self: std::pin::Pin<&mut Self>,
4083 cx: &mut std::task::Context<'_>,
4084 ) -> std::task::Poll<Option<Self::Item>> {
4085 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4086 &mut self.event_receiver,
4087 cx
4088 )?) {
4089 Some(buf) => std::task::Poll::Ready(Some(CoordinatorListenerEvent::decode(buf))),
4090 None => std::task::Poll::Ready(None),
4091 }
4092 }
4093}
4094
4095#[derive(Debug)]
4096pub enum CoordinatorListenerEvent {
4097 #[non_exhaustive]
4098 _UnknownEvent {
4099 ordinal: u64,
4101 },
4102}
4103
4104impl CoordinatorListenerEvent {
4105 fn decode(
4107 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4108 ) -> Result<CoordinatorListenerEvent, fidl::Error> {
4109 let (bytes, _handles) = buf.split_mut();
4110 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4111 debug_assert_eq!(tx_header.tx_id, 0);
4112 match tx_header.ordinal {
4113 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4114 Ok(CoordinatorListenerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4115 }
4116 _ => Err(fidl::Error::UnknownOrdinal {
4117 ordinal: tx_header.ordinal,
4118 protocol_name:
4119 <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4120 }),
4121 }
4122 }
4123}
4124
4125pub struct CoordinatorListenerRequestStream {
4127 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4128 is_terminated: bool,
4129}
4130
4131impl std::marker::Unpin for CoordinatorListenerRequestStream {}
4132
4133impl futures::stream::FusedStream for CoordinatorListenerRequestStream {
4134 fn is_terminated(&self) -> bool {
4135 self.is_terminated
4136 }
4137}
4138
4139impl fidl::endpoints::RequestStream for CoordinatorListenerRequestStream {
4140 type Protocol = CoordinatorListenerMarker;
4141 type ControlHandle = CoordinatorListenerControlHandle;
4142
4143 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4144 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4145 }
4146
4147 fn control_handle(&self) -> Self::ControlHandle {
4148 CoordinatorListenerControlHandle { inner: self.inner.clone() }
4149 }
4150
4151 fn into_inner(
4152 self,
4153 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4154 {
4155 (self.inner, self.is_terminated)
4156 }
4157
4158 fn from_inner(
4159 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4160 is_terminated: bool,
4161 ) -> Self {
4162 Self { inner, is_terminated }
4163 }
4164}
4165
4166impl futures::Stream for CoordinatorListenerRequestStream {
4167 type Item = Result<CoordinatorListenerRequest, fidl::Error>;
4168
4169 fn poll_next(
4170 mut self: std::pin::Pin<&mut Self>,
4171 cx: &mut std::task::Context<'_>,
4172 ) -> std::task::Poll<Option<Self::Item>> {
4173 let this = &mut *self;
4174 if this.inner.check_shutdown(cx) {
4175 this.is_terminated = true;
4176 return std::task::Poll::Ready(None);
4177 }
4178 if this.is_terminated {
4179 panic!("polled CoordinatorListenerRequestStream after completion");
4180 }
4181 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4182 |bytes, handles| {
4183 match this.inner.channel().read_etc(cx, bytes, handles) {
4184 std::task::Poll::Ready(Ok(())) => {}
4185 std::task::Poll::Pending => return std::task::Poll::Pending,
4186 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4187 this.is_terminated = true;
4188 return std::task::Poll::Ready(None);
4189 }
4190 std::task::Poll::Ready(Err(e)) => {
4191 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4192 e.into(),
4193 ))));
4194 }
4195 }
4196
4197 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4199
4200 std::task::Poll::Ready(Some(match header.ordinal {
4201 0x248fbe90c338a94f => {
4202 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4203 let mut req = fidl::new_empty!(CoordinatorListenerOnDisplaysChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4204 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnDisplaysChangedRequest>(&header, _body_bytes, handles, &mut req)?;
4205 let control_handle = CoordinatorListenerControlHandle {
4206 inner: this.inner.clone(),
4207 };
4208 Ok(CoordinatorListenerRequest::OnDisplaysChanged {added: req.added,
4209removed: req.removed,
4210
4211 control_handle,
4212 })
4213 }
4214 0x249e9b8da7a7ac47 => {
4215 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4216 let mut req = fidl::new_empty!(CoordinatorListenerOnVsyncRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4217 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnVsyncRequest>(&header, _body_bytes, handles, &mut req)?;
4218 let control_handle = CoordinatorListenerControlHandle {
4219 inner: this.inner.clone(),
4220 };
4221 Ok(CoordinatorListenerRequest::OnVsync {display_id: req.display_id,
4222timestamp: req.timestamp,
4223displayed_config_stamp: req.displayed_config_stamp,
4224cookie: req.cookie,
4225
4226 control_handle,
4227 })
4228 }
4229 0x1acd2ae683153d5e => {
4230 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4231 let mut req = fidl::new_empty!(CoordinatorListenerOnClientOwnershipChangeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4232 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CoordinatorListenerOnClientOwnershipChangeRequest>(&header, _body_bytes, handles, &mut req)?;
4233 let control_handle = CoordinatorListenerControlHandle {
4234 inner: this.inner.clone(),
4235 };
4236 Ok(CoordinatorListenerRequest::OnClientOwnershipChange {has_ownership: req.has_ownership,
4237
4238 control_handle,
4239 })
4240 }
4241 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4242 Ok(CoordinatorListenerRequest::_UnknownMethod {
4243 ordinal: header.ordinal,
4244 control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
4245 method_type: fidl::MethodType::OneWay,
4246 })
4247 }
4248 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4249 this.inner.send_framework_err(
4250 fidl::encoding::FrameworkErr::UnknownMethod,
4251 header.tx_id,
4252 header.ordinal,
4253 header.dynamic_flags(),
4254 (bytes, handles),
4255 )?;
4256 Ok(CoordinatorListenerRequest::_UnknownMethod {
4257 ordinal: header.ordinal,
4258 control_handle: CoordinatorListenerControlHandle { inner: this.inner.clone() },
4259 method_type: fidl::MethodType::TwoWay,
4260 })
4261 }
4262 _ => Err(fidl::Error::UnknownOrdinal {
4263 ordinal: header.ordinal,
4264 protocol_name: <CoordinatorListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4265 }),
4266 }))
4267 },
4268 )
4269 }
4270}
4271
4272#[derive(Debug)]
4276pub enum CoordinatorListenerRequest {
4277 OnDisplaysChanged {
4288 added: Vec<Info>,
4289 removed: Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
4290 control_handle: CoordinatorListenerControlHandle,
4291 },
4292 OnVsync {
4309 display_id: fidl_fuchsia_hardware_display_types::DisplayId,
4310 timestamp: fidl::MonotonicInstant,
4311 displayed_config_stamp: ConfigStamp,
4312 cookie: VsyncAckCookie,
4313 control_handle: CoordinatorListenerControlHandle,
4314 },
4315 OnClientOwnershipChange {
4324 has_ownership: bool,
4325 control_handle: CoordinatorListenerControlHandle,
4326 },
4327 #[non_exhaustive]
4329 _UnknownMethod {
4330 ordinal: u64,
4332 control_handle: CoordinatorListenerControlHandle,
4333 method_type: fidl::MethodType,
4334 },
4335}
4336
4337impl CoordinatorListenerRequest {
4338 #[allow(irrefutable_let_patterns)]
4339 pub fn into_on_displays_changed(
4340 self,
4341 ) -> Option<(
4342 Vec<Info>,
4343 Vec<fidl_fuchsia_hardware_display_types::DisplayId>,
4344 CoordinatorListenerControlHandle,
4345 )> {
4346 if let CoordinatorListenerRequest::OnDisplaysChanged { added, removed, control_handle } =
4347 self
4348 {
4349 Some((added, removed, control_handle))
4350 } else {
4351 None
4352 }
4353 }
4354
4355 #[allow(irrefutable_let_patterns)]
4356 pub fn into_on_vsync(
4357 self,
4358 ) -> Option<(
4359 fidl_fuchsia_hardware_display_types::DisplayId,
4360 fidl::MonotonicInstant,
4361 ConfigStamp,
4362 VsyncAckCookie,
4363 CoordinatorListenerControlHandle,
4364 )> {
4365 if let CoordinatorListenerRequest::OnVsync {
4366 display_id,
4367 timestamp,
4368 displayed_config_stamp,
4369 cookie,
4370 control_handle,
4371 } = self
4372 {
4373 Some((display_id, timestamp, displayed_config_stamp, cookie, control_handle))
4374 } else {
4375 None
4376 }
4377 }
4378
4379 #[allow(irrefutable_let_patterns)]
4380 pub fn into_on_client_ownership_change(
4381 self,
4382 ) -> Option<(bool, CoordinatorListenerControlHandle)> {
4383 if let CoordinatorListenerRequest::OnClientOwnershipChange {
4384 has_ownership,
4385 control_handle,
4386 } = self
4387 {
4388 Some((has_ownership, control_handle))
4389 } else {
4390 None
4391 }
4392 }
4393
4394 pub fn method_name(&self) -> &'static str {
4396 match *self {
4397 CoordinatorListenerRequest::OnDisplaysChanged { .. } => "on_displays_changed",
4398 CoordinatorListenerRequest::OnVsync { .. } => "on_vsync",
4399 CoordinatorListenerRequest::OnClientOwnershipChange { .. } => {
4400 "on_client_ownership_change"
4401 }
4402 CoordinatorListenerRequest::_UnknownMethod {
4403 method_type: fidl::MethodType::OneWay,
4404 ..
4405 } => "unknown one-way method",
4406 CoordinatorListenerRequest::_UnknownMethod {
4407 method_type: fidl::MethodType::TwoWay,
4408 ..
4409 } => "unknown two-way method",
4410 }
4411 }
4412}
4413
4414#[derive(Debug, Clone)]
4415pub struct CoordinatorListenerControlHandle {
4416 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4417}
4418
4419impl fidl::endpoints::ControlHandle for CoordinatorListenerControlHandle {
4420 fn shutdown(&self) {
4421 self.inner.shutdown()
4422 }
4423
4424 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4425 self.inner.shutdown_with_epitaph(status)
4426 }
4427
4428 fn is_closed(&self) -> bool {
4429 self.inner.channel().is_closed()
4430 }
4431 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4432 self.inner.channel().on_closed()
4433 }
4434
4435 #[cfg(target_os = "fuchsia")]
4436 fn signal_peer(
4437 &self,
4438 clear_mask: zx::Signals,
4439 set_mask: zx::Signals,
4440 ) -> Result<(), zx_status::Status> {
4441 use fidl::Peered;
4442 self.inner.channel().signal_peer(clear_mask, set_mask)
4443 }
4444}
4445
4446impl CoordinatorListenerControlHandle {}
4447
4448#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4449pub struct ProviderMarker;
4450
4451impl fidl::endpoints::ProtocolMarker for ProviderMarker {
4452 type Proxy = ProviderProxy;
4453 type RequestStream = ProviderRequestStream;
4454 #[cfg(target_os = "fuchsia")]
4455 type SynchronousProxy = ProviderSynchronousProxy;
4456
4457 const DEBUG_NAME: &'static str = "fuchsia.hardware.display.Provider";
4458}
4459impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
4460pub type ProviderOpenCoordinatorResult = Result<(), i32>;
4461
4462pub trait ProviderProxyInterface: Send + Sync {
4463 type OpenCoordinatorResponseFut: std::future::Future<Output = Result<ProviderOpenCoordinatorResult, fidl::Error>>
4464 + Send;
4465 fn r#open_coordinator(
4466 &self,
4467 payload: ProviderOpenCoordinatorRequest,
4468 ) -> Self::OpenCoordinatorResponseFut;
4469}
4470#[derive(Debug)]
4471#[cfg(target_os = "fuchsia")]
4472pub struct ProviderSynchronousProxy {
4473 client: fidl::client::sync::Client,
4474}
4475
4476#[cfg(target_os = "fuchsia")]
4477impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
4478 type Proxy = ProviderProxy;
4479 type Protocol = ProviderMarker;
4480
4481 fn from_channel(inner: fidl::Channel) -> Self {
4482 Self::new(inner)
4483 }
4484
4485 fn into_channel(self) -> fidl::Channel {
4486 self.client.into_channel()
4487 }
4488
4489 fn as_channel(&self) -> &fidl::Channel {
4490 self.client.as_channel()
4491 }
4492}
4493
4494#[cfg(target_os = "fuchsia")]
4495impl ProviderSynchronousProxy {
4496 pub fn new(channel: fidl::Channel) -> Self {
4497 Self { client: fidl::client::sync::Client::new(channel) }
4498 }
4499
4500 pub fn into_channel(self) -> fidl::Channel {
4501 self.client.into_channel()
4502 }
4503
4504 pub fn wait_for_event(
4507 &self,
4508 deadline: zx::MonotonicInstant,
4509 ) -> Result<ProviderEvent, fidl::Error> {
4510 ProviderEvent::decode(self.client.wait_for_event::<ProviderMarker>(deadline)?)
4511 }
4512
4513 pub fn r#open_coordinator(
4524 &self,
4525 mut payload: ProviderOpenCoordinatorRequest,
4526 ___deadline: zx::MonotonicInstant,
4527 ) -> Result<ProviderOpenCoordinatorResult, fidl::Error> {
4528 let _response = self.client.send_query::<
4529 ProviderOpenCoordinatorRequest,
4530 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4531 ProviderMarker,
4532 >(
4533 &mut payload,
4534 0x1bd6070372d03df0,
4535 fidl::encoding::DynamicFlags::empty(),
4536 ___deadline,
4537 )?;
4538 Ok(_response.map(|x| x))
4539 }
4540}
4541
4542#[cfg(target_os = "fuchsia")]
4543impl From<ProviderSynchronousProxy> for zx::NullableHandle {
4544 fn from(value: ProviderSynchronousProxy) -> Self {
4545 value.into_channel().into()
4546 }
4547}
4548
4549#[cfg(target_os = "fuchsia")]
4550impl From<fidl::Channel> for ProviderSynchronousProxy {
4551 fn from(value: fidl::Channel) -> Self {
4552 Self::new(value)
4553 }
4554}
4555
4556#[cfg(target_os = "fuchsia")]
4557impl fidl::endpoints::FromClient for ProviderSynchronousProxy {
4558 type Protocol = ProviderMarker;
4559
4560 fn from_client(value: fidl::endpoints::ClientEnd<ProviderMarker>) -> Self {
4561 Self::new(value.into_channel())
4562 }
4563}
4564
4565#[derive(Debug, Clone)]
4566pub struct ProviderProxy {
4567 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4568}
4569
4570impl fidl::endpoints::Proxy for ProviderProxy {
4571 type Protocol = ProviderMarker;
4572
4573 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4574 Self::new(inner)
4575 }
4576
4577 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4578 self.client.into_channel().map_err(|client| Self { client })
4579 }
4580
4581 fn as_channel(&self) -> &::fidl::AsyncChannel {
4582 self.client.as_channel()
4583 }
4584}
4585
4586impl ProviderProxy {
4587 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4589 let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4590 Self { client: fidl::client::Client::new(channel, protocol_name) }
4591 }
4592
4593 pub fn take_event_stream(&self) -> ProviderEventStream {
4599 ProviderEventStream { event_receiver: self.client.take_event_receiver() }
4600 }
4601
4602 pub fn r#open_coordinator(
4613 &self,
4614 mut payload: ProviderOpenCoordinatorRequest,
4615 ) -> fidl::client::QueryResponseFut<
4616 ProviderOpenCoordinatorResult,
4617 fidl::encoding::DefaultFuchsiaResourceDialect,
4618 > {
4619 ProviderProxyInterface::r#open_coordinator(self, payload)
4620 }
4621}
4622
4623impl ProviderProxyInterface for ProviderProxy {
4624 type OpenCoordinatorResponseFut = fidl::client::QueryResponseFut<
4625 ProviderOpenCoordinatorResult,
4626 fidl::encoding::DefaultFuchsiaResourceDialect,
4627 >;
4628 fn r#open_coordinator(
4629 &self,
4630 mut payload: ProviderOpenCoordinatorRequest,
4631 ) -> Self::OpenCoordinatorResponseFut {
4632 fn _decode(
4633 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4634 ) -> Result<ProviderOpenCoordinatorResult, fidl::Error> {
4635 let _response = fidl::client::decode_transaction_body::<
4636 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4637 fidl::encoding::DefaultFuchsiaResourceDialect,
4638 0x1bd6070372d03df0,
4639 >(_buf?)?;
4640 Ok(_response.map(|x| x))
4641 }
4642 self.client
4643 .send_query_and_decode::<ProviderOpenCoordinatorRequest, ProviderOpenCoordinatorResult>(
4644 &mut payload,
4645 0x1bd6070372d03df0,
4646 fidl::encoding::DynamicFlags::empty(),
4647 _decode,
4648 )
4649 }
4650}
4651
4652pub struct ProviderEventStream {
4653 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4654}
4655
4656impl std::marker::Unpin for ProviderEventStream {}
4657
4658impl futures::stream::FusedStream for ProviderEventStream {
4659 fn is_terminated(&self) -> bool {
4660 self.event_receiver.is_terminated()
4661 }
4662}
4663
4664impl futures::Stream for ProviderEventStream {
4665 type Item = Result<ProviderEvent, fidl::Error>;
4666
4667 fn poll_next(
4668 mut self: std::pin::Pin<&mut Self>,
4669 cx: &mut std::task::Context<'_>,
4670 ) -> std::task::Poll<Option<Self::Item>> {
4671 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4672 &mut self.event_receiver,
4673 cx
4674 )?) {
4675 Some(buf) => std::task::Poll::Ready(Some(ProviderEvent::decode(buf))),
4676 None => std::task::Poll::Ready(None),
4677 }
4678 }
4679}
4680
4681#[derive(Debug)]
4682pub enum ProviderEvent {}
4683
4684impl ProviderEvent {
4685 fn decode(
4687 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4688 ) -> Result<ProviderEvent, fidl::Error> {
4689 let (bytes, _handles) = buf.split_mut();
4690 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4691 debug_assert_eq!(tx_header.tx_id, 0);
4692 match tx_header.ordinal {
4693 _ => Err(fidl::Error::UnknownOrdinal {
4694 ordinal: tx_header.ordinal,
4695 protocol_name: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4696 }),
4697 }
4698 }
4699}
4700
4701pub struct ProviderRequestStream {
4703 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4704 is_terminated: bool,
4705}
4706
4707impl std::marker::Unpin for ProviderRequestStream {}
4708
4709impl futures::stream::FusedStream for ProviderRequestStream {
4710 fn is_terminated(&self) -> bool {
4711 self.is_terminated
4712 }
4713}
4714
4715impl fidl::endpoints::RequestStream for ProviderRequestStream {
4716 type Protocol = ProviderMarker;
4717 type ControlHandle = ProviderControlHandle;
4718
4719 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4720 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4721 }
4722
4723 fn control_handle(&self) -> Self::ControlHandle {
4724 ProviderControlHandle { inner: self.inner.clone() }
4725 }
4726
4727 fn into_inner(
4728 self,
4729 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4730 {
4731 (self.inner, self.is_terminated)
4732 }
4733
4734 fn from_inner(
4735 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4736 is_terminated: bool,
4737 ) -> Self {
4738 Self { inner, is_terminated }
4739 }
4740}
4741
4742impl futures::Stream for ProviderRequestStream {
4743 type Item = Result<ProviderRequest, fidl::Error>;
4744
4745 fn poll_next(
4746 mut self: std::pin::Pin<&mut Self>,
4747 cx: &mut std::task::Context<'_>,
4748 ) -> std::task::Poll<Option<Self::Item>> {
4749 let this = &mut *self;
4750 if this.inner.check_shutdown(cx) {
4751 this.is_terminated = true;
4752 return std::task::Poll::Ready(None);
4753 }
4754 if this.is_terminated {
4755 panic!("polled ProviderRequestStream after completion");
4756 }
4757 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4758 |bytes, handles| {
4759 match this.inner.channel().read_etc(cx, bytes, handles) {
4760 std::task::Poll::Ready(Ok(())) => {}
4761 std::task::Poll::Pending => return std::task::Poll::Pending,
4762 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4763 this.is_terminated = true;
4764 return std::task::Poll::Ready(None);
4765 }
4766 std::task::Poll::Ready(Err(e)) => {
4767 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4768 e.into(),
4769 ))));
4770 }
4771 }
4772
4773 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4775
4776 std::task::Poll::Ready(Some(match header.ordinal {
4777 0x1bd6070372d03df0 => {
4778 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4779 let mut req = fidl::new_empty!(
4780 ProviderOpenCoordinatorRequest,
4781 fidl::encoding::DefaultFuchsiaResourceDialect
4782 );
4783 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderOpenCoordinatorRequest>(&header, _body_bytes, handles, &mut req)?;
4784 let control_handle = ProviderControlHandle { inner: this.inner.clone() };
4785 Ok(ProviderRequest::OpenCoordinator {
4786 payload: req,
4787 responder: ProviderOpenCoordinatorResponder {
4788 control_handle: std::mem::ManuallyDrop::new(control_handle),
4789 tx_id: header.tx_id,
4790 },
4791 })
4792 }
4793 _ => Err(fidl::Error::UnknownOrdinal {
4794 ordinal: header.ordinal,
4795 protocol_name:
4796 <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4797 }),
4798 }))
4799 },
4800 )
4801 }
4802}
4803
4804#[derive(Debug)]
4811pub enum ProviderRequest {
4812 OpenCoordinator {
4823 payload: ProviderOpenCoordinatorRequest,
4824 responder: ProviderOpenCoordinatorResponder,
4825 },
4826}
4827
4828impl ProviderRequest {
4829 #[allow(irrefutable_let_patterns)]
4830 pub fn into_open_coordinator(
4831 self,
4832 ) -> Option<(ProviderOpenCoordinatorRequest, ProviderOpenCoordinatorResponder)> {
4833 if let ProviderRequest::OpenCoordinator { payload, responder } = self {
4834 Some((payload, responder))
4835 } else {
4836 None
4837 }
4838 }
4839
4840 pub fn method_name(&self) -> &'static str {
4842 match *self {
4843 ProviderRequest::OpenCoordinator { .. } => "open_coordinator",
4844 }
4845 }
4846}
4847
4848#[derive(Debug, Clone)]
4849pub struct ProviderControlHandle {
4850 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4851}
4852
4853impl fidl::endpoints::ControlHandle for ProviderControlHandle {
4854 fn shutdown(&self) {
4855 self.inner.shutdown()
4856 }
4857
4858 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4859 self.inner.shutdown_with_epitaph(status)
4860 }
4861
4862 fn is_closed(&self) -> bool {
4863 self.inner.channel().is_closed()
4864 }
4865 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4866 self.inner.channel().on_closed()
4867 }
4868
4869 #[cfg(target_os = "fuchsia")]
4870 fn signal_peer(
4871 &self,
4872 clear_mask: zx::Signals,
4873 set_mask: zx::Signals,
4874 ) -> Result<(), zx_status::Status> {
4875 use fidl::Peered;
4876 self.inner.channel().signal_peer(clear_mask, set_mask)
4877 }
4878}
4879
4880impl ProviderControlHandle {}
4881
4882#[must_use = "FIDL methods require a response to be sent"]
4883#[derive(Debug)]
4884pub struct ProviderOpenCoordinatorResponder {
4885 control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
4886 tx_id: u32,
4887}
4888
4889impl std::ops::Drop for ProviderOpenCoordinatorResponder {
4893 fn drop(&mut self) {
4894 self.control_handle.shutdown();
4895 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4897 }
4898}
4899
4900impl fidl::endpoints::Responder for ProviderOpenCoordinatorResponder {
4901 type ControlHandle = ProviderControlHandle;
4902
4903 fn control_handle(&self) -> &ProviderControlHandle {
4904 &self.control_handle
4905 }
4906
4907 fn drop_without_shutdown(mut self) {
4908 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4910 std::mem::forget(self);
4912 }
4913}
4914
4915impl ProviderOpenCoordinatorResponder {
4916 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4920 let _result = self.send_raw(result);
4921 if _result.is_err() {
4922 self.control_handle.shutdown();
4923 }
4924 self.drop_without_shutdown();
4925 _result
4926 }
4927
4928 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4930 let _result = self.send_raw(result);
4931 self.drop_without_shutdown();
4932 _result
4933 }
4934
4935 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4936 self.control_handle
4937 .inner
4938 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4939 result,
4940 self.tx_id,
4941 0x1bd6070372d03df0,
4942 fidl::encoding::DynamicFlags::empty(),
4943 )
4944 }
4945}
4946
4947#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4948pub struct ServiceMarker;
4949
4950#[cfg(target_os = "fuchsia")]
4951impl fidl::endpoints::ServiceMarker for ServiceMarker {
4952 type Proxy = ServiceProxy;
4953 type Request = ServiceRequest;
4954 const SERVICE_NAME: &'static str = "fuchsia.hardware.display.Service";
4955}
4956
4957#[cfg(target_os = "fuchsia")]
4960pub enum ServiceRequest {
4961 Provider(ProviderRequestStream),
4962}
4963
4964#[cfg(target_os = "fuchsia")]
4965impl fidl::endpoints::ServiceRequest for ServiceRequest {
4966 type Service = ServiceMarker;
4967
4968 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
4969 match name {
4970 "provider" => Self::Provider(
4971 <ProviderRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
4972 ),
4973 _ => panic!("no such member protocol name for service Service"),
4974 }
4975 }
4976
4977 fn member_names() -> &'static [&'static str] {
4978 &["provider"]
4979 }
4980}
4981#[cfg(target_os = "fuchsia")]
4982pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
4983
4984#[cfg(target_os = "fuchsia")]
4985impl fidl::endpoints::ServiceProxy for ServiceProxy {
4986 type Service = ServiceMarker;
4987
4988 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
4989 Self(opener)
4990 }
4991}
4992
4993#[cfg(target_os = "fuchsia")]
4994impl ServiceProxy {
4995 pub fn connect_to_provider(&self) -> Result<ProviderProxy, fidl::Error> {
4996 let (proxy, server_end) = fidl::endpoints::create_proxy::<ProviderMarker>();
4997 self.connect_channel_to_provider(server_end)?;
4998 Ok(proxy)
4999 }
5000
5001 pub fn connect_to_provider_sync(&self) -> Result<ProviderSynchronousProxy, fidl::Error> {
5004 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ProviderMarker>();
5005 self.connect_channel_to_provider(server_end)?;
5006 Ok(proxy)
5007 }
5008
5009 pub fn connect_channel_to_provider(
5012 &self,
5013 server_end: fidl::endpoints::ServerEnd<ProviderMarker>,
5014 ) -> Result<(), fidl::Error> {
5015 self.0.open_member("provider", server_end.into_channel())
5016 }
5017
5018 pub fn instance_name(&self) -> &str {
5019 self.0.instance_name()
5020 }
5021}
5022
5023mod internal {
5024 use super::*;
5025
5026 impl fidl::encoding::ResourceTypeMarker for CoordinatorImportBufferCollectionRequest {
5027 type Borrowed<'a> = &'a mut Self;
5028 fn take_or_borrow<'a>(
5029 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5030 ) -> Self::Borrowed<'a> {
5031 value
5032 }
5033 }
5034
5035 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportBufferCollectionRequest {
5036 type Owned = Self;
5037
5038 #[inline(always)]
5039 fn inline_align(_context: fidl::encoding::Context) -> usize {
5040 8
5041 }
5042
5043 #[inline(always)]
5044 fn inline_size(_context: fidl::encoding::Context) -> usize {
5045 16
5046 }
5047 }
5048
5049 unsafe impl
5050 fidl::encoding::Encode<
5051 CoordinatorImportBufferCollectionRequest,
5052 fidl::encoding::DefaultFuchsiaResourceDialect,
5053 > for &mut CoordinatorImportBufferCollectionRequest
5054 {
5055 #[inline]
5056 unsafe fn encode(
5057 self,
5058 encoder: &mut fidl::encoding::Encoder<
5059 '_,
5060 fidl::encoding::DefaultFuchsiaResourceDialect,
5061 >,
5062 offset: usize,
5063 _depth: fidl::encoding::Depth,
5064 ) -> fidl::Result<()> {
5065 encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
5066 fidl::encoding::Encode::<
5068 CoordinatorImportBufferCollectionRequest,
5069 fidl::encoding::DefaultFuchsiaResourceDialect,
5070 >::encode(
5071 (
5072 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(
5073 &self.buffer_collection_id,
5074 ),
5075 <fidl::encoding::Endpoint<
5076 fidl::endpoints::ClientEnd<
5077 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5078 >,
5079 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5080 &mut self.buffer_collection_token,
5081 ),
5082 ),
5083 encoder,
5084 offset,
5085 _depth,
5086 )
5087 }
5088 }
5089 unsafe impl<
5090 T0: fidl::encoding::Encode<BufferCollectionId, fidl::encoding::DefaultFuchsiaResourceDialect>,
5091 T1: fidl::encoding::Encode<
5092 fidl::encoding::Endpoint<
5093 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5094 >,
5095 fidl::encoding::DefaultFuchsiaResourceDialect,
5096 >,
5097 >
5098 fidl::encoding::Encode<
5099 CoordinatorImportBufferCollectionRequest,
5100 fidl::encoding::DefaultFuchsiaResourceDialect,
5101 > for (T0, T1)
5102 {
5103 #[inline]
5104 unsafe fn encode(
5105 self,
5106 encoder: &mut fidl::encoding::Encoder<
5107 '_,
5108 fidl::encoding::DefaultFuchsiaResourceDialect,
5109 >,
5110 offset: usize,
5111 depth: fidl::encoding::Depth,
5112 ) -> fidl::Result<()> {
5113 encoder.debug_check_bounds::<CoordinatorImportBufferCollectionRequest>(offset);
5114 unsafe {
5117 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5118 (ptr as *mut u64).write_unaligned(0);
5119 }
5120 self.0.encode(encoder, offset + 0, depth)?;
5122 self.1.encode(encoder, offset + 8, depth)?;
5123 Ok(())
5124 }
5125 }
5126
5127 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5128 for CoordinatorImportBufferCollectionRequest
5129 {
5130 #[inline(always)]
5131 fn new_empty() -> Self {
5132 Self {
5133 buffer_collection_id: fidl::new_empty!(
5134 BufferCollectionId,
5135 fidl::encoding::DefaultFuchsiaResourceDialect
5136 ),
5137 buffer_collection_token: fidl::new_empty!(
5138 fidl::encoding::Endpoint<
5139 fidl::endpoints::ClientEnd<
5140 fidl_fuchsia_sysmem2::BufferCollectionTokenMarker,
5141 >,
5142 >,
5143 fidl::encoding::DefaultFuchsiaResourceDialect
5144 ),
5145 }
5146 }
5147
5148 #[inline]
5149 unsafe fn decode(
5150 &mut self,
5151 decoder: &mut fidl::encoding::Decoder<
5152 '_,
5153 fidl::encoding::DefaultFuchsiaResourceDialect,
5154 >,
5155 offset: usize,
5156 _depth: fidl::encoding::Depth,
5157 ) -> fidl::Result<()> {
5158 decoder.debug_check_bounds::<Self>(offset);
5159 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5161 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5162 let mask = 0xffffffff00000000u64;
5163 let maskedval = padval & mask;
5164 if maskedval != 0 {
5165 return Err(fidl::Error::NonZeroPadding {
5166 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5167 });
5168 }
5169 fidl::decode!(
5170 BufferCollectionId,
5171 fidl::encoding::DefaultFuchsiaResourceDialect,
5172 &mut self.buffer_collection_id,
5173 decoder,
5174 offset + 0,
5175 _depth
5176 )?;
5177 fidl::decode!(
5178 fidl::encoding::Endpoint<
5179 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem2::BufferCollectionTokenMarker>,
5180 >,
5181 fidl::encoding::DefaultFuchsiaResourceDialect,
5182 &mut self.buffer_collection_token,
5183 decoder,
5184 offset + 8,
5185 _depth
5186 )?;
5187 Ok(())
5188 }
5189 }
5190
5191 impl fidl::encoding::ResourceTypeMarker for CoordinatorImportEventRequest {
5192 type Borrowed<'a> = &'a mut Self;
5193 fn take_or_borrow<'a>(
5194 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5195 ) -> Self::Borrowed<'a> {
5196 value
5197 }
5198 }
5199
5200 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportEventRequest {
5201 type Owned = Self;
5202
5203 #[inline(always)]
5204 fn inline_align(_context: fidl::encoding::Context) -> usize {
5205 8
5206 }
5207
5208 #[inline(always)]
5209 fn inline_size(_context: fidl::encoding::Context) -> usize {
5210 16
5211 }
5212 }
5213
5214 unsafe impl
5215 fidl::encoding::Encode<
5216 CoordinatorImportEventRequest,
5217 fidl::encoding::DefaultFuchsiaResourceDialect,
5218 > for &mut CoordinatorImportEventRequest
5219 {
5220 #[inline]
5221 unsafe fn encode(
5222 self,
5223 encoder: &mut fidl::encoding::Encoder<
5224 '_,
5225 fidl::encoding::DefaultFuchsiaResourceDialect,
5226 >,
5227 offset: usize,
5228 _depth: fidl::encoding::Depth,
5229 ) -> fidl::Result<()> {
5230 encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
5231 fidl::encoding::Encode::<
5233 CoordinatorImportEventRequest,
5234 fidl::encoding::DefaultFuchsiaResourceDialect,
5235 >::encode(
5236 (
5237 <fidl::encoding::HandleType<
5238 fidl::Event,
5239 { fidl::ObjectType::EVENT.into_raw() },
5240 2147483648,
5241 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5242 &mut self.event
5243 ),
5244 <EventId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
5245 ),
5246 encoder,
5247 offset,
5248 _depth,
5249 )
5250 }
5251 }
5252 unsafe impl<
5253 T0: fidl::encoding::Encode<
5254 fidl::encoding::HandleType<
5255 fidl::Event,
5256 { fidl::ObjectType::EVENT.into_raw() },
5257 2147483648,
5258 >,
5259 fidl::encoding::DefaultFuchsiaResourceDialect,
5260 >,
5261 T1: fidl::encoding::Encode<EventId, fidl::encoding::DefaultFuchsiaResourceDialect>,
5262 >
5263 fidl::encoding::Encode<
5264 CoordinatorImportEventRequest,
5265 fidl::encoding::DefaultFuchsiaResourceDialect,
5266 > for (T0, T1)
5267 {
5268 #[inline]
5269 unsafe fn encode(
5270 self,
5271 encoder: &mut fidl::encoding::Encoder<
5272 '_,
5273 fidl::encoding::DefaultFuchsiaResourceDialect,
5274 >,
5275 offset: usize,
5276 depth: fidl::encoding::Depth,
5277 ) -> fidl::Result<()> {
5278 encoder.debug_check_bounds::<CoordinatorImportEventRequest>(offset);
5279 unsafe {
5282 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5283 (ptr as *mut u64).write_unaligned(0);
5284 }
5285 self.0.encode(encoder, offset + 0, depth)?;
5287 self.1.encode(encoder, offset + 8, depth)?;
5288 Ok(())
5289 }
5290 }
5291
5292 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5293 for CoordinatorImportEventRequest
5294 {
5295 #[inline(always)]
5296 fn new_empty() -> Self {
5297 Self {
5298 event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5299 id: fidl::new_empty!(EventId, fidl::encoding::DefaultFuchsiaResourceDialect),
5300 }
5301 }
5302
5303 #[inline]
5304 unsafe fn decode(
5305 &mut self,
5306 decoder: &mut fidl::encoding::Decoder<
5307 '_,
5308 fidl::encoding::DefaultFuchsiaResourceDialect,
5309 >,
5310 offset: usize,
5311 _depth: fidl::encoding::Depth,
5312 ) -> fidl::Result<()> {
5313 decoder.debug_check_bounds::<Self>(offset);
5314 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5316 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5317 let mask = 0xffffffff00000000u64;
5318 let maskedval = padval & mask;
5319 if maskedval != 0 {
5320 return Err(fidl::Error::NonZeroPadding {
5321 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5322 });
5323 }
5324 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
5325 fidl::decode!(
5326 EventId,
5327 fidl::encoding::DefaultFuchsiaResourceDialect,
5328 &mut self.id,
5329 decoder,
5330 offset + 8,
5331 _depth
5332 )?;
5333 Ok(())
5334 }
5335 }
5336
5337 impl CoordinatorCommitConfigRequest {
5338 #[inline(always)]
5339 fn max_ordinal_present(&self) -> u64 {
5340 if let Some(_) = self.stamp {
5341 return 1;
5342 }
5343 0
5344 }
5345 }
5346
5347 impl fidl::encoding::ResourceTypeMarker for CoordinatorCommitConfigRequest {
5348 type Borrowed<'a> = &'a mut Self;
5349 fn take_or_borrow<'a>(
5350 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5351 ) -> Self::Borrowed<'a> {
5352 value
5353 }
5354 }
5355
5356 unsafe impl fidl::encoding::TypeMarker for CoordinatorCommitConfigRequest {
5357 type Owned = Self;
5358
5359 #[inline(always)]
5360 fn inline_align(_context: fidl::encoding::Context) -> usize {
5361 8
5362 }
5363
5364 #[inline(always)]
5365 fn inline_size(_context: fidl::encoding::Context) -> usize {
5366 16
5367 }
5368 }
5369
5370 unsafe impl
5371 fidl::encoding::Encode<
5372 CoordinatorCommitConfigRequest,
5373 fidl::encoding::DefaultFuchsiaResourceDialect,
5374 > for &mut CoordinatorCommitConfigRequest
5375 {
5376 unsafe fn encode(
5377 self,
5378 encoder: &mut fidl::encoding::Encoder<
5379 '_,
5380 fidl::encoding::DefaultFuchsiaResourceDialect,
5381 >,
5382 offset: usize,
5383 mut depth: fidl::encoding::Depth,
5384 ) -> fidl::Result<()> {
5385 encoder.debug_check_bounds::<CoordinatorCommitConfigRequest>(offset);
5386 let max_ordinal: u64 = self.max_ordinal_present();
5388 encoder.write_num(max_ordinal, offset);
5389 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5390 if max_ordinal == 0 {
5392 return Ok(());
5393 }
5394 depth.increment()?;
5395 let envelope_size = 8;
5396 let bytes_len = max_ordinal as usize * envelope_size;
5397 #[allow(unused_variables)]
5398 let offset = encoder.out_of_line_offset(bytes_len);
5399 let mut _prev_end_offset: usize = 0;
5400 if 1 > max_ordinal {
5401 return Ok(());
5402 }
5403
5404 let cur_offset: usize = (1 - 1) * envelope_size;
5407
5408 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5410
5411 fidl::encoding::encode_in_envelope_optional::<
5416 ConfigStamp,
5417 fidl::encoding::DefaultFuchsiaResourceDialect,
5418 >(
5419 self.stamp.as_ref().map(<ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow),
5420 encoder,
5421 offset + cur_offset,
5422 depth,
5423 )?;
5424
5425 _prev_end_offset = cur_offset + envelope_size;
5426
5427 Ok(())
5428 }
5429 }
5430
5431 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5432 for CoordinatorCommitConfigRequest
5433 {
5434 #[inline(always)]
5435 fn new_empty() -> Self {
5436 Self::default()
5437 }
5438
5439 unsafe fn decode(
5440 &mut self,
5441 decoder: &mut fidl::encoding::Decoder<
5442 '_,
5443 fidl::encoding::DefaultFuchsiaResourceDialect,
5444 >,
5445 offset: usize,
5446 mut depth: fidl::encoding::Depth,
5447 ) -> fidl::Result<()> {
5448 decoder.debug_check_bounds::<Self>(offset);
5449 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5450 None => return Err(fidl::Error::NotNullable),
5451 Some(len) => len,
5452 };
5453 if len == 0 {
5455 return Ok(());
5456 };
5457 depth.increment()?;
5458 let envelope_size = 8;
5459 let bytes_len = len * envelope_size;
5460 let offset = decoder.out_of_line_offset(bytes_len)?;
5461 let mut _next_ordinal_to_read = 0;
5463 let mut next_offset = offset;
5464 let end_offset = offset + bytes_len;
5465 _next_ordinal_to_read += 1;
5466 if next_offset >= end_offset {
5467 return Ok(());
5468 }
5469
5470 while _next_ordinal_to_read < 1 {
5472 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5473 _next_ordinal_to_read += 1;
5474 next_offset += envelope_size;
5475 }
5476
5477 let next_out_of_line = decoder.next_out_of_line();
5478 let handles_before = decoder.remaining_handles();
5479 if let Some((inlined, num_bytes, num_handles)) =
5480 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5481 {
5482 let member_inline_size =
5483 <ConfigStamp as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5484 if inlined != (member_inline_size <= 4) {
5485 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5486 }
5487 let inner_offset;
5488 let mut inner_depth = depth.clone();
5489 if inlined {
5490 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5491 inner_offset = next_offset;
5492 } else {
5493 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5494 inner_depth.increment()?;
5495 }
5496 let val_ref = self.stamp.get_or_insert_with(|| {
5497 fidl::new_empty!(ConfigStamp, fidl::encoding::DefaultFuchsiaResourceDialect)
5498 });
5499 fidl::decode!(
5500 ConfigStamp,
5501 fidl::encoding::DefaultFuchsiaResourceDialect,
5502 val_ref,
5503 decoder,
5504 inner_offset,
5505 inner_depth
5506 )?;
5507 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5508 {
5509 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5510 }
5511 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5512 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5513 }
5514 }
5515
5516 next_offset += envelope_size;
5517
5518 while next_offset < end_offset {
5520 _next_ordinal_to_read += 1;
5521 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5522 next_offset += envelope_size;
5523 }
5524
5525 Ok(())
5526 }
5527 }
5528
5529 impl ProviderOpenCoordinatorRequest {
5530 #[inline(always)]
5531 fn max_ordinal_present(&self) -> u64 {
5532 if let Some(_) = self.priority {
5533 return 3;
5534 }
5535 if let Some(_) = self.coordinator_listener {
5536 return 2;
5537 }
5538 if let Some(_) = self.coordinator {
5539 return 1;
5540 }
5541 0
5542 }
5543 }
5544
5545 impl fidl::encoding::ResourceTypeMarker for ProviderOpenCoordinatorRequest {
5546 type Borrowed<'a> = &'a mut Self;
5547 fn take_or_borrow<'a>(
5548 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5549 ) -> Self::Borrowed<'a> {
5550 value
5551 }
5552 }
5553
5554 unsafe impl fidl::encoding::TypeMarker for ProviderOpenCoordinatorRequest {
5555 type Owned = Self;
5556
5557 #[inline(always)]
5558 fn inline_align(_context: fidl::encoding::Context) -> usize {
5559 8
5560 }
5561
5562 #[inline(always)]
5563 fn inline_size(_context: fidl::encoding::Context) -> usize {
5564 16
5565 }
5566 }
5567
5568 unsafe impl
5569 fidl::encoding::Encode<
5570 ProviderOpenCoordinatorRequest,
5571 fidl::encoding::DefaultFuchsiaResourceDialect,
5572 > for &mut ProviderOpenCoordinatorRequest
5573 {
5574 unsafe fn encode(
5575 self,
5576 encoder: &mut fidl::encoding::Encoder<
5577 '_,
5578 fidl::encoding::DefaultFuchsiaResourceDialect,
5579 >,
5580 offset: usize,
5581 mut depth: fidl::encoding::Depth,
5582 ) -> fidl::Result<()> {
5583 encoder.debug_check_bounds::<ProviderOpenCoordinatorRequest>(offset);
5584 let max_ordinal: u64 = self.max_ordinal_present();
5586 encoder.write_num(max_ordinal, offset);
5587 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5588 if max_ordinal == 0 {
5590 return Ok(());
5591 }
5592 depth.increment()?;
5593 let envelope_size = 8;
5594 let bytes_len = max_ordinal as usize * envelope_size;
5595 #[allow(unused_variables)]
5596 let offset = encoder.out_of_line_offset(bytes_len);
5597 let mut _prev_end_offset: usize = 0;
5598 if 1 > max_ordinal {
5599 return Ok(());
5600 }
5601
5602 let cur_offset: usize = (1 - 1) * envelope_size;
5605
5606 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5608
5609 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5614 self.coordinator.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5615 encoder, offset + cur_offset, depth
5616 )?;
5617
5618 _prev_end_offset = cur_offset + envelope_size;
5619 if 2 > max_ordinal {
5620 return Ok(());
5621 }
5622
5623 let cur_offset: usize = (2 - 1) * envelope_size;
5626
5627 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5629
5630 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5635 self.coordinator_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5636 encoder, offset + cur_offset, depth
5637 )?;
5638
5639 _prev_end_offset = cur_offset + envelope_size;
5640 if 3 > max_ordinal {
5641 return Ok(());
5642 }
5643
5644 let cur_offset: usize = (3 - 1) * envelope_size;
5647
5648 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5650
5651 fidl::encoding::encode_in_envelope_optional::<
5656 ClientPriority,
5657 fidl::encoding::DefaultFuchsiaResourceDialect,
5658 >(
5659 self.priority
5660 .as_ref()
5661 .map(<ClientPriority as fidl::encoding::ValueTypeMarker>::borrow),
5662 encoder,
5663 offset + cur_offset,
5664 depth,
5665 )?;
5666
5667 _prev_end_offset = cur_offset + envelope_size;
5668
5669 Ok(())
5670 }
5671 }
5672
5673 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5674 for ProviderOpenCoordinatorRequest
5675 {
5676 #[inline(always)]
5677 fn new_empty() -> Self {
5678 Self::default()
5679 }
5680
5681 unsafe fn decode(
5682 &mut self,
5683 decoder: &mut fidl::encoding::Decoder<
5684 '_,
5685 fidl::encoding::DefaultFuchsiaResourceDialect,
5686 >,
5687 offset: usize,
5688 mut depth: fidl::encoding::Depth,
5689 ) -> fidl::Result<()> {
5690 decoder.debug_check_bounds::<Self>(offset);
5691 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5692 None => return Err(fidl::Error::NotNullable),
5693 Some(len) => len,
5694 };
5695 if len == 0 {
5697 return Ok(());
5698 };
5699 depth.increment()?;
5700 let envelope_size = 8;
5701 let bytes_len = len * envelope_size;
5702 let offset = decoder.out_of_line_offset(bytes_len)?;
5703 let mut _next_ordinal_to_read = 0;
5705 let mut next_offset = offset;
5706 let end_offset = offset + bytes_len;
5707 _next_ordinal_to_read += 1;
5708 if next_offset >= end_offset {
5709 return Ok(());
5710 }
5711
5712 while _next_ordinal_to_read < 1 {
5714 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5715 _next_ordinal_to_read += 1;
5716 next_offset += envelope_size;
5717 }
5718
5719 let next_out_of_line = decoder.next_out_of_line();
5720 let handles_before = decoder.remaining_handles();
5721 if let Some((inlined, num_bytes, num_handles)) =
5722 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5723 {
5724 let member_inline_size = <fidl::encoding::Endpoint<
5725 fidl::endpoints::ServerEnd<CoordinatorMarker>,
5726 > as fidl::encoding::TypeMarker>::inline_size(
5727 decoder.context
5728 );
5729 if inlined != (member_inline_size <= 4) {
5730 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5731 }
5732 let inner_offset;
5733 let mut inner_depth = depth.clone();
5734 if inlined {
5735 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5736 inner_offset = next_offset;
5737 } else {
5738 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5739 inner_depth.increment()?;
5740 }
5741 let val_ref = self.coordinator.get_or_insert_with(|| {
5742 fidl::new_empty!(
5743 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
5744 fidl::encoding::DefaultFuchsiaResourceDialect
5745 )
5746 });
5747 fidl::decode!(
5748 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CoordinatorMarker>>,
5749 fidl::encoding::DefaultFuchsiaResourceDialect,
5750 val_ref,
5751 decoder,
5752 inner_offset,
5753 inner_depth
5754 )?;
5755 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5756 {
5757 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5758 }
5759 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5760 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5761 }
5762 }
5763
5764 next_offset += envelope_size;
5765 _next_ordinal_to_read += 1;
5766 if next_offset >= end_offset {
5767 return Ok(());
5768 }
5769
5770 while _next_ordinal_to_read < 2 {
5772 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5773 _next_ordinal_to_read += 1;
5774 next_offset += envelope_size;
5775 }
5776
5777 let next_out_of_line = decoder.next_out_of_line();
5778 let handles_before = decoder.remaining_handles();
5779 if let Some((inlined, num_bytes, num_handles)) =
5780 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5781 {
5782 let member_inline_size = <fidl::encoding::Endpoint<
5783 fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
5784 > as fidl::encoding::TypeMarker>::inline_size(
5785 decoder.context
5786 );
5787 if inlined != (member_inline_size <= 4) {
5788 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5789 }
5790 let inner_offset;
5791 let mut inner_depth = depth.clone();
5792 if inlined {
5793 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5794 inner_offset = next_offset;
5795 } else {
5796 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5797 inner_depth.increment()?;
5798 }
5799 let val_ref = self.coordinator_listener.get_or_insert_with(|| {
5800 fidl::new_empty!(
5801 fidl::encoding::Endpoint<
5802 fidl::endpoints::ClientEnd<CoordinatorListenerMarker>,
5803 >,
5804 fidl::encoding::DefaultFuchsiaResourceDialect
5805 )
5806 });
5807 fidl::decode!(
5808 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<CoordinatorListenerMarker>>,
5809 fidl::encoding::DefaultFuchsiaResourceDialect,
5810 val_ref,
5811 decoder,
5812 inner_offset,
5813 inner_depth
5814 )?;
5815 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5816 {
5817 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5818 }
5819 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5820 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5821 }
5822 }
5823
5824 next_offset += envelope_size;
5825 _next_ordinal_to_read += 1;
5826 if next_offset >= end_offset {
5827 return Ok(());
5828 }
5829
5830 while _next_ordinal_to_read < 3 {
5832 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5833 _next_ordinal_to_read += 1;
5834 next_offset += envelope_size;
5835 }
5836
5837 let next_out_of_line = decoder.next_out_of_line();
5838 let handles_before = decoder.remaining_handles();
5839 if let Some((inlined, num_bytes, num_handles)) =
5840 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5841 {
5842 let member_inline_size =
5843 <ClientPriority as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5844 if inlined != (member_inline_size <= 4) {
5845 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5846 }
5847 let inner_offset;
5848 let mut inner_depth = depth.clone();
5849 if inlined {
5850 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5851 inner_offset = next_offset;
5852 } else {
5853 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5854 inner_depth.increment()?;
5855 }
5856 let val_ref = self.priority.get_or_insert_with(|| {
5857 fidl::new_empty!(ClientPriority, fidl::encoding::DefaultFuchsiaResourceDialect)
5858 });
5859 fidl::decode!(
5860 ClientPriority,
5861 fidl::encoding::DefaultFuchsiaResourceDialect,
5862 val_ref,
5863 decoder,
5864 inner_offset,
5865 inner_depth
5866 )?;
5867 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5868 {
5869 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5870 }
5871 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5872 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5873 }
5874 }
5875
5876 next_offset += envelope_size;
5877
5878 while next_offset < end_offset {
5880 _next_ordinal_to_read += 1;
5881 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5882 next_offset += envelope_size;
5883 }
5884
5885 Ok(())
5886 }
5887 }
5888}