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 {
1733 Some((responder))
1734 } else {
1735 None
1736 }
1737 }
1738
1739 #[allow(irrefutable_let_patterns)]
1740 pub fn into_get_num_light_groups(self) -> Option<(LightGetNumLightGroupsResponder)> {
1741 if let LightRequest::GetNumLightGroups { responder } = self {
1742 Some((responder))
1743 } else {
1744 None
1745 }
1746 }
1747
1748 #[allow(irrefutable_let_patterns)]
1749 pub fn into_get_info(self) -> Option<(u32, LightGetInfoResponder)> {
1750 if let LightRequest::GetInfo { index, responder } = self {
1751 Some((index, responder))
1752 } else {
1753 None
1754 }
1755 }
1756
1757 #[allow(irrefutable_let_patterns)]
1758 pub fn into_get_current_simple_value(
1759 self,
1760 ) -> Option<(u32, LightGetCurrentSimpleValueResponder)> {
1761 if let LightRequest::GetCurrentSimpleValue { index, responder } = self {
1762 Some((index, responder))
1763 } else {
1764 None
1765 }
1766 }
1767
1768 #[allow(irrefutable_let_patterns)]
1769 pub fn into_set_simple_value(self) -> Option<(u32, bool, LightSetSimpleValueResponder)> {
1770 if let LightRequest::SetSimpleValue { index, value, responder } = self {
1771 Some((index, value, responder))
1772 } else {
1773 None
1774 }
1775 }
1776
1777 #[allow(irrefutable_let_patterns)]
1778 pub fn into_get_current_brightness_value(
1779 self,
1780 ) -> Option<(u32, LightGetCurrentBrightnessValueResponder)> {
1781 if let LightRequest::GetCurrentBrightnessValue { index, responder } = self {
1782 Some((index, responder))
1783 } else {
1784 None
1785 }
1786 }
1787
1788 #[allow(irrefutable_let_patterns)]
1789 pub fn into_set_brightness_value(self) -> Option<(u32, f64, LightSetBrightnessValueResponder)> {
1790 if let LightRequest::SetBrightnessValue { index, value, responder } = self {
1791 Some((index, value, responder))
1792 } else {
1793 None
1794 }
1795 }
1796
1797 #[allow(irrefutable_let_patterns)]
1798 pub fn into_get_current_rgb_value(self) -> Option<(u32, LightGetCurrentRgbValueResponder)> {
1799 if let LightRequest::GetCurrentRgbValue { index, responder } = self {
1800 Some((index, responder))
1801 } else {
1802 None
1803 }
1804 }
1805
1806 #[allow(irrefutable_let_patterns)]
1807 pub fn into_set_rgb_value(self) -> Option<(u32, Rgb, LightSetRgbValueResponder)> {
1808 if let LightRequest::SetRgbValue { index, value, responder } = self {
1809 Some((index, value, responder))
1810 } else {
1811 None
1812 }
1813 }
1814
1815 #[allow(irrefutable_let_patterns)]
1816 pub fn into_get_group_info(self) -> Option<(u32, LightGetGroupInfoResponder)> {
1817 if let LightRequest::GetGroupInfo { group_id, responder } = self {
1818 Some((group_id, responder))
1819 } else {
1820 None
1821 }
1822 }
1823
1824 #[allow(irrefutable_let_patterns)]
1825 pub fn into_get_group_current_simple_value(
1826 self,
1827 ) -> Option<(u32, LightGetGroupCurrentSimpleValueResponder)> {
1828 if let LightRequest::GetGroupCurrentSimpleValue { group_id, responder } = self {
1829 Some((group_id, responder))
1830 } else {
1831 None
1832 }
1833 }
1834
1835 #[allow(irrefutable_let_patterns)]
1836 pub fn into_set_group_simple_value(
1837 self,
1838 ) -> Option<(u32, Vec<bool>, LightSetGroupSimpleValueResponder)> {
1839 if let LightRequest::SetGroupSimpleValue { group_id, values, responder } = self {
1840 Some((group_id, values, responder))
1841 } else {
1842 None
1843 }
1844 }
1845
1846 #[allow(irrefutable_let_patterns)]
1847 pub fn into_get_group_current_brightness_value(
1848 self,
1849 ) -> Option<(u32, LightGetGroupCurrentBrightnessValueResponder)> {
1850 if let LightRequest::GetGroupCurrentBrightnessValue { group_id, responder } = self {
1851 Some((group_id, responder))
1852 } else {
1853 None
1854 }
1855 }
1856
1857 #[allow(irrefutable_let_patterns)]
1858 pub fn into_set_group_brightness_value(
1859 self,
1860 ) -> Option<(u32, Vec<f64>, LightSetGroupBrightnessValueResponder)> {
1861 if let LightRequest::SetGroupBrightnessValue { group_id, values, responder } = self {
1862 Some((group_id, values, responder))
1863 } else {
1864 None
1865 }
1866 }
1867
1868 #[allow(irrefutable_let_patterns)]
1869 pub fn into_get_group_current_rgb_value(
1870 self,
1871 ) -> Option<(u32, LightGetGroupCurrentRgbValueResponder)> {
1872 if let LightRequest::GetGroupCurrentRgbValue { group_id, responder } = self {
1873 Some((group_id, responder))
1874 } else {
1875 None
1876 }
1877 }
1878
1879 #[allow(irrefutable_let_patterns)]
1880 pub fn into_set_group_rgb_value(
1881 self,
1882 ) -> Option<(u32, Vec<Rgb>, LightSetGroupRgbValueResponder)> {
1883 if let LightRequest::SetGroupRgbValue { group_id, values, responder } = self {
1884 Some((group_id, values, responder))
1885 } else {
1886 None
1887 }
1888 }
1889
1890 pub fn method_name(&self) -> &'static str {
1892 match *self {
1893 LightRequest::GetNumLights { .. } => "get_num_lights",
1894 LightRequest::GetNumLightGroups { .. } => "get_num_light_groups",
1895 LightRequest::GetInfo { .. } => "get_info",
1896 LightRequest::GetCurrentSimpleValue { .. } => "get_current_simple_value",
1897 LightRequest::SetSimpleValue { .. } => "set_simple_value",
1898 LightRequest::GetCurrentBrightnessValue { .. } => "get_current_brightness_value",
1899 LightRequest::SetBrightnessValue { .. } => "set_brightness_value",
1900 LightRequest::GetCurrentRgbValue { .. } => "get_current_rgb_value",
1901 LightRequest::SetRgbValue { .. } => "set_rgb_value",
1902 LightRequest::GetGroupInfo { .. } => "get_group_info",
1903 LightRequest::GetGroupCurrentSimpleValue { .. } => "get_group_current_simple_value",
1904 LightRequest::SetGroupSimpleValue { .. } => "set_group_simple_value",
1905 LightRequest::GetGroupCurrentBrightnessValue { .. } => {
1906 "get_group_current_brightness_value"
1907 }
1908 LightRequest::SetGroupBrightnessValue { .. } => "set_group_brightness_value",
1909 LightRequest::GetGroupCurrentRgbValue { .. } => "get_group_current_rgb_value",
1910 LightRequest::SetGroupRgbValue { .. } => "set_group_rgb_value",
1911 }
1912 }
1913}
1914
1915#[derive(Debug, Clone)]
1916pub struct LightControlHandle {
1917 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1918}
1919
1920impl fidl::endpoints::ControlHandle for LightControlHandle {
1921 fn shutdown(&self) {
1922 self.inner.shutdown()
1923 }
1924 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1925 self.inner.shutdown_with_epitaph(status)
1926 }
1927
1928 fn is_closed(&self) -> bool {
1929 self.inner.channel().is_closed()
1930 }
1931 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1932 self.inner.channel().on_closed()
1933 }
1934
1935 #[cfg(target_os = "fuchsia")]
1936 fn signal_peer(
1937 &self,
1938 clear_mask: zx::Signals,
1939 set_mask: zx::Signals,
1940 ) -> Result<(), zx_status::Status> {
1941 use fidl::Peered;
1942 self.inner.channel().signal_peer(clear_mask, set_mask)
1943 }
1944}
1945
1946impl LightControlHandle {}
1947
1948#[must_use = "FIDL methods require a response to be sent"]
1949#[derive(Debug)]
1950pub struct LightGetNumLightsResponder {
1951 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
1952 tx_id: u32,
1953}
1954
1955impl std::ops::Drop for LightGetNumLightsResponder {
1959 fn drop(&mut self) {
1960 self.control_handle.shutdown();
1961 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1963 }
1964}
1965
1966impl fidl::endpoints::Responder for LightGetNumLightsResponder {
1967 type ControlHandle = LightControlHandle;
1968
1969 fn control_handle(&self) -> &LightControlHandle {
1970 &self.control_handle
1971 }
1972
1973 fn drop_without_shutdown(mut self) {
1974 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1976 std::mem::forget(self);
1978 }
1979}
1980
1981impl LightGetNumLightsResponder {
1982 pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
1986 let _result = self.send_raw(count);
1987 if _result.is_err() {
1988 self.control_handle.shutdown();
1989 }
1990 self.drop_without_shutdown();
1991 _result
1992 }
1993
1994 pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
1996 let _result = self.send_raw(count);
1997 self.drop_without_shutdown();
1998 _result
1999 }
2000
2001 fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
2002 self.control_handle.inner.send::<LightGetNumLightsResponse>(
2003 (count,),
2004 self.tx_id,
2005 0x7ae2bd2ef8062dbb,
2006 fidl::encoding::DynamicFlags::empty(),
2007 )
2008 }
2009}
2010
2011#[must_use = "FIDL methods require a response to be sent"]
2012#[derive(Debug)]
2013pub struct LightGetNumLightGroupsResponder {
2014 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2015 tx_id: u32,
2016}
2017
2018impl std::ops::Drop for LightGetNumLightGroupsResponder {
2022 fn drop(&mut self) {
2023 self.control_handle.shutdown();
2024 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2026 }
2027}
2028
2029impl fidl::endpoints::Responder for LightGetNumLightGroupsResponder {
2030 type ControlHandle = LightControlHandle;
2031
2032 fn control_handle(&self) -> &LightControlHandle {
2033 &self.control_handle
2034 }
2035
2036 fn drop_without_shutdown(mut self) {
2037 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2039 std::mem::forget(self);
2041 }
2042}
2043
2044impl LightGetNumLightGroupsResponder {
2045 pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
2049 let _result = self.send_raw(count);
2050 if _result.is_err() {
2051 self.control_handle.shutdown();
2052 }
2053 self.drop_without_shutdown();
2054 _result
2055 }
2056
2057 pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
2059 let _result = self.send_raw(count);
2060 self.drop_without_shutdown();
2061 _result
2062 }
2063
2064 fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
2065 self.control_handle.inner.send::<LightGetNumLightGroupsResponse>(
2066 (count,),
2067 self.tx_id,
2068 0x600895db5a7cbf0,
2069 fidl::encoding::DynamicFlags::empty(),
2070 )
2071 }
2072}
2073
2074#[must_use = "FIDL methods require a response to be sent"]
2075#[derive(Debug)]
2076pub struct LightGetInfoResponder {
2077 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2078 tx_id: u32,
2079}
2080
2081impl std::ops::Drop for LightGetInfoResponder {
2085 fn drop(&mut self) {
2086 self.control_handle.shutdown();
2087 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2089 }
2090}
2091
2092impl fidl::endpoints::Responder for LightGetInfoResponder {
2093 type ControlHandle = LightControlHandle;
2094
2095 fn control_handle(&self) -> &LightControlHandle {
2096 &self.control_handle
2097 }
2098
2099 fn drop_without_shutdown(mut self) {
2100 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2102 std::mem::forget(self);
2104 }
2105}
2106
2107impl LightGetInfoResponder {
2108 pub fn send(self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2112 let _result = self.send_raw(result);
2113 if _result.is_err() {
2114 self.control_handle.shutdown();
2115 }
2116 self.drop_without_shutdown();
2117 _result
2118 }
2119
2120 pub fn send_no_shutdown_on_err(
2122 self,
2123 mut result: Result<&Info, LightError>,
2124 ) -> Result<(), fidl::Error> {
2125 let _result = self.send_raw(result);
2126 self.drop_without_shutdown();
2127 _result
2128 }
2129
2130 fn send_raw(&self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2131 self.control_handle
2132 .inner
2133 .send::<fidl::encoding::ResultType<LightGetInfoResponse, LightError>>(
2134 result.map(|info| (info,)),
2135 self.tx_id,
2136 0x4229b55c8c4bd529,
2137 fidl::encoding::DynamicFlags::empty(),
2138 )
2139 }
2140}
2141
2142#[must_use = "FIDL methods require a response to be sent"]
2143#[derive(Debug)]
2144pub struct LightGetCurrentSimpleValueResponder {
2145 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2146 tx_id: u32,
2147}
2148
2149impl std::ops::Drop for LightGetCurrentSimpleValueResponder {
2153 fn drop(&mut self) {
2154 self.control_handle.shutdown();
2155 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2157 }
2158}
2159
2160impl fidl::endpoints::Responder for LightGetCurrentSimpleValueResponder {
2161 type ControlHandle = LightControlHandle;
2162
2163 fn control_handle(&self) -> &LightControlHandle {
2164 &self.control_handle
2165 }
2166
2167 fn drop_without_shutdown(mut self) {
2168 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2170 std::mem::forget(self);
2172 }
2173}
2174
2175impl LightGetCurrentSimpleValueResponder {
2176 pub fn send(self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2180 let _result = self.send_raw(result);
2181 if _result.is_err() {
2182 self.control_handle.shutdown();
2183 }
2184 self.drop_without_shutdown();
2185 _result
2186 }
2187
2188 pub fn send_no_shutdown_on_err(
2190 self,
2191 mut result: Result<bool, LightError>,
2192 ) -> Result<(), fidl::Error> {
2193 let _result = self.send_raw(result);
2194 self.drop_without_shutdown();
2195 _result
2196 }
2197
2198 fn send_raw(&self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2199 self.control_handle.inner.send::<fidl::encoding::ResultType<
2200 LightGetCurrentSimpleValueResponse,
2201 LightError,
2202 >>(
2203 result.map(|value| (value,)),
2204 self.tx_id,
2205 0x183154896336c321,
2206 fidl::encoding::DynamicFlags::empty(),
2207 )
2208 }
2209}
2210
2211#[must_use = "FIDL methods require a response to be sent"]
2212#[derive(Debug)]
2213pub struct LightSetSimpleValueResponder {
2214 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2215 tx_id: u32,
2216}
2217
2218impl std::ops::Drop for LightSetSimpleValueResponder {
2222 fn drop(&mut self) {
2223 self.control_handle.shutdown();
2224 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2226 }
2227}
2228
2229impl fidl::endpoints::Responder for LightSetSimpleValueResponder {
2230 type ControlHandle = LightControlHandle;
2231
2232 fn control_handle(&self) -> &LightControlHandle {
2233 &self.control_handle
2234 }
2235
2236 fn drop_without_shutdown(mut self) {
2237 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2239 std::mem::forget(self);
2241 }
2242}
2243
2244impl LightSetSimpleValueResponder {
2245 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2249 let _result = self.send_raw(result);
2250 if _result.is_err() {
2251 self.control_handle.shutdown();
2252 }
2253 self.drop_without_shutdown();
2254 _result
2255 }
2256
2257 pub fn send_no_shutdown_on_err(
2259 self,
2260 mut result: Result<(), LightError>,
2261 ) -> Result<(), fidl::Error> {
2262 let _result = self.send_raw(result);
2263 self.drop_without_shutdown();
2264 _result
2265 }
2266
2267 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2268 self.control_handle
2269 .inner
2270 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2271 result,
2272 self.tx_id,
2273 0x4fb33d84c1aad81d,
2274 fidl::encoding::DynamicFlags::empty(),
2275 )
2276 }
2277}
2278
2279#[must_use = "FIDL methods require a response to be sent"]
2280#[derive(Debug)]
2281pub struct LightGetCurrentBrightnessValueResponder {
2282 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2283 tx_id: u32,
2284}
2285
2286impl std::ops::Drop for LightGetCurrentBrightnessValueResponder {
2290 fn drop(&mut self) {
2291 self.control_handle.shutdown();
2292 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2294 }
2295}
2296
2297impl fidl::endpoints::Responder for LightGetCurrentBrightnessValueResponder {
2298 type ControlHandle = LightControlHandle;
2299
2300 fn control_handle(&self) -> &LightControlHandle {
2301 &self.control_handle
2302 }
2303
2304 fn drop_without_shutdown(mut self) {
2305 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2307 std::mem::forget(self);
2309 }
2310}
2311
2312impl LightGetCurrentBrightnessValueResponder {
2313 pub fn send(self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2317 let _result = self.send_raw(result);
2318 if _result.is_err() {
2319 self.control_handle.shutdown();
2320 }
2321 self.drop_without_shutdown();
2322 _result
2323 }
2324
2325 pub fn send_no_shutdown_on_err(
2327 self,
2328 mut result: Result<f64, LightError>,
2329 ) -> Result<(), fidl::Error> {
2330 let _result = self.send_raw(result);
2331 self.drop_without_shutdown();
2332 _result
2333 }
2334
2335 fn send_raw(&self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2336 self.control_handle.inner.send::<fidl::encoding::ResultType<
2337 LightGetCurrentBrightnessValueResponse,
2338 LightError,
2339 >>(
2340 result.map(|value| (value,)),
2341 self.tx_id,
2342 0x2d387e129fe84809,
2343 fidl::encoding::DynamicFlags::empty(),
2344 )
2345 }
2346}
2347
2348#[must_use = "FIDL methods require a response to be sent"]
2349#[derive(Debug)]
2350pub struct LightSetBrightnessValueResponder {
2351 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2352 tx_id: u32,
2353}
2354
2355impl std::ops::Drop for LightSetBrightnessValueResponder {
2359 fn drop(&mut self) {
2360 self.control_handle.shutdown();
2361 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2363 }
2364}
2365
2366impl fidl::endpoints::Responder for LightSetBrightnessValueResponder {
2367 type ControlHandle = LightControlHandle;
2368
2369 fn control_handle(&self) -> &LightControlHandle {
2370 &self.control_handle
2371 }
2372
2373 fn drop_without_shutdown(mut self) {
2374 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2376 std::mem::forget(self);
2378 }
2379}
2380
2381impl LightSetBrightnessValueResponder {
2382 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2386 let _result = self.send_raw(result);
2387 if _result.is_err() {
2388 self.control_handle.shutdown();
2389 }
2390 self.drop_without_shutdown();
2391 _result
2392 }
2393
2394 pub fn send_no_shutdown_on_err(
2396 self,
2397 mut result: Result<(), LightError>,
2398 ) -> Result<(), fidl::Error> {
2399 let _result = self.send_raw(result);
2400 self.drop_without_shutdown();
2401 _result
2402 }
2403
2404 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2405 self.control_handle
2406 .inner
2407 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2408 result,
2409 self.tx_id,
2410 0x17cada93c7c48661,
2411 fidl::encoding::DynamicFlags::empty(),
2412 )
2413 }
2414}
2415
2416#[must_use = "FIDL methods require a response to be sent"]
2417#[derive(Debug)]
2418pub struct LightGetCurrentRgbValueResponder {
2419 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2420 tx_id: u32,
2421}
2422
2423impl std::ops::Drop for LightGetCurrentRgbValueResponder {
2427 fn drop(&mut self) {
2428 self.control_handle.shutdown();
2429 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2431 }
2432}
2433
2434impl fidl::endpoints::Responder for LightGetCurrentRgbValueResponder {
2435 type ControlHandle = LightControlHandle;
2436
2437 fn control_handle(&self) -> &LightControlHandle {
2438 &self.control_handle
2439 }
2440
2441 fn drop_without_shutdown(mut self) {
2442 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2444 std::mem::forget(self);
2446 }
2447}
2448
2449impl LightGetCurrentRgbValueResponder {
2450 pub fn send(self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2454 let _result = self.send_raw(result);
2455 if _result.is_err() {
2456 self.control_handle.shutdown();
2457 }
2458 self.drop_without_shutdown();
2459 _result
2460 }
2461
2462 pub fn send_no_shutdown_on_err(
2464 self,
2465 mut result: Result<&Rgb, LightError>,
2466 ) -> Result<(), fidl::Error> {
2467 let _result = self.send_raw(result);
2468 self.drop_without_shutdown();
2469 _result
2470 }
2471
2472 fn send_raw(&self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2473 self.control_handle.inner.send::<fidl::encoding::ResultType<
2474 LightGetCurrentRgbValueResponse,
2475 LightError,
2476 >>(
2477 result.map(|value| (value,)),
2478 self.tx_id,
2479 0x49965ac0d920f4ad,
2480 fidl::encoding::DynamicFlags::empty(),
2481 )
2482 }
2483}
2484
2485#[must_use = "FIDL methods require a response to be sent"]
2486#[derive(Debug)]
2487pub struct LightSetRgbValueResponder {
2488 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2489 tx_id: u32,
2490}
2491
2492impl std::ops::Drop for LightSetRgbValueResponder {
2496 fn drop(&mut self) {
2497 self.control_handle.shutdown();
2498 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2500 }
2501}
2502
2503impl fidl::endpoints::Responder for LightSetRgbValueResponder {
2504 type ControlHandle = LightControlHandle;
2505
2506 fn control_handle(&self) -> &LightControlHandle {
2507 &self.control_handle
2508 }
2509
2510 fn drop_without_shutdown(mut self) {
2511 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2513 std::mem::forget(self);
2515 }
2516}
2517
2518impl LightSetRgbValueResponder {
2519 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2523 let _result = self.send_raw(result);
2524 if _result.is_err() {
2525 self.control_handle.shutdown();
2526 }
2527 self.drop_without_shutdown();
2528 _result
2529 }
2530
2531 pub fn send_no_shutdown_on_err(
2533 self,
2534 mut result: Result<(), LightError>,
2535 ) -> Result<(), fidl::Error> {
2536 let _result = self.send_raw(result);
2537 self.drop_without_shutdown();
2538 _result
2539 }
2540
2541 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2542 self.control_handle
2543 .inner
2544 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2545 result,
2546 self.tx_id,
2547 0x2b354d18be0b70a4,
2548 fidl::encoding::DynamicFlags::empty(),
2549 )
2550 }
2551}
2552
2553#[must_use = "FIDL methods require a response to be sent"]
2554#[derive(Debug)]
2555pub struct LightGetGroupInfoResponder {
2556 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2557 tx_id: u32,
2558}
2559
2560impl std::ops::Drop for LightGetGroupInfoResponder {
2564 fn drop(&mut self) {
2565 self.control_handle.shutdown();
2566 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2568 }
2569}
2570
2571impl fidl::endpoints::Responder for LightGetGroupInfoResponder {
2572 type ControlHandle = LightControlHandle;
2573
2574 fn control_handle(&self) -> &LightControlHandle {
2575 &self.control_handle
2576 }
2577
2578 fn drop_without_shutdown(mut self) {
2579 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2581 std::mem::forget(self);
2583 }
2584}
2585
2586impl LightGetGroupInfoResponder {
2587 pub fn send(self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2591 let _result = self.send_raw(result);
2592 if _result.is_err() {
2593 self.control_handle.shutdown();
2594 }
2595 self.drop_without_shutdown();
2596 _result
2597 }
2598
2599 pub fn send_no_shutdown_on_err(
2601 self,
2602 mut result: Result<&GroupInfo, LightError>,
2603 ) -> Result<(), fidl::Error> {
2604 let _result = self.send_raw(result);
2605 self.drop_without_shutdown();
2606 _result
2607 }
2608
2609 fn send_raw(&self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2610 self.control_handle
2611 .inner
2612 .send::<fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>>(
2613 result.map(|info| (info,)),
2614 self.tx_id,
2615 0x5b27b0ca755b470b,
2616 fidl::encoding::DynamicFlags::empty(),
2617 )
2618 }
2619}
2620
2621#[must_use = "FIDL methods require a response to be sent"]
2622#[derive(Debug)]
2623pub struct LightGetGroupCurrentSimpleValueResponder {
2624 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2625 tx_id: u32,
2626}
2627
2628impl std::ops::Drop for LightGetGroupCurrentSimpleValueResponder {
2632 fn drop(&mut self) {
2633 self.control_handle.shutdown();
2634 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2636 }
2637}
2638
2639impl fidl::endpoints::Responder for LightGetGroupCurrentSimpleValueResponder {
2640 type ControlHandle = LightControlHandle;
2641
2642 fn control_handle(&self) -> &LightControlHandle {
2643 &self.control_handle
2644 }
2645
2646 fn drop_without_shutdown(mut self) {
2647 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2649 std::mem::forget(self);
2651 }
2652}
2653
2654impl LightGetGroupCurrentSimpleValueResponder {
2655 pub fn send(self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2659 let _result = self.send_raw(result);
2660 if _result.is_err() {
2661 self.control_handle.shutdown();
2662 }
2663 self.drop_without_shutdown();
2664 _result
2665 }
2666
2667 pub fn send_no_shutdown_on_err(
2669 self,
2670 mut result: Result<Option<&[bool]>, LightError>,
2671 ) -> Result<(), fidl::Error> {
2672 let _result = self.send_raw(result);
2673 self.drop_without_shutdown();
2674 _result
2675 }
2676
2677 fn send_raw(&self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2678 self.control_handle.inner.send::<fidl::encoding::ResultType<
2679 LightGetGroupCurrentSimpleValueResponse,
2680 LightError,
2681 >>(
2682 result.map(|values| (values,)),
2683 self.tx_id,
2684 0x659d9bdb5cc2201,
2685 fidl::encoding::DynamicFlags::empty(),
2686 )
2687 }
2688}
2689
2690#[must_use = "FIDL methods require a response to be sent"]
2691#[derive(Debug)]
2692pub struct LightSetGroupSimpleValueResponder {
2693 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2694 tx_id: u32,
2695}
2696
2697impl std::ops::Drop for LightSetGroupSimpleValueResponder {
2701 fn drop(&mut self) {
2702 self.control_handle.shutdown();
2703 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2705 }
2706}
2707
2708impl fidl::endpoints::Responder for LightSetGroupSimpleValueResponder {
2709 type ControlHandle = LightControlHandle;
2710
2711 fn control_handle(&self) -> &LightControlHandle {
2712 &self.control_handle
2713 }
2714
2715 fn drop_without_shutdown(mut self) {
2716 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2718 std::mem::forget(self);
2720 }
2721}
2722
2723impl LightSetGroupSimpleValueResponder {
2724 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2728 let _result = self.send_raw(result);
2729 if _result.is_err() {
2730 self.control_handle.shutdown();
2731 }
2732 self.drop_without_shutdown();
2733 _result
2734 }
2735
2736 pub fn send_no_shutdown_on_err(
2738 self,
2739 mut result: Result<(), LightError>,
2740 ) -> Result<(), fidl::Error> {
2741 let _result = self.send_raw(result);
2742 self.drop_without_shutdown();
2743 _result
2744 }
2745
2746 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2747 self.control_handle
2748 .inner
2749 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2750 result,
2751 self.tx_id,
2752 0x924234e74cc6dd8,
2753 fidl::encoding::DynamicFlags::empty(),
2754 )
2755 }
2756}
2757
2758#[must_use = "FIDL methods require a response to be sent"]
2759#[derive(Debug)]
2760pub struct LightGetGroupCurrentBrightnessValueResponder {
2761 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2762 tx_id: u32,
2763}
2764
2765impl std::ops::Drop for LightGetGroupCurrentBrightnessValueResponder {
2769 fn drop(&mut self) {
2770 self.control_handle.shutdown();
2771 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2773 }
2774}
2775
2776impl fidl::endpoints::Responder for LightGetGroupCurrentBrightnessValueResponder {
2777 type ControlHandle = LightControlHandle;
2778
2779 fn control_handle(&self) -> &LightControlHandle {
2780 &self.control_handle
2781 }
2782
2783 fn drop_without_shutdown(mut self) {
2784 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2786 std::mem::forget(self);
2788 }
2789}
2790
2791impl LightGetGroupCurrentBrightnessValueResponder {
2792 pub fn send(self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
2796 let _result = self.send_raw(result);
2797 if _result.is_err() {
2798 self.control_handle.shutdown();
2799 }
2800 self.drop_without_shutdown();
2801 _result
2802 }
2803
2804 pub fn send_no_shutdown_on_err(
2806 self,
2807 mut result: Result<Option<&[f64]>, LightError>,
2808 ) -> Result<(), fidl::Error> {
2809 let _result = self.send_raw(result);
2810 self.drop_without_shutdown();
2811 _result
2812 }
2813
2814 fn send_raw(&self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
2815 self.control_handle.inner.send::<fidl::encoding::ResultType<
2816 LightGetGroupCurrentBrightnessValueResponse,
2817 LightError,
2818 >>(
2819 result.map(|values| (values,)),
2820 self.tx_id,
2821 0x3ab226120b0d0362,
2822 fidl::encoding::DynamicFlags::empty(),
2823 )
2824 }
2825}
2826
2827#[must_use = "FIDL methods require a response to be sent"]
2828#[derive(Debug)]
2829pub struct LightSetGroupBrightnessValueResponder {
2830 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2831 tx_id: u32,
2832}
2833
2834impl std::ops::Drop for LightSetGroupBrightnessValueResponder {
2838 fn drop(&mut self) {
2839 self.control_handle.shutdown();
2840 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2842 }
2843}
2844
2845impl fidl::endpoints::Responder for LightSetGroupBrightnessValueResponder {
2846 type ControlHandle = LightControlHandle;
2847
2848 fn control_handle(&self) -> &LightControlHandle {
2849 &self.control_handle
2850 }
2851
2852 fn drop_without_shutdown(mut self) {
2853 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2855 std::mem::forget(self);
2857 }
2858}
2859
2860impl LightSetGroupBrightnessValueResponder {
2861 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2865 let _result = self.send_raw(result);
2866 if _result.is_err() {
2867 self.control_handle.shutdown();
2868 }
2869 self.drop_without_shutdown();
2870 _result
2871 }
2872
2873 pub fn send_no_shutdown_on_err(
2875 self,
2876 mut result: Result<(), LightError>,
2877 ) -> Result<(), fidl::Error> {
2878 let _result = self.send_raw(result);
2879 self.drop_without_shutdown();
2880 _result
2881 }
2882
2883 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2884 self.control_handle
2885 .inner
2886 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2887 result,
2888 self.tx_id,
2889 0x79e5f248fc5ec7ae,
2890 fidl::encoding::DynamicFlags::empty(),
2891 )
2892 }
2893}
2894
2895#[must_use = "FIDL methods require a response to be sent"]
2896#[derive(Debug)]
2897pub struct LightGetGroupCurrentRgbValueResponder {
2898 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2899 tx_id: u32,
2900}
2901
2902impl std::ops::Drop for LightGetGroupCurrentRgbValueResponder {
2906 fn drop(&mut self) {
2907 self.control_handle.shutdown();
2908 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2910 }
2911}
2912
2913impl fidl::endpoints::Responder for LightGetGroupCurrentRgbValueResponder {
2914 type ControlHandle = LightControlHandle;
2915
2916 fn control_handle(&self) -> &LightControlHandle {
2917 &self.control_handle
2918 }
2919
2920 fn drop_without_shutdown(mut self) {
2921 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2923 std::mem::forget(self);
2925 }
2926}
2927
2928impl LightGetGroupCurrentRgbValueResponder {
2929 pub fn send(self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
2933 let _result = self.send_raw(result);
2934 if _result.is_err() {
2935 self.control_handle.shutdown();
2936 }
2937 self.drop_without_shutdown();
2938 _result
2939 }
2940
2941 pub fn send_no_shutdown_on_err(
2943 self,
2944 mut result: Result<Option<&[Rgb]>, LightError>,
2945 ) -> Result<(), fidl::Error> {
2946 let _result = self.send_raw(result);
2947 self.drop_without_shutdown();
2948 _result
2949 }
2950
2951 fn send_raw(&self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
2952 self.control_handle.inner.send::<fidl::encoding::ResultType<
2953 LightGetGroupCurrentRgbValueResponse,
2954 LightError,
2955 >>(
2956 result.map(|values| (values,)),
2957 self.tx_id,
2958 0x2a6014b41254f617,
2959 fidl::encoding::DynamicFlags::empty(),
2960 )
2961 }
2962}
2963
2964#[must_use = "FIDL methods require a response to be sent"]
2965#[derive(Debug)]
2966pub struct LightSetGroupRgbValueResponder {
2967 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2968 tx_id: u32,
2969}
2970
2971impl std::ops::Drop for LightSetGroupRgbValueResponder {
2975 fn drop(&mut self) {
2976 self.control_handle.shutdown();
2977 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2979 }
2980}
2981
2982impl fidl::endpoints::Responder for LightSetGroupRgbValueResponder {
2983 type ControlHandle = LightControlHandle;
2984
2985 fn control_handle(&self) -> &LightControlHandle {
2986 &self.control_handle
2987 }
2988
2989 fn drop_without_shutdown(mut self) {
2990 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2992 std::mem::forget(self);
2994 }
2995}
2996
2997impl LightSetGroupRgbValueResponder {
2998 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3002 let _result = self.send_raw(result);
3003 if _result.is_err() {
3004 self.control_handle.shutdown();
3005 }
3006 self.drop_without_shutdown();
3007 _result
3008 }
3009
3010 pub fn send_no_shutdown_on_err(
3012 self,
3013 mut result: Result<(), LightError>,
3014 ) -> Result<(), fidl::Error> {
3015 let _result = self.send_raw(result);
3016 self.drop_without_shutdown();
3017 _result
3018 }
3019
3020 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3021 self.control_handle
3022 .inner
3023 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
3024 result,
3025 self.tx_id,
3026 0x33c92316f251e4e4,
3027 fidl::encoding::DynamicFlags::empty(),
3028 )
3029 }
3030}
3031
3032#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3033pub struct LightServiceMarker;
3034
3035#[cfg(target_os = "fuchsia")]
3036impl fidl::endpoints::ServiceMarker for LightServiceMarker {
3037 type Proxy = LightServiceProxy;
3038 type Request = LightServiceRequest;
3039 const SERVICE_NAME: &'static str = "fuchsia.hardware.light.LightService";
3040}
3041
3042#[cfg(target_os = "fuchsia")]
3045pub enum LightServiceRequest {
3046 Light(LightRequestStream),
3047}
3048
3049#[cfg(target_os = "fuchsia")]
3050impl fidl::endpoints::ServiceRequest for LightServiceRequest {
3051 type Service = LightServiceMarker;
3052
3053 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3054 match name {
3055 "light" => Self::Light(
3056 <LightRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3057 ),
3058 _ => panic!("no such member protocol name for service LightService"),
3059 }
3060 }
3061
3062 fn member_names() -> &'static [&'static str] {
3063 &["light"]
3064 }
3065}
3066#[cfg(target_os = "fuchsia")]
3067pub struct LightServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3068
3069#[cfg(target_os = "fuchsia")]
3070impl fidl::endpoints::ServiceProxy for LightServiceProxy {
3071 type Service = LightServiceMarker;
3072
3073 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3074 Self(opener)
3075 }
3076}
3077
3078#[cfg(target_os = "fuchsia")]
3079impl LightServiceProxy {
3080 pub fn connect_to_light(&self) -> Result<LightProxy, fidl::Error> {
3081 let (proxy, server_end) = fidl::endpoints::create_proxy::<LightMarker>();
3082 self.connect_channel_to_light(server_end)?;
3083 Ok(proxy)
3084 }
3085
3086 pub fn connect_to_light_sync(&self) -> Result<LightSynchronousProxy, fidl::Error> {
3089 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<LightMarker>();
3090 self.connect_channel_to_light(server_end)?;
3091 Ok(proxy)
3092 }
3093
3094 pub fn connect_channel_to_light(
3097 &self,
3098 server_end: fidl::endpoints::ServerEnd<LightMarker>,
3099 ) -> Result<(), fidl::Error> {
3100 self.0.open_member("light", server_end.into_channel())
3101 }
3102
3103 pub fn instance_name(&self) -> &str {
3104 self.0.instance_name()
3105 }
3106}
3107
3108mod internal {
3109 use super::*;
3110}