Skip to main content

fidl_fuchsia_hardware_light/
fidl_fuchsia_hardware_light.rs

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