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 type Brightness = f32;
14
15#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
18pub struct BrightnessPoint {
19 pub ambient_lux: f32,
20 pub display_nits: f32,
21}
22
23impl fidl::Persistable for BrightnessPoint {}
24
25#[derive(Clone, Debug, PartialEq, PartialOrd)]
28pub struct BrightnessTable {
29 pub points: Vec<BrightnessPoint>,
30}
31
32impl fidl::Persistable for BrightnessTable {}
33
34#[derive(Clone, Debug, PartialEq)]
35pub struct ColorAdjustmentHandlerSetColorAdjustmentRequest {
36 pub color_adjustment: ColorAdjustmentTable,
37}
38
39impl fidl::Persistable for ColorAdjustmentHandlerSetColorAdjustmentRequest {}
40
41#[derive(Clone, Debug, PartialEq)]
42pub struct ColorAdjustmentSetDiscreteColorAdjustmentRequest {
43 pub color_adjustment: ColorAdjustmentTable,
44}
45
46impl fidl::Persistable for ColorAdjustmentSetDiscreteColorAdjustmentRequest {}
47
48#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
49pub struct ControlSetAutoBrightnessAdjustmentRequest {
50 pub adjustment: f32,
51}
52
53impl fidl::Persistable for ControlSetAutoBrightnessAdjustmentRequest {}
54
55#[derive(Clone, Debug, PartialEq, PartialOrd)]
56pub struct ControlSetBrightnessTableRequest {
57 pub table: BrightnessTable,
58}
59
60impl fidl::Persistable for ControlSetBrightnessTableRequest {}
61
62#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
63pub struct ControlSetManualBrightnessRequest {
64 pub value: f32,
65}
66
67impl fidl::Persistable for ControlSetManualBrightnessRequest {}
68
69#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
70pub struct ControlSetManualBrightnessSmoothRequest {
71 pub value: f32,
72 pub duration: i64,
73}
74
75impl fidl::Persistable for ControlSetManualBrightnessSmoothRequest {}
76
77#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
78pub struct ControlWatchAutoBrightnessAdjustmentResponse {
79 pub adjustment: f32,
80}
81
82impl fidl::Persistable for ControlWatchAutoBrightnessAdjustmentResponse {}
83
84#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct ControlWatchAutoBrightnessResponse {
86 pub enabled: bool,
87}
88
89impl fidl::Persistable for ControlWatchAutoBrightnessResponse {}
90
91#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
92pub struct ControlWatchCurrentBrightnessResponse {
93 pub value: f32,
94}
95
96impl fidl::Persistable for ControlWatchCurrentBrightnessResponse {}
97
98#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
99pub struct ControlGetMaxAbsoluteBrightnessResponse {
100 pub max_brightness: f64,
101}
102
103impl fidl::Persistable for ControlGetMaxAbsoluteBrightnessResponse {}
104
105#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
106pub struct ReaderGetMaxAbsoluteBrightnessResponse {
107 pub max_brightness: f64,
108}
109
110impl fidl::Persistable for ReaderGetMaxAbsoluteBrightnessResponse {}
111
112#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
113pub struct ReaderWatchAutoBrightnessAdjustmentResponse {
114 pub adjustment: f32,
115}
116
117impl fidl::Persistable for ReaderWatchAutoBrightnessAdjustmentResponse {}
118
119#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
120pub struct ReaderWatchAutoBrightnessResponse {
121 pub enabled: bool,
122}
123
124impl fidl::Persistable for ReaderWatchAutoBrightnessResponse {}
125
126#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
127pub struct ReaderWatchCurrentBrightnessResponse {
128 pub value: f32,
129}
130
131impl fidl::Persistable for ReaderWatchCurrentBrightnessResponse {}
132
133#[derive(Clone, Debug, Default, PartialEq)]
135pub struct ColorAdjustmentTable {
136 pub matrix: Option<[f32; 9]>,
140 #[doc(hidden)]
141 pub __source_breaking: fidl::marker::SourceBreaking,
142}
143
144impl fidl::Persistable for ColorAdjustmentTable {}
145
146pub mod color_adjustment_ordinals {
147 pub const SET_DISCRETE_COLOR_ADJUSTMENT: u64 = 0x48d90d2e62d451c4;
148}
149
150pub mod color_adjustment_handler_ordinals {
151 pub const SET_COLOR_ADJUSTMENT: u64 = 0x6277992fee8aea3d;
152}
153
154pub mod control_ordinals {
155 pub const SET_AUTO_BRIGHTNESS: u64 = 0x46b623a7fa77a979;
156 pub const WATCH_AUTO_BRIGHTNESS: u64 = 0xd956a90c115186b;
157 pub const SET_MANUAL_BRIGHTNESS: u64 = 0x1e333aa49771e1eb;
158 pub const SET_MANUAL_BRIGHTNESS_SMOOTH: u64 = 0x7b7d273c20a61d0c;
159 pub const WATCH_CURRENT_BRIGHTNESS: u64 = 0x2cc3011e2326d4d8;
160 pub const SET_AUTO_BRIGHTNESS_ADJUSTMENT: u64 = 0x678ee26bc217d996;
161 pub const WATCH_AUTO_BRIGHTNESS_ADJUSTMENT: u64 = 0x7c373aafe0058135;
162 pub const SET_BRIGHTNESS_TABLE: u64 = 0x11d419413129dcee;
163 pub const GET_MAX_ABSOLUTE_BRIGHTNESS: u64 = 0x73055a8d6422caf8;
164}
165
166pub mod reader_ordinals {
167 pub const WATCH_AUTO_BRIGHTNESS: u64 = 0x2340adb613c927fe;
168 pub const WATCH_CURRENT_BRIGHTNESS: u64 = 0x261947be9be0c158;
169 pub const WATCH_AUTO_BRIGHTNESS_ADJUSTMENT: u64 = 0x63843519b3bc0f41;
170 pub const GET_MAX_ABSOLUTE_BRIGHTNESS: u64 = 0x27070157807d6424;
171}
172
173mod internal {
174 use super::*;
175
176 impl fidl::encoding::ValueTypeMarker for BrightnessPoint {
177 type Borrowed<'a> = &'a Self;
178 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
179 value
180 }
181 }
182
183 unsafe impl fidl::encoding::TypeMarker for BrightnessPoint {
184 type Owned = Self;
185
186 #[inline(always)]
187 fn inline_align(_context: fidl::encoding::Context) -> usize {
188 4
189 }
190
191 #[inline(always)]
192 fn inline_size(_context: fidl::encoding::Context) -> usize {
193 8
194 }
195 }
196
197 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BrightnessPoint, D>
198 for &BrightnessPoint
199 {
200 #[inline]
201 unsafe fn encode(
202 self,
203 encoder: &mut fidl::encoding::Encoder<'_, D>,
204 offset: usize,
205 _depth: fidl::encoding::Depth,
206 ) -> fidl::Result<()> {
207 encoder.debug_check_bounds::<BrightnessPoint>(offset);
208 fidl::encoding::Encode::<BrightnessPoint, D>::encode(
210 (
211 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.ambient_lux),
212 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.display_nits),
213 ),
214 encoder,
215 offset,
216 _depth,
217 )
218 }
219 }
220 unsafe impl<
221 D: fidl::encoding::ResourceDialect,
222 T0: fidl::encoding::Encode<f32, D>,
223 T1: fidl::encoding::Encode<f32, D>,
224 > fidl::encoding::Encode<BrightnessPoint, D> for (T0, T1)
225 {
226 #[inline]
227 unsafe fn encode(
228 self,
229 encoder: &mut fidl::encoding::Encoder<'_, D>,
230 offset: usize,
231 depth: fidl::encoding::Depth,
232 ) -> fidl::Result<()> {
233 encoder.debug_check_bounds::<BrightnessPoint>(offset);
234 self.0.encode(encoder, offset + 0, depth)?;
238 self.1.encode(encoder, offset + 4, depth)?;
239 Ok(())
240 }
241 }
242
243 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrightnessPoint {
244 #[inline(always)]
245 fn new_empty() -> Self {
246 Self { ambient_lux: fidl::new_empty!(f32, D), display_nits: fidl::new_empty!(f32, D) }
247 }
248
249 #[inline]
250 unsafe fn decode(
251 &mut self,
252 decoder: &mut fidl::encoding::Decoder<'_, D>,
253 offset: usize,
254 _depth: fidl::encoding::Depth,
255 ) -> fidl::Result<()> {
256 decoder.debug_check_bounds::<Self>(offset);
257 fidl::decode!(f32, D, &mut self.ambient_lux, decoder, offset + 0, _depth)?;
259 fidl::decode!(f32, D, &mut self.display_nits, decoder, offset + 4, _depth)?;
260 Ok(())
261 }
262 }
263
264 impl fidl::encoding::ValueTypeMarker for BrightnessTable {
265 type Borrowed<'a> = &'a Self;
266 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
267 value
268 }
269 }
270
271 unsafe impl fidl::encoding::TypeMarker for BrightnessTable {
272 type Owned = Self;
273
274 #[inline(always)]
275 fn inline_align(_context: fidl::encoding::Context) -> usize {
276 8
277 }
278
279 #[inline(always)]
280 fn inline_size(_context: fidl::encoding::Context) -> usize {
281 16
282 }
283 }
284
285 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BrightnessTable, D>
286 for &BrightnessTable
287 {
288 #[inline]
289 unsafe fn encode(
290 self,
291 encoder: &mut fidl::encoding::Encoder<'_, D>,
292 offset: usize,
293 _depth: fidl::encoding::Depth,
294 ) -> fidl::Result<()> {
295 encoder.debug_check_bounds::<BrightnessTable>(offset);
296 fidl::encoding::Encode::<BrightnessTable, D>::encode(
298 (
299 <fidl::encoding::Vector<BrightnessPoint, 50> as fidl::encoding::ValueTypeMarker>::borrow(&self.points),
300 ),
301 encoder, offset, _depth
302 )
303 }
304 }
305 unsafe impl<
306 D: fidl::encoding::ResourceDialect,
307 T0: fidl::encoding::Encode<fidl::encoding::Vector<BrightnessPoint, 50>, D>,
308 > fidl::encoding::Encode<BrightnessTable, D> for (T0,)
309 {
310 #[inline]
311 unsafe fn encode(
312 self,
313 encoder: &mut fidl::encoding::Encoder<'_, D>,
314 offset: usize,
315 depth: fidl::encoding::Depth,
316 ) -> fidl::Result<()> {
317 encoder.debug_check_bounds::<BrightnessTable>(offset);
318 self.0.encode(encoder, offset + 0, depth)?;
322 Ok(())
323 }
324 }
325
326 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrightnessTable {
327 #[inline(always)]
328 fn new_empty() -> Self {
329 Self { points: fidl::new_empty!(fidl::encoding::Vector<BrightnessPoint, 50>, D) }
330 }
331
332 #[inline]
333 unsafe fn decode(
334 &mut self,
335 decoder: &mut fidl::encoding::Decoder<'_, D>,
336 offset: usize,
337 _depth: fidl::encoding::Depth,
338 ) -> fidl::Result<()> {
339 decoder.debug_check_bounds::<Self>(offset);
340 fidl::decode!(fidl::encoding::Vector<BrightnessPoint, 50>, D, &mut self.points, decoder, offset + 0, _depth)?;
342 Ok(())
343 }
344 }
345
346 impl fidl::encoding::ValueTypeMarker for ColorAdjustmentHandlerSetColorAdjustmentRequest {
347 type Borrowed<'a> = &'a Self;
348 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
349 value
350 }
351 }
352
353 unsafe impl fidl::encoding::TypeMarker for ColorAdjustmentHandlerSetColorAdjustmentRequest {
354 type Owned = Self;
355
356 #[inline(always)]
357 fn inline_align(_context: fidl::encoding::Context) -> usize {
358 8
359 }
360
361 #[inline(always)]
362 fn inline_size(_context: fidl::encoding::Context) -> usize {
363 16
364 }
365 }
366
367 unsafe impl<D: fidl::encoding::ResourceDialect>
368 fidl::encoding::Encode<ColorAdjustmentHandlerSetColorAdjustmentRequest, D>
369 for &ColorAdjustmentHandlerSetColorAdjustmentRequest
370 {
371 #[inline]
372 unsafe fn encode(
373 self,
374 encoder: &mut fidl::encoding::Encoder<'_, D>,
375 offset: usize,
376 _depth: fidl::encoding::Depth,
377 ) -> fidl::Result<()> {
378 encoder.debug_check_bounds::<ColorAdjustmentHandlerSetColorAdjustmentRequest>(offset);
379 fidl::encoding::Encode::<ColorAdjustmentHandlerSetColorAdjustmentRequest, D>::encode(
381 (<ColorAdjustmentTable as fidl::encoding::ValueTypeMarker>::borrow(
382 &self.color_adjustment,
383 ),),
384 encoder,
385 offset,
386 _depth,
387 )
388 }
389 }
390 unsafe impl<
391 D: fidl::encoding::ResourceDialect,
392 T0: fidl::encoding::Encode<ColorAdjustmentTable, D>,
393 > fidl::encoding::Encode<ColorAdjustmentHandlerSetColorAdjustmentRequest, D> for (T0,)
394 {
395 #[inline]
396 unsafe fn encode(
397 self,
398 encoder: &mut fidl::encoding::Encoder<'_, D>,
399 offset: usize,
400 depth: fidl::encoding::Depth,
401 ) -> fidl::Result<()> {
402 encoder.debug_check_bounds::<ColorAdjustmentHandlerSetColorAdjustmentRequest>(offset);
403 self.0.encode(encoder, offset + 0, depth)?;
407 Ok(())
408 }
409 }
410
411 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
412 for ColorAdjustmentHandlerSetColorAdjustmentRequest
413 {
414 #[inline(always)]
415 fn new_empty() -> Self {
416 Self { color_adjustment: fidl::new_empty!(ColorAdjustmentTable, D) }
417 }
418
419 #[inline]
420 unsafe fn decode(
421 &mut self,
422 decoder: &mut fidl::encoding::Decoder<'_, D>,
423 offset: usize,
424 _depth: fidl::encoding::Depth,
425 ) -> fidl::Result<()> {
426 decoder.debug_check_bounds::<Self>(offset);
427 fidl::decode!(
429 ColorAdjustmentTable,
430 D,
431 &mut self.color_adjustment,
432 decoder,
433 offset + 0,
434 _depth
435 )?;
436 Ok(())
437 }
438 }
439
440 impl fidl::encoding::ValueTypeMarker for ColorAdjustmentSetDiscreteColorAdjustmentRequest {
441 type Borrowed<'a> = &'a Self;
442 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
443 value
444 }
445 }
446
447 unsafe impl fidl::encoding::TypeMarker for ColorAdjustmentSetDiscreteColorAdjustmentRequest {
448 type Owned = Self;
449
450 #[inline(always)]
451 fn inline_align(_context: fidl::encoding::Context) -> usize {
452 8
453 }
454
455 #[inline(always)]
456 fn inline_size(_context: fidl::encoding::Context) -> usize {
457 16
458 }
459 }
460
461 unsafe impl<D: fidl::encoding::ResourceDialect>
462 fidl::encoding::Encode<ColorAdjustmentSetDiscreteColorAdjustmentRequest, D>
463 for &ColorAdjustmentSetDiscreteColorAdjustmentRequest
464 {
465 #[inline]
466 unsafe fn encode(
467 self,
468 encoder: &mut fidl::encoding::Encoder<'_, D>,
469 offset: usize,
470 _depth: fidl::encoding::Depth,
471 ) -> fidl::Result<()> {
472 encoder.debug_check_bounds::<ColorAdjustmentSetDiscreteColorAdjustmentRequest>(offset);
473 fidl::encoding::Encode::<ColorAdjustmentSetDiscreteColorAdjustmentRequest, D>::encode(
475 (<ColorAdjustmentTable as fidl::encoding::ValueTypeMarker>::borrow(
476 &self.color_adjustment,
477 ),),
478 encoder,
479 offset,
480 _depth,
481 )
482 }
483 }
484 unsafe impl<
485 D: fidl::encoding::ResourceDialect,
486 T0: fidl::encoding::Encode<ColorAdjustmentTable, D>,
487 > fidl::encoding::Encode<ColorAdjustmentSetDiscreteColorAdjustmentRequest, D> for (T0,)
488 {
489 #[inline]
490 unsafe fn encode(
491 self,
492 encoder: &mut fidl::encoding::Encoder<'_, D>,
493 offset: usize,
494 depth: fidl::encoding::Depth,
495 ) -> fidl::Result<()> {
496 encoder.debug_check_bounds::<ColorAdjustmentSetDiscreteColorAdjustmentRequest>(offset);
497 self.0.encode(encoder, offset + 0, depth)?;
501 Ok(())
502 }
503 }
504
505 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
506 for ColorAdjustmentSetDiscreteColorAdjustmentRequest
507 {
508 #[inline(always)]
509 fn new_empty() -> Self {
510 Self { color_adjustment: fidl::new_empty!(ColorAdjustmentTable, D) }
511 }
512
513 #[inline]
514 unsafe fn decode(
515 &mut self,
516 decoder: &mut fidl::encoding::Decoder<'_, D>,
517 offset: usize,
518 _depth: fidl::encoding::Depth,
519 ) -> fidl::Result<()> {
520 decoder.debug_check_bounds::<Self>(offset);
521 fidl::decode!(
523 ColorAdjustmentTable,
524 D,
525 &mut self.color_adjustment,
526 decoder,
527 offset + 0,
528 _depth
529 )?;
530 Ok(())
531 }
532 }
533
534 impl fidl::encoding::ValueTypeMarker for ControlSetAutoBrightnessAdjustmentRequest {
535 type Borrowed<'a> = &'a Self;
536 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
537 value
538 }
539 }
540
541 unsafe impl fidl::encoding::TypeMarker for ControlSetAutoBrightnessAdjustmentRequest {
542 type Owned = Self;
543
544 #[inline(always)]
545 fn inline_align(_context: fidl::encoding::Context) -> usize {
546 4
547 }
548
549 #[inline(always)]
550 fn inline_size(_context: fidl::encoding::Context) -> usize {
551 4
552 }
553 }
554
555 unsafe impl<D: fidl::encoding::ResourceDialect>
556 fidl::encoding::Encode<ControlSetAutoBrightnessAdjustmentRequest, D>
557 for &ControlSetAutoBrightnessAdjustmentRequest
558 {
559 #[inline]
560 unsafe fn encode(
561 self,
562 encoder: &mut fidl::encoding::Encoder<'_, D>,
563 offset: usize,
564 _depth: fidl::encoding::Depth,
565 ) -> fidl::Result<()> {
566 encoder.debug_check_bounds::<ControlSetAutoBrightnessAdjustmentRequest>(offset);
567 fidl::encoding::Encode::<ControlSetAutoBrightnessAdjustmentRequest, D>::encode(
569 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.adjustment),),
570 encoder,
571 offset,
572 _depth,
573 )
574 }
575 }
576 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
577 fidl::encoding::Encode<ControlSetAutoBrightnessAdjustmentRequest, D> for (T0,)
578 {
579 #[inline]
580 unsafe fn encode(
581 self,
582 encoder: &mut fidl::encoding::Encoder<'_, D>,
583 offset: usize,
584 depth: fidl::encoding::Depth,
585 ) -> fidl::Result<()> {
586 encoder.debug_check_bounds::<ControlSetAutoBrightnessAdjustmentRequest>(offset);
587 self.0.encode(encoder, offset + 0, depth)?;
591 Ok(())
592 }
593 }
594
595 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
596 for ControlSetAutoBrightnessAdjustmentRequest
597 {
598 #[inline(always)]
599 fn new_empty() -> Self {
600 Self { adjustment: fidl::new_empty!(f32, D) }
601 }
602
603 #[inline]
604 unsafe fn decode(
605 &mut self,
606 decoder: &mut fidl::encoding::Decoder<'_, D>,
607 offset: usize,
608 _depth: fidl::encoding::Depth,
609 ) -> fidl::Result<()> {
610 decoder.debug_check_bounds::<Self>(offset);
611 fidl::decode!(f32, D, &mut self.adjustment, decoder, offset + 0, _depth)?;
613 Ok(())
614 }
615 }
616
617 impl fidl::encoding::ValueTypeMarker for ControlSetBrightnessTableRequest {
618 type Borrowed<'a> = &'a Self;
619 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
620 value
621 }
622 }
623
624 unsafe impl fidl::encoding::TypeMarker for ControlSetBrightnessTableRequest {
625 type Owned = Self;
626
627 #[inline(always)]
628 fn inline_align(_context: fidl::encoding::Context) -> usize {
629 8
630 }
631
632 #[inline(always)]
633 fn inline_size(_context: fidl::encoding::Context) -> usize {
634 16
635 }
636 }
637
638 unsafe impl<D: fidl::encoding::ResourceDialect>
639 fidl::encoding::Encode<ControlSetBrightnessTableRequest, D>
640 for &ControlSetBrightnessTableRequest
641 {
642 #[inline]
643 unsafe fn encode(
644 self,
645 encoder: &mut fidl::encoding::Encoder<'_, D>,
646 offset: usize,
647 _depth: fidl::encoding::Depth,
648 ) -> fidl::Result<()> {
649 encoder.debug_check_bounds::<ControlSetBrightnessTableRequest>(offset);
650 fidl::encoding::Encode::<ControlSetBrightnessTableRequest, D>::encode(
652 (<BrightnessTable as fidl::encoding::ValueTypeMarker>::borrow(&self.table),),
653 encoder,
654 offset,
655 _depth,
656 )
657 }
658 }
659 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BrightnessTable, D>>
660 fidl::encoding::Encode<ControlSetBrightnessTableRequest, D> for (T0,)
661 {
662 #[inline]
663 unsafe fn encode(
664 self,
665 encoder: &mut fidl::encoding::Encoder<'_, D>,
666 offset: usize,
667 depth: fidl::encoding::Depth,
668 ) -> fidl::Result<()> {
669 encoder.debug_check_bounds::<ControlSetBrightnessTableRequest>(offset);
670 self.0.encode(encoder, offset + 0, depth)?;
674 Ok(())
675 }
676 }
677
678 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
679 for ControlSetBrightnessTableRequest
680 {
681 #[inline(always)]
682 fn new_empty() -> Self {
683 Self { table: fidl::new_empty!(BrightnessTable, D) }
684 }
685
686 #[inline]
687 unsafe fn decode(
688 &mut self,
689 decoder: &mut fidl::encoding::Decoder<'_, D>,
690 offset: usize,
691 _depth: fidl::encoding::Depth,
692 ) -> fidl::Result<()> {
693 decoder.debug_check_bounds::<Self>(offset);
694 fidl::decode!(BrightnessTable, D, &mut self.table, decoder, offset + 0, _depth)?;
696 Ok(())
697 }
698 }
699
700 impl fidl::encoding::ValueTypeMarker for ControlSetManualBrightnessRequest {
701 type Borrowed<'a> = &'a Self;
702 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
703 value
704 }
705 }
706
707 unsafe impl fidl::encoding::TypeMarker for ControlSetManualBrightnessRequest {
708 type Owned = Self;
709
710 #[inline(always)]
711 fn inline_align(_context: fidl::encoding::Context) -> usize {
712 4
713 }
714
715 #[inline(always)]
716 fn inline_size(_context: fidl::encoding::Context) -> usize {
717 4
718 }
719 }
720
721 unsafe impl<D: fidl::encoding::ResourceDialect>
722 fidl::encoding::Encode<ControlSetManualBrightnessRequest, D>
723 for &ControlSetManualBrightnessRequest
724 {
725 #[inline]
726 unsafe fn encode(
727 self,
728 encoder: &mut fidl::encoding::Encoder<'_, D>,
729 offset: usize,
730 _depth: fidl::encoding::Depth,
731 ) -> fidl::Result<()> {
732 encoder.debug_check_bounds::<ControlSetManualBrightnessRequest>(offset);
733 fidl::encoding::Encode::<ControlSetManualBrightnessRequest, D>::encode(
735 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
736 encoder,
737 offset,
738 _depth,
739 )
740 }
741 }
742 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
743 fidl::encoding::Encode<ControlSetManualBrightnessRequest, D> for (T0,)
744 {
745 #[inline]
746 unsafe fn encode(
747 self,
748 encoder: &mut fidl::encoding::Encoder<'_, D>,
749 offset: usize,
750 depth: fidl::encoding::Depth,
751 ) -> fidl::Result<()> {
752 encoder.debug_check_bounds::<ControlSetManualBrightnessRequest>(offset);
753 self.0.encode(encoder, offset + 0, depth)?;
757 Ok(())
758 }
759 }
760
761 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
762 for ControlSetManualBrightnessRequest
763 {
764 #[inline(always)]
765 fn new_empty() -> Self {
766 Self { value: fidl::new_empty!(f32, D) }
767 }
768
769 #[inline]
770 unsafe fn decode(
771 &mut self,
772 decoder: &mut fidl::encoding::Decoder<'_, D>,
773 offset: usize,
774 _depth: fidl::encoding::Depth,
775 ) -> fidl::Result<()> {
776 decoder.debug_check_bounds::<Self>(offset);
777 fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
779 Ok(())
780 }
781 }
782
783 impl fidl::encoding::ValueTypeMarker for ControlSetManualBrightnessSmoothRequest {
784 type Borrowed<'a> = &'a Self;
785 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
786 value
787 }
788 }
789
790 unsafe impl fidl::encoding::TypeMarker for ControlSetManualBrightnessSmoothRequest {
791 type Owned = Self;
792
793 #[inline(always)]
794 fn inline_align(_context: fidl::encoding::Context) -> usize {
795 8
796 }
797
798 #[inline(always)]
799 fn inline_size(_context: fidl::encoding::Context) -> usize {
800 16
801 }
802 }
803
804 unsafe impl<D: fidl::encoding::ResourceDialect>
805 fidl::encoding::Encode<ControlSetManualBrightnessSmoothRequest, D>
806 for &ControlSetManualBrightnessSmoothRequest
807 {
808 #[inline]
809 unsafe fn encode(
810 self,
811 encoder: &mut fidl::encoding::Encoder<'_, D>,
812 offset: usize,
813 _depth: fidl::encoding::Depth,
814 ) -> fidl::Result<()> {
815 encoder.debug_check_bounds::<ControlSetManualBrightnessSmoothRequest>(offset);
816 fidl::encoding::Encode::<ControlSetManualBrightnessSmoothRequest, D>::encode(
818 (
819 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
820 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.duration),
821 ),
822 encoder,
823 offset,
824 _depth,
825 )
826 }
827 }
828 unsafe impl<
829 D: fidl::encoding::ResourceDialect,
830 T0: fidl::encoding::Encode<f32, D>,
831 T1: fidl::encoding::Encode<i64, D>,
832 > fidl::encoding::Encode<ControlSetManualBrightnessSmoothRequest, D> for (T0, T1)
833 {
834 #[inline]
835 unsafe fn encode(
836 self,
837 encoder: &mut fidl::encoding::Encoder<'_, D>,
838 offset: usize,
839 depth: fidl::encoding::Depth,
840 ) -> fidl::Result<()> {
841 encoder.debug_check_bounds::<ControlSetManualBrightnessSmoothRequest>(offset);
842 unsafe {
845 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
846 (ptr as *mut u64).write_unaligned(0);
847 }
848 self.0.encode(encoder, offset + 0, depth)?;
850 self.1.encode(encoder, offset + 8, depth)?;
851 Ok(())
852 }
853 }
854
855 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
856 for ControlSetManualBrightnessSmoothRequest
857 {
858 #[inline(always)]
859 fn new_empty() -> Self {
860 Self { value: fidl::new_empty!(f32, D), duration: fidl::new_empty!(i64, D) }
861 }
862
863 #[inline]
864 unsafe fn decode(
865 &mut self,
866 decoder: &mut fidl::encoding::Decoder<'_, D>,
867 offset: usize,
868 _depth: fidl::encoding::Depth,
869 ) -> fidl::Result<()> {
870 decoder.debug_check_bounds::<Self>(offset);
871 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
873 let padval = unsafe { (ptr as *const u64).read_unaligned() };
874 let mask = 0xffffffff00000000u64;
875 let maskedval = padval & mask;
876 if maskedval != 0 {
877 return Err(fidl::Error::NonZeroPadding {
878 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
879 });
880 }
881 fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
882 fidl::decode!(i64, D, &mut self.duration, decoder, offset + 8, _depth)?;
883 Ok(())
884 }
885 }
886
887 impl fidl::encoding::ValueTypeMarker for ControlWatchAutoBrightnessAdjustmentResponse {
888 type Borrowed<'a> = &'a Self;
889 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
890 value
891 }
892 }
893
894 unsafe impl fidl::encoding::TypeMarker for ControlWatchAutoBrightnessAdjustmentResponse {
895 type Owned = Self;
896
897 #[inline(always)]
898 fn inline_align(_context: fidl::encoding::Context) -> usize {
899 4
900 }
901
902 #[inline(always)]
903 fn inline_size(_context: fidl::encoding::Context) -> usize {
904 4
905 }
906 }
907
908 unsafe impl<D: fidl::encoding::ResourceDialect>
909 fidl::encoding::Encode<ControlWatchAutoBrightnessAdjustmentResponse, D>
910 for &ControlWatchAutoBrightnessAdjustmentResponse
911 {
912 #[inline]
913 unsafe fn encode(
914 self,
915 encoder: &mut fidl::encoding::Encoder<'_, D>,
916 offset: usize,
917 _depth: fidl::encoding::Depth,
918 ) -> fidl::Result<()> {
919 encoder.debug_check_bounds::<ControlWatchAutoBrightnessAdjustmentResponse>(offset);
920 fidl::encoding::Encode::<ControlWatchAutoBrightnessAdjustmentResponse, D>::encode(
922 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.adjustment),),
923 encoder,
924 offset,
925 _depth,
926 )
927 }
928 }
929 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
930 fidl::encoding::Encode<ControlWatchAutoBrightnessAdjustmentResponse, D> for (T0,)
931 {
932 #[inline]
933 unsafe fn encode(
934 self,
935 encoder: &mut fidl::encoding::Encoder<'_, D>,
936 offset: usize,
937 depth: fidl::encoding::Depth,
938 ) -> fidl::Result<()> {
939 encoder.debug_check_bounds::<ControlWatchAutoBrightnessAdjustmentResponse>(offset);
940 self.0.encode(encoder, offset + 0, depth)?;
944 Ok(())
945 }
946 }
947
948 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
949 for ControlWatchAutoBrightnessAdjustmentResponse
950 {
951 #[inline(always)]
952 fn new_empty() -> Self {
953 Self { adjustment: fidl::new_empty!(f32, D) }
954 }
955
956 #[inline]
957 unsafe fn decode(
958 &mut self,
959 decoder: &mut fidl::encoding::Decoder<'_, D>,
960 offset: usize,
961 _depth: fidl::encoding::Depth,
962 ) -> fidl::Result<()> {
963 decoder.debug_check_bounds::<Self>(offset);
964 fidl::decode!(f32, D, &mut self.adjustment, decoder, offset + 0, _depth)?;
966 Ok(())
967 }
968 }
969
970 impl fidl::encoding::ValueTypeMarker for ControlWatchAutoBrightnessResponse {
971 type Borrowed<'a> = &'a Self;
972 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
973 value
974 }
975 }
976
977 unsafe impl fidl::encoding::TypeMarker for ControlWatchAutoBrightnessResponse {
978 type Owned = Self;
979
980 #[inline(always)]
981 fn inline_align(_context: fidl::encoding::Context) -> usize {
982 1
983 }
984
985 #[inline(always)]
986 fn inline_size(_context: fidl::encoding::Context) -> usize {
987 1
988 }
989 }
990
991 unsafe impl<D: fidl::encoding::ResourceDialect>
992 fidl::encoding::Encode<ControlWatchAutoBrightnessResponse, D>
993 for &ControlWatchAutoBrightnessResponse
994 {
995 #[inline]
996 unsafe fn encode(
997 self,
998 encoder: &mut fidl::encoding::Encoder<'_, D>,
999 offset: usize,
1000 _depth: fidl::encoding::Depth,
1001 ) -> fidl::Result<()> {
1002 encoder.debug_check_bounds::<ControlWatchAutoBrightnessResponse>(offset);
1003 fidl::encoding::Encode::<ControlWatchAutoBrightnessResponse, D>::encode(
1005 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1006 encoder,
1007 offset,
1008 _depth,
1009 )
1010 }
1011 }
1012 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1013 fidl::encoding::Encode<ControlWatchAutoBrightnessResponse, D> for (T0,)
1014 {
1015 #[inline]
1016 unsafe fn encode(
1017 self,
1018 encoder: &mut fidl::encoding::Encoder<'_, D>,
1019 offset: usize,
1020 depth: fidl::encoding::Depth,
1021 ) -> fidl::Result<()> {
1022 encoder.debug_check_bounds::<ControlWatchAutoBrightnessResponse>(offset);
1023 self.0.encode(encoder, offset + 0, depth)?;
1027 Ok(())
1028 }
1029 }
1030
1031 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1032 for ControlWatchAutoBrightnessResponse
1033 {
1034 #[inline(always)]
1035 fn new_empty() -> Self {
1036 Self { enabled: fidl::new_empty!(bool, D) }
1037 }
1038
1039 #[inline]
1040 unsafe fn decode(
1041 &mut self,
1042 decoder: &mut fidl::encoding::Decoder<'_, D>,
1043 offset: usize,
1044 _depth: fidl::encoding::Depth,
1045 ) -> fidl::Result<()> {
1046 decoder.debug_check_bounds::<Self>(offset);
1047 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1049 Ok(())
1050 }
1051 }
1052
1053 impl fidl::encoding::ValueTypeMarker for ControlWatchCurrentBrightnessResponse {
1054 type Borrowed<'a> = &'a Self;
1055 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1056 value
1057 }
1058 }
1059
1060 unsafe impl fidl::encoding::TypeMarker for ControlWatchCurrentBrightnessResponse {
1061 type Owned = Self;
1062
1063 #[inline(always)]
1064 fn inline_align(_context: fidl::encoding::Context) -> usize {
1065 4
1066 }
1067
1068 #[inline(always)]
1069 fn inline_size(_context: fidl::encoding::Context) -> usize {
1070 4
1071 }
1072 }
1073
1074 unsafe impl<D: fidl::encoding::ResourceDialect>
1075 fidl::encoding::Encode<ControlWatchCurrentBrightnessResponse, D>
1076 for &ControlWatchCurrentBrightnessResponse
1077 {
1078 #[inline]
1079 unsafe fn encode(
1080 self,
1081 encoder: &mut fidl::encoding::Encoder<'_, D>,
1082 offset: usize,
1083 _depth: fidl::encoding::Depth,
1084 ) -> fidl::Result<()> {
1085 encoder.debug_check_bounds::<ControlWatchCurrentBrightnessResponse>(offset);
1086 fidl::encoding::Encode::<ControlWatchCurrentBrightnessResponse, D>::encode(
1088 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
1089 encoder,
1090 offset,
1091 _depth,
1092 )
1093 }
1094 }
1095 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
1096 fidl::encoding::Encode<ControlWatchCurrentBrightnessResponse, D> for (T0,)
1097 {
1098 #[inline]
1099 unsafe fn encode(
1100 self,
1101 encoder: &mut fidl::encoding::Encoder<'_, D>,
1102 offset: usize,
1103 depth: fidl::encoding::Depth,
1104 ) -> fidl::Result<()> {
1105 encoder.debug_check_bounds::<ControlWatchCurrentBrightnessResponse>(offset);
1106 self.0.encode(encoder, offset + 0, depth)?;
1110 Ok(())
1111 }
1112 }
1113
1114 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1115 for ControlWatchCurrentBrightnessResponse
1116 {
1117 #[inline(always)]
1118 fn new_empty() -> Self {
1119 Self { value: fidl::new_empty!(f32, D) }
1120 }
1121
1122 #[inline]
1123 unsafe fn decode(
1124 &mut self,
1125 decoder: &mut fidl::encoding::Decoder<'_, D>,
1126 offset: usize,
1127 _depth: fidl::encoding::Depth,
1128 ) -> fidl::Result<()> {
1129 decoder.debug_check_bounds::<Self>(offset);
1130 fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
1132 Ok(())
1133 }
1134 }
1135
1136 impl fidl::encoding::ValueTypeMarker for ControlGetMaxAbsoluteBrightnessResponse {
1137 type Borrowed<'a> = &'a Self;
1138 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1139 value
1140 }
1141 }
1142
1143 unsafe impl fidl::encoding::TypeMarker for ControlGetMaxAbsoluteBrightnessResponse {
1144 type Owned = Self;
1145
1146 #[inline(always)]
1147 fn inline_align(_context: fidl::encoding::Context) -> usize {
1148 8
1149 }
1150
1151 #[inline(always)]
1152 fn inline_size(_context: fidl::encoding::Context) -> usize {
1153 8
1154 }
1155 }
1156
1157 unsafe impl<D: fidl::encoding::ResourceDialect>
1158 fidl::encoding::Encode<ControlGetMaxAbsoluteBrightnessResponse, D>
1159 for &ControlGetMaxAbsoluteBrightnessResponse
1160 {
1161 #[inline]
1162 unsafe fn encode(
1163 self,
1164 encoder: &mut fidl::encoding::Encoder<'_, D>,
1165 offset: usize,
1166 _depth: fidl::encoding::Depth,
1167 ) -> fidl::Result<()> {
1168 encoder.debug_check_bounds::<ControlGetMaxAbsoluteBrightnessResponse>(offset);
1169 fidl::encoding::Encode::<ControlGetMaxAbsoluteBrightnessResponse, D>::encode(
1171 (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_brightness),),
1172 encoder,
1173 offset,
1174 _depth,
1175 )
1176 }
1177 }
1178 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
1179 fidl::encoding::Encode<ControlGetMaxAbsoluteBrightnessResponse, D> for (T0,)
1180 {
1181 #[inline]
1182 unsafe fn encode(
1183 self,
1184 encoder: &mut fidl::encoding::Encoder<'_, D>,
1185 offset: usize,
1186 depth: fidl::encoding::Depth,
1187 ) -> fidl::Result<()> {
1188 encoder.debug_check_bounds::<ControlGetMaxAbsoluteBrightnessResponse>(offset);
1189 self.0.encode(encoder, offset + 0, depth)?;
1193 Ok(())
1194 }
1195 }
1196
1197 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1198 for ControlGetMaxAbsoluteBrightnessResponse
1199 {
1200 #[inline(always)]
1201 fn new_empty() -> Self {
1202 Self { max_brightness: fidl::new_empty!(f64, D) }
1203 }
1204
1205 #[inline]
1206 unsafe fn decode(
1207 &mut self,
1208 decoder: &mut fidl::encoding::Decoder<'_, D>,
1209 offset: usize,
1210 _depth: fidl::encoding::Depth,
1211 ) -> fidl::Result<()> {
1212 decoder.debug_check_bounds::<Self>(offset);
1213 fidl::decode!(f64, D, &mut self.max_brightness, decoder, offset + 0, _depth)?;
1215 Ok(())
1216 }
1217 }
1218
1219 impl fidl::encoding::ValueTypeMarker for ReaderGetMaxAbsoluteBrightnessResponse {
1220 type Borrowed<'a> = &'a Self;
1221 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1222 value
1223 }
1224 }
1225
1226 unsafe impl fidl::encoding::TypeMarker for ReaderGetMaxAbsoluteBrightnessResponse {
1227 type Owned = Self;
1228
1229 #[inline(always)]
1230 fn inline_align(_context: fidl::encoding::Context) -> usize {
1231 8
1232 }
1233
1234 #[inline(always)]
1235 fn inline_size(_context: fidl::encoding::Context) -> usize {
1236 8
1237 }
1238 }
1239
1240 unsafe impl<D: fidl::encoding::ResourceDialect>
1241 fidl::encoding::Encode<ReaderGetMaxAbsoluteBrightnessResponse, D>
1242 for &ReaderGetMaxAbsoluteBrightnessResponse
1243 {
1244 #[inline]
1245 unsafe fn encode(
1246 self,
1247 encoder: &mut fidl::encoding::Encoder<'_, D>,
1248 offset: usize,
1249 _depth: fidl::encoding::Depth,
1250 ) -> fidl::Result<()> {
1251 encoder.debug_check_bounds::<ReaderGetMaxAbsoluteBrightnessResponse>(offset);
1252 fidl::encoding::Encode::<ReaderGetMaxAbsoluteBrightnessResponse, D>::encode(
1254 (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_brightness),),
1255 encoder,
1256 offset,
1257 _depth,
1258 )
1259 }
1260 }
1261 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
1262 fidl::encoding::Encode<ReaderGetMaxAbsoluteBrightnessResponse, D> for (T0,)
1263 {
1264 #[inline]
1265 unsafe fn encode(
1266 self,
1267 encoder: &mut fidl::encoding::Encoder<'_, D>,
1268 offset: usize,
1269 depth: fidl::encoding::Depth,
1270 ) -> fidl::Result<()> {
1271 encoder.debug_check_bounds::<ReaderGetMaxAbsoluteBrightnessResponse>(offset);
1272 self.0.encode(encoder, offset + 0, depth)?;
1276 Ok(())
1277 }
1278 }
1279
1280 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1281 for ReaderGetMaxAbsoluteBrightnessResponse
1282 {
1283 #[inline(always)]
1284 fn new_empty() -> Self {
1285 Self { max_brightness: fidl::new_empty!(f64, D) }
1286 }
1287
1288 #[inline]
1289 unsafe fn decode(
1290 &mut self,
1291 decoder: &mut fidl::encoding::Decoder<'_, D>,
1292 offset: usize,
1293 _depth: fidl::encoding::Depth,
1294 ) -> fidl::Result<()> {
1295 decoder.debug_check_bounds::<Self>(offset);
1296 fidl::decode!(f64, D, &mut self.max_brightness, decoder, offset + 0, _depth)?;
1298 Ok(())
1299 }
1300 }
1301
1302 impl fidl::encoding::ValueTypeMarker for ReaderWatchAutoBrightnessAdjustmentResponse {
1303 type Borrowed<'a> = &'a Self;
1304 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1305 value
1306 }
1307 }
1308
1309 unsafe impl fidl::encoding::TypeMarker for ReaderWatchAutoBrightnessAdjustmentResponse {
1310 type Owned = Self;
1311
1312 #[inline(always)]
1313 fn inline_align(_context: fidl::encoding::Context) -> usize {
1314 4
1315 }
1316
1317 #[inline(always)]
1318 fn inline_size(_context: fidl::encoding::Context) -> usize {
1319 4
1320 }
1321 }
1322
1323 unsafe impl<D: fidl::encoding::ResourceDialect>
1324 fidl::encoding::Encode<ReaderWatchAutoBrightnessAdjustmentResponse, D>
1325 for &ReaderWatchAutoBrightnessAdjustmentResponse
1326 {
1327 #[inline]
1328 unsafe fn encode(
1329 self,
1330 encoder: &mut fidl::encoding::Encoder<'_, D>,
1331 offset: usize,
1332 _depth: fidl::encoding::Depth,
1333 ) -> fidl::Result<()> {
1334 encoder.debug_check_bounds::<ReaderWatchAutoBrightnessAdjustmentResponse>(offset);
1335 fidl::encoding::Encode::<ReaderWatchAutoBrightnessAdjustmentResponse, D>::encode(
1337 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.adjustment),),
1338 encoder,
1339 offset,
1340 _depth,
1341 )
1342 }
1343 }
1344 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
1345 fidl::encoding::Encode<ReaderWatchAutoBrightnessAdjustmentResponse, D> for (T0,)
1346 {
1347 #[inline]
1348 unsafe fn encode(
1349 self,
1350 encoder: &mut fidl::encoding::Encoder<'_, D>,
1351 offset: usize,
1352 depth: fidl::encoding::Depth,
1353 ) -> fidl::Result<()> {
1354 encoder.debug_check_bounds::<ReaderWatchAutoBrightnessAdjustmentResponse>(offset);
1355 self.0.encode(encoder, offset + 0, depth)?;
1359 Ok(())
1360 }
1361 }
1362
1363 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1364 for ReaderWatchAutoBrightnessAdjustmentResponse
1365 {
1366 #[inline(always)]
1367 fn new_empty() -> Self {
1368 Self { adjustment: fidl::new_empty!(f32, D) }
1369 }
1370
1371 #[inline]
1372 unsafe fn decode(
1373 &mut self,
1374 decoder: &mut fidl::encoding::Decoder<'_, D>,
1375 offset: usize,
1376 _depth: fidl::encoding::Depth,
1377 ) -> fidl::Result<()> {
1378 decoder.debug_check_bounds::<Self>(offset);
1379 fidl::decode!(f32, D, &mut self.adjustment, decoder, offset + 0, _depth)?;
1381 Ok(())
1382 }
1383 }
1384
1385 impl fidl::encoding::ValueTypeMarker for ReaderWatchAutoBrightnessResponse {
1386 type Borrowed<'a> = &'a Self;
1387 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1388 value
1389 }
1390 }
1391
1392 unsafe impl fidl::encoding::TypeMarker for ReaderWatchAutoBrightnessResponse {
1393 type Owned = Self;
1394
1395 #[inline(always)]
1396 fn inline_align(_context: fidl::encoding::Context) -> usize {
1397 1
1398 }
1399
1400 #[inline(always)]
1401 fn inline_size(_context: fidl::encoding::Context) -> usize {
1402 1
1403 }
1404 }
1405
1406 unsafe impl<D: fidl::encoding::ResourceDialect>
1407 fidl::encoding::Encode<ReaderWatchAutoBrightnessResponse, D>
1408 for &ReaderWatchAutoBrightnessResponse
1409 {
1410 #[inline]
1411 unsafe fn encode(
1412 self,
1413 encoder: &mut fidl::encoding::Encoder<'_, D>,
1414 offset: usize,
1415 _depth: fidl::encoding::Depth,
1416 ) -> fidl::Result<()> {
1417 encoder.debug_check_bounds::<ReaderWatchAutoBrightnessResponse>(offset);
1418 fidl::encoding::Encode::<ReaderWatchAutoBrightnessResponse, D>::encode(
1420 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1421 encoder,
1422 offset,
1423 _depth,
1424 )
1425 }
1426 }
1427 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1428 fidl::encoding::Encode<ReaderWatchAutoBrightnessResponse, D> for (T0,)
1429 {
1430 #[inline]
1431 unsafe fn encode(
1432 self,
1433 encoder: &mut fidl::encoding::Encoder<'_, D>,
1434 offset: usize,
1435 depth: fidl::encoding::Depth,
1436 ) -> fidl::Result<()> {
1437 encoder.debug_check_bounds::<ReaderWatchAutoBrightnessResponse>(offset);
1438 self.0.encode(encoder, offset + 0, depth)?;
1442 Ok(())
1443 }
1444 }
1445
1446 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1447 for ReaderWatchAutoBrightnessResponse
1448 {
1449 #[inline(always)]
1450 fn new_empty() -> Self {
1451 Self { enabled: fidl::new_empty!(bool, D) }
1452 }
1453
1454 #[inline]
1455 unsafe fn decode(
1456 &mut self,
1457 decoder: &mut fidl::encoding::Decoder<'_, D>,
1458 offset: usize,
1459 _depth: fidl::encoding::Depth,
1460 ) -> fidl::Result<()> {
1461 decoder.debug_check_bounds::<Self>(offset);
1462 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1464 Ok(())
1465 }
1466 }
1467
1468 impl fidl::encoding::ValueTypeMarker for ReaderWatchCurrentBrightnessResponse {
1469 type Borrowed<'a> = &'a Self;
1470 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1471 value
1472 }
1473 }
1474
1475 unsafe impl fidl::encoding::TypeMarker for ReaderWatchCurrentBrightnessResponse {
1476 type Owned = Self;
1477
1478 #[inline(always)]
1479 fn inline_align(_context: fidl::encoding::Context) -> usize {
1480 4
1481 }
1482
1483 #[inline(always)]
1484 fn inline_size(_context: fidl::encoding::Context) -> usize {
1485 4
1486 }
1487 }
1488
1489 unsafe impl<D: fidl::encoding::ResourceDialect>
1490 fidl::encoding::Encode<ReaderWatchCurrentBrightnessResponse, D>
1491 for &ReaderWatchCurrentBrightnessResponse
1492 {
1493 #[inline]
1494 unsafe fn encode(
1495 self,
1496 encoder: &mut fidl::encoding::Encoder<'_, D>,
1497 offset: usize,
1498 _depth: fidl::encoding::Depth,
1499 ) -> fidl::Result<()> {
1500 encoder.debug_check_bounds::<ReaderWatchCurrentBrightnessResponse>(offset);
1501 fidl::encoding::Encode::<ReaderWatchCurrentBrightnessResponse, D>::encode(
1503 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
1504 encoder,
1505 offset,
1506 _depth,
1507 )
1508 }
1509 }
1510 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
1511 fidl::encoding::Encode<ReaderWatchCurrentBrightnessResponse, D> for (T0,)
1512 {
1513 #[inline]
1514 unsafe fn encode(
1515 self,
1516 encoder: &mut fidl::encoding::Encoder<'_, D>,
1517 offset: usize,
1518 depth: fidl::encoding::Depth,
1519 ) -> fidl::Result<()> {
1520 encoder.debug_check_bounds::<ReaderWatchCurrentBrightnessResponse>(offset);
1521 self.0.encode(encoder, offset + 0, depth)?;
1525 Ok(())
1526 }
1527 }
1528
1529 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1530 for ReaderWatchCurrentBrightnessResponse
1531 {
1532 #[inline(always)]
1533 fn new_empty() -> Self {
1534 Self { value: fidl::new_empty!(f32, D) }
1535 }
1536
1537 #[inline]
1538 unsafe fn decode(
1539 &mut self,
1540 decoder: &mut fidl::encoding::Decoder<'_, D>,
1541 offset: usize,
1542 _depth: fidl::encoding::Depth,
1543 ) -> fidl::Result<()> {
1544 decoder.debug_check_bounds::<Self>(offset);
1545 fidl::decode!(f32, D, &mut self.value, decoder, offset + 0, _depth)?;
1547 Ok(())
1548 }
1549 }
1550
1551 impl ColorAdjustmentTable {
1552 #[inline(always)]
1553 fn max_ordinal_present(&self) -> u64 {
1554 if let Some(_) = self.matrix {
1555 return 1;
1556 }
1557 0
1558 }
1559 }
1560
1561 impl fidl::encoding::ValueTypeMarker for ColorAdjustmentTable {
1562 type Borrowed<'a> = &'a Self;
1563 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1564 value
1565 }
1566 }
1567
1568 unsafe impl fidl::encoding::TypeMarker for ColorAdjustmentTable {
1569 type Owned = Self;
1570
1571 #[inline(always)]
1572 fn inline_align(_context: fidl::encoding::Context) -> usize {
1573 8
1574 }
1575
1576 #[inline(always)]
1577 fn inline_size(_context: fidl::encoding::Context) -> usize {
1578 16
1579 }
1580 }
1581
1582 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorAdjustmentTable, D>
1583 for &ColorAdjustmentTable
1584 {
1585 unsafe fn encode(
1586 self,
1587 encoder: &mut fidl::encoding::Encoder<'_, D>,
1588 offset: usize,
1589 mut depth: fidl::encoding::Depth,
1590 ) -> fidl::Result<()> {
1591 encoder.debug_check_bounds::<ColorAdjustmentTable>(offset);
1592 let max_ordinal: u64 = self.max_ordinal_present();
1594 encoder.write_num(max_ordinal, offset);
1595 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1596 if max_ordinal == 0 {
1598 return Ok(());
1599 }
1600 depth.increment()?;
1601 let envelope_size = 8;
1602 let bytes_len = max_ordinal as usize * envelope_size;
1603 #[allow(unused_variables)]
1604 let offset = encoder.out_of_line_offset(bytes_len);
1605 let mut _prev_end_offset: usize = 0;
1606 if 1 > max_ordinal {
1607 return Ok(());
1608 }
1609
1610 let cur_offset: usize = (1 - 1) * envelope_size;
1613
1614 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1616
1617 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<f32, 9>, D>(
1622 self.matrix.as_ref().map(
1623 <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow,
1624 ),
1625 encoder,
1626 offset + cur_offset,
1627 depth,
1628 )?;
1629
1630 _prev_end_offset = cur_offset + envelope_size;
1631
1632 Ok(())
1633 }
1634 }
1635
1636 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorAdjustmentTable {
1637 #[inline(always)]
1638 fn new_empty() -> Self {
1639 Self::default()
1640 }
1641
1642 unsafe fn decode(
1643 &mut self,
1644 decoder: &mut fidl::encoding::Decoder<'_, D>,
1645 offset: usize,
1646 mut depth: fidl::encoding::Depth,
1647 ) -> fidl::Result<()> {
1648 decoder.debug_check_bounds::<Self>(offset);
1649 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1650 None => return Err(fidl::Error::NotNullable),
1651 Some(len) => len,
1652 };
1653 if len == 0 {
1655 return Ok(());
1656 };
1657 depth.increment()?;
1658 let envelope_size = 8;
1659 let bytes_len = len * envelope_size;
1660 let offset = decoder.out_of_line_offset(bytes_len)?;
1661 let mut _next_ordinal_to_read = 0;
1663 let mut next_offset = offset;
1664 let end_offset = offset + bytes_len;
1665 _next_ordinal_to_read += 1;
1666 if next_offset >= end_offset {
1667 return Ok(());
1668 }
1669
1670 while _next_ordinal_to_read < 1 {
1672 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1673 _next_ordinal_to_read += 1;
1674 next_offset += envelope_size;
1675 }
1676
1677 let next_out_of_line = decoder.next_out_of_line();
1678 let handles_before = decoder.remaining_handles();
1679 if let Some((inlined, num_bytes, num_handles)) =
1680 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1681 {
1682 let member_inline_size =
1683 <fidl::encoding::Array<f32, 9> as fidl::encoding::TypeMarker>::inline_size(
1684 decoder.context,
1685 );
1686 if inlined != (member_inline_size <= 4) {
1687 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1688 }
1689 let inner_offset;
1690 let mut inner_depth = depth.clone();
1691 if inlined {
1692 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1693 inner_offset = next_offset;
1694 } else {
1695 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1696 inner_depth.increment()?;
1697 }
1698 let val_ref = self
1699 .matrix
1700 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<f32, 9>, D));
1701 fidl::decode!(fidl::encoding::Array<f32, 9>, D, val_ref, decoder, inner_offset, inner_depth)?;
1702 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1703 {
1704 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1705 }
1706 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1707 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1708 }
1709 }
1710
1711 next_offset += envelope_size;
1712
1713 while next_offset < end_offset {
1715 _next_ordinal_to_read += 1;
1716 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1717 next_offset += envelope_size;
1718 }
1719
1720 Ok(())
1721 }
1722 }
1723}