1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const LIGHT_NAME_LEN: u8 = 32;
12
13#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14#[repr(u32)]
15pub enum Capability {
16 Brightness = 1,
19 Rgb = 2,
21 Simple = 3,
23}
24
25impl Capability {
26 #[inline]
27 pub fn from_primitive(prim: u32) -> Option<Self> {
28 match prim {
29 1 => Some(Self::Brightness),
30 2 => Some(Self::Rgb),
31 3 => Some(Self::Simple),
32 _ => None,
33 }
34 }
35
36 #[inline]
37 pub const fn into_primitive(self) -> u32 {
38 self as u32
39 }
40}
41
42#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
43#[repr(u32)]
44pub enum LightError {
45 Ok = 0,
46 NotSupported = 1,
47 InvalidIndex = 2,
48 Failed = 3,
49}
50
51impl LightError {
52 #[inline]
53 pub fn from_primitive(prim: u32) -> Option<Self> {
54 match prim {
55 0 => Some(Self::Ok),
56 1 => Some(Self::NotSupported),
57 2 => Some(Self::InvalidIndex),
58 3 => Some(Self::Failed),
59 _ => None,
60 }
61 }
62
63 #[inline]
64 pub const fn into_primitive(self) -> u32 {
65 self as u32
66 }
67}
68
69#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct GroupInfo {
71 pub name: String,
72 pub count: u32,
73 pub capability: Capability,
74}
75
76impl fidl::Persistable for GroupInfo {}
77
78#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct Info {
80 pub name: String,
81 pub capability: Capability,
82}
83
84impl fidl::Persistable for Info {}
85
86#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
87#[repr(C)]
88pub struct LightGetCurrentBrightnessValueRequest {
89 pub index: u32,
90}
91
92impl fidl::Persistable for LightGetCurrentBrightnessValueRequest {}
93
94#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95#[repr(C)]
96pub struct LightGetCurrentRgbValueRequest {
97 pub index: u32,
98}
99
100impl fidl::Persistable for LightGetCurrentRgbValueRequest {}
101
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct LightGetCurrentSimpleValueRequest {
105 pub index: u32,
106}
107
108impl fidl::Persistable for LightGetCurrentSimpleValueRequest {}
109
110#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111#[repr(C)]
112pub struct LightGetGroupCurrentBrightnessValueRequest {
113 pub group_id: u32,
114}
115
116impl fidl::Persistable for LightGetGroupCurrentBrightnessValueRequest {}
117
118#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
119#[repr(C)]
120pub struct LightGetGroupCurrentRgbValueRequest {
121 pub group_id: u32,
122}
123
124impl fidl::Persistable for LightGetGroupCurrentRgbValueRequest {}
125
126#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127#[repr(C)]
128pub struct LightGetGroupCurrentSimpleValueRequest {
129 pub group_id: u32,
130}
131
132impl fidl::Persistable for LightGetGroupCurrentSimpleValueRequest {}
133
134#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135#[repr(C)]
136pub struct LightGetGroupInfoRequest {
137 pub group_id: u32,
138}
139
140impl fidl::Persistable for LightGetGroupInfoRequest {}
141
142#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
143#[repr(C)]
144pub struct LightGetInfoRequest {
145 pub index: u32,
146}
147
148impl fidl::Persistable for LightGetInfoRequest {}
149
150#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151#[repr(C)]
152pub struct LightGetNumLightGroupsResponse {
153 pub count: u32,
154}
155
156impl fidl::Persistable for LightGetNumLightGroupsResponse {}
157
158#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
159#[repr(C)]
160pub struct LightGetNumLightsResponse {
161 pub count: u32,
162}
163
164impl fidl::Persistable for LightGetNumLightsResponse {}
165
166#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
167pub struct LightSetBrightnessValueRequest {
168 pub index: u32,
169 pub value: f64,
170}
171
172impl fidl::Persistable for LightSetBrightnessValueRequest {}
173
174#[derive(Clone, Debug, PartialEq, PartialOrd)]
175pub struct LightSetGroupBrightnessValueRequest {
176 pub group_id: u32,
177 pub values: Vec<f64>,
178}
179
180impl fidl::Persistable for LightSetGroupBrightnessValueRequest {}
181
182#[derive(Clone, Debug, PartialEq, PartialOrd)]
183pub struct LightSetGroupRgbValueRequest {
184 pub group_id: u32,
185 pub values: Vec<Rgb>,
186}
187
188impl fidl::Persistable for LightSetGroupRgbValueRequest {}
189
190#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
191pub struct LightSetGroupSimpleValueRequest {
192 pub group_id: u32,
193 pub values: Vec<bool>,
194}
195
196impl fidl::Persistable for LightSetGroupSimpleValueRequest {}
197
198#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
199pub struct LightSetRgbValueRequest {
200 pub index: u32,
201 pub value: Rgb,
202}
203
204impl fidl::Persistable for LightSetRgbValueRequest {}
205
206#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
207pub struct LightSetSimpleValueRequest {
208 pub index: u32,
209 pub value: bool,
210}
211
212impl fidl::Persistable for LightSetSimpleValueRequest {}
213
214#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
215pub struct LightGetCurrentBrightnessValueResponse {
216 pub value: f64,
217}
218
219impl fidl::Persistable for LightGetCurrentBrightnessValueResponse {}
220
221#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
222pub struct LightGetCurrentRgbValueResponse {
223 pub value: Rgb,
224}
225
226impl fidl::Persistable for LightGetCurrentRgbValueResponse {}
227
228#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
229pub struct LightGetCurrentSimpleValueResponse {
230 pub value: bool,
231}
232
233impl fidl::Persistable for LightGetCurrentSimpleValueResponse {}
234
235#[derive(Clone, Debug, PartialEq, PartialOrd)]
236pub struct LightGetGroupCurrentBrightnessValueResponse {
237 pub values: Option<Vec<f64>>,
238}
239
240impl fidl::Persistable for LightGetGroupCurrentBrightnessValueResponse {}
241
242#[derive(Clone, Debug, PartialEq, PartialOrd)]
243pub struct LightGetGroupCurrentRgbValueResponse {
244 pub values: Option<Vec<Rgb>>,
245}
246
247impl fidl::Persistable for LightGetGroupCurrentRgbValueResponse {}
248
249#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
250pub struct LightGetGroupCurrentSimpleValueResponse {
251 pub values: Option<Vec<bool>>,
252}
253
254impl fidl::Persistable for LightGetGroupCurrentSimpleValueResponse {}
255
256#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
257pub struct LightGetGroupInfoResponse {
258 pub info: GroupInfo,
259}
260
261impl fidl::Persistable for LightGetGroupInfoResponse {}
262
263#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
264pub struct LightGetInfoResponse {
265 pub info: Info,
266}
267
268impl fidl::Persistable for LightGetInfoResponse {}
269
270#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
271pub struct Rgb {
272 pub red: f64,
273 pub green: f64,
274 pub blue: f64,
275}
276
277impl fidl::Persistable for Rgb {}
278
279#[derive(Clone, Debug, Default, PartialEq)]
280pub struct Config {
281 pub name: Option<String>,
282 pub brightness: Option<bool>,
283 pub rgb: Option<bool>,
284 pub init_on: Option<bool>,
285 pub group_id: Option<i32>,
286 #[doc(hidden)]
287 pub __source_breaking: fidl::marker::SourceBreaking,
288}
289
290impl fidl::Persistable for Config {}
291
292#[derive(Clone, Debug, Default, PartialEq)]
293pub struct Metadata {
294 pub configs: Option<Vec<Config>>,
295 #[doc(hidden)]
296 pub __source_breaking: fidl::marker::SourceBreaking,
297}
298
299impl fidl::Persistable for Metadata {}
300impl fidl::Serializable for Metadata {
301 const SERIALIZABLE_NAME: &'static str = "fuchsia.hardware.light.Metadata";
302}
303
304pub mod light_ordinals {
305 pub const GET_NUM_LIGHTS: u64 = 0x7ae2bd2ef8062dbb;
306 pub const GET_NUM_LIGHT_GROUPS: u64 = 0x600895db5a7cbf0;
307 pub const GET_INFO: u64 = 0x4229b55c8c4bd529;
308 pub const GET_CURRENT_SIMPLE_VALUE: u64 = 0x183154896336c321;
309 pub const SET_SIMPLE_VALUE: u64 = 0x4fb33d84c1aad81d;
310 pub const GET_CURRENT_BRIGHTNESS_VALUE: u64 = 0x2d387e129fe84809;
311 pub const SET_BRIGHTNESS_VALUE: u64 = 0x17cada93c7c48661;
312 pub const GET_CURRENT_RGB_VALUE: u64 = 0x49965ac0d920f4ad;
313 pub const SET_RGB_VALUE: u64 = 0x2b354d18be0b70a4;
314 pub const GET_GROUP_INFO: u64 = 0x5b27b0ca755b470b;
315 pub const GET_GROUP_CURRENT_SIMPLE_VALUE: u64 = 0x659d9bdb5cc2201;
316 pub const SET_GROUP_SIMPLE_VALUE: u64 = 0x924234e74cc6dd8;
317 pub const GET_GROUP_CURRENT_BRIGHTNESS_VALUE: u64 = 0x3ab226120b0d0362;
318 pub const SET_GROUP_BRIGHTNESS_VALUE: u64 = 0x79e5f248fc5ec7ae;
319 pub const GET_GROUP_CURRENT_RGB_VALUE: u64 = 0x2a6014b41254f617;
320 pub const SET_GROUP_RGB_VALUE: u64 = 0x33c92316f251e4e4;
321}
322
323mod internal {
324 use super::*;
325 unsafe impl fidl::encoding::TypeMarker for Capability {
326 type Owned = Self;
327
328 #[inline(always)]
329 fn inline_align(_context: fidl::encoding::Context) -> usize {
330 std::mem::align_of::<u32>()
331 }
332
333 #[inline(always)]
334 fn inline_size(_context: fidl::encoding::Context) -> usize {
335 std::mem::size_of::<u32>()
336 }
337
338 #[inline(always)]
339 fn encode_is_copy() -> bool {
340 true
341 }
342
343 #[inline(always)]
344 fn decode_is_copy() -> bool {
345 false
346 }
347 }
348
349 impl fidl::encoding::ValueTypeMarker for Capability {
350 type Borrowed<'a> = Self;
351 #[inline(always)]
352 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
353 *value
354 }
355 }
356
357 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Capability {
358 #[inline]
359 unsafe fn encode(
360 self,
361 encoder: &mut fidl::encoding::Encoder<'_, D>,
362 offset: usize,
363 _depth: fidl::encoding::Depth,
364 ) -> fidl::Result<()> {
365 encoder.debug_check_bounds::<Self>(offset);
366 encoder.write_num(self.into_primitive(), offset);
367 Ok(())
368 }
369 }
370
371 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
372 #[inline(always)]
373 fn new_empty() -> Self {
374 Self::Brightness
375 }
376
377 #[inline]
378 unsafe fn decode(
379 &mut self,
380 decoder: &mut fidl::encoding::Decoder<'_, D>,
381 offset: usize,
382 _depth: fidl::encoding::Depth,
383 ) -> fidl::Result<()> {
384 decoder.debug_check_bounds::<Self>(offset);
385 let prim = decoder.read_num::<u32>(offset);
386
387 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
388 Ok(())
389 }
390 }
391 unsafe impl fidl::encoding::TypeMarker for LightError {
392 type Owned = Self;
393
394 #[inline(always)]
395 fn inline_align(_context: fidl::encoding::Context) -> usize {
396 std::mem::align_of::<u32>()
397 }
398
399 #[inline(always)]
400 fn inline_size(_context: fidl::encoding::Context) -> usize {
401 std::mem::size_of::<u32>()
402 }
403
404 #[inline(always)]
405 fn encode_is_copy() -> bool {
406 true
407 }
408
409 #[inline(always)]
410 fn decode_is_copy() -> bool {
411 false
412 }
413 }
414
415 impl fidl::encoding::ValueTypeMarker for LightError {
416 type Borrowed<'a> = Self;
417 #[inline(always)]
418 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
419 *value
420 }
421 }
422
423 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LightError {
424 #[inline]
425 unsafe fn encode(
426 self,
427 encoder: &mut fidl::encoding::Encoder<'_, D>,
428 offset: usize,
429 _depth: fidl::encoding::Depth,
430 ) -> fidl::Result<()> {
431 encoder.debug_check_bounds::<Self>(offset);
432 encoder.write_num(self.into_primitive(), offset);
433 Ok(())
434 }
435 }
436
437 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightError {
438 #[inline(always)]
439 fn new_empty() -> Self {
440 Self::Ok
441 }
442
443 #[inline]
444 unsafe fn decode(
445 &mut self,
446 decoder: &mut fidl::encoding::Decoder<'_, D>,
447 offset: usize,
448 _depth: fidl::encoding::Depth,
449 ) -> fidl::Result<()> {
450 decoder.debug_check_bounds::<Self>(offset);
451 let prim = decoder.read_num::<u32>(offset);
452
453 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
454 Ok(())
455 }
456 }
457
458 impl fidl::encoding::ValueTypeMarker for GroupInfo {
459 type Borrowed<'a> = &'a Self;
460 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
461 value
462 }
463 }
464
465 unsafe impl fidl::encoding::TypeMarker for GroupInfo {
466 type Owned = Self;
467
468 #[inline(always)]
469 fn inline_align(_context: fidl::encoding::Context) -> usize {
470 8
471 }
472
473 #[inline(always)]
474 fn inline_size(_context: fidl::encoding::Context) -> usize {
475 24
476 }
477 }
478
479 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GroupInfo, D>
480 for &GroupInfo
481 {
482 #[inline]
483 unsafe fn encode(
484 self,
485 encoder: &mut fidl::encoding::Encoder<'_, D>,
486 offset: usize,
487 _depth: fidl::encoding::Depth,
488 ) -> fidl::Result<()> {
489 encoder.debug_check_bounds::<GroupInfo>(offset);
490 fidl::encoding::Encode::<GroupInfo, D>::encode(
492 (
493 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
494 &self.name,
495 ),
496 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
497 <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
498 ),
499 encoder,
500 offset,
501 _depth,
502 )
503 }
504 }
505 unsafe impl<
506 D: fidl::encoding::ResourceDialect,
507 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
508 T1: fidl::encoding::Encode<u32, D>,
509 T2: fidl::encoding::Encode<Capability, D>,
510 > fidl::encoding::Encode<GroupInfo, D> for (T0, T1, T2)
511 {
512 #[inline]
513 unsafe fn encode(
514 self,
515 encoder: &mut fidl::encoding::Encoder<'_, D>,
516 offset: usize,
517 depth: fidl::encoding::Depth,
518 ) -> fidl::Result<()> {
519 encoder.debug_check_bounds::<GroupInfo>(offset);
520 self.0.encode(encoder, offset + 0, depth)?;
524 self.1.encode(encoder, offset + 16, depth)?;
525 self.2.encode(encoder, offset + 20, depth)?;
526 Ok(())
527 }
528 }
529
530 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GroupInfo {
531 #[inline(always)]
532 fn new_empty() -> Self {
533 Self {
534 name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
535 count: fidl::new_empty!(u32, D),
536 capability: fidl::new_empty!(Capability, D),
537 }
538 }
539
540 #[inline]
541 unsafe fn decode(
542 &mut self,
543 decoder: &mut fidl::encoding::Decoder<'_, D>,
544 offset: usize,
545 _depth: fidl::encoding::Depth,
546 ) -> fidl::Result<()> {
547 decoder.debug_check_bounds::<Self>(offset);
548 fidl::decode!(
550 fidl::encoding::BoundedString<32>,
551 D,
552 &mut self.name,
553 decoder,
554 offset + 0,
555 _depth
556 )?;
557 fidl::decode!(u32, D, &mut self.count, decoder, offset + 16, _depth)?;
558 fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 20, _depth)?;
559 Ok(())
560 }
561 }
562
563 impl fidl::encoding::ValueTypeMarker for Info {
564 type Borrowed<'a> = &'a Self;
565 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
566 value
567 }
568 }
569
570 unsafe impl fidl::encoding::TypeMarker for Info {
571 type Owned = Self;
572
573 #[inline(always)]
574 fn inline_align(_context: fidl::encoding::Context) -> usize {
575 8
576 }
577
578 #[inline(always)]
579 fn inline_size(_context: fidl::encoding::Context) -> usize {
580 24
581 }
582 }
583
584 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
585 #[inline]
586 unsafe fn encode(
587 self,
588 encoder: &mut fidl::encoding::Encoder<'_, D>,
589 offset: usize,
590 _depth: fidl::encoding::Depth,
591 ) -> fidl::Result<()> {
592 encoder.debug_check_bounds::<Info>(offset);
593 fidl::encoding::Encode::<Info, D>::encode(
595 (
596 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
597 &self.name,
598 ),
599 <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
600 ),
601 encoder,
602 offset,
603 _depth,
604 )
605 }
606 }
607 unsafe impl<
608 D: fidl::encoding::ResourceDialect,
609 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
610 T1: fidl::encoding::Encode<Capability, D>,
611 > fidl::encoding::Encode<Info, D> for (T0, T1)
612 {
613 #[inline]
614 unsafe fn encode(
615 self,
616 encoder: &mut fidl::encoding::Encoder<'_, D>,
617 offset: usize,
618 depth: fidl::encoding::Depth,
619 ) -> fidl::Result<()> {
620 encoder.debug_check_bounds::<Info>(offset);
621 unsafe {
624 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
625 (ptr as *mut u64).write_unaligned(0);
626 }
627 self.0.encode(encoder, offset + 0, depth)?;
629 self.1.encode(encoder, offset + 16, depth)?;
630 Ok(())
631 }
632 }
633
634 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
635 #[inline(always)]
636 fn new_empty() -> Self {
637 Self {
638 name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
639 capability: fidl::new_empty!(Capability, D),
640 }
641 }
642
643 #[inline]
644 unsafe fn decode(
645 &mut self,
646 decoder: &mut fidl::encoding::Decoder<'_, D>,
647 offset: usize,
648 _depth: fidl::encoding::Depth,
649 ) -> fidl::Result<()> {
650 decoder.debug_check_bounds::<Self>(offset);
651 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
653 let padval = unsafe { (ptr as *const u64).read_unaligned() };
654 let mask = 0xffffffff00000000u64;
655 let maskedval = padval & mask;
656 if maskedval != 0 {
657 return Err(fidl::Error::NonZeroPadding {
658 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
659 });
660 }
661 fidl::decode!(
662 fidl::encoding::BoundedString<32>,
663 D,
664 &mut self.name,
665 decoder,
666 offset + 0,
667 _depth
668 )?;
669 fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 16, _depth)?;
670 Ok(())
671 }
672 }
673
674 impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueRequest {
675 type Borrowed<'a> = &'a Self;
676 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
677 value
678 }
679 }
680
681 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueRequest {
682 type Owned = Self;
683
684 #[inline(always)]
685 fn inline_align(_context: fidl::encoding::Context) -> usize {
686 4
687 }
688
689 #[inline(always)]
690 fn inline_size(_context: fidl::encoding::Context) -> usize {
691 4
692 }
693 #[inline(always)]
694 fn encode_is_copy() -> bool {
695 true
696 }
697
698 #[inline(always)]
699 fn decode_is_copy() -> bool {
700 true
701 }
702 }
703
704 unsafe impl<D: fidl::encoding::ResourceDialect>
705 fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D>
706 for &LightGetCurrentBrightnessValueRequest
707 {
708 #[inline]
709 unsafe fn encode(
710 self,
711 encoder: &mut fidl::encoding::Encoder<'_, D>,
712 offset: usize,
713 _depth: fidl::encoding::Depth,
714 ) -> fidl::Result<()> {
715 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
716 unsafe {
717 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
719 (buf_ptr as *mut LightGetCurrentBrightnessValueRequest)
720 .write_unaligned((self as *const LightGetCurrentBrightnessValueRequest).read());
721 }
724 Ok(())
725 }
726 }
727 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
728 fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D> for (T0,)
729 {
730 #[inline]
731 unsafe fn encode(
732 self,
733 encoder: &mut fidl::encoding::Encoder<'_, D>,
734 offset: usize,
735 depth: fidl::encoding::Depth,
736 ) -> fidl::Result<()> {
737 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
738 self.0.encode(encoder, offset + 0, depth)?;
742 Ok(())
743 }
744 }
745
746 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
747 for LightGetCurrentBrightnessValueRequest
748 {
749 #[inline(always)]
750 fn new_empty() -> Self {
751 Self { index: fidl::new_empty!(u32, D) }
752 }
753
754 #[inline]
755 unsafe fn decode(
756 &mut self,
757 decoder: &mut fidl::encoding::Decoder<'_, D>,
758 offset: usize,
759 _depth: fidl::encoding::Depth,
760 ) -> fidl::Result<()> {
761 decoder.debug_check_bounds::<Self>(offset);
762 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
763 unsafe {
766 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
767 }
768 Ok(())
769 }
770 }
771
772 impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueRequest {
773 type Borrowed<'a> = &'a Self;
774 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
775 value
776 }
777 }
778
779 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueRequest {
780 type Owned = Self;
781
782 #[inline(always)]
783 fn inline_align(_context: fidl::encoding::Context) -> usize {
784 4
785 }
786
787 #[inline(always)]
788 fn inline_size(_context: fidl::encoding::Context) -> usize {
789 4
790 }
791 #[inline(always)]
792 fn encode_is_copy() -> bool {
793 true
794 }
795
796 #[inline(always)]
797 fn decode_is_copy() -> bool {
798 true
799 }
800 }
801
802 unsafe impl<D: fidl::encoding::ResourceDialect>
803 fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D>
804 for &LightGetCurrentRgbValueRequest
805 {
806 #[inline]
807 unsafe fn encode(
808 self,
809 encoder: &mut fidl::encoding::Encoder<'_, D>,
810 offset: usize,
811 _depth: fidl::encoding::Depth,
812 ) -> fidl::Result<()> {
813 encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
814 unsafe {
815 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
817 (buf_ptr as *mut LightGetCurrentRgbValueRequest)
818 .write_unaligned((self as *const LightGetCurrentRgbValueRequest).read());
819 }
822 Ok(())
823 }
824 }
825 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
826 fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D> for (T0,)
827 {
828 #[inline]
829 unsafe fn encode(
830 self,
831 encoder: &mut fidl::encoding::Encoder<'_, D>,
832 offset: usize,
833 depth: fidl::encoding::Depth,
834 ) -> fidl::Result<()> {
835 encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
836 self.0.encode(encoder, offset + 0, depth)?;
840 Ok(())
841 }
842 }
843
844 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
845 for LightGetCurrentRgbValueRequest
846 {
847 #[inline(always)]
848 fn new_empty() -> Self {
849 Self { index: fidl::new_empty!(u32, D) }
850 }
851
852 #[inline]
853 unsafe fn decode(
854 &mut self,
855 decoder: &mut fidl::encoding::Decoder<'_, D>,
856 offset: usize,
857 _depth: fidl::encoding::Depth,
858 ) -> fidl::Result<()> {
859 decoder.debug_check_bounds::<Self>(offset);
860 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
861 unsafe {
864 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
865 }
866 Ok(())
867 }
868 }
869
870 impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueRequest {
871 type Borrowed<'a> = &'a Self;
872 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
873 value
874 }
875 }
876
877 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueRequest {
878 type Owned = Self;
879
880 #[inline(always)]
881 fn inline_align(_context: fidl::encoding::Context) -> usize {
882 4
883 }
884
885 #[inline(always)]
886 fn inline_size(_context: fidl::encoding::Context) -> usize {
887 4
888 }
889 #[inline(always)]
890 fn encode_is_copy() -> bool {
891 true
892 }
893
894 #[inline(always)]
895 fn decode_is_copy() -> bool {
896 true
897 }
898 }
899
900 unsafe impl<D: fidl::encoding::ResourceDialect>
901 fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D>
902 for &LightGetCurrentSimpleValueRequest
903 {
904 #[inline]
905 unsafe fn encode(
906 self,
907 encoder: &mut fidl::encoding::Encoder<'_, D>,
908 offset: usize,
909 _depth: fidl::encoding::Depth,
910 ) -> fidl::Result<()> {
911 encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
912 unsafe {
913 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
915 (buf_ptr as *mut LightGetCurrentSimpleValueRequest)
916 .write_unaligned((self as *const LightGetCurrentSimpleValueRequest).read());
917 }
920 Ok(())
921 }
922 }
923 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
924 fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D> for (T0,)
925 {
926 #[inline]
927 unsafe fn encode(
928 self,
929 encoder: &mut fidl::encoding::Encoder<'_, D>,
930 offset: usize,
931 depth: fidl::encoding::Depth,
932 ) -> fidl::Result<()> {
933 encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
934 self.0.encode(encoder, offset + 0, depth)?;
938 Ok(())
939 }
940 }
941
942 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
943 for LightGetCurrentSimpleValueRequest
944 {
945 #[inline(always)]
946 fn new_empty() -> Self {
947 Self { index: fidl::new_empty!(u32, D) }
948 }
949
950 #[inline]
951 unsafe fn decode(
952 &mut self,
953 decoder: &mut fidl::encoding::Decoder<'_, D>,
954 offset: usize,
955 _depth: fidl::encoding::Depth,
956 ) -> fidl::Result<()> {
957 decoder.debug_check_bounds::<Self>(offset);
958 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
959 unsafe {
962 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
963 }
964 Ok(())
965 }
966 }
967
968 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueRequest {
969 type Borrowed<'a> = &'a Self;
970 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
971 value
972 }
973 }
974
975 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueRequest {
976 type Owned = Self;
977
978 #[inline(always)]
979 fn inline_align(_context: fidl::encoding::Context) -> usize {
980 4
981 }
982
983 #[inline(always)]
984 fn inline_size(_context: fidl::encoding::Context) -> usize {
985 4
986 }
987 #[inline(always)]
988 fn encode_is_copy() -> bool {
989 true
990 }
991
992 #[inline(always)]
993 fn decode_is_copy() -> bool {
994 true
995 }
996 }
997
998 unsafe impl<D: fidl::encoding::ResourceDialect>
999 fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D>
1000 for &LightGetGroupCurrentBrightnessValueRequest
1001 {
1002 #[inline]
1003 unsafe fn encode(
1004 self,
1005 encoder: &mut fidl::encoding::Encoder<'_, D>,
1006 offset: usize,
1007 _depth: fidl::encoding::Depth,
1008 ) -> fidl::Result<()> {
1009 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
1010 unsafe {
1011 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1013 (buf_ptr as *mut LightGetGroupCurrentBrightnessValueRequest).write_unaligned(
1014 (self as *const LightGetGroupCurrentBrightnessValueRequest).read(),
1015 );
1016 }
1019 Ok(())
1020 }
1021 }
1022 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1023 fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D> for (T0,)
1024 {
1025 #[inline]
1026 unsafe fn encode(
1027 self,
1028 encoder: &mut fidl::encoding::Encoder<'_, D>,
1029 offset: usize,
1030 depth: fidl::encoding::Depth,
1031 ) -> fidl::Result<()> {
1032 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
1033 self.0.encode(encoder, offset + 0, depth)?;
1037 Ok(())
1038 }
1039 }
1040
1041 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1042 for LightGetGroupCurrentBrightnessValueRequest
1043 {
1044 #[inline(always)]
1045 fn new_empty() -> Self {
1046 Self { group_id: fidl::new_empty!(u32, D) }
1047 }
1048
1049 #[inline]
1050 unsafe fn decode(
1051 &mut self,
1052 decoder: &mut fidl::encoding::Decoder<'_, D>,
1053 offset: usize,
1054 _depth: fidl::encoding::Depth,
1055 ) -> fidl::Result<()> {
1056 decoder.debug_check_bounds::<Self>(offset);
1057 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1058 unsafe {
1061 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1062 }
1063 Ok(())
1064 }
1065 }
1066
1067 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueRequest {
1068 type Borrowed<'a> = &'a Self;
1069 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1070 value
1071 }
1072 }
1073
1074 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueRequest {
1075 type Owned = Self;
1076
1077 #[inline(always)]
1078 fn inline_align(_context: fidl::encoding::Context) -> usize {
1079 4
1080 }
1081
1082 #[inline(always)]
1083 fn inline_size(_context: fidl::encoding::Context) -> usize {
1084 4
1085 }
1086 #[inline(always)]
1087 fn encode_is_copy() -> bool {
1088 true
1089 }
1090
1091 #[inline(always)]
1092 fn decode_is_copy() -> bool {
1093 true
1094 }
1095 }
1096
1097 unsafe impl<D: fidl::encoding::ResourceDialect>
1098 fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D>
1099 for &LightGetGroupCurrentRgbValueRequest
1100 {
1101 #[inline]
1102 unsafe fn encode(
1103 self,
1104 encoder: &mut fidl::encoding::Encoder<'_, D>,
1105 offset: usize,
1106 _depth: fidl::encoding::Depth,
1107 ) -> fidl::Result<()> {
1108 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
1109 unsafe {
1110 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1112 (buf_ptr as *mut LightGetGroupCurrentRgbValueRequest)
1113 .write_unaligned((self as *const LightGetGroupCurrentRgbValueRequest).read());
1114 }
1117 Ok(())
1118 }
1119 }
1120 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1121 fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D> for (T0,)
1122 {
1123 #[inline]
1124 unsafe fn encode(
1125 self,
1126 encoder: &mut fidl::encoding::Encoder<'_, D>,
1127 offset: usize,
1128 depth: fidl::encoding::Depth,
1129 ) -> fidl::Result<()> {
1130 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
1131 self.0.encode(encoder, offset + 0, depth)?;
1135 Ok(())
1136 }
1137 }
1138
1139 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1140 for LightGetGroupCurrentRgbValueRequest
1141 {
1142 #[inline(always)]
1143 fn new_empty() -> Self {
1144 Self { group_id: fidl::new_empty!(u32, D) }
1145 }
1146
1147 #[inline]
1148 unsafe fn decode(
1149 &mut self,
1150 decoder: &mut fidl::encoding::Decoder<'_, D>,
1151 offset: usize,
1152 _depth: fidl::encoding::Depth,
1153 ) -> fidl::Result<()> {
1154 decoder.debug_check_bounds::<Self>(offset);
1155 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1156 unsafe {
1159 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1160 }
1161 Ok(())
1162 }
1163 }
1164
1165 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueRequest {
1166 type Borrowed<'a> = &'a Self;
1167 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1168 value
1169 }
1170 }
1171
1172 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueRequest {
1173 type Owned = Self;
1174
1175 #[inline(always)]
1176 fn inline_align(_context: fidl::encoding::Context) -> usize {
1177 4
1178 }
1179
1180 #[inline(always)]
1181 fn inline_size(_context: fidl::encoding::Context) -> usize {
1182 4
1183 }
1184 #[inline(always)]
1185 fn encode_is_copy() -> bool {
1186 true
1187 }
1188
1189 #[inline(always)]
1190 fn decode_is_copy() -> bool {
1191 true
1192 }
1193 }
1194
1195 unsafe impl<D: fidl::encoding::ResourceDialect>
1196 fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D>
1197 for &LightGetGroupCurrentSimpleValueRequest
1198 {
1199 #[inline]
1200 unsafe fn encode(
1201 self,
1202 encoder: &mut fidl::encoding::Encoder<'_, D>,
1203 offset: usize,
1204 _depth: fidl::encoding::Depth,
1205 ) -> fidl::Result<()> {
1206 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
1207 unsafe {
1208 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1210 (buf_ptr as *mut LightGetGroupCurrentSimpleValueRequest).write_unaligned(
1211 (self as *const LightGetGroupCurrentSimpleValueRequest).read(),
1212 );
1213 }
1216 Ok(())
1217 }
1218 }
1219 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1220 fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D> for (T0,)
1221 {
1222 #[inline]
1223 unsafe fn encode(
1224 self,
1225 encoder: &mut fidl::encoding::Encoder<'_, D>,
1226 offset: usize,
1227 depth: fidl::encoding::Depth,
1228 ) -> fidl::Result<()> {
1229 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
1230 self.0.encode(encoder, offset + 0, depth)?;
1234 Ok(())
1235 }
1236 }
1237
1238 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1239 for LightGetGroupCurrentSimpleValueRequest
1240 {
1241 #[inline(always)]
1242 fn new_empty() -> Self {
1243 Self { group_id: fidl::new_empty!(u32, D) }
1244 }
1245
1246 #[inline]
1247 unsafe fn decode(
1248 &mut self,
1249 decoder: &mut fidl::encoding::Decoder<'_, D>,
1250 offset: usize,
1251 _depth: fidl::encoding::Depth,
1252 ) -> fidl::Result<()> {
1253 decoder.debug_check_bounds::<Self>(offset);
1254 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1255 unsafe {
1258 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1259 }
1260 Ok(())
1261 }
1262 }
1263
1264 impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoRequest {
1265 type Borrowed<'a> = &'a Self;
1266 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1267 value
1268 }
1269 }
1270
1271 unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoRequest {
1272 type Owned = Self;
1273
1274 #[inline(always)]
1275 fn inline_align(_context: fidl::encoding::Context) -> usize {
1276 4
1277 }
1278
1279 #[inline(always)]
1280 fn inline_size(_context: fidl::encoding::Context) -> usize {
1281 4
1282 }
1283 #[inline(always)]
1284 fn encode_is_copy() -> bool {
1285 true
1286 }
1287
1288 #[inline(always)]
1289 fn decode_is_copy() -> bool {
1290 true
1291 }
1292 }
1293
1294 unsafe impl<D: fidl::encoding::ResourceDialect>
1295 fidl::encoding::Encode<LightGetGroupInfoRequest, D> for &LightGetGroupInfoRequest
1296 {
1297 #[inline]
1298 unsafe fn encode(
1299 self,
1300 encoder: &mut fidl::encoding::Encoder<'_, D>,
1301 offset: usize,
1302 _depth: fidl::encoding::Depth,
1303 ) -> fidl::Result<()> {
1304 encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
1305 unsafe {
1306 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1308 (buf_ptr as *mut LightGetGroupInfoRequest)
1309 .write_unaligned((self as *const LightGetGroupInfoRequest).read());
1310 }
1313 Ok(())
1314 }
1315 }
1316 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1317 fidl::encoding::Encode<LightGetGroupInfoRequest, D> for (T0,)
1318 {
1319 #[inline]
1320 unsafe fn encode(
1321 self,
1322 encoder: &mut fidl::encoding::Encoder<'_, D>,
1323 offset: usize,
1324 depth: fidl::encoding::Depth,
1325 ) -> fidl::Result<()> {
1326 encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
1327 self.0.encode(encoder, offset + 0, depth)?;
1331 Ok(())
1332 }
1333 }
1334
1335 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1336 for LightGetGroupInfoRequest
1337 {
1338 #[inline(always)]
1339 fn new_empty() -> Self {
1340 Self { group_id: fidl::new_empty!(u32, D) }
1341 }
1342
1343 #[inline]
1344 unsafe fn decode(
1345 &mut self,
1346 decoder: &mut fidl::encoding::Decoder<'_, D>,
1347 offset: usize,
1348 _depth: fidl::encoding::Depth,
1349 ) -> fidl::Result<()> {
1350 decoder.debug_check_bounds::<Self>(offset);
1351 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1352 unsafe {
1355 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1356 }
1357 Ok(())
1358 }
1359 }
1360
1361 impl fidl::encoding::ValueTypeMarker for LightGetInfoRequest {
1362 type Borrowed<'a> = &'a Self;
1363 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1364 value
1365 }
1366 }
1367
1368 unsafe impl fidl::encoding::TypeMarker for LightGetInfoRequest {
1369 type Owned = Self;
1370
1371 #[inline(always)]
1372 fn inline_align(_context: fidl::encoding::Context) -> usize {
1373 4
1374 }
1375
1376 #[inline(always)]
1377 fn inline_size(_context: fidl::encoding::Context) -> usize {
1378 4
1379 }
1380 #[inline(always)]
1381 fn encode_is_copy() -> bool {
1382 true
1383 }
1384
1385 #[inline(always)]
1386 fn decode_is_copy() -> bool {
1387 true
1388 }
1389 }
1390
1391 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoRequest, D>
1392 for &LightGetInfoRequest
1393 {
1394 #[inline]
1395 unsafe fn encode(
1396 self,
1397 encoder: &mut fidl::encoding::Encoder<'_, D>,
1398 offset: usize,
1399 _depth: fidl::encoding::Depth,
1400 ) -> fidl::Result<()> {
1401 encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
1402 unsafe {
1403 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1405 (buf_ptr as *mut LightGetInfoRequest)
1406 .write_unaligned((self as *const LightGetInfoRequest).read());
1407 }
1410 Ok(())
1411 }
1412 }
1413 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1414 fidl::encoding::Encode<LightGetInfoRequest, D> for (T0,)
1415 {
1416 #[inline]
1417 unsafe fn encode(
1418 self,
1419 encoder: &mut fidl::encoding::Encoder<'_, D>,
1420 offset: usize,
1421 depth: fidl::encoding::Depth,
1422 ) -> fidl::Result<()> {
1423 encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
1424 self.0.encode(encoder, offset + 0, depth)?;
1428 Ok(())
1429 }
1430 }
1431
1432 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoRequest {
1433 #[inline(always)]
1434 fn new_empty() -> Self {
1435 Self { index: fidl::new_empty!(u32, D) }
1436 }
1437
1438 #[inline]
1439 unsafe fn decode(
1440 &mut self,
1441 decoder: &mut fidl::encoding::Decoder<'_, D>,
1442 offset: usize,
1443 _depth: fidl::encoding::Depth,
1444 ) -> fidl::Result<()> {
1445 decoder.debug_check_bounds::<Self>(offset);
1446 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1447 unsafe {
1450 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1451 }
1452 Ok(())
1453 }
1454 }
1455
1456 impl fidl::encoding::ValueTypeMarker for LightGetNumLightGroupsResponse {
1457 type Borrowed<'a> = &'a Self;
1458 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1459 value
1460 }
1461 }
1462
1463 unsafe impl fidl::encoding::TypeMarker for LightGetNumLightGroupsResponse {
1464 type Owned = Self;
1465
1466 #[inline(always)]
1467 fn inline_align(_context: fidl::encoding::Context) -> usize {
1468 4
1469 }
1470
1471 #[inline(always)]
1472 fn inline_size(_context: fidl::encoding::Context) -> usize {
1473 4
1474 }
1475 #[inline(always)]
1476 fn encode_is_copy() -> bool {
1477 true
1478 }
1479
1480 #[inline(always)]
1481 fn decode_is_copy() -> bool {
1482 true
1483 }
1484 }
1485
1486 unsafe impl<D: fidl::encoding::ResourceDialect>
1487 fidl::encoding::Encode<LightGetNumLightGroupsResponse, D>
1488 for &LightGetNumLightGroupsResponse
1489 {
1490 #[inline]
1491 unsafe fn encode(
1492 self,
1493 encoder: &mut fidl::encoding::Encoder<'_, D>,
1494 offset: usize,
1495 _depth: fidl::encoding::Depth,
1496 ) -> fidl::Result<()> {
1497 encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
1498 unsafe {
1499 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1501 (buf_ptr as *mut LightGetNumLightGroupsResponse)
1502 .write_unaligned((self as *const LightGetNumLightGroupsResponse).read());
1503 }
1506 Ok(())
1507 }
1508 }
1509 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1510 fidl::encoding::Encode<LightGetNumLightGroupsResponse, D> for (T0,)
1511 {
1512 #[inline]
1513 unsafe fn encode(
1514 self,
1515 encoder: &mut fidl::encoding::Encoder<'_, D>,
1516 offset: usize,
1517 depth: fidl::encoding::Depth,
1518 ) -> fidl::Result<()> {
1519 encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
1520 self.0.encode(encoder, offset + 0, depth)?;
1524 Ok(())
1525 }
1526 }
1527
1528 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1529 for LightGetNumLightGroupsResponse
1530 {
1531 #[inline(always)]
1532 fn new_empty() -> Self {
1533 Self { count: fidl::new_empty!(u32, D) }
1534 }
1535
1536 #[inline]
1537 unsafe fn decode(
1538 &mut self,
1539 decoder: &mut fidl::encoding::Decoder<'_, D>,
1540 offset: usize,
1541 _depth: fidl::encoding::Depth,
1542 ) -> fidl::Result<()> {
1543 decoder.debug_check_bounds::<Self>(offset);
1544 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1545 unsafe {
1548 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1549 }
1550 Ok(())
1551 }
1552 }
1553
1554 impl fidl::encoding::ValueTypeMarker for LightGetNumLightsResponse {
1555 type Borrowed<'a> = &'a Self;
1556 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1557 value
1558 }
1559 }
1560
1561 unsafe impl fidl::encoding::TypeMarker for LightGetNumLightsResponse {
1562 type Owned = Self;
1563
1564 #[inline(always)]
1565 fn inline_align(_context: fidl::encoding::Context) -> usize {
1566 4
1567 }
1568
1569 #[inline(always)]
1570 fn inline_size(_context: fidl::encoding::Context) -> usize {
1571 4
1572 }
1573 #[inline(always)]
1574 fn encode_is_copy() -> bool {
1575 true
1576 }
1577
1578 #[inline(always)]
1579 fn decode_is_copy() -> bool {
1580 true
1581 }
1582 }
1583
1584 unsafe impl<D: fidl::encoding::ResourceDialect>
1585 fidl::encoding::Encode<LightGetNumLightsResponse, D> for &LightGetNumLightsResponse
1586 {
1587 #[inline]
1588 unsafe fn encode(
1589 self,
1590 encoder: &mut fidl::encoding::Encoder<'_, D>,
1591 offset: usize,
1592 _depth: fidl::encoding::Depth,
1593 ) -> fidl::Result<()> {
1594 encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
1595 unsafe {
1596 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1598 (buf_ptr as *mut LightGetNumLightsResponse)
1599 .write_unaligned((self as *const LightGetNumLightsResponse).read());
1600 }
1603 Ok(())
1604 }
1605 }
1606 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1607 fidl::encoding::Encode<LightGetNumLightsResponse, D> for (T0,)
1608 {
1609 #[inline]
1610 unsafe fn encode(
1611 self,
1612 encoder: &mut fidl::encoding::Encoder<'_, D>,
1613 offset: usize,
1614 depth: fidl::encoding::Depth,
1615 ) -> fidl::Result<()> {
1616 encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
1617 self.0.encode(encoder, offset + 0, depth)?;
1621 Ok(())
1622 }
1623 }
1624
1625 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1626 for LightGetNumLightsResponse
1627 {
1628 #[inline(always)]
1629 fn new_empty() -> Self {
1630 Self { count: fidl::new_empty!(u32, D) }
1631 }
1632
1633 #[inline]
1634 unsafe fn decode(
1635 &mut self,
1636 decoder: &mut fidl::encoding::Decoder<'_, D>,
1637 offset: usize,
1638 _depth: fidl::encoding::Depth,
1639 ) -> fidl::Result<()> {
1640 decoder.debug_check_bounds::<Self>(offset);
1641 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1642 unsafe {
1645 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1646 }
1647 Ok(())
1648 }
1649 }
1650
1651 impl fidl::encoding::ValueTypeMarker for LightSetBrightnessValueRequest {
1652 type Borrowed<'a> = &'a Self;
1653 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1654 value
1655 }
1656 }
1657
1658 unsafe impl fidl::encoding::TypeMarker for LightSetBrightnessValueRequest {
1659 type Owned = Self;
1660
1661 #[inline(always)]
1662 fn inline_align(_context: fidl::encoding::Context) -> usize {
1663 8
1664 }
1665
1666 #[inline(always)]
1667 fn inline_size(_context: fidl::encoding::Context) -> usize {
1668 16
1669 }
1670 }
1671
1672 unsafe impl<D: fidl::encoding::ResourceDialect>
1673 fidl::encoding::Encode<LightSetBrightnessValueRequest, D>
1674 for &LightSetBrightnessValueRequest
1675 {
1676 #[inline]
1677 unsafe fn encode(
1678 self,
1679 encoder: &mut fidl::encoding::Encoder<'_, D>,
1680 offset: usize,
1681 _depth: fidl::encoding::Depth,
1682 ) -> fidl::Result<()> {
1683 encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
1684 fidl::encoding::Encode::<LightSetBrightnessValueRequest, D>::encode(
1686 (
1687 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
1688 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
1689 ),
1690 encoder,
1691 offset,
1692 _depth,
1693 )
1694 }
1695 }
1696 unsafe impl<
1697 D: fidl::encoding::ResourceDialect,
1698 T0: fidl::encoding::Encode<u32, D>,
1699 T1: fidl::encoding::Encode<f64, D>,
1700 > fidl::encoding::Encode<LightSetBrightnessValueRequest, D> for (T0, T1)
1701 {
1702 #[inline]
1703 unsafe fn encode(
1704 self,
1705 encoder: &mut fidl::encoding::Encoder<'_, D>,
1706 offset: usize,
1707 depth: fidl::encoding::Depth,
1708 ) -> fidl::Result<()> {
1709 encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
1710 unsafe {
1713 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1714 (ptr as *mut u64).write_unaligned(0);
1715 }
1716 self.0.encode(encoder, offset + 0, depth)?;
1718 self.1.encode(encoder, offset + 8, depth)?;
1719 Ok(())
1720 }
1721 }
1722
1723 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1724 for LightSetBrightnessValueRequest
1725 {
1726 #[inline(always)]
1727 fn new_empty() -> Self {
1728 Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(f64, D) }
1729 }
1730
1731 #[inline]
1732 unsafe fn decode(
1733 &mut self,
1734 decoder: &mut fidl::encoding::Decoder<'_, D>,
1735 offset: usize,
1736 _depth: fidl::encoding::Depth,
1737 ) -> fidl::Result<()> {
1738 decoder.debug_check_bounds::<Self>(offset);
1739 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1741 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1742 let mask = 0xffffffff00000000u64;
1743 let maskedval = padval & mask;
1744 if maskedval != 0 {
1745 return Err(fidl::Error::NonZeroPadding {
1746 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1747 });
1748 }
1749 fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
1750 fidl::decode!(f64, D, &mut self.value, decoder, offset + 8, _depth)?;
1751 Ok(())
1752 }
1753 }
1754
1755 impl fidl::encoding::ValueTypeMarker for LightSetGroupBrightnessValueRequest {
1756 type Borrowed<'a> = &'a Self;
1757 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1758 value
1759 }
1760 }
1761
1762 unsafe impl fidl::encoding::TypeMarker for LightSetGroupBrightnessValueRequest {
1763 type Owned = Self;
1764
1765 #[inline(always)]
1766 fn inline_align(_context: fidl::encoding::Context) -> usize {
1767 8
1768 }
1769
1770 #[inline(always)]
1771 fn inline_size(_context: fidl::encoding::Context) -> usize {
1772 24
1773 }
1774 }
1775
1776 unsafe impl<D: fidl::encoding::ResourceDialect>
1777 fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D>
1778 for &LightSetGroupBrightnessValueRequest
1779 {
1780 #[inline]
1781 unsafe fn encode(
1782 self,
1783 encoder: &mut fidl::encoding::Encoder<'_, D>,
1784 offset: usize,
1785 _depth: fidl::encoding::Depth,
1786 ) -> fidl::Result<()> {
1787 encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
1788 fidl::encoding::Encode::<LightSetGroupBrightnessValueRequest, D>::encode(
1790 (
1791 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1792 <fidl::encoding::UnboundedVector<f64> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1793 ),
1794 encoder, offset, _depth
1795 )
1796 }
1797 }
1798 unsafe impl<
1799 D: fidl::encoding::ResourceDialect,
1800 T0: fidl::encoding::Encode<u32, D>,
1801 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<f64>, D>,
1802 > fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D> for (T0, T1)
1803 {
1804 #[inline]
1805 unsafe fn encode(
1806 self,
1807 encoder: &mut fidl::encoding::Encoder<'_, D>,
1808 offset: usize,
1809 depth: fidl::encoding::Depth,
1810 ) -> fidl::Result<()> {
1811 encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
1812 unsafe {
1815 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1816 (ptr as *mut u64).write_unaligned(0);
1817 }
1818 self.0.encode(encoder, offset + 0, depth)?;
1820 self.1.encode(encoder, offset + 8, depth)?;
1821 Ok(())
1822 }
1823 }
1824
1825 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1826 for LightSetGroupBrightnessValueRequest
1827 {
1828 #[inline(always)]
1829 fn new_empty() -> Self {
1830 Self {
1831 group_id: fidl::new_empty!(u32, D),
1832 values: fidl::new_empty!(fidl::encoding::UnboundedVector<f64>, D),
1833 }
1834 }
1835
1836 #[inline]
1837 unsafe fn decode(
1838 &mut self,
1839 decoder: &mut fidl::encoding::Decoder<'_, D>,
1840 offset: usize,
1841 _depth: fidl::encoding::Depth,
1842 ) -> fidl::Result<()> {
1843 decoder.debug_check_bounds::<Self>(offset);
1844 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1846 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1847 let mask = 0xffffffff00000000u64;
1848 let maskedval = padval & mask;
1849 if maskedval != 0 {
1850 return Err(fidl::Error::NonZeroPadding {
1851 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1852 });
1853 }
1854 fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
1855 fidl::decode!(
1856 fidl::encoding::UnboundedVector<f64>,
1857 D,
1858 &mut self.values,
1859 decoder,
1860 offset + 8,
1861 _depth
1862 )?;
1863 Ok(())
1864 }
1865 }
1866
1867 impl fidl::encoding::ValueTypeMarker for LightSetGroupRgbValueRequest {
1868 type Borrowed<'a> = &'a Self;
1869 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1870 value
1871 }
1872 }
1873
1874 unsafe impl fidl::encoding::TypeMarker for LightSetGroupRgbValueRequest {
1875 type Owned = Self;
1876
1877 #[inline(always)]
1878 fn inline_align(_context: fidl::encoding::Context) -> usize {
1879 8
1880 }
1881
1882 #[inline(always)]
1883 fn inline_size(_context: fidl::encoding::Context) -> usize {
1884 24
1885 }
1886 }
1887
1888 unsafe impl<D: fidl::encoding::ResourceDialect>
1889 fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for &LightSetGroupRgbValueRequest
1890 {
1891 #[inline]
1892 unsafe fn encode(
1893 self,
1894 encoder: &mut fidl::encoding::Encoder<'_, D>,
1895 offset: usize,
1896 _depth: fidl::encoding::Depth,
1897 ) -> fidl::Result<()> {
1898 encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
1899 fidl::encoding::Encode::<LightSetGroupRgbValueRequest, D>::encode(
1901 (
1902 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1903 <fidl::encoding::UnboundedVector<Rgb> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1904 ),
1905 encoder, offset, _depth
1906 )
1907 }
1908 }
1909 unsafe impl<
1910 D: fidl::encoding::ResourceDialect,
1911 T0: fidl::encoding::Encode<u32, D>,
1912 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Rgb>, D>,
1913 > fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for (T0, T1)
1914 {
1915 #[inline]
1916 unsafe fn encode(
1917 self,
1918 encoder: &mut fidl::encoding::Encoder<'_, D>,
1919 offset: usize,
1920 depth: fidl::encoding::Depth,
1921 ) -> fidl::Result<()> {
1922 encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
1923 unsafe {
1926 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1927 (ptr as *mut u64).write_unaligned(0);
1928 }
1929 self.0.encode(encoder, offset + 0, depth)?;
1931 self.1.encode(encoder, offset + 8, depth)?;
1932 Ok(())
1933 }
1934 }
1935
1936 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1937 for LightSetGroupRgbValueRequest
1938 {
1939 #[inline(always)]
1940 fn new_empty() -> Self {
1941 Self {
1942 group_id: fidl::new_empty!(u32, D),
1943 values: fidl::new_empty!(fidl::encoding::UnboundedVector<Rgb>, D),
1944 }
1945 }
1946
1947 #[inline]
1948 unsafe fn decode(
1949 &mut self,
1950 decoder: &mut fidl::encoding::Decoder<'_, D>,
1951 offset: usize,
1952 _depth: fidl::encoding::Depth,
1953 ) -> fidl::Result<()> {
1954 decoder.debug_check_bounds::<Self>(offset);
1955 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1957 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1958 let mask = 0xffffffff00000000u64;
1959 let maskedval = padval & mask;
1960 if maskedval != 0 {
1961 return Err(fidl::Error::NonZeroPadding {
1962 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1963 });
1964 }
1965 fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
1966 fidl::decode!(
1967 fidl::encoding::UnboundedVector<Rgb>,
1968 D,
1969 &mut self.values,
1970 decoder,
1971 offset + 8,
1972 _depth
1973 )?;
1974 Ok(())
1975 }
1976 }
1977
1978 impl fidl::encoding::ValueTypeMarker for LightSetGroupSimpleValueRequest {
1979 type Borrowed<'a> = &'a Self;
1980 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1981 value
1982 }
1983 }
1984
1985 unsafe impl fidl::encoding::TypeMarker for LightSetGroupSimpleValueRequest {
1986 type Owned = Self;
1987
1988 #[inline(always)]
1989 fn inline_align(_context: fidl::encoding::Context) -> usize {
1990 8
1991 }
1992
1993 #[inline(always)]
1994 fn inline_size(_context: fidl::encoding::Context) -> usize {
1995 24
1996 }
1997 }
1998
1999 unsafe impl<D: fidl::encoding::ResourceDialect>
2000 fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D>
2001 for &LightSetGroupSimpleValueRequest
2002 {
2003 #[inline]
2004 unsafe fn encode(
2005 self,
2006 encoder: &mut fidl::encoding::Encoder<'_, D>,
2007 offset: usize,
2008 _depth: fidl::encoding::Depth,
2009 ) -> fidl::Result<()> {
2010 encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
2011 fidl::encoding::Encode::<LightSetGroupSimpleValueRequest, D>::encode(
2013 (
2014 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
2015 <fidl::encoding::UnboundedVector<bool> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2016 ),
2017 encoder, offset, _depth
2018 )
2019 }
2020 }
2021 unsafe impl<
2022 D: fidl::encoding::ResourceDialect,
2023 T0: fidl::encoding::Encode<u32, D>,
2024 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<bool>, D>,
2025 > fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D> for (T0, T1)
2026 {
2027 #[inline]
2028 unsafe fn encode(
2029 self,
2030 encoder: &mut fidl::encoding::Encoder<'_, D>,
2031 offset: usize,
2032 depth: fidl::encoding::Depth,
2033 ) -> fidl::Result<()> {
2034 encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
2035 unsafe {
2038 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2039 (ptr as *mut u64).write_unaligned(0);
2040 }
2041 self.0.encode(encoder, offset + 0, depth)?;
2043 self.1.encode(encoder, offset + 8, depth)?;
2044 Ok(())
2045 }
2046 }
2047
2048 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2049 for LightSetGroupSimpleValueRequest
2050 {
2051 #[inline(always)]
2052 fn new_empty() -> Self {
2053 Self {
2054 group_id: fidl::new_empty!(u32, D),
2055 values: fidl::new_empty!(fidl::encoding::UnboundedVector<bool>, D),
2056 }
2057 }
2058
2059 #[inline]
2060 unsafe fn decode(
2061 &mut self,
2062 decoder: &mut fidl::encoding::Decoder<'_, D>,
2063 offset: usize,
2064 _depth: fidl::encoding::Depth,
2065 ) -> fidl::Result<()> {
2066 decoder.debug_check_bounds::<Self>(offset);
2067 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2069 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2070 let mask = 0xffffffff00000000u64;
2071 let maskedval = padval & mask;
2072 if maskedval != 0 {
2073 return Err(fidl::Error::NonZeroPadding {
2074 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2075 });
2076 }
2077 fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
2078 fidl::decode!(
2079 fidl::encoding::UnboundedVector<bool>,
2080 D,
2081 &mut self.values,
2082 decoder,
2083 offset + 8,
2084 _depth
2085 )?;
2086 Ok(())
2087 }
2088 }
2089
2090 impl fidl::encoding::ValueTypeMarker for LightSetRgbValueRequest {
2091 type Borrowed<'a> = &'a Self;
2092 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2093 value
2094 }
2095 }
2096
2097 unsafe impl fidl::encoding::TypeMarker for LightSetRgbValueRequest {
2098 type Owned = Self;
2099
2100 #[inline(always)]
2101 fn inline_align(_context: fidl::encoding::Context) -> usize {
2102 8
2103 }
2104
2105 #[inline(always)]
2106 fn inline_size(_context: fidl::encoding::Context) -> usize {
2107 32
2108 }
2109 }
2110
2111 unsafe impl<D: fidl::encoding::ResourceDialect>
2112 fidl::encoding::Encode<LightSetRgbValueRequest, D> for &LightSetRgbValueRequest
2113 {
2114 #[inline]
2115 unsafe fn encode(
2116 self,
2117 encoder: &mut fidl::encoding::Encoder<'_, D>,
2118 offset: usize,
2119 _depth: fidl::encoding::Depth,
2120 ) -> fidl::Result<()> {
2121 encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
2122 fidl::encoding::Encode::<LightSetRgbValueRequest, D>::encode(
2124 (
2125 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
2126 <Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2127 ),
2128 encoder,
2129 offset,
2130 _depth,
2131 )
2132 }
2133 }
2134 unsafe impl<
2135 D: fidl::encoding::ResourceDialect,
2136 T0: fidl::encoding::Encode<u32, D>,
2137 T1: fidl::encoding::Encode<Rgb, D>,
2138 > fidl::encoding::Encode<LightSetRgbValueRequest, D> for (T0, T1)
2139 {
2140 #[inline]
2141 unsafe fn encode(
2142 self,
2143 encoder: &mut fidl::encoding::Encoder<'_, D>,
2144 offset: usize,
2145 depth: fidl::encoding::Depth,
2146 ) -> fidl::Result<()> {
2147 encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
2148 unsafe {
2151 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2152 (ptr as *mut u64).write_unaligned(0);
2153 }
2154 self.0.encode(encoder, offset + 0, depth)?;
2156 self.1.encode(encoder, offset + 8, depth)?;
2157 Ok(())
2158 }
2159 }
2160
2161 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2162 for LightSetRgbValueRequest
2163 {
2164 #[inline(always)]
2165 fn new_empty() -> Self {
2166 Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(Rgb, D) }
2167 }
2168
2169 #[inline]
2170 unsafe fn decode(
2171 &mut self,
2172 decoder: &mut fidl::encoding::Decoder<'_, D>,
2173 offset: usize,
2174 _depth: fidl::encoding::Depth,
2175 ) -> fidl::Result<()> {
2176 decoder.debug_check_bounds::<Self>(offset);
2177 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2179 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2180 let mask = 0xffffffff00000000u64;
2181 let maskedval = padval & mask;
2182 if maskedval != 0 {
2183 return Err(fidl::Error::NonZeroPadding {
2184 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2185 });
2186 }
2187 fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
2188 fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 8, _depth)?;
2189 Ok(())
2190 }
2191 }
2192
2193 impl fidl::encoding::ValueTypeMarker for LightSetSimpleValueRequest {
2194 type Borrowed<'a> = &'a Self;
2195 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2196 value
2197 }
2198 }
2199
2200 unsafe impl fidl::encoding::TypeMarker for LightSetSimpleValueRequest {
2201 type Owned = Self;
2202
2203 #[inline(always)]
2204 fn inline_align(_context: fidl::encoding::Context) -> usize {
2205 4
2206 }
2207
2208 #[inline(always)]
2209 fn inline_size(_context: fidl::encoding::Context) -> usize {
2210 8
2211 }
2212 }
2213
2214 unsafe impl<D: fidl::encoding::ResourceDialect>
2215 fidl::encoding::Encode<LightSetSimpleValueRequest, D> for &LightSetSimpleValueRequest
2216 {
2217 #[inline]
2218 unsafe fn encode(
2219 self,
2220 encoder: &mut fidl::encoding::Encoder<'_, D>,
2221 offset: usize,
2222 _depth: fidl::encoding::Depth,
2223 ) -> fidl::Result<()> {
2224 encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
2225 fidl::encoding::Encode::<LightSetSimpleValueRequest, D>::encode(
2227 (
2228 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
2229 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2230 ),
2231 encoder,
2232 offset,
2233 _depth,
2234 )
2235 }
2236 }
2237 unsafe impl<
2238 D: fidl::encoding::ResourceDialect,
2239 T0: fidl::encoding::Encode<u32, D>,
2240 T1: fidl::encoding::Encode<bool, D>,
2241 > fidl::encoding::Encode<LightSetSimpleValueRequest, D> for (T0, T1)
2242 {
2243 #[inline]
2244 unsafe fn encode(
2245 self,
2246 encoder: &mut fidl::encoding::Encoder<'_, D>,
2247 offset: usize,
2248 depth: fidl::encoding::Depth,
2249 ) -> fidl::Result<()> {
2250 encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
2251 unsafe {
2254 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
2255 (ptr as *mut u32).write_unaligned(0);
2256 }
2257 self.0.encode(encoder, offset + 0, depth)?;
2259 self.1.encode(encoder, offset + 4, depth)?;
2260 Ok(())
2261 }
2262 }
2263
2264 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2265 for LightSetSimpleValueRequest
2266 {
2267 #[inline(always)]
2268 fn new_empty() -> Self {
2269 Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
2270 }
2271
2272 #[inline]
2273 unsafe fn decode(
2274 &mut self,
2275 decoder: &mut fidl::encoding::Decoder<'_, D>,
2276 offset: usize,
2277 _depth: fidl::encoding::Depth,
2278 ) -> fidl::Result<()> {
2279 decoder.debug_check_bounds::<Self>(offset);
2280 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
2282 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2283 let mask = 0xffffff00u32;
2284 let maskedval = padval & mask;
2285 if maskedval != 0 {
2286 return Err(fidl::Error::NonZeroPadding {
2287 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
2288 });
2289 }
2290 fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
2291 fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
2292 Ok(())
2293 }
2294 }
2295
2296 impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueResponse {
2297 type Borrowed<'a> = &'a Self;
2298 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2299 value
2300 }
2301 }
2302
2303 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueResponse {
2304 type Owned = Self;
2305
2306 #[inline(always)]
2307 fn inline_align(_context: fidl::encoding::Context) -> usize {
2308 8
2309 }
2310
2311 #[inline(always)]
2312 fn inline_size(_context: fidl::encoding::Context) -> usize {
2313 8
2314 }
2315 }
2316
2317 unsafe impl<D: fidl::encoding::ResourceDialect>
2318 fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D>
2319 for &LightGetCurrentBrightnessValueResponse
2320 {
2321 #[inline]
2322 unsafe fn encode(
2323 self,
2324 encoder: &mut fidl::encoding::Encoder<'_, D>,
2325 offset: usize,
2326 _depth: fidl::encoding::Depth,
2327 ) -> fidl::Result<()> {
2328 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
2329 fidl::encoding::Encode::<LightGetCurrentBrightnessValueResponse, D>::encode(
2331 (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2332 encoder,
2333 offset,
2334 _depth,
2335 )
2336 }
2337 }
2338 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
2339 fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D> for (T0,)
2340 {
2341 #[inline]
2342 unsafe fn encode(
2343 self,
2344 encoder: &mut fidl::encoding::Encoder<'_, D>,
2345 offset: usize,
2346 depth: fidl::encoding::Depth,
2347 ) -> fidl::Result<()> {
2348 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
2349 self.0.encode(encoder, offset + 0, depth)?;
2353 Ok(())
2354 }
2355 }
2356
2357 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2358 for LightGetCurrentBrightnessValueResponse
2359 {
2360 #[inline(always)]
2361 fn new_empty() -> Self {
2362 Self { value: fidl::new_empty!(f64, D) }
2363 }
2364
2365 #[inline]
2366 unsafe fn decode(
2367 &mut self,
2368 decoder: &mut fidl::encoding::Decoder<'_, D>,
2369 offset: usize,
2370 _depth: fidl::encoding::Depth,
2371 ) -> fidl::Result<()> {
2372 decoder.debug_check_bounds::<Self>(offset);
2373 fidl::decode!(f64, D, &mut self.value, decoder, offset + 0, _depth)?;
2375 Ok(())
2376 }
2377 }
2378
2379 impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueResponse {
2380 type Borrowed<'a> = &'a Self;
2381 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2382 value
2383 }
2384 }
2385
2386 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueResponse {
2387 type Owned = Self;
2388
2389 #[inline(always)]
2390 fn inline_align(_context: fidl::encoding::Context) -> usize {
2391 8
2392 }
2393
2394 #[inline(always)]
2395 fn inline_size(_context: fidl::encoding::Context) -> usize {
2396 24
2397 }
2398 }
2399
2400 unsafe impl<D: fidl::encoding::ResourceDialect>
2401 fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D>
2402 for &LightGetCurrentRgbValueResponse
2403 {
2404 #[inline]
2405 unsafe fn encode(
2406 self,
2407 encoder: &mut fidl::encoding::Encoder<'_, D>,
2408 offset: usize,
2409 _depth: fidl::encoding::Depth,
2410 ) -> fidl::Result<()> {
2411 encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
2412 fidl::encoding::Encode::<LightGetCurrentRgbValueResponse, D>::encode(
2414 (<Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2415 encoder,
2416 offset,
2417 _depth,
2418 )
2419 }
2420 }
2421 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Rgb, D>>
2422 fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D> for (T0,)
2423 {
2424 #[inline]
2425 unsafe fn encode(
2426 self,
2427 encoder: &mut fidl::encoding::Encoder<'_, D>,
2428 offset: usize,
2429 depth: fidl::encoding::Depth,
2430 ) -> fidl::Result<()> {
2431 encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
2432 self.0.encode(encoder, offset + 0, depth)?;
2436 Ok(())
2437 }
2438 }
2439
2440 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2441 for LightGetCurrentRgbValueResponse
2442 {
2443 #[inline(always)]
2444 fn new_empty() -> Self {
2445 Self { value: fidl::new_empty!(Rgb, D) }
2446 }
2447
2448 #[inline]
2449 unsafe fn decode(
2450 &mut self,
2451 decoder: &mut fidl::encoding::Decoder<'_, D>,
2452 offset: usize,
2453 _depth: fidl::encoding::Depth,
2454 ) -> fidl::Result<()> {
2455 decoder.debug_check_bounds::<Self>(offset);
2456 fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 0, _depth)?;
2458 Ok(())
2459 }
2460 }
2461
2462 impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueResponse {
2463 type Borrowed<'a> = &'a Self;
2464 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2465 value
2466 }
2467 }
2468
2469 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueResponse {
2470 type Owned = Self;
2471
2472 #[inline(always)]
2473 fn inline_align(_context: fidl::encoding::Context) -> usize {
2474 1
2475 }
2476
2477 #[inline(always)]
2478 fn inline_size(_context: fidl::encoding::Context) -> usize {
2479 1
2480 }
2481 }
2482
2483 unsafe impl<D: fidl::encoding::ResourceDialect>
2484 fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D>
2485 for &LightGetCurrentSimpleValueResponse
2486 {
2487 #[inline]
2488 unsafe fn encode(
2489 self,
2490 encoder: &mut fidl::encoding::Encoder<'_, D>,
2491 offset: usize,
2492 _depth: fidl::encoding::Depth,
2493 ) -> fidl::Result<()> {
2494 encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
2495 fidl::encoding::Encode::<LightGetCurrentSimpleValueResponse, D>::encode(
2497 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2498 encoder,
2499 offset,
2500 _depth,
2501 )
2502 }
2503 }
2504 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2505 fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D> for (T0,)
2506 {
2507 #[inline]
2508 unsafe fn encode(
2509 self,
2510 encoder: &mut fidl::encoding::Encoder<'_, D>,
2511 offset: usize,
2512 depth: fidl::encoding::Depth,
2513 ) -> fidl::Result<()> {
2514 encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
2515 self.0.encode(encoder, offset + 0, depth)?;
2519 Ok(())
2520 }
2521 }
2522
2523 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2524 for LightGetCurrentSimpleValueResponse
2525 {
2526 #[inline(always)]
2527 fn new_empty() -> Self {
2528 Self { value: fidl::new_empty!(bool, D) }
2529 }
2530
2531 #[inline]
2532 unsafe fn decode(
2533 &mut self,
2534 decoder: &mut fidl::encoding::Decoder<'_, D>,
2535 offset: usize,
2536 _depth: fidl::encoding::Depth,
2537 ) -> fidl::Result<()> {
2538 decoder.debug_check_bounds::<Self>(offset);
2539 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
2541 Ok(())
2542 }
2543 }
2544
2545 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueResponse {
2546 type Borrowed<'a> = &'a Self;
2547 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2548 value
2549 }
2550 }
2551
2552 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueResponse {
2553 type Owned = Self;
2554
2555 #[inline(always)]
2556 fn inline_align(_context: fidl::encoding::Context) -> usize {
2557 8
2558 }
2559
2560 #[inline(always)]
2561 fn inline_size(_context: fidl::encoding::Context) -> usize {
2562 16
2563 }
2564 }
2565
2566 unsafe impl<D: fidl::encoding::ResourceDialect>
2567 fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D>
2568 for &LightGetGroupCurrentBrightnessValueResponse
2569 {
2570 #[inline]
2571 unsafe fn encode(
2572 self,
2573 encoder: &mut fidl::encoding::Encoder<'_, D>,
2574 offset: usize,
2575 _depth: fidl::encoding::Depth,
2576 ) -> fidl::Result<()> {
2577 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
2578 fidl::encoding::Encode::<LightGetGroupCurrentBrightnessValueResponse, D>::encode(
2580 (
2581 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2582 ),
2583 encoder, offset, _depth
2584 )
2585 }
2586 }
2587 unsafe impl<
2588 D: fidl::encoding::ResourceDialect,
2589 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>, D>,
2590 > fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D> for (T0,)
2591 {
2592 #[inline]
2593 unsafe fn encode(
2594 self,
2595 encoder: &mut fidl::encoding::Encoder<'_, D>,
2596 offset: usize,
2597 depth: fidl::encoding::Depth,
2598 ) -> fidl::Result<()> {
2599 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
2600 self.0.encode(encoder, offset + 0, depth)?;
2604 Ok(())
2605 }
2606 }
2607
2608 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2609 for LightGetGroupCurrentBrightnessValueResponse
2610 {
2611 #[inline(always)]
2612 fn new_empty() -> Self {
2613 Self {
2614 values: fidl::new_empty!(
2615 fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2616 D
2617 ),
2618 }
2619 }
2620
2621 #[inline]
2622 unsafe fn decode(
2623 &mut self,
2624 decoder: &mut fidl::encoding::Decoder<'_, D>,
2625 offset: usize,
2626 _depth: fidl::encoding::Depth,
2627 ) -> fidl::Result<()> {
2628 decoder.debug_check_bounds::<Self>(offset);
2629 fidl::decode!(
2631 fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2632 D,
2633 &mut self.values,
2634 decoder,
2635 offset + 0,
2636 _depth
2637 )?;
2638 Ok(())
2639 }
2640 }
2641
2642 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueResponse {
2643 type Borrowed<'a> = &'a Self;
2644 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2645 value
2646 }
2647 }
2648
2649 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueResponse {
2650 type Owned = Self;
2651
2652 #[inline(always)]
2653 fn inline_align(_context: fidl::encoding::Context) -> usize {
2654 8
2655 }
2656
2657 #[inline(always)]
2658 fn inline_size(_context: fidl::encoding::Context) -> usize {
2659 16
2660 }
2661 }
2662
2663 unsafe impl<D: fidl::encoding::ResourceDialect>
2664 fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D>
2665 for &LightGetGroupCurrentRgbValueResponse
2666 {
2667 #[inline]
2668 unsafe fn encode(
2669 self,
2670 encoder: &mut fidl::encoding::Encoder<'_, D>,
2671 offset: usize,
2672 _depth: fidl::encoding::Depth,
2673 ) -> fidl::Result<()> {
2674 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
2675 fidl::encoding::Encode::<LightGetGroupCurrentRgbValueResponse, D>::encode(
2677 (
2678 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2679 ),
2680 encoder, offset, _depth
2681 )
2682 }
2683 }
2684 unsafe impl<
2685 D: fidl::encoding::ResourceDialect,
2686 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>, D>,
2687 > fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D> for (T0,)
2688 {
2689 #[inline]
2690 unsafe fn encode(
2691 self,
2692 encoder: &mut fidl::encoding::Encoder<'_, D>,
2693 offset: usize,
2694 depth: fidl::encoding::Depth,
2695 ) -> fidl::Result<()> {
2696 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
2697 self.0.encode(encoder, offset + 0, depth)?;
2701 Ok(())
2702 }
2703 }
2704
2705 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2706 for LightGetGroupCurrentRgbValueResponse
2707 {
2708 #[inline(always)]
2709 fn new_empty() -> Self {
2710 Self {
2711 values: fidl::new_empty!(
2712 fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2713 D
2714 ),
2715 }
2716 }
2717
2718 #[inline]
2719 unsafe fn decode(
2720 &mut self,
2721 decoder: &mut fidl::encoding::Decoder<'_, D>,
2722 offset: usize,
2723 _depth: fidl::encoding::Depth,
2724 ) -> fidl::Result<()> {
2725 decoder.debug_check_bounds::<Self>(offset);
2726 fidl::decode!(
2728 fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2729 D,
2730 &mut self.values,
2731 decoder,
2732 offset + 0,
2733 _depth
2734 )?;
2735 Ok(())
2736 }
2737 }
2738
2739 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueResponse {
2740 type Borrowed<'a> = &'a Self;
2741 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2742 value
2743 }
2744 }
2745
2746 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueResponse {
2747 type Owned = Self;
2748
2749 #[inline(always)]
2750 fn inline_align(_context: fidl::encoding::Context) -> usize {
2751 8
2752 }
2753
2754 #[inline(always)]
2755 fn inline_size(_context: fidl::encoding::Context) -> usize {
2756 16
2757 }
2758 }
2759
2760 unsafe impl<D: fidl::encoding::ResourceDialect>
2761 fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D>
2762 for &LightGetGroupCurrentSimpleValueResponse
2763 {
2764 #[inline]
2765 unsafe fn encode(
2766 self,
2767 encoder: &mut fidl::encoding::Encoder<'_, D>,
2768 offset: usize,
2769 _depth: fidl::encoding::Depth,
2770 ) -> fidl::Result<()> {
2771 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
2772 fidl::encoding::Encode::<LightGetGroupCurrentSimpleValueResponse, D>::encode(
2774 (
2775 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2776 ),
2777 encoder, offset, _depth
2778 )
2779 }
2780 }
2781 unsafe impl<
2782 D: fidl::encoding::ResourceDialect,
2783 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>, D>,
2784 > fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D> for (T0,)
2785 {
2786 #[inline]
2787 unsafe fn encode(
2788 self,
2789 encoder: &mut fidl::encoding::Encoder<'_, D>,
2790 offset: usize,
2791 depth: fidl::encoding::Depth,
2792 ) -> fidl::Result<()> {
2793 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
2794 self.0.encode(encoder, offset + 0, depth)?;
2798 Ok(())
2799 }
2800 }
2801
2802 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2803 for LightGetGroupCurrentSimpleValueResponse
2804 {
2805 #[inline(always)]
2806 fn new_empty() -> Self {
2807 Self {
2808 values: fidl::new_empty!(
2809 fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2810 D
2811 ),
2812 }
2813 }
2814
2815 #[inline]
2816 unsafe fn decode(
2817 &mut self,
2818 decoder: &mut fidl::encoding::Decoder<'_, D>,
2819 offset: usize,
2820 _depth: fidl::encoding::Depth,
2821 ) -> fidl::Result<()> {
2822 decoder.debug_check_bounds::<Self>(offset);
2823 fidl::decode!(
2825 fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2826 D,
2827 &mut self.values,
2828 decoder,
2829 offset + 0,
2830 _depth
2831 )?;
2832 Ok(())
2833 }
2834 }
2835
2836 impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoResponse {
2837 type Borrowed<'a> = &'a Self;
2838 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2839 value
2840 }
2841 }
2842
2843 unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoResponse {
2844 type Owned = Self;
2845
2846 #[inline(always)]
2847 fn inline_align(_context: fidl::encoding::Context) -> usize {
2848 8
2849 }
2850
2851 #[inline(always)]
2852 fn inline_size(_context: fidl::encoding::Context) -> usize {
2853 24
2854 }
2855 }
2856
2857 unsafe impl<D: fidl::encoding::ResourceDialect>
2858 fidl::encoding::Encode<LightGetGroupInfoResponse, D> for &LightGetGroupInfoResponse
2859 {
2860 #[inline]
2861 unsafe fn encode(
2862 self,
2863 encoder: &mut fidl::encoding::Encoder<'_, D>,
2864 offset: usize,
2865 _depth: fidl::encoding::Depth,
2866 ) -> fidl::Result<()> {
2867 encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
2868 fidl::encoding::Encode::<LightGetGroupInfoResponse, D>::encode(
2870 (<GroupInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2871 encoder,
2872 offset,
2873 _depth,
2874 )
2875 }
2876 }
2877 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GroupInfo, D>>
2878 fidl::encoding::Encode<LightGetGroupInfoResponse, D> for (T0,)
2879 {
2880 #[inline]
2881 unsafe fn encode(
2882 self,
2883 encoder: &mut fidl::encoding::Encoder<'_, D>,
2884 offset: usize,
2885 depth: fidl::encoding::Depth,
2886 ) -> fidl::Result<()> {
2887 encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
2888 self.0.encode(encoder, offset + 0, depth)?;
2892 Ok(())
2893 }
2894 }
2895
2896 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2897 for LightGetGroupInfoResponse
2898 {
2899 #[inline(always)]
2900 fn new_empty() -> Self {
2901 Self { info: fidl::new_empty!(GroupInfo, D) }
2902 }
2903
2904 #[inline]
2905 unsafe fn decode(
2906 &mut self,
2907 decoder: &mut fidl::encoding::Decoder<'_, D>,
2908 offset: usize,
2909 _depth: fidl::encoding::Depth,
2910 ) -> fidl::Result<()> {
2911 decoder.debug_check_bounds::<Self>(offset);
2912 fidl::decode!(GroupInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
2914 Ok(())
2915 }
2916 }
2917
2918 impl fidl::encoding::ValueTypeMarker for LightGetInfoResponse {
2919 type Borrowed<'a> = &'a Self;
2920 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2921 value
2922 }
2923 }
2924
2925 unsafe impl fidl::encoding::TypeMarker for LightGetInfoResponse {
2926 type Owned = Self;
2927
2928 #[inline(always)]
2929 fn inline_align(_context: fidl::encoding::Context) -> usize {
2930 8
2931 }
2932
2933 #[inline(always)]
2934 fn inline_size(_context: fidl::encoding::Context) -> usize {
2935 24
2936 }
2937 }
2938
2939 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoResponse, D>
2940 for &LightGetInfoResponse
2941 {
2942 #[inline]
2943 unsafe fn encode(
2944 self,
2945 encoder: &mut fidl::encoding::Encoder<'_, D>,
2946 offset: usize,
2947 _depth: fidl::encoding::Depth,
2948 ) -> fidl::Result<()> {
2949 encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
2950 fidl::encoding::Encode::<LightGetInfoResponse, D>::encode(
2952 (<Info as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2953 encoder,
2954 offset,
2955 _depth,
2956 )
2957 }
2958 }
2959 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Info, D>>
2960 fidl::encoding::Encode<LightGetInfoResponse, D> for (T0,)
2961 {
2962 #[inline]
2963 unsafe fn encode(
2964 self,
2965 encoder: &mut fidl::encoding::Encoder<'_, D>,
2966 offset: usize,
2967 depth: fidl::encoding::Depth,
2968 ) -> fidl::Result<()> {
2969 encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
2970 self.0.encode(encoder, offset + 0, depth)?;
2974 Ok(())
2975 }
2976 }
2977
2978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoResponse {
2979 #[inline(always)]
2980 fn new_empty() -> Self {
2981 Self { info: fidl::new_empty!(Info, D) }
2982 }
2983
2984 #[inline]
2985 unsafe fn decode(
2986 &mut self,
2987 decoder: &mut fidl::encoding::Decoder<'_, D>,
2988 offset: usize,
2989 _depth: fidl::encoding::Depth,
2990 ) -> fidl::Result<()> {
2991 decoder.debug_check_bounds::<Self>(offset);
2992 fidl::decode!(Info, D, &mut self.info, decoder, offset + 0, _depth)?;
2994 Ok(())
2995 }
2996 }
2997
2998 impl fidl::encoding::ValueTypeMarker for Rgb {
2999 type Borrowed<'a> = &'a Self;
3000 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3001 value
3002 }
3003 }
3004
3005 unsafe impl fidl::encoding::TypeMarker for Rgb {
3006 type Owned = Self;
3007
3008 #[inline(always)]
3009 fn inline_align(_context: fidl::encoding::Context) -> usize {
3010 8
3011 }
3012
3013 #[inline(always)]
3014 fn inline_size(_context: fidl::encoding::Context) -> usize {
3015 24
3016 }
3017 }
3018
3019 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Rgb, D> for &Rgb {
3020 #[inline]
3021 unsafe fn encode(
3022 self,
3023 encoder: &mut fidl::encoding::Encoder<'_, D>,
3024 offset: usize,
3025 _depth: fidl::encoding::Depth,
3026 ) -> fidl::Result<()> {
3027 encoder.debug_check_bounds::<Rgb>(offset);
3028 fidl::encoding::Encode::<Rgb, D>::encode(
3030 (
3031 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
3032 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
3033 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
3034 ),
3035 encoder,
3036 offset,
3037 _depth,
3038 )
3039 }
3040 }
3041 unsafe impl<
3042 D: fidl::encoding::ResourceDialect,
3043 T0: fidl::encoding::Encode<f64, D>,
3044 T1: fidl::encoding::Encode<f64, D>,
3045 T2: fidl::encoding::Encode<f64, D>,
3046 > fidl::encoding::Encode<Rgb, D> for (T0, T1, T2)
3047 {
3048 #[inline]
3049 unsafe fn encode(
3050 self,
3051 encoder: &mut fidl::encoding::Encoder<'_, D>,
3052 offset: usize,
3053 depth: fidl::encoding::Depth,
3054 ) -> fidl::Result<()> {
3055 encoder.debug_check_bounds::<Rgb>(offset);
3056 self.0.encode(encoder, offset + 0, depth)?;
3060 self.1.encode(encoder, offset + 8, depth)?;
3061 self.2.encode(encoder, offset + 16, depth)?;
3062 Ok(())
3063 }
3064 }
3065
3066 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rgb {
3067 #[inline(always)]
3068 fn new_empty() -> Self {
3069 Self {
3070 red: fidl::new_empty!(f64, D),
3071 green: fidl::new_empty!(f64, D),
3072 blue: fidl::new_empty!(f64, D),
3073 }
3074 }
3075
3076 #[inline]
3077 unsafe fn decode(
3078 &mut self,
3079 decoder: &mut fidl::encoding::Decoder<'_, D>,
3080 offset: usize,
3081 _depth: fidl::encoding::Depth,
3082 ) -> fidl::Result<()> {
3083 decoder.debug_check_bounds::<Self>(offset);
3084 fidl::decode!(f64, D, &mut self.red, decoder, offset + 0, _depth)?;
3086 fidl::decode!(f64, D, &mut self.green, decoder, offset + 8, _depth)?;
3087 fidl::decode!(f64, D, &mut self.blue, decoder, offset + 16, _depth)?;
3088 Ok(())
3089 }
3090 }
3091
3092 impl Config {
3093 #[inline(always)]
3094 fn max_ordinal_present(&self) -> u64 {
3095 if let Some(_) = self.group_id {
3096 return 5;
3097 }
3098 if let Some(_) = self.init_on {
3099 return 4;
3100 }
3101 if let Some(_) = self.rgb {
3102 return 3;
3103 }
3104 if let Some(_) = self.brightness {
3105 return 2;
3106 }
3107 if let Some(_) = self.name {
3108 return 1;
3109 }
3110 0
3111 }
3112 }
3113
3114 impl fidl::encoding::ValueTypeMarker for Config {
3115 type Borrowed<'a> = &'a Self;
3116 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3117 value
3118 }
3119 }
3120
3121 unsafe impl fidl::encoding::TypeMarker for Config {
3122 type Owned = Self;
3123
3124 #[inline(always)]
3125 fn inline_align(_context: fidl::encoding::Context) -> usize {
3126 8
3127 }
3128
3129 #[inline(always)]
3130 fn inline_size(_context: fidl::encoding::Context) -> usize {
3131 16
3132 }
3133 }
3134
3135 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
3136 unsafe fn encode(
3137 self,
3138 encoder: &mut fidl::encoding::Encoder<'_, D>,
3139 offset: usize,
3140 mut depth: fidl::encoding::Depth,
3141 ) -> fidl::Result<()> {
3142 encoder.debug_check_bounds::<Config>(offset);
3143 let max_ordinal: u64 = self.max_ordinal_present();
3145 encoder.write_num(max_ordinal, offset);
3146 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3147 if max_ordinal == 0 {
3149 return Ok(());
3150 }
3151 depth.increment()?;
3152 let envelope_size = 8;
3153 let bytes_len = max_ordinal as usize * envelope_size;
3154 #[allow(unused_variables)]
3155 let offset = encoder.out_of_line_offset(bytes_len);
3156 let mut _prev_end_offset: usize = 0;
3157 if 1 > max_ordinal {
3158 return Ok(());
3159 }
3160
3161 let cur_offset: usize = (1 - 1) * envelope_size;
3164
3165 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3167
3168 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
3173 self.name.as_ref().map(
3174 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3175 ),
3176 encoder,
3177 offset + cur_offset,
3178 depth,
3179 )?;
3180
3181 _prev_end_offset = cur_offset + envelope_size;
3182 if 2 > max_ordinal {
3183 return Ok(());
3184 }
3185
3186 let cur_offset: usize = (2 - 1) * envelope_size;
3189
3190 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3192
3193 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3198 self.brightness.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3199 encoder,
3200 offset + cur_offset,
3201 depth,
3202 )?;
3203
3204 _prev_end_offset = cur_offset + envelope_size;
3205 if 3 > max_ordinal {
3206 return Ok(());
3207 }
3208
3209 let cur_offset: usize = (3 - 1) * envelope_size;
3212
3213 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3215
3216 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3221 self.rgb.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3222 encoder,
3223 offset + cur_offset,
3224 depth,
3225 )?;
3226
3227 _prev_end_offset = cur_offset + envelope_size;
3228 if 4 > max_ordinal {
3229 return Ok(());
3230 }
3231
3232 let cur_offset: usize = (4 - 1) * envelope_size;
3235
3236 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3238
3239 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3244 self.init_on.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3245 encoder,
3246 offset + cur_offset,
3247 depth,
3248 )?;
3249
3250 _prev_end_offset = cur_offset + envelope_size;
3251 if 5 > max_ordinal {
3252 return Ok(());
3253 }
3254
3255 let cur_offset: usize = (5 - 1) * envelope_size;
3258
3259 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3261
3262 fidl::encoding::encode_in_envelope_optional::<i32, D>(
3267 self.group_id.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
3268 encoder,
3269 offset + cur_offset,
3270 depth,
3271 )?;
3272
3273 _prev_end_offset = cur_offset + envelope_size;
3274
3275 Ok(())
3276 }
3277 }
3278
3279 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
3280 #[inline(always)]
3281 fn new_empty() -> Self {
3282 Self::default()
3283 }
3284
3285 unsafe fn decode(
3286 &mut self,
3287 decoder: &mut fidl::encoding::Decoder<'_, D>,
3288 offset: usize,
3289 mut depth: fidl::encoding::Depth,
3290 ) -> fidl::Result<()> {
3291 decoder.debug_check_bounds::<Self>(offset);
3292 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3293 None => return Err(fidl::Error::NotNullable),
3294 Some(len) => len,
3295 };
3296 if len == 0 {
3298 return Ok(());
3299 };
3300 depth.increment()?;
3301 let envelope_size = 8;
3302 let bytes_len = len * envelope_size;
3303 let offset = decoder.out_of_line_offset(bytes_len)?;
3304 let mut _next_ordinal_to_read = 0;
3306 let mut next_offset = offset;
3307 let end_offset = offset + bytes_len;
3308 _next_ordinal_to_read += 1;
3309 if next_offset >= end_offset {
3310 return Ok(());
3311 }
3312
3313 while _next_ordinal_to_read < 1 {
3315 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3316 _next_ordinal_to_read += 1;
3317 next_offset += envelope_size;
3318 }
3319
3320 let next_out_of_line = decoder.next_out_of_line();
3321 let handles_before = decoder.remaining_handles();
3322 if let Some((inlined, num_bytes, num_handles)) =
3323 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3324 {
3325 let member_inline_size =
3326 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3327 decoder.context,
3328 );
3329 if inlined != (member_inline_size <= 4) {
3330 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3331 }
3332 let inner_offset;
3333 let mut inner_depth = depth.clone();
3334 if inlined {
3335 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3336 inner_offset = next_offset;
3337 } else {
3338 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3339 inner_depth.increment()?;
3340 }
3341 let val_ref = self
3342 .name
3343 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
3344 fidl::decode!(
3345 fidl::encoding::UnboundedString,
3346 D,
3347 val_ref,
3348 decoder,
3349 inner_offset,
3350 inner_depth
3351 )?;
3352 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3353 {
3354 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3355 }
3356 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3357 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3358 }
3359 }
3360
3361 next_offset += envelope_size;
3362 _next_ordinal_to_read += 1;
3363 if next_offset >= end_offset {
3364 return Ok(());
3365 }
3366
3367 while _next_ordinal_to_read < 2 {
3369 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3370 _next_ordinal_to_read += 1;
3371 next_offset += envelope_size;
3372 }
3373
3374 let next_out_of_line = decoder.next_out_of_line();
3375 let handles_before = decoder.remaining_handles();
3376 if let Some((inlined, num_bytes, num_handles)) =
3377 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3378 {
3379 let member_inline_size =
3380 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3381 if inlined != (member_inline_size <= 4) {
3382 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3383 }
3384 let inner_offset;
3385 let mut inner_depth = depth.clone();
3386 if inlined {
3387 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3388 inner_offset = next_offset;
3389 } else {
3390 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3391 inner_depth.increment()?;
3392 }
3393 let val_ref = self.brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
3394 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3395 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3396 {
3397 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3398 }
3399 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3400 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3401 }
3402 }
3403
3404 next_offset += envelope_size;
3405 _next_ordinal_to_read += 1;
3406 if next_offset >= end_offset {
3407 return Ok(());
3408 }
3409
3410 while _next_ordinal_to_read < 3 {
3412 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3413 _next_ordinal_to_read += 1;
3414 next_offset += envelope_size;
3415 }
3416
3417 let next_out_of_line = decoder.next_out_of_line();
3418 let handles_before = decoder.remaining_handles();
3419 if let Some((inlined, num_bytes, num_handles)) =
3420 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3421 {
3422 let member_inline_size =
3423 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3424 if inlined != (member_inline_size <= 4) {
3425 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3426 }
3427 let inner_offset;
3428 let mut inner_depth = depth.clone();
3429 if inlined {
3430 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3431 inner_offset = next_offset;
3432 } else {
3433 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3434 inner_depth.increment()?;
3435 }
3436 let val_ref = self.rgb.get_or_insert_with(|| fidl::new_empty!(bool, D));
3437 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3438 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3439 {
3440 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3441 }
3442 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3443 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3444 }
3445 }
3446
3447 next_offset += envelope_size;
3448 _next_ordinal_to_read += 1;
3449 if next_offset >= end_offset {
3450 return Ok(());
3451 }
3452
3453 while _next_ordinal_to_read < 4 {
3455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3456 _next_ordinal_to_read += 1;
3457 next_offset += envelope_size;
3458 }
3459
3460 let next_out_of_line = decoder.next_out_of_line();
3461 let handles_before = decoder.remaining_handles();
3462 if let Some((inlined, num_bytes, num_handles)) =
3463 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3464 {
3465 let member_inline_size =
3466 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3467 if inlined != (member_inline_size <= 4) {
3468 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3469 }
3470 let inner_offset;
3471 let mut inner_depth = depth.clone();
3472 if inlined {
3473 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3474 inner_offset = next_offset;
3475 } else {
3476 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3477 inner_depth.increment()?;
3478 }
3479 let val_ref = self.init_on.get_or_insert_with(|| fidl::new_empty!(bool, D));
3480 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3481 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3482 {
3483 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3484 }
3485 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3486 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3487 }
3488 }
3489
3490 next_offset += envelope_size;
3491 _next_ordinal_to_read += 1;
3492 if next_offset >= end_offset {
3493 return Ok(());
3494 }
3495
3496 while _next_ordinal_to_read < 5 {
3498 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3499 _next_ordinal_to_read += 1;
3500 next_offset += envelope_size;
3501 }
3502
3503 let next_out_of_line = decoder.next_out_of_line();
3504 let handles_before = decoder.remaining_handles();
3505 if let Some((inlined, num_bytes, num_handles)) =
3506 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3507 {
3508 let member_inline_size =
3509 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3510 if inlined != (member_inline_size <= 4) {
3511 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3512 }
3513 let inner_offset;
3514 let mut inner_depth = depth.clone();
3515 if inlined {
3516 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3517 inner_offset = next_offset;
3518 } else {
3519 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3520 inner_depth.increment()?;
3521 }
3522 let val_ref = self.group_id.get_or_insert_with(|| fidl::new_empty!(i32, D));
3523 fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
3524 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3525 {
3526 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3527 }
3528 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3529 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3530 }
3531 }
3532
3533 next_offset += envelope_size;
3534
3535 while next_offset < end_offset {
3537 _next_ordinal_to_read += 1;
3538 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3539 next_offset += envelope_size;
3540 }
3541
3542 Ok(())
3543 }
3544 }
3545
3546 impl Metadata {
3547 #[inline(always)]
3548 fn max_ordinal_present(&self) -> u64 {
3549 if let Some(_) = self.configs {
3550 return 1;
3551 }
3552 0
3553 }
3554 }
3555
3556 impl fidl::encoding::ValueTypeMarker for Metadata {
3557 type Borrowed<'a> = &'a Self;
3558 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3559 value
3560 }
3561 }
3562
3563 unsafe impl fidl::encoding::TypeMarker for Metadata {
3564 type Owned = Self;
3565
3566 #[inline(always)]
3567 fn inline_align(_context: fidl::encoding::Context) -> usize {
3568 8
3569 }
3570
3571 #[inline(always)]
3572 fn inline_size(_context: fidl::encoding::Context) -> usize {
3573 16
3574 }
3575 }
3576
3577 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
3578 unsafe fn encode(
3579 self,
3580 encoder: &mut fidl::encoding::Encoder<'_, D>,
3581 offset: usize,
3582 mut depth: fidl::encoding::Depth,
3583 ) -> fidl::Result<()> {
3584 encoder.debug_check_bounds::<Metadata>(offset);
3585 let max_ordinal: u64 = self.max_ordinal_present();
3587 encoder.write_num(max_ordinal, offset);
3588 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3589 if max_ordinal == 0 {
3591 return Ok(());
3592 }
3593 depth.increment()?;
3594 let envelope_size = 8;
3595 let bytes_len = max_ordinal as usize * envelope_size;
3596 #[allow(unused_variables)]
3597 let offset = encoder.out_of_line_offset(bytes_len);
3598 let mut _prev_end_offset: usize = 0;
3599 if 1 > max_ordinal {
3600 return Ok(());
3601 }
3602
3603 let cur_offset: usize = (1 - 1) * envelope_size;
3606
3607 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3609
3610 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Config>, D>(
3615 self.configs.as_ref().map(<fidl::encoding::UnboundedVector<Config> as fidl::encoding::ValueTypeMarker>::borrow),
3616 encoder, offset + cur_offset, depth
3617 )?;
3618
3619 _prev_end_offset = cur_offset + envelope_size;
3620
3621 Ok(())
3622 }
3623 }
3624
3625 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
3626 #[inline(always)]
3627 fn new_empty() -> Self {
3628 Self::default()
3629 }
3630
3631 unsafe fn decode(
3632 &mut self,
3633 decoder: &mut fidl::encoding::Decoder<'_, D>,
3634 offset: usize,
3635 mut depth: fidl::encoding::Depth,
3636 ) -> fidl::Result<()> {
3637 decoder.debug_check_bounds::<Self>(offset);
3638 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3639 None => return Err(fidl::Error::NotNullable),
3640 Some(len) => len,
3641 };
3642 if len == 0 {
3644 return Ok(());
3645 };
3646 depth.increment()?;
3647 let envelope_size = 8;
3648 let bytes_len = len * envelope_size;
3649 let offset = decoder.out_of_line_offset(bytes_len)?;
3650 let mut _next_ordinal_to_read = 0;
3652 let mut next_offset = offset;
3653 let end_offset = offset + bytes_len;
3654 _next_ordinal_to_read += 1;
3655 if next_offset >= end_offset {
3656 return Ok(());
3657 }
3658
3659 while _next_ordinal_to_read < 1 {
3661 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3662 _next_ordinal_to_read += 1;
3663 next_offset += envelope_size;
3664 }
3665
3666 let next_out_of_line = decoder.next_out_of_line();
3667 let handles_before = decoder.remaining_handles();
3668 if let Some((inlined, num_bytes, num_handles)) =
3669 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3670 {
3671 let member_inline_size = <fidl::encoding::UnboundedVector<Config> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3672 if inlined != (member_inline_size <= 4) {
3673 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3674 }
3675 let inner_offset;
3676 let mut inner_depth = depth.clone();
3677 if inlined {
3678 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3679 inner_offset = next_offset;
3680 } else {
3681 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3682 inner_depth.increment()?;
3683 }
3684 let val_ref = self.configs.get_or_insert_with(|| {
3685 fidl::new_empty!(fidl::encoding::UnboundedVector<Config>, D)
3686 });
3687 fidl::decode!(
3688 fidl::encoding::UnboundedVector<Config>,
3689 D,
3690 val_ref,
3691 decoder,
3692 inner_offset,
3693 inner_depth
3694 )?;
3695 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3696 {
3697 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3698 }
3699 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3700 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3701 }
3702 }
3703
3704 next_offset += envelope_size;
3705
3706 while next_offset < end_offset {
3708 _next_ordinal_to_read += 1;
3709 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3710 next_offset += envelope_size;
3711 }
3712
3713 Ok(())
3714 }
3715 }
3716}