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::NullableHandle {
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
1921 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1922 self.inner.shutdown_with_epitaph(status)
1923 }
1924
1925 fn is_closed(&self) -> bool {
1926 self.inner.channel().is_closed()
1927 }
1928 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1929 self.inner.channel().on_closed()
1930 }
1931
1932 #[cfg(target_os = "fuchsia")]
1933 fn signal_peer(
1934 &self,
1935 clear_mask: zx::Signals,
1936 set_mask: zx::Signals,
1937 ) -> Result<(), zx_status::Status> {
1938 use fidl::Peered;
1939 self.inner.channel().signal_peer(clear_mask, set_mask)
1940 }
1941}
1942
1943impl LightControlHandle {}
1944
1945#[must_use = "FIDL methods require a response to be sent"]
1946#[derive(Debug)]
1947pub struct LightGetNumLightsResponder {
1948 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
1949 tx_id: u32,
1950}
1951
1952impl std::ops::Drop for LightGetNumLightsResponder {
1956 fn drop(&mut self) {
1957 self.control_handle.shutdown();
1958 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1960 }
1961}
1962
1963impl fidl::endpoints::Responder for LightGetNumLightsResponder {
1964 type ControlHandle = LightControlHandle;
1965
1966 fn control_handle(&self) -> &LightControlHandle {
1967 &self.control_handle
1968 }
1969
1970 fn drop_without_shutdown(mut self) {
1971 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1973 std::mem::forget(self);
1975 }
1976}
1977
1978impl LightGetNumLightsResponder {
1979 pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
1983 let _result = self.send_raw(count);
1984 if _result.is_err() {
1985 self.control_handle.shutdown();
1986 }
1987 self.drop_without_shutdown();
1988 _result
1989 }
1990
1991 pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
1993 let _result = self.send_raw(count);
1994 self.drop_without_shutdown();
1995 _result
1996 }
1997
1998 fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
1999 self.control_handle.inner.send::<LightGetNumLightsResponse>(
2000 (count,),
2001 self.tx_id,
2002 0x7ae2bd2ef8062dbb,
2003 fidl::encoding::DynamicFlags::empty(),
2004 )
2005 }
2006}
2007
2008#[must_use = "FIDL methods require a response to be sent"]
2009#[derive(Debug)]
2010pub struct LightGetNumLightGroupsResponder {
2011 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2012 tx_id: u32,
2013}
2014
2015impl std::ops::Drop for LightGetNumLightGroupsResponder {
2019 fn drop(&mut self) {
2020 self.control_handle.shutdown();
2021 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2023 }
2024}
2025
2026impl fidl::endpoints::Responder for LightGetNumLightGroupsResponder {
2027 type ControlHandle = LightControlHandle;
2028
2029 fn control_handle(&self) -> &LightControlHandle {
2030 &self.control_handle
2031 }
2032
2033 fn drop_without_shutdown(mut self) {
2034 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2036 std::mem::forget(self);
2038 }
2039}
2040
2041impl LightGetNumLightGroupsResponder {
2042 pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
2046 let _result = self.send_raw(count);
2047 if _result.is_err() {
2048 self.control_handle.shutdown();
2049 }
2050 self.drop_without_shutdown();
2051 _result
2052 }
2053
2054 pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
2056 let _result = self.send_raw(count);
2057 self.drop_without_shutdown();
2058 _result
2059 }
2060
2061 fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
2062 self.control_handle.inner.send::<LightGetNumLightGroupsResponse>(
2063 (count,),
2064 self.tx_id,
2065 0x600895db5a7cbf0,
2066 fidl::encoding::DynamicFlags::empty(),
2067 )
2068 }
2069}
2070
2071#[must_use = "FIDL methods require a response to be sent"]
2072#[derive(Debug)]
2073pub struct LightGetInfoResponder {
2074 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2075 tx_id: u32,
2076}
2077
2078impl std::ops::Drop for LightGetInfoResponder {
2082 fn drop(&mut self) {
2083 self.control_handle.shutdown();
2084 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2086 }
2087}
2088
2089impl fidl::endpoints::Responder for LightGetInfoResponder {
2090 type ControlHandle = LightControlHandle;
2091
2092 fn control_handle(&self) -> &LightControlHandle {
2093 &self.control_handle
2094 }
2095
2096 fn drop_without_shutdown(mut self) {
2097 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2099 std::mem::forget(self);
2101 }
2102}
2103
2104impl LightGetInfoResponder {
2105 pub fn send(self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2109 let _result = self.send_raw(result);
2110 if _result.is_err() {
2111 self.control_handle.shutdown();
2112 }
2113 self.drop_without_shutdown();
2114 _result
2115 }
2116
2117 pub fn send_no_shutdown_on_err(
2119 self,
2120 mut result: Result<&Info, LightError>,
2121 ) -> Result<(), fidl::Error> {
2122 let _result = self.send_raw(result);
2123 self.drop_without_shutdown();
2124 _result
2125 }
2126
2127 fn send_raw(&self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2128 self.control_handle
2129 .inner
2130 .send::<fidl::encoding::ResultType<LightGetInfoResponse, LightError>>(
2131 result.map(|info| (info,)),
2132 self.tx_id,
2133 0x4229b55c8c4bd529,
2134 fidl::encoding::DynamicFlags::empty(),
2135 )
2136 }
2137}
2138
2139#[must_use = "FIDL methods require a response to be sent"]
2140#[derive(Debug)]
2141pub struct LightGetCurrentSimpleValueResponder {
2142 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2143 tx_id: u32,
2144}
2145
2146impl std::ops::Drop for LightGetCurrentSimpleValueResponder {
2150 fn drop(&mut self) {
2151 self.control_handle.shutdown();
2152 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2154 }
2155}
2156
2157impl fidl::endpoints::Responder for LightGetCurrentSimpleValueResponder {
2158 type ControlHandle = LightControlHandle;
2159
2160 fn control_handle(&self) -> &LightControlHandle {
2161 &self.control_handle
2162 }
2163
2164 fn drop_without_shutdown(mut self) {
2165 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2167 std::mem::forget(self);
2169 }
2170}
2171
2172impl LightGetCurrentSimpleValueResponder {
2173 pub fn send(self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2177 let _result = self.send_raw(result);
2178 if _result.is_err() {
2179 self.control_handle.shutdown();
2180 }
2181 self.drop_without_shutdown();
2182 _result
2183 }
2184
2185 pub fn send_no_shutdown_on_err(
2187 self,
2188 mut result: Result<bool, LightError>,
2189 ) -> Result<(), fidl::Error> {
2190 let _result = self.send_raw(result);
2191 self.drop_without_shutdown();
2192 _result
2193 }
2194
2195 fn send_raw(&self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2196 self.control_handle.inner.send::<fidl::encoding::ResultType<
2197 LightGetCurrentSimpleValueResponse,
2198 LightError,
2199 >>(
2200 result.map(|value| (value,)),
2201 self.tx_id,
2202 0x183154896336c321,
2203 fidl::encoding::DynamicFlags::empty(),
2204 )
2205 }
2206}
2207
2208#[must_use = "FIDL methods require a response to be sent"]
2209#[derive(Debug)]
2210pub struct LightSetSimpleValueResponder {
2211 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2212 tx_id: u32,
2213}
2214
2215impl std::ops::Drop for LightSetSimpleValueResponder {
2219 fn drop(&mut self) {
2220 self.control_handle.shutdown();
2221 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2223 }
2224}
2225
2226impl fidl::endpoints::Responder for LightSetSimpleValueResponder {
2227 type ControlHandle = LightControlHandle;
2228
2229 fn control_handle(&self) -> &LightControlHandle {
2230 &self.control_handle
2231 }
2232
2233 fn drop_without_shutdown(mut self) {
2234 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2236 std::mem::forget(self);
2238 }
2239}
2240
2241impl LightSetSimpleValueResponder {
2242 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2246 let _result = self.send_raw(result);
2247 if _result.is_err() {
2248 self.control_handle.shutdown();
2249 }
2250 self.drop_without_shutdown();
2251 _result
2252 }
2253
2254 pub fn send_no_shutdown_on_err(
2256 self,
2257 mut result: Result<(), LightError>,
2258 ) -> Result<(), fidl::Error> {
2259 let _result = self.send_raw(result);
2260 self.drop_without_shutdown();
2261 _result
2262 }
2263
2264 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2265 self.control_handle
2266 .inner
2267 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2268 result,
2269 self.tx_id,
2270 0x4fb33d84c1aad81d,
2271 fidl::encoding::DynamicFlags::empty(),
2272 )
2273 }
2274}
2275
2276#[must_use = "FIDL methods require a response to be sent"]
2277#[derive(Debug)]
2278pub struct LightGetCurrentBrightnessValueResponder {
2279 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2280 tx_id: u32,
2281}
2282
2283impl std::ops::Drop for LightGetCurrentBrightnessValueResponder {
2287 fn drop(&mut self) {
2288 self.control_handle.shutdown();
2289 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2291 }
2292}
2293
2294impl fidl::endpoints::Responder for LightGetCurrentBrightnessValueResponder {
2295 type ControlHandle = LightControlHandle;
2296
2297 fn control_handle(&self) -> &LightControlHandle {
2298 &self.control_handle
2299 }
2300
2301 fn drop_without_shutdown(mut self) {
2302 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2304 std::mem::forget(self);
2306 }
2307}
2308
2309impl LightGetCurrentBrightnessValueResponder {
2310 pub fn send(self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2314 let _result = self.send_raw(result);
2315 if _result.is_err() {
2316 self.control_handle.shutdown();
2317 }
2318 self.drop_without_shutdown();
2319 _result
2320 }
2321
2322 pub fn send_no_shutdown_on_err(
2324 self,
2325 mut result: Result<f64, LightError>,
2326 ) -> Result<(), fidl::Error> {
2327 let _result = self.send_raw(result);
2328 self.drop_without_shutdown();
2329 _result
2330 }
2331
2332 fn send_raw(&self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2333 self.control_handle.inner.send::<fidl::encoding::ResultType<
2334 LightGetCurrentBrightnessValueResponse,
2335 LightError,
2336 >>(
2337 result.map(|value| (value,)),
2338 self.tx_id,
2339 0x2d387e129fe84809,
2340 fidl::encoding::DynamicFlags::empty(),
2341 )
2342 }
2343}
2344
2345#[must_use = "FIDL methods require a response to be sent"]
2346#[derive(Debug)]
2347pub struct LightSetBrightnessValueResponder {
2348 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2349 tx_id: u32,
2350}
2351
2352impl std::ops::Drop for LightSetBrightnessValueResponder {
2356 fn drop(&mut self) {
2357 self.control_handle.shutdown();
2358 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2360 }
2361}
2362
2363impl fidl::endpoints::Responder for LightSetBrightnessValueResponder {
2364 type ControlHandle = LightControlHandle;
2365
2366 fn control_handle(&self) -> &LightControlHandle {
2367 &self.control_handle
2368 }
2369
2370 fn drop_without_shutdown(mut self) {
2371 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2373 std::mem::forget(self);
2375 }
2376}
2377
2378impl LightSetBrightnessValueResponder {
2379 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2383 let _result = self.send_raw(result);
2384 if _result.is_err() {
2385 self.control_handle.shutdown();
2386 }
2387 self.drop_without_shutdown();
2388 _result
2389 }
2390
2391 pub fn send_no_shutdown_on_err(
2393 self,
2394 mut result: Result<(), LightError>,
2395 ) -> Result<(), fidl::Error> {
2396 let _result = self.send_raw(result);
2397 self.drop_without_shutdown();
2398 _result
2399 }
2400
2401 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2402 self.control_handle
2403 .inner
2404 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2405 result,
2406 self.tx_id,
2407 0x17cada93c7c48661,
2408 fidl::encoding::DynamicFlags::empty(),
2409 )
2410 }
2411}
2412
2413#[must_use = "FIDL methods require a response to be sent"]
2414#[derive(Debug)]
2415pub struct LightGetCurrentRgbValueResponder {
2416 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2417 tx_id: u32,
2418}
2419
2420impl std::ops::Drop for LightGetCurrentRgbValueResponder {
2424 fn drop(&mut self) {
2425 self.control_handle.shutdown();
2426 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2428 }
2429}
2430
2431impl fidl::endpoints::Responder for LightGetCurrentRgbValueResponder {
2432 type ControlHandle = LightControlHandle;
2433
2434 fn control_handle(&self) -> &LightControlHandle {
2435 &self.control_handle
2436 }
2437
2438 fn drop_without_shutdown(mut self) {
2439 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2441 std::mem::forget(self);
2443 }
2444}
2445
2446impl LightGetCurrentRgbValueResponder {
2447 pub fn send(self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2451 let _result = self.send_raw(result);
2452 if _result.is_err() {
2453 self.control_handle.shutdown();
2454 }
2455 self.drop_without_shutdown();
2456 _result
2457 }
2458
2459 pub fn send_no_shutdown_on_err(
2461 self,
2462 mut result: Result<&Rgb, LightError>,
2463 ) -> Result<(), fidl::Error> {
2464 let _result = self.send_raw(result);
2465 self.drop_without_shutdown();
2466 _result
2467 }
2468
2469 fn send_raw(&self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2470 self.control_handle.inner.send::<fidl::encoding::ResultType<
2471 LightGetCurrentRgbValueResponse,
2472 LightError,
2473 >>(
2474 result.map(|value| (value,)),
2475 self.tx_id,
2476 0x49965ac0d920f4ad,
2477 fidl::encoding::DynamicFlags::empty(),
2478 )
2479 }
2480}
2481
2482#[must_use = "FIDL methods require a response to be sent"]
2483#[derive(Debug)]
2484pub struct LightSetRgbValueResponder {
2485 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2486 tx_id: u32,
2487}
2488
2489impl std::ops::Drop for LightSetRgbValueResponder {
2493 fn drop(&mut self) {
2494 self.control_handle.shutdown();
2495 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2497 }
2498}
2499
2500impl fidl::endpoints::Responder for LightSetRgbValueResponder {
2501 type ControlHandle = LightControlHandle;
2502
2503 fn control_handle(&self) -> &LightControlHandle {
2504 &self.control_handle
2505 }
2506
2507 fn drop_without_shutdown(mut self) {
2508 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2510 std::mem::forget(self);
2512 }
2513}
2514
2515impl LightSetRgbValueResponder {
2516 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2520 let _result = self.send_raw(result);
2521 if _result.is_err() {
2522 self.control_handle.shutdown();
2523 }
2524 self.drop_without_shutdown();
2525 _result
2526 }
2527
2528 pub fn send_no_shutdown_on_err(
2530 self,
2531 mut result: Result<(), LightError>,
2532 ) -> Result<(), fidl::Error> {
2533 let _result = self.send_raw(result);
2534 self.drop_without_shutdown();
2535 _result
2536 }
2537
2538 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2539 self.control_handle
2540 .inner
2541 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2542 result,
2543 self.tx_id,
2544 0x2b354d18be0b70a4,
2545 fidl::encoding::DynamicFlags::empty(),
2546 )
2547 }
2548}
2549
2550#[must_use = "FIDL methods require a response to be sent"]
2551#[derive(Debug)]
2552pub struct LightGetGroupInfoResponder {
2553 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2554 tx_id: u32,
2555}
2556
2557impl std::ops::Drop for LightGetGroupInfoResponder {
2561 fn drop(&mut self) {
2562 self.control_handle.shutdown();
2563 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2565 }
2566}
2567
2568impl fidl::endpoints::Responder for LightGetGroupInfoResponder {
2569 type ControlHandle = LightControlHandle;
2570
2571 fn control_handle(&self) -> &LightControlHandle {
2572 &self.control_handle
2573 }
2574
2575 fn drop_without_shutdown(mut self) {
2576 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2578 std::mem::forget(self);
2580 }
2581}
2582
2583impl LightGetGroupInfoResponder {
2584 pub fn send(self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2588 let _result = self.send_raw(result);
2589 if _result.is_err() {
2590 self.control_handle.shutdown();
2591 }
2592 self.drop_without_shutdown();
2593 _result
2594 }
2595
2596 pub fn send_no_shutdown_on_err(
2598 self,
2599 mut result: Result<&GroupInfo, LightError>,
2600 ) -> Result<(), fidl::Error> {
2601 let _result = self.send_raw(result);
2602 self.drop_without_shutdown();
2603 _result
2604 }
2605
2606 fn send_raw(&self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2607 self.control_handle
2608 .inner
2609 .send::<fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>>(
2610 result.map(|info| (info,)),
2611 self.tx_id,
2612 0x5b27b0ca755b470b,
2613 fidl::encoding::DynamicFlags::empty(),
2614 )
2615 }
2616}
2617
2618#[must_use = "FIDL methods require a response to be sent"]
2619#[derive(Debug)]
2620pub struct LightGetGroupCurrentSimpleValueResponder {
2621 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2622 tx_id: u32,
2623}
2624
2625impl std::ops::Drop for LightGetGroupCurrentSimpleValueResponder {
2629 fn drop(&mut self) {
2630 self.control_handle.shutdown();
2631 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2633 }
2634}
2635
2636impl fidl::endpoints::Responder for LightGetGroupCurrentSimpleValueResponder {
2637 type ControlHandle = LightControlHandle;
2638
2639 fn control_handle(&self) -> &LightControlHandle {
2640 &self.control_handle
2641 }
2642
2643 fn drop_without_shutdown(mut self) {
2644 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2646 std::mem::forget(self);
2648 }
2649}
2650
2651impl LightGetGroupCurrentSimpleValueResponder {
2652 pub fn send(self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2656 let _result = self.send_raw(result);
2657 if _result.is_err() {
2658 self.control_handle.shutdown();
2659 }
2660 self.drop_without_shutdown();
2661 _result
2662 }
2663
2664 pub fn send_no_shutdown_on_err(
2666 self,
2667 mut result: Result<Option<&[bool]>, LightError>,
2668 ) -> Result<(), fidl::Error> {
2669 let _result = self.send_raw(result);
2670 self.drop_without_shutdown();
2671 _result
2672 }
2673
2674 fn send_raw(&self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2675 self.control_handle.inner.send::<fidl::encoding::ResultType<
2676 LightGetGroupCurrentSimpleValueResponse,
2677 LightError,
2678 >>(
2679 result.map(|values| (values,)),
2680 self.tx_id,
2681 0x659d9bdb5cc2201,
2682 fidl::encoding::DynamicFlags::empty(),
2683 )
2684 }
2685}
2686
2687#[must_use = "FIDL methods require a response to be sent"]
2688#[derive(Debug)]
2689pub struct LightSetGroupSimpleValueResponder {
2690 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2691 tx_id: u32,
2692}
2693
2694impl std::ops::Drop for LightSetGroupSimpleValueResponder {
2698 fn drop(&mut self) {
2699 self.control_handle.shutdown();
2700 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2702 }
2703}
2704
2705impl fidl::endpoints::Responder for LightSetGroupSimpleValueResponder {
2706 type ControlHandle = LightControlHandle;
2707
2708 fn control_handle(&self) -> &LightControlHandle {
2709 &self.control_handle
2710 }
2711
2712 fn drop_without_shutdown(mut self) {
2713 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2715 std::mem::forget(self);
2717 }
2718}
2719
2720impl LightSetGroupSimpleValueResponder {
2721 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2725 let _result = self.send_raw(result);
2726 if _result.is_err() {
2727 self.control_handle.shutdown();
2728 }
2729 self.drop_without_shutdown();
2730 _result
2731 }
2732
2733 pub fn send_no_shutdown_on_err(
2735 self,
2736 mut result: Result<(), LightError>,
2737 ) -> Result<(), fidl::Error> {
2738 let _result = self.send_raw(result);
2739 self.drop_without_shutdown();
2740 _result
2741 }
2742
2743 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2744 self.control_handle
2745 .inner
2746 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2747 result,
2748 self.tx_id,
2749 0x924234e74cc6dd8,
2750 fidl::encoding::DynamicFlags::empty(),
2751 )
2752 }
2753}
2754
2755#[must_use = "FIDL methods require a response to be sent"]
2756#[derive(Debug)]
2757pub struct LightGetGroupCurrentBrightnessValueResponder {
2758 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2759 tx_id: u32,
2760}
2761
2762impl std::ops::Drop for LightGetGroupCurrentBrightnessValueResponder {
2766 fn drop(&mut self) {
2767 self.control_handle.shutdown();
2768 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2770 }
2771}
2772
2773impl fidl::endpoints::Responder for LightGetGroupCurrentBrightnessValueResponder {
2774 type ControlHandle = LightControlHandle;
2775
2776 fn control_handle(&self) -> &LightControlHandle {
2777 &self.control_handle
2778 }
2779
2780 fn drop_without_shutdown(mut self) {
2781 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2783 std::mem::forget(self);
2785 }
2786}
2787
2788impl LightGetGroupCurrentBrightnessValueResponder {
2789 pub fn send(self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
2793 let _result = self.send_raw(result);
2794 if _result.is_err() {
2795 self.control_handle.shutdown();
2796 }
2797 self.drop_without_shutdown();
2798 _result
2799 }
2800
2801 pub fn send_no_shutdown_on_err(
2803 self,
2804 mut result: Result<Option<&[f64]>, LightError>,
2805 ) -> Result<(), fidl::Error> {
2806 let _result = self.send_raw(result);
2807 self.drop_without_shutdown();
2808 _result
2809 }
2810
2811 fn send_raw(&self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
2812 self.control_handle.inner.send::<fidl::encoding::ResultType<
2813 LightGetGroupCurrentBrightnessValueResponse,
2814 LightError,
2815 >>(
2816 result.map(|values| (values,)),
2817 self.tx_id,
2818 0x3ab226120b0d0362,
2819 fidl::encoding::DynamicFlags::empty(),
2820 )
2821 }
2822}
2823
2824#[must_use = "FIDL methods require a response to be sent"]
2825#[derive(Debug)]
2826pub struct LightSetGroupBrightnessValueResponder {
2827 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2828 tx_id: u32,
2829}
2830
2831impl std::ops::Drop for LightSetGroupBrightnessValueResponder {
2835 fn drop(&mut self) {
2836 self.control_handle.shutdown();
2837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2839 }
2840}
2841
2842impl fidl::endpoints::Responder for LightSetGroupBrightnessValueResponder {
2843 type ControlHandle = LightControlHandle;
2844
2845 fn control_handle(&self) -> &LightControlHandle {
2846 &self.control_handle
2847 }
2848
2849 fn drop_without_shutdown(mut self) {
2850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2852 std::mem::forget(self);
2854 }
2855}
2856
2857impl LightSetGroupBrightnessValueResponder {
2858 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2862 let _result = self.send_raw(result);
2863 if _result.is_err() {
2864 self.control_handle.shutdown();
2865 }
2866 self.drop_without_shutdown();
2867 _result
2868 }
2869
2870 pub fn send_no_shutdown_on_err(
2872 self,
2873 mut result: Result<(), LightError>,
2874 ) -> Result<(), fidl::Error> {
2875 let _result = self.send_raw(result);
2876 self.drop_without_shutdown();
2877 _result
2878 }
2879
2880 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2881 self.control_handle
2882 .inner
2883 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2884 result,
2885 self.tx_id,
2886 0x79e5f248fc5ec7ae,
2887 fidl::encoding::DynamicFlags::empty(),
2888 )
2889 }
2890}
2891
2892#[must_use = "FIDL methods require a response to be sent"]
2893#[derive(Debug)]
2894pub struct LightGetGroupCurrentRgbValueResponder {
2895 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2896 tx_id: u32,
2897}
2898
2899impl std::ops::Drop for LightGetGroupCurrentRgbValueResponder {
2903 fn drop(&mut self) {
2904 self.control_handle.shutdown();
2905 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2907 }
2908}
2909
2910impl fidl::endpoints::Responder for LightGetGroupCurrentRgbValueResponder {
2911 type ControlHandle = LightControlHandle;
2912
2913 fn control_handle(&self) -> &LightControlHandle {
2914 &self.control_handle
2915 }
2916
2917 fn drop_without_shutdown(mut self) {
2918 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2920 std::mem::forget(self);
2922 }
2923}
2924
2925impl LightGetGroupCurrentRgbValueResponder {
2926 pub fn send(self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
2930 let _result = self.send_raw(result);
2931 if _result.is_err() {
2932 self.control_handle.shutdown();
2933 }
2934 self.drop_without_shutdown();
2935 _result
2936 }
2937
2938 pub fn send_no_shutdown_on_err(
2940 self,
2941 mut result: Result<Option<&[Rgb]>, LightError>,
2942 ) -> Result<(), fidl::Error> {
2943 let _result = self.send_raw(result);
2944 self.drop_without_shutdown();
2945 _result
2946 }
2947
2948 fn send_raw(&self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
2949 self.control_handle.inner.send::<fidl::encoding::ResultType<
2950 LightGetGroupCurrentRgbValueResponse,
2951 LightError,
2952 >>(
2953 result.map(|values| (values,)),
2954 self.tx_id,
2955 0x2a6014b41254f617,
2956 fidl::encoding::DynamicFlags::empty(),
2957 )
2958 }
2959}
2960
2961#[must_use = "FIDL methods require a response to be sent"]
2962#[derive(Debug)]
2963pub struct LightSetGroupRgbValueResponder {
2964 control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2965 tx_id: u32,
2966}
2967
2968impl std::ops::Drop for LightSetGroupRgbValueResponder {
2972 fn drop(&mut self) {
2973 self.control_handle.shutdown();
2974 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2976 }
2977}
2978
2979impl fidl::endpoints::Responder for LightSetGroupRgbValueResponder {
2980 type ControlHandle = LightControlHandle;
2981
2982 fn control_handle(&self) -> &LightControlHandle {
2983 &self.control_handle
2984 }
2985
2986 fn drop_without_shutdown(mut self) {
2987 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2989 std::mem::forget(self);
2991 }
2992}
2993
2994impl LightSetGroupRgbValueResponder {
2995 pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2999 let _result = self.send_raw(result);
3000 if _result.is_err() {
3001 self.control_handle.shutdown();
3002 }
3003 self.drop_without_shutdown();
3004 _result
3005 }
3006
3007 pub fn send_no_shutdown_on_err(
3009 self,
3010 mut result: Result<(), LightError>,
3011 ) -> Result<(), fidl::Error> {
3012 let _result = self.send_raw(result);
3013 self.drop_without_shutdown();
3014 _result
3015 }
3016
3017 fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3018 self.control_handle
3019 .inner
3020 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
3021 result,
3022 self.tx_id,
3023 0x33c92316f251e4e4,
3024 fidl::encoding::DynamicFlags::empty(),
3025 )
3026 }
3027}
3028
3029#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3030pub struct LightServiceMarker;
3031
3032#[cfg(target_os = "fuchsia")]
3033impl fidl::endpoints::ServiceMarker for LightServiceMarker {
3034 type Proxy = LightServiceProxy;
3035 type Request = LightServiceRequest;
3036 const SERVICE_NAME: &'static str = "fuchsia.hardware.light.LightService";
3037}
3038
3039#[cfg(target_os = "fuchsia")]
3042pub enum LightServiceRequest {
3043 Light(LightRequestStream),
3044}
3045
3046#[cfg(target_os = "fuchsia")]
3047impl fidl::endpoints::ServiceRequest for LightServiceRequest {
3048 type Service = LightServiceMarker;
3049
3050 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3051 match name {
3052 "light" => Self::Light(
3053 <LightRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3054 ),
3055 _ => panic!("no such member protocol name for service LightService"),
3056 }
3057 }
3058
3059 fn member_names() -> &'static [&'static str] {
3060 &["light"]
3061 }
3062}
3063#[cfg(target_os = "fuchsia")]
3064pub struct LightServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3065
3066#[cfg(target_os = "fuchsia")]
3067impl fidl::endpoints::ServiceProxy for LightServiceProxy {
3068 type Service = LightServiceMarker;
3069
3070 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3071 Self(opener)
3072 }
3073}
3074
3075#[cfg(target_os = "fuchsia")]
3076impl LightServiceProxy {
3077 pub fn connect_to_light(&self) -> Result<LightProxy, fidl::Error> {
3078 let (proxy, server_end) = fidl::endpoints::create_proxy::<LightMarker>();
3079 self.connect_channel_to_light(server_end)?;
3080 Ok(proxy)
3081 }
3082
3083 pub fn connect_to_light_sync(&self) -> Result<LightSynchronousProxy, fidl::Error> {
3086 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<LightMarker>();
3087 self.connect_channel_to_light(server_end)?;
3088 Ok(proxy)
3089 }
3090
3091 pub fn connect_channel_to_light(
3094 &self,
3095 server_end: fidl::endpoints::ServerEnd<LightMarker>,
3096 ) -> Result<(), fidl::Error> {
3097 self.0.open_member("light", server_end.into_channel())
3098 }
3099
3100 pub fn instance_name(&self) -> &str {
3101 self.0.instance_name()
3102 }
3103}
3104
3105mod internal {
3106 use super::*;
3107}