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