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_light__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct LightMarker;
16
17impl fidl::endpoints::ProtocolMarker for LightMarker {
18 type Proxy = LightProxy;
19 type RequestStream = LightRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = LightSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "fuchsia.hardware.light.Light";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for LightMarker {}
26pub type LightGetInfoResult = Result<Info, LightError>;
27pub type LightGetCurrentSimpleValueResult = Result<bool, LightError>;
28pub type LightSetSimpleValueResult = Result<(), LightError>;
29pub type LightGetCurrentBrightnessValueResult = Result<f64, LightError>;
30pub type LightSetBrightnessValueResult = Result<(), LightError>;
31pub type LightGetCurrentRgbValueResult = Result<Rgb, LightError>;
32pub type LightSetRgbValueResult = Result<(), LightError>;
33pub type LightGetGroupInfoResult = Result<GroupInfo, LightError>;
34pub type LightGetGroupCurrentSimpleValueResult = Result<Option<Vec<bool>>, LightError>;
35pub type LightSetGroupSimpleValueResult = Result<(), LightError>;
36pub type LightGetGroupCurrentBrightnessValueResult = Result<Option<Vec<f64>>, LightError>;
37pub type LightSetGroupBrightnessValueResult = Result<(), LightError>;
38pub type LightGetGroupCurrentRgbValueResult = Result<Option<Vec<Rgb>>, LightError>;
39pub type LightSetGroupRgbValueResult = Result<(), LightError>;
40
41pub trait LightProxyInterface: Send + Sync {
42 type GetNumLightsResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
43 fn r#get_num_lights(&self) -> Self::GetNumLightsResponseFut;
44 type GetNumLightGroupsResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
45 fn r#get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut;
46 type GetInfoResponseFut: std::future::Future<Output = Result<LightGetInfoResult, fidl::Error>>
47 + Send;
48 fn r#get_info(&self, index: u32) -> Self::GetInfoResponseFut;
49 type GetCurrentSimpleValueResponseFut: std::future::Future<Output = Result<LightGetCurrentSimpleValueResult, fidl::Error>>
50 + Send;
51 fn r#get_current_simple_value(&self, index: u32) -> Self::GetCurrentSimpleValueResponseFut;
52 type SetSimpleValueResponseFut: std::future::Future<Output = Result<LightSetSimpleValueResult, fidl::Error>>
53 + Send;
54 fn r#set_simple_value(&self, index: u32, value: bool) -> Self::SetSimpleValueResponseFut;
55 type GetCurrentBrightnessValueResponseFut: std::future::Future<Output = Result<LightGetCurrentBrightnessValueResult, fidl::Error>>
56 + Send;
57 fn r#get_current_brightness_value(
58 &self,
59 index: u32,
60 ) -> Self::GetCurrentBrightnessValueResponseFut;
61 type SetBrightnessValueResponseFut: std::future::Future<Output = Result<LightSetBrightnessValueResult, fidl::Error>>
62 + Send;
63 fn r#set_brightness_value(&self, index: u32, value: f64)
64 -> Self::SetBrightnessValueResponseFut;
65 type GetCurrentRgbValueResponseFut: std::future::Future<Output = Result<LightGetCurrentRgbValueResult, fidl::Error>>
66 + Send;
67 fn r#get_current_rgb_value(&self, index: u32) -> Self::GetCurrentRgbValueResponseFut;
68 type SetRgbValueResponseFut: std::future::Future<Output = Result<LightSetRgbValueResult, fidl::Error>>
69 + Send;
70 fn r#set_rgb_value(&self, index: u32, value: &Rgb) -> Self::SetRgbValueResponseFut;
71 type GetGroupInfoResponseFut: std::future::Future<Output = Result<LightGetGroupInfoResult, fidl::Error>>
72 + Send;
73 fn r#get_group_info(&self, group_id: u32) -> Self::GetGroupInfoResponseFut;
74 type GetGroupCurrentSimpleValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentSimpleValueResult, fidl::Error>>
75 + Send;
76 fn r#get_group_current_simple_value(
77 &self,
78 group_id: u32,
79 ) -> Self::GetGroupCurrentSimpleValueResponseFut;
80 type SetGroupSimpleValueResponseFut: std::future::Future<Output = Result<LightSetGroupSimpleValueResult, fidl::Error>>
81 + Send;
82 fn r#set_group_simple_value(
83 &self,
84 group_id: u32,
85 values: &[bool],
86 ) -> Self::SetGroupSimpleValueResponseFut;
87 type GetGroupCurrentBrightnessValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error>>
88 + Send;
89 fn r#get_group_current_brightness_value(
90 &self,
91 group_id: u32,
92 ) -> Self::GetGroupCurrentBrightnessValueResponseFut;
93 type SetGroupBrightnessValueResponseFut: std::future::Future<Output = Result<LightSetGroupBrightnessValueResult, fidl::Error>>
94 + Send;
95 fn r#set_group_brightness_value(
96 &self,
97 group_id: u32,
98 values: &[f64],
99 ) -> Self::SetGroupBrightnessValueResponseFut;
100 type GetGroupCurrentRgbValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentRgbValueResult, fidl::Error>>
101 + Send;
102 fn r#get_group_current_rgb_value(
103 &self,
104 group_id: u32,
105 ) -> Self::GetGroupCurrentRgbValueResponseFut;
106 type SetGroupRgbValueResponseFut: std::future::Future<Output = Result<LightSetGroupRgbValueResult, fidl::Error>>
107 + Send;
108 fn r#set_group_rgb_value(
109 &self,
110 group_id: u32,
111 values: &[Rgb],
112 ) -> Self::SetGroupRgbValueResponseFut;
113}
114#[derive(Debug)]
115#[cfg(target_os = "fuchsia")]
116pub struct LightSynchronousProxy {
117 client: fidl::client::sync::Client,
118}
119
120#[cfg(target_os = "fuchsia")]
121impl fidl::endpoints::SynchronousProxy for LightSynchronousProxy {
122 type Proxy = LightProxy;
123 type Protocol = LightMarker;
124
125 fn from_channel(inner: fidl::Channel) -> Self {
126 Self::new(inner)
127 }
128
129 fn into_channel(self) -> fidl::Channel {
130 self.client.into_channel()
131 }
132
133 fn as_channel(&self) -> &fidl::Channel {
134 self.client.as_channel()
135 }
136}
137
138#[cfg(target_os = "fuchsia")]
139impl LightSynchronousProxy {
140 pub fn new(channel: fidl::Channel) -> Self {
141 let protocol_name = <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
142 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
143 }
144
145 pub fn into_channel(self) -> fidl::Channel {
146 self.client.into_channel()
147 }
148
149 pub fn wait_for_event(
152 &self,
153 deadline: zx::MonotonicInstant,
154 ) -> Result<LightEvent, fidl::Error> {
155 LightEvent::decode(self.client.wait_for_event(deadline)?)
156 }
157
158 pub fn r#get_num_lights(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
163 let _response =
164 self.client.send_query::<fidl::encoding::EmptyPayload, LightGetNumLightsResponse>(
165 (),
166 0x7ae2bd2ef8062dbb,
167 fidl::encoding::DynamicFlags::empty(),
168 ___deadline,
169 )?;
170 Ok(_response.count)
171 }
172
173 pub fn r#get_num_light_groups(
176 &self,
177 ___deadline: zx::MonotonicInstant,
178 ) -> Result<u32, fidl::Error> {
179 let _response = self
180 .client
181 .send_query::<fidl::encoding::EmptyPayload, LightGetNumLightGroupsResponse>(
182 (),
183 0x600895db5a7cbf0,
184 fidl::encoding::DynamicFlags::empty(),
185 ___deadline,
186 )?;
187 Ok(_response.count)
188 }
189
190 pub fn r#get_info(
193 &self,
194 mut index: u32,
195 ___deadline: zx::MonotonicInstant,
196 ) -> Result<LightGetInfoResult, fidl::Error> {
197 let _response = self.client.send_query::<
198 LightGetInfoRequest,
199 fidl::encoding::ResultType<LightGetInfoResponse, LightError>,
200 >(
201 (index,),
202 0x4229b55c8c4bd529,
203 fidl::encoding::DynamicFlags::empty(),
204 ___deadline,
205 )?;
206 Ok(_response.map(|x| x.info))
207 }
208
209 pub fn r#get_current_simple_value(
215 &self,
216 mut index: u32,
217 ___deadline: zx::MonotonicInstant,
218 ) -> Result<LightGetCurrentSimpleValueResult, fidl::Error> {
219 let _response = self.client.send_query::<
220 LightGetCurrentSimpleValueRequest,
221 fidl::encoding::ResultType<LightGetCurrentSimpleValueResponse, LightError>,
222 >(
223 (index,),
224 0x183154896336c321,
225 fidl::encoding::DynamicFlags::empty(),
226 ___deadline,
227 )?;
228 Ok(_response.map(|x| x.value))
229 }
230
231 pub fn r#set_simple_value(
237 &self,
238 mut index: u32,
239 mut value: bool,
240 ___deadline: zx::MonotonicInstant,
241 ) -> Result<LightSetSimpleValueResult, fidl::Error> {
242 let _response = self.client.send_query::<
243 LightSetSimpleValueRequest,
244 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
245 >(
246 (index, value,),
247 0x4fb33d84c1aad81d,
248 fidl::encoding::DynamicFlags::empty(),
249 ___deadline,
250 )?;
251 Ok(_response.map(|x| x))
252 }
253
254 pub fn r#get_current_brightness_value(
260 &self,
261 mut index: u32,
262 ___deadline: zx::MonotonicInstant,
263 ) -> Result<LightGetCurrentBrightnessValueResult, fidl::Error> {
264 let _response = self.client.send_query::<
265 LightGetCurrentBrightnessValueRequest,
266 fidl::encoding::ResultType<LightGetCurrentBrightnessValueResponse, LightError>,
267 >(
268 (index,),
269 0x2d387e129fe84809,
270 fidl::encoding::DynamicFlags::empty(),
271 ___deadline,
272 )?;
273 Ok(_response.map(|x| x.value))
274 }
275
276 pub fn r#set_brightness_value(
282 &self,
283 mut index: u32,
284 mut value: f64,
285 ___deadline: zx::MonotonicInstant,
286 ) -> Result<LightSetBrightnessValueResult, fidl::Error> {
287 let _response = self.client.send_query::<
288 LightSetBrightnessValueRequest,
289 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
290 >(
291 (index, value,),
292 0x17cada93c7c48661,
293 fidl::encoding::DynamicFlags::empty(),
294 ___deadline,
295 )?;
296 Ok(_response.map(|x| x))
297 }
298
299 pub fn r#get_current_rgb_value(
304 &self,
305 mut index: u32,
306 ___deadline: zx::MonotonicInstant,
307 ) -> Result<LightGetCurrentRgbValueResult, fidl::Error> {
308 let _response = self.client.send_query::<
309 LightGetCurrentRgbValueRequest,
310 fidl::encoding::ResultType<LightGetCurrentRgbValueResponse, LightError>,
311 >(
312 (index,),
313 0x49965ac0d920f4ad,
314 fidl::encoding::DynamicFlags::empty(),
315 ___deadline,
316 )?;
317 Ok(_response.map(|x| x.value))
318 }
319
320 pub fn r#set_rgb_value(
325 &self,
326 mut index: u32,
327 mut value: &Rgb,
328 ___deadline: zx::MonotonicInstant,
329 ) -> Result<LightSetRgbValueResult, fidl::Error> {
330 let _response = self.client.send_query::<
331 LightSetRgbValueRequest,
332 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
333 >(
334 (index, value,),
335 0x2b354d18be0b70a4,
336 fidl::encoding::DynamicFlags::empty(),
337 ___deadline,
338 )?;
339 Ok(_response.map(|x| x))
340 }
341
342 pub fn r#get_group_info(
345 &self,
346 mut group_id: u32,
347 ___deadline: zx::MonotonicInstant,
348 ) -> Result<LightGetGroupInfoResult, fidl::Error> {
349 let _response = self.client.send_query::<
350 LightGetGroupInfoRequest,
351 fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>,
352 >(
353 (group_id,),
354 0x5b27b0ca755b470b,
355 fidl::encoding::DynamicFlags::empty(),
356 ___deadline,
357 )?;
358 Ok(_response.map(|x| x.info))
359 }
360
361 pub fn r#get_group_current_simple_value(
368 &self,
369 mut group_id: u32,
370 ___deadline: zx::MonotonicInstant,
371 ) -> Result<LightGetGroupCurrentSimpleValueResult, fidl::Error> {
372 let _response = self.client.send_query::<
373 LightGetGroupCurrentSimpleValueRequest,
374 fidl::encoding::ResultType<LightGetGroupCurrentSimpleValueResponse, LightError>,
375 >(
376 (group_id,),
377 0x659d9bdb5cc2201,
378 fidl::encoding::DynamicFlags::empty(),
379 ___deadline,
380 )?;
381 Ok(_response.map(|x| x.values))
382 }
383
384 pub fn r#set_group_simple_value(
391 &self,
392 mut group_id: u32,
393 mut values: &[bool],
394 ___deadline: zx::MonotonicInstant,
395 ) -> Result<LightSetGroupSimpleValueResult, fidl::Error> {
396 let _response = self.client.send_query::<
397 LightSetGroupSimpleValueRequest,
398 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
399 >(
400 (group_id, values,),
401 0x924234e74cc6dd8,
402 fidl::encoding::DynamicFlags::empty(),
403 ___deadline,
404 )?;
405 Ok(_response.map(|x| x))
406 }
407
408 pub fn r#get_group_current_brightness_value(
415 &self,
416 mut group_id: u32,
417 ___deadline: zx::MonotonicInstant,
418 ) -> Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error> {
419 let _response = self.client.send_query::<
420 LightGetGroupCurrentBrightnessValueRequest,
421 fidl::encoding::ResultType<LightGetGroupCurrentBrightnessValueResponse, LightError>,
422 >(
423 (group_id,),
424 0x3ab226120b0d0362,
425 fidl::encoding::DynamicFlags::empty(),
426 ___deadline,
427 )?;
428 Ok(_response.map(|x| x.values))
429 }
430
431 pub fn r#set_group_brightness_value(
438 &self,
439 mut group_id: u32,
440 mut values: &[f64],
441 ___deadline: zx::MonotonicInstant,
442 ) -> Result<LightSetGroupBrightnessValueResult, fidl::Error> {
443 let _response = self.client.send_query::<
444 LightSetGroupBrightnessValueRequest,
445 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
446 >(
447 (group_id, values,),
448 0x79e5f248fc5ec7ae,
449 fidl::encoding::DynamicFlags::empty(),
450 ___deadline,
451 )?;
452 Ok(_response.map(|x| x))
453 }
454
455 pub fn r#get_group_current_rgb_value(
461 &self,
462 mut group_id: u32,
463 ___deadline: zx::MonotonicInstant,
464 ) -> Result<LightGetGroupCurrentRgbValueResult, fidl::Error> {
465 let _response = self.client.send_query::<
466 LightGetGroupCurrentRgbValueRequest,
467 fidl::encoding::ResultType<LightGetGroupCurrentRgbValueResponse, LightError>,
468 >(
469 (group_id,),
470 0x2a6014b41254f617,
471 fidl::encoding::DynamicFlags::empty(),
472 ___deadline,
473 )?;
474 Ok(_response.map(|x| x.values))
475 }
476
477 pub fn r#set_group_rgb_value(
483 &self,
484 mut group_id: u32,
485 mut values: &[Rgb],
486 ___deadline: zx::MonotonicInstant,
487 ) -> Result<LightSetGroupRgbValueResult, fidl::Error> {
488 let _response = self.client.send_query::<
489 LightSetGroupRgbValueRequest,
490 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
491 >(
492 (group_id, values,),
493 0x33c92316f251e4e4,
494 fidl::encoding::DynamicFlags::empty(),
495 ___deadline,
496 )?;
497 Ok(_response.map(|x| x))
498 }
499}
500
501#[cfg(target_os = "fuchsia")]
502impl From<LightSynchronousProxy> for zx::Handle {
503 fn from(value: LightSynchronousProxy) -> Self {
504 value.into_channel().into()
505 }
506}
507
508#[cfg(target_os = "fuchsia")]
509impl From<fidl::Channel> for LightSynchronousProxy {
510 fn from(value: fidl::Channel) -> Self {
511 Self::new(value)
512 }
513}
514
515#[cfg(target_os = "fuchsia")]
516impl fidl::endpoints::FromClient for LightSynchronousProxy {
517 type Protocol = LightMarker;
518
519 fn from_client(value: fidl::endpoints::ClientEnd<LightMarker>) -> Self {
520 Self::new(value.into_channel())
521 }
522}
523
524#[derive(Debug, Clone)]
525pub struct LightProxy {
526 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
527}
528
529impl fidl::endpoints::Proxy for LightProxy {
530 type Protocol = LightMarker;
531
532 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
533 Self::new(inner)
534 }
535
536 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
537 self.client.into_channel().map_err(|client| Self { client })
538 }
539
540 fn as_channel(&self) -> &::fidl::AsyncChannel {
541 self.client.as_channel()
542 }
543}
544
545impl LightProxy {
546 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
548 let protocol_name = <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
549 Self { client: fidl::client::Client::new(channel, protocol_name) }
550 }
551
552 pub fn take_event_stream(&self) -> LightEventStream {
558 LightEventStream { event_receiver: self.client.take_event_receiver() }
559 }
560
561 pub fn r#get_num_lights(
566 &self,
567 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
568 LightProxyInterface::r#get_num_lights(self)
569 }
570
571 pub fn r#get_num_light_groups(
574 &self,
575 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
576 LightProxyInterface::r#get_num_light_groups(self)
577 }
578
579 pub fn r#get_info(
582 &self,
583 mut index: u32,
584 ) -> fidl::client::QueryResponseFut<
585 LightGetInfoResult,
586 fidl::encoding::DefaultFuchsiaResourceDialect,
587 > {
588 LightProxyInterface::r#get_info(self, index)
589 }
590
591 pub fn r#get_current_simple_value(
597 &self,
598 mut index: u32,
599 ) -> fidl::client::QueryResponseFut<
600 LightGetCurrentSimpleValueResult,
601 fidl::encoding::DefaultFuchsiaResourceDialect,
602 > {
603 LightProxyInterface::r#get_current_simple_value(self, index)
604 }
605
606 pub fn r#set_simple_value(
612 &self,
613 mut index: u32,
614 mut value: bool,
615 ) -> fidl::client::QueryResponseFut<
616 LightSetSimpleValueResult,
617 fidl::encoding::DefaultFuchsiaResourceDialect,
618 > {
619 LightProxyInterface::r#set_simple_value(self, index, value)
620 }
621
622 pub fn r#get_current_brightness_value(
628 &self,
629 mut index: u32,
630 ) -> fidl::client::QueryResponseFut<
631 LightGetCurrentBrightnessValueResult,
632 fidl::encoding::DefaultFuchsiaResourceDialect,
633 > {
634 LightProxyInterface::r#get_current_brightness_value(self, index)
635 }
636
637 pub fn r#set_brightness_value(
643 &self,
644 mut index: u32,
645 mut value: f64,
646 ) -> fidl::client::QueryResponseFut<
647 LightSetBrightnessValueResult,
648 fidl::encoding::DefaultFuchsiaResourceDialect,
649 > {
650 LightProxyInterface::r#set_brightness_value(self, index, value)
651 }
652
653 pub fn r#get_current_rgb_value(
658 &self,
659 mut index: u32,
660 ) -> fidl::client::QueryResponseFut<
661 LightGetCurrentRgbValueResult,
662 fidl::encoding::DefaultFuchsiaResourceDialect,
663 > {
664 LightProxyInterface::r#get_current_rgb_value(self, index)
665 }
666
667 pub fn r#set_rgb_value(
672 &self,
673 mut index: u32,
674 mut value: &Rgb,
675 ) -> fidl::client::QueryResponseFut<
676 LightSetRgbValueResult,
677 fidl::encoding::DefaultFuchsiaResourceDialect,
678 > {
679 LightProxyInterface::r#set_rgb_value(self, index, value)
680 }
681
682 pub fn r#get_group_info(
685 &self,
686 mut group_id: u32,
687 ) -> fidl::client::QueryResponseFut<
688 LightGetGroupInfoResult,
689 fidl::encoding::DefaultFuchsiaResourceDialect,
690 > {
691 LightProxyInterface::r#get_group_info(self, group_id)
692 }
693
694 pub fn r#get_group_current_simple_value(
701 &self,
702 mut group_id: u32,
703 ) -> fidl::client::QueryResponseFut<
704 LightGetGroupCurrentSimpleValueResult,
705 fidl::encoding::DefaultFuchsiaResourceDialect,
706 > {
707 LightProxyInterface::r#get_group_current_simple_value(self, group_id)
708 }
709
710 pub fn r#set_group_simple_value(
717 &self,
718 mut group_id: u32,
719 mut values: &[bool],
720 ) -> fidl::client::QueryResponseFut<
721 LightSetGroupSimpleValueResult,
722 fidl::encoding::DefaultFuchsiaResourceDialect,
723 > {
724 LightProxyInterface::r#set_group_simple_value(self, group_id, values)
725 }
726
727 pub fn r#get_group_current_brightness_value(
734 &self,
735 mut group_id: u32,
736 ) -> fidl::client::QueryResponseFut<
737 LightGetGroupCurrentBrightnessValueResult,
738 fidl::encoding::DefaultFuchsiaResourceDialect,
739 > {
740 LightProxyInterface::r#get_group_current_brightness_value(self, group_id)
741 }
742
743 pub fn r#set_group_brightness_value(
750 &self,
751 mut group_id: u32,
752 mut values: &[f64],
753 ) -> fidl::client::QueryResponseFut<
754 LightSetGroupBrightnessValueResult,
755 fidl::encoding::DefaultFuchsiaResourceDialect,
756 > {
757 LightProxyInterface::r#set_group_brightness_value(self, group_id, values)
758 }
759
760 pub fn r#get_group_current_rgb_value(
766 &self,
767 mut group_id: u32,
768 ) -> fidl::client::QueryResponseFut<
769 LightGetGroupCurrentRgbValueResult,
770 fidl::encoding::DefaultFuchsiaResourceDialect,
771 > {
772 LightProxyInterface::r#get_group_current_rgb_value(self, group_id)
773 }
774
775 pub fn r#set_group_rgb_value(
781 &self,
782 mut group_id: u32,
783 mut values: &[Rgb],
784 ) -> fidl::client::QueryResponseFut<
785 LightSetGroupRgbValueResult,
786 fidl::encoding::DefaultFuchsiaResourceDialect,
787 > {
788 LightProxyInterface::r#set_group_rgb_value(self, group_id, values)
789 }
790}
791
792impl LightProxyInterface for LightProxy {
793 type GetNumLightsResponseFut =
794 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
795 fn r#get_num_lights(&self) -> Self::GetNumLightsResponseFut {
796 fn _decode(
797 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
798 ) -> Result<u32, fidl::Error> {
799 let _response = fidl::client::decode_transaction_body::<
800 LightGetNumLightsResponse,
801 fidl::encoding::DefaultFuchsiaResourceDialect,
802 0x7ae2bd2ef8062dbb,
803 >(_buf?)?;
804 Ok(_response.count)
805 }
806 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
807 (),
808 0x7ae2bd2ef8062dbb,
809 fidl::encoding::DynamicFlags::empty(),
810 _decode,
811 )
812 }
813
814 type GetNumLightGroupsResponseFut =
815 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
816 fn r#get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut {
817 fn _decode(
818 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
819 ) -> Result<u32, fidl::Error> {
820 let _response = fidl::client::decode_transaction_body::<
821 LightGetNumLightGroupsResponse,
822 fidl::encoding::DefaultFuchsiaResourceDialect,
823 0x600895db5a7cbf0,
824 >(_buf?)?;
825 Ok(_response.count)
826 }
827 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
828 (),
829 0x600895db5a7cbf0,
830 fidl::encoding::DynamicFlags::empty(),
831 _decode,
832 )
833 }
834
835 type GetInfoResponseFut = fidl::client::QueryResponseFut<
836 LightGetInfoResult,
837 fidl::encoding::DefaultFuchsiaResourceDialect,
838 >;
839 fn r#get_info(&self, mut index: u32) -> Self::GetInfoResponseFut {
840 fn _decode(
841 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
842 ) -> Result<LightGetInfoResult, fidl::Error> {
843 let _response = fidl::client::decode_transaction_body::<
844 fidl::encoding::ResultType<LightGetInfoResponse, LightError>,
845 fidl::encoding::DefaultFuchsiaResourceDialect,
846 0x4229b55c8c4bd529,
847 >(_buf?)?;
848 Ok(_response.map(|x| x.info))
849 }
850 self.client.send_query_and_decode::<LightGetInfoRequest, LightGetInfoResult>(
851 (index,),
852 0x4229b55c8c4bd529,
853 fidl::encoding::DynamicFlags::empty(),
854 _decode,
855 )
856 }
857
858 type GetCurrentSimpleValueResponseFut = fidl::client::QueryResponseFut<
859 LightGetCurrentSimpleValueResult,
860 fidl::encoding::DefaultFuchsiaResourceDialect,
861 >;
862 fn r#get_current_simple_value(&self, mut index: u32) -> Self::GetCurrentSimpleValueResponseFut {
863 fn _decode(
864 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
865 ) -> Result<LightGetCurrentSimpleValueResult, fidl::Error> {
866 let _response = fidl::client::decode_transaction_body::<
867 fidl::encoding::ResultType<LightGetCurrentSimpleValueResponse, LightError>,
868 fidl::encoding::DefaultFuchsiaResourceDialect,
869 0x183154896336c321,
870 >(_buf?)?;
871 Ok(_response.map(|x| x.value))
872 }
873 self.client.send_query_and_decode::<
874 LightGetCurrentSimpleValueRequest,
875 LightGetCurrentSimpleValueResult,
876 >(
877 (index,),
878 0x183154896336c321,
879 fidl::encoding::DynamicFlags::empty(),
880 _decode,
881 )
882 }
883
884 type SetSimpleValueResponseFut = fidl::client::QueryResponseFut<
885 LightSetSimpleValueResult,
886 fidl::encoding::DefaultFuchsiaResourceDialect,
887 >;
888 fn r#set_simple_value(
889 &self,
890 mut index: u32,
891 mut value: bool,
892 ) -> Self::SetSimpleValueResponseFut {
893 fn _decode(
894 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
895 ) -> Result<LightSetSimpleValueResult, fidl::Error> {
896 let _response = fidl::client::decode_transaction_body::<
897 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
898 fidl::encoding::DefaultFuchsiaResourceDialect,
899 0x4fb33d84c1aad81d,
900 >(_buf?)?;
901 Ok(_response.map(|x| x))
902 }
903 self.client.send_query_and_decode::<LightSetSimpleValueRequest, LightSetSimpleValueResult>(
904 (index, value),
905 0x4fb33d84c1aad81d,
906 fidl::encoding::DynamicFlags::empty(),
907 _decode,
908 )
909 }
910
911 type GetCurrentBrightnessValueResponseFut = fidl::client::QueryResponseFut<
912 LightGetCurrentBrightnessValueResult,
913 fidl::encoding::DefaultFuchsiaResourceDialect,
914 >;
915 fn r#get_current_brightness_value(
916 &self,
917 mut index: u32,
918 ) -> Self::GetCurrentBrightnessValueResponseFut {
919 fn _decode(
920 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
921 ) -> Result<LightGetCurrentBrightnessValueResult, fidl::Error> {
922 let _response = fidl::client::decode_transaction_body::<
923 fidl::encoding::ResultType<LightGetCurrentBrightnessValueResponse, LightError>,
924 fidl::encoding::DefaultFuchsiaResourceDialect,
925 0x2d387e129fe84809,
926 >(_buf?)?;
927 Ok(_response.map(|x| x.value))
928 }
929 self.client.send_query_and_decode::<
930 LightGetCurrentBrightnessValueRequest,
931 LightGetCurrentBrightnessValueResult,
932 >(
933 (index,),
934 0x2d387e129fe84809,
935 fidl::encoding::DynamicFlags::empty(),
936 _decode,
937 )
938 }
939
940 type SetBrightnessValueResponseFut = fidl::client::QueryResponseFut<
941 LightSetBrightnessValueResult,
942 fidl::encoding::DefaultFuchsiaResourceDialect,
943 >;
944 fn r#set_brightness_value(
945 &self,
946 mut index: u32,
947 mut value: f64,
948 ) -> Self::SetBrightnessValueResponseFut {
949 fn _decode(
950 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
951 ) -> Result<LightSetBrightnessValueResult, fidl::Error> {
952 let _response = fidl::client::decode_transaction_body::<
953 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
954 fidl::encoding::DefaultFuchsiaResourceDialect,
955 0x17cada93c7c48661,
956 >(_buf?)?;
957 Ok(_response.map(|x| x))
958 }
959 self.client
960 .send_query_and_decode::<LightSetBrightnessValueRequest, LightSetBrightnessValueResult>(
961 (index, value),
962 0x17cada93c7c48661,
963 fidl::encoding::DynamicFlags::empty(),
964 _decode,
965 )
966 }
967
968 type GetCurrentRgbValueResponseFut = fidl::client::QueryResponseFut<
969 LightGetCurrentRgbValueResult,
970 fidl::encoding::DefaultFuchsiaResourceDialect,
971 >;
972 fn r#get_current_rgb_value(&self, mut index: u32) -> Self::GetCurrentRgbValueResponseFut {
973 fn _decode(
974 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
975 ) -> Result<LightGetCurrentRgbValueResult, fidl::Error> {
976 let _response = fidl::client::decode_transaction_body::<
977 fidl::encoding::ResultType<LightGetCurrentRgbValueResponse, LightError>,
978 fidl::encoding::DefaultFuchsiaResourceDialect,
979 0x49965ac0d920f4ad,
980 >(_buf?)?;
981 Ok(_response.map(|x| x.value))
982 }
983 self.client
984 .send_query_and_decode::<LightGetCurrentRgbValueRequest, LightGetCurrentRgbValueResult>(
985 (index,),
986 0x49965ac0d920f4ad,
987 fidl::encoding::DynamicFlags::empty(),
988 _decode,
989 )
990 }
991
992 type SetRgbValueResponseFut = fidl::client::QueryResponseFut<
993 LightSetRgbValueResult,
994 fidl::encoding::DefaultFuchsiaResourceDialect,
995 >;
996 fn r#set_rgb_value(&self, mut index: u32, mut value: &Rgb) -> Self::SetRgbValueResponseFut {
997 fn _decode(
998 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
999 ) -> Result<LightSetRgbValueResult, fidl::Error> {
1000 let _response = fidl::client::decode_transaction_body::<
1001 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1002 fidl::encoding::DefaultFuchsiaResourceDialect,
1003 0x2b354d18be0b70a4,
1004 >(_buf?)?;
1005 Ok(_response.map(|x| x))
1006 }
1007 self.client.send_query_and_decode::<LightSetRgbValueRequest, LightSetRgbValueResult>(
1008 (index, value),
1009 0x2b354d18be0b70a4,
1010 fidl::encoding::DynamicFlags::empty(),
1011 _decode,
1012 )
1013 }
1014
1015 type GetGroupInfoResponseFut = fidl::client::QueryResponseFut<
1016 LightGetGroupInfoResult,
1017 fidl::encoding::DefaultFuchsiaResourceDialect,
1018 >;
1019 fn r#get_group_info(&self, mut group_id: u32) -> Self::GetGroupInfoResponseFut {
1020 fn _decode(
1021 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1022 ) -> Result<LightGetGroupInfoResult, fidl::Error> {
1023 let _response = fidl::client::decode_transaction_body::<
1024 fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>,
1025 fidl::encoding::DefaultFuchsiaResourceDialect,
1026 0x5b27b0ca755b470b,
1027 >(_buf?)?;
1028 Ok(_response.map(|x| x.info))
1029 }
1030 self.client.send_query_and_decode::<LightGetGroupInfoRequest, LightGetGroupInfoResult>(
1031 (group_id,),
1032 0x5b27b0ca755b470b,
1033 fidl::encoding::DynamicFlags::empty(),
1034 _decode,
1035 )
1036 }
1037
1038 type GetGroupCurrentSimpleValueResponseFut = fidl::client::QueryResponseFut<
1039 LightGetGroupCurrentSimpleValueResult,
1040 fidl::encoding::DefaultFuchsiaResourceDialect,
1041 >;
1042 fn r#get_group_current_simple_value(
1043 &self,
1044 mut group_id: u32,
1045 ) -> Self::GetGroupCurrentSimpleValueResponseFut {
1046 fn _decode(
1047 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1048 ) -> Result<LightGetGroupCurrentSimpleValueResult, fidl::Error> {
1049 let _response = fidl::client::decode_transaction_body::<
1050 fidl::encoding::ResultType<LightGetGroupCurrentSimpleValueResponse, LightError>,
1051 fidl::encoding::DefaultFuchsiaResourceDialect,
1052 0x659d9bdb5cc2201,
1053 >(_buf?)?;
1054 Ok(_response.map(|x| x.values))
1055 }
1056 self.client.send_query_and_decode::<
1057 LightGetGroupCurrentSimpleValueRequest,
1058 LightGetGroupCurrentSimpleValueResult,
1059 >(
1060 (group_id,),
1061 0x659d9bdb5cc2201,
1062 fidl::encoding::DynamicFlags::empty(),
1063 _decode,
1064 )
1065 }
1066
1067 type SetGroupSimpleValueResponseFut = fidl::client::QueryResponseFut<
1068 LightSetGroupSimpleValueResult,
1069 fidl::encoding::DefaultFuchsiaResourceDialect,
1070 >;
1071 fn r#set_group_simple_value(
1072 &self,
1073 mut group_id: u32,
1074 mut values: &[bool],
1075 ) -> Self::SetGroupSimpleValueResponseFut {
1076 fn _decode(
1077 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1078 ) -> Result<LightSetGroupSimpleValueResult, fidl::Error> {
1079 let _response = fidl::client::decode_transaction_body::<
1080 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1081 fidl::encoding::DefaultFuchsiaResourceDialect,
1082 0x924234e74cc6dd8,
1083 >(_buf?)?;
1084 Ok(_response.map(|x| x))
1085 }
1086 self.client.send_query_and_decode::<
1087 LightSetGroupSimpleValueRequest,
1088 LightSetGroupSimpleValueResult,
1089 >(
1090 (group_id, values,),
1091 0x924234e74cc6dd8,
1092 fidl::encoding::DynamicFlags::empty(),
1093 _decode,
1094 )
1095 }
1096
1097 type GetGroupCurrentBrightnessValueResponseFut = fidl::client::QueryResponseFut<
1098 LightGetGroupCurrentBrightnessValueResult,
1099 fidl::encoding::DefaultFuchsiaResourceDialect,
1100 >;
1101 fn r#get_group_current_brightness_value(
1102 &self,
1103 mut group_id: u32,
1104 ) -> Self::GetGroupCurrentBrightnessValueResponseFut {
1105 fn _decode(
1106 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1107 ) -> Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error> {
1108 let _response = fidl::client::decode_transaction_body::<
1109 fidl::encoding::ResultType<LightGetGroupCurrentBrightnessValueResponse, LightError>,
1110 fidl::encoding::DefaultFuchsiaResourceDialect,
1111 0x3ab226120b0d0362,
1112 >(_buf?)?;
1113 Ok(_response.map(|x| x.values))
1114 }
1115 self.client.send_query_and_decode::<
1116 LightGetGroupCurrentBrightnessValueRequest,
1117 LightGetGroupCurrentBrightnessValueResult,
1118 >(
1119 (group_id,),
1120 0x3ab226120b0d0362,
1121 fidl::encoding::DynamicFlags::empty(),
1122 _decode,
1123 )
1124 }
1125
1126 type SetGroupBrightnessValueResponseFut = fidl::client::QueryResponseFut<
1127 LightSetGroupBrightnessValueResult,
1128 fidl::encoding::DefaultFuchsiaResourceDialect,
1129 >;
1130 fn r#set_group_brightness_value(
1131 &self,
1132 mut group_id: u32,
1133 mut values: &[f64],
1134 ) -> Self::SetGroupBrightnessValueResponseFut {
1135 fn _decode(
1136 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1137 ) -> Result<LightSetGroupBrightnessValueResult, fidl::Error> {
1138 let _response = fidl::client::decode_transaction_body::<
1139 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1140 fidl::encoding::DefaultFuchsiaResourceDialect,
1141 0x79e5f248fc5ec7ae,
1142 >(_buf?)?;
1143 Ok(_response.map(|x| x))
1144 }
1145 self.client.send_query_and_decode::<
1146 LightSetGroupBrightnessValueRequest,
1147 LightSetGroupBrightnessValueResult,
1148 >(
1149 (group_id, values,),
1150 0x79e5f248fc5ec7ae,
1151 fidl::encoding::DynamicFlags::empty(),
1152 _decode,
1153 )
1154 }
1155
1156 type GetGroupCurrentRgbValueResponseFut = fidl::client::QueryResponseFut<
1157 LightGetGroupCurrentRgbValueResult,
1158 fidl::encoding::DefaultFuchsiaResourceDialect,
1159 >;
1160 fn r#get_group_current_rgb_value(
1161 &self,
1162 mut group_id: u32,
1163 ) -> Self::GetGroupCurrentRgbValueResponseFut {
1164 fn _decode(
1165 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1166 ) -> Result<LightGetGroupCurrentRgbValueResult, fidl::Error> {
1167 let _response = fidl::client::decode_transaction_body::<
1168 fidl::encoding::ResultType<LightGetGroupCurrentRgbValueResponse, LightError>,
1169 fidl::encoding::DefaultFuchsiaResourceDialect,
1170 0x2a6014b41254f617,
1171 >(_buf?)?;
1172 Ok(_response.map(|x| x.values))
1173 }
1174 self.client.send_query_and_decode::<
1175 LightGetGroupCurrentRgbValueRequest,
1176 LightGetGroupCurrentRgbValueResult,
1177 >(
1178 (group_id,),
1179 0x2a6014b41254f617,
1180 fidl::encoding::DynamicFlags::empty(),
1181 _decode,
1182 )
1183 }
1184
1185 type SetGroupRgbValueResponseFut = fidl::client::QueryResponseFut<
1186 LightSetGroupRgbValueResult,
1187 fidl::encoding::DefaultFuchsiaResourceDialect,
1188 >;
1189 fn r#set_group_rgb_value(
1190 &self,
1191 mut group_id: u32,
1192 mut values: &[Rgb],
1193 ) -> Self::SetGroupRgbValueResponseFut {
1194 fn _decode(
1195 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1196 ) -> Result<LightSetGroupRgbValueResult, fidl::Error> {
1197 let _response = fidl::client::decode_transaction_body::<
1198 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1199 fidl::encoding::DefaultFuchsiaResourceDialect,
1200 0x33c92316f251e4e4,
1201 >(_buf?)?;
1202 Ok(_response.map(|x| x))
1203 }
1204 self.client
1205 .send_query_and_decode::<LightSetGroupRgbValueRequest, LightSetGroupRgbValueResult>(
1206 (group_id, values),
1207 0x33c92316f251e4e4,
1208 fidl::encoding::DynamicFlags::empty(),
1209 _decode,
1210 )
1211 }
1212}
1213
1214pub struct LightEventStream {
1215 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1216}
1217
1218impl std::marker::Unpin for LightEventStream {}
1219
1220impl futures::stream::FusedStream for LightEventStream {
1221 fn is_terminated(&self) -> bool {
1222 self.event_receiver.is_terminated()
1223 }
1224}
1225
1226impl futures::Stream for LightEventStream {
1227 type Item = Result<LightEvent, fidl::Error>;
1228
1229 fn poll_next(
1230 mut self: std::pin::Pin<&mut Self>,
1231 cx: &mut std::task::Context<'_>,
1232 ) -> std::task::Poll<Option<Self::Item>> {
1233 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1234 &mut self.event_receiver,
1235 cx
1236 )?) {
1237 Some(buf) => std::task::Poll::Ready(Some(LightEvent::decode(buf))),
1238 None => std::task::Poll::Ready(None),
1239 }
1240 }
1241}
1242
1243#[derive(Debug)]
1244pub enum LightEvent {}
1245
1246impl LightEvent {
1247 fn decode(
1249 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1250 ) -> Result<LightEvent, fidl::Error> {
1251 let (bytes, _handles) = buf.split_mut();
1252 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1253 debug_assert_eq!(tx_header.tx_id, 0);
1254 match tx_header.ordinal {
1255 _ => Err(fidl::Error::UnknownOrdinal {
1256 ordinal: tx_header.ordinal,
1257 protocol_name: <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1258 }),
1259 }
1260 }
1261}
1262
1263pub struct LightRequestStream {
1265 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1266 is_terminated: bool,
1267}
1268
1269impl std::marker::Unpin for LightRequestStream {}
1270
1271impl futures::stream::FusedStream for LightRequestStream {
1272 fn is_terminated(&self) -> bool {
1273 self.is_terminated
1274 }
1275}
1276
1277impl fidl::endpoints::RequestStream for LightRequestStream {
1278 type Protocol = LightMarker;
1279 type ControlHandle = LightControlHandle;
1280
1281 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1282 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1283 }
1284
1285 fn control_handle(&self) -> Self::ControlHandle {
1286 LightControlHandle { inner: self.inner.clone() }
1287 }
1288
1289 fn into_inner(
1290 self,
1291 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1292 {
1293 (self.inner, self.is_terminated)
1294 }
1295
1296 fn from_inner(
1297 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1298 is_terminated: bool,
1299 ) -> Self {
1300 Self { inner, is_terminated }
1301 }
1302}
1303
1304impl futures::Stream for LightRequestStream {
1305 type Item = Result<LightRequest, fidl::Error>;
1306
1307 fn poll_next(
1308 mut self: std::pin::Pin<&mut Self>,
1309 cx: &mut std::task::Context<'_>,
1310 ) -> std::task::Poll<Option<Self::Item>> {
1311 let this = &mut *self;
1312 if this.inner.check_shutdown(cx) {
1313 this.is_terminated = true;
1314 return std::task::Poll::Ready(None);
1315 }
1316 if this.is_terminated {
1317 panic!("polled LightRequestStream after completion");
1318 }
1319 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1320 |bytes, handles| {
1321 match this.inner.channel().read_etc(cx, bytes, handles) {
1322 std::task::Poll::Ready(Ok(())) => {}
1323 std::task::Poll::Pending => return std::task::Poll::Pending,
1324 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1325 this.is_terminated = true;
1326 return std::task::Poll::Ready(None);
1327 }
1328 std::task::Poll::Ready(Err(e)) => {
1329 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1330 e.into(),
1331 ))));
1332 }
1333 }
1334
1335 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1337
1338 std::task::Poll::Ready(Some(match header.ordinal {
1339 0x7ae2bd2ef8062dbb => {
1340 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1341 let mut req = fidl::new_empty!(
1342 fidl::encoding::EmptyPayload,
1343 fidl::encoding::DefaultFuchsiaResourceDialect
1344 );
1345 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1346 let control_handle = LightControlHandle { inner: this.inner.clone() };
1347 Ok(LightRequest::GetNumLights {
1348 responder: LightGetNumLightsResponder {
1349 control_handle: std::mem::ManuallyDrop::new(control_handle),
1350 tx_id: header.tx_id,
1351 },
1352 })
1353 }
1354 0x600895db5a7cbf0 => {
1355 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1356 let mut req = fidl::new_empty!(
1357 fidl::encoding::EmptyPayload,
1358 fidl::encoding::DefaultFuchsiaResourceDialect
1359 );
1360 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1361 let control_handle = LightControlHandle { inner: this.inner.clone() };
1362 Ok(LightRequest::GetNumLightGroups {
1363 responder: LightGetNumLightGroupsResponder {
1364 control_handle: std::mem::ManuallyDrop::new(control_handle),
1365 tx_id: header.tx_id,
1366 },
1367 })
1368 }
1369 0x4229b55c8c4bd529 => {
1370 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1371 let mut req = fidl::new_empty!(
1372 LightGetInfoRequest,
1373 fidl::encoding::DefaultFuchsiaResourceDialect
1374 );
1375 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetInfoRequest>(&header, _body_bytes, handles, &mut req)?;
1376 let control_handle = LightControlHandle { inner: this.inner.clone() };
1377 Ok(LightRequest::GetInfo {
1378 index: req.index,
1379
1380 responder: LightGetInfoResponder {
1381 control_handle: std::mem::ManuallyDrop::new(control_handle),
1382 tx_id: header.tx_id,
1383 },
1384 })
1385 }
1386 0x183154896336c321 => {
1387 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1388 let mut req = fidl::new_empty!(
1389 LightGetCurrentSimpleValueRequest,
1390 fidl::encoding::DefaultFuchsiaResourceDialect
1391 );
1392 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1393 let control_handle = LightControlHandle { inner: this.inner.clone() };
1394 Ok(LightRequest::GetCurrentSimpleValue {
1395 index: req.index,
1396
1397 responder: LightGetCurrentSimpleValueResponder {
1398 control_handle: std::mem::ManuallyDrop::new(control_handle),
1399 tx_id: header.tx_id,
1400 },
1401 })
1402 }
1403 0x4fb33d84c1aad81d => {
1404 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1405 let mut req = fidl::new_empty!(
1406 LightSetSimpleValueRequest,
1407 fidl::encoding::DefaultFuchsiaResourceDialect
1408 );
1409 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1410 let control_handle = LightControlHandle { inner: this.inner.clone() };
1411 Ok(LightRequest::SetSimpleValue {
1412 index: req.index,
1413 value: req.value,
1414
1415 responder: LightSetSimpleValueResponder {
1416 control_handle: std::mem::ManuallyDrop::new(control_handle),
1417 tx_id: header.tx_id,
1418 },
1419 })
1420 }
1421 0x2d387e129fe84809 => {
1422 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1423 let mut req = fidl::new_empty!(
1424 LightGetCurrentBrightnessValueRequest,
1425 fidl::encoding::DefaultFuchsiaResourceDialect
1426 );
1427 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1428 let control_handle = LightControlHandle { inner: this.inner.clone() };
1429 Ok(LightRequest::GetCurrentBrightnessValue {
1430 index: req.index,
1431
1432 responder: LightGetCurrentBrightnessValueResponder {
1433 control_handle: std::mem::ManuallyDrop::new(control_handle),
1434 tx_id: header.tx_id,
1435 },
1436 })
1437 }
1438 0x17cada93c7c48661 => {
1439 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1440 let mut req = fidl::new_empty!(
1441 LightSetBrightnessValueRequest,
1442 fidl::encoding::DefaultFuchsiaResourceDialect
1443 );
1444 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1445 let control_handle = LightControlHandle { inner: this.inner.clone() };
1446 Ok(LightRequest::SetBrightnessValue {
1447 index: req.index,
1448 value: req.value,
1449
1450 responder: LightSetBrightnessValueResponder {
1451 control_handle: std::mem::ManuallyDrop::new(control_handle),
1452 tx_id: header.tx_id,
1453 },
1454 })
1455 }
1456 0x49965ac0d920f4ad => {
1457 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1458 let mut req = fidl::new_empty!(
1459 LightGetCurrentRgbValueRequest,
1460 fidl::encoding::DefaultFuchsiaResourceDialect
1461 );
1462 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1463 let control_handle = LightControlHandle { inner: this.inner.clone() };
1464 Ok(LightRequest::GetCurrentRgbValue {
1465 index: req.index,
1466
1467 responder: LightGetCurrentRgbValueResponder {
1468 control_handle: std::mem::ManuallyDrop::new(control_handle),
1469 tx_id: header.tx_id,
1470 },
1471 })
1472 }
1473 0x2b354d18be0b70a4 => {
1474 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1475 let mut req = fidl::new_empty!(
1476 LightSetRgbValueRequest,
1477 fidl::encoding::DefaultFuchsiaResourceDialect
1478 );
1479 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1480 let control_handle = LightControlHandle { inner: this.inner.clone() };
1481 Ok(LightRequest::SetRgbValue {
1482 index: req.index,
1483 value: req.value,
1484
1485 responder: LightSetRgbValueResponder {
1486 control_handle: std::mem::ManuallyDrop::new(control_handle),
1487 tx_id: header.tx_id,
1488 },
1489 })
1490 }
1491 0x5b27b0ca755b470b => {
1492 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1493 let mut req = fidl::new_empty!(
1494 LightGetGroupInfoRequest,
1495 fidl::encoding::DefaultFuchsiaResourceDialect
1496 );
1497 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupInfoRequest>(&header, _body_bytes, handles, &mut req)?;
1498 let control_handle = LightControlHandle { inner: this.inner.clone() };
1499 Ok(LightRequest::GetGroupInfo {
1500 group_id: req.group_id,
1501
1502 responder: LightGetGroupInfoResponder {
1503 control_handle: std::mem::ManuallyDrop::new(control_handle),
1504 tx_id: header.tx_id,
1505 },
1506 })
1507 }
1508 0x659d9bdb5cc2201 => {
1509 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1510 let mut req = fidl::new_empty!(
1511 LightGetGroupCurrentSimpleValueRequest,
1512 fidl::encoding::DefaultFuchsiaResourceDialect
1513 );
1514 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1515 let control_handle = LightControlHandle { inner: this.inner.clone() };
1516 Ok(LightRequest::GetGroupCurrentSimpleValue {
1517 group_id: req.group_id,
1518
1519 responder: LightGetGroupCurrentSimpleValueResponder {
1520 control_handle: std::mem::ManuallyDrop::new(control_handle),
1521 tx_id: header.tx_id,
1522 },
1523 })
1524 }
1525 0x924234e74cc6dd8 => {
1526 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1527 let mut req = fidl::new_empty!(
1528 LightSetGroupSimpleValueRequest,
1529 fidl::encoding::DefaultFuchsiaResourceDialect
1530 );
1531 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1532 let control_handle = LightControlHandle { inner: this.inner.clone() };
1533 Ok(LightRequest::SetGroupSimpleValue {
1534 group_id: req.group_id,
1535 values: req.values,
1536
1537 responder: LightSetGroupSimpleValueResponder {
1538 control_handle: std::mem::ManuallyDrop::new(control_handle),
1539 tx_id: header.tx_id,
1540 },
1541 })
1542 }
1543 0x3ab226120b0d0362 => {
1544 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1545 let mut req = fidl::new_empty!(
1546 LightGetGroupCurrentBrightnessValueRequest,
1547 fidl::encoding::DefaultFuchsiaResourceDialect
1548 );
1549 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1550 let control_handle = LightControlHandle { inner: this.inner.clone() };
1551 Ok(LightRequest::GetGroupCurrentBrightnessValue {
1552 group_id: req.group_id,
1553
1554 responder: LightGetGroupCurrentBrightnessValueResponder {
1555 control_handle: std::mem::ManuallyDrop::new(control_handle),
1556 tx_id: header.tx_id,
1557 },
1558 })
1559 }
1560 0x79e5f248fc5ec7ae => {
1561 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1562 let mut req = fidl::new_empty!(
1563 LightSetGroupBrightnessValueRequest,
1564 fidl::encoding::DefaultFuchsiaResourceDialect
1565 );
1566 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1567 let control_handle = LightControlHandle { inner: this.inner.clone() };
1568 Ok(LightRequest::SetGroupBrightnessValue {
1569 group_id: req.group_id,
1570 values: req.values,
1571
1572 responder: LightSetGroupBrightnessValueResponder {
1573 control_handle: std::mem::ManuallyDrop::new(control_handle),
1574 tx_id: header.tx_id,
1575 },
1576 })
1577 }
1578 0x2a6014b41254f617 => {
1579 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1580 let mut req = fidl::new_empty!(
1581 LightGetGroupCurrentRgbValueRequest,
1582 fidl::encoding::DefaultFuchsiaResourceDialect
1583 );
1584 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1585 let control_handle = LightControlHandle { inner: this.inner.clone() };
1586 Ok(LightRequest::GetGroupCurrentRgbValue {
1587 group_id: req.group_id,
1588
1589 responder: LightGetGroupCurrentRgbValueResponder {
1590 control_handle: std::mem::ManuallyDrop::new(control_handle),
1591 tx_id: header.tx_id,
1592 },
1593 })
1594 }
1595 0x33c92316f251e4e4 => {
1596 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1597 let mut req = fidl::new_empty!(
1598 LightSetGroupRgbValueRequest,
1599 fidl::encoding::DefaultFuchsiaResourceDialect
1600 );
1601 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1602 let control_handle = LightControlHandle { inner: this.inner.clone() };
1603 Ok(LightRequest::SetGroupRgbValue {
1604 group_id: req.group_id,
1605 values: req.values,
1606
1607 responder: LightSetGroupRgbValueResponder {
1608 control_handle: std::mem::ManuallyDrop::new(control_handle),
1609 tx_id: header.tx_id,
1610 },
1611 })
1612 }
1613 _ => Err(fidl::Error::UnknownOrdinal {
1614 ordinal: header.ordinal,
1615 protocol_name: <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1616 }),
1617 }))
1618 },
1619 )
1620 }
1621}
1622
1623#[derive(Debug)]
1624pub enum LightRequest {
1625 GetNumLights { responder: LightGetNumLightsResponder },
1630 GetNumLightGroups { responder: LightGetNumLightGroupsResponder },
1633 GetInfo { index: u32, responder: LightGetInfoResponder },
1636 GetCurrentSimpleValue { index: u32, responder: LightGetCurrentSimpleValueResponder },
1642 SetSimpleValue { index: u32, value: bool, responder: LightSetSimpleValueResponder },
1648 GetCurrentBrightnessValue { index: u32, responder: LightGetCurrentBrightnessValueResponder },
1654 SetBrightnessValue { index: u32, value: f64, responder: LightSetBrightnessValueResponder },
1660 GetCurrentRgbValue { index: u32, responder: LightGetCurrentRgbValueResponder },
1665 SetRgbValue { index: u32, value: Rgb, responder: LightSetRgbValueResponder },
1670 GetGroupInfo { group_id: u32, responder: LightGetGroupInfoResponder },
1673 GetGroupCurrentSimpleValue {
1680 group_id: u32,
1681 responder: LightGetGroupCurrentSimpleValueResponder,
1682 },
1683 SetGroupSimpleValue {
1690 group_id: u32,
1691 values: Vec<bool>,
1692 responder: LightSetGroupSimpleValueResponder,
1693 },
1694 GetGroupCurrentBrightnessValue {
1701 group_id: u32,
1702 responder: LightGetGroupCurrentBrightnessValueResponder,
1703 },
1704 SetGroupBrightnessValue {
1711 group_id: u32,
1712 values: Vec<f64>,
1713 responder: LightSetGroupBrightnessValueResponder,
1714 },
1715 GetGroupCurrentRgbValue { group_id: u32, responder: LightGetGroupCurrentRgbValueResponder },
1721 SetGroupRgbValue { group_id: u32, values: Vec<Rgb>, responder: LightSetGroupRgbValueResponder },
1727}
1728
1729impl LightRequest {
1730 #[allow(irrefutable_let_patterns)]
1731 pub fn into_get_num_lights(self) -> Option<(LightGetNumLightsResponder)> {
1732 if let LightRequest::GetNumLights { responder } = self { Some((responder)) } else { None }
1733 }
1734
1735 #[allow(irrefutable_let_patterns)]
1736 pub fn into_get_num_light_groups(self) -> Option<(LightGetNumLightGroupsResponder)> {
1737 if let LightRequest::GetNumLightGroups { responder } = self {
1738 Some((responder))
1739 } else {
1740 None
1741 }
1742 }
1743
1744 #[allow(irrefutable_let_patterns)]
1745 pub fn into_get_info(self) -> Option<(u32, LightGetInfoResponder)> {
1746 if let LightRequest::GetInfo { index, responder } = self {
1747 Some((index, responder))
1748 } else {
1749 None
1750 }
1751 }
1752
1753 #[allow(irrefutable_let_patterns)]
1754 pub fn into_get_current_simple_value(
1755 self,
1756 ) -> Option<(u32, LightGetCurrentSimpleValueResponder)> {
1757 if let LightRequest::GetCurrentSimpleValue { index, responder } = self {
1758 Some((index, responder))
1759 } else {
1760 None
1761 }
1762 }
1763
1764 #[allow(irrefutable_let_patterns)]
1765 pub fn into_set_simple_value(self) -> Option<(u32, bool, LightSetSimpleValueResponder)> {
1766 if let LightRequest::SetSimpleValue { index, value, responder } = self {
1767 Some((index, value, responder))
1768 } else {
1769 None
1770 }
1771 }
1772
1773 #[allow(irrefutable_let_patterns)]
1774 pub fn into_get_current_brightness_value(
1775 self,
1776 ) -> Option<(u32, LightGetCurrentBrightnessValueResponder)> {
1777 if let LightRequest::GetCurrentBrightnessValue { index, responder } = self {
1778 Some((index, responder))
1779 } else {
1780 None
1781 }
1782 }
1783
1784 #[allow(irrefutable_let_patterns)]
1785 pub fn into_set_brightness_value(self) -> Option<(u32, f64, LightSetBrightnessValueResponder)> {
1786 if let LightRequest::SetBrightnessValue { index, value, responder } = self {
1787 Some((index, value, responder))
1788 } else {
1789 None
1790 }
1791 }
1792
1793 #[allow(irrefutable_let_patterns)]
1794 pub fn into_get_current_rgb_value(self) -> Option<(u32, LightGetCurrentRgbValueResponder)> {
1795 if let LightRequest::GetCurrentRgbValue { index, responder } = self {
1796 Some((index, responder))
1797 } else {
1798 None
1799 }
1800 }
1801
1802 #[allow(irrefutable_let_patterns)]
1803 pub fn into_set_rgb_value(self) -> Option<(u32, Rgb, LightSetRgbValueResponder)> {
1804 if let LightRequest::SetRgbValue { index, value, responder } = self {
1805 Some((index, value, responder))
1806 } else {
1807 None
1808 }
1809 }
1810
1811 #[allow(irrefutable_let_patterns)]
1812 pub fn into_get_group_info(self) -> Option<(u32, LightGetGroupInfoResponder)> {
1813 if let LightRequest::GetGroupInfo { group_id, responder } = self {
1814 Some((group_id, responder))
1815 } else {
1816 None
1817 }
1818 }
1819
1820 #[allow(irrefutable_let_patterns)]
1821 pub fn into_get_group_current_simple_value(
1822 self,
1823 ) -> Option<(u32, LightGetGroupCurrentSimpleValueResponder)> {
1824 if let LightRequest::GetGroupCurrentSimpleValue { group_id, responder } = self {
1825 Some((group_id, responder))
1826 } else {
1827 None
1828 }
1829 }
1830
1831 #[allow(irrefutable_let_patterns)]
1832 pub fn into_set_group_simple_value(
1833 self,
1834 ) -> Option<(u32, Vec<bool>, LightSetGroupSimpleValueResponder)> {
1835 if let LightRequest::SetGroupSimpleValue { group_id, values, responder } = self {
1836 Some((group_id, values, responder))
1837 } else {
1838 None
1839 }
1840 }
1841
1842 #[allow(irrefutable_let_patterns)]
1843 pub fn into_get_group_current_brightness_value(
1844 self,
1845 ) -> Option<(u32, LightGetGroupCurrentBrightnessValueResponder)> {
1846 if let LightRequest::GetGroupCurrentBrightnessValue { group_id, responder } = self {
1847 Some((group_id, responder))
1848 } else {
1849 None
1850 }
1851 }
1852
1853 #[allow(irrefutable_let_patterns)]
1854 pub fn into_set_group_brightness_value(
1855 self,
1856 ) -> Option<(u32, Vec<f64>, LightSetGroupBrightnessValueResponder)> {
1857 if let LightRequest::SetGroupBrightnessValue { group_id, values, responder } = self {
1858 Some((group_id, values, responder))
1859 } else {
1860 None
1861 }
1862 }
1863
1864 #[allow(irrefutable_let_patterns)]
1865 pub fn into_get_group_current_rgb_value(
1866 self,
1867 ) -> Option<(u32, LightGetGroupCurrentRgbValueResponder)> {
1868 if let LightRequest::GetGroupCurrentRgbValue { group_id, responder } = self {
1869 Some((group_id, responder))
1870 } else {
1871 None
1872 }
1873 }
1874
1875 #[allow(irrefutable_let_patterns)]
1876 pub fn into_set_group_rgb_value(
1877 self,
1878 ) -> Option<(u32, Vec<Rgb>, LightSetGroupRgbValueResponder)> {
1879 if let LightRequest::SetGroupRgbValue { group_id, values, responder } = self {
1880 Some((group_id, values, responder))
1881 } else {
1882 None
1883 }
1884 }
1885
1886 pub fn method_name(&self) -> &'static str {
1888 match *self {
1889 LightRequest::GetNumLights { .. } => "get_num_lights",
1890 LightRequest::GetNumLightGroups { .. } => "get_num_light_groups",
1891 LightRequest::GetInfo { .. } => "get_info",
1892 LightRequest::GetCurrentSimpleValue { .. } => "get_current_simple_value",
1893 LightRequest::SetSimpleValue { .. } => "set_simple_value",
1894 LightRequest::GetCurrentBrightnessValue { .. } => "get_current_brightness_value",
1895 LightRequest::SetBrightnessValue { .. } => "set_brightness_value",
1896 LightRequest::GetCurrentRgbValue { .. } => "get_current_rgb_value",
1897 LightRequest::SetRgbValue { .. } => "set_rgb_value",
1898 LightRequest::GetGroupInfo { .. } => "get_group_info",
1899 LightRequest::GetGroupCurrentSimpleValue { .. } => "get_group_current_simple_value",
1900 LightRequest::SetGroupSimpleValue { .. } => "set_group_simple_value",
1901 LightRequest::GetGroupCurrentBrightnessValue { .. } => {
1902 "get_group_current_brightness_value"
1903 }
1904 LightRequest::SetGroupBrightnessValue { .. } => "set_group_brightness_value",
1905 LightRequest::GetGroupCurrentRgbValue { .. } => "get_group_current_rgb_value",
1906 LightRequest::SetGroupRgbValue { .. } => "set_group_rgb_value",
1907 }
1908 }
1909}
1910
1911#[derive(Debug, Clone)]
1912pub struct LightControlHandle {
1913 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1914}
1915
1916impl fidl::endpoints::ControlHandle for LightControlHandle {
1917 fn shutdown(&self) {
1918 self.inner.shutdown()
1919 }
1920 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1921 self.inner.shutdown_with_epitaph(status)
1922 }
1923
1924 fn is_closed(&self) -> bool {
1925 self.inner.channel().is_closed()
1926 }
1927 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1928 self.inner.channel().on_closed()
1929 }
1930
1931 #[cfg(target_os = "fuchsia")]
1932 fn signal_peer(
1933 &self,
1934 clear_mask: zx::Signals,
1935 set_mask: zx::Signals,
1936 ) -> Result<(), zx_status::Status> {
1937 use fidl::Peered;
1938 self.inner.channel().signal_peer(clear_mask, set_mask)
1939 }
1940}
1941
1942impl LightControlHandle {}
1943
1944#[must_use = "FIDL methods require a response to be sent"]
1945#[derive(Debug)]
1946pub struct LightGetNumLightsResponder {
1947 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
1948 tx_id: u32,
1949}
1950
1951impl std::ops::Drop for LightGetNumLightsResponder {
1955 fn drop(&mut self) {
1956 self.control_handle.shutdown();
1957 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1959 }
1960}
1961
1962impl fidl::endpoints::Responder for LightGetNumLightsResponder {
1963 type ControlHandle = LightControlHandle;
1964
1965 fn control_handle(&self) -> &LightControlHandle {
1966 &self.control_handle
1967 }
1968
1969 fn drop_without_shutdown(mut self) {
1970 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1972 std::mem::forget(self);
1974 }
1975}
1976
1977impl LightGetNumLightsResponder {
1978 pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
1982 let _result = self.send_raw(count);
1983 if _result.is_err() {
1984 self.control_handle.shutdown();
1985 }
1986 self.drop_without_shutdown();
1987 _result
1988 }
1989
1990 pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
1992 let _result = self.send_raw(count);
1993 self.drop_without_shutdown();
1994 _result
1995 }
1996
1997 fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
1998 self.control_handle.inner.send::<LightGetNumLightsResponse>(
1999 (count,),
2000 self.tx_id,
2001 0x7ae2bd2ef8062dbb,
2002 fidl::encoding::DynamicFlags::empty(),
2003 )
2004 }
2005}
2006
2007#[must_use = "FIDL methods require a response to be sent"]
2008#[derive(Debug)]
2009pub struct LightGetNumLightGroupsResponder {
2010 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2011 tx_id: u32,
2012}
2013
2014impl std::ops::Drop for LightGetNumLightGroupsResponder {
2018 fn drop(&mut self) {
2019 self.control_handle.shutdown();
2020 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2022 }
2023}
2024
2025impl fidl::endpoints::Responder for LightGetNumLightGroupsResponder {
2026 type ControlHandle = LightControlHandle;
2027
2028 fn control_handle(&self) -> &LightControlHandle {
2029 &self.control_handle
2030 }
2031
2032 fn drop_without_shutdown(mut self) {
2033 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2035 std::mem::forget(self);
2037 }
2038}
2039
2040impl LightGetNumLightGroupsResponder {
2041 pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
2045 let _result = self.send_raw(count);
2046 if _result.is_err() {
2047 self.control_handle.shutdown();
2048 }
2049 self.drop_without_shutdown();
2050 _result
2051 }
2052
2053 pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
2055 let _result = self.send_raw(count);
2056 self.drop_without_shutdown();
2057 _result
2058 }
2059
2060 fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
2061 self.control_handle.inner.send::<LightGetNumLightGroupsResponse>(
2062 (count,),
2063 self.tx_id,
2064 0x600895db5a7cbf0,
2065 fidl::encoding::DynamicFlags::empty(),
2066 )
2067 }
2068}
2069
2070#[must_use = "FIDL methods require a response to be sent"]
2071#[derive(Debug)]
2072pub struct LightGetInfoResponder {
2073 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2074 tx_id: u32,
2075}
2076
2077impl std::ops::Drop for LightGetInfoResponder {
2081 fn drop(&mut self) {
2082 self.control_handle.shutdown();
2083 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2085 }
2086}
2087
2088impl fidl::endpoints::Responder for LightGetInfoResponder {
2089 type ControlHandle = LightControlHandle;
2090
2091 fn control_handle(&self) -> &LightControlHandle {
2092 &self.control_handle
2093 }
2094
2095 fn drop_without_shutdown(mut self) {
2096 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2098 std::mem::forget(self);
2100 }
2101}
2102
2103impl LightGetInfoResponder {
2104 pub fn send(self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2108 let _result = self.send_raw(result);
2109 if _result.is_err() {
2110 self.control_handle.shutdown();
2111 }
2112 self.drop_without_shutdown();
2113 _result
2114 }
2115
2116 pub fn send_no_shutdown_on_err(
2118 self,
2119 mut result: Result<&Info, LightError>,
2120 ) -> Result<(), fidl::Error> {
2121 let _result = self.send_raw(result);
2122 self.drop_without_shutdown();
2123 _result
2124 }
2125
2126 fn send_raw(&self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2127 self.control_handle
2128 .inner
2129 .send::<fidl::encoding::ResultType<LightGetInfoResponse, LightError>>(
2130 result.map(|info| (info,)),
2131 self.tx_id,
2132 0x4229b55c8c4bd529,
2133 fidl::encoding::DynamicFlags::empty(),
2134 )
2135 }
2136}
2137
2138#[must_use = "FIDL methods require a response to be sent"]
2139#[derive(Debug)]
2140pub struct LightGetCurrentSimpleValueResponder {
2141 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2142 tx_id: u32,
2143}
2144
2145impl std::ops::Drop for LightGetCurrentSimpleValueResponder {
2149 fn drop(&mut self) {
2150 self.control_handle.shutdown();
2151 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2153 }
2154}
2155
2156impl fidl::endpoints::Responder for LightGetCurrentSimpleValueResponder {
2157 type ControlHandle = LightControlHandle;
2158
2159 fn control_handle(&self) -> &LightControlHandle {
2160 &self.control_handle
2161 }
2162
2163 fn drop_without_shutdown(mut self) {
2164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2166 std::mem::forget(self);
2168 }
2169}
2170
2171impl LightGetCurrentSimpleValueResponder {
2172 pub fn send(self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2176 let _result = self.send_raw(result);
2177 if _result.is_err() {
2178 self.control_handle.shutdown();
2179 }
2180 self.drop_without_shutdown();
2181 _result
2182 }
2183
2184 pub fn send_no_shutdown_on_err(
2186 self,
2187 mut result: Result<bool, LightError>,
2188 ) -> Result<(), fidl::Error> {
2189 let _result = self.send_raw(result);
2190 self.drop_without_shutdown();
2191 _result
2192 }
2193
2194 fn send_raw(&self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2195 self.control_handle.inner.send::<fidl::encoding::ResultType<
2196 LightGetCurrentSimpleValueResponse,
2197 LightError,
2198 >>(
2199 result.map(|value| (value,)),
2200 self.tx_id,
2201 0x183154896336c321,
2202 fidl::encoding::DynamicFlags::empty(),
2203 )
2204 }
2205}
2206
2207#[must_use = "FIDL methods require a response to be sent"]
2208#[derive(Debug)]
2209pub struct LightSetSimpleValueResponder {
2210 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2211 tx_id: u32,
2212}
2213
2214impl std::ops::Drop for LightSetSimpleValueResponder {
2218 fn drop(&mut self) {
2219 self.control_handle.shutdown();
2220 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2222 }
2223}
2224
2225impl fidl::endpoints::Responder for LightSetSimpleValueResponder {
2226 type ControlHandle = LightControlHandle;
2227
2228 fn control_handle(&self) -> &LightControlHandle {
2229 &self.control_handle
2230 }
2231
2232 fn drop_without_shutdown(mut self) {
2233 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2235 std::mem::forget(self);
2237 }
2238}
2239
2240impl LightSetSimpleValueResponder {
2241 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2245 let _result = self.send_raw(result);
2246 if _result.is_err() {
2247 self.control_handle.shutdown();
2248 }
2249 self.drop_without_shutdown();
2250 _result
2251 }
2252
2253 pub fn send_no_shutdown_on_err(
2255 self,
2256 mut result: Result<(), LightError>,
2257 ) -> Result<(), fidl::Error> {
2258 let _result = self.send_raw(result);
2259 self.drop_without_shutdown();
2260 _result
2261 }
2262
2263 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2264 self.control_handle
2265 .inner
2266 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2267 result,
2268 self.tx_id,
2269 0x4fb33d84c1aad81d,
2270 fidl::encoding::DynamicFlags::empty(),
2271 )
2272 }
2273}
2274
2275#[must_use = "FIDL methods require a response to be sent"]
2276#[derive(Debug)]
2277pub struct LightGetCurrentBrightnessValueResponder {
2278 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2279 tx_id: u32,
2280}
2281
2282impl std::ops::Drop for LightGetCurrentBrightnessValueResponder {
2286 fn drop(&mut self) {
2287 self.control_handle.shutdown();
2288 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2290 }
2291}
2292
2293impl fidl::endpoints::Responder for LightGetCurrentBrightnessValueResponder {
2294 type ControlHandle = LightControlHandle;
2295
2296 fn control_handle(&self) -> &LightControlHandle {
2297 &self.control_handle
2298 }
2299
2300 fn drop_without_shutdown(mut self) {
2301 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2303 std::mem::forget(self);
2305 }
2306}
2307
2308impl LightGetCurrentBrightnessValueResponder {
2309 pub fn send(self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2313 let _result = self.send_raw(result);
2314 if _result.is_err() {
2315 self.control_handle.shutdown();
2316 }
2317 self.drop_without_shutdown();
2318 _result
2319 }
2320
2321 pub fn send_no_shutdown_on_err(
2323 self,
2324 mut result: Result<f64, LightError>,
2325 ) -> Result<(), fidl::Error> {
2326 let _result = self.send_raw(result);
2327 self.drop_without_shutdown();
2328 _result
2329 }
2330
2331 fn send_raw(&self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2332 self.control_handle.inner.send::<fidl::encoding::ResultType<
2333 LightGetCurrentBrightnessValueResponse,
2334 LightError,
2335 >>(
2336 result.map(|value| (value,)),
2337 self.tx_id,
2338 0x2d387e129fe84809,
2339 fidl::encoding::DynamicFlags::empty(),
2340 )
2341 }
2342}
2343
2344#[must_use = "FIDL methods require a response to be sent"]
2345#[derive(Debug)]
2346pub struct LightSetBrightnessValueResponder {
2347 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2348 tx_id: u32,
2349}
2350
2351impl std::ops::Drop for LightSetBrightnessValueResponder {
2355 fn drop(&mut self) {
2356 self.control_handle.shutdown();
2357 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2359 }
2360}
2361
2362impl fidl::endpoints::Responder for LightSetBrightnessValueResponder {
2363 type ControlHandle = LightControlHandle;
2364
2365 fn control_handle(&self) -> &LightControlHandle {
2366 &self.control_handle
2367 }
2368
2369 fn drop_without_shutdown(mut self) {
2370 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2372 std::mem::forget(self);
2374 }
2375}
2376
2377impl LightSetBrightnessValueResponder {
2378 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2382 let _result = self.send_raw(result);
2383 if _result.is_err() {
2384 self.control_handle.shutdown();
2385 }
2386 self.drop_without_shutdown();
2387 _result
2388 }
2389
2390 pub fn send_no_shutdown_on_err(
2392 self,
2393 mut result: Result<(), LightError>,
2394 ) -> Result<(), fidl::Error> {
2395 let _result = self.send_raw(result);
2396 self.drop_without_shutdown();
2397 _result
2398 }
2399
2400 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2401 self.control_handle
2402 .inner
2403 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2404 result,
2405 self.tx_id,
2406 0x17cada93c7c48661,
2407 fidl::encoding::DynamicFlags::empty(),
2408 )
2409 }
2410}
2411
2412#[must_use = "FIDL methods require a response to be sent"]
2413#[derive(Debug)]
2414pub struct LightGetCurrentRgbValueResponder {
2415 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2416 tx_id: u32,
2417}
2418
2419impl std::ops::Drop for LightGetCurrentRgbValueResponder {
2423 fn drop(&mut self) {
2424 self.control_handle.shutdown();
2425 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2427 }
2428}
2429
2430impl fidl::endpoints::Responder for LightGetCurrentRgbValueResponder {
2431 type ControlHandle = LightControlHandle;
2432
2433 fn control_handle(&self) -> &LightControlHandle {
2434 &self.control_handle
2435 }
2436
2437 fn drop_without_shutdown(mut self) {
2438 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2440 std::mem::forget(self);
2442 }
2443}
2444
2445impl LightGetCurrentRgbValueResponder {
2446 pub fn send(self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2450 let _result = self.send_raw(result);
2451 if _result.is_err() {
2452 self.control_handle.shutdown();
2453 }
2454 self.drop_without_shutdown();
2455 _result
2456 }
2457
2458 pub fn send_no_shutdown_on_err(
2460 self,
2461 mut result: Result<&Rgb, LightError>,
2462 ) -> Result<(), fidl::Error> {
2463 let _result = self.send_raw(result);
2464 self.drop_without_shutdown();
2465 _result
2466 }
2467
2468 fn send_raw(&self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2469 self.control_handle.inner.send::<fidl::encoding::ResultType<
2470 LightGetCurrentRgbValueResponse,
2471 LightError,
2472 >>(
2473 result.map(|value| (value,)),
2474 self.tx_id,
2475 0x49965ac0d920f4ad,
2476 fidl::encoding::DynamicFlags::empty(),
2477 )
2478 }
2479}
2480
2481#[must_use = "FIDL methods require a response to be sent"]
2482#[derive(Debug)]
2483pub struct LightSetRgbValueResponder {
2484 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2485 tx_id: u32,
2486}
2487
2488impl std::ops::Drop for LightSetRgbValueResponder {
2492 fn drop(&mut self) {
2493 self.control_handle.shutdown();
2494 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2496 }
2497}
2498
2499impl fidl::endpoints::Responder for LightSetRgbValueResponder {
2500 type ControlHandle = LightControlHandle;
2501
2502 fn control_handle(&self) -> &LightControlHandle {
2503 &self.control_handle
2504 }
2505
2506 fn drop_without_shutdown(mut self) {
2507 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2509 std::mem::forget(self);
2511 }
2512}
2513
2514impl LightSetRgbValueResponder {
2515 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2519 let _result = self.send_raw(result);
2520 if _result.is_err() {
2521 self.control_handle.shutdown();
2522 }
2523 self.drop_without_shutdown();
2524 _result
2525 }
2526
2527 pub fn send_no_shutdown_on_err(
2529 self,
2530 mut result: Result<(), LightError>,
2531 ) -> Result<(), fidl::Error> {
2532 let _result = self.send_raw(result);
2533 self.drop_without_shutdown();
2534 _result
2535 }
2536
2537 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2538 self.control_handle
2539 .inner
2540 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2541 result,
2542 self.tx_id,
2543 0x2b354d18be0b70a4,
2544 fidl::encoding::DynamicFlags::empty(),
2545 )
2546 }
2547}
2548
2549#[must_use = "FIDL methods require a response to be sent"]
2550#[derive(Debug)]
2551pub struct LightGetGroupInfoResponder {
2552 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2553 tx_id: u32,
2554}
2555
2556impl std::ops::Drop for LightGetGroupInfoResponder {
2560 fn drop(&mut self) {
2561 self.control_handle.shutdown();
2562 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2564 }
2565}
2566
2567impl fidl::endpoints::Responder for LightGetGroupInfoResponder {
2568 type ControlHandle = LightControlHandle;
2569
2570 fn control_handle(&self) -> &LightControlHandle {
2571 &self.control_handle
2572 }
2573
2574 fn drop_without_shutdown(mut self) {
2575 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2577 std::mem::forget(self);
2579 }
2580}
2581
2582impl LightGetGroupInfoResponder {
2583 pub fn send(self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2587 let _result = self.send_raw(result);
2588 if _result.is_err() {
2589 self.control_handle.shutdown();
2590 }
2591 self.drop_without_shutdown();
2592 _result
2593 }
2594
2595 pub fn send_no_shutdown_on_err(
2597 self,
2598 mut result: Result<&GroupInfo, LightError>,
2599 ) -> Result<(), fidl::Error> {
2600 let _result = self.send_raw(result);
2601 self.drop_without_shutdown();
2602 _result
2603 }
2604
2605 fn send_raw(&self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2606 self.control_handle
2607 .inner
2608 .send::<fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>>(
2609 result.map(|info| (info,)),
2610 self.tx_id,
2611 0x5b27b0ca755b470b,
2612 fidl::encoding::DynamicFlags::empty(),
2613 )
2614 }
2615}
2616
2617#[must_use = "FIDL methods require a response to be sent"]
2618#[derive(Debug)]
2619pub struct LightGetGroupCurrentSimpleValueResponder {
2620 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2621 tx_id: u32,
2622}
2623
2624impl std::ops::Drop for LightGetGroupCurrentSimpleValueResponder {
2628 fn drop(&mut self) {
2629 self.control_handle.shutdown();
2630 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2632 }
2633}
2634
2635impl fidl::endpoints::Responder for LightGetGroupCurrentSimpleValueResponder {
2636 type ControlHandle = LightControlHandle;
2637
2638 fn control_handle(&self) -> &LightControlHandle {
2639 &self.control_handle
2640 }
2641
2642 fn drop_without_shutdown(mut self) {
2643 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2645 std::mem::forget(self);
2647 }
2648}
2649
2650impl LightGetGroupCurrentSimpleValueResponder {
2651 pub fn send(self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2655 let _result = self.send_raw(result);
2656 if _result.is_err() {
2657 self.control_handle.shutdown();
2658 }
2659 self.drop_without_shutdown();
2660 _result
2661 }
2662
2663 pub fn send_no_shutdown_on_err(
2665 self,
2666 mut result: Result<Option<&[bool]>, LightError>,
2667 ) -> Result<(), fidl::Error> {
2668 let _result = self.send_raw(result);
2669 self.drop_without_shutdown();
2670 _result
2671 }
2672
2673 fn send_raw(&self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2674 self.control_handle.inner.send::<fidl::encoding::ResultType<
2675 LightGetGroupCurrentSimpleValueResponse,
2676 LightError,
2677 >>(
2678 result.map(|values| (values,)),
2679 self.tx_id,
2680 0x659d9bdb5cc2201,
2681 fidl::encoding::DynamicFlags::empty(),
2682 )
2683 }
2684}
2685
2686#[must_use = "FIDL methods require a response to be sent"]
2687#[derive(Debug)]
2688pub struct LightSetGroupSimpleValueResponder {
2689 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2690 tx_id: u32,
2691}
2692
2693impl std::ops::Drop for LightSetGroupSimpleValueResponder {
2697 fn drop(&mut self) {
2698 self.control_handle.shutdown();
2699 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2701 }
2702}
2703
2704impl fidl::endpoints::Responder for LightSetGroupSimpleValueResponder {
2705 type ControlHandle = LightControlHandle;
2706
2707 fn control_handle(&self) -> &LightControlHandle {
2708 &self.control_handle
2709 }
2710
2711 fn drop_without_shutdown(mut self) {
2712 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2714 std::mem::forget(self);
2716 }
2717}
2718
2719impl LightSetGroupSimpleValueResponder {
2720 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2724 let _result = self.send_raw(result);
2725 if _result.is_err() {
2726 self.control_handle.shutdown();
2727 }
2728 self.drop_without_shutdown();
2729 _result
2730 }
2731
2732 pub fn send_no_shutdown_on_err(
2734 self,
2735 mut result: Result<(), LightError>,
2736 ) -> Result<(), fidl::Error> {
2737 let _result = self.send_raw(result);
2738 self.drop_without_shutdown();
2739 _result
2740 }
2741
2742 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2743 self.control_handle
2744 .inner
2745 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2746 result,
2747 self.tx_id,
2748 0x924234e74cc6dd8,
2749 fidl::encoding::DynamicFlags::empty(),
2750 )
2751 }
2752}
2753
2754#[must_use = "FIDL methods require a response to be sent"]
2755#[derive(Debug)]
2756pub struct LightGetGroupCurrentBrightnessValueResponder {
2757 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2758 tx_id: u32,
2759}
2760
2761impl std::ops::Drop for LightGetGroupCurrentBrightnessValueResponder {
2765 fn drop(&mut self) {
2766 self.control_handle.shutdown();
2767 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2769 }
2770}
2771
2772impl fidl::endpoints::Responder for LightGetGroupCurrentBrightnessValueResponder {
2773 type ControlHandle = LightControlHandle;
2774
2775 fn control_handle(&self) -> &LightControlHandle {
2776 &self.control_handle
2777 }
2778
2779 fn drop_without_shutdown(mut self) {
2780 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2782 std::mem::forget(self);
2784 }
2785}
2786
2787impl LightGetGroupCurrentBrightnessValueResponder {
2788 pub fn send(self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
2792 let _result = self.send_raw(result);
2793 if _result.is_err() {
2794 self.control_handle.shutdown();
2795 }
2796 self.drop_without_shutdown();
2797 _result
2798 }
2799
2800 pub fn send_no_shutdown_on_err(
2802 self,
2803 mut result: Result<Option<&[f64]>, LightError>,
2804 ) -> Result<(), fidl::Error> {
2805 let _result = self.send_raw(result);
2806 self.drop_without_shutdown();
2807 _result
2808 }
2809
2810 fn send_raw(&self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
2811 self.control_handle.inner.send::<fidl::encoding::ResultType<
2812 LightGetGroupCurrentBrightnessValueResponse,
2813 LightError,
2814 >>(
2815 result.map(|values| (values,)),
2816 self.tx_id,
2817 0x3ab226120b0d0362,
2818 fidl::encoding::DynamicFlags::empty(),
2819 )
2820 }
2821}
2822
2823#[must_use = "FIDL methods require a response to be sent"]
2824#[derive(Debug)]
2825pub struct LightSetGroupBrightnessValueResponder {
2826 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2827 tx_id: u32,
2828}
2829
2830impl std::ops::Drop for LightSetGroupBrightnessValueResponder {
2834 fn drop(&mut self) {
2835 self.control_handle.shutdown();
2836 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2838 }
2839}
2840
2841impl fidl::endpoints::Responder for LightSetGroupBrightnessValueResponder {
2842 type ControlHandle = LightControlHandle;
2843
2844 fn control_handle(&self) -> &LightControlHandle {
2845 &self.control_handle
2846 }
2847
2848 fn drop_without_shutdown(mut self) {
2849 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2851 std::mem::forget(self);
2853 }
2854}
2855
2856impl LightSetGroupBrightnessValueResponder {
2857 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2861 let _result = self.send_raw(result);
2862 if _result.is_err() {
2863 self.control_handle.shutdown();
2864 }
2865 self.drop_without_shutdown();
2866 _result
2867 }
2868
2869 pub fn send_no_shutdown_on_err(
2871 self,
2872 mut result: Result<(), LightError>,
2873 ) -> Result<(), fidl::Error> {
2874 let _result = self.send_raw(result);
2875 self.drop_without_shutdown();
2876 _result
2877 }
2878
2879 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2880 self.control_handle
2881 .inner
2882 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2883 result,
2884 self.tx_id,
2885 0x79e5f248fc5ec7ae,
2886 fidl::encoding::DynamicFlags::empty(),
2887 )
2888 }
2889}
2890
2891#[must_use = "FIDL methods require a response to be sent"]
2892#[derive(Debug)]
2893pub struct LightGetGroupCurrentRgbValueResponder {
2894 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2895 tx_id: u32,
2896}
2897
2898impl std::ops::Drop for LightGetGroupCurrentRgbValueResponder {
2902 fn drop(&mut self) {
2903 self.control_handle.shutdown();
2904 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2906 }
2907}
2908
2909impl fidl::endpoints::Responder for LightGetGroupCurrentRgbValueResponder {
2910 type ControlHandle = LightControlHandle;
2911
2912 fn control_handle(&self) -> &LightControlHandle {
2913 &self.control_handle
2914 }
2915
2916 fn drop_without_shutdown(mut self) {
2917 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2919 std::mem::forget(self);
2921 }
2922}
2923
2924impl LightGetGroupCurrentRgbValueResponder {
2925 pub fn send(self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
2929 let _result = self.send_raw(result);
2930 if _result.is_err() {
2931 self.control_handle.shutdown();
2932 }
2933 self.drop_without_shutdown();
2934 _result
2935 }
2936
2937 pub fn send_no_shutdown_on_err(
2939 self,
2940 mut result: Result<Option<&[Rgb]>, LightError>,
2941 ) -> Result<(), fidl::Error> {
2942 let _result = self.send_raw(result);
2943 self.drop_without_shutdown();
2944 _result
2945 }
2946
2947 fn send_raw(&self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
2948 self.control_handle.inner.send::<fidl::encoding::ResultType<
2949 LightGetGroupCurrentRgbValueResponse,
2950 LightError,
2951 >>(
2952 result.map(|values| (values,)),
2953 self.tx_id,
2954 0x2a6014b41254f617,
2955 fidl::encoding::DynamicFlags::empty(),
2956 )
2957 }
2958}
2959
2960#[must_use = "FIDL methods require a response to be sent"]
2961#[derive(Debug)]
2962pub struct LightSetGroupRgbValueResponder {
2963 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2964 tx_id: u32,
2965}
2966
2967impl std::ops::Drop for LightSetGroupRgbValueResponder {
2971 fn drop(&mut self) {
2972 self.control_handle.shutdown();
2973 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2975 }
2976}
2977
2978impl fidl::endpoints::Responder for LightSetGroupRgbValueResponder {
2979 type ControlHandle = LightControlHandle;
2980
2981 fn control_handle(&self) -> &LightControlHandle {
2982 &self.control_handle
2983 }
2984
2985 fn drop_without_shutdown(mut self) {
2986 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2988 std::mem::forget(self);
2990 }
2991}
2992
2993impl LightSetGroupRgbValueResponder {
2994 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2998 let _result = self.send_raw(result);
2999 if _result.is_err() {
3000 self.control_handle.shutdown();
3001 }
3002 self.drop_without_shutdown();
3003 _result
3004 }
3005
3006 pub fn send_no_shutdown_on_err(
3008 self,
3009 mut result: Result<(), LightError>,
3010 ) -> Result<(), fidl::Error> {
3011 let _result = self.send_raw(result);
3012 self.drop_without_shutdown();
3013 _result
3014 }
3015
3016 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3017 self.control_handle
3018 .inner
3019 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
3020 result,
3021 self.tx_id,
3022 0x33c92316f251e4e4,
3023 fidl::encoding::DynamicFlags::empty(),
3024 )
3025 }
3026}
3027
3028#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3029pub struct LightServiceMarker;
3030
3031#[cfg(target_os = "fuchsia")]
3032impl fidl::endpoints::ServiceMarker for LightServiceMarker {
3033 type Proxy = LightServiceProxy;
3034 type Request = LightServiceRequest;
3035 const SERVICE_NAME: &'static str = "fuchsia.hardware.light.LightService";
3036}
3037
3038#[cfg(target_os = "fuchsia")]
3041pub enum LightServiceRequest {
3042 Light(LightRequestStream),
3043}
3044
3045#[cfg(target_os = "fuchsia")]
3046impl fidl::endpoints::ServiceRequest for LightServiceRequest {
3047 type Service = LightServiceMarker;
3048
3049 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3050 match name {
3051 "light" => Self::Light(
3052 <LightRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3053 ),
3054 _ => panic!("no such member protocol name for service LightService"),
3055 }
3056 }
3057
3058 fn member_names() -> &'static [&'static str] {
3059 &["light"]
3060 }
3061}
3062#[cfg(target_os = "fuchsia")]
3063pub struct LightServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3064
3065#[cfg(target_os = "fuchsia")]
3066impl fidl::endpoints::ServiceProxy for LightServiceProxy {
3067 type Service = LightServiceMarker;
3068
3069 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3070 Self(opener)
3071 }
3072}
3073
3074#[cfg(target_os = "fuchsia")]
3075impl LightServiceProxy {
3076 pub fn connect_to_light(&self) -> Result<LightProxy, fidl::Error> {
3077 let (proxy, server_end) = fidl::endpoints::create_proxy::<LightMarker>();
3078 self.connect_channel_to_light(server_end)?;
3079 Ok(proxy)
3080 }
3081
3082 pub fn connect_to_light_sync(&self) -> Result<LightSynchronousProxy, fidl::Error> {
3085 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<LightMarker>();
3086 self.connect_channel_to_light(server_end)?;
3087 Ok(proxy)
3088 }
3089
3090 pub fn connect_channel_to_light(
3093 &self,
3094 server_end: fidl::endpoints::ServerEnd<LightMarker>,
3095 ) -> Result<(), fidl::Error> {
3096 self.0.open_member("light", server_end.into_channel())
3097 }
3098
3099 pub fn instance_name(&self) -> &str {
3100 self.0.instance_name()
3101 }
3102}
3103
3104mod internal {
3105 use super::*;
3106}