Skip to main content

fidl_fuchsia_hardware_light/
fidl_fuchsia_hardware_light.rs

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