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 {}
300
301mod internal {
302 use super::*;
303 unsafe impl fidl::encoding::TypeMarker for Capability {
304 type Owned = Self;
305
306 #[inline(always)]
307 fn inline_align(_context: fidl::encoding::Context) -> usize {
308 std::mem::align_of::<u32>()
309 }
310
311 #[inline(always)]
312 fn inline_size(_context: fidl::encoding::Context) -> usize {
313 std::mem::size_of::<u32>()
314 }
315
316 #[inline(always)]
317 fn encode_is_copy() -> bool {
318 true
319 }
320
321 #[inline(always)]
322 fn decode_is_copy() -> bool {
323 false
324 }
325 }
326
327 impl fidl::encoding::ValueTypeMarker for Capability {
328 type Borrowed<'a> = Self;
329 #[inline(always)]
330 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
331 *value
332 }
333 }
334
335 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Capability {
336 #[inline]
337 unsafe fn encode(
338 self,
339 encoder: &mut fidl::encoding::Encoder<'_, D>,
340 offset: usize,
341 _depth: fidl::encoding::Depth,
342 ) -> fidl::Result<()> {
343 encoder.debug_check_bounds::<Self>(offset);
344 encoder.write_num(self.into_primitive(), offset);
345 Ok(())
346 }
347 }
348
349 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
350 #[inline(always)]
351 fn new_empty() -> Self {
352 Self::Brightness
353 }
354
355 #[inline]
356 unsafe fn decode(
357 &mut self,
358 decoder: &mut fidl::encoding::Decoder<'_, D>,
359 offset: usize,
360 _depth: fidl::encoding::Depth,
361 ) -> fidl::Result<()> {
362 decoder.debug_check_bounds::<Self>(offset);
363 let prim = decoder.read_num::<u32>(offset);
364
365 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
366 Ok(())
367 }
368 }
369 unsafe impl fidl::encoding::TypeMarker for LightError {
370 type Owned = Self;
371
372 #[inline(always)]
373 fn inline_align(_context: fidl::encoding::Context) -> usize {
374 std::mem::align_of::<u32>()
375 }
376
377 #[inline(always)]
378 fn inline_size(_context: fidl::encoding::Context) -> usize {
379 std::mem::size_of::<u32>()
380 }
381
382 #[inline(always)]
383 fn encode_is_copy() -> bool {
384 true
385 }
386
387 #[inline(always)]
388 fn decode_is_copy() -> bool {
389 false
390 }
391 }
392
393 impl fidl::encoding::ValueTypeMarker for LightError {
394 type Borrowed<'a> = Self;
395 #[inline(always)]
396 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
397 *value
398 }
399 }
400
401 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LightError {
402 #[inline]
403 unsafe fn encode(
404 self,
405 encoder: &mut fidl::encoding::Encoder<'_, D>,
406 offset: usize,
407 _depth: fidl::encoding::Depth,
408 ) -> fidl::Result<()> {
409 encoder.debug_check_bounds::<Self>(offset);
410 encoder.write_num(self.into_primitive(), offset);
411 Ok(())
412 }
413 }
414
415 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightError {
416 #[inline(always)]
417 fn new_empty() -> Self {
418 Self::Ok
419 }
420
421 #[inline]
422 unsafe fn decode(
423 &mut self,
424 decoder: &mut fidl::encoding::Decoder<'_, D>,
425 offset: usize,
426 _depth: fidl::encoding::Depth,
427 ) -> fidl::Result<()> {
428 decoder.debug_check_bounds::<Self>(offset);
429 let prim = decoder.read_num::<u32>(offset);
430
431 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
432 Ok(())
433 }
434 }
435
436 impl fidl::encoding::ValueTypeMarker for GroupInfo {
437 type Borrowed<'a> = &'a Self;
438 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
439 value
440 }
441 }
442
443 unsafe impl fidl::encoding::TypeMarker for GroupInfo {
444 type Owned = Self;
445
446 #[inline(always)]
447 fn inline_align(_context: fidl::encoding::Context) -> usize {
448 8
449 }
450
451 #[inline(always)]
452 fn inline_size(_context: fidl::encoding::Context) -> usize {
453 24
454 }
455 }
456
457 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GroupInfo, D>
458 for &GroupInfo
459 {
460 #[inline]
461 unsafe fn encode(
462 self,
463 encoder: &mut fidl::encoding::Encoder<'_, D>,
464 offset: usize,
465 _depth: fidl::encoding::Depth,
466 ) -> fidl::Result<()> {
467 encoder.debug_check_bounds::<GroupInfo>(offset);
468 fidl::encoding::Encode::<GroupInfo, D>::encode(
470 (
471 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
472 &self.name,
473 ),
474 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
475 <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
476 ),
477 encoder,
478 offset,
479 _depth,
480 )
481 }
482 }
483 unsafe impl<
484 D: fidl::encoding::ResourceDialect,
485 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
486 T1: fidl::encoding::Encode<u32, D>,
487 T2: fidl::encoding::Encode<Capability, D>,
488 > fidl::encoding::Encode<GroupInfo, D> for (T0, T1, T2)
489 {
490 #[inline]
491 unsafe fn encode(
492 self,
493 encoder: &mut fidl::encoding::Encoder<'_, D>,
494 offset: usize,
495 depth: fidl::encoding::Depth,
496 ) -> fidl::Result<()> {
497 encoder.debug_check_bounds::<GroupInfo>(offset);
498 self.0.encode(encoder, offset + 0, depth)?;
502 self.1.encode(encoder, offset + 16, depth)?;
503 self.2.encode(encoder, offset + 20, depth)?;
504 Ok(())
505 }
506 }
507
508 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GroupInfo {
509 #[inline(always)]
510 fn new_empty() -> Self {
511 Self {
512 name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
513 count: fidl::new_empty!(u32, D),
514 capability: fidl::new_empty!(Capability, D),
515 }
516 }
517
518 #[inline]
519 unsafe fn decode(
520 &mut self,
521 decoder: &mut fidl::encoding::Decoder<'_, D>,
522 offset: usize,
523 _depth: fidl::encoding::Depth,
524 ) -> fidl::Result<()> {
525 decoder.debug_check_bounds::<Self>(offset);
526 fidl::decode!(
528 fidl::encoding::BoundedString<32>,
529 D,
530 &mut self.name,
531 decoder,
532 offset + 0,
533 _depth
534 )?;
535 fidl::decode!(u32, D, &mut self.count, decoder, offset + 16, _depth)?;
536 fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 20, _depth)?;
537 Ok(())
538 }
539 }
540
541 impl fidl::encoding::ValueTypeMarker for Info {
542 type Borrowed<'a> = &'a Self;
543 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
544 value
545 }
546 }
547
548 unsafe impl fidl::encoding::TypeMarker for Info {
549 type Owned = Self;
550
551 #[inline(always)]
552 fn inline_align(_context: fidl::encoding::Context) -> usize {
553 8
554 }
555
556 #[inline(always)]
557 fn inline_size(_context: fidl::encoding::Context) -> usize {
558 24
559 }
560 }
561
562 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
563 #[inline]
564 unsafe fn encode(
565 self,
566 encoder: &mut fidl::encoding::Encoder<'_, D>,
567 offset: usize,
568 _depth: fidl::encoding::Depth,
569 ) -> fidl::Result<()> {
570 encoder.debug_check_bounds::<Info>(offset);
571 fidl::encoding::Encode::<Info, D>::encode(
573 (
574 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
575 &self.name,
576 ),
577 <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
578 ),
579 encoder,
580 offset,
581 _depth,
582 )
583 }
584 }
585 unsafe impl<
586 D: fidl::encoding::ResourceDialect,
587 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
588 T1: fidl::encoding::Encode<Capability, D>,
589 > fidl::encoding::Encode<Info, D> for (T0, T1)
590 {
591 #[inline]
592 unsafe fn encode(
593 self,
594 encoder: &mut fidl::encoding::Encoder<'_, D>,
595 offset: usize,
596 depth: fidl::encoding::Depth,
597 ) -> fidl::Result<()> {
598 encoder.debug_check_bounds::<Info>(offset);
599 unsafe {
602 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
603 (ptr as *mut u64).write_unaligned(0);
604 }
605 self.0.encode(encoder, offset + 0, depth)?;
607 self.1.encode(encoder, offset + 16, depth)?;
608 Ok(())
609 }
610 }
611
612 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
613 #[inline(always)]
614 fn new_empty() -> Self {
615 Self {
616 name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
617 capability: fidl::new_empty!(Capability, D),
618 }
619 }
620
621 #[inline]
622 unsafe fn decode(
623 &mut self,
624 decoder: &mut fidl::encoding::Decoder<'_, D>,
625 offset: usize,
626 _depth: fidl::encoding::Depth,
627 ) -> fidl::Result<()> {
628 decoder.debug_check_bounds::<Self>(offset);
629 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
631 let padval = unsafe { (ptr as *const u64).read_unaligned() };
632 let mask = 0xffffffff00000000u64;
633 let maskedval = padval & mask;
634 if maskedval != 0 {
635 return Err(fidl::Error::NonZeroPadding {
636 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
637 });
638 }
639 fidl::decode!(
640 fidl::encoding::BoundedString<32>,
641 D,
642 &mut self.name,
643 decoder,
644 offset + 0,
645 _depth
646 )?;
647 fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 16, _depth)?;
648 Ok(())
649 }
650 }
651
652 impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueRequest {
653 type Borrowed<'a> = &'a Self;
654 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
655 value
656 }
657 }
658
659 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueRequest {
660 type Owned = Self;
661
662 #[inline(always)]
663 fn inline_align(_context: fidl::encoding::Context) -> usize {
664 4
665 }
666
667 #[inline(always)]
668 fn inline_size(_context: fidl::encoding::Context) -> usize {
669 4
670 }
671 #[inline(always)]
672 fn encode_is_copy() -> bool {
673 true
674 }
675
676 #[inline(always)]
677 fn decode_is_copy() -> bool {
678 true
679 }
680 }
681
682 unsafe impl<D: fidl::encoding::ResourceDialect>
683 fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D>
684 for &LightGetCurrentBrightnessValueRequest
685 {
686 #[inline]
687 unsafe fn encode(
688 self,
689 encoder: &mut fidl::encoding::Encoder<'_, D>,
690 offset: usize,
691 _depth: fidl::encoding::Depth,
692 ) -> fidl::Result<()> {
693 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
694 unsafe {
695 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
697 (buf_ptr as *mut LightGetCurrentBrightnessValueRequest)
698 .write_unaligned((self as *const LightGetCurrentBrightnessValueRequest).read());
699 }
702 Ok(())
703 }
704 }
705 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
706 fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
720 Ok(())
721 }
722 }
723
724 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
725 for LightGetCurrentBrightnessValueRequest
726 {
727 #[inline(always)]
728 fn new_empty() -> Self {
729 Self { index: fidl::new_empty!(u32, D) }
730 }
731
732 #[inline]
733 unsafe fn decode(
734 &mut self,
735 decoder: &mut fidl::encoding::Decoder<'_, D>,
736 offset: usize,
737 _depth: fidl::encoding::Depth,
738 ) -> fidl::Result<()> {
739 decoder.debug_check_bounds::<Self>(offset);
740 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
741 unsafe {
744 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
745 }
746 Ok(())
747 }
748 }
749
750 impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueRequest {
751 type Borrowed<'a> = &'a Self;
752 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
753 value
754 }
755 }
756
757 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueRequest {
758 type Owned = Self;
759
760 #[inline(always)]
761 fn inline_align(_context: fidl::encoding::Context) -> usize {
762 4
763 }
764
765 #[inline(always)]
766 fn inline_size(_context: fidl::encoding::Context) -> usize {
767 4
768 }
769 #[inline(always)]
770 fn encode_is_copy() -> bool {
771 true
772 }
773
774 #[inline(always)]
775 fn decode_is_copy() -> bool {
776 true
777 }
778 }
779
780 unsafe impl<D: fidl::encoding::ResourceDialect>
781 fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D>
782 for &LightGetCurrentRgbValueRequest
783 {
784 #[inline]
785 unsafe fn encode(
786 self,
787 encoder: &mut fidl::encoding::Encoder<'_, D>,
788 offset: usize,
789 _depth: fidl::encoding::Depth,
790 ) -> fidl::Result<()> {
791 encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
792 unsafe {
793 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
795 (buf_ptr as *mut LightGetCurrentRgbValueRequest)
796 .write_unaligned((self as *const LightGetCurrentRgbValueRequest).read());
797 }
800 Ok(())
801 }
802 }
803 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
804 fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
818 Ok(())
819 }
820 }
821
822 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
823 for LightGetCurrentRgbValueRequest
824 {
825 #[inline(always)]
826 fn new_empty() -> Self {
827 Self { index: fidl::new_empty!(u32, D) }
828 }
829
830 #[inline]
831 unsafe fn decode(
832 &mut self,
833 decoder: &mut fidl::encoding::Decoder<'_, D>,
834 offset: usize,
835 _depth: fidl::encoding::Depth,
836 ) -> fidl::Result<()> {
837 decoder.debug_check_bounds::<Self>(offset);
838 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
839 unsafe {
842 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
843 }
844 Ok(())
845 }
846 }
847
848 impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueRequest {
849 type Borrowed<'a> = &'a Self;
850 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
851 value
852 }
853 }
854
855 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueRequest {
856 type Owned = Self;
857
858 #[inline(always)]
859 fn inline_align(_context: fidl::encoding::Context) -> usize {
860 4
861 }
862
863 #[inline(always)]
864 fn inline_size(_context: fidl::encoding::Context) -> usize {
865 4
866 }
867 #[inline(always)]
868 fn encode_is_copy() -> bool {
869 true
870 }
871
872 #[inline(always)]
873 fn decode_is_copy() -> bool {
874 true
875 }
876 }
877
878 unsafe impl<D: fidl::encoding::ResourceDialect>
879 fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D>
880 for &LightGetCurrentSimpleValueRequest
881 {
882 #[inline]
883 unsafe fn encode(
884 self,
885 encoder: &mut fidl::encoding::Encoder<'_, D>,
886 offset: usize,
887 _depth: fidl::encoding::Depth,
888 ) -> fidl::Result<()> {
889 encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
890 unsafe {
891 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
893 (buf_ptr as *mut LightGetCurrentSimpleValueRequest)
894 .write_unaligned((self as *const LightGetCurrentSimpleValueRequest).read());
895 }
898 Ok(())
899 }
900 }
901 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
902 fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
916 Ok(())
917 }
918 }
919
920 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
921 for LightGetCurrentSimpleValueRequest
922 {
923 #[inline(always)]
924 fn new_empty() -> Self {
925 Self { index: fidl::new_empty!(u32, D) }
926 }
927
928 #[inline]
929 unsafe fn decode(
930 &mut self,
931 decoder: &mut fidl::encoding::Decoder<'_, D>,
932 offset: usize,
933 _depth: fidl::encoding::Depth,
934 ) -> fidl::Result<()> {
935 decoder.debug_check_bounds::<Self>(offset);
936 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
937 unsafe {
940 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
941 }
942 Ok(())
943 }
944 }
945
946 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueRequest {
947 type Borrowed<'a> = &'a Self;
948 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
949 value
950 }
951 }
952
953 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueRequest {
954 type Owned = Self;
955
956 #[inline(always)]
957 fn inline_align(_context: fidl::encoding::Context) -> usize {
958 4
959 }
960
961 #[inline(always)]
962 fn inline_size(_context: fidl::encoding::Context) -> usize {
963 4
964 }
965 #[inline(always)]
966 fn encode_is_copy() -> bool {
967 true
968 }
969
970 #[inline(always)]
971 fn decode_is_copy() -> bool {
972 true
973 }
974 }
975
976 unsafe impl<D: fidl::encoding::ResourceDialect>
977 fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D>
978 for &LightGetGroupCurrentBrightnessValueRequest
979 {
980 #[inline]
981 unsafe fn encode(
982 self,
983 encoder: &mut fidl::encoding::Encoder<'_, D>,
984 offset: usize,
985 _depth: fidl::encoding::Depth,
986 ) -> fidl::Result<()> {
987 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
988 unsafe {
989 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
991 (buf_ptr as *mut LightGetGroupCurrentBrightnessValueRequest).write_unaligned(
992 (self as *const LightGetGroupCurrentBrightnessValueRequest).read(),
993 );
994 }
997 Ok(())
998 }
999 }
1000 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1001 fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D> for (T0,)
1002 {
1003 #[inline]
1004 unsafe fn encode(
1005 self,
1006 encoder: &mut fidl::encoding::Encoder<'_, D>,
1007 offset: usize,
1008 depth: fidl::encoding::Depth,
1009 ) -> fidl::Result<()> {
1010 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
1011 self.0.encode(encoder, offset + 0, depth)?;
1015 Ok(())
1016 }
1017 }
1018
1019 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1020 for LightGetGroupCurrentBrightnessValueRequest
1021 {
1022 #[inline(always)]
1023 fn new_empty() -> Self {
1024 Self { group_id: fidl::new_empty!(u32, D) }
1025 }
1026
1027 #[inline]
1028 unsafe fn decode(
1029 &mut self,
1030 decoder: &mut fidl::encoding::Decoder<'_, D>,
1031 offset: usize,
1032 _depth: fidl::encoding::Depth,
1033 ) -> fidl::Result<()> {
1034 decoder.debug_check_bounds::<Self>(offset);
1035 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1036 unsafe {
1039 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1040 }
1041 Ok(())
1042 }
1043 }
1044
1045 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueRequest {
1046 type Borrowed<'a> = &'a Self;
1047 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1048 value
1049 }
1050 }
1051
1052 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueRequest {
1053 type Owned = Self;
1054
1055 #[inline(always)]
1056 fn inline_align(_context: fidl::encoding::Context) -> usize {
1057 4
1058 }
1059
1060 #[inline(always)]
1061 fn inline_size(_context: fidl::encoding::Context) -> usize {
1062 4
1063 }
1064 #[inline(always)]
1065 fn encode_is_copy() -> bool {
1066 true
1067 }
1068
1069 #[inline(always)]
1070 fn decode_is_copy() -> bool {
1071 true
1072 }
1073 }
1074
1075 unsafe impl<D: fidl::encoding::ResourceDialect>
1076 fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D>
1077 for &LightGetGroupCurrentRgbValueRequest
1078 {
1079 #[inline]
1080 unsafe fn encode(
1081 self,
1082 encoder: &mut fidl::encoding::Encoder<'_, D>,
1083 offset: usize,
1084 _depth: fidl::encoding::Depth,
1085 ) -> fidl::Result<()> {
1086 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
1087 unsafe {
1088 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1090 (buf_ptr as *mut LightGetGroupCurrentRgbValueRequest)
1091 .write_unaligned((self as *const LightGetGroupCurrentRgbValueRequest).read());
1092 }
1095 Ok(())
1096 }
1097 }
1098 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1099 fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
1113 Ok(())
1114 }
1115 }
1116
1117 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1118 for LightGetGroupCurrentRgbValueRequest
1119 {
1120 #[inline(always)]
1121 fn new_empty() -> Self {
1122 Self { group_id: fidl::new_empty!(u32, D) }
1123 }
1124
1125 #[inline]
1126 unsafe fn decode(
1127 &mut self,
1128 decoder: &mut fidl::encoding::Decoder<'_, D>,
1129 offset: usize,
1130 _depth: fidl::encoding::Depth,
1131 ) -> fidl::Result<()> {
1132 decoder.debug_check_bounds::<Self>(offset);
1133 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1134 unsafe {
1137 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1138 }
1139 Ok(())
1140 }
1141 }
1142
1143 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueRequest {
1144 type Borrowed<'a> = &'a Self;
1145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1146 value
1147 }
1148 }
1149
1150 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueRequest {
1151 type Owned = Self;
1152
1153 #[inline(always)]
1154 fn inline_align(_context: fidl::encoding::Context) -> usize {
1155 4
1156 }
1157
1158 #[inline(always)]
1159 fn inline_size(_context: fidl::encoding::Context) -> usize {
1160 4
1161 }
1162 #[inline(always)]
1163 fn encode_is_copy() -> bool {
1164 true
1165 }
1166
1167 #[inline(always)]
1168 fn decode_is_copy() -> bool {
1169 true
1170 }
1171 }
1172
1173 unsafe impl<D: fidl::encoding::ResourceDialect>
1174 fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D>
1175 for &LightGetGroupCurrentSimpleValueRequest
1176 {
1177 #[inline]
1178 unsafe fn encode(
1179 self,
1180 encoder: &mut fidl::encoding::Encoder<'_, D>,
1181 offset: usize,
1182 _depth: fidl::encoding::Depth,
1183 ) -> fidl::Result<()> {
1184 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
1185 unsafe {
1186 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1188 (buf_ptr as *mut LightGetGroupCurrentSimpleValueRequest).write_unaligned(
1189 (self as *const LightGetGroupCurrentSimpleValueRequest).read(),
1190 );
1191 }
1194 Ok(())
1195 }
1196 }
1197 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1198 fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D> for (T0,)
1199 {
1200 #[inline]
1201 unsafe fn encode(
1202 self,
1203 encoder: &mut fidl::encoding::Encoder<'_, D>,
1204 offset: usize,
1205 depth: fidl::encoding::Depth,
1206 ) -> fidl::Result<()> {
1207 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
1208 self.0.encode(encoder, offset + 0, depth)?;
1212 Ok(())
1213 }
1214 }
1215
1216 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1217 for LightGetGroupCurrentSimpleValueRequest
1218 {
1219 #[inline(always)]
1220 fn new_empty() -> Self {
1221 Self { group_id: fidl::new_empty!(u32, D) }
1222 }
1223
1224 #[inline]
1225 unsafe fn decode(
1226 &mut self,
1227 decoder: &mut fidl::encoding::Decoder<'_, D>,
1228 offset: usize,
1229 _depth: fidl::encoding::Depth,
1230 ) -> fidl::Result<()> {
1231 decoder.debug_check_bounds::<Self>(offset);
1232 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1233 unsafe {
1236 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1237 }
1238 Ok(())
1239 }
1240 }
1241
1242 impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoRequest {
1243 type Borrowed<'a> = &'a Self;
1244 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1245 value
1246 }
1247 }
1248
1249 unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoRequest {
1250 type Owned = Self;
1251
1252 #[inline(always)]
1253 fn inline_align(_context: fidl::encoding::Context) -> usize {
1254 4
1255 }
1256
1257 #[inline(always)]
1258 fn inline_size(_context: fidl::encoding::Context) -> usize {
1259 4
1260 }
1261 #[inline(always)]
1262 fn encode_is_copy() -> bool {
1263 true
1264 }
1265
1266 #[inline(always)]
1267 fn decode_is_copy() -> bool {
1268 true
1269 }
1270 }
1271
1272 unsafe impl<D: fidl::encoding::ResourceDialect>
1273 fidl::encoding::Encode<LightGetGroupInfoRequest, D> for &LightGetGroupInfoRequest
1274 {
1275 #[inline]
1276 unsafe fn encode(
1277 self,
1278 encoder: &mut fidl::encoding::Encoder<'_, D>,
1279 offset: usize,
1280 _depth: fidl::encoding::Depth,
1281 ) -> fidl::Result<()> {
1282 encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
1283 unsafe {
1284 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1286 (buf_ptr as *mut LightGetGroupInfoRequest)
1287 .write_unaligned((self as *const LightGetGroupInfoRequest).read());
1288 }
1291 Ok(())
1292 }
1293 }
1294 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1295 fidl::encoding::Encode<LightGetGroupInfoRequest, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
1309 Ok(())
1310 }
1311 }
1312
1313 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1314 for LightGetGroupInfoRequest
1315 {
1316 #[inline(always)]
1317 fn new_empty() -> Self {
1318 Self { group_id: fidl::new_empty!(u32, D) }
1319 }
1320
1321 #[inline]
1322 unsafe fn decode(
1323 &mut self,
1324 decoder: &mut fidl::encoding::Decoder<'_, D>,
1325 offset: usize,
1326 _depth: fidl::encoding::Depth,
1327 ) -> fidl::Result<()> {
1328 decoder.debug_check_bounds::<Self>(offset);
1329 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1330 unsafe {
1333 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1334 }
1335 Ok(())
1336 }
1337 }
1338
1339 impl fidl::encoding::ValueTypeMarker for LightGetInfoRequest {
1340 type Borrowed<'a> = &'a Self;
1341 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1342 value
1343 }
1344 }
1345
1346 unsafe impl fidl::encoding::TypeMarker for LightGetInfoRequest {
1347 type Owned = Self;
1348
1349 #[inline(always)]
1350 fn inline_align(_context: fidl::encoding::Context) -> usize {
1351 4
1352 }
1353
1354 #[inline(always)]
1355 fn inline_size(_context: fidl::encoding::Context) -> usize {
1356 4
1357 }
1358 #[inline(always)]
1359 fn encode_is_copy() -> bool {
1360 true
1361 }
1362
1363 #[inline(always)]
1364 fn decode_is_copy() -> bool {
1365 true
1366 }
1367 }
1368
1369 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoRequest, D>
1370 for &LightGetInfoRequest
1371 {
1372 #[inline]
1373 unsafe fn encode(
1374 self,
1375 encoder: &mut fidl::encoding::Encoder<'_, D>,
1376 offset: usize,
1377 _depth: fidl::encoding::Depth,
1378 ) -> fidl::Result<()> {
1379 encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
1380 unsafe {
1381 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1383 (buf_ptr as *mut LightGetInfoRequest)
1384 .write_unaligned((self as *const LightGetInfoRequest).read());
1385 }
1388 Ok(())
1389 }
1390 }
1391 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1392 fidl::encoding::Encode<LightGetInfoRequest, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
1406 Ok(())
1407 }
1408 }
1409
1410 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoRequest {
1411 #[inline(always)]
1412 fn new_empty() -> Self {
1413 Self { index: fidl::new_empty!(u32, D) }
1414 }
1415
1416 #[inline]
1417 unsafe fn decode(
1418 &mut self,
1419 decoder: &mut fidl::encoding::Decoder<'_, D>,
1420 offset: usize,
1421 _depth: fidl::encoding::Depth,
1422 ) -> fidl::Result<()> {
1423 decoder.debug_check_bounds::<Self>(offset);
1424 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1425 unsafe {
1428 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1429 }
1430 Ok(())
1431 }
1432 }
1433
1434 impl fidl::encoding::ValueTypeMarker for LightGetNumLightGroupsResponse {
1435 type Borrowed<'a> = &'a Self;
1436 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1437 value
1438 }
1439 }
1440
1441 unsafe impl fidl::encoding::TypeMarker for LightGetNumLightGroupsResponse {
1442 type Owned = Self;
1443
1444 #[inline(always)]
1445 fn inline_align(_context: fidl::encoding::Context) -> usize {
1446 4
1447 }
1448
1449 #[inline(always)]
1450 fn inline_size(_context: fidl::encoding::Context) -> usize {
1451 4
1452 }
1453 #[inline(always)]
1454 fn encode_is_copy() -> bool {
1455 true
1456 }
1457
1458 #[inline(always)]
1459 fn decode_is_copy() -> bool {
1460 true
1461 }
1462 }
1463
1464 unsafe impl<D: fidl::encoding::ResourceDialect>
1465 fidl::encoding::Encode<LightGetNumLightGroupsResponse, D>
1466 for &LightGetNumLightGroupsResponse
1467 {
1468 #[inline]
1469 unsafe fn encode(
1470 self,
1471 encoder: &mut fidl::encoding::Encoder<'_, D>,
1472 offset: usize,
1473 _depth: fidl::encoding::Depth,
1474 ) -> fidl::Result<()> {
1475 encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
1476 unsafe {
1477 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1479 (buf_ptr as *mut LightGetNumLightGroupsResponse)
1480 .write_unaligned((self as *const LightGetNumLightGroupsResponse).read());
1481 }
1484 Ok(())
1485 }
1486 }
1487 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1488 fidl::encoding::Encode<LightGetNumLightGroupsResponse, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
1502 Ok(())
1503 }
1504 }
1505
1506 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1507 for LightGetNumLightGroupsResponse
1508 {
1509 #[inline(always)]
1510 fn new_empty() -> Self {
1511 Self { count: fidl::new_empty!(u32, D) }
1512 }
1513
1514 #[inline]
1515 unsafe fn decode(
1516 &mut self,
1517 decoder: &mut fidl::encoding::Decoder<'_, D>,
1518 offset: usize,
1519 _depth: fidl::encoding::Depth,
1520 ) -> fidl::Result<()> {
1521 decoder.debug_check_bounds::<Self>(offset);
1522 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1523 unsafe {
1526 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1527 }
1528 Ok(())
1529 }
1530 }
1531
1532 impl fidl::encoding::ValueTypeMarker for LightGetNumLightsResponse {
1533 type Borrowed<'a> = &'a Self;
1534 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1535 value
1536 }
1537 }
1538
1539 unsafe impl fidl::encoding::TypeMarker for LightGetNumLightsResponse {
1540 type Owned = Self;
1541
1542 #[inline(always)]
1543 fn inline_align(_context: fidl::encoding::Context) -> usize {
1544 4
1545 }
1546
1547 #[inline(always)]
1548 fn inline_size(_context: fidl::encoding::Context) -> usize {
1549 4
1550 }
1551 #[inline(always)]
1552 fn encode_is_copy() -> bool {
1553 true
1554 }
1555
1556 #[inline(always)]
1557 fn decode_is_copy() -> bool {
1558 true
1559 }
1560 }
1561
1562 unsafe impl<D: fidl::encoding::ResourceDialect>
1563 fidl::encoding::Encode<LightGetNumLightsResponse, D> for &LightGetNumLightsResponse
1564 {
1565 #[inline]
1566 unsafe fn encode(
1567 self,
1568 encoder: &mut fidl::encoding::Encoder<'_, D>,
1569 offset: usize,
1570 _depth: fidl::encoding::Depth,
1571 ) -> fidl::Result<()> {
1572 encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
1573 unsafe {
1574 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1576 (buf_ptr as *mut LightGetNumLightsResponse)
1577 .write_unaligned((self as *const LightGetNumLightsResponse).read());
1578 }
1581 Ok(())
1582 }
1583 }
1584 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1585 fidl::encoding::Encode<LightGetNumLightsResponse, D> for (T0,)
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 self.0.encode(encoder, offset + 0, depth)?;
1599 Ok(())
1600 }
1601 }
1602
1603 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1604 for LightGetNumLightsResponse
1605 {
1606 #[inline(always)]
1607 fn new_empty() -> Self {
1608 Self { count: fidl::new_empty!(u32, D) }
1609 }
1610
1611 #[inline]
1612 unsafe fn decode(
1613 &mut self,
1614 decoder: &mut fidl::encoding::Decoder<'_, D>,
1615 offset: usize,
1616 _depth: fidl::encoding::Depth,
1617 ) -> fidl::Result<()> {
1618 decoder.debug_check_bounds::<Self>(offset);
1619 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1620 unsafe {
1623 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1624 }
1625 Ok(())
1626 }
1627 }
1628
1629 impl fidl::encoding::ValueTypeMarker for LightSetBrightnessValueRequest {
1630 type Borrowed<'a> = &'a Self;
1631 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1632 value
1633 }
1634 }
1635
1636 unsafe impl fidl::encoding::TypeMarker for LightSetBrightnessValueRequest {
1637 type Owned = Self;
1638
1639 #[inline(always)]
1640 fn inline_align(_context: fidl::encoding::Context) -> usize {
1641 8
1642 }
1643
1644 #[inline(always)]
1645 fn inline_size(_context: fidl::encoding::Context) -> usize {
1646 16
1647 }
1648 }
1649
1650 unsafe impl<D: fidl::encoding::ResourceDialect>
1651 fidl::encoding::Encode<LightSetBrightnessValueRequest, D>
1652 for &LightSetBrightnessValueRequest
1653 {
1654 #[inline]
1655 unsafe fn encode(
1656 self,
1657 encoder: &mut fidl::encoding::Encoder<'_, D>,
1658 offset: usize,
1659 _depth: fidl::encoding::Depth,
1660 ) -> fidl::Result<()> {
1661 encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
1662 fidl::encoding::Encode::<LightSetBrightnessValueRequest, D>::encode(
1664 (
1665 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
1666 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
1667 ),
1668 encoder,
1669 offset,
1670 _depth,
1671 )
1672 }
1673 }
1674 unsafe impl<
1675 D: fidl::encoding::ResourceDialect,
1676 T0: fidl::encoding::Encode<u32, D>,
1677 T1: fidl::encoding::Encode<f64, D>,
1678 > fidl::encoding::Encode<LightSetBrightnessValueRequest, D> for (T0, T1)
1679 {
1680 #[inline]
1681 unsafe fn encode(
1682 self,
1683 encoder: &mut fidl::encoding::Encoder<'_, D>,
1684 offset: usize,
1685 depth: fidl::encoding::Depth,
1686 ) -> fidl::Result<()> {
1687 encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
1688 unsafe {
1691 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1692 (ptr as *mut u64).write_unaligned(0);
1693 }
1694 self.0.encode(encoder, offset + 0, depth)?;
1696 self.1.encode(encoder, offset + 8, depth)?;
1697 Ok(())
1698 }
1699 }
1700
1701 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1702 for LightSetBrightnessValueRequest
1703 {
1704 #[inline(always)]
1705 fn new_empty() -> Self {
1706 Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(f64, D) }
1707 }
1708
1709 #[inline]
1710 unsafe fn decode(
1711 &mut self,
1712 decoder: &mut fidl::encoding::Decoder<'_, D>,
1713 offset: usize,
1714 _depth: fidl::encoding::Depth,
1715 ) -> fidl::Result<()> {
1716 decoder.debug_check_bounds::<Self>(offset);
1717 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1719 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1720 let mask = 0xffffffff00000000u64;
1721 let maskedval = padval & mask;
1722 if maskedval != 0 {
1723 return Err(fidl::Error::NonZeroPadding {
1724 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1725 });
1726 }
1727 fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
1728 fidl::decode!(f64, D, &mut self.value, decoder, offset + 8, _depth)?;
1729 Ok(())
1730 }
1731 }
1732
1733 impl fidl::encoding::ValueTypeMarker for LightSetGroupBrightnessValueRequest {
1734 type Borrowed<'a> = &'a Self;
1735 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1736 value
1737 }
1738 }
1739
1740 unsafe impl fidl::encoding::TypeMarker for LightSetGroupBrightnessValueRequest {
1741 type Owned = Self;
1742
1743 #[inline(always)]
1744 fn inline_align(_context: fidl::encoding::Context) -> usize {
1745 8
1746 }
1747
1748 #[inline(always)]
1749 fn inline_size(_context: fidl::encoding::Context) -> usize {
1750 24
1751 }
1752 }
1753
1754 unsafe impl<D: fidl::encoding::ResourceDialect>
1755 fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D>
1756 for &LightSetGroupBrightnessValueRequest
1757 {
1758 #[inline]
1759 unsafe fn encode(
1760 self,
1761 encoder: &mut fidl::encoding::Encoder<'_, D>,
1762 offset: usize,
1763 _depth: fidl::encoding::Depth,
1764 ) -> fidl::Result<()> {
1765 encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
1766 fidl::encoding::Encode::<LightSetGroupBrightnessValueRequest, D>::encode(
1768 (
1769 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1770 <fidl::encoding::UnboundedVector<f64> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1771 ),
1772 encoder, offset, _depth
1773 )
1774 }
1775 }
1776 unsafe impl<
1777 D: fidl::encoding::ResourceDialect,
1778 T0: fidl::encoding::Encode<u32, D>,
1779 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<f64>, D>,
1780 > fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D> for (T0, T1)
1781 {
1782 #[inline]
1783 unsafe fn encode(
1784 self,
1785 encoder: &mut fidl::encoding::Encoder<'_, D>,
1786 offset: usize,
1787 depth: fidl::encoding::Depth,
1788 ) -> fidl::Result<()> {
1789 encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
1790 unsafe {
1793 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1794 (ptr as *mut u64).write_unaligned(0);
1795 }
1796 self.0.encode(encoder, offset + 0, depth)?;
1798 self.1.encode(encoder, offset + 8, depth)?;
1799 Ok(())
1800 }
1801 }
1802
1803 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1804 for LightSetGroupBrightnessValueRequest
1805 {
1806 #[inline(always)]
1807 fn new_empty() -> Self {
1808 Self {
1809 group_id: fidl::new_empty!(u32, D),
1810 values: fidl::new_empty!(fidl::encoding::UnboundedVector<f64>, D),
1811 }
1812 }
1813
1814 #[inline]
1815 unsafe fn decode(
1816 &mut self,
1817 decoder: &mut fidl::encoding::Decoder<'_, D>,
1818 offset: usize,
1819 _depth: fidl::encoding::Depth,
1820 ) -> fidl::Result<()> {
1821 decoder.debug_check_bounds::<Self>(offset);
1822 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1824 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1825 let mask = 0xffffffff00000000u64;
1826 let maskedval = padval & mask;
1827 if maskedval != 0 {
1828 return Err(fidl::Error::NonZeroPadding {
1829 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1830 });
1831 }
1832 fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
1833 fidl::decode!(
1834 fidl::encoding::UnboundedVector<f64>,
1835 D,
1836 &mut self.values,
1837 decoder,
1838 offset + 8,
1839 _depth
1840 )?;
1841 Ok(())
1842 }
1843 }
1844
1845 impl fidl::encoding::ValueTypeMarker for LightSetGroupRgbValueRequest {
1846 type Borrowed<'a> = &'a Self;
1847 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1848 value
1849 }
1850 }
1851
1852 unsafe impl fidl::encoding::TypeMarker for LightSetGroupRgbValueRequest {
1853 type Owned = Self;
1854
1855 #[inline(always)]
1856 fn inline_align(_context: fidl::encoding::Context) -> usize {
1857 8
1858 }
1859
1860 #[inline(always)]
1861 fn inline_size(_context: fidl::encoding::Context) -> usize {
1862 24
1863 }
1864 }
1865
1866 unsafe impl<D: fidl::encoding::ResourceDialect>
1867 fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for &LightSetGroupRgbValueRequest
1868 {
1869 #[inline]
1870 unsafe fn encode(
1871 self,
1872 encoder: &mut fidl::encoding::Encoder<'_, D>,
1873 offset: usize,
1874 _depth: fidl::encoding::Depth,
1875 ) -> fidl::Result<()> {
1876 encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
1877 fidl::encoding::Encode::<LightSetGroupRgbValueRequest, D>::encode(
1879 (
1880 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1881 <fidl::encoding::UnboundedVector<Rgb> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1882 ),
1883 encoder, offset, _depth
1884 )
1885 }
1886 }
1887 unsafe impl<
1888 D: fidl::encoding::ResourceDialect,
1889 T0: fidl::encoding::Encode<u32, D>,
1890 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Rgb>, D>,
1891 > fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for (T0, T1)
1892 {
1893 #[inline]
1894 unsafe fn encode(
1895 self,
1896 encoder: &mut fidl::encoding::Encoder<'_, D>,
1897 offset: usize,
1898 depth: fidl::encoding::Depth,
1899 ) -> fidl::Result<()> {
1900 encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
1901 unsafe {
1904 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1905 (ptr as *mut u64).write_unaligned(0);
1906 }
1907 self.0.encode(encoder, offset + 0, depth)?;
1909 self.1.encode(encoder, offset + 8, depth)?;
1910 Ok(())
1911 }
1912 }
1913
1914 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1915 for LightSetGroupRgbValueRequest
1916 {
1917 #[inline(always)]
1918 fn new_empty() -> Self {
1919 Self {
1920 group_id: fidl::new_empty!(u32, D),
1921 values: fidl::new_empty!(fidl::encoding::UnboundedVector<Rgb>, D),
1922 }
1923 }
1924
1925 #[inline]
1926 unsafe fn decode(
1927 &mut self,
1928 decoder: &mut fidl::encoding::Decoder<'_, D>,
1929 offset: usize,
1930 _depth: fidl::encoding::Depth,
1931 ) -> fidl::Result<()> {
1932 decoder.debug_check_bounds::<Self>(offset);
1933 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1935 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1936 let mask = 0xffffffff00000000u64;
1937 let maskedval = padval & mask;
1938 if maskedval != 0 {
1939 return Err(fidl::Error::NonZeroPadding {
1940 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1941 });
1942 }
1943 fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
1944 fidl::decode!(
1945 fidl::encoding::UnboundedVector<Rgb>,
1946 D,
1947 &mut self.values,
1948 decoder,
1949 offset + 8,
1950 _depth
1951 )?;
1952 Ok(())
1953 }
1954 }
1955
1956 impl fidl::encoding::ValueTypeMarker for LightSetGroupSimpleValueRequest {
1957 type Borrowed<'a> = &'a Self;
1958 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1959 value
1960 }
1961 }
1962
1963 unsafe impl fidl::encoding::TypeMarker for LightSetGroupSimpleValueRequest {
1964 type Owned = Self;
1965
1966 #[inline(always)]
1967 fn inline_align(_context: fidl::encoding::Context) -> usize {
1968 8
1969 }
1970
1971 #[inline(always)]
1972 fn inline_size(_context: fidl::encoding::Context) -> usize {
1973 24
1974 }
1975 }
1976
1977 unsafe impl<D: fidl::encoding::ResourceDialect>
1978 fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D>
1979 for &LightSetGroupSimpleValueRequest
1980 {
1981 #[inline]
1982 unsafe fn encode(
1983 self,
1984 encoder: &mut fidl::encoding::Encoder<'_, D>,
1985 offset: usize,
1986 _depth: fidl::encoding::Depth,
1987 ) -> fidl::Result<()> {
1988 encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
1989 fidl::encoding::Encode::<LightSetGroupSimpleValueRequest, D>::encode(
1991 (
1992 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1993 <fidl::encoding::UnboundedVector<bool> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1994 ),
1995 encoder, offset, _depth
1996 )
1997 }
1998 }
1999 unsafe impl<
2000 D: fidl::encoding::ResourceDialect,
2001 T0: fidl::encoding::Encode<u32, D>,
2002 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<bool>, D>,
2003 > fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D> for (T0, T1)
2004 {
2005 #[inline]
2006 unsafe fn encode(
2007 self,
2008 encoder: &mut fidl::encoding::Encoder<'_, D>,
2009 offset: usize,
2010 depth: fidl::encoding::Depth,
2011 ) -> fidl::Result<()> {
2012 encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
2013 unsafe {
2016 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2017 (ptr as *mut u64).write_unaligned(0);
2018 }
2019 self.0.encode(encoder, offset + 0, depth)?;
2021 self.1.encode(encoder, offset + 8, depth)?;
2022 Ok(())
2023 }
2024 }
2025
2026 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2027 for LightSetGroupSimpleValueRequest
2028 {
2029 #[inline(always)]
2030 fn new_empty() -> Self {
2031 Self {
2032 group_id: fidl::new_empty!(u32, D),
2033 values: fidl::new_empty!(fidl::encoding::UnboundedVector<bool>, D),
2034 }
2035 }
2036
2037 #[inline]
2038 unsafe fn decode(
2039 &mut self,
2040 decoder: &mut fidl::encoding::Decoder<'_, D>,
2041 offset: usize,
2042 _depth: fidl::encoding::Depth,
2043 ) -> fidl::Result<()> {
2044 decoder.debug_check_bounds::<Self>(offset);
2045 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2047 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2048 let mask = 0xffffffff00000000u64;
2049 let maskedval = padval & mask;
2050 if maskedval != 0 {
2051 return Err(fidl::Error::NonZeroPadding {
2052 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2053 });
2054 }
2055 fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
2056 fidl::decode!(
2057 fidl::encoding::UnboundedVector<bool>,
2058 D,
2059 &mut self.values,
2060 decoder,
2061 offset + 8,
2062 _depth
2063 )?;
2064 Ok(())
2065 }
2066 }
2067
2068 impl fidl::encoding::ValueTypeMarker for LightSetRgbValueRequest {
2069 type Borrowed<'a> = &'a Self;
2070 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2071 value
2072 }
2073 }
2074
2075 unsafe impl fidl::encoding::TypeMarker for LightSetRgbValueRequest {
2076 type Owned = Self;
2077
2078 #[inline(always)]
2079 fn inline_align(_context: fidl::encoding::Context) -> usize {
2080 8
2081 }
2082
2083 #[inline(always)]
2084 fn inline_size(_context: fidl::encoding::Context) -> usize {
2085 32
2086 }
2087 }
2088
2089 unsafe impl<D: fidl::encoding::ResourceDialect>
2090 fidl::encoding::Encode<LightSetRgbValueRequest, D> for &LightSetRgbValueRequest
2091 {
2092 #[inline]
2093 unsafe fn encode(
2094 self,
2095 encoder: &mut fidl::encoding::Encoder<'_, D>,
2096 offset: usize,
2097 _depth: fidl::encoding::Depth,
2098 ) -> fidl::Result<()> {
2099 encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
2100 fidl::encoding::Encode::<LightSetRgbValueRequest, D>::encode(
2102 (
2103 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
2104 <Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2105 ),
2106 encoder,
2107 offset,
2108 _depth,
2109 )
2110 }
2111 }
2112 unsafe impl<
2113 D: fidl::encoding::ResourceDialect,
2114 T0: fidl::encoding::Encode<u32, D>,
2115 T1: fidl::encoding::Encode<Rgb, D>,
2116 > fidl::encoding::Encode<LightSetRgbValueRequest, D> for (T0, T1)
2117 {
2118 #[inline]
2119 unsafe fn encode(
2120 self,
2121 encoder: &mut fidl::encoding::Encoder<'_, D>,
2122 offset: usize,
2123 depth: fidl::encoding::Depth,
2124 ) -> fidl::Result<()> {
2125 encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
2126 unsafe {
2129 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2130 (ptr as *mut u64).write_unaligned(0);
2131 }
2132 self.0.encode(encoder, offset + 0, depth)?;
2134 self.1.encode(encoder, offset + 8, depth)?;
2135 Ok(())
2136 }
2137 }
2138
2139 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2140 for LightSetRgbValueRequest
2141 {
2142 #[inline(always)]
2143 fn new_empty() -> Self {
2144 Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(Rgb, D) }
2145 }
2146
2147 #[inline]
2148 unsafe fn decode(
2149 &mut self,
2150 decoder: &mut fidl::encoding::Decoder<'_, D>,
2151 offset: usize,
2152 _depth: fidl::encoding::Depth,
2153 ) -> fidl::Result<()> {
2154 decoder.debug_check_bounds::<Self>(offset);
2155 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2157 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2158 let mask = 0xffffffff00000000u64;
2159 let maskedval = padval & mask;
2160 if maskedval != 0 {
2161 return Err(fidl::Error::NonZeroPadding {
2162 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2163 });
2164 }
2165 fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
2166 fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 8, _depth)?;
2167 Ok(())
2168 }
2169 }
2170
2171 impl fidl::encoding::ValueTypeMarker for LightSetSimpleValueRequest {
2172 type Borrowed<'a> = &'a Self;
2173 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2174 value
2175 }
2176 }
2177
2178 unsafe impl fidl::encoding::TypeMarker for LightSetSimpleValueRequest {
2179 type Owned = Self;
2180
2181 #[inline(always)]
2182 fn inline_align(_context: fidl::encoding::Context) -> usize {
2183 4
2184 }
2185
2186 #[inline(always)]
2187 fn inline_size(_context: fidl::encoding::Context) -> usize {
2188 8
2189 }
2190 }
2191
2192 unsafe impl<D: fidl::encoding::ResourceDialect>
2193 fidl::encoding::Encode<LightSetSimpleValueRequest, D> for &LightSetSimpleValueRequest
2194 {
2195 #[inline]
2196 unsafe fn encode(
2197 self,
2198 encoder: &mut fidl::encoding::Encoder<'_, D>,
2199 offset: usize,
2200 _depth: fidl::encoding::Depth,
2201 ) -> fidl::Result<()> {
2202 encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
2203 fidl::encoding::Encode::<LightSetSimpleValueRequest, D>::encode(
2205 (
2206 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
2207 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2208 ),
2209 encoder,
2210 offset,
2211 _depth,
2212 )
2213 }
2214 }
2215 unsafe impl<
2216 D: fidl::encoding::ResourceDialect,
2217 T0: fidl::encoding::Encode<u32, D>,
2218 T1: fidl::encoding::Encode<bool, D>,
2219 > fidl::encoding::Encode<LightSetSimpleValueRequest, D> for (T0, T1)
2220 {
2221 #[inline]
2222 unsafe fn encode(
2223 self,
2224 encoder: &mut fidl::encoding::Encoder<'_, D>,
2225 offset: usize,
2226 depth: fidl::encoding::Depth,
2227 ) -> fidl::Result<()> {
2228 encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
2229 unsafe {
2232 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
2233 (ptr as *mut u32).write_unaligned(0);
2234 }
2235 self.0.encode(encoder, offset + 0, depth)?;
2237 self.1.encode(encoder, offset + 4, depth)?;
2238 Ok(())
2239 }
2240 }
2241
2242 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2243 for LightSetSimpleValueRequest
2244 {
2245 #[inline(always)]
2246 fn new_empty() -> Self {
2247 Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
2248 }
2249
2250 #[inline]
2251 unsafe fn decode(
2252 &mut self,
2253 decoder: &mut fidl::encoding::Decoder<'_, D>,
2254 offset: usize,
2255 _depth: fidl::encoding::Depth,
2256 ) -> fidl::Result<()> {
2257 decoder.debug_check_bounds::<Self>(offset);
2258 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
2260 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2261 let mask = 0xffffff00u32;
2262 let maskedval = padval & mask;
2263 if maskedval != 0 {
2264 return Err(fidl::Error::NonZeroPadding {
2265 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
2266 });
2267 }
2268 fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
2269 fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
2270 Ok(())
2271 }
2272 }
2273
2274 impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueResponse {
2275 type Borrowed<'a> = &'a Self;
2276 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2277 value
2278 }
2279 }
2280
2281 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueResponse {
2282 type Owned = Self;
2283
2284 #[inline(always)]
2285 fn inline_align(_context: fidl::encoding::Context) -> usize {
2286 8
2287 }
2288
2289 #[inline(always)]
2290 fn inline_size(_context: fidl::encoding::Context) -> usize {
2291 8
2292 }
2293 }
2294
2295 unsafe impl<D: fidl::encoding::ResourceDialect>
2296 fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D>
2297 for &LightGetCurrentBrightnessValueResponse
2298 {
2299 #[inline]
2300 unsafe fn encode(
2301 self,
2302 encoder: &mut fidl::encoding::Encoder<'_, D>,
2303 offset: usize,
2304 _depth: fidl::encoding::Depth,
2305 ) -> fidl::Result<()> {
2306 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
2307 fidl::encoding::Encode::<LightGetCurrentBrightnessValueResponse, D>::encode(
2309 (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2310 encoder,
2311 offset,
2312 _depth,
2313 )
2314 }
2315 }
2316 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
2317 fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D> for (T0,)
2318 {
2319 #[inline]
2320 unsafe fn encode(
2321 self,
2322 encoder: &mut fidl::encoding::Encoder<'_, D>,
2323 offset: usize,
2324 depth: fidl::encoding::Depth,
2325 ) -> fidl::Result<()> {
2326 encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
2327 self.0.encode(encoder, offset + 0, depth)?;
2331 Ok(())
2332 }
2333 }
2334
2335 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2336 for LightGetCurrentBrightnessValueResponse
2337 {
2338 #[inline(always)]
2339 fn new_empty() -> Self {
2340 Self { value: fidl::new_empty!(f64, D) }
2341 }
2342
2343 #[inline]
2344 unsafe fn decode(
2345 &mut self,
2346 decoder: &mut fidl::encoding::Decoder<'_, D>,
2347 offset: usize,
2348 _depth: fidl::encoding::Depth,
2349 ) -> fidl::Result<()> {
2350 decoder.debug_check_bounds::<Self>(offset);
2351 fidl::decode!(f64, D, &mut self.value, decoder, offset + 0, _depth)?;
2353 Ok(())
2354 }
2355 }
2356
2357 impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueResponse {
2358 type Borrowed<'a> = &'a Self;
2359 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2360 value
2361 }
2362 }
2363
2364 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueResponse {
2365 type Owned = Self;
2366
2367 #[inline(always)]
2368 fn inline_align(_context: fidl::encoding::Context) -> usize {
2369 8
2370 }
2371
2372 #[inline(always)]
2373 fn inline_size(_context: fidl::encoding::Context) -> usize {
2374 24
2375 }
2376 }
2377
2378 unsafe impl<D: fidl::encoding::ResourceDialect>
2379 fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D>
2380 for &LightGetCurrentRgbValueResponse
2381 {
2382 #[inline]
2383 unsafe fn encode(
2384 self,
2385 encoder: &mut fidl::encoding::Encoder<'_, D>,
2386 offset: usize,
2387 _depth: fidl::encoding::Depth,
2388 ) -> fidl::Result<()> {
2389 encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
2390 fidl::encoding::Encode::<LightGetCurrentRgbValueResponse, D>::encode(
2392 (<Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2393 encoder,
2394 offset,
2395 _depth,
2396 )
2397 }
2398 }
2399 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Rgb, D>>
2400 fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D> for (T0,)
2401 {
2402 #[inline]
2403 unsafe fn encode(
2404 self,
2405 encoder: &mut fidl::encoding::Encoder<'_, D>,
2406 offset: usize,
2407 depth: fidl::encoding::Depth,
2408 ) -> fidl::Result<()> {
2409 encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
2410 self.0.encode(encoder, offset + 0, depth)?;
2414 Ok(())
2415 }
2416 }
2417
2418 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2419 for LightGetCurrentRgbValueResponse
2420 {
2421 #[inline(always)]
2422 fn new_empty() -> Self {
2423 Self { value: fidl::new_empty!(Rgb, D) }
2424 }
2425
2426 #[inline]
2427 unsafe fn decode(
2428 &mut self,
2429 decoder: &mut fidl::encoding::Decoder<'_, D>,
2430 offset: usize,
2431 _depth: fidl::encoding::Depth,
2432 ) -> fidl::Result<()> {
2433 decoder.debug_check_bounds::<Self>(offset);
2434 fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 0, _depth)?;
2436 Ok(())
2437 }
2438 }
2439
2440 impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueResponse {
2441 type Borrowed<'a> = &'a Self;
2442 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2443 value
2444 }
2445 }
2446
2447 unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueResponse {
2448 type Owned = Self;
2449
2450 #[inline(always)]
2451 fn inline_align(_context: fidl::encoding::Context) -> usize {
2452 1
2453 }
2454
2455 #[inline(always)]
2456 fn inline_size(_context: fidl::encoding::Context) -> usize {
2457 1
2458 }
2459 }
2460
2461 unsafe impl<D: fidl::encoding::ResourceDialect>
2462 fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D>
2463 for &LightGetCurrentSimpleValueResponse
2464 {
2465 #[inline]
2466 unsafe fn encode(
2467 self,
2468 encoder: &mut fidl::encoding::Encoder<'_, D>,
2469 offset: usize,
2470 _depth: fidl::encoding::Depth,
2471 ) -> fidl::Result<()> {
2472 encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
2473 fidl::encoding::Encode::<LightGetCurrentSimpleValueResponse, D>::encode(
2475 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2476 encoder,
2477 offset,
2478 _depth,
2479 )
2480 }
2481 }
2482 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2483 fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D> for (T0,)
2484 {
2485 #[inline]
2486 unsafe fn encode(
2487 self,
2488 encoder: &mut fidl::encoding::Encoder<'_, D>,
2489 offset: usize,
2490 depth: fidl::encoding::Depth,
2491 ) -> fidl::Result<()> {
2492 encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
2493 self.0.encode(encoder, offset + 0, depth)?;
2497 Ok(())
2498 }
2499 }
2500
2501 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2502 for LightGetCurrentSimpleValueResponse
2503 {
2504 #[inline(always)]
2505 fn new_empty() -> Self {
2506 Self { value: fidl::new_empty!(bool, D) }
2507 }
2508
2509 #[inline]
2510 unsafe fn decode(
2511 &mut self,
2512 decoder: &mut fidl::encoding::Decoder<'_, D>,
2513 offset: usize,
2514 _depth: fidl::encoding::Depth,
2515 ) -> fidl::Result<()> {
2516 decoder.debug_check_bounds::<Self>(offset);
2517 fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
2519 Ok(())
2520 }
2521 }
2522
2523 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueResponse {
2524 type Borrowed<'a> = &'a Self;
2525 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2526 value
2527 }
2528 }
2529
2530 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueResponse {
2531 type Owned = Self;
2532
2533 #[inline(always)]
2534 fn inline_align(_context: fidl::encoding::Context) -> usize {
2535 8
2536 }
2537
2538 #[inline(always)]
2539 fn inline_size(_context: fidl::encoding::Context) -> usize {
2540 16
2541 }
2542 }
2543
2544 unsafe impl<D: fidl::encoding::ResourceDialect>
2545 fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D>
2546 for &LightGetGroupCurrentBrightnessValueResponse
2547 {
2548 #[inline]
2549 unsafe fn encode(
2550 self,
2551 encoder: &mut fidl::encoding::Encoder<'_, D>,
2552 offset: usize,
2553 _depth: fidl::encoding::Depth,
2554 ) -> fidl::Result<()> {
2555 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
2556 fidl::encoding::Encode::<LightGetGroupCurrentBrightnessValueResponse, D>::encode(
2558 (
2559 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2560 ),
2561 encoder, offset, _depth
2562 )
2563 }
2564 }
2565 unsafe impl<
2566 D: fidl::encoding::ResourceDialect,
2567 T0: fidl::encoding::Encode<
2568 fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2569 D,
2570 >,
2571 > fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D> for (T0,)
2572 {
2573 #[inline]
2574 unsafe fn encode(
2575 self,
2576 encoder: &mut fidl::encoding::Encoder<'_, D>,
2577 offset: usize,
2578 depth: fidl::encoding::Depth,
2579 ) -> fidl::Result<()> {
2580 encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
2581 self.0.encode(encoder, offset + 0, depth)?;
2585 Ok(())
2586 }
2587 }
2588
2589 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2590 for LightGetGroupCurrentBrightnessValueResponse
2591 {
2592 #[inline(always)]
2593 fn new_empty() -> Self {
2594 Self {
2595 values: fidl::new_empty!(
2596 fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2597 D
2598 ),
2599 }
2600 }
2601
2602 #[inline]
2603 unsafe fn decode(
2604 &mut self,
2605 decoder: &mut fidl::encoding::Decoder<'_, D>,
2606 offset: usize,
2607 _depth: fidl::encoding::Depth,
2608 ) -> fidl::Result<()> {
2609 decoder.debug_check_bounds::<Self>(offset);
2610 fidl::decode!(
2612 fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2613 D,
2614 &mut self.values,
2615 decoder,
2616 offset + 0,
2617 _depth
2618 )?;
2619 Ok(())
2620 }
2621 }
2622
2623 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueResponse {
2624 type Borrowed<'a> = &'a Self;
2625 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2626 value
2627 }
2628 }
2629
2630 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueResponse {
2631 type Owned = Self;
2632
2633 #[inline(always)]
2634 fn inline_align(_context: fidl::encoding::Context) -> usize {
2635 8
2636 }
2637
2638 #[inline(always)]
2639 fn inline_size(_context: fidl::encoding::Context) -> usize {
2640 16
2641 }
2642 }
2643
2644 unsafe impl<D: fidl::encoding::ResourceDialect>
2645 fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D>
2646 for &LightGetGroupCurrentRgbValueResponse
2647 {
2648 #[inline]
2649 unsafe fn encode(
2650 self,
2651 encoder: &mut fidl::encoding::Encoder<'_, D>,
2652 offset: usize,
2653 _depth: fidl::encoding::Depth,
2654 ) -> fidl::Result<()> {
2655 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
2656 fidl::encoding::Encode::<LightGetGroupCurrentRgbValueResponse, D>::encode(
2658 (
2659 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2660 ),
2661 encoder, offset, _depth
2662 )
2663 }
2664 }
2665 unsafe impl<
2666 D: fidl::encoding::ResourceDialect,
2667 T0: fidl::encoding::Encode<
2668 fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2669 D,
2670 >,
2671 > fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D> for (T0,)
2672 {
2673 #[inline]
2674 unsafe fn encode(
2675 self,
2676 encoder: &mut fidl::encoding::Encoder<'_, D>,
2677 offset: usize,
2678 depth: fidl::encoding::Depth,
2679 ) -> fidl::Result<()> {
2680 encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
2681 self.0.encode(encoder, offset + 0, depth)?;
2685 Ok(())
2686 }
2687 }
2688
2689 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2690 for LightGetGroupCurrentRgbValueResponse
2691 {
2692 #[inline(always)]
2693 fn new_empty() -> Self {
2694 Self {
2695 values: fidl::new_empty!(
2696 fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2697 D
2698 ),
2699 }
2700 }
2701
2702 #[inline]
2703 unsafe fn decode(
2704 &mut self,
2705 decoder: &mut fidl::encoding::Decoder<'_, D>,
2706 offset: usize,
2707 _depth: fidl::encoding::Depth,
2708 ) -> fidl::Result<()> {
2709 decoder.debug_check_bounds::<Self>(offset);
2710 fidl::decode!(
2712 fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2713 D,
2714 &mut self.values,
2715 decoder,
2716 offset + 0,
2717 _depth
2718 )?;
2719 Ok(())
2720 }
2721 }
2722
2723 impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueResponse {
2724 type Borrowed<'a> = &'a Self;
2725 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2726 value
2727 }
2728 }
2729
2730 unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueResponse {
2731 type Owned = Self;
2732
2733 #[inline(always)]
2734 fn inline_align(_context: fidl::encoding::Context) -> usize {
2735 8
2736 }
2737
2738 #[inline(always)]
2739 fn inline_size(_context: fidl::encoding::Context) -> usize {
2740 16
2741 }
2742 }
2743
2744 unsafe impl<D: fidl::encoding::ResourceDialect>
2745 fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D>
2746 for &LightGetGroupCurrentSimpleValueResponse
2747 {
2748 #[inline]
2749 unsafe fn encode(
2750 self,
2751 encoder: &mut fidl::encoding::Encoder<'_, D>,
2752 offset: usize,
2753 _depth: fidl::encoding::Depth,
2754 ) -> fidl::Result<()> {
2755 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
2756 fidl::encoding::Encode::<LightGetGroupCurrentSimpleValueResponse, D>::encode(
2758 (
2759 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2760 ),
2761 encoder, offset, _depth
2762 )
2763 }
2764 }
2765 unsafe impl<
2766 D: fidl::encoding::ResourceDialect,
2767 T0: fidl::encoding::Encode<
2768 fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2769 D,
2770 >,
2771 > fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D> for (T0,)
2772 {
2773 #[inline]
2774 unsafe fn encode(
2775 self,
2776 encoder: &mut fidl::encoding::Encoder<'_, D>,
2777 offset: usize,
2778 depth: fidl::encoding::Depth,
2779 ) -> fidl::Result<()> {
2780 encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
2781 self.0.encode(encoder, offset + 0, depth)?;
2785 Ok(())
2786 }
2787 }
2788
2789 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2790 for LightGetGroupCurrentSimpleValueResponse
2791 {
2792 #[inline(always)]
2793 fn new_empty() -> Self {
2794 Self {
2795 values: fidl::new_empty!(
2796 fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2797 D
2798 ),
2799 }
2800 }
2801
2802 #[inline]
2803 unsafe fn decode(
2804 &mut self,
2805 decoder: &mut fidl::encoding::Decoder<'_, D>,
2806 offset: usize,
2807 _depth: fidl::encoding::Depth,
2808 ) -> fidl::Result<()> {
2809 decoder.debug_check_bounds::<Self>(offset);
2810 fidl::decode!(
2812 fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2813 D,
2814 &mut self.values,
2815 decoder,
2816 offset + 0,
2817 _depth
2818 )?;
2819 Ok(())
2820 }
2821 }
2822
2823 impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoResponse {
2824 type Borrowed<'a> = &'a Self;
2825 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2826 value
2827 }
2828 }
2829
2830 unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoResponse {
2831 type Owned = Self;
2832
2833 #[inline(always)]
2834 fn inline_align(_context: fidl::encoding::Context) -> usize {
2835 8
2836 }
2837
2838 #[inline(always)]
2839 fn inline_size(_context: fidl::encoding::Context) -> usize {
2840 24
2841 }
2842 }
2843
2844 unsafe impl<D: fidl::encoding::ResourceDialect>
2845 fidl::encoding::Encode<LightGetGroupInfoResponse, D> for &LightGetGroupInfoResponse
2846 {
2847 #[inline]
2848 unsafe fn encode(
2849 self,
2850 encoder: &mut fidl::encoding::Encoder<'_, D>,
2851 offset: usize,
2852 _depth: fidl::encoding::Depth,
2853 ) -> fidl::Result<()> {
2854 encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
2855 fidl::encoding::Encode::<LightGetGroupInfoResponse, D>::encode(
2857 (<GroupInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2858 encoder,
2859 offset,
2860 _depth,
2861 )
2862 }
2863 }
2864 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GroupInfo, D>>
2865 fidl::encoding::Encode<LightGetGroupInfoResponse, D> for (T0,)
2866 {
2867 #[inline]
2868 unsafe fn encode(
2869 self,
2870 encoder: &mut fidl::encoding::Encoder<'_, D>,
2871 offset: usize,
2872 depth: fidl::encoding::Depth,
2873 ) -> fidl::Result<()> {
2874 encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
2875 self.0.encode(encoder, offset + 0, depth)?;
2879 Ok(())
2880 }
2881 }
2882
2883 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2884 for LightGetGroupInfoResponse
2885 {
2886 #[inline(always)]
2887 fn new_empty() -> Self {
2888 Self { info: fidl::new_empty!(GroupInfo, D) }
2889 }
2890
2891 #[inline]
2892 unsafe fn decode(
2893 &mut self,
2894 decoder: &mut fidl::encoding::Decoder<'_, D>,
2895 offset: usize,
2896 _depth: fidl::encoding::Depth,
2897 ) -> fidl::Result<()> {
2898 decoder.debug_check_bounds::<Self>(offset);
2899 fidl::decode!(GroupInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
2901 Ok(())
2902 }
2903 }
2904
2905 impl fidl::encoding::ValueTypeMarker for LightGetInfoResponse {
2906 type Borrowed<'a> = &'a Self;
2907 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2908 value
2909 }
2910 }
2911
2912 unsafe impl fidl::encoding::TypeMarker for LightGetInfoResponse {
2913 type Owned = Self;
2914
2915 #[inline(always)]
2916 fn inline_align(_context: fidl::encoding::Context) -> usize {
2917 8
2918 }
2919
2920 #[inline(always)]
2921 fn inline_size(_context: fidl::encoding::Context) -> usize {
2922 24
2923 }
2924 }
2925
2926 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoResponse, D>
2927 for &LightGetInfoResponse
2928 {
2929 #[inline]
2930 unsafe fn encode(
2931 self,
2932 encoder: &mut fidl::encoding::Encoder<'_, D>,
2933 offset: usize,
2934 _depth: fidl::encoding::Depth,
2935 ) -> fidl::Result<()> {
2936 encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
2937 fidl::encoding::Encode::<LightGetInfoResponse, D>::encode(
2939 (<Info as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2940 encoder,
2941 offset,
2942 _depth,
2943 )
2944 }
2945 }
2946 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Info, D>>
2947 fidl::encoding::Encode<LightGetInfoResponse, D> for (T0,)
2948 {
2949 #[inline]
2950 unsafe fn encode(
2951 self,
2952 encoder: &mut fidl::encoding::Encoder<'_, D>,
2953 offset: usize,
2954 depth: fidl::encoding::Depth,
2955 ) -> fidl::Result<()> {
2956 encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
2957 self.0.encode(encoder, offset + 0, depth)?;
2961 Ok(())
2962 }
2963 }
2964
2965 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoResponse {
2966 #[inline(always)]
2967 fn new_empty() -> Self {
2968 Self { info: fidl::new_empty!(Info, D) }
2969 }
2970
2971 #[inline]
2972 unsafe fn decode(
2973 &mut self,
2974 decoder: &mut fidl::encoding::Decoder<'_, D>,
2975 offset: usize,
2976 _depth: fidl::encoding::Depth,
2977 ) -> fidl::Result<()> {
2978 decoder.debug_check_bounds::<Self>(offset);
2979 fidl::decode!(Info, D, &mut self.info, decoder, offset + 0, _depth)?;
2981 Ok(())
2982 }
2983 }
2984
2985 impl fidl::encoding::ValueTypeMarker for Rgb {
2986 type Borrowed<'a> = &'a Self;
2987 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2988 value
2989 }
2990 }
2991
2992 unsafe impl fidl::encoding::TypeMarker for Rgb {
2993 type Owned = Self;
2994
2995 #[inline(always)]
2996 fn inline_align(_context: fidl::encoding::Context) -> usize {
2997 8
2998 }
2999
3000 #[inline(always)]
3001 fn inline_size(_context: fidl::encoding::Context) -> usize {
3002 24
3003 }
3004 }
3005
3006 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Rgb, D> for &Rgb {
3007 #[inline]
3008 unsafe fn encode(
3009 self,
3010 encoder: &mut fidl::encoding::Encoder<'_, D>,
3011 offset: usize,
3012 _depth: fidl::encoding::Depth,
3013 ) -> fidl::Result<()> {
3014 encoder.debug_check_bounds::<Rgb>(offset);
3015 fidl::encoding::Encode::<Rgb, D>::encode(
3017 (
3018 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
3019 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
3020 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
3021 ),
3022 encoder,
3023 offset,
3024 _depth,
3025 )
3026 }
3027 }
3028 unsafe impl<
3029 D: fidl::encoding::ResourceDialect,
3030 T0: fidl::encoding::Encode<f64, D>,
3031 T1: fidl::encoding::Encode<f64, D>,
3032 T2: fidl::encoding::Encode<f64, D>,
3033 > fidl::encoding::Encode<Rgb, D> for (T0, T1, T2)
3034 {
3035 #[inline]
3036 unsafe fn encode(
3037 self,
3038 encoder: &mut fidl::encoding::Encoder<'_, D>,
3039 offset: usize,
3040 depth: fidl::encoding::Depth,
3041 ) -> fidl::Result<()> {
3042 encoder.debug_check_bounds::<Rgb>(offset);
3043 self.0.encode(encoder, offset + 0, depth)?;
3047 self.1.encode(encoder, offset + 8, depth)?;
3048 self.2.encode(encoder, offset + 16, depth)?;
3049 Ok(())
3050 }
3051 }
3052
3053 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rgb {
3054 #[inline(always)]
3055 fn new_empty() -> Self {
3056 Self {
3057 red: fidl::new_empty!(f64, D),
3058 green: fidl::new_empty!(f64, D),
3059 blue: fidl::new_empty!(f64, D),
3060 }
3061 }
3062
3063 #[inline]
3064 unsafe fn decode(
3065 &mut self,
3066 decoder: &mut fidl::encoding::Decoder<'_, D>,
3067 offset: usize,
3068 _depth: fidl::encoding::Depth,
3069 ) -> fidl::Result<()> {
3070 decoder.debug_check_bounds::<Self>(offset);
3071 fidl::decode!(f64, D, &mut self.red, decoder, offset + 0, _depth)?;
3073 fidl::decode!(f64, D, &mut self.green, decoder, offset + 8, _depth)?;
3074 fidl::decode!(f64, D, &mut self.blue, decoder, offset + 16, _depth)?;
3075 Ok(())
3076 }
3077 }
3078
3079 impl Config {
3080 #[inline(always)]
3081 fn max_ordinal_present(&self) -> u64 {
3082 if let Some(_) = self.group_id {
3083 return 5;
3084 }
3085 if let Some(_) = self.init_on {
3086 return 4;
3087 }
3088 if let Some(_) = self.rgb {
3089 return 3;
3090 }
3091 if let Some(_) = self.brightness {
3092 return 2;
3093 }
3094 if let Some(_) = self.name {
3095 return 1;
3096 }
3097 0
3098 }
3099 }
3100
3101 impl fidl::encoding::ValueTypeMarker for Config {
3102 type Borrowed<'a> = &'a Self;
3103 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3104 value
3105 }
3106 }
3107
3108 unsafe impl fidl::encoding::TypeMarker for Config {
3109 type Owned = Self;
3110
3111 #[inline(always)]
3112 fn inline_align(_context: fidl::encoding::Context) -> usize {
3113 8
3114 }
3115
3116 #[inline(always)]
3117 fn inline_size(_context: fidl::encoding::Context) -> usize {
3118 16
3119 }
3120 }
3121
3122 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
3123 unsafe fn encode(
3124 self,
3125 encoder: &mut fidl::encoding::Encoder<'_, D>,
3126 offset: usize,
3127 mut depth: fidl::encoding::Depth,
3128 ) -> fidl::Result<()> {
3129 encoder.debug_check_bounds::<Config>(offset);
3130 let max_ordinal: u64 = self.max_ordinal_present();
3132 encoder.write_num(max_ordinal, offset);
3133 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3134 if max_ordinal == 0 {
3136 return Ok(());
3137 }
3138 depth.increment()?;
3139 let envelope_size = 8;
3140 let bytes_len = max_ordinal as usize * envelope_size;
3141 #[allow(unused_variables)]
3142 let offset = encoder.out_of_line_offset(bytes_len);
3143 let mut _prev_end_offset: usize = 0;
3144 if 1 > max_ordinal {
3145 return Ok(());
3146 }
3147
3148 let cur_offset: usize = (1 - 1) * envelope_size;
3151
3152 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3154
3155 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
3160 self.name.as_ref().map(
3161 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3162 ),
3163 encoder,
3164 offset + cur_offset,
3165 depth,
3166 )?;
3167
3168 _prev_end_offset = cur_offset + envelope_size;
3169 if 2 > max_ordinal {
3170 return Ok(());
3171 }
3172
3173 let cur_offset: usize = (2 - 1) * envelope_size;
3176
3177 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3179
3180 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3185 self.brightness.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3186 encoder,
3187 offset + cur_offset,
3188 depth,
3189 )?;
3190
3191 _prev_end_offset = cur_offset + envelope_size;
3192 if 3 > max_ordinal {
3193 return Ok(());
3194 }
3195
3196 let cur_offset: usize = (3 - 1) * envelope_size;
3199
3200 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3202
3203 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3208 self.rgb.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3209 encoder,
3210 offset + cur_offset,
3211 depth,
3212 )?;
3213
3214 _prev_end_offset = cur_offset + envelope_size;
3215 if 4 > max_ordinal {
3216 return Ok(());
3217 }
3218
3219 let cur_offset: usize = (4 - 1) * envelope_size;
3222
3223 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3225
3226 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3231 self.init_on.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3232 encoder,
3233 offset + cur_offset,
3234 depth,
3235 )?;
3236
3237 _prev_end_offset = cur_offset + envelope_size;
3238 if 5 > max_ordinal {
3239 return Ok(());
3240 }
3241
3242 let cur_offset: usize = (5 - 1) * envelope_size;
3245
3246 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3248
3249 fidl::encoding::encode_in_envelope_optional::<i32, D>(
3254 self.group_id.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
3255 encoder,
3256 offset + cur_offset,
3257 depth,
3258 )?;
3259
3260 _prev_end_offset = cur_offset + envelope_size;
3261
3262 Ok(())
3263 }
3264 }
3265
3266 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
3267 #[inline(always)]
3268 fn new_empty() -> Self {
3269 Self::default()
3270 }
3271
3272 unsafe fn decode(
3273 &mut self,
3274 decoder: &mut fidl::encoding::Decoder<'_, D>,
3275 offset: usize,
3276 mut depth: fidl::encoding::Depth,
3277 ) -> fidl::Result<()> {
3278 decoder.debug_check_bounds::<Self>(offset);
3279 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3280 None => return Err(fidl::Error::NotNullable),
3281 Some(len) => len,
3282 };
3283 if len == 0 {
3285 return Ok(());
3286 };
3287 depth.increment()?;
3288 let envelope_size = 8;
3289 let bytes_len = len * envelope_size;
3290 let offset = decoder.out_of_line_offset(bytes_len)?;
3291 let mut _next_ordinal_to_read = 0;
3293 let mut next_offset = offset;
3294 let end_offset = offset + bytes_len;
3295 _next_ordinal_to_read += 1;
3296 if next_offset >= end_offset {
3297 return Ok(());
3298 }
3299
3300 while _next_ordinal_to_read < 1 {
3302 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3303 _next_ordinal_to_read += 1;
3304 next_offset += envelope_size;
3305 }
3306
3307 let next_out_of_line = decoder.next_out_of_line();
3308 let handles_before = decoder.remaining_handles();
3309 if let Some((inlined, num_bytes, num_handles)) =
3310 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3311 {
3312 let member_inline_size =
3313 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3314 decoder.context,
3315 );
3316 if inlined != (member_inline_size <= 4) {
3317 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3318 }
3319 let inner_offset;
3320 let mut inner_depth = depth.clone();
3321 if inlined {
3322 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3323 inner_offset = next_offset;
3324 } else {
3325 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3326 inner_depth.increment()?;
3327 }
3328 let val_ref = self
3329 .name
3330 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
3331 fidl::decode!(
3332 fidl::encoding::UnboundedString,
3333 D,
3334 val_ref,
3335 decoder,
3336 inner_offset,
3337 inner_depth
3338 )?;
3339 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3340 {
3341 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3342 }
3343 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3344 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3345 }
3346 }
3347
3348 next_offset += envelope_size;
3349 _next_ordinal_to_read += 1;
3350 if next_offset >= end_offset {
3351 return Ok(());
3352 }
3353
3354 while _next_ordinal_to_read < 2 {
3356 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3357 _next_ordinal_to_read += 1;
3358 next_offset += envelope_size;
3359 }
3360
3361 let next_out_of_line = decoder.next_out_of_line();
3362 let handles_before = decoder.remaining_handles();
3363 if let Some((inlined, num_bytes, num_handles)) =
3364 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3365 {
3366 let member_inline_size =
3367 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3368 if inlined != (member_inline_size <= 4) {
3369 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3370 }
3371 let inner_offset;
3372 let mut inner_depth = depth.clone();
3373 if inlined {
3374 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3375 inner_offset = next_offset;
3376 } else {
3377 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3378 inner_depth.increment()?;
3379 }
3380 let val_ref = self.brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
3381 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3382 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3383 {
3384 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3385 }
3386 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3387 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3388 }
3389 }
3390
3391 next_offset += envelope_size;
3392 _next_ordinal_to_read += 1;
3393 if next_offset >= end_offset {
3394 return Ok(());
3395 }
3396
3397 while _next_ordinal_to_read < 3 {
3399 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3400 _next_ordinal_to_read += 1;
3401 next_offset += envelope_size;
3402 }
3403
3404 let next_out_of_line = decoder.next_out_of_line();
3405 let handles_before = decoder.remaining_handles();
3406 if let Some((inlined, num_bytes, num_handles)) =
3407 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3408 {
3409 let member_inline_size =
3410 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3411 if inlined != (member_inline_size <= 4) {
3412 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3413 }
3414 let inner_offset;
3415 let mut inner_depth = depth.clone();
3416 if inlined {
3417 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3418 inner_offset = next_offset;
3419 } else {
3420 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3421 inner_depth.increment()?;
3422 }
3423 let val_ref = self.rgb.get_or_insert_with(|| fidl::new_empty!(bool, D));
3424 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3425 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3426 {
3427 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3428 }
3429 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3430 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3431 }
3432 }
3433
3434 next_offset += envelope_size;
3435 _next_ordinal_to_read += 1;
3436 if next_offset >= end_offset {
3437 return Ok(());
3438 }
3439
3440 while _next_ordinal_to_read < 4 {
3442 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3443 _next_ordinal_to_read += 1;
3444 next_offset += envelope_size;
3445 }
3446
3447 let next_out_of_line = decoder.next_out_of_line();
3448 let handles_before = decoder.remaining_handles();
3449 if let Some((inlined, num_bytes, num_handles)) =
3450 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3451 {
3452 let member_inline_size =
3453 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3454 if inlined != (member_inline_size <= 4) {
3455 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3456 }
3457 let inner_offset;
3458 let mut inner_depth = depth.clone();
3459 if inlined {
3460 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3461 inner_offset = next_offset;
3462 } else {
3463 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3464 inner_depth.increment()?;
3465 }
3466 let val_ref = self.init_on.get_or_insert_with(|| fidl::new_empty!(bool, D));
3467 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3468 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3469 {
3470 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3471 }
3472 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3473 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3474 }
3475 }
3476
3477 next_offset += envelope_size;
3478 _next_ordinal_to_read += 1;
3479 if next_offset >= end_offset {
3480 return Ok(());
3481 }
3482
3483 while _next_ordinal_to_read < 5 {
3485 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3486 _next_ordinal_to_read += 1;
3487 next_offset += envelope_size;
3488 }
3489
3490 let next_out_of_line = decoder.next_out_of_line();
3491 let handles_before = decoder.remaining_handles();
3492 if let Some((inlined, num_bytes, num_handles)) =
3493 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3494 {
3495 let member_inline_size =
3496 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3497 if inlined != (member_inline_size <= 4) {
3498 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3499 }
3500 let inner_offset;
3501 let mut inner_depth = depth.clone();
3502 if inlined {
3503 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3504 inner_offset = next_offset;
3505 } else {
3506 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3507 inner_depth.increment()?;
3508 }
3509 let val_ref = self.group_id.get_or_insert_with(|| fidl::new_empty!(i32, D));
3510 fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
3511 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3512 {
3513 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3514 }
3515 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3516 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3517 }
3518 }
3519
3520 next_offset += envelope_size;
3521
3522 while next_offset < end_offset {
3524 _next_ordinal_to_read += 1;
3525 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3526 next_offset += envelope_size;
3527 }
3528
3529 Ok(())
3530 }
3531 }
3532
3533 impl Metadata {
3534 #[inline(always)]
3535 fn max_ordinal_present(&self) -> u64 {
3536 if let Some(_) = self.configs {
3537 return 1;
3538 }
3539 0
3540 }
3541 }
3542
3543 impl fidl::encoding::ValueTypeMarker for Metadata {
3544 type Borrowed<'a> = &'a Self;
3545 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3546 value
3547 }
3548 }
3549
3550 unsafe impl fidl::encoding::TypeMarker for Metadata {
3551 type Owned = Self;
3552
3553 #[inline(always)]
3554 fn inline_align(_context: fidl::encoding::Context) -> usize {
3555 8
3556 }
3557
3558 #[inline(always)]
3559 fn inline_size(_context: fidl::encoding::Context) -> usize {
3560 16
3561 }
3562 }
3563
3564 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
3565 unsafe fn encode(
3566 self,
3567 encoder: &mut fidl::encoding::Encoder<'_, D>,
3568 offset: usize,
3569 mut depth: fidl::encoding::Depth,
3570 ) -> fidl::Result<()> {
3571 encoder.debug_check_bounds::<Metadata>(offset);
3572 let max_ordinal: u64 = self.max_ordinal_present();
3574 encoder.write_num(max_ordinal, offset);
3575 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3576 if max_ordinal == 0 {
3578 return Ok(());
3579 }
3580 depth.increment()?;
3581 let envelope_size = 8;
3582 let bytes_len = max_ordinal as usize * envelope_size;
3583 #[allow(unused_variables)]
3584 let offset = encoder.out_of_line_offset(bytes_len);
3585 let mut _prev_end_offset: usize = 0;
3586 if 1 > max_ordinal {
3587 return Ok(());
3588 }
3589
3590 let cur_offset: usize = (1 - 1) * envelope_size;
3593
3594 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3596
3597 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Config>, D>(
3602 self.configs.as_ref().map(<fidl::encoding::UnboundedVector<Config> as fidl::encoding::ValueTypeMarker>::borrow),
3603 encoder, offset + cur_offset, depth
3604 )?;
3605
3606 _prev_end_offset = cur_offset + envelope_size;
3607
3608 Ok(())
3609 }
3610 }
3611
3612 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
3613 #[inline(always)]
3614 fn new_empty() -> Self {
3615 Self::default()
3616 }
3617
3618 unsafe fn decode(
3619 &mut self,
3620 decoder: &mut fidl::encoding::Decoder<'_, D>,
3621 offset: usize,
3622 mut depth: fidl::encoding::Depth,
3623 ) -> fidl::Result<()> {
3624 decoder.debug_check_bounds::<Self>(offset);
3625 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3626 None => return Err(fidl::Error::NotNullable),
3627 Some(len) => len,
3628 };
3629 if len == 0 {
3631 return Ok(());
3632 };
3633 depth.increment()?;
3634 let envelope_size = 8;
3635 let bytes_len = len * envelope_size;
3636 let offset = decoder.out_of_line_offset(bytes_len)?;
3637 let mut _next_ordinal_to_read = 0;
3639 let mut next_offset = offset;
3640 let end_offset = offset + bytes_len;
3641 _next_ordinal_to_read += 1;
3642 if next_offset >= end_offset {
3643 return Ok(());
3644 }
3645
3646 while _next_ordinal_to_read < 1 {
3648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3649 _next_ordinal_to_read += 1;
3650 next_offset += envelope_size;
3651 }
3652
3653 let next_out_of_line = decoder.next_out_of_line();
3654 let handles_before = decoder.remaining_handles();
3655 if let Some((inlined, num_bytes, num_handles)) =
3656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3657 {
3658 let member_inline_size = <fidl::encoding::UnboundedVector<Config> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3659 if inlined != (member_inline_size <= 4) {
3660 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3661 }
3662 let inner_offset;
3663 let mut inner_depth = depth.clone();
3664 if inlined {
3665 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3666 inner_offset = next_offset;
3667 } else {
3668 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3669 inner_depth.increment()?;
3670 }
3671 let val_ref = self.configs.get_or_insert_with(|| {
3672 fidl::new_empty!(fidl::encoding::UnboundedVector<Config>, D)
3673 });
3674 fidl::decode!(
3675 fidl::encoding::UnboundedVector<Config>,
3676 D,
3677 val_ref,
3678 decoder,
3679 inner_offset,
3680 inner_depth
3681 )?;
3682 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3683 {
3684 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3685 }
3686 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3687 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3688 }
3689 }
3690
3691 next_offset += envelope_size;
3692
3693 while next_offset < end_offset {
3695 _next_ordinal_to_read += 1;
3696 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3697 next_offset += envelope_size;
3698 }
3699
3700 Ok(())
3701 }
3702 }
3703}