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 _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13pub const LIGHT_NAME_LEN: u8 = 32;
14
15#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
16#[repr(u32)]
17pub enum Capability {
18    /// This capability indicates that the light supports setting brightness to a uint8_t value.
19    /// If this capability is not supported, the light only supports off and on state.
20    Brightness = 1,
21    /// This capability indicates that the light supports setting an RGB value.
22    Rgb = 2,
23    /// No capabilities
24    Simple = 3,
25}
26
27impl Capability {
28    #[inline]
29    pub fn from_primitive(prim: u32) -> Option<Self> {
30        match prim {
31            1 => Some(Self::Brightness),
32            2 => Some(Self::Rgb),
33            3 => Some(Self::Simple),
34            _ => None,
35        }
36    }
37
38    #[inline]
39    pub const fn into_primitive(self) -> u32 {
40        self as u32
41    }
42
43    #[deprecated = "Strict enums should not use `is_unknown`"]
44    #[inline]
45    pub fn is_unknown(&self) -> bool {
46        false
47    }
48}
49
50#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
51#[repr(u32)]
52pub enum LightError {
53    Ok = 0,
54    NotSupported = 1,
55    InvalidIndex = 2,
56    Failed = 3,
57}
58
59impl LightError {
60    #[inline]
61    pub fn from_primitive(prim: u32) -> Option<Self> {
62        match prim {
63            0 => Some(Self::Ok),
64            1 => Some(Self::NotSupported),
65            2 => Some(Self::InvalidIndex),
66            3 => Some(Self::Failed),
67            _ => None,
68        }
69    }
70
71    #[inline]
72    pub const fn into_primitive(self) -> u32 {
73        self as u32
74    }
75
76    #[deprecated = "Strict enums should not use `is_unknown`"]
77    #[inline]
78    pub fn is_unknown(&self) -> bool {
79        false
80    }
81}
82
83#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84pub struct GroupInfo {
85    pub name: String,
86    pub count: u32,
87    pub capability: Capability,
88}
89
90impl fidl::Persistable for GroupInfo {}
91
92#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93pub struct Info {
94    pub name: String,
95    pub capability: Capability,
96}
97
98impl fidl::Persistable for Info {}
99
100#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
101#[repr(C)]
102pub struct LightGetCurrentBrightnessValueRequest {
103    pub index: u32,
104}
105
106impl fidl::Persistable for LightGetCurrentBrightnessValueRequest {}
107
108#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
109#[repr(C)]
110pub struct LightGetCurrentRgbValueRequest {
111    pub index: u32,
112}
113
114impl fidl::Persistable for LightGetCurrentRgbValueRequest {}
115
116#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117#[repr(C)]
118pub struct LightGetCurrentSimpleValueRequest {
119    pub index: u32,
120}
121
122impl fidl::Persistable for LightGetCurrentSimpleValueRequest {}
123
124#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125#[repr(C)]
126pub struct LightGetGroupCurrentBrightnessValueRequest {
127    pub group_id: u32,
128}
129
130impl fidl::Persistable for LightGetGroupCurrentBrightnessValueRequest {}
131
132#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133#[repr(C)]
134pub struct LightGetGroupCurrentRgbValueRequest {
135    pub group_id: u32,
136}
137
138impl fidl::Persistable for LightGetGroupCurrentRgbValueRequest {}
139
140#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
141#[repr(C)]
142pub struct LightGetGroupCurrentSimpleValueRequest {
143    pub group_id: u32,
144}
145
146impl fidl::Persistable for LightGetGroupCurrentSimpleValueRequest {}
147
148#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
149#[repr(C)]
150pub struct LightGetGroupInfoRequest {
151    pub group_id: u32,
152}
153
154impl fidl::Persistable for LightGetGroupInfoRequest {}
155
156#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157#[repr(C)]
158pub struct LightGetInfoRequest {
159    pub index: u32,
160}
161
162impl fidl::Persistable for LightGetInfoRequest {}
163
164#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165#[repr(C)]
166pub struct LightGetNumLightGroupsResponse {
167    pub count: u32,
168}
169
170impl fidl::Persistable for LightGetNumLightGroupsResponse {}
171
172#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
173#[repr(C)]
174pub struct LightGetNumLightsResponse {
175    pub count: u32,
176}
177
178impl fidl::Persistable for LightGetNumLightsResponse {}
179
180#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
181pub struct LightSetBrightnessValueRequest {
182    pub index: u32,
183    pub value: f64,
184}
185
186impl fidl::Persistable for LightSetBrightnessValueRequest {}
187
188#[derive(Clone, Debug, PartialEq, PartialOrd)]
189pub struct LightSetGroupBrightnessValueRequest {
190    pub group_id: u32,
191    pub values: Vec<f64>,
192}
193
194impl fidl::Persistable for LightSetGroupBrightnessValueRequest {}
195
196#[derive(Clone, Debug, PartialEq, PartialOrd)]
197pub struct LightSetGroupRgbValueRequest {
198    pub group_id: u32,
199    pub values: Vec<Rgb>,
200}
201
202impl fidl::Persistable for LightSetGroupRgbValueRequest {}
203
204#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
205pub struct LightSetGroupSimpleValueRequest {
206    pub group_id: u32,
207    pub values: Vec<bool>,
208}
209
210impl fidl::Persistable for LightSetGroupSimpleValueRequest {}
211
212#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
213pub struct LightSetRgbValueRequest {
214    pub index: u32,
215    pub value: Rgb,
216}
217
218impl fidl::Persistable for LightSetRgbValueRequest {}
219
220#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct LightSetSimpleValueRequest {
222    pub index: u32,
223    pub value: bool,
224}
225
226impl fidl::Persistable for LightSetSimpleValueRequest {}
227
228#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
229pub struct LightGetCurrentBrightnessValueResponse {
230    pub value: f64,
231}
232
233impl fidl::Persistable for LightGetCurrentBrightnessValueResponse {}
234
235#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
236pub struct LightGetCurrentRgbValueResponse {
237    pub value: Rgb,
238}
239
240impl fidl::Persistable for LightGetCurrentRgbValueResponse {}
241
242#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
243pub struct LightGetCurrentSimpleValueResponse {
244    pub value: bool,
245}
246
247impl fidl::Persistable for LightGetCurrentSimpleValueResponse {}
248
249#[derive(Clone, Debug, PartialEq, PartialOrd)]
250pub struct LightGetGroupCurrentBrightnessValueResponse {
251    pub values: Option<Vec<f64>>,
252}
253
254impl fidl::Persistable for LightGetGroupCurrentBrightnessValueResponse {}
255
256#[derive(Clone, Debug, PartialEq, PartialOrd)]
257pub struct LightGetGroupCurrentRgbValueResponse {
258    pub values: Option<Vec<Rgb>>,
259}
260
261impl fidl::Persistable for LightGetGroupCurrentRgbValueResponse {}
262
263#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
264pub struct LightGetGroupCurrentSimpleValueResponse {
265    pub values: Option<Vec<bool>>,
266}
267
268impl fidl::Persistable for LightGetGroupCurrentSimpleValueResponse {}
269
270#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
271pub struct LightGetGroupInfoResponse {
272    pub info: GroupInfo,
273}
274
275impl fidl::Persistable for LightGetGroupInfoResponse {}
276
277#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
278pub struct LightGetInfoResponse {
279    pub info: Info,
280}
281
282impl fidl::Persistable for LightGetInfoResponse {}
283
284#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
285pub struct Rgb {
286    pub red: f64,
287    pub green: f64,
288    pub blue: f64,
289}
290
291impl fidl::Persistable for Rgb {}
292
293#[derive(Clone, Debug, Default, PartialEq)]
294pub struct Config {
295    pub name: Option<String>,
296    pub brightness: Option<bool>,
297    pub rgb: Option<bool>,
298    pub init_on: Option<bool>,
299    pub group_id: Option<i32>,
300    #[doc(hidden)]
301    pub __source_breaking: fidl::marker::SourceBreaking,
302}
303
304impl fidl::Persistable for Config {}
305
306#[derive(Clone, Debug, Default, PartialEq)]
307pub struct Metadata {
308    pub configs: Option<Vec<Config>>,
309    #[doc(hidden)]
310    pub __source_breaking: fidl::marker::SourceBreaking,
311}
312
313impl fidl::Persistable for Metadata {}
314
315#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
316pub struct LightMarker;
317
318impl fidl::endpoints::ProtocolMarker for LightMarker {
319    type Proxy = LightProxy;
320    type RequestStream = LightRequestStream;
321    #[cfg(target_os = "fuchsia")]
322    type SynchronousProxy = LightSynchronousProxy;
323
324    const DEBUG_NAME: &'static str = "fuchsia.hardware.light.Light";
325}
326impl fidl::endpoints::DiscoverableProtocolMarker for LightMarker {}
327pub type LightGetInfoResult = Result<Info, LightError>;
328pub type LightGetCurrentSimpleValueResult = Result<bool, LightError>;
329pub type LightSetSimpleValueResult = Result<(), LightError>;
330pub type LightGetCurrentBrightnessValueResult = Result<f64, LightError>;
331pub type LightSetBrightnessValueResult = Result<(), LightError>;
332pub type LightGetCurrentRgbValueResult = Result<Rgb, LightError>;
333pub type LightSetRgbValueResult = Result<(), LightError>;
334pub type LightGetGroupInfoResult = Result<GroupInfo, LightError>;
335pub type LightGetGroupCurrentSimpleValueResult = Result<Option<Vec<bool>>, LightError>;
336pub type LightSetGroupSimpleValueResult = Result<(), LightError>;
337pub type LightGetGroupCurrentBrightnessValueResult = Result<Option<Vec<f64>>, LightError>;
338pub type LightSetGroupBrightnessValueResult = Result<(), LightError>;
339pub type LightGetGroupCurrentRgbValueResult = Result<Option<Vec<Rgb>>, LightError>;
340pub type LightSetGroupRgbValueResult = Result<(), LightError>;
341
342pub trait LightProxyInterface: Send + Sync {
343    type GetNumLightsResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
344    fn r#get_num_lights(&self) -> Self::GetNumLightsResponseFut;
345    type GetNumLightGroupsResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
346    fn r#get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut;
347    type GetInfoResponseFut: std::future::Future<Output = Result<LightGetInfoResult, fidl::Error>>
348        + Send;
349    fn r#get_info(&self, index: u32) -> Self::GetInfoResponseFut;
350    type GetCurrentSimpleValueResponseFut: std::future::Future<Output = Result<LightGetCurrentSimpleValueResult, fidl::Error>>
351        + Send;
352    fn r#get_current_simple_value(&self, index: u32) -> Self::GetCurrentSimpleValueResponseFut;
353    type SetSimpleValueResponseFut: std::future::Future<Output = Result<LightSetSimpleValueResult, fidl::Error>>
354        + Send;
355    fn r#set_simple_value(&self, index: u32, value: bool) -> Self::SetSimpleValueResponseFut;
356    type GetCurrentBrightnessValueResponseFut: std::future::Future<Output = Result<LightGetCurrentBrightnessValueResult, fidl::Error>>
357        + Send;
358    fn r#get_current_brightness_value(
359        &self,
360        index: u32,
361    ) -> Self::GetCurrentBrightnessValueResponseFut;
362    type SetBrightnessValueResponseFut: std::future::Future<Output = Result<LightSetBrightnessValueResult, fidl::Error>>
363        + Send;
364    fn r#set_brightness_value(&self, index: u32, value: f64)
365        -> Self::SetBrightnessValueResponseFut;
366    type GetCurrentRgbValueResponseFut: std::future::Future<Output = Result<LightGetCurrentRgbValueResult, fidl::Error>>
367        + Send;
368    fn r#get_current_rgb_value(&self, index: u32) -> Self::GetCurrentRgbValueResponseFut;
369    type SetRgbValueResponseFut: std::future::Future<Output = Result<LightSetRgbValueResult, fidl::Error>>
370        + Send;
371    fn r#set_rgb_value(&self, index: u32, value: &Rgb) -> Self::SetRgbValueResponseFut;
372    type GetGroupInfoResponseFut: std::future::Future<Output = Result<LightGetGroupInfoResult, fidl::Error>>
373        + Send;
374    fn r#get_group_info(&self, group_id: u32) -> Self::GetGroupInfoResponseFut;
375    type GetGroupCurrentSimpleValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentSimpleValueResult, fidl::Error>>
376        + Send;
377    fn r#get_group_current_simple_value(
378        &self,
379        group_id: u32,
380    ) -> Self::GetGroupCurrentSimpleValueResponseFut;
381    type SetGroupSimpleValueResponseFut: std::future::Future<Output = Result<LightSetGroupSimpleValueResult, fidl::Error>>
382        + Send;
383    fn r#set_group_simple_value(
384        &self,
385        group_id: u32,
386        values: &[bool],
387    ) -> Self::SetGroupSimpleValueResponseFut;
388    type GetGroupCurrentBrightnessValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error>>
389        + Send;
390    fn r#get_group_current_brightness_value(
391        &self,
392        group_id: u32,
393    ) -> Self::GetGroupCurrentBrightnessValueResponseFut;
394    type SetGroupBrightnessValueResponseFut: std::future::Future<Output = Result<LightSetGroupBrightnessValueResult, fidl::Error>>
395        + Send;
396    fn r#set_group_brightness_value(
397        &self,
398        group_id: u32,
399        values: &[f64],
400    ) -> Self::SetGroupBrightnessValueResponseFut;
401    type GetGroupCurrentRgbValueResponseFut: std::future::Future<Output = Result<LightGetGroupCurrentRgbValueResult, fidl::Error>>
402        + Send;
403    fn r#get_group_current_rgb_value(
404        &self,
405        group_id: u32,
406    ) -> Self::GetGroupCurrentRgbValueResponseFut;
407    type SetGroupRgbValueResponseFut: std::future::Future<Output = Result<LightSetGroupRgbValueResult, fidl::Error>>
408        + Send;
409    fn r#set_group_rgb_value(
410        &self,
411        group_id: u32,
412        values: &[Rgb],
413    ) -> Self::SetGroupRgbValueResponseFut;
414}
415#[derive(Debug)]
416#[cfg(target_os = "fuchsia")]
417pub struct LightSynchronousProxy {
418    client: fidl::client::sync::Client,
419}
420
421#[cfg(target_os = "fuchsia")]
422impl fidl::endpoints::SynchronousProxy for LightSynchronousProxy {
423    type Proxy = LightProxy;
424    type Protocol = LightMarker;
425
426    fn from_channel(inner: fidl::Channel) -> Self {
427        Self::new(inner)
428    }
429
430    fn into_channel(self) -> fidl::Channel {
431        self.client.into_channel()
432    }
433
434    fn as_channel(&self) -> &fidl::Channel {
435        self.client.as_channel()
436    }
437}
438
439#[cfg(target_os = "fuchsia")]
440impl LightSynchronousProxy {
441    pub fn new(channel: fidl::Channel) -> Self {
442        let protocol_name = <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
443        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
444    }
445
446    pub fn into_channel(self) -> fidl::Channel {
447        self.client.into_channel()
448    }
449
450    /// Waits until an event arrives and returns it. It is safe for other
451    /// threads to make concurrent requests while waiting for an event.
452    pub fn wait_for_event(
453        &self,
454        deadline: zx::MonotonicInstant,
455    ) -> Result<LightEvent, fidl::Error> {
456        LightEvent::decode(self.client.wait_for_event(deadline)?)
457    }
458
459    /// Returns the total number of physical lights.
460    /// This will typically be 1 for a simple LED light, but may be greater than one for an array of
461    /// lights or a more complicated lighting device.
462    /// The multiple lights are addressed using "index" parameter in the calls below.
463    pub fn r#get_num_lights(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
464        let _response =
465            self.client.send_query::<fidl::encoding::EmptyPayload, LightGetNumLightsResponse>(
466                (),
467                0x7ae2bd2ef8062dbb,
468                fidl::encoding::DynamicFlags::empty(),
469                ___deadline,
470            )?;
471        Ok(_response.count)
472    }
473
474    /// Returns the total number of light groups (does not count single lights).
475    /// The light groups are addressed using "group_id" parameter in the calls below.
476    pub fn r#get_num_light_groups(
477        &self,
478        ___deadline: zx::MonotonicInstant,
479    ) -> Result<u32, fidl::Error> {
480        let _response = self
481            .client
482            .send_query::<fidl::encoding::EmptyPayload, LightGetNumLightGroupsResponse>(
483                (),
484                0x600895db5a7cbf0,
485                fidl::encoding::DynamicFlags::empty(),
486                ___deadline,
487            )?;
488        Ok(_response.count)
489    }
490
491    /// Returns info for the single light.
492    /// index: Index of the light defined by board. Must be less than value returned by GetNumLights.
493    pub fn r#get_info(
494        &self,
495        mut index: u32,
496        ___deadline: zx::MonotonicInstant,
497    ) -> Result<LightGetInfoResult, fidl::Error> {
498        let _response = self.client.send_query::<
499            LightGetInfoRequest,
500            fidl::encoding::ResultType<LightGetInfoResponse, LightError>,
501        >(
502            (index,),
503            0x4229b55c8c4bd529,
504            fidl::encoding::DynamicFlags::empty(),
505            ___deadline,
506        )?;
507        Ok(_response.map(|x| x.info))
508    }
509
510    /// Returns the current value. If the light is ON, the value is True. If the light is OFF,
511    /// the value is False.
512    /// If the capability 'SIMPLE' is not supported by this light, returns NOT_SUPPORTED.
513    /// Use GetInfo to check if light supports this operation.
514    /// index: a number between 0 inclusive and the count received from GetNumLights.
515    pub fn r#get_current_simple_value(
516        &self,
517        mut index: u32,
518        ___deadline: zx::MonotonicInstant,
519    ) -> Result<LightGetCurrentSimpleValueResult, fidl::Error> {
520        let _response = self.client.send_query::<
521            LightGetCurrentSimpleValueRequest,
522            fidl::encoding::ResultType<LightGetCurrentSimpleValueResponse, LightError>,
523        >(
524            (index,),
525            0x183154896336c321,
526            fidl::encoding::DynamicFlags::empty(),
527            ___deadline,
528        )?;
529        Ok(_response.map(|x| x.value))
530    }
531
532    /// Sets the current value. Value should be set to 'TRUE' to turn on the light. Value should be
533    /// set to 'FALSE' to turn off the light.
534    /// If the capability 'SIMPLE' is not supported by this light, returns NOT_SUPPORTED.
535    /// Use GetInfo to check if light supports this operation.
536    /// index: a number between 0 inclusive and the count received from GetNumLights.
537    pub fn r#set_simple_value(
538        &self,
539        mut index: u32,
540        mut value: bool,
541        ___deadline: zx::MonotonicInstant,
542    ) -> Result<LightSetSimpleValueResult, fidl::Error> {
543        let _response = self.client.send_query::<
544            LightSetSimpleValueRequest,
545            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
546        >(
547            (index, value,),
548            0x4fb33d84c1aad81d,
549            fidl::encoding::DynamicFlags::empty(),
550            ___deadline,
551        )?;
552        Ok(_response.map(|x| x))
553    }
554
555    /// Returns the current brightness value (0.0 - 1.0) of the light indicated by index, where 0.0
556    /// is minimum brightness and 1.0 is maximum.
557    /// If the capability 'BRIGHTNESS' is not supported by this light, returns NOT_SUPPORTED.
558    /// Use GetInfo to check if light supports this operation.
559    /// index: a number between 0 inclusive and the count received from GetNumLights.
560    pub fn r#get_current_brightness_value(
561        &self,
562        mut index: u32,
563        ___deadline: zx::MonotonicInstant,
564    ) -> Result<LightGetCurrentBrightnessValueResult, fidl::Error> {
565        let _response = self.client.send_query::<
566            LightGetCurrentBrightnessValueRequest,
567            fidl::encoding::ResultType<LightGetCurrentBrightnessValueResponse, LightError>,
568        >(
569            (index,),
570            0x2d387e129fe84809,
571            fidl::encoding::DynamicFlags::empty(),
572            ___deadline,
573        )?;
574        Ok(_response.map(|x| x.value))
575    }
576
577    /// Sets the current brightness value (0.0 - 1.0), where 0.0 is minimum brightness and 1.0 is
578    /// maximum.
579    /// If the capability 'BRIGHTNESS' is not supported by this light, returns NOT_SUPPORTED.
580    /// Use GetInfo to check if light supports this operation.
581    /// index: a number between 0 inclusive and the count received from GetNumLights.
582    pub fn r#set_brightness_value(
583        &self,
584        mut index: u32,
585        mut value: f64,
586        ___deadline: zx::MonotonicInstant,
587    ) -> Result<LightSetBrightnessValueResult, fidl::Error> {
588        let _response = self.client.send_query::<
589            LightSetBrightnessValueRequest,
590            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
591        >(
592            (index, value,),
593            0x17cada93c7c48661,
594            fidl::encoding::DynamicFlags::empty(),
595            ___deadline,
596        )?;
597        Ok(_response.map(|x| x))
598    }
599
600    /// Returns the current RGB value for the single light.
601    /// If the capability 'RGB' is not supported by this light, returns NOT_SUPPORTED.
602    /// Use GetInfo to check if light supports this operation.
603    /// index: a number between 0 inclusive and the count received from GetNumLights.
604    pub fn r#get_current_rgb_value(
605        &self,
606        mut index: u32,
607        ___deadline: zx::MonotonicInstant,
608    ) -> Result<LightGetCurrentRgbValueResult, fidl::Error> {
609        let _response = self.client.send_query::<
610            LightGetCurrentRgbValueRequest,
611            fidl::encoding::ResultType<LightGetCurrentRgbValueResponse, LightError>,
612        >(
613            (index,),
614            0x49965ac0d920f4ad,
615            fidl::encoding::DynamicFlags::empty(),
616            ___deadline,
617        )?;
618        Ok(_response.map(|x| x.value))
619    }
620
621    /// Sets the current RGB value.
622    /// If the capability 'RGB' is not supported by this light, returns NOT_SUPPORTED.
623    /// Use GetInfo to check if light supports this operation.
624    /// index: a number between 0 inclusive and the count received from GetNumLights.
625    pub fn r#set_rgb_value(
626        &self,
627        mut index: u32,
628        mut value: &Rgb,
629        ___deadline: zx::MonotonicInstant,
630    ) -> Result<LightSetRgbValueResult, fidl::Error> {
631        let _response = self.client.send_query::<
632            LightSetRgbValueRequest,
633            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
634        >(
635            (index, value,),
636            0x2b354d18be0b70a4,
637            fidl::encoding::DynamicFlags::empty(),
638            ___deadline,
639        )?;
640        Ok(_response.map(|x| x))
641    }
642
643    /// Returns group info for the light group.
644    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
645    pub fn r#get_group_info(
646        &self,
647        mut group_id: u32,
648        ___deadline: zx::MonotonicInstant,
649    ) -> Result<LightGetGroupInfoResult, fidl::Error> {
650        let _response = self.client.send_query::<
651            LightGetGroupInfoRequest,
652            fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>,
653        >(
654            (group_id,),
655            0x5b27b0ca755b470b,
656            fidl::encoding::DynamicFlags::empty(),
657            ___deadline,
658        )?;
659        Ok(_response.map(|x| x.info))
660    }
661
662    /// Returns an array of the current values.If the light is ON, the value is True. If the light
663    /// is OFF, the value is False.
664    /// If group_id is invalid, INVALID_INDEX will be returned.
665    /// If the capability 'SIMPLE' is not supported by this group, returns NOT_SUPPORTED.
666    /// Use GetGroupInfo to check if group supports this operation.
667    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
668    pub fn r#get_group_current_simple_value(
669        &self,
670        mut group_id: u32,
671        ___deadline: zx::MonotonicInstant,
672    ) -> Result<LightGetGroupCurrentSimpleValueResult, fidl::Error> {
673        let _response = self.client.send_query::<
674            LightGetGroupCurrentSimpleValueRequest,
675            fidl::encoding::ResultType<LightGetGroupCurrentSimpleValueResponse, LightError>,
676        >(
677            (group_id,),
678            0x659d9bdb5cc2201,
679            fidl::encoding::DynamicFlags::empty(),
680            ___deadline,
681        )?;
682        Ok(_response.map(|x| x.values))
683    }
684
685    /// Sets the current values through the values array. Value should be set to 'TRUE' to turn on
686    /// the light. Value should be set to 'FALSE' to turn off the light.
687    /// If group_id is invalid, INVALID_INDEX will be returned.
688    /// If the capability 'SIMPLE' is not supported by this group, returns NOT_SUPPORTED.
689    /// Use GetGroupInfo to check if group supports this operation.
690    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
691    pub fn r#set_group_simple_value(
692        &self,
693        mut group_id: u32,
694        mut values: &[bool],
695        ___deadline: zx::MonotonicInstant,
696    ) -> Result<LightSetGroupSimpleValueResult, fidl::Error> {
697        let _response = self.client.send_query::<
698            LightSetGroupSimpleValueRequest,
699            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
700        >(
701            (group_id, values,),
702            0x924234e74cc6dd8,
703            fidl::encoding::DynamicFlags::empty(),
704            ___deadline,
705        )?;
706        Ok(_response.map(|x| x))
707    }
708
709    /// Returns an array of the current brightness values (0.0 - 1.0) for the light group, where 0.0
710    /// is minimum brightness and 1.0 is maximum.
711    /// If group_id is invalid, INVALID_INDEX will be returned.
712    /// If the capability 'BRIGHTNESS' is not supported by this group, returns NOT_SUPPORTED.
713    /// Use GetGroupInfo to check if group supports this operation.
714    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
715    pub fn r#get_group_current_brightness_value(
716        &self,
717        mut group_id: u32,
718        ___deadline: zx::MonotonicInstant,
719    ) -> Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error> {
720        let _response = self.client.send_query::<
721            LightGetGroupCurrentBrightnessValueRequest,
722            fidl::encoding::ResultType<LightGetGroupCurrentBrightnessValueResponse, LightError>,
723        >(
724            (group_id,),
725            0x3ab226120b0d0362,
726            fidl::encoding::DynamicFlags::empty(),
727            ___deadline,
728        )?;
729        Ok(_response.map(|x| x.values))
730    }
731
732    /// Sets the current brightness values (0.0 - 1.0) for the light group through the values array,
733    /// where 0.0 is minimum brightness and 1.0 is maximum.
734    /// If group_id is invalid, INVALID_INDEX will be returned.
735    /// If the capability 'BRIGHTNESS' is not supported by this group, returns NOT_SUPPORTED.
736    /// Use GetGroupInfo to check if group supports this operation.
737    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
738    pub fn r#set_group_brightness_value(
739        &self,
740        mut group_id: u32,
741        mut values: &[f64],
742        ___deadline: zx::MonotonicInstant,
743    ) -> Result<LightSetGroupBrightnessValueResult, fidl::Error> {
744        let _response = self.client.send_query::<
745            LightSetGroupBrightnessValueRequest,
746            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
747        >(
748            (group_id, values,),
749            0x79e5f248fc5ec7ae,
750            fidl::encoding::DynamicFlags::empty(),
751            ___deadline,
752        )?;
753        Ok(_response.map(|x| x))
754    }
755
756    /// Returns an array of the current RGB values for the light group.
757    /// If group_id is invalid, INVALID_INDEX will be returned.
758    /// If the capability 'RGB' is not supported by this group, returns NOT_SUPPORTED.
759    /// Use GetGroupInfo to check if group supports this operation.
760    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
761    pub fn r#get_group_current_rgb_value(
762        &self,
763        mut group_id: u32,
764        ___deadline: zx::MonotonicInstant,
765    ) -> Result<LightGetGroupCurrentRgbValueResult, fidl::Error> {
766        let _response = self.client.send_query::<
767            LightGetGroupCurrentRgbValueRequest,
768            fidl::encoding::ResultType<LightGetGroupCurrentRgbValueResponse, LightError>,
769        >(
770            (group_id,),
771            0x2a6014b41254f617,
772            fidl::encoding::DynamicFlags::empty(),
773            ___deadline,
774        )?;
775        Ok(_response.map(|x| x.values))
776    }
777
778    /// Sets the current RGB value for the light group.
779    /// If group_id is invalid, INVALID_INDEX will be returned.
780    /// If the capability 'RGB' is not supported by this group, returns NOT_SUPPORTED.
781    /// Use GetGroupInfo to check if group supports this operation.
782    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
783    pub fn r#set_group_rgb_value(
784        &self,
785        mut group_id: u32,
786        mut values: &[Rgb],
787        ___deadline: zx::MonotonicInstant,
788    ) -> Result<LightSetGroupRgbValueResult, fidl::Error> {
789        let _response = self.client.send_query::<
790            LightSetGroupRgbValueRequest,
791            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
792        >(
793            (group_id, values,),
794            0x33c92316f251e4e4,
795            fidl::encoding::DynamicFlags::empty(),
796            ___deadline,
797        )?;
798        Ok(_response.map(|x| x))
799    }
800}
801
802#[derive(Debug, Clone)]
803pub struct LightProxy {
804    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
805}
806
807impl fidl::endpoints::Proxy for LightProxy {
808    type Protocol = LightMarker;
809
810    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
811        Self::new(inner)
812    }
813
814    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
815        self.client.into_channel().map_err(|client| Self { client })
816    }
817
818    fn as_channel(&self) -> &::fidl::AsyncChannel {
819        self.client.as_channel()
820    }
821}
822
823impl LightProxy {
824    /// Create a new Proxy for fuchsia.hardware.light/Light.
825    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
826        let protocol_name = <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
827        Self { client: fidl::client::Client::new(channel, protocol_name) }
828    }
829
830    /// Get a Stream of events from the remote end of the protocol.
831    ///
832    /// # Panics
833    ///
834    /// Panics if the event stream was already taken.
835    pub fn take_event_stream(&self) -> LightEventStream {
836        LightEventStream { event_receiver: self.client.take_event_receiver() }
837    }
838
839    /// Returns the total number of physical lights.
840    /// This will typically be 1 for a simple LED light, but may be greater than one for an array of
841    /// lights or a more complicated lighting device.
842    /// The multiple lights are addressed using "index" parameter in the calls below.
843    pub fn r#get_num_lights(
844        &self,
845    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
846        LightProxyInterface::r#get_num_lights(self)
847    }
848
849    /// Returns the total number of light groups (does not count single lights).
850    /// The light groups are addressed using "group_id" parameter in the calls below.
851    pub fn r#get_num_light_groups(
852        &self,
853    ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
854        LightProxyInterface::r#get_num_light_groups(self)
855    }
856
857    /// Returns info for the single light.
858    /// index: Index of the light defined by board. Must be less than value returned by GetNumLights.
859    pub fn r#get_info(
860        &self,
861        mut index: u32,
862    ) -> fidl::client::QueryResponseFut<
863        LightGetInfoResult,
864        fidl::encoding::DefaultFuchsiaResourceDialect,
865    > {
866        LightProxyInterface::r#get_info(self, index)
867    }
868
869    /// Returns the current value. If the light is ON, the value is True. If the light is OFF,
870    /// the value is False.
871    /// If the capability 'SIMPLE' is not supported by this light, returns NOT_SUPPORTED.
872    /// Use GetInfo to check if light supports this operation.
873    /// index: a number between 0 inclusive and the count received from GetNumLights.
874    pub fn r#get_current_simple_value(
875        &self,
876        mut index: u32,
877    ) -> fidl::client::QueryResponseFut<
878        LightGetCurrentSimpleValueResult,
879        fidl::encoding::DefaultFuchsiaResourceDialect,
880    > {
881        LightProxyInterface::r#get_current_simple_value(self, index)
882    }
883
884    /// Sets the current value. Value should be set to 'TRUE' to turn on the light. Value should be
885    /// set to 'FALSE' to turn off the light.
886    /// If the capability 'SIMPLE' is not supported by this light, returns NOT_SUPPORTED.
887    /// Use GetInfo to check if light supports this operation.
888    /// index: a number between 0 inclusive and the count received from GetNumLights.
889    pub fn r#set_simple_value(
890        &self,
891        mut index: u32,
892        mut value: bool,
893    ) -> fidl::client::QueryResponseFut<
894        LightSetSimpleValueResult,
895        fidl::encoding::DefaultFuchsiaResourceDialect,
896    > {
897        LightProxyInterface::r#set_simple_value(self, index, value)
898    }
899
900    /// Returns the current brightness value (0.0 - 1.0) of the light indicated by index, where 0.0
901    /// is minimum brightness and 1.0 is maximum.
902    /// If the capability 'BRIGHTNESS' is not supported by this light, returns NOT_SUPPORTED.
903    /// Use GetInfo to check if light supports this operation.
904    /// index: a number between 0 inclusive and the count received from GetNumLights.
905    pub fn r#get_current_brightness_value(
906        &self,
907        mut index: u32,
908    ) -> fidl::client::QueryResponseFut<
909        LightGetCurrentBrightnessValueResult,
910        fidl::encoding::DefaultFuchsiaResourceDialect,
911    > {
912        LightProxyInterface::r#get_current_brightness_value(self, index)
913    }
914
915    /// Sets the current brightness value (0.0 - 1.0), where 0.0 is minimum brightness and 1.0 is
916    /// maximum.
917    /// If the capability 'BRIGHTNESS' is not supported by this light, returns NOT_SUPPORTED.
918    /// Use GetInfo to check if light supports this operation.
919    /// index: a number between 0 inclusive and the count received from GetNumLights.
920    pub fn r#set_brightness_value(
921        &self,
922        mut index: u32,
923        mut value: f64,
924    ) -> fidl::client::QueryResponseFut<
925        LightSetBrightnessValueResult,
926        fidl::encoding::DefaultFuchsiaResourceDialect,
927    > {
928        LightProxyInterface::r#set_brightness_value(self, index, value)
929    }
930
931    /// Returns the current RGB value for the single light.
932    /// If the capability 'RGB' is not supported by this light, returns NOT_SUPPORTED.
933    /// Use GetInfo to check if light supports this operation.
934    /// index: a number between 0 inclusive and the count received from GetNumLights.
935    pub fn r#get_current_rgb_value(
936        &self,
937        mut index: u32,
938    ) -> fidl::client::QueryResponseFut<
939        LightGetCurrentRgbValueResult,
940        fidl::encoding::DefaultFuchsiaResourceDialect,
941    > {
942        LightProxyInterface::r#get_current_rgb_value(self, index)
943    }
944
945    /// Sets the current RGB value.
946    /// If the capability 'RGB' is not supported by this light, returns NOT_SUPPORTED.
947    /// Use GetInfo to check if light supports this operation.
948    /// index: a number between 0 inclusive and the count received from GetNumLights.
949    pub fn r#set_rgb_value(
950        &self,
951        mut index: u32,
952        mut value: &Rgb,
953    ) -> fidl::client::QueryResponseFut<
954        LightSetRgbValueResult,
955        fidl::encoding::DefaultFuchsiaResourceDialect,
956    > {
957        LightProxyInterface::r#set_rgb_value(self, index, value)
958    }
959
960    /// Returns group info for the light group.
961    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
962    pub fn r#get_group_info(
963        &self,
964        mut group_id: u32,
965    ) -> fidl::client::QueryResponseFut<
966        LightGetGroupInfoResult,
967        fidl::encoding::DefaultFuchsiaResourceDialect,
968    > {
969        LightProxyInterface::r#get_group_info(self, group_id)
970    }
971
972    /// Returns an array of the current values.If the light is ON, the value is True. If the light
973    /// is OFF, the value is False.
974    /// If group_id is invalid, INVALID_INDEX will be returned.
975    /// If the capability 'SIMPLE' is not supported by this group, returns NOT_SUPPORTED.
976    /// Use GetGroupInfo to check if group supports this operation.
977    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
978    pub fn r#get_group_current_simple_value(
979        &self,
980        mut group_id: u32,
981    ) -> fidl::client::QueryResponseFut<
982        LightGetGroupCurrentSimpleValueResult,
983        fidl::encoding::DefaultFuchsiaResourceDialect,
984    > {
985        LightProxyInterface::r#get_group_current_simple_value(self, group_id)
986    }
987
988    /// Sets the current values through the values array. Value should be set to 'TRUE' to turn on
989    /// the light. Value should be set to 'FALSE' to turn off the light.
990    /// If group_id is invalid, INVALID_INDEX will be returned.
991    /// If the capability 'SIMPLE' is not supported by this group, returns NOT_SUPPORTED.
992    /// Use GetGroupInfo to check if group supports this operation.
993    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
994    pub fn r#set_group_simple_value(
995        &self,
996        mut group_id: u32,
997        mut values: &[bool],
998    ) -> fidl::client::QueryResponseFut<
999        LightSetGroupSimpleValueResult,
1000        fidl::encoding::DefaultFuchsiaResourceDialect,
1001    > {
1002        LightProxyInterface::r#set_group_simple_value(self, group_id, values)
1003    }
1004
1005    /// Returns an array of the current brightness values (0.0 - 1.0) for the light group, where 0.0
1006    /// is minimum brightness and 1.0 is maximum.
1007    /// If group_id is invalid, INVALID_INDEX will be returned.
1008    /// If the capability 'BRIGHTNESS' is not supported by this group, returns NOT_SUPPORTED.
1009    /// Use GetGroupInfo to check if group supports this operation.
1010    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1011    pub fn r#get_group_current_brightness_value(
1012        &self,
1013        mut group_id: u32,
1014    ) -> fidl::client::QueryResponseFut<
1015        LightGetGroupCurrentBrightnessValueResult,
1016        fidl::encoding::DefaultFuchsiaResourceDialect,
1017    > {
1018        LightProxyInterface::r#get_group_current_brightness_value(self, group_id)
1019    }
1020
1021    /// Sets the current brightness values (0.0 - 1.0) for the light group through the values array,
1022    /// where 0.0 is minimum brightness and 1.0 is maximum.
1023    /// If group_id is invalid, INVALID_INDEX will be returned.
1024    /// If the capability 'BRIGHTNESS' is not supported by this group, returns NOT_SUPPORTED.
1025    /// Use GetGroupInfo to check if group supports this operation.
1026    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1027    pub fn r#set_group_brightness_value(
1028        &self,
1029        mut group_id: u32,
1030        mut values: &[f64],
1031    ) -> fidl::client::QueryResponseFut<
1032        LightSetGroupBrightnessValueResult,
1033        fidl::encoding::DefaultFuchsiaResourceDialect,
1034    > {
1035        LightProxyInterface::r#set_group_brightness_value(self, group_id, values)
1036    }
1037
1038    /// Returns an array of the current RGB values for the light group.
1039    /// If group_id is invalid, INVALID_INDEX will be returned.
1040    /// If the capability 'RGB' is not supported by this group, returns NOT_SUPPORTED.
1041    /// Use GetGroupInfo to check if group supports this operation.
1042    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1043    pub fn r#get_group_current_rgb_value(
1044        &self,
1045        mut group_id: u32,
1046    ) -> fidl::client::QueryResponseFut<
1047        LightGetGroupCurrentRgbValueResult,
1048        fidl::encoding::DefaultFuchsiaResourceDialect,
1049    > {
1050        LightProxyInterface::r#get_group_current_rgb_value(self, group_id)
1051    }
1052
1053    /// Sets the current RGB value for the light group.
1054    /// If group_id is invalid, INVALID_INDEX will be returned.
1055    /// If the capability 'RGB' is not supported by this group, returns NOT_SUPPORTED.
1056    /// Use GetGroupInfo to check if group supports this operation.
1057    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1058    pub fn r#set_group_rgb_value(
1059        &self,
1060        mut group_id: u32,
1061        mut values: &[Rgb],
1062    ) -> fidl::client::QueryResponseFut<
1063        LightSetGroupRgbValueResult,
1064        fidl::encoding::DefaultFuchsiaResourceDialect,
1065    > {
1066        LightProxyInterface::r#set_group_rgb_value(self, group_id, values)
1067    }
1068}
1069
1070impl LightProxyInterface for LightProxy {
1071    type GetNumLightsResponseFut =
1072        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1073    fn r#get_num_lights(&self) -> Self::GetNumLightsResponseFut {
1074        fn _decode(
1075            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1076        ) -> Result<u32, fidl::Error> {
1077            let _response = fidl::client::decode_transaction_body::<
1078                LightGetNumLightsResponse,
1079                fidl::encoding::DefaultFuchsiaResourceDialect,
1080                0x7ae2bd2ef8062dbb,
1081            >(_buf?)?;
1082            Ok(_response.count)
1083        }
1084        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
1085            (),
1086            0x7ae2bd2ef8062dbb,
1087            fidl::encoding::DynamicFlags::empty(),
1088            _decode,
1089        )
1090    }
1091
1092    type GetNumLightGroupsResponseFut =
1093        fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1094    fn r#get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut {
1095        fn _decode(
1096            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1097        ) -> Result<u32, fidl::Error> {
1098            let _response = fidl::client::decode_transaction_body::<
1099                LightGetNumLightGroupsResponse,
1100                fidl::encoding::DefaultFuchsiaResourceDialect,
1101                0x600895db5a7cbf0,
1102            >(_buf?)?;
1103            Ok(_response.count)
1104        }
1105        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
1106            (),
1107            0x600895db5a7cbf0,
1108            fidl::encoding::DynamicFlags::empty(),
1109            _decode,
1110        )
1111    }
1112
1113    type GetInfoResponseFut = fidl::client::QueryResponseFut<
1114        LightGetInfoResult,
1115        fidl::encoding::DefaultFuchsiaResourceDialect,
1116    >;
1117    fn r#get_info(&self, mut index: u32) -> Self::GetInfoResponseFut {
1118        fn _decode(
1119            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1120        ) -> Result<LightGetInfoResult, fidl::Error> {
1121            let _response = fidl::client::decode_transaction_body::<
1122                fidl::encoding::ResultType<LightGetInfoResponse, LightError>,
1123                fidl::encoding::DefaultFuchsiaResourceDialect,
1124                0x4229b55c8c4bd529,
1125            >(_buf?)?;
1126            Ok(_response.map(|x| x.info))
1127        }
1128        self.client.send_query_and_decode::<LightGetInfoRequest, LightGetInfoResult>(
1129            (index,),
1130            0x4229b55c8c4bd529,
1131            fidl::encoding::DynamicFlags::empty(),
1132            _decode,
1133        )
1134    }
1135
1136    type GetCurrentSimpleValueResponseFut = fidl::client::QueryResponseFut<
1137        LightGetCurrentSimpleValueResult,
1138        fidl::encoding::DefaultFuchsiaResourceDialect,
1139    >;
1140    fn r#get_current_simple_value(&self, mut index: u32) -> Self::GetCurrentSimpleValueResponseFut {
1141        fn _decode(
1142            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1143        ) -> Result<LightGetCurrentSimpleValueResult, fidl::Error> {
1144            let _response = fidl::client::decode_transaction_body::<
1145                fidl::encoding::ResultType<LightGetCurrentSimpleValueResponse, LightError>,
1146                fidl::encoding::DefaultFuchsiaResourceDialect,
1147                0x183154896336c321,
1148            >(_buf?)?;
1149            Ok(_response.map(|x| x.value))
1150        }
1151        self.client.send_query_and_decode::<
1152            LightGetCurrentSimpleValueRequest,
1153            LightGetCurrentSimpleValueResult,
1154        >(
1155            (index,),
1156            0x183154896336c321,
1157            fidl::encoding::DynamicFlags::empty(),
1158            _decode,
1159        )
1160    }
1161
1162    type SetSimpleValueResponseFut = fidl::client::QueryResponseFut<
1163        LightSetSimpleValueResult,
1164        fidl::encoding::DefaultFuchsiaResourceDialect,
1165    >;
1166    fn r#set_simple_value(
1167        &self,
1168        mut index: u32,
1169        mut value: bool,
1170    ) -> Self::SetSimpleValueResponseFut {
1171        fn _decode(
1172            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1173        ) -> Result<LightSetSimpleValueResult, fidl::Error> {
1174            let _response = fidl::client::decode_transaction_body::<
1175                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1176                fidl::encoding::DefaultFuchsiaResourceDialect,
1177                0x4fb33d84c1aad81d,
1178            >(_buf?)?;
1179            Ok(_response.map(|x| x))
1180        }
1181        self.client.send_query_and_decode::<LightSetSimpleValueRequest, LightSetSimpleValueResult>(
1182            (index, value),
1183            0x4fb33d84c1aad81d,
1184            fidl::encoding::DynamicFlags::empty(),
1185            _decode,
1186        )
1187    }
1188
1189    type GetCurrentBrightnessValueResponseFut = fidl::client::QueryResponseFut<
1190        LightGetCurrentBrightnessValueResult,
1191        fidl::encoding::DefaultFuchsiaResourceDialect,
1192    >;
1193    fn r#get_current_brightness_value(
1194        &self,
1195        mut index: u32,
1196    ) -> Self::GetCurrentBrightnessValueResponseFut {
1197        fn _decode(
1198            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1199        ) -> Result<LightGetCurrentBrightnessValueResult, fidl::Error> {
1200            let _response = fidl::client::decode_transaction_body::<
1201                fidl::encoding::ResultType<LightGetCurrentBrightnessValueResponse, LightError>,
1202                fidl::encoding::DefaultFuchsiaResourceDialect,
1203                0x2d387e129fe84809,
1204            >(_buf?)?;
1205            Ok(_response.map(|x| x.value))
1206        }
1207        self.client.send_query_and_decode::<
1208            LightGetCurrentBrightnessValueRequest,
1209            LightGetCurrentBrightnessValueResult,
1210        >(
1211            (index,),
1212            0x2d387e129fe84809,
1213            fidl::encoding::DynamicFlags::empty(),
1214            _decode,
1215        )
1216    }
1217
1218    type SetBrightnessValueResponseFut = fidl::client::QueryResponseFut<
1219        LightSetBrightnessValueResult,
1220        fidl::encoding::DefaultFuchsiaResourceDialect,
1221    >;
1222    fn r#set_brightness_value(
1223        &self,
1224        mut index: u32,
1225        mut value: f64,
1226    ) -> Self::SetBrightnessValueResponseFut {
1227        fn _decode(
1228            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1229        ) -> Result<LightSetBrightnessValueResult, fidl::Error> {
1230            let _response = fidl::client::decode_transaction_body::<
1231                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1232                fidl::encoding::DefaultFuchsiaResourceDialect,
1233                0x17cada93c7c48661,
1234            >(_buf?)?;
1235            Ok(_response.map(|x| x))
1236        }
1237        self.client
1238            .send_query_and_decode::<LightSetBrightnessValueRequest, LightSetBrightnessValueResult>(
1239                (index, value),
1240                0x17cada93c7c48661,
1241                fidl::encoding::DynamicFlags::empty(),
1242                _decode,
1243            )
1244    }
1245
1246    type GetCurrentRgbValueResponseFut = fidl::client::QueryResponseFut<
1247        LightGetCurrentRgbValueResult,
1248        fidl::encoding::DefaultFuchsiaResourceDialect,
1249    >;
1250    fn r#get_current_rgb_value(&self, mut index: u32) -> Self::GetCurrentRgbValueResponseFut {
1251        fn _decode(
1252            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1253        ) -> Result<LightGetCurrentRgbValueResult, fidl::Error> {
1254            let _response = fidl::client::decode_transaction_body::<
1255                fidl::encoding::ResultType<LightGetCurrentRgbValueResponse, LightError>,
1256                fidl::encoding::DefaultFuchsiaResourceDialect,
1257                0x49965ac0d920f4ad,
1258            >(_buf?)?;
1259            Ok(_response.map(|x| x.value))
1260        }
1261        self.client
1262            .send_query_and_decode::<LightGetCurrentRgbValueRequest, LightGetCurrentRgbValueResult>(
1263                (index,),
1264                0x49965ac0d920f4ad,
1265                fidl::encoding::DynamicFlags::empty(),
1266                _decode,
1267            )
1268    }
1269
1270    type SetRgbValueResponseFut = fidl::client::QueryResponseFut<
1271        LightSetRgbValueResult,
1272        fidl::encoding::DefaultFuchsiaResourceDialect,
1273    >;
1274    fn r#set_rgb_value(&self, mut index: u32, mut value: &Rgb) -> Self::SetRgbValueResponseFut {
1275        fn _decode(
1276            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1277        ) -> Result<LightSetRgbValueResult, fidl::Error> {
1278            let _response = fidl::client::decode_transaction_body::<
1279                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1280                fidl::encoding::DefaultFuchsiaResourceDialect,
1281                0x2b354d18be0b70a4,
1282            >(_buf?)?;
1283            Ok(_response.map(|x| x))
1284        }
1285        self.client.send_query_and_decode::<LightSetRgbValueRequest, LightSetRgbValueResult>(
1286            (index, value),
1287            0x2b354d18be0b70a4,
1288            fidl::encoding::DynamicFlags::empty(),
1289            _decode,
1290        )
1291    }
1292
1293    type GetGroupInfoResponseFut = fidl::client::QueryResponseFut<
1294        LightGetGroupInfoResult,
1295        fidl::encoding::DefaultFuchsiaResourceDialect,
1296    >;
1297    fn r#get_group_info(&self, mut group_id: u32) -> Self::GetGroupInfoResponseFut {
1298        fn _decode(
1299            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1300        ) -> Result<LightGetGroupInfoResult, fidl::Error> {
1301            let _response = fidl::client::decode_transaction_body::<
1302                fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>,
1303                fidl::encoding::DefaultFuchsiaResourceDialect,
1304                0x5b27b0ca755b470b,
1305            >(_buf?)?;
1306            Ok(_response.map(|x| x.info))
1307        }
1308        self.client.send_query_and_decode::<LightGetGroupInfoRequest, LightGetGroupInfoResult>(
1309            (group_id,),
1310            0x5b27b0ca755b470b,
1311            fidl::encoding::DynamicFlags::empty(),
1312            _decode,
1313        )
1314    }
1315
1316    type GetGroupCurrentSimpleValueResponseFut = fidl::client::QueryResponseFut<
1317        LightGetGroupCurrentSimpleValueResult,
1318        fidl::encoding::DefaultFuchsiaResourceDialect,
1319    >;
1320    fn r#get_group_current_simple_value(
1321        &self,
1322        mut group_id: u32,
1323    ) -> Self::GetGroupCurrentSimpleValueResponseFut {
1324        fn _decode(
1325            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1326        ) -> Result<LightGetGroupCurrentSimpleValueResult, fidl::Error> {
1327            let _response = fidl::client::decode_transaction_body::<
1328                fidl::encoding::ResultType<LightGetGroupCurrentSimpleValueResponse, LightError>,
1329                fidl::encoding::DefaultFuchsiaResourceDialect,
1330                0x659d9bdb5cc2201,
1331            >(_buf?)?;
1332            Ok(_response.map(|x| x.values))
1333        }
1334        self.client.send_query_and_decode::<
1335            LightGetGroupCurrentSimpleValueRequest,
1336            LightGetGroupCurrentSimpleValueResult,
1337        >(
1338            (group_id,),
1339            0x659d9bdb5cc2201,
1340            fidl::encoding::DynamicFlags::empty(),
1341            _decode,
1342        )
1343    }
1344
1345    type SetGroupSimpleValueResponseFut = fidl::client::QueryResponseFut<
1346        LightSetGroupSimpleValueResult,
1347        fidl::encoding::DefaultFuchsiaResourceDialect,
1348    >;
1349    fn r#set_group_simple_value(
1350        &self,
1351        mut group_id: u32,
1352        mut values: &[bool],
1353    ) -> Self::SetGroupSimpleValueResponseFut {
1354        fn _decode(
1355            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1356        ) -> Result<LightSetGroupSimpleValueResult, fidl::Error> {
1357            let _response = fidl::client::decode_transaction_body::<
1358                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1359                fidl::encoding::DefaultFuchsiaResourceDialect,
1360                0x924234e74cc6dd8,
1361            >(_buf?)?;
1362            Ok(_response.map(|x| x))
1363        }
1364        self.client.send_query_and_decode::<
1365            LightSetGroupSimpleValueRequest,
1366            LightSetGroupSimpleValueResult,
1367        >(
1368            (group_id, values,),
1369            0x924234e74cc6dd8,
1370            fidl::encoding::DynamicFlags::empty(),
1371            _decode,
1372        )
1373    }
1374
1375    type GetGroupCurrentBrightnessValueResponseFut = fidl::client::QueryResponseFut<
1376        LightGetGroupCurrentBrightnessValueResult,
1377        fidl::encoding::DefaultFuchsiaResourceDialect,
1378    >;
1379    fn r#get_group_current_brightness_value(
1380        &self,
1381        mut group_id: u32,
1382    ) -> Self::GetGroupCurrentBrightnessValueResponseFut {
1383        fn _decode(
1384            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1385        ) -> Result<LightGetGroupCurrentBrightnessValueResult, fidl::Error> {
1386            let _response = fidl::client::decode_transaction_body::<
1387                fidl::encoding::ResultType<LightGetGroupCurrentBrightnessValueResponse, LightError>,
1388                fidl::encoding::DefaultFuchsiaResourceDialect,
1389                0x3ab226120b0d0362,
1390            >(_buf?)?;
1391            Ok(_response.map(|x| x.values))
1392        }
1393        self.client.send_query_and_decode::<
1394            LightGetGroupCurrentBrightnessValueRequest,
1395            LightGetGroupCurrentBrightnessValueResult,
1396        >(
1397            (group_id,),
1398            0x3ab226120b0d0362,
1399            fidl::encoding::DynamicFlags::empty(),
1400            _decode,
1401        )
1402    }
1403
1404    type SetGroupBrightnessValueResponseFut = fidl::client::QueryResponseFut<
1405        LightSetGroupBrightnessValueResult,
1406        fidl::encoding::DefaultFuchsiaResourceDialect,
1407    >;
1408    fn r#set_group_brightness_value(
1409        &self,
1410        mut group_id: u32,
1411        mut values: &[f64],
1412    ) -> Self::SetGroupBrightnessValueResponseFut {
1413        fn _decode(
1414            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1415        ) -> Result<LightSetGroupBrightnessValueResult, fidl::Error> {
1416            let _response = fidl::client::decode_transaction_body::<
1417                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1418                fidl::encoding::DefaultFuchsiaResourceDialect,
1419                0x79e5f248fc5ec7ae,
1420            >(_buf?)?;
1421            Ok(_response.map(|x| x))
1422        }
1423        self.client.send_query_and_decode::<
1424            LightSetGroupBrightnessValueRequest,
1425            LightSetGroupBrightnessValueResult,
1426        >(
1427            (group_id, values,),
1428            0x79e5f248fc5ec7ae,
1429            fidl::encoding::DynamicFlags::empty(),
1430            _decode,
1431        )
1432    }
1433
1434    type GetGroupCurrentRgbValueResponseFut = fidl::client::QueryResponseFut<
1435        LightGetGroupCurrentRgbValueResult,
1436        fidl::encoding::DefaultFuchsiaResourceDialect,
1437    >;
1438    fn r#get_group_current_rgb_value(
1439        &self,
1440        mut group_id: u32,
1441    ) -> Self::GetGroupCurrentRgbValueResponseFut {
1442        fn _decode(
1443            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1444        ) -> Result<LightGetGroupCurrentRgbValueResult, fidl::Error> {
1445            let _response = fidl::client::decode_transaction_body::<
1446                fidl::encoding::ResultType<LightGetGroupCurrentRgbValueResponse, LightError>,
1447                fidl::encoding::DefaultFuchsiaResourceDialect,
1448                0x2a6014b41254f617,
1449            >(_buf?)?;
1450            Ok(_response.map(|x| x.values))
1451        }
1452        self.client.send_query_and_decode::<
1453            LightGetGroupCurrentRgbValueRequest,
1454            LightGetGroupCurrentRgbValueResult,
1455        >(
1456            (group_id,),
1457            0x2a6014b41254f617,
1458            fidl::encoding::DynamicFlags::empty(),
1459            _decode,
1460        )
1461    }
1462
1463    type SetGroupRgbValueResponseFut = fidl::client::QueryResponseFut<
1464        LightSetGroupRgbValueResult,
1465        fidl::encoding::DefaultFuchsiaResourceDialect,
1466    >;
1467    fn r#set_group_rgb_value(
1468        &self,
1469        mut group_id: u32,
1470        mut values: &[Rgb],
1471    ) -> Self::SetGroupRgbValueResponseFut {
1472        fn _decode(
1473            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1474        ) -> Result<LightSetGroupRgbValueResult, fidl::Error> {
1475            let _response = fidl::client::decode_transaction_body::<
1476                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>,
1477                fidl::encoding::DefaultFuchsiaResourceDialect,
1478                0x33c92316f251e4e4,
1479            >(_buf?)?;
1480            Ok(_response.map(|x| x))
1481        }
1482        self.client
1483            .send_query_and_decode::<LightSetGroupRgbValueRequest, LightSetGroupRgbValueResult>(
1484                (group_id, values),
1485                0x33c92316f251e4e4,
1486                fidl::encoding::DynamicFlags::empty(),
1487                _decode,
1488            )
1489    }
1490}
1491
1492pub struct LightEventStream {
1493    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1494}
1495
1496impl std::marker::Unpin for LightEventStream {}
1497
1498impl futures::stream::FusedStream for LightEventStream {
1499    fn is_terminated(&self) -> bool {
1500        self.event_receiver.is_terminated()
1501    }
1502}
1503
1504impl futures::Stream for LightEventStream {
1505    type Item = Result<LightEvent, fidl::Error>;
1506
1507    fn poll_next(
1508        mut self: std::pin::Pin<&mut Self>,
1509        cx: &mut std::task::Context<'_>,
1510    ) -> std::task::Poll<Option<Self::Item>> {
1511        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1512            &mut self.event_receiver,
1513            cx
1514        )?) {
1515            Some(buf) => std::task::Poll::Ready(Some(LightEvent::decode(buf))),
1516            None => std::task::Poll::Ready(None),
1517        }
1518    }
1519}
1520
1521#[derive(Debug)]
1522pub enum LightEvent {}
1523
1524impl LightEvent {
1525    /// Decodes a message buffer as a [`LightEvent`].
1526    fn decode(
1527        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1528    ) -> Result<LightEvent, fidl::Error> {
1529        let (bytes, _handles) = buf.split_mut();
1530        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1531        debug_assert_eq!(tx_header.tx_id, 0);
1532        match tx_header.ordinal {
1533            _ => Err(fidl::Error::UnknownOrdinal {
1534                ordinal: tx_header.ordinal,
1535                protocol_name: <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1536            }),
1537        }
1538    }
1539}
1540
1541/// A Stream of incoming requests for fuchsia.hardware.light/Light.
1542pub struct LightRequestStream {
1543    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1544    is_terminated: bool,
1545}
1546
1547impl std::marker::Unpin for LightRequestStream {}
1548
1549impl futures::stream::FusedStream for LightRequestStream {
1550    fn is_terminated(&self) -> bool {
1551        self.is_terminated
1552    }
1553}
1554
1555impl fidl::endpoints::RequestStream for LightRequestStream {
1556    type Protocol = LightMarker;
1557    type ControlHandle = LightControlHandle;
1558
1559    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1560        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1561    }
1562
1563    fn control_handle(&self) -> Self::ControlHandle {
1564        LightControlHandle { inner: self.inner.clone() }
1565    }
1566
1567    fn into_inner(
1568        self,
1569    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1570    {
1571        (self.inner, self.is_terminated)
1572    }
1573
1574    fn from_inner(
1575        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1576        is_terminated: bool,
1577    ) -> Self {
1578        Self { inner, is_terminated }
1579    }
1580}
1581
1582impl futures::Stream for LightRequestStream {
1583    type Item = Result<LightRequest, fidl::Error>;
1584
1585    fn poll_next(
1586        mut self: std::pin::Pin<&mut Self>,
1587        cx: &mut std::task::Context<'_>,
1588    ) -> std::task::Poll<Option<Self::Item>> {
1589        let this = &mut *self;
1590        if this.inner.check_shutdown(cx) {
1591            this.is_terminated = true;
1592            return std::task::Poll::Ready(None);
1593        }
1594        if this.is_terminated {
1595            panic!("polled LightRequestStream after completion");
1596        }
1597        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1598            |bytes, handles| {
1599                match this.inner.channel().read_etc(cx, bytes, handles) {
1600                    std::task::Poll::Ready(Ok(())) => {}
1601                    std::task::Poll::Pending => return std::task::Poll::Pending,
1602                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1603                        this.is_terminated = true;
1604                        return std::task::Poll::Ready(None);
1605                    }
1606                    std::task::Poll::Ready(Err(e)) => {
1607                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1608                            e.into(),
1609                        ))))
1610                    }
1611                }
1612
1613                // A message has been received from the channel
1614                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1615
1616                std::task::Poll::Ready(Some(match header.ordinal {
1617                    0x7ae2bd2ef8062dbb => {
1618                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1619                        let mut req = fidl::new_empty!(
1620                            fidl::encoding::EmptyPayload,
1621                            fidl::encoding::DefaultFuchsiaResourceDialect
1622                        );
1623                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1624                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1625                        Ok(LightRequest::GetNumLights {
1626                            responder: LightGetNumLightsResponder {
1627                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1628                                tx_id: header.tx_id,
1629                            },
1630                        })
1631                    }
1632                    0x600895db5a7cbf0 => {
1633                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1634                        let mut req = fidl::new_empty!(
1635                            fidl::encoding::EmptyPayload,
1636                            fidl::encoding::DefaultFuchsiaResourceDialect
1637                        );
1638                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1639                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1640                        Ok(LightRequest::GetNumLightGroups {
1641                            responder: LightGetNumLightGroupsResponder {
1642                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1643                                tx_id: header.tx_id,
1644                            },
1645                        })
1646                    }
1647                    0x4229b55c8c4bd529 => {
1648                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1649                        let mut req = fidl::new_empty!(
1650                            LightGetInfoRequest,
1651                            fidl::encoding::DefaultFuchsiaResourceDialect
1652                        );
1653                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetInfoRequest>(&header, _body_bytes, handles, &mut req)?;
1654                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1655                        Ok(LightRequest::GetInfo {
1656                            index: req.index,
1657
1658                            responder: LightGetInfoResponder {
1659                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1660                                tx_id: header.tx_id,
1661                            },
1662                        })
1663                    }
1664                    0x183154896336c321 => {
1665                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1666                        let mut req = fidl::new_empty!(
1667                            LightGetCurrentSimpleValueRequest,
1668                            fidl::encoding::DefaultFuchsiaResourceDialect
1669                        );
1670                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1671                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1672                        Ok(LightRequest::GetCurrentSimpleValue {
1673                            index: req.index,
1674
1675                            responder: LightGetCurrentSimpleValueResponder {
1676                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1677                                tx_id: header.tx_id,
1678                            },
1679                        })
1680                    }
1681                    0x4fb33d84c1aad81d => {
1682                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1683                        let mut req = fidl::new_empty!(
1684                            LightSetSimpleValueRequest,
1685                            fidl::encoding::DefaultFuchsiaResourceDialect
1686                        );
1687                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1688                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1689                        Ok(LightRequest::SetSimpleValue {
1690                            index: req.index,
1691                            value: req.value,
1692
1693                            responder: LightSetSimpleValueResponder {
1694                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1695                                tx_id: header.tx_id,
1696                            },
1697                        })
1698                    }
1699                    0x2d387e129fe84809 => {
1700                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1701                        let mut req = fidl::new_empty!(
1702                            LightGetCurrentBrightnessValueRequest,
1703                            fidl::encoding::DefaultFuchsiaResourceDialect
1704                        );
1705                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1706                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1707                        Ok(LightRequest::GetCurrentBrightnessValue {
1708                            index: req.index,
1709
1710                            responder: LightGetCurrentBrightnessValueResponder {
1711                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1712                                tx_id: header.tx_id,
1713                            },
1714                        })
1715                    }
1716                    0x17cada93c7c48661 => {
1717                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1718                        let mut req = fidl::new_empty!(
1719                            LightSetBrightnessValueRequest,
1720                            fidl::encoding::DefaultFuchsiaResourceDialect
1721                        );
1722                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1723                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1724                        Ok(LightRequest::SetBrightnessValue {
1725                            index: req.index,
1726                            value: req.value,
1727
1728                            responder: LightSetBrightnessValueResponder {
1729                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1730                                tx_id: header.tx_id,
1731                            },
1732                        })
1733                    }
1734                    0x49965ac0d920f4ad => {
1735                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1736                        let mut req = fidl::new_empty!(
1737                            LightGetCurrentRgbValueRequest,
1738                            fidl::encoding::DefaultFuchsiaResourceDialect
1739                        );
1740                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetCurrentRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1741                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1742                        Ok(LightRequest::GetCurrentRgbValue {
1743                            index: req.index,
1744
1745                            responder: LightGetCurrentRgbValueResponder {
1746                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1747                                tx_id: header.tx_id,
1748                            },
1749                        })
1750                    }
1751                    0x2b354d18be0b70a4 => {
1752                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1753                        let mut req = fidl::new_empty!(
1754                            LightSetRgbValueRequest,
1755                            fidl::encoding::DefaultFuchsiaResourceDialect
1756                        );
1757                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1758                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1759                        Ok(LightRequest::SetRgbValue {
1760                            index: req.index,
1761                            value: req.value,
1762
1763                            responder: LightSetRgbValueResponder {
1764                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1765                                tx_id: header.tx_id,
1766                            },
1767                        })
1768                    }
1769                    0x5b27b0ca755b470b => {
1770                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1771                        let mut req = fidl::new_empty!(
1772                            LightGetGroupInfoRequest,
1773                            fidl::encoding::DefaultFuchsiaResourceDialect
1774                        );
1775                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupInfoRequest>(&header, _body_bytes, handles, &mut req)?;
1776                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1777                        Ok(LightRequest::GetGroupInfo {
1778                            group_id: req.group_id,
1779
1780                            responder: LightGetGroupInfoResponder {
1781                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1782                                tx_id: header.tx_id,
1783                            },
1784                        })
1785                    }
1786                    0x659d9bdb5cc2201 => {
1787                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1788                        let mut req = fidl::new_empty!(
1789                            LightGetGroupCurrentSimpleValueRequest,
1790                            fidl::encoding::DefaultFuchsiaResourceDialect
1791                        );
1792                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1793                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1794                        Ok(LightRequest::GetGroupCurrentSimpleValue {
1795                            group_id: req.group_id,
1796
1797                            responder: LightGetGroupCurrentSimpleValueResponder {
1798                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1799                                tx_id: header.tx_id,
1800                            },
1801                        })
1802                    }
1803                    0x924234e74cc6dd8 => {
1804                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1805                        let mut req = fidl::new_empty!(
1806                            LightSetGroupSimpleValueRequest,
1807                            fidl::encoding::DefaultFuchsiaResourceDialect
1808                        );
1809                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupSimpleValueRequest>(&header, _body_bytes, handles, &mut req)?;
1810                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1811                        Ok(LightRequest::SetGroupSimpleValue {
1812                            group_id: req.group_id,
1813                            values: req.values,
1814
1815                            responder: LightSetGroupSimpleValueResponder {
1816                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1817                                tx_id: header.tx_id,
1818                            },
1819                        })
1820                    }
1821                    0x3ab226120b0d0362 => {
1822                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1823                        let mut req = fidl::new_empty!(
1824                            LightGetGroupCurrentBrightnessValueRequest,
1825                            fidl::encoding::DefaultFuchsiaResourceDialect
1826                        );
1827                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1828                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1829                        Ok(LightRequest::GetGroupCurrentBrightnessValue {
1830                            group_id: req.group_id,
1831
1832                            responder: LightGetGroupCurrentBrightnessValueResponder {
1833                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1834                                tx_id: header.tx_id,
1835                            },
1836                        })
1837                    }
1838                    0x79e5f248fc5ec7ae => {
1839                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1840                        let mut req = fidl::new_empty!(
1841                            LightSetGroupBrightnessValueRequest,
1842                            fidl::encoding::DefaultFuchsiaResourceDialect
1843                        );
1844                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupBrightnessValueRequest>(&header, _body_bytes, handles, &mut req)?;
1845                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1846                        Ok(LightRequest::SetGroupBrightnessValue {
1847                            group_id: req.group_id,
1848                            values: req.values,
1849
1850                            responder: LightSetGroupBrightnessValueResponder {
1851                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1852                                tx_id: header.tx_id,
1853                            },
1854                        })
1855                    }
1856                    0x2a6014b41254f617 => {
1857                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1858                        let mut req = fidl::new_empty!(
1859                            LightGetGroupCurrentRgbValueRequest,
1860                            fidl::encoding::DefaultFuchsiaResourceDialect
1861                        );
1862                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightGetGroupCurrentRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1863                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1864                        Ok(LightRequest::GetGroupCurrentRgbValue {
1865                            group_id: req.group_id,
1866
1867                            responder: LightGetGroupCurrentRgbValueResponder {
1868                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1869                                tx_id: header.tx_id,
1870                            },
1871                        })
1872                    }
1873                    0x33c92316f251e4e4 => {
1874                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1875                        let mut req = fidl::new_empty!(
1876                            LightSetGroupRgbValueRequest,
1877                            fidl::encoding::DefaultFuchsiaResourceDialect
1878                        );
1879                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LightSetGroupRgbValueRequest>(&header, _body_bytes, handles, &mut req)?;
1880                        let control_handle = LightControlHandle { inner: this.inner.clone() };
1881                        Ok(LightRequest::SetGroupRgbValue {
1882                            group_id: req.group_id,
1883                            values: req.values,
1884
1885                            responder: LightSetGroupRgbValueResponder {
1886                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1887                                tx_id: header.tx_id,
1888                            },
1889                        })
1890                    }
1891                    _ => Err(fidl::Error::UnknownOrdinal {
1892                        ordinal: header.ordinal,
1893                        protocol_name: <LightMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1894                    }),
1895                }))
1896            },
1897        )
1898    }
1899}
1900
1901#[derive(Debug)]
1902pub enum LightRequest {
1903    /// Returns the total number of physical lights.
1904    /// This will typically be 1 for a simple LED light, but may be greater than one for an array of
1905    /// lights or a more complicated lighting device.
1906    /// The multiple lights are addressed using "index" parameter in the calls below.
1907    GetNumLights { responder: LightGetNumLightsResponder },
1908    /// Returns the total number of light groups (does not count single lights).
1909    /// The light groups are addressed using "group_id" parameter in the calls below.
1910    GetNumLightGroups { responder: LightGetNumLightGroupsResponder },
1911    /// Returns info for the single light.
1912    /// index: Index of the light defined by board. Must be less than value returned by GetNumLights.
1913    GetInfo { index: u32, responder: LightGetInfoResponder },
1914    /// Returns the current value. If the light is ON, the value is True. If the light is OFF,
1915    /// the value is False.
1916    /// If the capability 'SIMPLE' is not supported by this light, returns NOT_SUPPORTED.
1917    /// Use GetInfo to check if light supports this operation.
1918    /// index: a number between 0 inclusive and the count received from GetNumLights.
1919    GetCurrentSimpleValue { index: u32, responder: LightGetCurrentSimpleValueResponder },
1920    /// Sets the current value. Value should be set to 'TRUE' to turn on the light. Value should be
1921    /// set to 'FALSE' to turn off the light.
1922    /// If the capability 'SIMPLE' is not supported by this light, returns NOT_SUPPORTED.
1923    /// Use GetInfo to check if light supports this operation.
1924    /// index: a number between 0 inclusive and the count received from GetNumLights.
1925    SetSimpleValue { index: u32, value: bool, responder: LightSetSimpleValueResponder },
1926    /// Returns the current brightness value (0.0 - 1.0) of the light indicated by index, where 0.0
1927    /// is minimum brightness and 1.0 is maximum.
1928    /// If the capability 'BRIGHTNESS' is not supported by this light, returns NOT_SUPPORTED.
1929    /// Use GetInfo to check if light supports this operation.
1930    /// index: a number between 0 inclusive and the count received from GetNumLights.
1931    GetCurrentBrightnessValue { index: u32, responder: LightGetCurrentBrightnessValueResponder },
1932    /// Sets the current brightness value (0.0 - 1.0), where 0.0 is minimum brightness and 1.0 is
1933    /// maximum.
1934    /// If the capability 'BRIGHTNESS' is not supported by this light, returns NOT_SUPPORTED.
1935    /// Use GetInfo to check if light supports this operation.
1936    /// index: a number between 0 inclusive and the count received from GetNumLights.
1937    SetBrightnessValue { index: u32, value: f64, responder: LightSetBrightnessValueResponder },
1938    /// Returns the current RGB value for the single light.
1939    /// If the capability 'RGB' is not supported by this light, returns NOT_SUPPORTED.
1940    /// Use GetInfo to check if light supports this operation.
1941    /// index: a number between 0 inclusive and the count received from GetNumLights.
1942    GetCurrentRgbValue { index: u32, responder: LightGetCurrentRgbValueResponder },
1943    /// Sets the current RGB value.
1944    /// If the capability 'RGB' is not supported by this light, returns NOT_SUPPORTED.
1945    /// Use GetInfo to check if light supports this operation.
1946    /// index: a number between 0 inclusive and the count received from GetNumLights.
1947    SetRgbValue { index: u32, value: Rgb, responder: LightSetRgbValueResponder },
1948    /// Returns group info for the light group.
1949    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1950    GetGroupInfo { group_id: u32, responder: LightGetGroupInfoResponder },
1951    /// Returns an array of the current values.If the light is ON, the value is True. If the light
1952    /// is OFF, the value is False.
1953    /// If group_id is invalid, INVALID_INDEX will be returned.
1954    /// If the capability 'SIMPLE' is not supported by this group, returns NOT_SUPPORTED.
1955    /// Use GetGroupInfo to check if group supports this operation.
1956    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1957    GetGroupCurrentSimpleValue {
1958        group_id: u32,
1959        responder: LightGetGroupCurrentSimpleValueResponder,
1960    },
1961    /// Sets the current values through the values array. Value should be set to 'TRUE' to turn on
1962    /// the light. Value should be set to 'FALSE' to turn off the light.
1963    /// If group_id is invalid, INVALID_INDEX will be returned.
1964    /// If the capability 'SIMPLE' is not supported by this group, returns NOT_SUPPORTED.
1965    /// Use GetGroupInfo to check if group supports this operation.
1966    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1967    SetGroupSimpleValue {
1968        group_id: u32,
1969        values: Vec<bool>,
1970        responder: LightSetGroupSimpleValueResponder,
1971    },
1972    /// Returns an array of the current brightness values (0.0 - 1.0) for the light group, where 0.0
1973    /// is minimum brightness and 1.0 is maximum.
1974    /// If group_id is invalid, INVALID_INDEX will be returned.
1975    /// If the capability 'BRIGHTNESS' is not supported by this group, returns NOT_SUPPORTED.
1976    /// Use GetGroupInfo to check if group supports this operation.
1977    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1978    GetGroupCurrentBrightnessValue {
1979        group_id: u32,
1980        responder: LightGetGroupCurrentBrightnessValueResponder,
1981    },
1982    /// Sets the current brightness values (0.0 - 1.0) for the light group through the values array,
1983    /// where 0.0 is minimum brightness and 1.0 is maximum.
1984    /// If group_id is invalid, INVALID_INDEX will be returned.
1985    /// If the capability 'BRIGHTNESS' is not supported by this group, returns NOT_SUPPORTED.
1986    /// Use GetGroupInfo to check if group supports this operation.
1987    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1988    SetGroupBrightnessValue {
1989        group_id: u32,
1990        values: Vec<f64>,
1991        responder: LightSetGroupBrightnessValueResponder,
1992    },
1993    /// Returns an array of the current RGB values for the light group.
1994    /// If group_id is invalid, INVALID_INDEX will be returned.
1995    /// If the capability 'RGB' is not supported by this group, returns NOT_SUPPORTED.
1996    /// Use GetGroupInfo to check if group supports this operation.
1997    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
1998    GetGroupCurrentRgbValue { group_id: u32, responder: LightGetGroupCurrentRgbValueResponder },
1999    /// Sets the current RGB value for the light group.
2000    /// If group_id is invalid, INVALID_INDEX will be returned.
2001    /// If the capability 'RGB' is not supported by this group, returns NOT_SUPPORTED.
2002    /// Use GetGroupInfo to check if group supports this operation.
2003    /// group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
2004    SetGroupRgbValue { group_id: u32, values: Vec<Rgb>, responder: LightSetGroupRgbValueResponder },
2005}
2006
2007impl LightRequest {
2008    #[allow(irrefutable_let_patterns)]
2009    pub fn into_get_num_lights(self) -> Option<(LightGetNumLightsResponder)> {
2010        if let LightRequest::GetNumLights { responder } = self {
2011            Some((responder))
2012        } else {
2013            None
2014        }
2015    }
2016
2017    #[allow(irrefutable_let_patterns)]
2018    pub fn into_get_num_light_groups(self) -> Option<(LightGetNumLightGroupsResponder)> {
2019        if let LightRequest::GetNumLightGroups { responder } = self {
2020            Some((responder))
2021        } else {
2022            None
2023        }
2024    }
2025
2026    #[allow(irrefutable_let_patterns)]
2027    pub fn into_get_info(self) -> Option<(u32, LightGetInfoResponder)> {
2028        if let LightRequest::GetInfo { index, responder } = self {
2029            Some((index, responder))
2030        } else {
2031            None
2032        }
2033    }
2034
2035    #[allow(irrefutable_let_patterns)]
2036    pub fn into_get_current_simple_value(
2037        self,
2038    ) -> Option<(u32, LightGetCurrentSimpleValueResponder)> {
2039        if let LightRequest::GetCurrentSimpleValue { index, responder } = self {
2040            Some((index, responder))
2041        } else {
2042            None
2043        }
2044    }
2045
2046    #[allow(irrefutable_let_patterns)]
2047    pub fn into_set_simple_value(self) -> Option<(u32, bool, LightSetSimpleValueResponder)> {
2048        if let LightRequest::SetSimpleValue { index, value, responder } = self {
2049            Some((index, value, responder))
2050        } else {
2051            None
2052        }
2053    }
2054
2055    #[allow(irrefutable_let_patterns)]
2056    pub fn into_get_current_brightness_value(
2057        self,
2058    ) -> Option<(u32, LightGetCurrentBrightnessValueResponder)> {
2059        if let LightRequest::GetCurrentBrightnessValue { index, responder } = self {
2060            Some((index, responder))
2061        } else {
2062            None
2063        }
2064    }
2065
2066    #[allow(irrefutable_let_patterns)]
2067    pub fn into_set_brightness_value(self) -> Option<(u32, f64, LightSetBrightnessValueResponder)> {
2068        if let LightRequest::SetBrightnessValue { index, value, responder } = self {
2069            Some((index, value, responder))
2070        } else {
2071            None
2072        }
2073    }
2074
2075    #[allow(irrefutable_let_patterns)]
2076    pub fn into_get_current_rgb_value(self) -> Option<(u32, LightGetCurrentRgbValueResponder)> {
2077        if let LightRequest::GetCurrentRgbValue { index, responder } = self {
2078            Some((index, responder))
2079        } else {
2080            None
2081        }
2082    }
2083
2084    #[allow(irrefutable_let_patterns)]
2085    pub fn into_set_rgb_value(self) -> Option<(u32, Rgb, LightSetRgbValueResponder)> {
2086        if let LightRequest::SetRgbValue { index, value, responder } = self {
2087            Some((index, value, responder))
2088        } else {
2089            None
2090        }
2091    }
2092
2093    #[allow(irrefutable_let_patterns)]
2094    pub fn into_get_group_info(self) -> Option<(u32, LightGetGroupInfoResponder)> {
2095        if let LightRequest::GetGroupInfo { group_id, responder } = self {
2096            Some((group_id, responder))
2097        } else {
2098            None
2099        }
2100    }
2101
2102    #[allow(irrefutable_let_patterns)]
2103    pub fn into_get_group_current_simple_value(
2104        self,
2105    ) -> Option<(u32, LightGetGroupCurrentSimpleValueResponder)> {
2106        if let LightRequest::GetGroupCurrentSimpleValue { group_id, responder } = self {
2107            Some((group_id, responder))
2108        } else {
2109            None
2110        }
2111    }
2112
2113    #[allow(irrefutable_let_patterns)]
2114    pub fn into_set_group_simple_value(
2115        self,
2116    ) -> Option<(u32, Vec<bool>, LightSetGroupSimpleValueResponder)> {
2117        if let LightRequest::SetGroupSimpleValue { group_id, values, responder } = self {
2118            Some((group_id, values, responder))
2119        } else {
2120            None
2121        }
2122    }
2123
2124    #[allow(irrefutable_let_patterns)]
2125    pub fn into_get_group_current_brightness_value(
2126        self,
2127    ) -> Option<(u32, LightGetGroupCurrentBrightnessValueResponder)> {
2128        if let LightRequest::GetGroupCurrentBrightnessValue { group_id, responder } = self {
2129            Some((group_id, responder))
2130        } else {
2131            None
2132        }
2133    }
2134
2135    #[allow(irrefutable_let_patterns)]
2136    pub fn into_set_group_brightness_value(
2137        self,
2138    ) -> Option<(u32, Vec<f64>, LightSetGroupBrightnessValueResponder)> {
2139        if let LightRequest::SetGroupBrightnessValue { group_id, values, responder } = self {
2140            Some((group_id, values, responder))
2141        } else {
2142            None
2143        }
2144    }
2145
2146    #[allow(irrefutable_let_patterns)]
2147    pub fn into_get_group_current_rgb_value(
2148        self,
2149    ) -> Option<(u32, LightGetGroupCurrentRgbValueResponder)> {
2150        if let LightRequest::GetGroupCurrentRgbValue { group_id, responder } = self {
2151            Some((group_id, responder))
2152        } else {
2153            None
2154        }
2155    }
2156
2157    #[allow(irrefutable_let_patterns)]
2158    pub fn into_set_group_rgb_value(
2159        self,
2160    ) -> Option<(u32, Vec<Rgb>, LightSetGroupRgbValueResponder)> {
2161        if let LightRequest::SetGroupRgbValue { group_id, values, responder } = self {
2162            Some((group_id, values, responder))
2163        } else {
2164            None
2165        }
2166    }
2167
2168    /// Name of the method defined in FIDL
2169    pub fn method_name(&self) -> &'static str {
2170        match *self {
2171            LightRequest::GetNumLights { .. } => "get_num_lights",
2172            LightRequest::GetNumLightGroups { .. } => "get_num_light_groups",
2173            LightRequest::GetInfo { .. } => "get_info",
2174            LightRequest::GetCurrentSimpleValue { .. } => "get_current_simple_value",
2175            LightRequest::SetSimpleValue { .. } => "set_simple_value",
2176            LightRequest::GetCurrentBrightnessValue { .. } => "get_current_brightness_value",
2177            LightRequest::SetBrightnessValue { .. } => "set_brightness_value",
2178            LightRequest::GetCurrentRgbValue { .. } => "get_current_rgb_value",
2179            LightRequest::SetRgbValue { .. } => "set_rgb_value",
2180            LightRequest::GetGroupInfo { .. } => "get_group_info",
2181            LightRequest::GetGroupCurrentSimpleValue { .. } => "get_group_current_simple_value",
2182            LightRequest::SetGroupSimpleValue { .. } => "set_group_simple_value",
2183            LightRequest::GetGroupCurrentBrightnessValue { .. } => {
2184                "get_group_current_brightness_value"
2185            }
2186            LightRequest::SetGroupBrightnessValue { .. } => "set_group_brightness_value",
2187            LightRequest::GetGroupCurrentRgbValue { .. } => "get_group_current_rgb_value",
2188            LightRequest::SetGroupRgbValue { .. } => "set_group_rgb_value",
2189        }
2190    }
2191}
2192
2193#[derive(Debug, Clone)]
2194pub struct LightControlHandle {
2195    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2196}
2197
2198impl fidl::endpoints::ControlHandle for LightControlHandle {
2199    fn shutdown(&self) {
2200        self.inner.shutdown()
2201    }
2202    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2203        self.inner.shutdown_with_epitaph(status)
2204    }
2205
2206    fn is_closed(&self) -> bool {
2207        self.inner.channel().is_closed()
2208    }
2209    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2210        self.inner.channel().on_closed()
2211    }
2212
2213    #[cfg(target_os = "fuchsia")]
2214    fn signal_peer(
2215        &self,
2216        clear_mask: zx::Signals,
2217        set_mask: zx::Signals,
2218    ) -> Result<(), zx_status::Status> {
2219        use fidl::Peered;
2220        self.inner.channel().signal_peer(clear_mask, set_mask)
2221    }
2222}
2223
2224impl LightControlHandle {}
2225
2226#[must_use = "FIDL methods require a response to be sent"]
2227#[derive(Debug)]
2228pub struct LightGetNumLightsResponder {
2229    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2230    tx_id: u32,
2231}
2232
2233/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2234/// if the responder is dropped without sending a response, so that the client
2235/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2236impl std::ops::Drop for LightGetNumLightsResponder {
2237    fn drop(&mut self) {
2238        self.control_handle.shutdown();
2239        // Safety: drops once, never accessed again
2240        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2241    }
2242}
2243
2244impl fidl::endpoints::Responder for LightGetNumLightsResponder {
2245    type ControlHandle = LightControlHandle;
2246
2247    fn control_handle(&self) -> &LightControlHandle {
2248        &self.control_handle
2249    }
2250
2251    fn drop_without_shutdown(mut self) {
2252        // Safety: drops once, never accessed again due to mem::forget
2253        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2254        // Prevent Drop from running (which would shut down the channel)
2255        std::mem::forget(self);
2256    }
2257}
2258
2259impl LightGetNumLightsResponder {
2260    /// Sends a response to the FIDL transaction.
2261    ///
2262    /// Sets the channel to shutdown if an error occurs.
2263    pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
2264        let _result = self.send_raw(count);
2265        if _result.is_err() {
2266            self.control_handle.shutdown();
2267        }
2268        self.drop_without_shutdown();
2269        _result
2270    }
2271
2272    /// Similar to "send" but does not shutdown the channel if an error occurs.
2273    pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
2274        let _result = self.send_raw(count);
2275        self.drop_without_shutdown();
2276        _result
2277    }
2278
2279    fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
2280        self.control_handle.inner.send::<LightGetNumLightsResponse>(
2281            (count,),
2282            self.tx_id,
2283            0x7ae2bd2ef8062dbb,
2284            fidl::encoding::DynamicFlags::empty(),
2285        )
2286    }
2287}
2288
2289#[must_use = "FIDL methods require a response to be sent"]
2290#[derive(Debug)]
2291pub struct LightGetNumLightGroupsResponder {
2292    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2293    tx_id: u32,
2294}
2295
2296/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2297/// if the responder is dropped without sending a response, so that the client
2298/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2299impl std::ops::Drop for LightGetNumLightGroupsResponder {
2300    fn drop(&mut self) {
2301        self.control_handle.shutdown();
2302        // Safety: drops once, never accessed again
2303        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2304    }
2305}
2306
2307impl fidl::endpoints::Responder for LightGetNumLightGroupsResponder {
2308    type ControlHandle = LightControlHandle;
2309
2310    fn control_handle(&self) -> &LightControlHandle {
2311        &self.control_handle
2312    }
2313
2314    fn drop_without_shutdown(mut self) {
2315        // Safety: drops once, never accessed again due to mem::forget
2316        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2317        // Prevent Drop from running (which would shut down the channel)
2318        std::mem::forget(self);
2319    }
2320}
2321
2322impl LightGetNumLightGroupsResponder {
2323    /// Sends a response to the FIDL transaction.
2324    ///
2325    /// Sets the channel to shutdown if an error occurs.
2326    pub fn send(self, mut count: u32) -> Result<(), fidl::Error> {
2327        let _result = self.send_raw(count);
2328        if _result.is_err() {
2329            self.control_handle.shutdown();
2330        }
2331        self.drop_without_shutdown();
2332        _result
2333    }
2334
2335    /// Similar to "send" but does not shutdown the channel if an error occurs.
2336    pub fn send_no_shutdown_on_err(self, mut count: u32) -> Result<(), fidl::Error> {
2337        let _result = self.send_raw(count);
2338        self.drop_without_shutdown();
2339        _result
2340    }
2341
2342    fn send_raw(&self, mut count: u32) -> Result<(), fidl::Error> {
2343        self.control_handle.inner.send::<LightGetNumLightGroupsResponse>(
2344            (count,),
2345            self.tx_id,
2346            0x600895db5a7cbf0,
2347            fidl::encoding::DynamicFlags::empty(),
2348        )
2349    }
2350}
2351
2352#[must_use = "FIDL methods require a response to be sent"]
2353#[derive(Debug)]
2354pub struct LightGetInfoResponder {
2355    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2356    tx_id: u32,
2357}
2358
2359/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2360/// if the responder is dropped without sending a response, so that the client
2361/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2362impl std::ops::Drop for LightGetInfoResponder {
2363    fn drop(&mut self) {
2364        self.control_handle.shutdown();
2365        // Safety: drops once, never accessed again
2366        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2367    }
2368}
2369
2370impl fidl::endpoints::Responder for LightGetInfoResponder {
2371    type ControlHandle = LightControlHandle;
2372
2373    fn control_handle(&self) -> &LightControlHandle {
2374        &self.control_handle
2375    }
2376
2377    fn drop_without_shutdown(mut self) {
2378        // Safety: drops once, never accessed again due to mem::forget
2379        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2380        // Prevent Drop from running (which would shut down the channel)
2381        std::mem::forget(self);
2382    }
2383}
2384
2385impl LightGetInfoResponder {
2386    /// Sends a response to the FIDL transaction.
2387    ///
2388    /// Sets the channel to shutdown if an error occurs.
2389    pub fn send(self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2390        let _result = self.send_raw(result);
2391        if _result.is_err() {
2392            self.control_handle.shutdown();
2393        }
2394        self.drop_without_shutdown();
2395        _result
2396    }
2397
2398    /// Similar to "send" but does not shutdown the channel if an error occurs.
2399    pub fn send_no_shutdown_on_err(
2400        self,
2401        mut result: Result<&Info, LightError>,
2402    ) -> Result<(), fidl::Error> {
2403        let _result = self.send_raw(result);
2404        self.drop_without_shutdown();
2405        _result
2406    }
2407
2408    fn send_raw(&self, mut result: Result<&Info, LightError>) -> Result<(), fidl::Error> {
2409        self.control_handle
2410            .inner
2411            .send::<fidl::encoding::ResultType<LightGetInfoResponse, LightError>>(
2412                result.map(|info| (info,)),
2413                self.tx_id,
2414                0x4229b55c8c4bd529,
2415                fidl::encoding::DynamicFlags::empty(),
2416            )
2417    }
2418}
2419
2420#[must_use = "FIDL methods require a response to be sent"]
2421#[derive(Debug)]
2422pub struct LightGetCurrentSimpleValueResponder {
2423    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2424    tx_id: u32,
2425}
2426
2427/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2428/// if the responder is dropped without sending a response, so that the client
2429/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2430impl std::ops::Drop for LightGetCurrentSimpleValueResponder {
2431    fn drop(&mut self) {
2432        self.control_handle.shutdown();
2433        // Safety: drops once, never accessed again
2434        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2435    }
2436}
2437
2438impl fidl::endpoints::Responder for LightGetCurrentSimpleValueResponder {
2439    type ControlHandle = LightControlHandle;
2440
2441    fn control_handle(&self) -> &LightControlHandle {
2442        &self.control_handle
2443    }
2444
2445    fn drop_without_shutdown(mut self) {
2446        // Safety: drops once, never accessed again due to mem::forget
2447        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2448        // Prevent Drop from running (which would shut down the channel)
2449        std::mem::forget(self);
2450    }
2451}
2452
2453impl LightGetCurrentSimpleValueResponder {
2454    /// Sends a response to the FIDL transaction.
2455    ///
2456    /// Sets the channel to shutdown if an error occurs.
2457    pub fn send(self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2458        let _result = self.send_raw(result);
2459        if _result.is_err() {
2460            self.control_handle.shutdown();
2461        }
2462        self.drop_without_shutdown();
2463        _result
2464    }
2465
2466    /// Similar to "send" but does not shutdown the channel if an error occurs.
2467    pub fn send_no_shutdown_on_err(
2468        self,
2469        mut result: Result<bool, LightError>,
2470    ) -> Result<(), fidl::Error> {
2471        let _result = self.send_raw(result);
2472        self.drop_without_shutdown();
2473        _result
2474    }
2475
2476    fn send_raw(&self, mut result: Result<bool, LightError>) -> Result<(), fidl::Error> {
2477        self.control_handle.inner.send::<fidl::encoding::ResultType<
2478            LightGetCurrentSimpleValueResponse,
2479            LightError,
2480        >>(
2481            result.map(|value| (value,)),
2482            self.tx_id,
2483            0x183154896336c321,
2484            fidl::encoding::DynamicFlags::empty(),
2485        )
2486    }
2487}
2488
2489#[must_use = "FIDL methods require a response to be sent"]
2490#[derive(Debug)]
2491pub struct LightSetSimpleValueResponder {
2492    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2493    tx_id: u32,
2494}
2495
2496/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2497/// if the responder is dropped without sending a response, so that the client
2498/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2499impl std::ops::Drop for LightSetSimpleValueResponder {
2500    fn drop(&mut self) {
2501        self.control_handle.shutdown();
2502        // Safety: drops once, never accessed again
2503        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2504    }
2505}
2506
2507impl fidl::endpoints::Responder for LightSetSimpleValueResponder {
2508    type ControlHandle = LightControlHandle;
2509
2510    fn control_handle(&self) -> &LightControlHandle {
2511        &self.control_handle
2512    }
2513
2514    fn drop_without_shutdown(mut self) {
2515        // Safety: drops once, never accessed again due to mem::forget
2516        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2517        // Prevent Drop from running (which would shut down the channel)
2518        std::mem::forget(self);
2519    }
2520}
2521
2522impl LightSetSimpleValueResponder {
2523    /// Sends a response to the FIDL transaction.
2524    ///
2525    /// Sets the channel to shutdown if an error occurs.
2526    pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2527        let _result = self.send_raw(result);
2528        if _result.is_err() {
2529            self.control_handle.shutdown();
2530        }
2531        self.drop_without_shutdown();
2532        _result
2533    }
2534
2535    /// Similar to "send" but does not shutdown the channel if an error occurs.
2536    pub fn send_no_shutdown_on_err(
2537        self,
2538        mut result: Result<(), LightError>,
2539    ) -> Result<(), fidl::Error> {
2540        let _result = self.send_raw(result);
2541        self.drop_without_shutdown();
2542        _result
2543    }
2544
2545    fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2546        self.control_handle
2547            .inner
2548            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2549                result,
2550                self.tx_id,
2551                0x4fb33d84c1aad81d,
2552                fidl::encoding::DynamicFlags::empty(),
2553            )
2554    }
2555}
2556
2557#[must_use = "FIDL methods require a response to be sent"]
2558#[derive(Debug)]
2559pub struct LightGetCurrentBrightnessValueResponder {
2560    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2561    tx_id: u32,
2562}
2563
2564/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2565/// if the responder is dropped without sending a response, so that the client
2566/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2567impl std::ops::Drop for LightGetCurrentBrightnessValueResponder {
2568    fn drop(&mut self) {
2569        self.control_handle.shutdown();
2570        // Safety: drops once, never accessed again
2571        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2572    }
2573}
2574
2575impl fidl::endpoints::Responder for LightGetCurrentBrightnessValueResponder {
2576    type ControlHandle = LightControlHandle;
2577
2578    fn control_handle(&self) -> &LightControlHandle {
2579        &self.control_handle
2580    }
2581
2582    fn drop_without_shutdown(mut self) {
2583        // Safety: drops once, never accessed again due to mem::forget
2584        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2585        // Prevent Drop from running (which would shut down the channel)
2586        std::mem::forget(self);
2587    }
2588}
2589
2590impl LightGetCurrentBrightnessValueResponder {
2591    /// Sends a response to the FIDL transaction.
2592    ///
2593    /// Sets the channel to shutdown if an error occurs.
2594    pub fn send(self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2595        let _result = self.send_raw(result);
2596        if _result.is_err() {
2597            self.control_handle.shutdown();
2598        }
2599        self.drop_without_shutdown();
2600        _result
2601    }
2602
2603    /// Similar to "send" but does not shutdown the channel if an error occurs.
2604    pub fn send_no_shutdown_on_err(
2605        self,
2606        mut result: Result<f64, LightError>,
2607    ) -> Result<(), fidl::Error> {
2608        let _result = self.send_raw(result);
2609        self.drop_without_shutdown();
2610        _result
2611    }
2612
2613    fn send_raw(&self, mut result: Result<f64, LightError>) -> Result<(), fidl::Error> {
2614        self.control_handle.inner.send::<fidl::encoding::ResultType<
2615            LightGetCurrentBrightnessValueResponse,
2616            LightError,
2617        >>(
2618            result.map(|value| (value,)),
2619            self.tx_id,
2620            0x2d387e129fe84809,
2621            fidl::encoding::DynamicFlags::empty(),
2622        )
2623    }
2624}
2625
2626#[must_use = "FIDL methods require a response to be sent"]
2627#[derive(Debug)]
2628pub struct LightSetBrightnessValueResponder {
2629    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2630    tx_id: u32,
2631}
2632
2633/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2634/// if the responder is dropped without sending a response, so that the client
2635/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2636impl std::ops::Drop for LightSetBrightnessValueResponder {
2637    fn drop(&mut self) {
2638        self.control_handle.shutdown();
2639        // Safety: drops once, never accessed again
2640        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2641    }
2642}
2643
2644impl fidl::endpoints::Responder for LightSetBrightnessValueResponder {
2645    type ControlHandle = LightControlHandle;
2646
2647    fn control_handle(&self) -> &LightControlHandle {
2648        &self.control_handle
2649    }
2650
2651    fn drop_without_shutdown(mut self) {
2652        // Safety: drops once, never accessed again due to mem::forget
2653        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2654        // Prevent Drop from running (which would shut down the channel)
2655        std::mem::forget(self);
2656    }
2657}
2658
2659impl LightSetBrightnessValueResponder {
2660    /// Sends a response to the FIDL transaction.
2661    ///
2662    /// Sets the channel to shutdown if an error occurs.
2663    pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2664        let _result = self.send_raw(result);
2665        if _result.is_err() {
2666            self.control_handle.shutdown();
2667        }
2668        self.drop_without_shutdown();
2669        _result
2670    }
2671
2672    /// Similar to "send" but does not shutdown the channel if an error occurs.
2673    pub fn send_no_shutdown_on_err(
2674        self,
2675        mut result: Result<(), LightError>,
2676    ) -> Result<(), fidl::Error> {
2677        let _result = self.send_raw(result);
2678        self.drop_without_shutdown();
2679        _result
2680    }
2681
2682    fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2683        self.control_handle
2684            .inner
2685            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2686                result,
2687                self.tx_id,
2688                0x17cada93c7c48661,
2689                fidl::encoding::DynamicFlags::empty(),
2690            )
2691    }
2692}
2693
2694#[must_use = "FIDL methods require a response to be sent"]
2695#[derive(Debug)]
2696pub struct LightGetCurrentRgbValueResponder {
2697    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2698    tx_id: u32,
2699}
2700
2701/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2702/// if the responder is dropped without sending a response, so that the client
2703/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2704impl std::ops::Drop for LightGetCurrentRgbValueResponder {
2705    fn drop(&mut self) {
2706        self.control_handle.shutdown();
2707        // Safety: drops once, never accessed again
2708        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2709    }
2710}
2711
2712impl fidl::endpoints::Responder for LightGetCurrentRgbValueResponder {
2713    type ControlHandle = LightControlHandle;
2714
2715    fn control_handle(&self) -> &LightControlHandle {
2716        &self.control_handle
2717    }
2718
2719    fn drop_without_shutdown(mut self) {
2720        // Safety: drops once, never accessed again due to mem::forget
2721        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2722        // Prevent Drop from running (which would shut down the channel)
2723        std::mem::forget(self);
2724    }
2725}
2726
2727impl LightGetCurrentRgbValueResponder {
2728    /// Sends a response to the FIDL transaction.
2729    ///
2730    /// Sets the channel to shutdown if an error occurs.
2731    pub fn send(self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2732        let _result = self.send_raw(result);
2733        if _result.is_err() {
2734            self.control_handle.shutdown();
2735        }
2736        self.drop_without_shutdown();
2737        _result
2738    }
2739
2740    /// Similar to "send" but does not shutdown the channel if an error occurs.
2741    pub fn send_no_shutdown_on_err(
2742        self,
2743        mut result: Result<&Rgb, LightError>,
2744    ) -> Result<(), fidl::Error> {
2745        let _result = self.send_raw(result);
2746        self.drop_without_shutdown();
2747        _result
2748    }
2749
2750    fn send_raw(&self, mut result: Result<&Rgb, LightError>) -> Result<(), fidl::Error> {
2751        self.control_handle.inner.send::<fidl::encoding::ResultType<
2752            LightGetCurrentRgbValueResponse,
2753            LightError,
2754        >>(
2755            result.map(|value| (value,)),
2756            self.tx_id,
2757            0x49965ac0d920f4ad,
2758            fidl::encoding::DynamicFlags::empty(),
2759        )
2760    }
2761}
2762
2763#[must_use = "FIDL methods require a response to be sent"]
2764#[derive(Debug)]
2765pub struct LightSetRgbValueResponder {
2766    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2767    tx_id: u32,
2768}
2769
2770/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2771/// if the responder is dropped without sending a response, so that the client
2772/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2773impl std::ops::Drop for LightSetRgbValueResponder {
2774    fn drop(&mut self) {
2775        self.control_handle.shutdown();
2776        // Safety: drops once, never accessed again
2777        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2778    }
2779}
2780
2781impl fidl::endpoints::Responder for LightSetRgbValueResponder {
2782    type ControlHandle = LightControlHandle;
2783
2784    fn control_handle(&self) -> &LightControlHandle {
2785        &self.control_handle
2786    }
2787
2788    fn drop_without_shutdown(mut self) {
2789        // Safety: drops once, never accessed again due to mem::forget
2790        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2791        // Prevent Drop from running (which would shut down the channel)
2792        std::mem::forget(self);
2793    }
2794}
2795
2796impl LightSetRgbValueResponder {
2797    /// Sends a response to the FIDL transaction.
2798    ///
2799    /// Sets the channel to shutdown if an error occurs.
2800    pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2801        let _result = self.send_raw(result);
2802        if _result.is_err() {
2803            self.control_handle.shutdown();
2804        }
2805        self.drop_without_shutdown();
2806        _result
2807    }
2808
2809    /// Similar to "send" but does not shutdown the channel if an error occurs.
2810    pub fn send_no_shutdown_on_err(
2811        self,
2812        mut result: Result<(), LightError>,
2813    ) -> Result<(), fidl::Error> {
2814        let _result = self.send_raw(result);
2815        self.drop_without_shutdown();
2816        _result
2817    }
2818
2819    fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
2820        self.control_handle
2821            .inner
2822            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
2823                result,
2824                self.tx_id,
2825                0x2b354d18be0b70a4,
2826                fidl::encoding::DynamicFlags::empty(),
2827            )
2828    }
2829}
2830
2831#[must_use = "FIDL methods require a response to be sent"]
2832#[derive(Debug)]
2833pub struct LightGetGroupInfoResponder {
2834    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2835    tx_id: u32,
2836}
2837
2838/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2839/// if the responder is dropped without sending a response, so that the client
2840/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2841impl std::ops::Drop for LightGetGroupInfoResponder {
2842    fn drop(&mut self) {
2843        self.control_handle.shutdown();
2844        // Safety: drops once, never accessed again
2845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2846    }
2847}
2848
2849impl fidl::endpoints::Responder for LightGetGroupInfoResponder {
2850    type ControlHandle = LightControlHandle;
2851
2852    fn control_handle(&self) -> &LightControlHandle {
2853        &self.control_handle
2854    }
2855
2856    fn drop_without_shutdown(mut self) {
2857        // Safety: drops once, never accessed again due to mem::forget
2858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2859        // Prevent Drop from running (which would shut down the channel)
2860        std::mem::forget(self);
2861    }
2862}
2863
2864impl LightGetGroupInfoResponder {
2865    /// Sends a response to the FIDL transaction.
2866    ///
2867    /// Sets the channel to shutdown if an error occurs.
2868    pub fn send(self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2869        let _result = self.send_raw(result);
2870        if _result.is_err() {
2871            self.control_handle.shutdown();
2872        }
2873        self.drop_without_shutdown();
2874        _result
2875    }
2876
2877    /// Similar to "send" but does not shutdown the channel if an error occurs.
2878    pub fn send_no_shutdown_on_err(
2879        self,
2880        mut result: Result<&GroupInfo, LightError>,
2881    ) -> Result<(), fidl::Error> {
2882        let _result = self.send_raw(result);
2883        self.drop_without_shutdown();
2884        _result
2885    }
2886
2887    fn send_raw(&self, mut result: Result<&GroupInfo, LightError>) -> Result<(), fidl::Error> {
2888        self.control_handle
2889            .inner
2890            .send::<fidl::encoding::ResultType<LightGetGroupInfoResponse, LightError>>(
2891                result.map(|info| (info,)),
2892                self.tx_id,
2893                0x5b27b0ca755b470b,
2894                fidl::encoding::DynamicFlags::empty(),
2895            )
2896    }
2897}
2898
2899#[must_use = "FIDL methods require a response to be sent"]
2900#[derive(Debug)]
2901pub struct LightGetGroupCurrentSimpleValueResponder {
2902    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2903    tx_id: u32,
2904}
2905
2906/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2907/// if the responder is dropped without sending a response, so that the client
2908/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2909impl std::ops::Drop for LightGetGroupCurrentSimpleValueResponder {
2910    fn drop(&mut self) {
2911        self.control_handle.shutdown();
2912        // Safety: drops once, never accessed again
2913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2914    }
2915}
2916
2917impl fidl::endpoints::Responder for LightGetGroupCurrentSimpleValueResponder {
2918    type ControlHandle = LightControlHandle;
2919
2920    fn control_handle(&self) -> &LightControlHandle {
2921        &self.control_handle
2922    }
2923
2924    fn drop_without_shutdown(mut self) {
2925        // Safety: drops once, never accessed again due to mem::forget
2926        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2927        // Prevent Drop from running (which would shut down the channel)
2928        std::mem::forget(self);
2929    }
2930}
2931
2932impl LightGetGroupCurrentSimpleValueResponder {
2933    /// Sends a response to the FIDL transaction.
2934    ///
2935    /// Sets the channel to shutdown if an error occurs.
2936    pub fn send(self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2937        let _result = self.send_raw(result);
2938        if _result.is_err() {
2939            self.control_handle.shutdown();
2940        }
2941        self.drop_without_shutdown();
2942        _result
2943    }
2944
2945    /// Similar to "send" but does not shutdown the channel if an error occurs.
2946    pub fn send_no_shutdown_on_err(
2947        self,
2948        mut result: Result<Option<&[bool]>, LightError>,
2949    ) -> Result<(), fidl::Error> {
2950        let _result = self.send_raw(result);
2951        self.drop_without_shutdown();
2952        _result
2953    }
2954
2955    fn send_raw(&self, mut result: Result<Option<&[bool]>, LightError>) -> Result<(), fidl::Error> {
2956        self.control_handle.inner.send::<fidl::encoding::ResultType<
2957            LightGetGroupCurrentSimpleValueResponse,
2958            LightError,
2959        >>(
2960            result.map(|values| (values,)),
2961            self.tx_id,
2962            0x659d9bdb5cc2201,
2963            fidl::encoding::DynamicFlags::empty(),
2964        )
2965    }
2966}
2967
2968#[must_use = "FIDL methods require a response to be sent"]
2969#[derive(Debug)]
2970pub struct LightSetGroupSimpleValueResponder {
2971    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
2972    tx_id: u32,
2973}
2974
2975/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
2976/// if the responder is dropped without sending a response, so that the client
2977/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2978impl std::ops::Drop for LightSetGroupSimpleValueResponder {
2979    fn drop(&mut self) {
2980        self.control_handle.shutdown();
2981        // Safety: drops once, never accessed again
2982        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2983    }
2984}
2985
2986impl fidl::endpoints::Responder for LightSetGroupSimpleValueResponder {
2987    type ControlHandle = LightControlHandle;
2988
2989    fn control_handle(&self) -> &LightControlHandle {
2990        &self.control_handle
2991    }
2992
2993    fn drop_without_shutdown(mut self) {
2994        // Safety: drops once, never accessed again due to mem::forget
2995        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2996        // Prevent Drop from running (which would shut down the channel)
2997        std::mem::forget(self);
2998    }
2999}
3000
3001impl LightSetGroupSimpleValueResponder {
3002    /// Sends a response to the FIDL transaction.
3003    ///
3004    /// Sets the channel to shutdown if an error occurs.
3005    pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3006        let _result = self.send_raw(result);
3007        if _result.is_err() {
3008            self.control_handle.shutdown();
3009        }
3010        self.drop_without_shutdown();
3011        _result
3012    }
3013
3014    /// Similar to "send" but does not shutdown the channel if an error occurs.
3015    pub fn send_no_shutdown_on_err(
3016        self,
3017        mut result: Result<(), LightError>,
3018    ) -> Result<(), fidl::Error> {
3019        let _result = self.send_raw(result);
3020        self.drop_without_shutdown();
3021        _result
3022    }
3023
3024    fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3025        self.control_handle
3026            .inner
3027            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
3028                result,
3029                self.tx_id,
3030                0x924234e74cc6dd8,
3031                fidl::encoding::DynamicFlags::empty(),
3032            )
3033    }
3034}
3035
3036#[must_use = "FIDL methods require a response to be sent"]
3037#[derive(Debug)]
3038pub struct LightGetGroupCurrentBrightnessValueResponder {
3039    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
3040    tx_id: u32,
3041}
3042
3043/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
3044/// if the responder is dropped without sending a response, so that the client
3045/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3046impl std::ops::Drop for LightGetGroupCurrentBrightnessValueResponder {
3047    fn drop(&mut self) {
3048        self.control_handle.shutdown();
3049        // Safety: drops once, never accessed again
3050        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3051    }
3052}
3053
3054impl fidl::endpoints::Responder for LightGetGroupCurrentBrightnessValueResponder {
3055    type ControlHandle = LightControlHandle;
3056
3057    fn control_handle(&self) -> &LightControlHandle {
3058        &self.control_handle
3059    }
3060
3061    fn drop_without_shutdown(mut self) {
3062        // Safety: drops once, never accessed again due to mem::forget
3063        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3064        // Prevent Drop from running (which would shut down the channel)
3065        std::mem::forget(self);
3066    }
3067}
3068
3069impl LightGetGroupCurrentBrightnessValueResponder {
3070    /// Sends a response to the FIDL transaction.
3071    ///
3072    /// Sets the channel to shutdown if an error occurs.
3073    pub fn send(self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
3074        let _result = self.send_raw(result);
3075        if _result.is_err() {
3076            self.control_handle.shutdown();
3077        }
3078        self.drop_without_shutdown();
3079        _result
3080    }
3081
3082    /// Similar to "send" but does not shutdown the channel if an error occurs.
3083    pub fn send_no_shutdown_on_err(
3084        self,
3085        mut result: Result<Option<&[f64]>, LightError>,
3086    ) -> Result<(), fidl::Error> {
3087        let _result = self.send_raw(result);
3088        self.drop_without_shutdown();
3089        _result
3090    }
3091
3092    fn send_raw(&self, mut result: Result<Option<&[f64]>, LightError>) -> Result<(), fidl::Error> {
3093        self.control_handle.inner.send::<fidl::encoding::ResultType<
3094            LightGetGroupCurrentBrightnessValueResponse,
3095            LightError,
3096        >>(
3097            result.map(|values| (values,)),
3098            self.tx_id,
3099            0x3ab226120b0d0362,
3100            fidl::encoding::DynamicFlags::empty(),
3101        )
3102    }
3103}
3104
3105#[must_use = "FIDL methods require a response to be sent"]
3106#[derive(Debug)]
3107pub struct LightSetGroupBrightnessValueResponder {
3108    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
3109    tx_id: u32,
3110}
3111
3112/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
3113/// if the responder is dropped without sending a response, so that the client
3114/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3115impl std::ops::Drop for LightSetGroupBrightnessValueResponder {
3116    fn drop(&mut self) {
3117        self.control_handle.shutdown();
3118        // Safety: drops once, never accessed again
3119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3120    }
3121}
3122
3123impl fidl::endpoints::Responder for LightSetGroupBrightnessValueResponder {
3124    type ControlHandle = LightControlHandle;
3125
3126    fn control_handle(&self) -> &LightControlHandle {
3127        &self.control_handle
3128    }
3129
3130    fn drop_without_shutdown(mut self) {
3131        // Safety: drops once, never accessed again due to mem::forget
3132        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3133        // Prevent Drop from running (which would shut down the channel)
3134        std::mem::forget(self);
3135    }
3136}
3137
3138impl LightSetGroupBrightnessValueResponder {
3139    /// Sends a response to the FIDL transaction.
3140    ///
3141    /// Sets the channel to shutdown if an error occurs.
3142    pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3143        let _result = self.send_raw(result);
3144        if _result.is_err() {
3145            self.control_handle.shutdown();
3146        }
3147        self.drop_without_shutdown();
3148        _result
3149    }
3150
3151    /// Similar to "send" but does not shutdown the channel if an error occurs.
3152    pub fn send_no_shutdown_on_err(
3153        self,
3154        mut result: Result<(), LightError>,
3155    ) -> Result<(), fidl::Error> {
3156        let _result = self.send_raw(result);
3157        self.drop_without_shutdown();
3158        _result
3159    }
3160
3161    fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3162        self.control_handle
3163            .inner
3164            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
3165                result,
3166                self.tx_id,
3167                0x79e5f248fc5ec7ae,
3168                fidl::encoding::DynamicFlags::empty(),
3169            )
3170    }
3171}
3172
3173#[must_use = "FIDL methods require a response to be sent"]
3174#[derive(Debug)]
3175pub struct LightGetGroupCurrentRgbValueResponder {
3176    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
3177    tx_id: u32,
3178}
3179
3180/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
3181/// if the responder is dropped without sending a response, so that the client
3182/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3183impl std::ops::Drop for LightGetGroupCurrentRgbValueResponder {
3184    fn drop(&mut self) {
3185        self.control_handle.shutdown();
3186        // Safety: drops once, never accessed again
3187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3188    }
3189}
3190
3191impl fidl::endpoints::Responder for LightGetGroupCurrentRgbValueResponder {
3192    type ControlHandle = LightControlHandle;
3193
3194    fn control_handle(&self) -> &LightControlHandle {
3195        &self.control_handle
3196    }
3197
3198    fn drop_without_shutdown(mut self) {
3199        // Safety: drops once, never accessed again due to mem::forget
3200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3201        // Prevent Drop from running (which would shut down the channel)
3202        std::mem::forget(self);
3203    }
3204}
3205
3206impl LightGetGroupCurrentRgbValueResponder {
3207    /// Sends a response to the FIDL transaction.
3208    ///
3209    /// Sets the channel to shutdown if an error occurs.
3210    pub fn send(self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
3211        let _result = self.send_raw(result);
3212        if _result.is_err() {
3213            self.control_handle.shutdown();
3214        }
3215        self.drop_without_shutdown();
3216        _result
3217    }
3218
3219    /// Similar to "send" but does not shutdown the channel if an error occurs.
3220    pub fn send_no_shutdown_on_err(
3221        self,
3222        mut result: Result<Option<&[Rgb]>, LightError>,
3223    ) -> Result<(), fidl::Error> {
3224        let _result = self.send_raw(result);
3225        self.drop_without_shutdown();
3226        _result
3227    }
3228
3229    fn send_raw(&self, mut result: Result<Option<&[Rgb]>, LightError>) -> Result<(), fidl::Error> {
3230        self.control_handle.inner.send::<fidl::encoding::ResultType<
3231            LightGetGroupCurrentRgbValueResponse,
3232            LightError,
3233        >>(
3234            result.map(|values| (values,)),
3235            self.tx_id,
3236            0x2a6014b41254f617,
3237            fidl::encoding::DynamicFlags::empty(),
3238        )
3239    }
3240}
3241
3242#[must_use = "FIDL methods require a response to be sent"]
3243#[derive(Debug)]
3244pub struct LightSetGroupRgbValueResponder {
3245    control_handle: std::mem::ManuallyDrop<LightControlHandle>,
3246    tx_id: u32,
3247}
3248
3249/// Set the the channel to be shutdown (see [`LightControlHandle::shutdown`])
3250/// if the responder is dropped without sending a response, so that the client
3251/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3252impl std::ops::Drop for LightSetGroupRgbValueResponder {
3253    fn drop(&mut self) {
3254        self.control_handle.shutdown();
3255        // Safety: drops once, never accessed again
3256        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3257    }
3258}
3259
3260impl fidl::endpoints::Responder for LightSetGroupRgbValueResponder {
3261    type ControlHandle = LightControlHandle;
3262
3263    fn control_handle(&self) -> &LightControlHandle {
3264        &self.control_handle
3265    }
3266
3267    fn drop_without_shutdown(mut self) {
3268        // Safety: drops once, never accessed again due to mem::forget
3269        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3270        // Prevent Drop from running (which would shut down the channel)
3271        std::mem::forget(self);
3272    }
3273}
3274
3275impl LightSetGroupRgbValueResponder {
3276    /// Sends a response to the FIDL transaction.
3277    ///
3278    /// Sets the channel to shutdown if an error occurs.
3279    pub fn send(self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3280        let _result = self.send_raw(result);
3281        if _result.is_err() {
3282            self.control_handle.shutdown();
3283        }
3284        self.drop_without_shutdown();
3285        _result
3286    }
3287
3288    /// Similar to "send" but does not shutdown the channel if an error occurs.
3289    pub fn send_no_shutdown_on_err(
3290        self,
3291        mut result: Result<(), LightError>,
3292    ) -> Result<(), fidl::Error> {
3293        let _result = self.send_raw(result);
3294        self.drop_without_shutdown();
3295        _result
3296    }
3297
3298    fn send_raw(&self, mut result: Result<(), LightError>) -> Result<(), fidl::Error> {
3299        self.control_handle
3300            .inner
3301            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, LightError>>(
3302                result,
3303                self.tx_id,
3304                0x33c92316f251e4e4,
3305                fidl::encoding::DynamicFlags::empty(),
3306            )
3307    }
3308}
3309
3310#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3311pub struct LightServiceMarker;
3312
3313#[cfg(target_os = "fuchsia")]
3314impl fidl::endpoints::ServiceMarker for LightServiceMarker {
3315    type Proxy = LightServiceProxy;
3316    type Request = LightServiceRequest;
3317    const SERVICE_NAME: &'static str = "fuchsia.hardware.light.LightService";
3318}
3319
3320/// A request for one of the member protocols of LightService.
3321///
3322#[cfg(target_os = "fuchsia")]
3323pub enum LightServiceRequest {
3324    Light(LightRequestStream),
3325}
3326
3327#[cfg(target_os = "fuchsia")]
3328impl fidl::endpoints::ServiceRequest for LightServiceRequest {
3329    type Service = LightServiceMarker;
3330
3331    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3332        match name {
3333            "light" => Self::Light(
3334                <LightRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3335            ),
3336            _ => panic!("no such member protocol name for service LightService"),
3337        }
3338    }
3339
3340    fn member_names() -> &'static [&'static str] {
3341        &["light"]
3342    }
3343}
3344#[cfg(target_os = "fuchsia")]
3345pub struct LightServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3346
3347#[cfg(target_os = "fuchsia")]
3348impl fidl::endpoints::ServiceProxy for LightServiceProxy {
3349    type Service = LightServiceMarker;
3350
3351    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3352        Self(opener)
3353    }
3354}
3355
3356#[cfg(target_os = "fuchsia")]
3357impl LightServiceProxy {
3358    pub fn connect_to_light(&self) -> Result<LightProxy, fidl::Error> {
3359        let (proxy, server_end) = fidl::endpoints::create_proxy::<LightMarker>();
3360        self.connect_channel_to_light(server_end)?;
3361        Ok(proxy)
3362    }
3363
3364    /// Like `connect_to_light`, but returns a sync proxy.
3365    /// See [`Self::connect_to_light`] for more details.
3366    pub fn connect_to_light_sync(&self) -> Result<LightSynchronousProxy, fidl::Error> {
3367        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<LightMarker>();
3368        self.connect_channel_to_light(server_end)?;
3369        Ok(proxy)
3370    }
3371
3372    /// Like `connect_to_light`, but accepts a server end.
3373    /// See [`Self::connect_to_light`] for more details.
3374    pub fn connect_channel_to_light(
3375        &self,
3376        server_end: fidl::endpoints::ServerEnd<LightMarker>,
3377    ) -> Result<(), fidl::Error> {
3378        self.0.open_member("light", server_end.into_channel())
3379    }
3380
3381    pub fn instance_name(&self) -> &str {
3382        self.0.instance_name()
3383    }
3384}
3385
3386mod internal {
3387    use super::*;
3388    unsafe impl fidl::encoding::TypeMarker for Capability {
3389        type Owned = Self;
3390
3391        #[inline(always)]
3392        fn inline_align(_context: fidl::encoding::Context) -> usize {
3393            std::mem::align_of::<u32>()
3394        }
3395
3396        #[inline(always)]
3397        fn inline_size(_context: fidl::encoding::Context) -> usize {
3398            std::mem::size_of::<u32>()
3399        }
3400
3401        #[inline(always)]
3402        fn encode_is_copy() -> bool {
3403            true
3404        }
3405
3406        #[inline(always)]
3407        fn decode_is_copy() -> bool {
3408            false
3409        }
3410    }
3411
3412    impl fidl::encoding::ValueTypeMarker for Capability {
3413        type Borrowed<'a> = Self;
3414        #[inline(always)]
3415        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3416            *value
3417        }
3418    }
3419
3420    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Capability {
3421        #[inline]
3422        unsafe fn encode(
3423            self,
3424            encoder: &mut fidl::encoding::Encoder<'_, D>,
3425            offset: usize,
3426            _depth: fidl::encoding::Depth,
3427        ) -> fidl::Result<()> {
3428            encoder.debug_check_bounds::<Self>(offset);
3429            encoder.write_num(self.into_primitive(), offset);
3430            Ok(())
3431        }
3432    }
3433
3434    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
3435        #[inline(always)]
3436        fn new_empty() -> Self {
3437            Self::Brightness
3438        }
3439
3440        #[inline]
3441        unsafe fn decode(
3442            &mut self,
3443            decoder: &mut fidl::encoding::Decoder<'_, D>,
3444            offset: usize,
3445            _depth: fidl::encoding::Depth,
3446        ) -> fidl::Result<()> {
3447            decoder.debug_check_bounds::<Self>(offset);
3448            let prim = decoder.read_num::<u32>(offset);
3449
3450            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3451            Ok(())
3452        }
3453    }
3454    unsafe impl fidl::encoding::TypeMarker for LightError {
3455        type Owned = Self;
3456
3457        #[inline(always)]
3458        fn inline_align(_context: fidl::encoding::Context) -> usize {
3459            std::mem::align_of::<u32>()
3460        }
3461
3462        #[inline(always)]
3463        fn inline_size(_context: fidl::encoding::Context) -> usize {
3464            std::mem::size_of::<u32>()
3465        }
3466
3467        #[inline(always)]
3468        fn encode_is_copy() -> bool {
3469            true
3470        }
3471
3472        #[inline(always)]
3473        fn decode_is_copy() -> bool {
3474            false
3475        }
3476    }
3477
3478    impl fidl::encoding::ValueTypeMarker for LightError {
3479        type Borrowed<'a> = Self;
3480        #[inline(always)]
3481        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3482            *value
3483        }
3484    }
3485
3486    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LightError {
3487        #[inline]
3488        unsafe fn encode(
3489            self,
3490            encoder: &mut fidl::encoding::Encoder<'_, D>,
3491            offset: usize,
3492            _depth: fidl::encoding::Depth,
3493        ) -> fidl::Result<()> {
3494            encoder.debug_check_bounds::<Self>(offset);
3495            encoder.write_num(self.into_primitive(), offset);
3496            Ok(())
3497        }
3498    }
3499
3500    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightError {
3501        #[inline(always)]
3502        fn new_empty() -> Self {
3503            Self::Ok
3504        }
3505
3506        #[inline]
3507        unsafe fn decode(
3508            &mut self,
3509            decoder: &mut fidl::encoding::Decoder<'_, D>,
3510            offset: usize,
3511            _depth: fidl::encoding::Depth,
3512        ) -> fidl::Result<()> {
3513            decoder.debug_check_bounds::<Self>(offset);
3514            let prim = decoder.read_num::<u32>(offset);
3515
3516            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3517            Ok(())
3518        }
3519    }
3520
3521    impl fidl::encoding::ValueTypeMarker for GroupInfo {
3522        type Borrowed<'a> = &'a Self;
3523        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3524            value
3525        }
3526    }
3527
3528    unsafe impl fidl::encoding::TypeMarker for GroupInfo {
3529        type Owned = Self;
3530
3531        #[inline(always)]
3532        fn inline_align(_context: fidl::encoding::Context) -> usize {
3533            8
3534        }
3535
3536        #[inline(always)]
3537        fn inline_size(_context: fidl::encoding::Context) -> usize {
3538            24
3539        }
3540    }
3541
3542    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GroupInfo, D>
3543        for &GroupInfo
3544    {
3545        #[inline]
3546        unsafe fn encode(
3547            self,
3548            encoder: &mut fidl::encoding::Encoder<'_, D>,
3549            offset: usize,
3550            _depth: fidl::encoding::Depth,
3551        ) -> fidl::Result<()> {
3552            encoder.debug_check_bounds::<GroupInfo>(offset);
3553            // Delegate to tuple encoding.
3554            fidl::encoding::Encode::<GroupInfo, D>::encode(
3555                (
3556                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
3557                        &self.name,
3558                    ),
3559                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
3560                    <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
3561                ),
3562                encoder,
3563                offset,
3564                _depth,
3565            )
3566        }
3567    }
3568    unsafe impl<
3569            D: fidl::encoding::ResourceDialect,
3570            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
3571            T1: fidl::encoding::Encode<u32, D>,
3572            T2: fidl::encoding::Encode<Capability, D>,
3573        > fidl::encoding::Encode<GroupInfo, D> for (T0, T1, T2)
3574    {
3575        #[inline]
3576        unsafe fn encode(
3577            self,
3578            encoder: &mut fidl::encoding::Encoder<'_, D>,
3579            offset: usize,
3580            depth: fidl::encoding::Depth,
3581        ) -> fidl::Result<()> {
3582            encoder.debug_check_bounds::<GroupInfo>(offset);
3583            // Zero out padding regions. There's no need to apply masks
3584            // because the unmasked parts will be overwritten by fields.
3585            // Write the fields.
3586            self.0.encode(encoder, offset + 0, depth)?;
3587            self.1.encode(encoder, offset + 16, depth)?;
3588            self.2.encode(encoder, offset + 20, depth)?;
3589            Ok(())
3590        }
3591    }
3592
3593    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GroupInfo {
3594        #[inline(always)]
3595        fn new_empty() -> Self {
3596            Self {
3597                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
3598                count: fidl::new_empty!(u32, D),
3599                capability: fidl::new_empty!(Capability, D),
3600            }
3601        }
3602
3603        #[inline]
3604        unsafe fn decode(
3605            &mut self,
3606            decoder: &mut fidl::encoding::Decoder<'_, D>,
3607            offset: usize,
3608            _depth: fidl::encoding::Depth,
3609        ) -> fidl::Result<()> {
3610            decoder.debug_check_bounds::<Self>(offset);
3611            // Verify that padding bytes are zero.
3612            fidl::decode!(
3613                fidl::encoding::BoundedString<32>,
3614                D,
3615                &mut self.name,
3616                decoder,
3617                offset + 0,
3618                _depth
3619            )?;
3620            fidl::decode!(u32, D, &mut self.count, decoder, offset + 16, _depth)?;
3621            fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 20, _depth)?;
3622            Ok(())
3623        }
3624    }
3625
3626    impl fidl::encoding::ValueTypeMarker for Info {
3627        type Borrowed<'a> = &'a Self;
3628        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3629            value
3630        }
3631    }
3632
3633    unsafe impl fidl::encoding::TypeMarker for Info {
3634        type Owned = Self;
3635
3636        #[inline(always)]
3637        fn inline_align(_context: fidl::encoding::Context) -> usize {
3638            8
3639        }
3640
3641        #[inline(always)]
3642        fn inline_size(_context: fidl::encoding::Context) -> usize {
3643            24
3644        }
3645    }
3646
3647    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
3648        #[inline]
3649        unsafe fn encode(
3650            self,
3651            encoder: &mut fidl::encoding::Encoder<'_, D>,
3652            offset: usize,
3653            _depth: fidl::encoding::Depth,
3654        ) -> fidl::Result<()> {
3655            encoder.debug_check_bounds::<Info>(offset);
3656            // Delegate to tuple encoding.
3657            fidl::encoding::Encode::<Info, D>::encode(
3658                (
3659                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
3660                        &self.name,
3661                    ),
3662                    <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
3663                ),
3664                encoder,
3665                offset,
3666                _depth,
3667            )
3668        }
3669    }
3670    unsafe impl<
3671            D: fidl::encoding::ResourceDialect,
3672            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
3673            T1: fidl::encoding::Encode<Capability, D>,
3674        > fidl::encoding::Encode<Info, D> for (T0, T1)
3675    {
3676        #[inline]
3677        unsafe fn encode(
3678            self,
3679            encoder: &mut fidl::encoding::Encoder<'_, D>,
3680            offset: usize,
3681            depth: fidl::encoding::Depth,
3682        ) -> fidl::Result<()> {
3683            encoder.debug_check_bounds::<Info>(offset);
3684            // Zero out padding regions. There's no need to apply masks
3685            // because the unmasked parts will be overwritten by fields.
3686            unsafe {
3687                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3688                (ptr as *mut u64).write_unaligned(0);
3689            }
3690            // Write the fields.
3691            self.0.encode(encoder, offset + 0, depth)?;
3692            self.1.encode(encoder, offset + 16, depth)?;
3693            Ok(())
3694        }
3695    }
3696
3697    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
3698        #[inline(always)]
3699        fn new_empty() -> Self {
3700            Self {
3701                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
3702                capability: fidl::new_empty!(Capability, D),
3703            }
3704        }
3705
3706        #[inline]
3707        unsafe fn decode(
3708            &mut self,
3709            decoder: &mut fidl::encoding::Decoder<'_, D>,
3710            offset: usize,
3711            _depth: fidl::encoding::Depth,
3712        ) -> fidl::Result<()> {
3713            decoder.debug_check_bounds::<Self>(offset);
3714            // Verify that padding bytes are zero.
3715            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3716            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3717            let mask = 0xffffffff00000000u64;
3718            let maskedval = padval & mask;
3719            if maskedval != 0 {
3720                return Err(fidl::Error::NonZeroPadding {
3721                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3722                });
3723            }
3724            fidl::decode!(
3725                fidl::encoding::BoundedString<32>,
3726                D,
3727                &mut self.name,
3728                decoder,
3729                offset + 0,
3730                _depth
3731            )?;
3732            fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 16, _depth)?;
3733            Ok(())
3734        }
3735    }
3736
3737    impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueRequest {
3738        type Borrowed<'a> = &'a Self;
3739        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3740            value
3741        }
3742    }
3743
3744    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueRequest {
3745        type Owned = Self;
3746
3747        #[inline(always)]
3748        fn inline_align(_context: fidl::encoding::Context) -> usize {
3749            4
3750        }
3751
3752        #[inline(always)]
3753        fn inline_size(_context: fidl::encoding::Context) -> usize {
3754            4
3755        }
3756        #[inline(always)]
3757        fn encode_is_copy() -> bool {
3758            true
3759        }
3760
3761        #[inline(always)]
3762        fn decode_is_copy() -> bool {
3763            true
3764        }
3765    }
3766
3767    unsafe impl<D: fidl::encoding::ResourceDialect>
3768        fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D>
3769        for &LightGetCurrentBrightnessValueRequest
3770    {
3771        #[inline]
3772        unsafe fn encode(
3773            self,
3774            encoder: &mut fidl::encoding::Encoder<'_, D>,
3775            offset: usize,
3776            _depth: fidl::encoding::Depth,
3777        ) -> fidl::Result<()> {
3778            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
3779            unsafe {
3780                // Copy the object into the buffer.
3781                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3782                (buf_ptr as *mut LightGetCurrentBrightnessValueRequest)
3783                    .write_unaligned((self as *const LightGetCurrentBrightnessValueRequest).read());
3784                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3785                // done second because the memcpy will write garbage to these bytes.
3786            }
3787            Ok(())
3788        }
3789    }
3790    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3791        fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D> for (T0,)
3792    {
3793        #[inline]
3794        unsafe fn encode(
3795            self,
3796            encoder: &mut fidl::encoding::Encoder<'_, D>,
3797            offset: usize,
3798            depth: fidl::encoding::Depth,
3799        ) -> fidl::Result<()> {
3800            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
3801            // Zero out padding regions. There's no need to apply masks
3802            // because the unmasked parts will be overwritten by fields.
3803            // Write the fields.
3804            self.0.encode(encoder, offset + 0, depth)?;
3805            Ok(())
3806        }
3807    }
3808
3809    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3810        for LightGetCurrentBrightnessValueRequest
3811    {
3812        #[inline(always)]
3813        fn new_empty() -> Self {
3814            Self { index: fidl::new_empty!(u32, D) }
3815        }
3816
3817        #[inline]
3818        unsafe fn decode(
3819            &mut self,
3820            decoder: &mut fidl::encoding::Decoder<'_, D>,
3821            offset: usize,
3822            _depth: fidl::encoding::Depth,
3823        ) -> fidl::Result<()> {
3824            decoder.debug_check_bounds::<Self>(offset);
3825            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3826            // Verify that padding bytes are zero.
3827            // Copy from the buffer into the object.
3828            unsafe {
3829                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3830            }
3831            Ok(())
3832        }
3833    }
3834
3835    impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueRequest {
3836        type Borrowed<'a> = &'a Self;
3837        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3838            value
3839        }
3840    }
3841
3842    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueRequest {
3843        type Owned = Self;
3844
3845        #[inline(always)]
3846        fn inline_align(_context: fidl::encoding::Context) -> usize {
3847            4
3848        }
3849
3850        #[inline(always)]
3851        fn inline_size(_context: fidl::encoding::Context) -> usize {
3852            4
3853        }
3854        #[inline(always)]
3855        fn encode_is_copy() -> bool {
3856            true
3857        }
3858
3859        #[inline(always)]
3860        fn decode_is_copy() -> bool {
3861            true
3862        }
3863    }
3864
3865    unsafe impl<D: fidl::encoding::ResourceDialect>
3866        fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D>
3867        for &LightGetCurrentRgbValueRequest
3868    {
3869        #[inline]
3870        unsafe fn encode(
3871            self,
3872            encoder: &mut fidl::encoding::Encoder<'_, D>,
3873            offset: usize,
3874            _depth: fidl::encoding::Depth,
3875        ) -> fidl::Result<()> {
3876            encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
3877            unsafe {
3878                // Copy the object into the buffer.
3879                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3880                (buf_ptr as *mut LightGetCurrentRgbValueRequest)
3881                    .write_unaligned((self as *const LightGetCurrentRgbValueRequest).read());
3882                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3883                // done second because the memcpy will write garbage to these bytes.
3884            }
3885            Ok(())
3886        }
3887    }
3888    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3889        fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D> for (T0,)
3890    {
3891        #[inline]
3892        unsafe fn encode(
3893            self,
3894            encoder: &mut fidl::encoding::Encoder<'_, D>,
3895            offset: usize,
3896            depth: fidl::encoding::Depth,
3897        ) -> fidl::Result<()> {
3898            encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
3899            // Zero out padding regions. There's no need to apply masks
3900            // because the unmasked parts will be overwritten by fields.
3901            // Write the fields.
3902            self.0.encode(encoder, offset + 0, depth)?;
3903            Ok(())
3904        }
3905    }
3906
3907    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3908        for LightGetCurrentRgbValueRequest
3909    {
3910        #[inline(always)]
3911        fn new_empty() -> Self {
3912            Self { index: fidl::new_empty!(u32, D) }
3913        }
3914
3915        #[inline]
3916        unsafe fn decode(
3917            &mut self,
3918            decoder: &mut fidl::encoding::Decoder<'_, D>,
3919            offset: usize,
3920            _depth: fidl::encoding::Depth,
3921        ) -> fidl::Result<()> {
3922            decoder.debug_check_bounds::<Self>(offset);
3923            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3924            // Verify that padding bytes are zero.
3925            // Copy from the buffer into the object.
3926            unsafe {
3927                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3928            }
3929            Ok(())
3930        }
3931    }
3932
3933    impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueRequest {
3934        type Borrowed<'a> = &'a Self;
3935        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3936            value
3937        }
3938    }
3939
3940    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueRequest {
3941        type Owned = Self;
3942
3943        #[inline(always)]
3944        fn inline_align(_context: fidl::encoding::Context) -> usize {
3945            4
3946        }
3947
3948        #[inline(always)]
3949        fn inline_size(_context: fidl::encoding::Context) -> usize {
3950            4
3951        }
3952        #[inline(always)]
3953        fn encode_is_copy() -> bool {
3954            true
3955        }
3956
3957        #[inline(always)]
3958        fn decode_is_copy() -> bool {
3959            true
3960        }
3961    }
3962
3963    unsafe impl<D: fidl::encoding::ResourceDialect>
3964        fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D>
3965        for &LightGetCurrentSimpleValueRequest
3966    {
3967        #[inline]
3968        unsafe fn encode(
3969            self,
3970            encoder: &mut fidl::encoding::Encoder<'_, D>,
3971            offset: usize,
3972            _depth: fidl::encoding::Depth,
3973        ) -> fidl::Result<()> {
3974            encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
3975            unsafe {
3976                // Copy the object into the buffer.
3977                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3978                (buf_ptr as *mut LightGetCurrentSimpleValueRequest)
3979                    .write_unaligned((self as *const LightGetCurrentSimpleValueRequest).read());
3980                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3981                // done second because the memcpy will write garbage to these bytes.
3982            }
3983            Ok(())
3984        }
3985    }
3986    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3987        fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D> for (T0,)
3988    {
3989        #[inline]
3990        unsafe fn encode(
3991            self,
3992            encoder: &mut fidl::encoding::Encoder<'_, D>,
3993            offset: usize,
3994            depth: fidl::encoding::Depth,
3995        ) -> fidl::Result<()> {
3996            encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
3997            // Zero out padding regions. There's no need to apply masks
3998            // because the unmasked parts will be overwritten by fields.
3999            // Write the fields.
4000            self.0.encode(encoder, offset + 0, depth)?;
4001            Ok(())
4002        }
4003    }
4004
4005    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4006        for LightGetCurrentSimpleValueRequest
4007    {
4008        #[inline(always)]
4009        fn new_empty() -> Self {
4010            Self { index: fidl::new_empty!(u32, D) }
4011        }
4012
4013        #[inline]
4014        unsafe fn decode(
4015            &mut self,
4016            decoder: &mut fidl::encoding::Decoder<'_, D>,
4017            offset: usize,
4018            _depth: fidl::encoding::Depth,
4019        ) -> fidl::Result<()> {
4020            decoder.debug_check_bounds::<Self>(offset);
4021            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4022            // Verify that padding bytes are zero.
4023            // Copy from the buffer into the object.
4024            unsafe {
4025                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4026            }
4027            Ok(())
4028        }
4029    }
4030
4031    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueRequest {
4032        type Borrowed<'a> = &'a Self;
4033        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4034            value
4035        }
4036    }
4037
4038    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueRequest {
4039        type Owned = Self;
4040
4041        #[inline(always)]
4042        fn inline_align(_context: fidl::encoding::Context) -> usize {
4043            4
4044        }
4045
4046        #[inline(always)]
4047        fn inline_size(_context: fidl::encoding::Context) -> usize {
4048            4
4049        }
4050        #[inline(always)]
4051        fn encode_is_copy() -> bool {
4052            true
4053        }
4054
4055        #[inline(always)]
4056        fn decode_is_copy() -> bool {
4057            true
4058        }
4059    }
4060
4061    unsafe impl<D: fidl::encoding::ResourceDialect>
4062        fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D>
4063        for &LightGetGroupCurrentBrightnessValueRequest
4064    {
4065        #[inline]
4066        unsafe fn encode(
4067            self,
4068            encoder: &mut fidl::encoding::Encoder<'_, D>,
4069            offset: usize,
4070            _depth: fidl::encoding::Depth,
4071        ) -> fidl::Result<()> {
4072            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
4073            unsafe {
4074                // Copy the object into the buffer.
4075                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4076                (buf_ptr as *mut LightGetGroupCurrentBrightnessValueRequest).write_unaligned(
4077                    (self as *const LightGetGroupCurrentBrightnessValueRequest).read(),
4078                );
4079                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4080                // done second because the memcpy will write garbage to these bytes.
4081            }
4082            Ok(())
4083        }
4084    }
4085    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4086        fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D> for (T0,)
4087    {
4088        #[inline]
4089        unsafe fn encode(
4090            self,
4091            encoder: &mut fidl::encoding::Encoder<'_, D>,
4092            offset: usize,
4093            depth: fidl::encoding::Depth,
4094        ) -> fidl::Result<()> {
4095            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
4096            // Zero out padding regions. There's no need to apply masks
4097            // because the unmasked parts will be overwritten by fields.
4098            // Write the fields.
4099            self.0.encode(encoder, offset + 0, depth)?;
4100            Ok(())
4101        }
4102    }
4103
4104    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4105        for LightGetGroupCurrentBrightnessValueRequest
4106    {
4107        #[inline(always)]
4108        fn new_empty() -> Self {
4109            Self { group_id: fidl::new_empty!(u32, D) }
4110        }
4111
4112        #[inline]
4113        unsafe fn decode(
4114            &mut self,
4115            decoder: &mut fidl::encoding::Decoder<'_, D>,
4116            offset: usize,
4117            _depth: fidl::encoding::Depth,
4118        ) -> fidl::Result<()> {
4119            decoder.debug_check_bounds::<Self>(offset);
4120            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4121            // Verify that padding bytes are zero.
4122            // Copy from the buffer into the object.
4123            unsafe {
4124                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4125            }
4126            Ok(())
4127        }
4128    }
4129
4130    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueRequest {
4131        type Borrowed<'a> = &'a Self;
4132        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4133            value
4134        }
4135    }
4136
4137    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueRequest {
4138        type Owned = Self;
4139
4140        #[inline(always)]
4141        fn inline_align(_context: fidl::encoding::Context) -> usize {
4142            4
4143        }
4144
4145        #[inline(always)]
4146        fn inline_size(_context: fidl::encoding::Context) -> usize {
4147            4
4148        }
4149        #[inline(always)]
4150        fn encode_is_copy() -> bool {
4151            true
4152        }
4153
4154        #[inline(always)]
4155        fn decode_is_copy() -> bool {
4156            true
4157        }
4158    }
4159
4160    unsafe impl<D: fidl::encoding::ResourceDialect>
4161        fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D>
4162        for &LightGetGroupCurrentRgbValueRequest
4163    {
4164        #[inline]
4165        unsafe fn encode(
4166            self,
4167            encoder: &mut fidl::encoding::Encoder<'_, D>,
4168            offset: usize,
4169            _depth: fidl::encoding::Depth,
4170        ) -> fidl::Result<()> {
4171            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
4172            unsafe {
4173                // Copy the object into the buffer.
4174                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4175                (buf_ptr as *mut LightGetGroupCurrentRgbValueRequest)
4176                    .write_unaligned((self as *const LightGetGroupCurrentRgbValueRequest).read());
4177                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4178                // done second because the memcpy will write garbage to these bytes.
4179            }
4180            Ok(())
4181        }
4182    }
4183    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4184        fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D> for (T0,)
4185    {
4186        #[inline]
4187        unsafe fn encode(
4188            self,
4189            encoder: &mut fidl::encoding::Encoder<'_, D>,
4190            offset: usize,
4191            depth: fidl::encoding::Depth,
4192        ) -> fidl::Result<()> {
4193            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
4194            // Zero out padding regions. There's no need to apply masks
4195            // because the unmasked parts will be overwritten by fields.
4196            // Write the fields.
4197            self.0.encode(encoder, offset + 0, depth)?;
4198            Ok(())
4199        }
4200    }
4201
4202    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4203        for LightGetGroupCurrentRgbValueRequest
4204    {
4205        #[inline(always)]
4206        fn new_empty() -> Self {
4207            Self { group_id: fidl::new_empty!(u32, D) }
4208        }
4209
4210        #[inline]
4211        unsafe fn decode(
4212            &mut self,
4213            decoder: &mut fidl::encoding::Decoder<'_, D>,
4214            offset: usize,
4215            _depth: fidl::encoding::Depth,
4216        ) -> fidl::Result<()> {
4217            decoder.debug_check_bounds::<Self>(offset);
4218            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4219            // Verify that padding bytes are zero.
4220            // Copy from the buffer into the object.
4221            unsafe {
4222                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4223            }
4224            Ok(())
4225        }
4226    }
4227
4228    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueRequest {
4229        type Borrowed<'a> = &'a Self;
4230        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4231            value
4232        }
4233    }
4234
4235    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueRequest {
4236        type Owned = Self;
4237
4238        #[inline(always)]
4239        fn inline_align(_context: fidl::encoding::Context) -> usize {
4240            4
4241        }
4242
4243        #[inline(always)]
4244        fn inline_size(_context: fidl::encoding::Context) -> usize {
4245            4
4246        }
4247        #[inline(always)]
4248        fn encode_is_copy() -> bool {
4249            true
4250        }
4251
4252        #[inline(always)]
4253        fn decode_is_copy() -> bool {
4254            true
4255        }
4256    }
4257
4258    unsafe impl<D: fidl::encoding::ResourceDialect>
4259        fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D>
4260        for &LightGetGroupCurrentSimpleValueRequest
4261    {
4262        #[inline]
4263        unsafe fn encode(
4264            self,
4265            encoder: &mut fidl::encoding::Encoder<'_, D>,
4266            offset: usize,
4267            _depth: fidl::encoding::Depth,
4268        ) -> fidl::Result<()> {
4269            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
4270            unsafe {
4271                // Copy the object into the buffer.
4272                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4273                (buf_ptr as *mut LightGetGroupCurrentSimpleValueRequest).write_unaligned(
4274                    (self as *const LightGetGroupCurrentSimpleValueRequest).read(),
4275                );
4276                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4277                // done second because the memcpy will write garbage to these bytes.
4278            }
4279            Ok(())
4280        }
4281    }
4282    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4283        fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D> for (T0,)
4284    {
4285        #[inline]
4286        unsafe fn encode(
4287            self,
4288            encoder: &mut fidl::encoding::Encoder<'_, D>,
4289            offset: usize,
4290            depth: fidl::encoding::Depth,
4291        ) -> fidl::Result<()> {
4292            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
4293            // Zero out padding regions. There's no need to apply masks
4294            // because the unmasked parts will be overwritten by fields.
4295            // Write the fields.
4296            self.0.encode(encoder, offset + 0, depth)?;
4297            Ok(())
4298        }
4299    }
4300
4301    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4302        for LightGetGroupCurrentSimpleValueRequest
4303    {
4304        #[inline(always)]
4305        fn new_empty() -> Self {
4306            Self { group_id: fidl::new_empty!(u32, D) }
4307        }
4308
4309        #[inline]
4310        unsafe fn decode(
4311            &mut self,
4312            decoder: &mut fidl::encoding::Decoder<'_, D>,
4313            offset: usize,
4314            _depth: fidl::encoding::Depth,
4315        ) -> fidl::Result<()> {
4316            decoder.debug_check_bounds::<Self>(offset);
4317            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4318            // Verify that padding bytes are zero.
4319            // Copy from the buffer into the object.
4320            unsafe {
4321                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4322            }
4323            Ok(())
4324        }
4325    }
4326
4327    impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoRequest {
4328        type Borrowed<'a> = &'a Self;
4329        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4330            value
4331        }
4332    }
4333
4334    unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoRequest {
4335        type Owned = Self;
4336
4337        #[inline(always)]
4338        fn inline_align(_context: fidl::encoding::Context) -> usize {
4339            4
4340        }
4341
4342        #[inline(always)]
4343        fn inline_size(_context: fidl::encoding::Context) -> usize {
4344            4
4345        }
4346        #[inline(always)]
4347        fn encode_is_copy() -> bool {
4348            true
4349        }
4350
4351        #[inline(always)]
4352        fn decode_is_copy() -> bool {
4353            true
4354        }
4355    }
4356
4357    unsafe impl<D: fidl::encoding::ResourceDialect>
4358        fidl::encoding::Encode<LightGetGroupInfoRequest, D> for &LightGetGroupInfoRequest
4359    {
4360        #[inline]
4361        unsafe fn encode(
4362            self,
4363            encoder: &mut fidl::encoding::Encoder<'_, D>,
4364            offset: usize,
4365            _depth: fidl::encoding::Depth,
4366        ) -> fidl::Result<()> {
4367            encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
4368            unsafe {
4369                // Copy the object into the buffer.
4370                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4371                (buf_ptr as *mut LightGetGroupInfoRequest)
4372                    .write_unaligned((self as *const LightGetGroupInfoRequest).read());
4373                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4374                // done second because the memcpy will write garbage to these bytes.
4375            }
4376            Ok(())
4377        }
4378    }
4379    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4380        fidl::encoding::Encode<LightGetGroupInfoRequest, D> for (T0,)
4381    {
4382        #[inline]
4383        unsafe fn encode(
4384            self,
4385            encoder: &mut fidl::encoding::Encoder<'_, D>,
4386            offset: usize,
4387            depth: fidl::encoding::Depth,
4388        ) -> fidl::Result<()> {
4389            encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
4390            // Zero out padding regions. There's no need to apply masks
4391            // because the unmasked parts will be overwritten by fields.
4392            // Write the fields.
4393            self.0.encode(encoder, offset + 0, depth)?;
4394            Ok(())
4395        }
4396    }
4397
4398    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4399        for LightGetGroupInfoRequest
4400    {
4401        #[inline(always)]
4402        fn new_empty() -> Self {
4403            Self { group_id: fidl::new_empty!(u32, D) }
4404        }
4405
4406        #[inline]
4407        unsafe fn decode(
4408            &mut self,
4409            decoder: &mut fidl::encoding::Decoder<'_, D>,
4410            offset: usize,
4411            _depth: fidl::encoding::Depth,
4412        ) -> fidl::Result<()> {
4413            decoder.debug_check_bounds::<Self>(offset);
4414            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4415            // Verify that padding bytes are zero.
4416            // Copy from the buffer into the object.
4417            unsafe {
4418                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4419            }
4420            Ok(())
4421        }
4422    }
4423
4424    impl fidl::encoding::ValueTypeMarker for LightGetInfoRequest {
4425        type Borrowed<'a> = &'a Self;
4426        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4427            value
4428        }
4429    }
4430
4431    unsafe impl fidl::encoding::TypeMarker for LightGetInfoRequest {
4432        type Owned = Self;
4433
4434        #[inline(always)]
4435        fn inline_align(_context: fidl::encoding::Context) -> usize {
4436            4
4437        }
4438
4439        #[inline(always)]
4440        fn inline_size(_context: fidl::encoding::Context) -> usize {
4441            4
4442        }
4443        #[inline(always)]
4444        fn encode_is_copy() -> bool {
4445            true
4446        }
4447
4448        #[inline(always)]
4449        fn decode_is_copy() -> bool {
4450            true
4451        }
4452    }
4453
4454    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoRequest, D>
4455        for &LightGetInfoRequest
4456    {
4457        #[inline]
4458        unsafe fn encode(
4459            self,
4460            encoder: &mut fidl::encoding::Encoder<'_, D>,
4461            offset: usize,
4462            _depth: fidl::encoding::Depth,
4463        ) -> fidl::Result<()> {
4464            encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
4465            unsafe {
4466                // Copy the object into the buffer.
4467                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4468                (buf_ptr as *mut LightGetInfoRequest)
4469                    .write_unaligned((self as *const LightGetInfoRequest).read());
4470                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4471                // done second because the memcpy will write garbage to these bytes.
4472            }
4473            Ok(())
4474        }
4475    }
4476    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4477        fidl::encoding::Encode<LightGetInfoRequest, D> for (T0,)
4478    {
4479        #[inline]
4480        unsafe fn encode(
4481            self,
4482            encoder: &mut fidl::encoding::Encoder<'_, D>,
4483            offset: usize,
4484            depth: fidl::encoding::Depth,
4485        ) -> fidl::Result<()> {
4486            encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
4487            // Zero out padding regions. There's no need to apply masks
4488            // because the unmasked parts will be overwritten by fields.
4489            // Write the fields.
4490            self.0.encode(encoder, offset + 0, depth)?;
4491            Ok(())
4492        }
4493    }
4494
4495    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoRequest {
4496        #[inline(always)]
4497        fn new_empty() -> Self {
4498            Self { index: fidl::new_empty!(u32, D) }
4499        }
4500
4501        #[inline]
4502        unsafe fn decode(
4503            &mut self,
4504            decoder: &mut fidl::encoding::Decoder<'_, D>,
4505            offset: usize,
4506            _depth: fidl::encoding::Depth,
4507        ) -> fidl::Result<()> {
4508            decoder.debug_check_bounds::<Self>(offset);
4509            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4510            // Verify that padding bytes are zero.
4511            // Copy from the buffer into the object.
4512            unsafe {
4513                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4514            }
4515            Ok(())
4516        }
4517    }
4518
4519    impl fidl::encoding::ValueTypeMarker for LightGetNumLightGroupsResponse {
4520        type Borrowed<'a> = &'a Self;
4521        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4522            value
4523        }
4524    }
4525
4526    unsafe impl fidl::encoding::TypeMarker for LightGetNumLightGroupsResponse {
4527        type Owned = Self;
4528
4529        #[inline(always)]
4530        fn inline_align(_context: fidl::encoding::Context) -> usize {
4531            4
4532        }
4533
4534        #[inline(always)]
4535        fn inline_size(_context: fidl::encoding::Context) -> usize {
4536            4
4537        }
4538        #[inline(always)]
4539        fn encode_is_copy() -> bool {
4540            true
4541        }
4542
4543        #[inline(always)]
4544        fn decode_is_copy() -> bool {
4545            true
4546        }
4547    }
4548
4549    unsafe impl<D: fidl::encoding::ResourceDialect>
4550        fidl::encoding::Encode<LightGetNumLightGroupsResponse, D>
4551        for &LightGetNumLightGroupsResponse
4552    {
4553        #[inline]
4554        unsafe fn encode(
4555            self,
4556            encoder: &mut fidl::encoding::Encoder<'_, D>,
4557            offset: usize,
4558            _depth: fidl::encoding::Depth,
4559        ) -> fidl::Result<()> {
4560            encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
4561            unsafe {
4562                // Copy the object into the buffer.
4563                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4564                (buf_ptr as *mut LightGetNumLightGroupsResponse)
4565                    .write_unaligned((self as *const LightGetNumLightGroupsResponse).read());
4566                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4567                // done second because the memcpy will write garbage to these bytes.
4568            }
4569            Ok(())
4570        }
4571    }
4572    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4573        fidl::encoding::Encode<LightGetNumLightGroupsResponse, D> for (T0,)
4574    {
4575        #[inline]
4576        unsafe fn encode(
4577            self,
4578            encoder: &mut fidl::encoding::Encoder<'_, D>,
4579            offset: usize,
4580            depth: fidl::encoding::Depth,
4581        ) -> fidl::Result<()> {
4582            encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
4583            // Zero out padding regions. There's no need to apply masks
4584            // because the unmasked parts will be overwritten by fields.
4585            // Write the fields.
4586            self.0.encode(encoder, offset + 0, depth)?;
4587            Ok(())
4588        }
4589    }
4590
4591    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4592        for LightGetNumLightGroupsResponse
4593    {
4594        #[inline(always)]
4595        fn new_empty() -> Self {
4596            Self { count: fidl::new_empty!(u32, D) }
4597        }
4598
4599        #[inline]
4600        unsafe fn decode(
4601            &mut self,
4602            decoder: &mut fidl::encoding::Decoder<'_, D>,
4603            offset: usize,
4604            _depth: fidl::encoding::Depth,
4605        ) -> fidl::Result<()> {
4606            decoder.debug_check_bounds::<Self>(offset);
4607            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4608            // Verify that padding bytes are zero.
4609            // Copy from the buffer into the object.
4610            unsafe {
4611                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4612            }
4613            Ok(())
4614        }
4615    }
4616
4617    impl fidl::encoding::ValueTypeMarker for LightGetNumLightsResponse {
4618        type Borrowed<'a> = &'a Self;
4619        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4620            value
4621        }
4622    }
4623
4624    unsafe impl fidl::encoding::TypeMarker for LightGetNumLightsResponse {
4625        type Owned = Self;
4626
4627        #[inline(always)]
4628        fn inline_align(_context: fidl::encoding::Context) -> usize {
4629            4
4630        }
4631
4632        #[inline(always)]
4633        fn inline_size(_context: fidl::encoding::Context) -> usize {
4634            4
4635        }
4636        #[inline(always)]
4637        fn encode_is_copy() -> bool {
4638            true
4639        }
4640
4641        #[inline(always)]
4642        fn decode_is_copy() -> bool {
4643            true
4644        }
4645    }
4646
4647    unsafe impl<D: fidl::encoding::ResourceDialect>
4648        fidl::encoding::Encode<LightGetNumLightsResponse, D> for &LightGetNumLightsResponse
4649    {
4650        #[inline]
4651        unsafe fn encode(
4652            self,
4653            encoder: &mut fidl::encoding::Encoder<'_, D>,
4654            offset: usize,
4655            _depth: fidl::encoding::Depth,
4656        ) -> fidl::Result<()> {
4657            encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
4658            unsafe {
4659                // Copy the object into the buffer.
4660                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4661                (buf_ptr as *mut LightGetNumLightsResponse)
4662                    .write_unaligned((self as *const LightGetNumLightsResponse).read());
4663                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4664                // done second because the memcpy will write garbage to these bytes.
4665            }
4666            Ok(())
4667        }
4668    }
4669    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4670        fidl::encoding::Encode<LightGetNumLightsResponse, D> for (T0,)
4671    {
4672        #[inline]
4673        unsafe fn encode(
4674            self,
4675            encoder: &mut fidl::encoding::Encoder<'_, D>,
4676            offset: usize,
4677            depth: fidl::encoding::Depth,
4678        ) -> fidl::Result<()> {
4679            encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
4680            // Zero out padding regions. There's no need to apply masks
4681            // because the unmasked parts will be overwritten by fields.
4682            // Write the fields.
4683            self.0.encode(encoder, offset + 0, depth)?;
4684            Ok(())
4685        }
4686    }
4687
4688    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4689        for LightGetNumLightsResponse
4690    {
4691        #[inline(always)]
4692        fn new_empty() -> Self {
4693            Self { count: fidl::new_empty!(u32, D) }
4694        }
4695
4696        #[inline]
4697        unsafe fn decode(
4698            &mut self,
4699            decoder: &mut fidl::encoding::Decoder<'_, D>,
4700            offset: usize,
4701            _depth: fidl::encoding::Depth,
4702        ) -> fidl::Result<()> {
4703            decoder.debug_check_bounds::<Self>(offset);
4704            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4705            // Verify that padding bytes are zero.
4706            // Copy from the buffer into the object.
4707            unsafe {
4708                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4709            }
4710            Ok(())
4711        }
4712    }
4713
4714    impl fidl::encoding::ValueTypeMarker for LightSetBrightnessValueRequest {
4715        type Borrowed<'a> = &'a Self;
4716        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4717            value
4718        }
4719    }
4720
4721    unsafe impl fidl::encoding::TypeMarker for LightSetBrightnessValueRequest {
4722        type Owned = Self;
4723
4724        #[inline(always)]
4725        fn inline_align(_context: fidl::encoding::Context) -> usize {
4726            8
4727        }
4728
4729        #[inline(always)]
4730        fn inline_size(_context: fidl::encoding::Context) -> usize {
4731            16
4732        }
4733    }
4734
4735    unsafe impl<D: fidl::encoding::ResourceDialect>
4736        fidl::encoding::Encode<LightSetBrightnessValueRequest, D>
4737        for &LightSetBrightnessValueRequest
4738    {
4739        #[inline]
4740        unsafe fn encode(
4741            self,
4742            encoder: &mut fidl::encoding::Encoder<'_, D>,
4743            offset: usize,
4744            _depth: fidl::encoding::Depth,
4745        ) -> fidl::Result<()> {
4746            encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
4747            // Delegate to tuple encoding.
4748            fidl::encoding::Encode::<LightSetBrightnessValueRequest, D>::encode(
4749                (
4750                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
4751                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4752                ),
4753                encoder,
4754                offset,
4755                _depth,
4756            )
4757        }
4758    }
4759    unsafe impl<
4760            D: fidl::encoding::ResourceDialect,
4761            T0: fidl::encoding::Encode<u32, D>,
4762            T1: fidl::encoding::Encode<f64, D>,
4763        > fidl::encoding::Encode<LightSetBrightnessValueRequest, D> for (T0, T1)
4764    {
4765        #[inline]
4766        unsafe fn encode(
4767            self,
4768            encoder: &mut fidl::encoding::Encoder<'_, D>,
4769            offset: usize,
4770            depth: fidl::encoding::Depth,
4771        ) -> fidl::Result<()> {
4772            encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
4773            // Zero out padding regions. There's no need to apply masks
4774            // because the unmasked parts will be overwritten by fields.
4775            unsafe {
4776                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4777                (ptr as *mut u64).write_unaligned(0);
4778            }
4779            // Write the fields.
4780            self.0.encode(encoder, offset + 0, depth)?;
4781            self.1.encode(encoder, offset + 8, depth)?;
4782            Ok(())
4783        }
4784    }
4785
4786    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4787        for LightSetBrightnessValueRequest
4788    {
4789        #[inline(always)]
4790        fn new_empty() -> Self {
4791            Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(f64, D) }
4792        }
4793
4794        #[inline]
4795        unsafe fn decode(
4796            &mut self,
4797            decoder: &mut fidl::encoding::Decoder<'_, D>,
4798            offset: usize,
4799            _depth: fidl::encoding::Depth,
4800        ) -> fidl::Result<()> {
4801            decoder.debug_check_bounds::<Self>(offset);
4802            // Verify that padding bytes are zero.
4803            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4804            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4805            let mask = 0xffffffff00000000u64;
4806            let maskedval = padval & mask;
4807            if maskedval != 0 {
4808                return Err(fidl::Error::NonZeroPadding {
4809                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4810                });
4811            }
4812            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
4813            fidl::decode!(f64, D, &mut self.value, decoder, offset + 8, _depth)?;
4814            Ok(())
4815        }
4816    }
4817
4818    impl fidl::encoding::ValueTypeMarker for LightSetGroupBrightnessValueRequest {
4819        type Borrowed<'a> = &'a Self;
4820        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4821            value
4822        }
4823    }
4824
4825    unsafe impl fidl::encoding::TypeMarker for LightSetGroupBrightnessValueRequest {
4826        type Owned = Self;
4827
4828        #[inline(always)]
4829        fn inline_align(_context: fidl::encoding::Context) -> usize {
4830            8
4831        }
4832
4833        #[inline(always)]
4834        fn inline_size(_context: fidl::encoding::Context) -> usize {
4835            24
4836        }
4837    }
4838
4839    unsafe impl<D: fidl::encoding::ResourceDialect>
4840        fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D>
4841        for &LightSetGroupBrightnessValueRequest
4842    {
4843        #[inline]
4844        unsafe fn encode(
4845            self,
4846            encoder: &mut fidl::encoding::Encoder<'_, D>,
4847            offset: usize,
4848            _depth: fidl::encoding::Depth,
4849        ) -> fidl::Result<()> {
4850            encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
4851            // Delegate to tuple encoding.
4852            fidl::encoding::Encode::<LightSetGroupBrightnessValueRequest, D>::encode(
4853                (
4854                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
4855                    <fidl::encoding::UnboundedVector<f64> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
4856                ),
4857                encoder, offset, _depth
4858            )
4859        }
4860    }
4861    unsafe impl<
4862            D: fidl::encoding::ResourceDialect,
4863            T0: fidl::encoding::Encode<u32, D>,
4864            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<f64>, D>,
4865        > fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D> for (T0, T1)
4866    {
4867        #[inline]
4868        unsafe fn encode(
4869            self,
4870            encoder: &mut fidl::encoding::Encoder<'_, D>,
4871            offset: usize,
4872            depth: fidl::encoding::Depth,
4873        ) -> fidl::Result<()> {
4874            encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
4875            // Zero out padding regions. There's no need to apply masks
4876            // because the unmasked parts will be overwritten by fields.
4877            unsafe {
4878                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4879                (ptr as *mut u64).write_unaligned(0);
4880            }
4881            // Write the fields.
4882            self.0.encode(encoder, offset + 0, depth)?;
4883            self.1.encode(encoder, offset + 8, depth)?;
4884            Ok(())
4885        }
4886    }
4887
4888    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4889        for LightSetGroupBrightnessValueRequest
4890    {
4891        #[inline(always)]
4892        fn new_empty() -> Self {
4893            Self {
4894                group_id: fidl::new_empty!(u32, D),
4895                values: fidl::new_empty!(fidl::encoding::UnboundedVector<f64>, D),
4896            }
4897        }
4898
4899        #[inline]
4900        unsafe fn decode(
4901            &mut self,
4902            decoder: &mut fidl::encoding::Decoder<'_, D>,
4903            offset: usize,
4904            _depth: fidl::encoding::Depth,
4905        ) -> fidl::Result<()> {
4906            decoder.debug_check_bounds::<Self>(offset);
4907            // Verify that padding bytes are zero.
4908            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4909            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4910            let mask = 0xffffffff00000000u64;
4911            let maskedval = padval & mask;
4912            if maskedval != 0 {
4913                return Err(fidl::Error::NonZeroPadding {
4914                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4915                });
4916            }
4917            fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
4918            fidl::decode!(
4919                fidl::encoding::UnboundedVector<f64>,
4920                D,
4921                &mut self.values,
4922                decoder,
4923                offset + 8,
4924                _depth
4925            )?;
4926            Ok(())
4927        }
4928    }
4929
4930    impl fidl::encoding::ValueTypeMarker for LightSetGroupRgbValueRequest {
4931        type Borrowed<'a> = &'a Self;
4932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4933            value
4934        }
4935    }
4936
4937    unsafe impl fidl::encoding::TypeMarker for LightSetGroupRgbValueRequest {
4938        type Owned = Self;
4939
4940        #[inline(always)]
4941        fn inline_align(_context: fidl::encoding::Context) -> usize {
4942            8
4943        }
4944
4945        #[inline(always)]
4946        fn inline_size(_context: fidl::encoding::Context) -> usize {
4947            24
4948        }
4949    }
4950
4951    unsafe impl<D: fidl::encoding::ResourceDialect>
4952        fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for &LightSetGroupRgbValueRequest
4953    {
4954        #[inline]
4955        unsafe fn encode(
4956            self,
4957            encoder: &mut fidl::encoding::Encoder<'_, D>,
4958            offset: usize,
4959            _depth: fidl::encoding::Depth,
4960        ) -> fidl::Result<()> {
4961            encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
4962            // Delegate to tuple encoding.
4963            fidl::encoding::Encode::<LightSetGroupRgbValueRequest, D>::encode(
4964                (
4965                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
4966                    <fidl::encoding::UnboundedVector<Rgb> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
4967                ),
4968                encoder, offset, _depth
4969            )
4970        }
4971    }
4972    unsafe impl<
4973            D: fidl::encoding::ResourceDialect,
4974            T0: fidl::encoding::Encode<u32, D>,
4975            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Rgb>, D>,
4976        > fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for (T0, T1)
4977    {
4978        #[inline]
4979        unsafe fn encode(
4980            self,
4981            encoder: &mut fidl::encoding::Encoder<'_, D>,
4982            offset: usize,
4983            depth: fidl::encoding::Depth,
4984        ) -> fidl::Result<()> {
4985            encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
4986            // Zero out padding regions. There's no need to apply masks
4987            // because the unmasked parts will be overwritten by fields.
4988            unsafe {
4989                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4990                (ptr as *mut u64).write_unaligned(0);
4991            }
4992            // Write the fields.
4993            self.0.encode(encoder, offset + 0, depth)?;
4994            self.1.encode(encoder, offset + 8, depth)?;
4995            Ok(())
4996        }
4997    }
4998
4999    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5000        for LightSetGroupRgbValueRequest
5001    {
5002        #[inline(always)]
5003        fn new_empty() -> Self {
5004            Self {
5005                group_id: fidl::new_empty!(u32, D),
5006                values: fidl::new_empty!(fidl::encoding::UnboundedVector<Rgb>, D),
5007            }
5008        }
5009
5010        #[inline]
5011        unsafe fn decode(
5012            &mut self,
5013            decoder: &mut fidl::encoding::Decoder<'_, D>,
5014            offset: usize,
5015            _depth: fidl::encoding::Depth,
5016        ) -> fidl::Result<()> {
5017            decoder.debug_check_bounds::<Self>(offset);
5018            // Verify that padding bytes are zero.
5019            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5020            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5021            let mask = 0xffffffff00000000u64;
5022            let maskedval = padval & mask;
5023            if maskedval != 0 {
5024                return Err(fidl::Error::NonZeroPadding {
5025                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5026                });
5027            }
5028            fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
5029            fidl::decode!(
5030                fidl::encoding::UnboundedVector<Rgb>,
5031                D,
5032                &mut self.values,
5033                decoder,
5034                offset + 8,
5035                _depth
5036            )?;
5037            Ok(())
5038        }
5039    }
5040
5041    impl fidl::encoding::ValueTypeMarker for LightSetGroupSimpleValueRequest {
5042        type Borrowed<'a> = &'a Self;
5043        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5044            value
5045        }
5046    }
5047
5048    unsafe impl fidl::encoding::TypeMarker for LightSetGroupSimpleValueRequest {
5049        type Owned = Self;
5050
5051        #[inline(always)]
5052        fn inline_align(_context: fidl::encoding::Context) -> usize {
5053            8
5054        }
5055
5056        #[inline(always)]
5057        fn inline_size(_context: fidl::encoding::Context) -> usize {
5058            24
5059        }
5060    }
5061
5062    unsafe impl<D: fidl::encoding::ResourceDialect>
5063        fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D>
5064        for &LightSetGroupSimpleValueRequest
5065    {
5066        #[inline]
5067        unsafe fn encode(
5068            self,
5069            encoder: &mut fidl::encoding::Encoder<'_, D>,
5070            offset: usize,
5071            _depth: fidl::encoding::Depth,
5072        ) -> fidl::Result<()> {
5073            encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
5074            // Delegate to tuple encoding.
5075            fidl::encoding::Encode::<LightSetGroupSimpleValueRequest, D>::encode(
5076                (
5077                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
5078                    <fidl::encoding::UnboundedVector<bool> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
5079                ),
5080                encoder, offset, _depth
5081            )
5082        }
5083    }
5084    unsafe impl<
5085            D: fidl::encoding::ResourceDialect,
5086            T0: fidl::encoding::Encode<u32, D>,
5087            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<bool>, D>,
5088        > fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D> for (T0, T1)
5089    {
5090        #[inline]
5091        unsafe fn encode(
5092            self,
5093            encoder: &mut fidl::encoding::Encoder<'_, D>,
5094            offset: usize,
5095            depth: fidl::encoding::Depth,
5096        ) -> fidl::Result<()> {
5097            encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
5098            // Zero out padding regions. There's no need to apply masks
5099            // because the unmasked parts will be overwritten by fields.
5100            unsafe {
5101                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5102                (ptr as *mut u64).write_unaligned(0);
5103            }
5104            // Write the fields.
5105            self.0.encode(encoder, offset + 0, depth)?;
5106            self.1.encode(encoder, offset + 8, depth)?;
5107            Ok(())
5108        }
5109    }
5110
5111    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5112        for LightSetGroupSimpleValueRequest
5113    {
5114        #[inline(always)]
5115        fn new_empty() -> Self {
5116            Self {
5117                group_id: fidl::new_empty!(u32, D),
5118                values: fidl::new_empty!(fidl::encoding::UnboundedVector<bool>, D),
5119            }
5120        }
5121
5122        #[inline]
5123        unsafe fn decode(
5124            &mut self,
5125            decoder: &mut fidl::encoding::Decoder<'_, D>,
5126            offset: usize,
5127            _depth: fidl::encoding::Depth,
5128        ) -> fidl::Result<()> {
5129            decoder.debug_check_bounds::<Self>(offset);
5130            // Verify that padding bytes are zero.
5131            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5132            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5133            let mask = 0xffffffff00000000u64;
5134            let maskedval = padval & mask;
5135            if maskedval != 0 {
5136                return Err(fidl::Error::NonZeroPadding {
5137                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5138                });
5139            }
5140            fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
5141            fidl::decode!(
5142                fidl::encoding::UnboundedVector<bool>,
5143                D,
5144                &mut self.values,
5145                decoder,
5146                offset + 8,
5147                _depth
5148            )?;
5149            Ok(())
5150        }
5151    }
5152
5153    impl fidl::encoding::ValueTypeMarker for LightSetRgbValueRequest {
5154        type Borrowed<'a> = &'a Self;
5155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5156            value
5157        }
5158    }
5159
5160    unsafe impl fidl::encoding::TypeMarker for LightSetRgbValueRequest {
5161        type Owned = Self;
5162
5163        #[inline(always)]
5164        fn inline_align(_context: fidl::encoding::Context) -> usize {
5165            8
5166        }
5167
5168        #[inline(always)]
5169        fn inline_size(_context: fidl::encoding::Context) -> usize {
5170            32
5171        }
5172    }
5173
5174    unsafe impl<D: fidl::encoding::ResourceDialect>
5175        fidl::encoding::Encode<LightSetRgbValueRequest, D> for &LightSetRgbValueRequest
5176    {
5177        #[inline]
5178        unsafe fn encode(
5179            self,
5180            encoder: &mut fidl::encoding::Encoder<'_, D>,
5181            offset: usize,
5182            _depth: fidl::encoding::Depth,
5183        ) -> fidl::Result<()> {
5184            encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
5185            // Delegate to tuple encoding.
5186            fidl::encoding::Encode::<LightSetRgbValueRequest, D>::encode(
5187                (
5188                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
5189                    <Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5190                ),
5191                encoder,
5192                offset,
5193                _depth,
5194            )
5195        }
5196    }
5197    unsafe impl<
5198            D: fidl::encoding::ResourceDialect,
5199            T0: fidl::encoding::Encode<u32, D>,
5200            T1: fidl::encoding::Encode<Rgb, D>,
5201        > fidl::encoding::Encode<LightSetRgbValueRequest, D> for (T0, T1)
5202    {
5203        #[inline]
5204        unsafe fn encode(
5205            self,
5206            encoder: &mut fidl::encoding::Encoder<'_, D>,
5207            offset: usize,
5208            depth: fidl::encoding::Depth,
5209        ) -> fidl::Result<()> {
5210            encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
5211            // Zero out padding regions. There's no need to apply masks
5212            // because the unmasked parts will be overwritten by fields.
5213            unsafe {
5214                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5215                (ptr as *mut u64).write_unaligned(0);
5216            }
5217            // Write the fields.
5218            self.0.encode(encoder, offset + 0, depth)?;
5219            self.1.encode(encoder, offset + 8, depth)?;
5220            Ok(())
5221        }
5222    }
5223
5224    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5225        for LightSetRgbValueRequest
5226    {
5227        #[inline(always)]
5228        fn new_empty() -> Self {
5229            Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(Rgb, D) }
5230        }
5231
5232        #[inline]
5233        unsafe fn decode(
5234            &mut self,
5235            decoder: &mut fidl::encoding::Decoder<'_, D>,
5236            offset: usize,
5237            _depth: fidl::encoding::Depth,
5238        ) -> fidl::Result<()> {
5239            decoder.debug_check_bounds::<Self>(offset);
5240            // Verify that padding bytes are zero.
5241            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5242            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5243            let mask = 0xffffffff00000000u64;
5244            let maskedval = padval & mask;
5245            if maskedval != 0 {
5246                return Err(fidl::Error::NonZeroPadding {
5247                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5248                });
5249            }
5250            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
5251            fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 8, _depth)?;
5252            Ok(())
5253        }
5254    }
5255
5256    impl fidl::encoding::ValueTypeMarker for LightSetSimpleValueRequest {
5257        type Borrowed<'a> = &'a Self;
5258        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5259            value
5260        }
5261    }
5262
5263    unsafe impl fidl::encoding::TypeMarker for LightSetSimpleValueRequest {
5264        type Owned = Self;
5265
5266        #[inline(always)]
5267        fn inline_align(_context: fidl::encoding::Context) -> usize {
5268            4
5269        }
5270
5271        #[inline(always)]
5272        fn inline_size(_context: fidl::encoding::Context) -> usize {
5273            8
5274        }
5275    }
5276
5277    unsafe impl<D: fidl::encoding::ResourceDialect>
5278        fidl::encoding::Encode<LightSetSimpleValueRequest, D> for &LightSetSimpleValueRequest
5279    {
5280        #[inline]
5281        unsafe fn encode(
5282            self,
5283            encoder: &mut fidl::encoding::Encoder<'_, D>,
5284            offset: usize,
5285            _depth: fidl::encoding::Depth,
5286        ) -> fidl::Result<()> {
5287            encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
5288            // Delegate to tuple encoding.
5289            fidl::encoding::Encode::<LightSetSimpleValueRequest, D>::encode(
5290                (
5291                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
5292                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5293                ),
5294                encoder,
5295                offset,
5296                _depth,
5297            )
5298        }
5299    }
5300    unsafe impl<
5301            D: fidl::encoding::ResourceDialect,
5302            T0: fidl::encoding::Encode<u32, D>,
5303            T1: fidl::encoding::Encode<bool, D>,
5304        > fidl::encoding::Encode<LightSetSimpleValueRequest, D> for (T0, T1)
5305    {
5306        #[inline]
5307        unsafe fn encode(
5308            self,
5309            encoder: &mut fidl::encoding::Encoder<'_, D>,
5310            offset: usize,
5311            depth: fidl::encoding::Depth,
5312        ) -> fidl::Result<()> {
5313            encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
5314            // Zero out padding regions. There's no need to apply masks
5315            // because the unmasked parts will be overwritten by fields.
5316            unsafe {
5317                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
5318                (ptr as *mut u32).write_unaligned(0);
5319            }
5320            // Write the fields.
5321            self.0.encode(encoder, offset + 0, depth)?;
5322            self.1.encode(encoder, offset + 4, depth)?;
5323            Ok(())
5324        }
5325    }
5326
5327    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5328        for LightSetSimpleValueRequest
5329    {
5330        #[inline(always)]
5331        fn new_empty() -> Self {
5332            Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
5333        }
5334
5335        #[inline]
5336        unsafe fn decode(
5337            &mut self,
5338            decoder: &mut fidl::encoding::Decoder<'_, D>,
5339            offset: usize,
5340            _depth: fidl::encoding::Depth,
5341        ) -> fidl::Result<()> {
5342            decoder.debug_check_bounds::<Self>(offset);
5343            // Verify that padding bytes are zero.
5344            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
5345            let padval = unsafe { (ptr as *const u32).read_unaligned() };
5346            let mask = 0xffffff00u32;
5347            let maskedval = padval & mask;
5348            if maskedval != 0 {
5349                return Err(fidl::Error::NonZeroPadding {
5350                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
5351                });
5352            }
5353            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
5354            fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
5355            Ok(())
5356        }
5357    }
5358
5359    impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueResponse {
5360        type Borrowed<'a> = &'a Self;
5361        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5362            value
5363        }
5364    }
5365
5366    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueResponse {
5367        type Owned = Self;
5368
5369        #[inline(always)]
5370        fn inline_align(_context: fidl::encoding::Context) -> usize {
5371            8
5372        }
5373
5374        #[inline(always)]
5375        fn inline_size(_context: fidl::encoding::Context) -> usize {
5376            8
5377        }
5378    }
5379
5380    unsafe impl<D: fidl::encoding::ResourceDialect>
5381        fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D>
5382        for &LightGetCurrentBrightnessValueResponse
5383    {
5384        #[inline]
5385        unsafe fn encode(
5386            self,
5387            encoder: &mut fidl::encoding::Encoder<'_, D>,
5388            offset: usize,
5389            _depth: fidl::encoding::Depth,
5390        ) -> fidl::Result<()> {
5391            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
5392            // Delegate to tuple encoding.
5393            fidl::encoding::Encode::<LightGetCurrentBrightnessValueResponse, D>::encode(
5394                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5395                encoder,
5396                offset,
5397                _depth,
5398            )
5399        }
5400    }
5401    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
5402        fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D> for (T0,)
5403    {
5404        #[inline]
5405        unsafe fn encode(
5406            self,
5407            encoder: &mut fidl::encoding::Encoder<'_, D>,
5408            offset: usize,
5409            depth: fidl::encoding::Depth,
5410        ) -> fidl::Result<()> {
5411            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
5412            // Zero out padding regions. There's no need to apply masks
5413            // because the unmasked parts will be overwritten by fields.
5414            // Write the fields.
5415            self.0.encode(encoder, offset + 0, depth)?;
5416            Ok(())
5417        }
5418    }
5419
5420    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5421        for LightGetCurrentBrightnessValueResponse
5422    {
5423        #[inline(always)]
5424        fn new_empty() -> Self {
5425            Self { value: fidl::new_empty!(f64, D) }
5426        }
5427
5428        #[inline]
5429        unsafe fn decode(
5430            &mut self,
5431            decoder: &mut fidl::encoding::Decoder<'_, D>,
5432            offset: usize,
5433            _depth: fidl::encoding::Depth,
5434        ) -> fidl::Result<()> {
5435            decoder.debug_check_bounds::<Self>(offset);
5436            // Verify that padding bytes are zero.
5437            fidl::decode!(f64, D, &mut self.value, decoder, offset + 0, _depth)?;
5438            Ok(())
5439        }
5440    }
5441
5442    impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueResponse {
5443        type Borrowed<'a> = &'a Self;
5444        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5445            value
5446        }
5447    }
5448
5449    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueResponse {
5450        type Owned = Self;
5451
5452        #[inline(always)]
5453        fn inline_align(_context: fidl::encoding::Context) -> usize {
5454            8
5455        }
5456
5457        #[inline(always)]
5458        fn inline_size(_context: fidl::encoding::Context) -> usize {
5459            24
5460        }
5461    }
5462
5463    unsafe impl<D: fidl::encoding::ResourceDialect>
5464        fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D>
5465        for &LightGetCurrentRgbValueResponse
5466    {
5467        #[inline]
5468        unsafe fn encode(
5469            self,
5470            encoder: &mut fidl::encoding::Encoder<'_, D>,
5471            offset: usize,
5472            _depth: fidl::encoding::Depth,
5473        ) -> fidl::Result<()> {
5474            encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
5475            // Delegate to tuple encoding.
5476            fidl::encoding::Encode::<LightGetCurrentRgbValueResponse, D>::encode(
5477                (<Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5478                encoder,
5479                offset,
5480                _depth,
5481            )
5482        }
5483    }
5484    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Rgb, D>>
5485        fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D> for (T0,)
5486    {
5487        #[inline]
5488        unsafe fn encode(
5489            self,
5490            encoder: &mut fidl::encoding::Encoder<'_, D>,
5491            offset: usize,
5492            depth: fidl::encoding::Depth,
5493        ) -> fidl::Result<()> {
5494            encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
5495            // Zero out padding regions. There's no need to apply masks
5496            // because the unmasked parts will be overwritten by fields.
5497            // Write the fields.
5498            self.0.encode(encoder, offset + 0, depth)?;
5499            Ok(())
5500        }
5501    }
5502
5503    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5504        for LightGetCurrentRgbValueResponse
5505    {
5506        #[inline(always)]
5507        fn new_empty() -> Self {
5508            Self { value: fidl::new_empty!(Rgb, D) }
5509        }
5510
5511        #[inline]
5512        unsafe fn decode(
5513            &mut self,
5514            decoder: &mut fidl::encoding::Decoder<'_, D>,
5515            offset: usize,
5516            _depth: fidl::encoding::Depth,
5517        ) -> fidl::Result<()> {
5518            decoder.debug_check_bounds::<Self>(offset);
5519            // Verify that padding bytes are zero.
5520            fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 0, _depth)?;
5521            Ok(())
5522        }
5523    }
5524
5525    impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueResponse {
5526        type Borrowed<'a> = &'a Self;
5527        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5528            value
5529        }
5530    }
5531
5532    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueResponse {
5533        type Owned = Self;
5534
5535        #[inline(always)]
5536        fn inline_align(_context: fidl::encoding::Context) -> usize {
5537            1
5538        }
5539
5540        #[inline(always)]
5541        fn inline_size(_context: fidl::encoding::Context) -> usize {
5542            1
5543        }
5544    }
5545
5546    unsafe impl<D: fidl::encoding::ResourceDialect>
5547        fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D>
5548        for &LightGetCurrentSimpleValueResponse
5549    {
5550        #[inline]
5551        unsafe fn encode(
5552            self,
5553            encoder: &mut fidl::encoding::Encoder<'_, D>,
5554            offset: usize,
5555            _depth: fidl::encoding::Depth,
5556        ) -> fidl::Result<()> {
5557            encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
5558            // Delegate to tuple encoding.
5559            fidl::encoding::Encode::<LightGetCurrentSimpleValueResponse, D>::encode(
5560                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
5561                encoder,
5562                offset,
5563                _depth,
5564            )
5565        }
5566    }
5567    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5568        fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D> for (T0,)
5569    {
5570        #[inline]
5571        unsafe fn encode(
5572            self,
5573            encoder: &mut fidl::encoding::Encoder<'_, D>,
5574            offset: usize,
5575            depth: fidl::encoding::Depth,
5576        ) -> fidl::Result<()> {
5577            encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
5578            // Zero out padding regions. There's no need to apply masks
5579            // because the unmasked parts will be overwritten by fields.
5580            // Write the fields.
5581            self.0.encode(encoder, offset + 0, depth)?;
5582            Ok(())
5583        }
5584    }
5585
5586    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5587        for LightGetCurrentSimpleValueResponse
5588    {
5589        #[inline(always)]
5590        fn new_empty() -> Self {
5591            Self { value: fidl::new_empty!(bool, D) }
5592        }
5593
5594        #[inline]
5595        unsafe fn decode(
5596            &mut self,
5597            decoder: &mut fidl::encoding::Decoder<'_, D>,
5598            offset: usize,
5599            _depth: fidl::encoding::Depth,
5600        ) -> fidl::Result<()> {
5601            decoder.debug_check_bounds::<Self>(offset);
5602            // Verify that padding bytes are zero.
5603            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
5604            Ok(())
5605        }
5606    }
5607
5608    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueResponse {
5609        type Borrowed<'a> = &'a Self;
5610        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5611            value
5612        }
5613    }
5614
5615    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueResponse {
5616        type Owned = Self;
5617
5618        #[inline(always)]
5619        fn inline_align(_context: fidl::encoding::Context) -> usize {
5620            8
5621        }
5622
5623        #[inline(always)]
5624        fn inline_size(_context: fidl::encoding::Context) -> usize {
5625            16
5626        }
5627    }
5628
5629    unsafe impl<D: fidl::encoding::ResourceDialect>
5630        fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D>
5631        for &LightGetGroupCurrentBrightnessValueResponse
5632    {
5633        #[inline]
5634        unsafe fn encode(
5635            self,
5636            encoder: &mut fidl::encoding::Encoder<'_, D>,
5637            offset: usize,
5638            _depth: fidl::encoding::Depth,
5639        ) -> fidl::Result<()> {
5640            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
5641            // Delegate to tuple encoding.
5642            fidl::encoding::Encode::<LightGetGroupCurrentBrightnessValueResponse, D>::encode(
5643                (
5644                    <fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
5645                ),
5646                encoder, offset, _depth
5647            )
5648        }
5649    }
5650    unsafe impl<
5651            D: fidl::encoding::ResourceDialect,
5652            T0: fidl::encoding::Encode<
5653                fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
5654                D,
5655            >,
5656        > fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D> for (T0,)
5657    {
5658        #[inline]
5659        unsafe fn encode(
5660            self,
5661            encoder: &mut fidl::encoding::Encoder<'_, D>,
5662            offset: usize,
5663            depth: fidl::encoding::Depth,
5664        ) -> fidl::Result<()> {
5665            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
5666            // Zero out padding regions. There's no need to apply masks
5667            // because the unmasked parts will be overwritten by fields.
5668            // Write the fields.
5669            self.0.encode(encoder, offset + 0, depth)?;
5670            Ok(())
5671        }
5672    }
5673
5674    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5675        for LightGetGroupCurrentBrightnessValueResponse
5676    {
5677        #[inline(always)]
5678        fn new_empty() -> Self {
5679            Self {
5680                values: fidl::new_empty!(
5681                    fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
5682                    D
5683                ),
5684            }
5685        }
5686
5687        #[inline]
5688        unsafe fn decode(
5689            &mut self,
5690            decoder: &mut fidl::encoding::Decoder<'_, D>,
5691            offset: usize,
5692            _depth: fidl::encoding::Depth,
5693        ) -> fidl::Result<()> {
5694            decoder.debug_check_bounds::<Self>(offset);
5695            // Verify that padding bytes are zero.
5696            fidl::decode!(
5697                fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
5698                D,
5699                &mut self.values,
5700                decoder,
5701                offset + 0,
5702                _depth
5703            )?;
5704            Ok(())
5705        }
5706    }
5707
5708    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueResponse {
5709        type Borrowed<'a> = &'a Self;
5710        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5711            value
5712        }
5713    }
5714
5715    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueResponse {
5716        type Owned = Self;
5717
5718        #[inline(always)]
5719        fn inline_align(_context: fidl::encoding::Context) -> usize {
5720            8
5721        }
5722
5723        #[inline(always)]
5724        fn inline_size(_context: fidl::encoding::Context) -> usize {
5725            16
5726        }
5727    }
5728
5729    unsafe impl<D: fidl::encoding::ResourceDialect>
5730        fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D>
5731        for &LightGetGroupCurrentRgbValueResponse
5732    {
5733        #[inline]
5734        unsafe fn encode(
5735            self,
5736            encoder: &mut fidl::encoding::Encoder<'_, D>,
5737            offset: usize,
5738            _depth: fidl::encoding::Depth,
5739        ) -> fidl::Result<()> {
5740            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
5741            // Delegate to tuple encoding.
5742            fidl::encoding::Encode::<LightGetGroupCurrentRgbValueResponse, D>::encode(
5743                (
5744                    <fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
5745                ),
5746                encoder, offset, _depth
5747            )
5748        }
5749    }
5750    unsafe impl<
5751            D: fidl::encoding::ResourceDialect,
5752            T0: fidl::encoding::Encode<
5753                fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
5754                D,
5755            >,
5756        > fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D> for (T0,)
5757    {
5758        #[inline]
5759        unsafe fn encode(
5760            self,
5761            encoder: &mut fidl::encoding::Encoder<'_, D>,
5762            offset: usize,
5763            depth: fidl::encoding::Depth,
5764        ) -> fidl::Result<()> {
5765            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
5766            // Zero out padding regions. There's no need to apply masks
5767            // because the unmasked parts will be overwritten by fields.
5768            // Write the fields.
5769            self.0.encode(encoder, offset + 0, depth)?;
5770            Ok(())
5771        }
5772    }
5773
5774    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5775        for LightGetGroupCurrentRgbValueResponse
5776    {
5777        #[inline(always)]
5778        fn new_empty() -> Self {
5779            Self {
5780                values: fidl::new_empty!(
5781                    fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
5782                    D
5783                ),
5784            }
5785        }
5786
5787        #[inline]
5788        unsafe fn decode(
5789            &mut self,
5790            decoder: &mut fidl::encoding::Decoder<'_, D>,
5791            offset: usize,
5792            _depth: fidl::encoding::Depth,
5793        ) -> fidl::Result<()> {
5794            decoder.debug_check_bounds::<Self>(offset);
5795            // Verify that padding bytes are zero.
5796            fidl::decode!(
5797                fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
5798                D,
5799                &mut self.values,
5800                decoder,
5801                offset + 0,
5802                _depth
5803            )?;
5804            Ok(())
5805        }
5806    }
5807
5808    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueResponse {
5809        type Borrowed<'a> = &'a Self;
5810        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5811            value
5812        }
5813    }
5814
5815    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueResponse {
5816        type Owned = Self;
5817
5818        #[inline(always)]
5819        fn inline_align(_context: fidl::encoding::Context) -> usize {
5820            8
5821        }
5822
5823        #[inline(always)]
5824        fn inline_size(_context: fidl::encoding::Context) -> usize {
5825            16
5826        }
5827    }
5828
5829    unsafe impl<D: fidl::encoding::ResourceDialect>
5830        fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D>
5831        for &LightGetGroupCurrentSimpleValueResponse
5832    {
5833        #[inline]
5834        unsafe fn encode(
5835            self,
5836            encoder: &mut fidl::encoding::Encoder<'_, D>,
5837            offset: usize,
5838            _depth: fidl::encoding::Depth,
5839        ) -> fidl::Result<()> {
5840            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
5841            // Delegate to tuple encoding.
5842            fidl::encoding::Encode::<LightGetGroupCurrentSimpleValueResponse, D>::encode(
5843                (
5844                    <fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
5845                ),
5846                encoder, offset, _depth
5847            )
5848        }
5849    }
5850    unsafe impl<
5851            D: fidl::encoding::ResourceDialect,
5852            T0: fidl::encoding::Encode<
5853                fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
5854                D,
5855            >,
5856        > fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D> for (T0,)
5857    {
5858        #[inline]
5859        unsafe fn encode(
5860            self,
5861            encoder: &mut fidl::encoding::Encoder<'_, D>,
5862            offset: usize,
5863            depth: fidl::encoding::Depth,
5864        ) -> fidl::Result<()> {
5865            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
5866            // Zero out padding regions. There's no need to apply masks
5867            // because the unmasked parts will be overwritten by fields.
5868            // Write the fields.
5869            self.0.encode(encoder, offset + 0, depth)?;
5870            Ok(())
5871        }
5872    }
5873
5874    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5875        for LightGetGroupCurrentSimpleValueResponse
5876    {
5877        #[inline(always)]
5878        fn new_empty() -> Self {
5879            Self {
5880                values: fidl::new_empty!(
5881                    fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
5882                    D
5883                ),
5884            }
5885        }
5886
5887        #[inline]
5888        unsafe fn decode(
5889            &mut self,
5890            decoder: &mut fidl::encoding::Decoder<'_, D>,
5891            offset: usize,
5892            _depth: fidl::encoding::Depth,
5893        ) -> fidl::Result<()> {
5894            decoder.debug_check_bounds::<Self>(offset);
5895            // Verify that padding bytes are zero.
5896            fidl::decode!(
5897                fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
5898                D,
5899                &mut self.values,
5900                decoder,
5901                offset + 0,
5902                _depth
5903            )?;
5904            Ok(())
5905        }
5906    }
5907
5908    impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoResponse {
5909        type Borrowed<'a> = &'a Self;
5910        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5911            value
5912        }
5913    }
5914
5915    unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoResponse {
5916        type Owned = Self;
5917
5918        #[inline(always)]
5919        fn inline_align(_context: fidl::encoding::Context) -> usize {
5920            8
5921        }
5922
5923        #[inline(always)]
5924        fn inline_size(_context: fidl::encoding::Context) -> usize {
5925            24
5926        }
5927    }
5928
5929    unsafe impl<D: fidl::encoding::ResourceDialect>
5930        fidl::encoding::Encode<LightGetGroupInfoResponse, D> for &LightGetGroupInfoResponse
5931    {
5932        #[inline]
5933        unsafe fn encode(
5934            self,
5935            encoder: &mut fidl::encoding::Encoder<'_, D>,
5936            offset: usize,
5937            _depth: fidl::encoding::Depth,
5938        ) -> fidl::Result<()> {
5939            encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
5940            // Delegate to tuple encoding.
5941            fidl::encoding::Encode::<LightGetGroupInfoResponse, D>::encode(
5942                (<GroupInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
5943                encoder,
5944                offset,
5945                _depth,
5946            )
5947        }
5948    }
5949    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GroupInfo, D>>
5950        fidl::encoding::Encode<LightGetGroupInfoResponse, D> for (T0,)
5951    {
5952        #[inline]
5953        unsafe fn encode(
5954            self,
5955            encoder: &mut fidl::encoding::Encoder<'_, D>,
5956            offset: usize,
5957            depth: fidl::encoding::Depth,
5958        ) -> fidl::Result<()> {
5959            encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
5960            // Zero out padding regions. There's no need to apply masks
5961            // because the unmasked parts will be overwritten by fields.
5962            // Write the fields.
5963            self.0.encode(encoder, offset + 0, depth)?;
5964            Ok(())
5965        }
5966    }
5967
5968    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5969        for LightGetGroupInfoResponse
5970    {
5971        #[inline(always)]
5972        fn new_empty() -> Self {
5973            Self { info: fidl::new_empty!(GroupInfo, D) }
5974        }
5975
5976        #[inline]
5977        unsafe fn decode(
5978            &mut self,
5979            decoder: &mut fidl::encoding::Decoder<'_, D>,
5980            offset: usize,
5981            _depth: fidl::encoding::Depth,
5982        ) -> fidl::Result<()> {
5983            decoder.debug_check_bounds::<Self>(offset);
5984            // Verify that padding bytes are zero.
5985            fidl::decode!(GroupInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
5986            Ok(())
5987        }
5988    }
5989
5990    impl fidl::encoding::ValueTypeMarker for LightGetInfoResponse {
5991        type Borrowed<'a> = &'a Self;
5992        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5993            value
5994        }
5995    }
5996
5997    unsafe impl fidl::encoding::TypeMarker for LightGetInfoResponse {
5998        type Owned = Self;
5999
6000        #[inline(always)]
6001        fn inline_align(_context: fidl::encoding::Context) -> usize {
6002            8
6003        }
6004
6005        #[inline(always)]
6006        fn inline_size(_context: fidl::encoding::Context) -> usize {
6007            24
6008        }
6009    }
6010
6011    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoResponse, D>
6012        for &LightGetInfoResponse
6013    {
6014        #[inline]
6015        unsafe fn encode(
6016            self,
6017            encoder: &mut fidl::encoding::Encoder<'_, D>,
6018            offset: usize,
6019            _depth: fidl::encoding::Depth,
6020        ) -> fidl::Result<()> {
6021            encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
6022            // Delegate to tuple encoding.
6023            fidl::encoding::Encode::<LightGetInfoResponse, D>::encode(
6024                (<Info as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
6025                encoder,
6026                offset,
6027                _depth,
6028            )
6029        }
6030    }
6031    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Info, D>>
6032        fidl::encoding::Encode<LightGetInfoResponse, D> for (T0,)
6033    {
6034        #[inline]
6035        unsafe fn encode(
6036            self,
6037            encoder: &mut fidl::encoding::Encoder<'_, D>,
6038            offset: usize,
6039            depth: fidl::encoding::Depth,
6040        ) -> fidl::Result<()> {
6041            encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
6042            // Zero out padding regions. There's no need to apply masks
6043            // because the unmasked parts will be overwritten by fields.
6044            // Write the fields.
6045            self.0.encode(encoder, offset + 0, depth)?;
6046            Ok(())
6047        }
6048    }
6049
6050    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoResponse {
6051        #[inline(always)]
6052        fn new_empty() -> Self {
6053            Self { info: fidl::new_empty!(Info, D) }
6054        }
6055
6056        #[inline]
6057        unsafe fn decode(
6058            &mut self,
6059            decoder: &mut fidl::encoding::Decoder<'_, D>,
6060            offset: usize,
6061            _depth: fidl::encoding::Depth,
6062        ) -> fidl::Result<()> {
6063            decoder.debug_check_bounds::<Self>(offset);
6064            // Verify that padding bytes are zero.
6065            fidl::decode!(Info, D, &mut self.info, decoder, offset + 0, _depth)?;
6066            Ok(())
6067        }
6068    }
6069
6070    impl fidl::encoding::ValueTypeMarker for Rgb {
6071        type Borrowed<'a> = &'a Self;
6072        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6073            value
6074        }
6075    }
6076
6077    unsafe impl fidl::encoding::TypeMarker for Rgb {
6078        type Owned = Self;
6079
6080        #[inline(always)]
6081        fn inline_align(_context: fidl::encoding::Context) -> usize {
6082            8
6083        }
6084
6085        #[inline(always)]
6086        fn inline_size(_context: fidl::encoding::Context) -> usize {
6087            24
6088        }
6089    }
6090
6091    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Rgb, D> for &Rgb {
6092        #[inline]
6093        unsafe fn encode(
6094            self,
6095            encoder: &mut fidl::encoding::Encoder<'_, D>,
6096            offset: usize,
6097            _depth: fidl::encoding::Depth,
6098        ) -> fidl::Result<()> {
6099            encoder.debug_check_bounds::<Rgb>(offset);
6100            // Delegate to tuple encoding.
6101            fidl::encoding::Encode::<Rgb, D>::encode(
6102                (
6103                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
6104                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
6105                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
6106                ),
6107                encoder,
6108                offset,
6109                _depth,
6110            )
6111        }
6112    }
6113    unsafe impl<
6114            D: fidl::encoding::ResourceDialect,
6115            T0: fidl::encoding::Encode<f64, D>,
6116            T1: fidl::encoding::Encode<f64, D>,
6117            T2: fidl::encoding::Encode<f64, D>,
6118        > fidl::encoding::Encode<Rgb, D> for (T0, T1, T2)
6119    {
6120        #[inline]
6121        unsafe fn encode(
6122            self,
6123            encoder: &mut fidl::encoding::Encoder<'_, D>,
6124            offset: usize,
6125            depth: fidl::encoding::Depth,
6126        ) -> fidl::Result<()> {
6127            encoder.debug_check_bounds::<Rgb>(offset);
6128            // Zero out padding regions. There's no need to apply masks
6129            // because the unmasked parts will be overwritten by fields.
6130            // Write the fields.
6131            self.0.encode(encoder, offset + 0, depth)?;
6132            self.1.encode(encoder, offset + 8, depth)?;
6133            self.2.encode(encoder, offset + 16, depth)?;
6134            Ok(())
6135        }
6136    }
6137
6138    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rgb {
6139        #[inline(always)]
6140        fn new_empty() -> Self {
6141            Self {
6142                red: fidl::new_empty!(f64, D),
6143                green: fidl::new_empty!(f64, D),
6144                blue: fidl::new_empty!(f64, D),
6145            }
6146        }
6147
6148        #[inline]
6149        unsafe fn decode(
6150            &mut self,
6151            decoder: &mut fidl::encoding::Decoder<'_, D>,
6152            offset: usize,
6153            _depth: fidl::encoding::Depth,
6154        ) -> fidl::Result<()> {
6155            decoder.debug_check_bounds::<Self>(offset);
6156            // Verify that padding bytes are zero.
6157            fidl::decode!(f64, D, &mut self.red, decoder, offset + 0, _depth)?;
6158            fidl::decode!(f64, D, &mut self.green, decoder, offset + 8, _depth)?;
6159            fidl::decode!(f64, D, &mut self.blue, decoder, offset + 16, _depth)?;
6160            Ok(())
6161        }
6162    }
6163
6164    impl Config {
6165        #[inline(always)]
6166        fn max_ordinal_present(&self) -> u64 {
6167            if let Some(_) = self.group_id {
6168                return 5;
6169            }
6170            if let Some(_) = self.init_on {
6171                return 4;
6172            }
6173            if let Some(_) = self.rgb {
6174                return 3;
6175            }
6176            if let Some(_) = self.brightness {
6177                return 2;
6178            }
6179            if let Some(_) = self.name {
6180                return 1;
6181            }
6182            0
6183        }
6184    }
6185
6186    impl fidl::encoding::ValueTypeMarker for Config {
6187        type Borrowed<'a> = &'a Self;
6188        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6189            value
6190        }
6191    }
6192
6193    unsafe impl fidl::encoding::TypeMarker for Config {
6194        type Owned = Self;
6195
6196        #[inline(always)]
6197        fn inline_align(_context: fidl::encoding::Context) -> usize {
6198            8
6199        }
6200
6201        #[inline(always)]
6202        fn inline_size(_context: fidl::encoding::Context) -> usize {
6203            16
6204        }
6205    }
6206
6207    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
6208        unsafe fn encode(
6209            self,
6210            encoder: &mut fidl::encoding::Encoder<'_, D>,
6211            offset: usize,
6212            mut depth: fidl::encoding::Depth,
6213        ) -> fidl::Result<()> {
6214            encoder.debug_check_bounds::<Config>(offset);
6215            // Vector header
6216            let max_ordinal: u64 = self.max_ordinal_present();
6217            encoder.write_num(max_ordinal, offset);
6218            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6219            // Calling encoder.out_of_line_offset(0) is not allowed.
6220            if max_ordinal == 0 {
6221                return Ok(());
6222            }
6223            depth.increment()?;
6224            let envelope_size = 8;
6225            let bytes_len = max_ordinal as usize * envelope_size;
6226            #[allow(unused_variables)]
6227            let offset = encoder.out_of_line_offset(bytes_len);
6228            let mut _prev_end_offset: usize = 0;
6229            if 1 > max_ordinal {
6230                return Ok(());
6231            }
6232
6233            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6234            // are envelope_size bytes.
6235            let cur_offset: usize = (1 - 1) * envelope_size;
6236
6237            // Zero reserved fields.
6238            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6239
6240            // Safety:
6241            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6242            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6243            //   envelope_size bytes, there is always sufficient room.
6244            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
6245                self.name.as_ref().map(
6246                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
6247                ),
6248                encoder,
6249                offset + cur_offset,
6250                depth,
6251            )?;
6252
6253            _prev_end_offset = cur_offset + envelope_size;
6254            if 2 > max_ordinal {
6255                return Ok(());
6256            }
6257
6258            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6259            // are envelope_size bytes.
6260            let cur_offset: usize = (2 - 1) * envelope_size;
6261
6262            // Zero reserved fields.
6263            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6264
6265            // Safety:
6266            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6267            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6268            //   envelope_size bytes, there is always sufficient room.
6269            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6270                self.brightness.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6271                encoder,
6272                offset + cur_offset,
6273                depth,
6274            )?;
6275
6276            _prev_end_offset = cur_offset + envelope_size;
6277            if 3 > max_ordinal {
6278                return Ok(());
6279            }
6280
6281            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6282            // are envelope_size bytes.
6283            let cur_offset: usize = (3 - 1) * envelope_size;
6284
6285            // Zero reserved fields.
6286            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6287
6288            // Safety:
6289            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6290            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6291            //   envelope_size bytes, there is always sufficient room.
6292            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6293                self.rgb.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6294                encoder,
6295                offset + cur_offset,
6296                depth,
6297            )?;
6298
6299            _prev_end_offset = cur_offset + envelope_size;
6300            if 4 > max_ordinal {
6301                return Ok(());
6302            }
6303
6304            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6305            // are envelope_size bytes.
6306            let cur_offset: usize = (4 - 1) * envelope_size;
6307
6308            // Zero reserved fields.
6309            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6310
6311            // Safety:
6312            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6313            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6314            //   envelope_size bytes, there is always sufficient room.
6315            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6316                self.init_on.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6317                encoder,
6318                offset + cur_offset,
6319                depth,
6320            )?;
6321
6322            _prev_end_offset = cur_offset + envelope_size;
6323            if 5 > max_ordinal {
6324                return Ok(());
6325            }
6326
6327            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6328            // are envelope_size bytes.
6329            let cur_offset: usize = (5 - 1) * envelope_size;
6330
6331            // Zero reserved fields.
6332            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6333
6334            // Safety:
6335            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6336            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6337            //   envelope_size bytes, there is always sufficient room.
6338            fidl::encoding::encode_in_envelope_optional::<i32, D>(
6339                self.group_id.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
6340                encoder,
6341                offset + cur_offset,
6342                depth,
6343            )?;
6344
6345            _prev_end_offset = cur_offset + envelope_size;
6346
6347            Ok(())
6348        }
6349    }
6350
6351    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
6352        #[inline(always)]
6353        fn new_empty() -> Self {
6354            Self::default()
6355        }
6356
6357        unsafe fn decode(
6358            &mut self,
6359            decoder: &mut fidl::encoding::Decoder<'_, D>,
6360            offset: usize,
6361            mut depth: fidl::encoding::Depth,
6362        ) -> fidl::Result<()> {
6363            decoder.debug_check_bounds::<Self>(offset);
6364            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6365                None => return Err(fidl::Error::NotNullable),
6366                Some(len) => len,
6367            };
6368            // Calling decoder.out_of_line_offset(0) is not allowed.
6369            if len == 0 {
6370                return Ok(());
6371            };
6372            depth.increment()?;
6373            let envelope_size = 8;
6374            let bytes_len = len * envelope_size;
6375            let offset = decoder.out_of_line_offset(bytes_len)?;
6376            // Decode the envelope for each type.
6377            let mut _next_ordinal_to_read = 0;
6378            let mut next_offset = offset;
6379            let end_offset = offset + bytes_len;
6380            _next_ordinal_to_read += 1;
6381            if next_offset >= end_offset {
6382                return Ok(());
6383            }
6384
6385            // Decode unknown envelopes for gaps in ordinals.
6386            while _next_ordinal_to_read < 1 {
6387                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6388                _next_ordinal_to_read += 1;
6389                next_offset += envelope_size;
6390            }
6391
6392            let next_out_of_line = decoder.next_out_of_line();
6393            let handles_before = decoder.remaining_handles();
6394            if let Some((inlined, num_bytes, num_handles)) =
6395                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6396            {
6397                let member_inline_size =
6398                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
6399                        decoder.context,
6400                    );
6401                if inlined != (member_inline_size <= 4) {
6402                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6403                }
6404                let inner_offset;
6405                let mut inner_depth = depth.clone();
6406                if inlined {
6407                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6408                    inner_offset = next_offset;
6409                } else {
6410                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6411                    inner_depth.increment()?;
6412                }
6413                let val_ref = self
6414                    .name
6415                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
6416                fidl::decode!(
6417                    fidl::encoding::UnboundedString,
6418                    D,
6419                    val_ref,
6420                    decoder,
6421                    inner_offset,
6422                    inner_depth
6423                )?;
6424                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6425                {
6426                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6427                }
6428                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6429                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6430                }
6431            }
6432
6433            next_offset += envelope_size;
6434            _next_ordinal_to_read += 1;
6435            if next_offset >= end_offset {
6436                return Ok(());
6437            }
6438
6439            // Decode unknown envelopes for gaps in ordinals.
6440            while _next_ordinal_to_read < 2 {
6441                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6442                _next_ordinal_to_read += 1;
6443                next_offset += envelope_size;
6444            }
6445
6446            let next_out_of_line = decoder.next_out_of_line();
6447            let handles_before = decoder.remaining_handles();
6448            if let Some((inlined, num_bytes, num_handles)) =
6449                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6450            {
6451                let member_inline_size =
6452                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6453                if inlined != (member_inline_size <= 4) {
6454                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6455                }
6456                let inner_offset;
6457                let mut inner_depth = depth.clone();
6458                if inlined {
6459                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6460                    inner_offset = next_offset;
6461                } else {
6462                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6463                    inner_depth.increment()?;
6464                }
6465                let val_ref = self.brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
6466                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6467                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6468                {
6469                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6470                }
6471                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6472                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6473                }
6474            }
6475
6476            next_offset += envelope_size;
6477            _next_ordinal_to_read += 1;
6478            if next_offset >= end_offset {
6479                return Ok(());
6480            }
6481
6482            // Decode unknown envelopes for gaps in ordinals.
6483            while _next_ordinal_to_read < 3 {
6484                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6485                _next_ordinal_to_read += 1;
6486                next_offset += envelope_size;
6487            }
6488
6489            let next_out_of_line = decoder.next_out_of_line();
6490            let handles_before = decoder.remaining_handles();
6491            if let Some((inlined, num_bytes, num_handles)) =
6492                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6493            {
6494                let member_inline_size =
6495                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6496                if inlined != (member_inline_size <= 4) {
6497                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6498                }
6499                let inner_offset;
6500                let mut inner_depth = depth.clone();
6501                if inlined {
6502                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6503                    inner_offset = next_offset;
6504                } else {
6505                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6506                    inner_depth.increment()?;
6507                }
6508                let val_ref = self.rgb.get_or_insert_with(|| fidl::new_empty!(bool, D));
6509                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6510                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6511                {
6512                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6513                }
6514                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6515                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6516                }
6517            }
6518
6519            next_offset += envelope_size;
6520            _next_ordinal_to_read += 1;
6521            if next_offset >= end_offset {
6522                return Ok(());
6523            }
6524
6525            // Decode unknown envelopes for gaps in ordinals.
6526            while _next_ordinal_to_read < 4 {
6527                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6528                _next_ordinal_to_read += 1;
6529                next_offset += envelope_size;
6530            }
6531
6532            let next_out_of_line = decoder.next_out_of_line();
6533            let handles_before = decoder.remaining_handles();
6534            if let Some((inlined, num_bytes, num_handles)) =
6535                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6536            {
6537                let member_inline_size =
6538                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6539                if inlined != (member_inline_size <= 4) {
6540                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6541                }
6542                let inner_offset;
6543                let mut inner_depth = depth.clone();
6544                if inlined {
6545                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6546                    inner_offset = next_offset;
6547                } else {
6548                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6549                    inner_depth.increment()?;
6550                }
6551                let val_ref = self.init_on.get_or_insert_with(|| fidl::new_empty!(bool, D));
6552                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6553                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6554                {
6555                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6556                }
6557                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6558                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6559                }
6560            }
6561
6562            next_offset += envelope_size;
6563            _next_ordinal_to_read += 1;
6564            if next_offset >= end_offset {
6565                return Ok(());
6566            }
6567
6568            // Decode unknown envelopes for gaps in ordinals.
6569            while _next_ordinal_to_read < 5 {
6570                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6571                _next_ordinal_to_read += 1;
6572                next_offset += envelope_size;
6573            }
6574
6575            let next_out_of_line = decoder.next_out_of_line();
6576            let handles_before = decoder.remaining_handles();
6577            if let Some((inlined, num_bytes, num_handles)) =
6578                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6579            {
6580                let member_inline_size =
6581                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6582                if inlined != (member_inline_size <= 4) {
6583                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6584                }
6585                let inner_offset;
6586                let mut inner_depth = depth.clone();
6587                if inlined {
6588                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6589                    inner_offset = next_offset;
6590                } else {
6591                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6592                    inner_depth.increment()?;
6593                }
6594                let val_ref = self.group_id.get_or_insert_with(|| fidl::new_empty!(i32, D));
6595                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
6596                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6597                {
6598                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6599                }
6600                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6601                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6602                }
6603            }
6604
6605            next_offset += envelope_size;
6606
6607            // Decode the remaining unknown envelopes.
6608            while next_offset < end_offset {
6609                _next_ordinal_to_read += 1;
6610                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6611                next_offset += envelope_size;
6612            }
6613
6614            Ok(())
6615        }
6616    }
6617
6618    impl Metadata {
6619        #[inline(always)]
6620        fn max_ordinal_present(&self) -> u64 {
6621            if let Some(_) = self.configs {
6622                return 1;
6623            }
6624            0
6625        }
6626    }
6627
6628    impl fidl::encoding::ValueTypeMarker for Metadata {
6629        type Borrowed<'a> = &'a Self;
6630        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6631            value
6632        }
6633    }
6634
6635    unsafe impl fidl::encoding::TypeMarker for Metadata {
6636        type Owned = Self;
6637
6638        #[inline(always)]
6639        fn inline_align(_context: fidl::encoding::Context) -> usize {
6640            8
6641        }
6642
6643        #[inline(always)]
6644        fn inline_size(_context: fidl::encoding::Context) -> usize {
6645            16
6646        }
6647    }
6648
6649    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
6650        unsafe fn encode(
6651            self,
6652            encoder: &mut fidl::encoding::Encoder<'_, D>,
6653            offset: usize,
6654            mut depth: fidl::encoding::Depth,
6655        ) -> fidl::Result<()> {
6656            encoder.debug_check_bounds::<Metadata>(offset);
6657            // Vector header
6658            let max_ordinal: u64 = self.max_ordinal_present();
6659            encoder.write_num(max_ordinal, offset);
6660            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6661            // Calling encoder.out_of_line_offset(0) is not allowed.
6662            if max_ordinal == 0 {
6663                return Ok(());
6664            }
6665            depth.increment()?;
6666            let envelope_size = 8;
6667            let bytes_len = max_ordinal as usize * envelope_size;
6668            #[allow(unused_variables)]
6669            let offset = encoder.out_of_line_offset(bytes_len);
6670            let mut _prev_end_offset: usize = 0;
6671            if 1 > max_ordinal {
6672                return Ok(());
6673            }
6674
6675            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6676            // are envelope_size bytes.
6677            let cur_offset: usize = (1 - 1) * envelope_size;
6678
6679            // Zero reserved fields.
6680            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6681
6682            // Safety:
6683            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6684            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6685            //   envelope_size bytes, there is always sufficient room.
6686            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Config>, D>(
6687            self.configs.as_ref().map(<fidl::encoding::UnboundedVector<Config> as fidl::encoding::ValueTypeMarker>::borrow),
6688            encoder, offset + cur_offset, depth
6689        )?;
6690
6691            _prev_end_offset = cur_offset + envelope_size;
6692
6693            Ok(())
6694        }
6695    }
6696
6697    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
6698        #[inline(always)]
6699        fn new_empty() -> Self {
6700            Self::default()
6701        }
6702
6703        unsafe fn decode(
6704            &mut self,
6705            decoder: &mut fidl::encoding::Decoder<'_, D>,
6706            offset: usize,
6707            mut depth: fidl::encoding::Depth,
6708        ) -> fidl::Result<()> {
6709            decoder.debug_check_bounds::<Self>(offset);
6710            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6711                None => return Err(fidl::Error::NotNullable),
6712                Some(len) => len,
6713            };
6714            // Calling decoder.out_of_line_offset(0) is not allowed.
6715            if len == 0 {
6716                return Ok(());
6717            };
6718            depth.increment()?;
6719            let envelope_size = 8;
6720            let bytes_len = len * envelope_size;
6721            let offset = decoder.out_of_line_offset(bytes_len)?;
6722            // Decode the envelope for each type.
6723            let mut _next_ordinal_to_read = 0;
6724            let mut next_offset = offset;
6725            let end_offset = offset + bytes_len;
6726            _next_ordinal_to_read += 1;
6727            if next_offset >= end_offset {
6728                return Ok(());
6729            }
6730
6731            // Decode unknown envelopes for gaps in ordinals.
6732            while _next_ordinal_to_read < 1 {
6733                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6734                _next_ordinal_to_read += 1;
6735                next_offset += envelope_size;
6736            }
6737
6738            let next_out_of_line = decoder.next_out_of_line();
6739            let handles_before = decoder.remaining_handles();
6740            if let Some((inlined, num_bytes, num_handles)) =
6741                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6742            {
6743                let member_inline_size = <fidl::encoding::UnboundedVector<Config> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6744                if inlined != (member_inline_size <= 4) {
6745                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6746                }
6747                let inner_offset;
6748                let mut inner_depth = depth.clone();
6749                if inlined {
6750                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6751                    inner_offset = next_offset;
6752                } else {
6753                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6754                    inner_depth.increment()?;
6755                }
6756                let val_ref = self.configs.get_or_insert_with(|| {
6757                    fidl::new_empty!(fidl::encoding::UnboundedVector<Config>, D)
6758                });
6759                fidl::decode!(
6760                    fidl::encoding::UnboundedVector<Config>,
6761                    D,
6762                    val_ref,
6763                    decoder,
6764                    inner_offset,
6765                    inner_depth
6766                )?;
6767                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6768                {
6769                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6770                }
6771                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6772                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6773                }
6774            }
6775
6776            next_offset += envelope_size;
6777
6778            // Decode the remaining unknown envelopes.
6779            while next_offset < end_offset {
6780                _next_ordinal_to_read += 1;
6781                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6782                next_offset += envelope_size;
6783            }
6784
6785            Ok(())
6786        }
6787    }
6788}