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 ClockDomain = u32;
12
13pub type ElementId = u64;
14
15pub type TopologyId = u64;
16
17pub const CLOCK_DOMAIN_EXTERNAL: u32 = 4294967295;
18
19pub const CLOCK_DOMAIN_MONOTONIC: u32 = 0;
20
21pub const MAX_COUNT_CHANNELS_IN_RING_BUFFER: u32 = 64;
22
23pub const MAX_COUNT_CHANNEL_SETS: u32 = 64;
24
25pub const MAX_COUNT_DAI_FORMATS: u32 = MAX_COUNT_FORMATS as u32;
26
27pub const MAX_COUNT_DAI_SUPPORTED_BITS_PER_SAMPLE: u32 = 8;
28
29pub const MAX_COUNT_DAI_SUPPORTED_BITS_PER_SLOT: u32 = 8;
30
31pub const MAX_COUNT_DAI_SUPPORTED_FRAME_FORMATS: u32 = 64;
32
33pub const MAX_COUNT_DAI_SUPPORTED_NUMBER_OF_CHANNELS: u32 = 64;
34
35pub const MAX_COUNT_DAI_SUPPORTED_RATES: u32 = 64;
36
37pub const MAX_COUNT_DAI_SUPPORTED_SAMPLE_FORMATS: u32 = 4;
38
39pub const MAX_COUNT_FORMATS: u32 = 64;
40
41pub const MAX_COUNT_SUPPORTED_BYTES_PER_SAMPLE: u32 = 8;
42
43pub const MAX_COUNT_SUPPORTED_NUMBER_OF_CHANNELS: u32 = 64;
44
45pub const MAX_COUNT_SUPPORTED_RATES: u32 = 64;
46
47pub const MAX_COUNT_SUPPORTED_SAMPLE_FORMATS: u32 = 3;
48
49pub const MAX_COUNT_SUPPORTED_VALID_BITS_PER_SAMPLE: u32 = 8;
50
51pub const MAX_DAI_UI_STRING_SIZE: u32 = 256;
52
53pub const MAX_UI_STRING_SIZE: u32 = 256;
54
55pub const UNIQUE_ID_SIZE: u32 = 16;
56
57#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
59#[repr(u8)]
60pub enum DaiFrameFormatStandard {
61 None = 1,
63 I2S = 2,
67 StereoLeft = 3,
71 StereoRight = 4,
74 Tdm1 = 5,
78 Tdm2 = 6,
82 Tdm3 = 7,
86}
87
88impl DaiFrameFormatStandard {
89 #[inline]
90 pub fn from_primitive(prim: u8) -> Option<Self> {
91 match prim {
92 1 => Some(Self::None),
93 2 => Some(Self::I2S),
94 3 => Some(Self::StereoLeft),
95 4 => Some(Self::StereoRight),
96 5 => Some(Self::Tdm1),
97 6 => Some(Self::Tdm2),
98 7 => Some(Self::Tdm3),
99 _ => None,
100 }
101 }
102
103 #[inline]
104 pub const fn into_primitive(self) -> u8 {
105 self as u8
106 }
107
108 #[deprecated = "Strict enums should not use `is_unknown`"]
109 #[inline]
110 pub fn is_unknown(&self) -> bool {
111 false
112 }
113}
114
115#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
116#[repr(u8)]
117pub enum DaiSampleFormat {
118 Pdm = 1,
120 PcmSigned = 2,
122 PcmUnsigned = 3,
124 PcmFloat = 4,
126}
127
128impl DaiSampleFormat {
129 #[inline]
130 pub fn from_primitive(prim: u8) -> Option<Self> {
131 match prim {
132 1 => Some(Self::Pdm),
133 2 => Some(Self::PcmSigned),
134 3 => Some(Self::PcmUnsigned),
135 4 => Some(Self::PcmFloat),
136 _ => None,
137 }
138 }
139
140 #[inline]
141 pub const fn into_primitive(self) -> u8 {
142 self as u8
143 }
144
145 #[deprecated = "Strict enums should not use `is_unknown`"]
146 #[inline]
147 pub fn is_unknown(&self) -> bool {
148 false
149 }
150}
151
152#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
153pub enum DeviceType {
154 StreamConfig,
156 Dai,
158 Codec,
160 Composite,
162 #[doc(hidden)]
163 __SourceBreaking { unknown_ordinal: u32 },
164}
165
166#[macro_export]
168macro_rules! DeviceTypeUnknown {
169 () => {
170 _
171 };
172}
173
174impl DeviceType {
175 #[inline]
176 pub fn from_primitive(prim: u32) -> Option<Self> {
177 match prim {
178 1 => Some(Self::StreamConfig),
179 2 => Some(Self::Dai),
180 3 => Some(Self::Codec),
181 4 => Some(Self::Composite),
182 _ => None,
183 }
184 }
185
186 #[inline]
187 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
188 match prim {
189 1 => Self::StreamConfig,
190 2 => Self::Dai,
191 3 => Self::Codec,
192 4 => Self::Composite,
193 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
194 }
195 }
196
197 #[inline]
198 pub fn unknown() -> Self {
199 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
200 }
201
202 #[inline]
203 pub const fn into_primitive(self) -> u32 {
204 match self {
205 Self::StreamConfig => 1,
206 Self::Dai => 2,
207 Self::Codec => 3,
208 Self::Composite => 4,
209 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
210 }
211 }
212
213 #[inline]
214 pub fn is_unknown(&self) -> bool {
215 match self {
216 Self::__SourceBreaking { unknown_ordinal: _ } => true,
217 _ => false,
218 }
219 }
220}
221
222#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
223pub enum DriverError {
224 InternalError,
226 NotSupported,
228 InvalidArgs,
230 WrongType,
232 ShouldWait,
235 #[doc(hidden)]
236 __SourceBreaking { unknown_ordinal: u32 },
237}
238
239#[macro_export]
241macro_rules! DriverErrorUnknown {
242 () => {
243 _
244 };
245}
246
247impl DriverError {
248 #[inline]
249 pub fn from_primitive(prim: u32) -> Option<Self> {
250 match prim {
251 1 => Some(Self::InternalError),
252 2 => Some(Self::NotSupported),
253 3 => Some(Self::InvalidArgs),
254 4 => Some(Self::WrongType),
255 5 => Some(Self::ShouldWait),
256 _ => None,
257 }
258 }
259
260 #[inline]
261 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
262 match prim {
263 1 => Self::InternalError,
264 2 => Self::NotSupported,
265 3 => Self::InvalidArgs,
266 4 => Self::WrongType,
267 5 => Self::ShouldWait,
268 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
269 }
270 }
271
272 #[inline]
273 pub fn unknown() -> Self {
274 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
275 }
276
277 #[inline]
278 pub const fn into_primitive(self) -> u32 {
279 match self {
280 Self::InternalError => 1,
281 Self::NotSupported => 2,
282 Self::InvalidArgs => 3,
283 Self::WrongType => 4,
284 Self::ShouldWait => 5,
285 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
286 }
287 }
288
289 #[inline]
290 pub fn is_unknown(&self) -> bool {
291 match self {
292 Self::__SourceBreaking { unknown_ordinal: _ } => true,
293 _ => false,
294 }
295 }
296}
297
298#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
299#[repr(u32)]
300pub enum GetVmoError {
301 InvalidArgs = 1,
303 InternalError = 2,
305}
306
307impl GetVmoError {
308 #[inline]
309 pub fn from_primitive(prim: u32) -> Option<Self> {
310 match prim {
311 1 => Some(Self::InvalidArgs),
312 2 => Some(Self::InternalError),
313 _ => None,
314 }
315 }
316
317 #[inline]
318 pub const fn into_primitive(self) -> u32 {
319 self as u32
320 }
321
322 #[deprecated = "Strict enums should not use `is_unknown`"]
323 #[inline]
324 pub fn is_unknown(&self) -> bool {
325 false
326 }
327}
328
329#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
330#[repr(u32)]
331pub enum PlugDetectCapabilities {
332 Hardwired = 0,
334 CanAsyncNotify = 1,
336}
337
338impl PlugDetectCapabilities {
339 #[inline]
340 pub fn from_primitive(prim: u32) -> Option<Self> {
341 match prim {
342 0 => Some(Self::Hardwired),
343 1 => Some(Self::CanAsyncNotify),
344 _ => None,
345 }
346 }
347
348 #[inline]
349 pub const fn into_primitive(self) -> u32 {
350 self as u32
351 }
352
353 #[deprecated = "Strict enums should not use `is_unknown`"]
354 #[inline]
355 pub fn is_unknown(&self) -> bool {
356 false
357 }
358}
359
360#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
361#[repr(u8)]
362pub enum SampleFormat {
363 PcmSigned = 1,
365 PcmUnsigned = 2,
367 PcmFloat = 3,
369}
370
371impl SampleFormat {
372 #[inline]
373 pub fn from_primitive(prim: u8) -> Option<Self> {
374 match prim {
375 1 => Some(Self::PcmSigned),
376 2 => Some(Self::PcmUnsigned),
377 3 => Some(Self::PcmFloat),
378 _ => None,
379 }
380 }
381
382 #[inline]
383 pub const fn into_primitive(self) -> u8 {
384 self as u8
385 }
386
387 #[deprecated = "Strict enums should not use `is_unknown`"]
388 #[inline]
389 pub fn is_unknown(&self) -> bool {
390 false
391 }
392}
393
394#[derive(Clone, Debug, PartialEq)]
395pub struct CodecGetPropertiesResponse {
396 pub properties: CodecProperties,
397}
398
399impl fidl::Persistable for CodecGetPropertiesResponse {}
400
401#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
402pub struct CodecIsBridgeableResponse {
403 pub supports_bridged_mode: bool,
404}
405
406impl fidl::Persistable for CodecIsBridgeableResponse {}
407
408#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
409pub struct CodecSetBridgedModeRequest {
410 pub enable_bridged_mode: bool,
411}
412
413impl fidl::Persistable for CodecSetBridgedModeRequest {}
414
415#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
416pub struct CodecSetDaiFormatRequest {
417 pub format: DaiFormat,
418}
419
420impl fidl::Persistable for CodecSetDaiFormatRequest {}
421
422#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
423#[repr(C)]
424pub struct CodecStartResponse {
425 pub start_time: i64,
426}
427
428impl fidl::Persistable for CodecStartResponse {}
429
430#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
431#[repr(C)]
432pub struct CodecStopResponse {
433 pub stop_time: i64,
434}
435
436impl fidl::Persistable for CodecStopResponse {}
437
438#[derive(Clone, Debug, PartialEq)]
439pub struct CodecWatchPlugStateResponse {
440 pub plug_state: PlugState,
441}
442
443impl fidl::Persistable for CodecWatchPlugStateResponse {}
444
445#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
446pub struct CodecGetDaiFormatsResponse {
447 pub formats: Vec<DaiSupportedFormats>,
448}
449
450impl fidl::Persistable for CodecGetDaiFormatsResponse {}
451
452#[derive(Clone, Debug, PartialEq)]
453pub struct CodecSetDaiFormatResponse {
454 pub state: CodecFormatInfo,
455}
456
457impl fidl::Persistable for CodecSetDaiFormatResponse {}
458
459#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
460#[repr(C)]
461pub struct CompositeGetDaiFormatsRequest {
462 pub processing_element_id: u64,
463}
464
465impl fidl::Persistable for CompositeGetDaiFormatsRequest {}
466
467#[derive(Clone, Debug, PartialEq)]
468pub struct CompositeGetPropertiesResponse {
469 pub properties: CompositeProperties,
470}
471
472impl fidl::Persistable for CompositeGetPropertiesResponse {}
473
474#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
475#[repr(C)]
476pub struct CompositeGetRingBufferFormatsRequest {
477 pub processing_element_id: u64,
478}
479
480impl fidl::Persistable for CompositeGetRingBufferFormatsRequest {}
481
482#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
483pub struct CompositeSetDaiFormatRequest {
484 pub processing_element_id: u64,
485 pub format: DaiFormat,
486}
487
488impl fidl::Persistable for CompositeSetDaiFormatRequest {}
489
490#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
491pub struct CompositeGetDaiFormatsResponse {
492 pub dai_formats: Vec<DaiSupportedFormats>,
493}
494
495impl fidl::Persistable for CompositeGetDaiFormatsResponse {}
496
497#[derive(Clone, Debug, PartialEq)]
498pub struct CompositeGetRingBufferFormatsResponse {
499 pub ring_buffer_formats: Vec<SupportedFormats>,
500}
501
502impl fidl::Persistable for CompositeGetRingBufferFormatsResponse {}
503
504#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
508pub struct DaiFormat {
509 pub number_of_channels: u32,
511 pub channels_to_use_bitmask: u64,
514 pub sample_format: DaiSampleFormat,
516 pub frame_format: DaiFrameFormat,
518 pub frame_rate: u32,
520 pub bits_per_slot: u8,
522 pub bits_per_sample: u8,
525}
526
527impl fidl::Persistable for DaiFormat {}
528
529#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
531pub struct DaiFrameFormatCustom {
532 pub left_justified: bool,
534 pub sclk_on_raising: bool,
539 pub frame_sync_sclks_offset: i8,
542 pub frame_sync_size: u8,
545}
546
547impl fidl::Persistable for DaiFrameFormatCustom {}
548
549#[derive(Clone, Debug, PartialEq)]
550pub struct DaiGetPropertiesResponse {
551 pub properties: DaiProperties,
552}
553
554impl fidl::Persistable for DaiGetPropertiesResponse {}
555
556#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
564pub struct DaiSupportedFormats {
565 pub number_of_channels: Vec<u32>,
567 pub sample_formats: Vec<DaiSampleFormat>,
569 pub frame_formats: Vec<DaiFrameFormat>,
571 pub frame_rates: Vec<u32>,
573 pub bits_per_slot: Vec<u8>,
575 pub bits_per_sample: Vec<u8>,
577}
578
579impl fidl::Persistable for DaiSupportedFormats {}
580
581#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
582pub struct DaiGetDaiFormatsResponse {
583 pub dai_formats: Vec<DaiSupportedFormats>,
584}
585
586impl fidl::Persistable for DaiGetDaiFormatsResponse {}
587
588#[derive(Clone, Debug, PartialEq)]
589pub struct DaiGetRingBufferFormatsResponse {
590 pub ring_buffer_formats: Vec<SupportedFormats>,
591}
592
593impl fidl::Persistable for DaiGetRingBufferFormatsResponse {}
594
595#[derive(Clone, Debug, PartialEq)]
596pub struct HealthGetHealthStateResponse {
597 pub state: HealthState,
598}
599
600impl fidl::Persistable for HealthGetHealthStateResponse {}
601
602#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
607pub struct PcmFormat {
608 pub number_of_channels: u8,
610 pub sample_format: SampleFormat,
612 pub bytes_per_sample: u8,
615 pub valid_bits_per_sample: u8,
619 pub frame_rate: u32,
621}
622
623impl fidl::Persistable for PcmFormat {}
624
625#[derive(Clone, Debug, PartialEq)]
626pub struct RingBufferGetPropertiesResponse {
627 pub properties: RingBufferProperties,
628}
629
630impl fidl::Persistable for RingBufferGetPropertiesResponse {}
631
632#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
633#[repr(C)]
634pub struct RingBufferGetVmoRequest {
635 pub min_frames: u32,
636 pub clock_recovery_notifications_per_ring: u32,
637}
638
639impl fidl::Persistable for RingBufferGetVmoRequest {}
640
641#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
642#[repr(C)]
643pub struct RingBufferPositionInfo {
644 pub timestamp: i64,
649 pub position: u32,
652}
653
654impl fidl::Persistable for RingBufferPositionInfo {}
655
656#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
657#[repr(C)]
658pub struct RingBufferSetActiveChannelsRequest {
659 pub active_channels_bitmask: u64,
660}
661
662impl fidl::Persistable for RingBufferSetActiveChannelsRequest {}
663
664#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
665#[repr(C)]
666pub struct RingBufferStartResponse {
667 pub start_time: i64,
668}
669
670impl fidl::Persistable for RingBufferStartResponse {}
671
672#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
673#[repr(C)]
674pub struct RingBufferWatchClockRecoveryPositionInfoResponse {
675 pub position_info: RingBufferPositionInfo,
676}
677
678impl fidl::Persistable for RingBufferWatchClockRecoveryPositionInfoResponse {}
679
680#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
681#[repr(C)]
682pub struct RingBufferSetActiveChannelsResponse {
683 pub set_time: i64,
684}
685
686impl fidl::Persistable for RingBufferSetActiveChannelsResponse {}
687
688#[derive(Clone, Debug, PartialEq)]
689pub struct RingBufferWatchDelayInfoResponse {
690 pub delay_info: DelayInfo,
691}
692
693impl fidl::Persistable for RingBufferWatchDelayInfoResponse {}
694
695#[derive(Clone, Debug, PartialEq)]
696pub struct StreamConfigGetPropertiesResponse {
697 pub properties: StreamProperties,
698}
699
700impl fidl::Persistable for StreamConfigGetPropertiesResponse {}
701
702#[derive(Clone, Debug, PartialEq)]
703pub struct StreamConfigGetSupportedFormatsResponse {
704 pub supported_formats: Vec<SupportedFormats>,
705}
706
707impl fidl::Persistable for StreamConfigGetSupportedFormatsResponse {}
708
709#[derive(Clone, Debug, PartialEq)]
710pub struct StreamConfigSetGainRequest {
711 pub target_state: GainState,
712}
713
714impl fidl::Persistable for StreamConfigSetGainRequest {}
715
716#[derive(Clone, Debug, PartialEq)]
717pub struct StreamConfigWatchGainStateResponse {
718 pub gain_state: GainState,
719}
720
721impl fidl::Persistable for StreamConfigWatchGainStateResponse {}
722
723#[derive(Clone, Debug, PartialEq)]
724pub struct StreamConfigWatchPlugStateResponse {
725 pub plug_state: PlugState,
726}
727
728impl fidl::Persistable for StreamConfigWatchPlugStateResponse {}
729
730#[derive(Clone, Debug, Default, PartialEq)]
732pub struct ChannelAttributes {
733 pub min_frequency: Option<u32>,
739 pub max_frequency: Option<u32>,
745 #[doc(hidden)]
746 pub __source_breaking: fidl::marker::SourceBreaking,
747}
748
749impl fidl::Persistable for ChannelAttributes {}
750
751#[derive(Clone, Debug, Default, PartialEq)]
753pub struct ChannelSet {
754 pub attributes: Option<Vec<ChannelAttributes>>,
760 #[doc(hidden)]
761 pub __source_breaking: fidl::marker::SourceBreaking,
762}
763
764impl fidl::Persistable for ChannelSet {}
765
766#[derive(Clone, Debug, Default, PartialEq)]
768pub struct CodecFormatInfo {
769 pub external_delay: Option<i64>,
776 pub turn_on_delay: Option<i64>,
785 pub turn_off_delay: Option<i64>,
794 #[doc(hidden)]
795 pub __source_breaking: fidl::marker::SourceBreaking,
796}
797
798impl fidl::Persistable for CodecFormatInfo {}
799
800#[derive(Clone, Debug, Default, PartialEq)]
801pub struct CodecProperties {
802 pub is_input: Option<bool>,
807 pub manufacturer: Option<String>,
812 pub product: Option<String>,
817 pub unique_id: Option<[u8; 16]>,
822 pub plug_detect_capabilities: Option<PlugDetectCapabilities>,
826 #[doc(hidden)]
827 pub __source_breaking: fidl::marker::SourceBreaking,
828}
829
830impl fidl::Persistable for CodecProperties {}
831
832#[derive(Clone, Debug, Default, PartialEq)]
833pub struct CompositeProperties {
834 pub manufacturer: Option<String>,
839 pub product: Option<String>,
844 pub unique_id: Option<[u8; 16]>,
854 pub clock_domain: Option<u32>,
875 #[doc(hidden)]
876 pub __source_breaking: fidl::marker::SourceBreaking,
877}
878
879impl fidl::Persistable for CompositeProperties {}
880
881#[derive(Clone, Debug, Default, PartialEq)]
882pub struct DaiProperties {
883 pub is_input: Option<bool>,
887 pub manufacturer: Option<String>,
892 pub product_name: Option<String>,
897 pub unique_id: Option<[u8; 16]>,
902 pub clock_domain: Option<u32>,
923 #[doc(hidden)]
924 pub __source_breaking: fidl::marker::SourceBreaking,
925}
926
927impl fidl::Persistable for DaiProperties {}
928
929#[derive(Clone, Debug, Default, PartialEq)]
931pub struct DelayInfo {
932 pub internal_delay: Option<i64>,
953 pub external_delay: Option<i64>,
972 #[doc(hidden)]
973 pub __source_breaking: fidl::marker::SourceBreaking,
974}
975
976impl fidl::Persistable for DelayInfo {}
977
978#[derive(Clone, Debug, Default, PartialEq)]
979pub struct Format {
980 pub pcm_format: Option<PcmFormat>,
984 #[doc(hidden)]
985 pub __source_breaking: fidl::marker::SourceBreaking,
986}
987
988impl fidl::Persistable for Format {}
989
990#[derive(Clone, Debug, Default, PartialEq)]
992pub struct GainState {
993 pub muted: Option<bool>,
997 pub agc_enabled: Option<bool>,
1001 pub gain_db: Option<f32>,
1005 #[doc(hidden)]
1006 pub __source_breaking: fidl::marker::SourceBreaking,
1007}
1008
1009impl fidl::Persistable for GainState {}
1010
1011#[derive(Clone, Debug, Default, PartialEq)]
1012pub struct HealthState {
1013 pub healthy: Option<bool>,
1021 #[doc(hidden)]
1022 pub __source_breaking: fidl::marker::SourceBreaking,
1023}
1024
1025impl fidl::Persistable for HealthState {}
1026
1027#[derive(Clone, Debug, Default, PartialEq)]
1036pub struct PcmSupportedFormats {
1037 pub channel_sets: Option<Vec<ChannelSet>>,
1045 pub sample_formats: Option<Vec<SampleFormat>>,
1049 pub bytes_per_sample: Option<Vec<u8>>,
1055 pub valid_bits_per_sample: Option<Vec<u8>>,
1062 pub frame_rates: Option<Vec<u32>>,
1066 #[doc(hidden)]
1067 pub __source_breaking: fidl::marker::SourceBreaking,
1068}
1069
1070impl fidl::Persistable for PcmSupportedFormats {}
1071
1072#[derive(Clone, Debug, Default, PartialEq)]
1077pub struct PlugState {
1078 pub plugged: Option<bool>,
1080 pub plug_state_time: Option<i64>,
1082 #[doc(hidden)]
1083 pub __source_breaking: fidl::marker::SourceBreaking,
1084}
1085
1086impl fidl::Persistable for PlugState {}
1087
1088#[derive(Clone, Debug, Default, PartialEq)]
1090pub struct RingBufferProperties {
1091 pub external_delay: Option<i64>,
1100 pub fifo_depth: Option<u32>,
1134 pub needs_cache_flush_or_invalidate: Option<bool>,
1148 pub turn_on_delay: Option<i64>,
1160 pub driver_transfer_bytes: Option<u32>,
1352 #[doc(hidden)]
1353 pub __source_breaking: fidl::marker::SourceBreaking,
1354}
1355
1356impl fidl::Persistable for RingBufferProperties {}
1357
1358#[derive(Clone, Debug, Default, PartialEq)]
1359pub struct StreamProperties {
1360 pub unique_id: Option<[u8; 16]>,
1370 pub is_input: Option<bool>,
1374 pub can_mute: Option<bool>,
1378 pub can_agc: Option<bool>,
1382 pub min_gain_db: Option<f32>,
1386 pub max_gain_db: Option<f32>,
1390 pub gain_step_db: Option<f32>,
1395 pub plug_detect_capabilities: Option<PlugDetectCapabilities>,
1399 pub manufacturer: Option<String>,
1404 pub product: Option<String>,
1409 pub clock_domain: Option<u32>,
1430 #[doc(hidden)]
1431 pub __source_breaking: fidl::marker::SourceBreaking,
1432}
1433
1434impl fidl::Persistable for StreamProperties {}
1435
1436#[derive(Clone, Debug, Default, PartialEq)]
1438pub struct SupportedFormats {
1439 pub pcm_supported_formats: Option<PcmSupportedFormats>,
1443 #[doc(hidden)]
1444 pub __source_breaking: fidl::marker::SourceBreaking,
1445}
1446
1447impl fidl::Persistable for SupportedFormats {}
1448
1449#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1451pub enum DaiFrameFormat {
1452 FrameFormatStandard(DaiFrameFormatStandard),
1454 FrameFormatCustom(DaiFrameFormatCustom),
1456}
1457
1458impl DaiFrameFormat {
1459 #[inline]
1460 pub fn ordinal(&self) -> u64 {
1461 match *self {
1462 Self::FrameFormatStandard(_) => 1,
1463 Self::FrameFormatCustom(_) => 2,
1464 }
1465 }
1466
1467 #[deprecated = "Strict unions should not use `is_unknown`"]
1468 #[inline]
1469 pub fn is_unknown(&self) -> bool {
1470 false
1471 }
1472}
1473
1474impl fidl::Persistable for DaiFrameFormat {}
1475
1476mod internal {
1477 use super::*;
1478 unsafe impl fidl::encoding::TypeMarker for DaiFrameFormatStandard {
1479 type Owned = Self;
1480
1481 #[inline(always)]
1482 fn inline_align(_context: fidl::encoding::Context) -> usize {
1483 std::mem::align_of::<u8>()
1484 }
1485
1486 #[inline(always)]
1487 fn inline_size(_context: fidl::encoding::Context) -> usize {
1488 std::mem::size_of::<u8>()
1489 }
1490
1491 #[inline(always)]
1492 fn encode_is_copy() -> bool {
1493 true
1494 }
1495
1496 #[inline(always)]
1497 fn decode_is_copy() -> bool {
1498 false
1499 }
1500 }
1501
1502 impl fidl::encoding::ValueTypeMarker for DaiFrameFormatStandard {
1503 type Borrowed<'a> = Self;
1504 #[inline(always)]
1505 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1506 *value
1507 }
1508 }
1509
1510 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1511 for DaiFrameFormatStandard
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::<Self>(offset);
1521 encoder.write_num(self.into_primitive(), offset);
1522 Ok(())
1523 }
1524 }
1525
1526 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1527 for DaiFrameFormatStandard
1528 {
1529 #[inline(always)]
1530 fn new_empty() -> Self {
1531 Self::None
1532 }
1533
1534 #[inline]
1535 unsafe fn decode(
1536 &mut self,
1537 decoder: &mut fidl::encoding::Decoder<'_, D>,
1538 offset: usize,
1539 _depth: fidl::encoding::Depth,
1540 ) -> fidl::Result<()> {
1541 decoder.debug_check_bounds::<Self>(offset);
1542 let prim = decoder.read_num::<u8>(offset);
1543
1544 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1545 Ok(())
1546 }
1547 }
1548 unsafe impl fidl::encoding::TypeMarker for DaiSampleFormat {
1549 type Owned = Self;
1550
1551 #[inline(always)]
1552 fn inline_align(_context: fidl::encoding::Context) -> usize {
1553 std::mem::align_of::<u8>()
1554 }
1555
1556 #[inline(always)]
1557 fn inline_size(_context: fidl::encoding::Context) -> usize {
1558 std::mem::size_of::<u8>()
1559 }
1560
1561 #[inline(always)]
1562 fn encode_is_copy() -> bool {
1563 true
1564 }
1565
1566 #[inline(always)]
1567 fn decode_is_copy() -> bool {
1568 false
1569 }
1570 }
1571
1572 impl fidl::encoding::ValueTypeMarker for DaiSampleFormat {
1573 type Borrowed<'a> = Self;
1574 #[inline(always)]
1575 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1576 *value
1577 }
1578 }
1579
1580 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1581 for DaiSampleFormat
1582 {
1583 #[inline]
1584 unsafe fn encode(
1585 self,
1586 encoder: &mut fidl::encoding::Encoder<'_, D>,
1587 offset: usize,
1588 _depth: fidl::encoding::Depth,
1589 ) -> fidl::Result<()> {
1590 encoder.debug_check_bounds::<Self>(offset);
1591 encoder.write_num(self.into_primitive(), offset);
1592 Ok(())
1593 }
1594 }
1595
1596 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiSampleFormat {
1597 #[inline(always)]
1598 fn new_empty() -> Self {
1599 Self::Pdm
1600 }
1601
1602 #[inline]
1603 unsafe fn decode(
1604 &mut self,
1605 decoder: &mut fidl::encoding::Decoder<'_, D>,
1606 offset: usize,
1607 _depth: fidl::encoding::Depth,
1608 ) -> fidl::Result<()> {
1609 decoder.debug_check_bounds::<Self>(offset);
1610 let prim = decoder.read_num::<u8>(offset);
1611
1612 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1613 Ok(())
1614 }
1615 }
1616 unsafe impl fidl::encoding::TypeMarker for DeviceType {
1617 type Owned = Self;
1618
1619 #[inline(always)]
1620 fn inline_align(_context: fidl::encoding::Context) -> usize {
1621 std::mem::align_of::<u32>()
1622 }
1623
1624 #[inline(always)]
1625 fn inline_size(_context: fidl::encoding::Context) -> usize {
1626 std::mem::size_of::<u32>()
1627 }
1628
1629 #[inline(always)]
1630 fn encode_is_copy() -> bool {
1631 false
1632 }
1633
1634 #[inline(always)]
1635 fn decode_is_copy() -> bool {
1636 false
1637 }
1638 }
1639
1640 impl fidl::encoding::ValueTypeMarker for DeviceType {
1641 type Borrowed<'a> = Self;
1642 #[inline(always)]
1643 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1644 *value
1645 }
1646 }
1647
1648 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeviceType {
1649 #[inline]
1650 unsafe fn encode(
1651 self,
1652 encoder: &mut fidl::encoding::Encoder<'_, D>,
1653 offset: usize,
1654 _depth: fidl::encoding::Depth,
1655 ) -> fidl::Result<()> {
1656 encoder.debug_check_bounds::<Self>(offset);
1657 encoder.write_num(self.into_primitive(), offset);
1658 Ok(())
1659 }
1660 }
1661
1662 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceType {
1663 #[inline(always)]
1664 fn new_empty() -> Self {
1665 Self::unknown()
1666 }
1667
1668 #[inline]
1669 unsafe fn decode(
1670 &mut self,
1671 decoder: &mut fidl::encoding::Decoder<'_, D>,
1672 offset: usize,
1673 _depth: fidl::encoding::Depth,
1674 ) -> fidl::Result<()> {
1675 decoder.debug_check_bounds::<Self>(offset);
1676 let prim = decoder.read_num::<u32>(offset);
1677
1678 *self = Self::from_primitive_allow_unknown(prim);
1679 Ok(())
1680 }
1681 }
1682 unsafe impl fidl::encoding::TypeMarker for DriverError {
1683 type Owned = Self;
1684
1685 #[inline(always)]
1686 fn inline_align(_context: fidl::encoding::Context) -> usize {
1687 std::mem::align_of::<u32>()
1688 }
1689
1690 #[inline(always)]
1691 fn inline_size(_context: fidl::encoding::Context) -> usize {
1692 std::mem::size_of::<u32>()
1693 }
1694
1695 #[inline(always)]
1696 fn encode_is_copy() -> bool {
1697 false
1698 }
1699
1700 #[inline(always)]
1701 fn decode_is_copy() -> bool {
1702 false
1703 }
1704 }
1705
1706 impl fidl::encoding::ValueTypeMarker for DriverError {
1707 type Borrowed<'a> = Self;
1708 #[inline(always)]
1709 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1710 *value
1711 }
1712 }
1713
1714 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DriverError {
1715 #[inline]
1716 unsafe fn encode(
1717 self,
1718 encoder: &mut fidl::encoding::Encoder<'_, D>,
1719 offset: usize,
1720 _depth: fidl::encoding::Depth,
1721 ) -> fidl::Result<()> {
1722 encoder.debug_check_bounds::<Self>(offset);
1723 encoder.write_num(self.into_primitive(), offset);
1724 Ok(())
1725 }
1726 }
1727
1728 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DriverError {
1729 #[inline(always)]
1730 fn new_empty() -> Self {
1731 Self::unknown()
1732 }
1733
1734 #[inline]
1735 unsafe fn decode(
1736 &mut self,
1737 decoder: &mut fidl::encoding::Decoder<'_, D>,
1738 offset: usize,
1739 _depth: fidl::encoding::Depth,
1740 ) -> fidl::Result<()> {
1741 decoder.debug_check_bounds::<Self>(offset);
1742 let prim = decoder.read_num::<u32>(offset);
1743
1744 *self = Self::from_primitive_allow_unknown(prim);
1745 Ok(())
1746 }
1747 }
1748 unsafe impl fidl::encoding::TypeMarker for GetVmoError {
1749 type Owned = Self;
1750
1751 #[inline(always)]
1752 fn inline_align(_context: fidl::encoding::Context) -> usize {
1753 std::mem::align_of::<u32>()
1754 }
1755
1756 #[inline(always)]
1757 fn inline_size(_context: fidl::encoding::Context) -> usize {
1758 std::mem::size_of::<u32>()
1759 }
1760
1761 #[inline(always)]
1762 fn encode_is_copy() -> bool {
1763 true
1764 }
1765
1766 #[inline(always)]
1767 fn decode_is_copy() -> bool {
1768 false
1769 }
1770 }
1771
1772 impl fidl::encoding::ValueTypeMarker for GetVmoError {
1773 type Borrowed<'a> = Self;
1774 #[inline(always)]
1775 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1776 *value
1777 }
1778 }
1779
1780 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GetVmoError {
1781 #[inline]
1782 unsafe fn encode(
1783 self,
1784 encoder: &mut fidl::encoding::Encoder<'_, D>,
1785 offset: usize,
1786 _depth: fidl::encoding::Depth,
1787 ) -> fidl::Result<()> {
1788 encoder.debug_check_bounds::<Self>(offset);
1789 encoder.write_num(self.into_primitive(), offset);
1790 Ok(())
1791 }
1792 }
1793
1794 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetVmoError {
1795 #[inline(always)]
1796 fn new_empty() -> Self {
1797 Self::InvalidArgs
1798 }
1799
1800 #[inline]
1801 unsafe fn decode(
1802 &mut self,
1803 decoder: &mut fidl::encoding::Decoder<'_, D>,
1804 offset: usize,
1805 _depth: fidl::encoding::Depth,
1806 ) -> fidl::Result<()> {
1807 decoder.debug_check_bounds::<Self>(offset);
1808 let prim = decoder.read_num::<u32>(offset);
1809
1810 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1811 Ok(())
1812 }
1813 }
1814 unsafe impl fidl::encoding::TypeMarker for PlugDetectCapabilities {
1815 type Owned = Self;
1816
1817 #[inline(always)]
1818 fn inline_align(_context: fidl::encoding::Context) -> usize {
1819 std::mem::align_of::<u32>()
1820 }
1821
1822 #[inline(always)]
1823 fn inline_size(_context: fidl::encoding::Context) -> usize {
1824 std::mem::size_of::<u32>()
1825 }
1826
1827 #[inline(always)]
1828 fn encode_is_copy() -> bool {
1829 true
1830 }
1831
1832 #[inline(always)]
1833 fn decode_is_copy() -> bool {
1834 false
1835 }
1836 }
1837
1838 impl fidl::encoding::ValueTypeMarker for PlugDetectCapabilities {
1839 type Borrowed<'a> = Self;
1840 #[inline(always)]
1841 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1842 *value
1843 }
1844 }
1845
1846 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1847 for PlugDetectCapabilities
1848 {
1849 #[inline]
1850 unsafe fn encode(
1851 self,
1852 encoder: &mut fidl::encoding::Encoder<'_, D>,
1853 offset: usize,
1854 _depth: fidl::encoding::Depth,
1855 ) -> fidl::Result<()> {
1856 encoder.debug_check_bounds::<Self>(offset);
1857 encoder.write_num(self.into_primitive(), offset);
1858 Ok(())
1859 }
1860 }
1861
1862 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1863 for PlugDetectCapabilities
1864 {
1865 #[inline(always)]
1866 fn new_empty() -> Self {
1867 Self::Hardwired
1868 }
1869
1870 #[inline]
1871 unsafe fn decode(
1872 &mut self,
1873 decoder: &mut fidl::encoding::Decoder<'_, D>,
1874 offset: usize,
1875 _depth: fidl::encoding::Depth,
1876 ) -> fidl::Result<()> {
1877 decoder.debug_check_bounds::<Self>(offset);
1878 let prim = decoder.read_num::<u32>(offset);
1879
1880 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1881 Ok(())
1882 }
1883 }
1884 unsafe impl fidl::encoding::TypeMarker for SampleFormat {
1885 type Owned = Self;
1886
1887 #[inline(always)]
1888 fn inline_align(_context: fidl::encoding::Context) -> usize {
1889 std::mem::align_of::<u8>()
1890 }
1891
1892 #[inline(always)]
1893 fn inline_size(_context: fidl::encoding::Context) -> usize {
1894 std::mem::size_of::<u8>()
1895 }
1896
1897 #[inline(always)]
1898 fn encode_is_copy() -> bool {
1899 true
1900 }
1901
1902 #[inline(always)]
1903 fn decode_is_copy() -> bool {
1904 false
1905 }
1906 }
1907
1908 impl fidl::encoding::ValueTypeMarker for SampleFormat {
1909 type Borrowed<'a> = Self;
1910 #[inline(always)]
1911 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1912 *value
1913 }
1914 }
1915
1916 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SampleFormat {
1917 #[inline]
1918 unsafe fn encode(
1919 self,
1920 encoder: &mut fidl::encoding::Encoder<'_, D>,
1921 offset: usize,
1922 _depth: fidl::encoding::Depth,
1923 ) -> fidl::Result<()> {
1924 encoder.debug_check_bounds::<Self>(offset);
1925 encoder.write_num(self.into_primitive(), offset);
1926 Ok(())
1927 }
1928 }
1929
1930 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SampleFormat {
1931 #[inline(always)]
1932 fn new_empty() -> Self {
1933 Self::PcmSigned
1934 }
1935
1936 #[inline]
1937 unsafe fn decode(
1938 &mut self,
1939 decoder: &mut fidl::encoding::Decoder<'_, D>,
1940 offset: usize,
1941 _depth: fidl::encoding::Depth,
1942 ) -> fidl::Result<()> {
1943 decoder.debug_check_bounds::<Self>(offset);
1944 let prim = decoder.read_num::<u8>(offset);
1945
1946 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1947 Ok(())
1948 }
1949 }
1950
1951 impl fidl::encoding::ValueTypeMarker for CodecGetPropertiesResponse {
1952 type Borrowed<'a> = &'a Self;
1953 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1954 value
1955 }
1956 }
1957
1958 unsafe impl fidl::encoding::TypeMarker for CodecGetPropertiesResponse {
1959 type Owned = Self;
1960
1961 #[inline(always)]
1962 fn inline_align(_context: fidl::encoding::Context) -> usize {
1963 8
1964 }
1965
1966 #[inline(always)]
1967 fn inline_size(_context: fidl::encoding::Context) -> usize {
1968 16
1969 }
1970 }
1971
1972 unsafe impl<D: fidl::encoding::ResourceDialect>
1973 fidl::encoding::Encode<CodecGetPropertiesResponse, D> for &CodecGetPropertiesResponse
1974 {
1975 #[inline]
1976 unsafe fn encode(
1977 self,
1978 encoder: &mut fidl::encoding::Encoder<'_, D>,
1979 offset: usize,
1980 _depth: fidl::encoding::Depth,
1981 ) -> fidl::Result<()> {
1982 encoder.debug_check_bounds::<CodecGetPropertiesResponse>(offset);
1983 fidl::encoding::Encode::<CodecGetPropertiesResponse, D>::encode(
1985 (<CodecProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
1986 encoder,
1987 offset,
1988 _depth,
1989 )
1990 }
1991 }
1992 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CodecProperties, D>>
1993 fidl::encoding::Encode<CodecGetPropertiesResponse, D> for (T0,)
1994 {
1995 #[inline]
1996 unsafe fn encode(
1997 self,
1998 encoder: &mut fidl::encoding::Encoder<'_, D>,
1999 offset: usize,
2000 depth: fidl::encoding::Depth,
2001 ) -> fidl::Result<()> {
2002 encoder.debug_check_bounds::<CodecGetPropertiesResponse>(offset);
2003 self.0.encode(encoder, offset + 0, depth)?;
2007 Ok(())
2008 }
2009 }
2010
2011 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2012 for CodecGetPropertiesResponse
2013 {
2014 #[inline(always)]
2015 fn new_empty() -> Self {
2016 Self { properties: fidl::new_empty!(CodecProperties, D) }
2017 }
2018
2019 #[inline]
2020 unsafe fn decode(
2021 &mut self,
2022 decoder: &mut fidl::encoding::Decoder<'_, D>,
2023 offset: usize,
2024 _depth: fidl::encoding::Depth,
2025 ) -> fidl::Result<()> {
2026 decoder.debug_check_bounds::<Self>(offset);
2027 fidl::decode!(CodecProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
2029 Ok(())
2030 }
2031 }
2032
2033 impl fidl::encoding::ValueTypeMarker for CodecIsBridgeableResponse {
2034 type Borrowed<'a> = &'a Self;
2035 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2036 value
2037 }
2038 }
2039
2040 unsafe impl fidl::encoding::TypeMarker for CodecIsBridgeableResponse {
2041 type Owned = Self;
2042
2043 #[inline(always)]
2044 fn inline_align(_context: fidl::encoding::Context) -> usize {
2045 1
2046 }
2047
2048 #[inline(always)]
2049 fn inline_size(_context: fidl::encoding::Context) -> usize {
2050 1
2051 }
2052 }
2053
2054 unsafe impl<D: fidl::encoding::ResourceDialect>
2055 fidl::encoding::Encode<CodecIsBridgeableResponse, D> for &CodecIsBridgeableResponse
2056 {
2057 #[inline]
2058 unsafe fn encode(
2059 self,
2060 encoder: &mut fidl::encoding::Encoder<'_, D>,
2061 offset: usize,
2062 _depth: fidl::encoding::Depth,
2063 ) -> fidl::Result<()> {
2064 encoder.debug_check_bounds::<CodecIsBridgeableResponse>(offset);
2065 fidl::encoding::Encode::<CodecIsBridgeableResponse, D>::encode(
2067 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_bridged_mode),),
2068 encoder,
2069 offset,
2070 _depth,
2071 )
2072 }
2073 }
2074 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2075 fidl::encoding::Encode<CodecIsBridgeableResponse, D> for (T0,)
2076 {
2077 #[inline]
2078 unsafe fn encode(
2079 self,
2080 encoder: &mut fidl::encoding::Encoder<'_, D>,
2081 offset: usize,
2082 depth: fidl::encoding::Depth,
2083 ) -> fidl::Result<()> {
2084 encoder.debug_check_bounds::<CodecIsBridgeableResponse>(offset);
2085 self.0.encode(encoder, offset + 0, depth)?;
2089 Ok(())
2090 }
2091 }
2092
2093 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2094 for CodecIsBridgeableResponse
2095 {
2096 #[inline(always)]
2097 fn new_empty() -> Self {
2098 Self { supports_bridged_mode: fidl::new_empty!(bool, D) }
2099 }
2100
2101 #[inline]
2102 unsafe fn decode(
2103 &mut self,
2104 decoder: &mut fidl::encoding::Decoder<'_, D>,
2105 offset: usize,
2106 _depth: fidl::encoding::Depth,
2107 ) -> fidl::Result<()> {
2108 decoder.debug_check_bounds::<Self>(offset);
2109 fidl::decode!(bool, D, &mut self.supports_bridged_mode, decoder, offset + 0, _depth)?;
2111 Ok(())
2112 }
2113 }
2114
2115 impl fidl::encoding::ValueTypeMarker for CodecSetBridgedModeRequest {
2116 type Borrowed<'a> = &'a Self;
2117 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2118 value
2119 }
2120 }
2121
2122 unsafe impl fidl::encoding::TypeMarker for CodecSetBridgedModeRequest {
2123 type Owned = Self;
2124
2125 #[inline(always)]
2126 fn inline_align(_context: fidl::encoding::Context) -> usize {
2127 1
2128 }
2129
2130 #[inline(always)]
2131 fn inline_size(_context: fidl::encoding::Context) -> usize {
2132 1
2133 }
2134 }
2135
2136 unsafe impl<D: fidl::encoding::ResourceDialect>
2137 fidl::encoding::Encode<CodecSetBridgedModeRequest, D> for &CodecSetBridgedModeRequest
2138 {
2139 #[inline]
2140 unsafe fn encode(
2141 self,
2142 encoder: &mut fidl::encoding::Encoder<'_, D>,
2143 offset: usize,
2144 _depth: fidl::encoding::Depth,
2145 ) -> fidl::Result<()> {
2146 encoder.debug_check_bounds::<CodecSetBridgedModeRequest>(offset);
2147 fidl::encoding::Encode::<CodecSetBridgedModeRequest, D>::encode(
2149 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable_bridged_mode),),
2150 encoder,
2151 offset,
2152 _depth,
2153 )
2154 }
2155 }
2156 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2157 fidl::encoding::Encode<CodecSetBridgedModeRequest, D> for (T0,)
2158 {
2159 #[inline]
2160 unsafe fn encode(
2161 self,
2162 encoder: &mut fidl::encoding::Encoder<'_, D>,
2163 offset: usize,
2164 depth: fidl::encoding::Depth,
2165 ) -> fidl::Result<()> {
2166 encoder.debug_check_bounds::<CodecSetBridgedModeRequest>(offset);
2167 self.0.encode(encoder, offset + 0, depth)?;
2171 Ok(())
2172 }
2173 }
2174
2175 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2176 for CodecSetBridgedModeRequest
2177 {
2178 #[inline(always)]
2179 fn new_empty() -> Self {
2180 Self { enable_bridged_mode: fidl::new_empty!(bool, D) }
2181 }
2182
2183 #[inline]
2184 unsafe fn decode(
2185 &mut self,
2186 decoder: &mut fidl::encoding::Decoder<'_, D>,
2187 offset: usize,
2188 _depth: fidl::encoding::Depth,
2189 ) -> fidl::Result<()> {
2190 decoder.debug_check_bounds::<Self>(offset);
2191 fidl::decode!(bool, D, &mut self.enable_bridged_mode, decoder, offset + 0, _depth)?;
2193 Ok(())
2194 }
2195 }
2196
2197 impl fidl::encoding::ValueTypeMarker for CodecSetDaiFormatRequest {
2198 type Borrowed<'a> = &'a Self;
2199 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2200 value
2201 }
2202 }
2203
2204 unsafe impl fidl::encoding::TypeMarker for CodecSetDaiFormatRequest {
2205 type Owned = Self;
2206
2207 #[inline(always)]
2208 fn inline_align(_context: fidl::encoding::Context) -> usize {
2209 8
2210 }
2211
2212 #[inline(always)]
2213 fn inline_size(_context: fidl::encoding::Context) -> usize {
2214 48
2215 }
2216 }
2217
2218 unsafe impl<D: fidl::encoding::ResourceDialect>
2219 fidl::encoding::Encode<CodecSetDaiFormatRequest, D> for &CodecSetDaiFormatRequest
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::<CodecSetDaiFormatRequest>(offset);
2229 fidl::encoding::Encode::<CodecSetDaiFormatRequest, D>::encode(
2231 (<DaiFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.format),),
2232 encoder,
2233 offset,
2234 _depth,
2235 )
2236 }
2237 }
2238 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DaiFormat, D>>
2239 fidl::encoding::Encode<CodecSetDaiFormatRequest, D> for (T0,)
2240 {
2241 #[inline]
2242 unsafe fn encode(
2243 self,
2244 encoder: &mut fidl::encoding::Encoder<'_, D>,
2245 offset: usize,
2246 depth: fidl::encoding::Depth,
2247 ) -> fidl::Result<()> {
2248 encoder.debug_check_bounds::<CodecSetDaiFormatRequest>(offset);
2249 self.0.encode(encoder, offset + 0, depth)?;
2253 Ok(())
2254 }
2255 }
2256
2257 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2258 for CodecSetDaiFormatRequest
2259 {
2260 #[inline(always)]
2261 fn new_empty() -> Self {
2262 Self { format: fidl::new_empty!(DaiFormat, D) }
2263 }
2264
2265 #[inline]
2266 unsafe fn decode(
2267 &mut self,
2268 decoder: &mut fidl::encoding::Decoder<'_, D>,
2269 offset: usize,
2270 _depth: fidl::encoding::Depth,
2271 ) -> fidl::Result<()> {
2272 decoder.debug_check_bounds::<Self>(offset);
2273 fidl::decode!(DaiFormat, D, &mut self.format, decoder, offset + 0, _depth)?;
2275 Ok(())
2276 }
2277 }
2278
2279 impl fidl::encoding::ValueTypeMarker for CodecStartResponse {
2280 type Borrowed<'a> = &'a Self;
2281 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2282 value
2283 }
2284 }
2285
2286 unsafe impl fidl::encoding::TypeMarker for CodecStartResponse {
2287 type Owned = Self;
2288
2289 #[inline(always)]
2290 fn inline_align(_context: fidl::encoding::Context) -> usize {
2291 8
2292 }
2293
2294 #[inline(always)]
2295 fn inline_size(_context: fidl::encoding::Context) -> usize {
2296 8
2297 }
2298 #[inline(always)]
2299 fn encode_is_copy() -> bool {
2300 true
2301 }
2302
2303 #[inline(always)]
2304 fn decode_is_copy() -> bool {
2305 true
2306 }
2307 }
2308
2309 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CodecStartResponse, D>
2310 for &CodecStartResponse
2311 {
2312 #[inline]
2313 unsafe fn encode(
2314 self,
2315 encoder: &mut fidl::encoding::Encoder<'_, D>,
2316 offset: usize,
2317 _depth: fidl::encoding::Depth,
2318 ) -> fidl::Result<()> {
2319 encoder.debug_check_bounds::<CodecStartResponse>(offset);
2320 unsafe {
2321 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2323 (buf_ptr as *mut CodecStartResponse)
2324 .write_unaligned((self as *const CodecStartResponse).read());
2325 }
2328 Ok(())
2329 }
2330 }
2331 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
2332 fidl::encoding::Encode<CodecStartResponse, D> for (T0,)
2333 {
2334 #[inline]
2335 unsafe fn encode(
2336 self,
2337 encoder: &mut fidl::encoding::Encoder<'_, D>,
2338 offset: usize,
2339 depth: fidl::encoding::Depth,
2340 ) -> fidl::Result<()> {
2341 encoder.debug_check_bounds::<CodecStartResponse>(offset);
2342 self.0.encode(encoder, offset + 0, depth)?;
2346 Ok(())
2347 }
2348 }
2349
2350 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecStartResponse {
2351 #[inline(always)]
2352 fn new_empty() -> Self {
2353 Self { start_time: fidl::new_empty!(i64, D) }
2354 }
2355
2356 #[inline]
2357 unsafe fn decode(
2358 &mut self,
2359 decoder: &mut fidl::encoding::Decoder<'_, D>,
2360 offset: usize,
2361 _depth: fidl::encoding::Depth,
2362 ) -> fidl::Result<()> {
2363 decoder.debug_check_bounds::<Self>(offset);
2364 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2365 unsafe {
2368 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2369 }
2370 Ok(())
2371 }
2372 }
2373
2374 impl fidl::encoding::ValueTypeMarker for CodecStopResponse {
2375 type Borrowed<'a> = &'a Self;
2376 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2377 value
2378 }
2379 }
2380
2381 unsafe impl fidl::encoding::TypeMarker for CodecStopResponse {
2382 type Owned = Self;
2383
2384 #[inline(always)]
2385 fn inline_align(_context: fidl::encoding::Context) -> usize {
2386 8
2387 }
2388
2389 #[inline(always)]
2390 fn inline_size(_context: fidl::encoding::Context) -> usize {
2391 8
2392 }
2393 #[inline(always)]
2394 fn encode_is_copy() -> bool {
2395 true
2396 }
2397
2398 #[inline(always)]
2399 fn decode_is_copy() -> bool {
2400 true
2401 }
2402 }
2403
2404 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CodecStopResponse, D>
2405 for &CodecStopResponse
2406 {
2407 #[inline]
2408 unsafe fn encode(
2409 self,
2410 encoder: &mut fidl::encoding::Encoder<'_, D>,
2411 offset: usize,
2412 _depth: fidl::encoding::Depth,
2413 ) -> fidl::Result<()> {
2414 encoder.debug_check_bounds::<CodecStopResponse>(offset);
2415 unsafe {
2416 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2418 (buf_ptr as *mut CodecStopResponse)
2419 .write_unaligned((self as *const CodecStopResponse).read());
2420 }
2423 Ok(())
2424 }
2425 }
2426 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
2427 fidl::encoding::Encode<CodecStopResponse, D> for (T0,)
2428 {
2429 #[inline]
2430 unsafe fn encode(
2431 self,
2432 encoder: &mut fidl::encoding::Encoder<'_, D>,
2433 offset: usize,
2434 depth: fidl::encoding::Depth,
2435 ) -> fidl::Result<()> {
2436 encoder.debug_check_bounds::<CodecStopResponse>(offset);
2437 self.0.encode(encoder, offset + 0, depth)?;
2441 Ok(())
2442 }
2443 }
2444
2445 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecStopResponse {
2446 #[inline(always)]
2447 fn new_empty() -> Self {
2448 Self { stop_time: fidl::new_empty!(i64, D) }
2449 }
2450
2451 #[inline]
2452 unsafe fn decode(
2453 &mut self,
2454 decoder: &mut fidl::encoding::Decoder<'_, D>,
2455 offset: usize,
2456 _depth: fidl::encoding::Depth,
2457 ) -> fidl::Result<()> {
2458 decoder.debug_check_bounds::<Self>(offset);
2459 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2460 unsafe {
2463 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2464 }
2465 Ok(())
2466 }
2467 }
2468
2469 impl fidl::encoding::ValueTypeMarker for CodecWatchPlugStateResponse {
2470 type Borrowed<'a> = &'a Self;
2471 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2472 value
2473 }
2474 }
2475
2476 unsafe impl fidl::encoding::TypeMarker for CodecWatchPlugStateResponse {
2477 type Owned = Self;
2478
2479 #[inline(always)]
2480 fn inline_align(_context: fidl::encoding::Context) -> usize {
2481 8
2482 }
2483
2484 #[inline(always)]
2485 fn inline_size(_context: fidl::encoding::Context) -> usize {
2486 16
2487 }
2488 }
2489
2490 unsafe impl<D: fidl::encoding::ResourceDialect>
2491 fidl::encoding::Encode<CodecWatchPlugStateResponse, D> for &CodecWatchPlugStateResponse
2492 {
2493 #[inline]
2494 unsafe fn encode(
2495 self,
2496 encoder: &mut fidl::encoding::Encoder<'_, D>,
2497 offset: usize,
2498 _depth: fidl::encoding::Depth,
2499 ) -> fidl::Result<()> {
2500 encoder.debug_check_bounds::<CodecWatchPlugStateResponse>(offset);
2501 fidl::encoding::Encode::<CodecWatchPlugStateResponse, D>::encode(
2503 (<PlugState as fidl::encoding::ValueTypeMarker>::borrow(&self.plug_state),),
2504 encoder,
2505 offset,
2506 _depth,
2507 )
2508 }
2509 }
2510 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlugState, D>>
2511 fidl::encoding::Encode<CodecWatchPlugStateResponse, D> for (T0,)
2512 {
2513 #[inline]
2514 unsafe fn encode(
2515 self,
2516 encoder: &mut fidl::encoding::Encoder<'_, D>,
2517 offset: usize,
2518 depth: fidl::encoding::Depth,
2519 ) -> fidl::Result<()> {
2520 encoder.debug_check_bounds::<CodecWatchPlugStateResponse>(offset);
2521 self.0.encode(encoder, offset + 0, depth)?;
2525 Ok(())
2526 }
2527 }
2528
2529 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2530 for CodecWatchPlugStateResponse
2531 {
2532 #[inline(always)]
2533 fn new_empty() -> Self {
2534 Self { plug_state: fidl::new_empty!(PlugState, D) }
2535 }
2536
2537 #[inline]
2538 unsafe fn decode(
2539 &mut self,
2540 decoder: &mut fidl::encoding::Decoder<'_, D>,
2541 offset: usize,
2542 _depth: fidl::encoding::Depth,
2543 ) -> fidl::Result<()> {
2544 decoder.debug_check_bounds::<Self>(offset);
2545 fidl::decode!(PlugState, D, &mut self.plug_state, decoder, offset + 0, _depth)?;
2547 Ok(())
2548 }
2549 }
2550
2551 impl fidl::encoding::ValueTypeMarker for CodecGetDaiFormatsResponse {
2552 type Borrowed<'a> = &'a Self;
2553 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2554 value
2555 }
2556 }
2557
2558 unsafe impl fidl::encoding::TypeMarker for CodecGetDaiFormatsResponse {
2559 type Owned = Self;
2560
2561 #[inline(always)]
2562 fn inline_align(_context: fidl::encoding::Context) -> usize {
2563 8
2564 }
2565
2566 #[inline(always)]
2567 fn inline_size(_context: fidl::encoding::Context) -> usize {
2568 16
2569 }
2570 }
2571
2572 unsafe impl<D: fidl::encoding::ResourceDialect>
2573 fidl::encoding::Encode<CodecGetDaiFormatsResponse, D> for &CodecGetDaiFormatsResponse
2574 {
2575 #[inline]
2576 unsafe fn encode(
2577 self,
2578 encoder: &mut fidl::encoding::Encoder<'_, D>,
2579 offset: usize,
2580 _depth: fidl::encoding::Depth,
2581 ) -> fidl::Result<()> {
2582 encoder.debug_check_bounds::<CodecGetDaiFormatsResponse>(offset);
2583 fidl::encoding::Encode::<CodecGetDaiFormatsResponse, D>::encode(
2585 (
2586 <fidl::encoding::Vector<DaiSupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.formats),
2587 ),
2588 encoder, offset, _depth
2589 )
2590 }
2591 }
2592 unsafe impl<
2593 D: fidl::encoding::ResourceDialect,
2594 T0: fidl::encoding::Encode<fidl::encoding::Vector<DaiSupportedFormats, 64>, D>,
2595 > fidl::encoding::Encode<CodecGetDaiFormatsResponse, D> for (T0,)
2596 {
2597 #[inline]
2598 unsafe fn encode(
2599 self,
2600 encoder: &mut fidl::encoding::Encoder<'_, D>,
2601 offset: usize,
2602 depth: fidl::encoding::Depth,
2603 ) -> fidl::Result<()> {
2604 encoder.debug_check_bounds::<CodecGetDaiFormatsResponse>(offset);
2605 self.0.encode(encoder, offset + 0, depth)?;
2609 Ok(())
2610 }
2611 }
2612
2613 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2614 for CodecGetDaiFormatsResponse
2615 {
2616 #[inline(always)]
2617 fn new_empty() -> Self {
2618 Self { formats: fidl::new_empty!(fidl::encoding::Vector<DaiSupportedFormats, 64>, D) }
2619 }
2620
2621 #[inline]
2622 unsafe fn decode(
2623 &mut self,
2624 decoder: &mut fidl::encoding::Decoder<'_, D>,
2625 offset: usize,
2626 _depth: fidl::encoding::Depth,
2627 ) -> fidl::Result<()> {
2628 decoder.debug_check_bounds::<Self>(offset);
2629 fidl::decode!(fidl::encoding::Vector<DaiSupportedFormats, 64>, D, &mut self.formats, decoder, offset + 0, _depth)?;
2631 Ok(())
2632 }
2633 }
2634
2635 impl fidl::encoding::ValueTypeMarker for CodecSetDaiFormatResponse {
2636 type Borrowed<'a> = &'a Self;
2637 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2638 value
2639 }
2640 }
2641
2642 unsafe impl fidl::encoding::TypeMarker for CodecSetDaiFormatResponse {
2643 type Owned = Self;
2644
2645 #[inline(always)]
2646 fn inline_align(_context: fidl::encoding::Context) -> usize {
2647 8
2648 }
2649
2650 #[inline(always)]
2651 fn inline_size(_context: fidl::encoding::Context) -> usize {
2652 16
2653 }
2654 }
2655
2656 unsafe impl<D: fidl::encoding::ResourceDialect>
2657 fidl::encoding::Encode<CodecSetDaiFormatResponse, D> for &CodecSetDaiFormatResponse
2658 {
2659 #[inline]
2660 unsafe fn encode(
2661 self,
2662 encoder: &mut fidl::encoding::Encoder<'_, D>,
2663 offset: usize,
2664 _depth: fidl::encoding::Depth,
2665 ) -> fidl::Result<()> {
2666 encoder.debug_check_bounds::<CodecSetDaiFormatResponse>(offset);
2667 fidl::encoding::Encode::<CodecSetDaiFormatResponse, D>::encode(
2669 (<CodecFormatInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
2670 encoder,
2671 offset,
2672 _depth,
2673 )
2674 }
2675 }
2676 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CodecFormatInfo, D>>
2677 fidl::encoding::Encode<CodecSetDaiFormatResponse, D> for (T0,)
2678 {
2679 #[inline]
2680 unsafe fn encode(
2681 self,
2682 encoder: &mut fidl::encoding::Encoder<'_, D>,
2683 offset: usize,
2684 depth: fidl::encoding::Depth,
2685 ) -> fidl::Result<()> {
2686 encoder.debug_check_bounds::<CodecSetDaiFormatResponse>(offset);
2687 self.0.encode(encoder, offset + 0, depth)?;
2691 Ok(())
2692 }
2693 }
2694
2695 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2696 for CodecSetDaiFormatResponse
2697 {
2698 #[inline(always)]
2699 fn new_empty() -> Self {
2700 Self { state: fidl::new_empty!(CodecFormatInfo, D) }
2701 }
2702
2703 #[inline]
2704 unsafe fn decode(
2705 &mut self,
2706 decoder: &mut fidl::encoding::Decoder<'_, D>,
2707 offset: usize,
2708 _depth: fidl::encoding::Depth,
2709 ) -> fidl::Result<()> {
2710 decoder.debug_check_bounds::<Self>(offset);
2711 fidl::decode!(CodecFormatInfo, D, &mut self.state, decoder, offset + 0, _depth)?;
2713 Ok(())
2714 }
2715 }
2716
2717 impl fidl::encoding::ValueTypeMarker for CompositeGetDaiFormatsRequest {
2718 type Borrowed<'a> = &'a Self;
2719 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2720 value
2721 }
2722 }
2723
2724 unsafe impl fidl::encoding::TypeMarker for CompositeGetDaiFormatsRequest {
2725 type Owned = Self;
2726
2727 #[inline(always)]
2728 fn inline_align(_context: fidl::encoding::Context) -> usize {
2729 8
2730 }
2731
2732 #[inline(always)]
2733 fn inline_size(_context: fidl::encoding::Context) -> usize {
2734 8
2735 }
2736 #[inline(always)]
2737 fn encode_is_copy() -> bool {
2738 true
2739 }
2740
2741 #[inline(always)]
2742 fn decode_is_copy() -> bool {
2743 true
2744 }
2745 }
2746
2747 unsafe impl<D: fidl::encoding::ResourceDialect>
2748 fidl::encoding::Encode<CompositeGetDaiFormatsRequest, D>
2749 for &CompositeGetDaiFormatsRequest
2750 {
2751 #[inline]
2752 unsafe fn encode(
2753 self,
2754 encoder: &mut fidl::encoding::Encoder<'_, D>,
2755 offset: usize,
2756 _depth: fidl::encoding::Depth,
2757 ) -> fidl::Result<()> {
2758 encoder.debug_check_bounds::<CompositeGetDaiFormatsRequest>(offset);
2759 unsafe {
2760 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2762 (buf_ptr as *mut CompositeGetDaiFormatsRequest)
2763 .write_unaligned((self as *const CompositeGetDaiFormatsRequest).read());
2764 }
2767 Ok(())
2768 }
2769 }
2770 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2771 fidl::encoding::Encode<CompositeGetDaiFormatsRequest, 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::<CompositeGetDaiFormatsRequest>(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 CompositeGetDaiFormatsRequest
2791 {
2792 #[inline(always)]
2793 fn new_empty() -> Self {
2794 Self { processing_element_id: fidl::new_empty!(u64, D) }
2795 }
2796
2797 #[inline]
2798 unsafe fn decode(
2799 &mut self,
2800 decoder: &mut fidl::encoding::Decoder<'_, D>,
2801 offset: usize,
2802 _depth: fidl::encoding::Depth,
2803 ) -> fidl::Result<()> {
2804 decoder.debug_check_bounds::<Self>(offset);
2805 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2806 unsafe {
2809 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2810 }
2811 Ok(())
2812 }
2813 }
2814
2815 impl fidl::encoding::ValueTypeMarker for CompositeGetPropertiesResponse {
2816 type Borrowed<'a> = &'a Self;
2817 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2818 value
2819 }
2820 }
2821
2822 unsafe impl fidl::encoding::TypeMarker for CompositeGetPropertiesResponse {
2823 type Owned = Self;
2824
2825 #[inline(always)]
2826 fn inline_align(_context: fidl::encoding::Context) -> usize {
2827 8
2828 }
2829
2830 #[inline(always)]
2831 fn inline_size(_context: fidl::encoding::Context) -> usize {
2832 16
2833 }
2834 }
2835
2836 unsafe impl<D: fidl::encoding::ResourceDialect>
2837 fidl::encoding::Encode<CompositeGetPropertiesResponse, D>
2838 for &CompositeGetPropertiesResponse
2839 {
2840 #[inline]
2841 unsafe fn encode(
2842 self,
2843 encoder: &mut fidl::encoding::Encoder<'_, D>,
2844 offset: usize,
2845 _depth: fidl::encoding::Depth,
2846 ) -> fidl::Result<()> {
2847 encoder.debug_check_bounds::<CompositeGetPropertiesResponse>(offset);
2848 fidl::encoding::Encode::<CompositeGetPropertiesResponse, D>::encode(
2850 (<CompositeProperties as fidl::encoding::ValueTypeMarker>::borrow(
2851 &self.properties,
2852 ),),
2853 encoder,
2854 offset,
2855 _depth,
2856 )
2857 }
2858 }
2859 unsafe impl<
2860 D: fidl::encoding::ResourceDialect,
2861 T0: fidl::encoding::Encode<CompositeProperties, D>,
2862 > fidl::encoding::Encode<CompositeGetPropertiesResponse, D> for (T0,)
2863 {
2864 #[inline]
2865 unsafe fn encode(
2866 self,
2867 encoder: &mut fidl::encoding::Encoder<'_, D>,
2868 offset: usize,
2869 depth: fidl::encoding::Depth,
2870 ) -> fidl::Result<()> {
2871 encoder.debug_check_bounds::<CompositeGetPropertiesResponse>(offset);
2872 self.0.encode(encoder, offset + 0, depth)?;
2876 Ok(())
2877 }
2878 }
2879
2880 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2881 for CompositeGetPropertiesResponse
2882 {
2883 #[inline(always)]
2884 fn new_empty() -> Self {
2885 Self { properties: fidl::new_empty!(CompositeProperties, D) }
2886 }
2887
2888 #[inline]
2889 unsafe fn decode(
2890 &mut self,
2891 decoder: &mut fidl::encoding::Decoder<'_, D>,
2892 offset: usize,
2893 _depth: fidl::encoding::Depth,
2894 ) -> fidl::Result<()> {
2895 decoder.debug_check_bounds::<Self>(offset);
2896 fidl::decode!(
2898 CompositeProperties,
2899 D,
2900 &mut self.properties,
2901 decoder,
2902 offset + 0,
2903 _depth
2904 )?;
2905 Ok(())
2906 }
2907 }
2908
2909 impl fidl::encoding::ValueTypeMarker for CompositeGetRingBufferFormatsRequest {
2910 type Borrowed<'a> = &'a Self;
2911 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2912 value
2913 }
2914 }
2915
2916 unsafe impl fidl::encoding::TypeMarker for CompositeGetRingBufferFormatsRequest {
2917 type Owned = Self;
2918
2919 #[inline(always)]
2920 fn inline_align(_context: fidl::encoding::Context) -> usize {
2921 8
2922 }
2923
2924 #[inline(always)]
2925 fn inline_size(_context: fidl::encoding::Context) -> usize {
2926 8
2927 }
2928 #[inline(always)]
2929 fn encode_is_copy() -> bool {
2930 true
2931 }
2932
2933 #[inline(always)]
2934 fn decode_is_copy() -> bool {
2935 true
2936 }
2937 }
2938
2939 unsafe impl<D: fidl::encoding::ResourceDialect>
2940 fidl::encoding::Encode<CompositeGetRingBufferFormatsRequest, D>
2941 for &CompositeGetRingBufferFormatsRequest
2942 {
2943 #[inline]
2944 unsafe fn encode(
2945 self,
2946 encoder: &mut fidl::encoding::Encoder<'_, D>,
2947 offset: usize,
2948 _depth: fidl::encoding::Depth,
2949 ) -> fidl::Result<()> {
2950 encoder.debug_check_bounds::<CompositeGetRingBufferFormatsRequest>(offset);
2951 unsafe {
2952 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2954 (buf_ptr as *mut CompositeGetRingBufferFormatsRequest)
2955 .write_unaligned((self as *const CompositeGetRingBufferFormatsRequest).read());
2956 }
2959 Ok(())
2960 }
2961 }
2962 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2963 fidl::encoding::Encode<CompositeGetRingBufferFormatsRequest, D> for (T0,)
2964 {
2965 #[inline]
2966 unsafe fn encode(
2967 self,
2968 encoder: &mut fidl::encoding::Encoder<'_, D>,
2969 offset: usize,
2970 depth: fidl::encoding::Depth,
2971 ) -> fidl::Result<()> {
2972 encoder.debug_check_bounds::<CompositeGetRingBufferFormatsRequest>(offset);
2973 self.0.encode(encoder, offset + 0, depth)?;
2977 Ok(())
2978 }
2979 }
2980
2981 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2982 for CompositeGetRingBufferFormatsRequest
2983 {
2984 #[inline(always)]
2985 fn new_empty() -> Self {
2986 Self { processing_element_id: fidl::new_empty!(u64, D) }
2987 }
2988
2989 #[inline]
2990 unsafe fn decode(
2991 &mut self,
2992 decoder: &mut fidl::encoding::Decoder<'_, D>,
2993 offset: usize,
2994 _depth: fidl::encoding::Depth,
2995 ) -> fidl::Result<()> {
2996 decoder.debug_check_bounds::<Self>(offset);
2997 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2998 unsafe {
3001 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3002 }
3003 Ok(())
3004 }
3005 }
3006
3007 impl fidl::encoding::ValueTypeMarker for CompositeSetDaiFormatRequest {
3008 type Borrowed<'a> = &'a Self;
3009 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3010 value
3011 }
3012 }
3013
3014 unsafe impl fidl::encoding::TypeMarker for CompositeSetDaiFormatRequest {
3015 type Owned = Self;
3016
3017 #[inline(always)]
3018 fn inline_align(_context: fidl::encoding::Context) -> usize {
3019 8
3020 }
3021
3022 #[inline(always)]
3023 fn inline_size(_context: fidl::encoding::Context) -> usize {
3024 56
3025 }
3026 }
3027
3028 unsafe impl<D: fidl::encoding::ResourceDialect>
3029 fidl::encoding::Encode<CompositeSetDaiFormatRequest, D> for &CompositeSetDaiFormatRequest
3030 {
3031 #[inline]
3032 unsafe fn encode(
3033 self,
3034 encoder: &mut fidl::encoding::Encoder<'_, D>,
3035 offset: usize,
3036 _depth: fidl::encoding::Depth,
3037 ) -> fidl::Result<()> {
3038 encoder.debug_check_bounds::<CompositeSetDaiFormatRequest>(offset);
3039 fidl::encoding::Encode::<CompositeSetDaiFormatRequest, D>::encode(
3041 (
3042 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.processing_element_id),
3043 <DaiFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.format),
3044 ),
3045 encoder,
3046 offset,
3047 _depth,
3048 )
3049 }
3050 }
3051 unsafe impl<
3052 D: fidl::encoding::ResourceDialect,
3053 T0: fidl::encoding::Encode<u64, D>,
3054 T1: fidl::encoding::Encode<DaiFormat, D>,
3055 > fidl::encoding::Encode<CompositeSetDaiFormatRequest, D> for (T0, T1)
3056 {
3057 #[inline]
3058 unsafe fn encode(
3059 self,
3060 encoder: &mut fidl::encoding::Encoder<'_, D>,
3061 offset: usize,
3062 depth: fidl::encoding::Depth,
3063 ) -> fidl::Result<()> {
3064 encoder.debug_check_bounds::<CompositeSetDaiFormatRequest>(offset);
3065 self.0.encode(encoder, offset + 0, depth)?;
3069 self.1.encode(encoder, offset + 8, depth)?;
3070 Ok(())
3071 }
3072 }
3073
3074 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3075 for CompositeSetDaiFormatRequest
3076 {
3077 #[inline(always)]
3078 fn new_empty() -> Self {
3079 Self {
3080 processing_element_id: fidl::new_empty!(u64, D),
3081 format: fidl::new_empty!(DaiFormat, D),
3082 }
3083 }
3084
3085 #[inline]
3086 unsafe fn decode(
3087 &mut self,
3088 decoder: &mut fidl::encoding::Decoder<'_, D>,
3089 offset: usize,
3090 _depth: fidl::encoding::Depth,
3091 ) -> fidl::Result<()> {
3092 decoder.debug_check_bounds::<Self>(offset);
3093 fidl::decode!(u64, D, &mut self.processing_element_id, decoder, offset + 0, _depth)?;
3095 fidl::decode!(DaiFormat, D, &mut self.format, decoder, offset + 8, _depth)?;
3096 Ok(())
3097 }
3098 }
3099
3100 impl fidl::encoding::ValueTypeMarker for CompositeGetDaiFormatsResponse {
3101 type Borrowed<'a> = &'a Self;
3102 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3103 value
3104 }
3105 }
3106
3107 unsafe impl fidl::encoding::TypeMarker for CompositeGetDaiFormatsResponse {
3108 type Owned = Self;
3109
3110 #[inline(always)]
3111 fn inline_align(_context: fidl::encoding::Context) -> usize {
3112 8
3113 }
3114
3115 #[inline(always)]
3116 fn inline_size(_context: fidl::encoding::Context) -> usize {
3117 16
3118 }
3119 }
3120
3121 unsafe impl<D: fidl::encoding::ResourceDialect>
3122 fidl::encoding::Encode<CompositeGetDaiFormatsResponse, D>
3123 for &CompositeGetDaiFormatsResponse
3124 {
3125 #[inline]
3126 unsafe fn encode(
3127 self,
3128 encoder: &mut fidl::encoding::Encoder<'_, D>,
3129 offset: usize,
3130 _depth: fidl::encoding::Depth,
3131 ) -> fidl::Result<()> {
3132 encoder.debug_check_bounds::<CompositeGetDaiFormatsResponse>(offset);
3133 fidl::encoding::Encode::<CompositeGetDaiFormatsResponse, D>::encode(
3135 (
3136 <fidl::encoding::Vector<DaiSupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.dai_formats),
3137 ),
3138 encoder, offset, _depth
3139 )
3140 }
3141 }
3142 unsafe impl<
3143 D: fidl::encoding::ResourceDialect,
3144 T0: fidl::encoding::Encode<fidl::encoding::Vector<DaiSupportedFormats, 64>, D>,
3145 > fidl::encoding::Encode<CompositeGetDaiFormatsResponse, D> for (T0,)
3146 {
3147 #[inline]
3148 unsafe fn encode(
3149 self,
3150 encoder: &mut fidl::encoding::Encoder<'_, D>,
3151 offset: usize,
3152 depth: fidl::encoding::Depth,
3153 ) -> fidl::Result<()> {
3154 encoder.debug_check_bounds::<CompositeGetDaiFormatsResponse>(offset);
3155 self.0.encode(encoder, offset + 0, depth)?;
3159 Ok(())
3160 }
3161 }
3162
3163 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3164 for CompositeGetDaiFormatsResponse
3165 {
3166 #[inline(always)]
3167 fn new_empty() -> Self {
3168 Self {
3169 dai_formats: fidl::new_empty!(fidl::encoding::Vector<DaiSupportedFormats, 64>, D),
3170 }
3171 }
3172
3173 #[inline]
3174 unsafe fn decode(
3175 &mut self,
3176 decoder: &mut fidl::encoding::Decoder<'_, D>,
3177 offset: usize,
3178 _depth: fidl::encoding::Depth,
3179 ) -> fidl::Result<()> {
3180 decoder.debug_check_bounds::<Self>(offset);
3181 fidl::decode!(fidl::encoding::Vector<DaiSupportedFormats, 64>, D, &mut self.dai_formats, decoder, offset + 0, _depth)?;
3183 Ok(())
3184 }
3185 }
3186
3187 impl fidl::encoding::ValueTypeMarker for CompositeGetRingBufferFormatsResponse {
3188 type Borrowed<'a> = &'a Self;
3189 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3190 value
3191 }
3192 }
3193
3194 unsafe impl fidl::encoding::TypeMarker for CompositeGetRingBufferFormatsResponse {
3195 type Owned = Self;
3196
3197 #[inline(always)]
3198 fn inline_align(_context: fidl::encoding::Context) -> usize {
3199 8
3200 }
3201
3202 #[inline(always)]
3203 fn inline_size(_context: fidl::encoding::Context) -> usize {
3204 16
3205 }
3206 }
3207
3208 unsafe impl<D: fidl::encoding::ResourceDialect>
3209 fidl::encoding::Encode<CompositeGetRingBufferFormatsResponse, D>
3210 for &CompositeGetRingBufferFormatsResponse
3211 {
3212 #[inline]
3213 unsafe fn encode(
3214 self,
3215 encoder: &mut fidl::encoding::Encoder<'_, D>,
3216 offset: usize,
3217 _depth: fidl::encoding::Depth,
3218 ) -> fidl::Result<()> {
3219 encoder.debug_check_bounds::<CompositeGetRingBufferFormatsResponse>(offset);
3220 fidl::encoding::Encode::<CompositeGetRingBufferFormatsResponse, D>::encode(
3222 (
3223 <fidl::encoding::Vector<SupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.ring_buffer_formats),
3224 ),
3225 encoder, offset, _depth
3226 )
3227 }
3228 }
3229 unsafe impl<
3230 D: fidl::encoding::ResourceDialect,
3231 T0: fidl::encoding::Encode<fidl::encoding::Vector<SupportedFormats, 64>, D>,
3232 > fidl::encoding::Encode<CompositeGetRingBufferFormatsResponse, D> for (T0,)
3233 {
3234 #[inline]
3235 unsafe fn encode(
3236 self,
3237 encoder: &mut fidl::encoding::Encoder<'_, D>,
3238 offset: usize,
3239 depth: fidl::encoding::Depth,
3240 ) -> fidl::Result<()> {
3241 encoder.debug_check_bounds::<CompositeGetRingBufferFormatsResponse>(offset);
3242 self.0.encode(encoder, offset + 0, depth)?;
3246 Ok(())
3247 }
3248 }
3249
3250 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3251 for CompositeGetRingBufferFormatsResponse
3252 {
3253 #[inline(always)]
3254 fn new_empty() -> Self {
3255 Self {
3256 ring_buffer_formats: fidl::new_empty!(fidl::encoding::Vector<SupportedFormats, 64>, D),
3257 }
3258 }
3259
3260 #[inline]
3261 unsafe fn decode(
3262 &mut self,
3263 decoder: &mut fidl::encoding::Decoder<'_, D>,
3264 offset: usize,
3265 _depth: fidl::encoding::Depth,
3266 ) -> fidl::Result<()> {
3267 decoder.debug_check_bounds::<Self>(offset);
3268 fidl::decode!(fidl::encoding::Vector<SupportedFormats, 64>, D, &mut self.ring_buffer_formats, decoder, offset + 0, _depth)?;
3270 Ok(())
3271 }
3272 }
3273
3274 impl fidl::encoding::ValueTypeMarker for DaiFormat {
3275 type Borrowed<'a> = &'a Self;
3276 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3277 value
3278 }
3279 }
3280
3281 unsafe impl fidl::encoding::TypeMarker for DaiFormat {
3282 type Owned = Self;
3283
3284 #[inline(always)]
3285 fn inline_align(_context: fidl::encoding::Context) -> usize {
3286 8
3287 }
3288
3289 #[inline(always)]
3290 fn inline_size(_context: fidl::encoding::Context) -> usize {
3291 48
3292 }
3293 }
3294
3295 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiFormat, D>
3296 for &DaiFormat
3297 {
3298 #[inline]
3299 unsafe fn encode(
3300 self,
3301 encoder: &mut fidl::encoding::Encoder<'_, D>,
3302 offset: usize,
3303 _depth: fidl::encoding::Depth,
3304 ) -> fidl::Result<()> {
3305 encoder.debug_check_bounds::<DaiFormat>(offset);
3306 fidl::encoding::Encode::<DaiFormat, D>::encode(
3308 (
3309 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.number_of_channels),
3310 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.channels_to_use_bitmask),
3311 <DaiSampleFormat as fidl::encoding::ValueTypeMarker>::borrow(
3312 &self.sample_format,
3313 ),
3314 <DaiFrameFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_format),
3315 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rate),
3316 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_slot),
3317 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_sample),
3318 ),
3319 encoder,
3320 offset,
3321 _depth,
3322 )
3323 }
3324 }
3325 unsafe impl<
3326 D: fidl::encoding::ResourceDialect,
3327 T0: fidl::encoding::Encode<u32, D>,
3328 T1: fidl::encoding::Encode<u64, D>,
3329 T2: fidl::encoding::Encode<DaiSampleFormat, D>,
3330 T3: fidl::encoding::Encode<DaiFrameFormat, D>,
3331 T4: fidl::encoding::Encode<u32, D>,
3332 T5: fidl::encoding::Encode<u8, D>,
3333 T6: fidl::encoding::Encode<u8, D>,
3334 > fidl::encoding::Encode<DaiFormat, D> for (T0, T1, T2, T3, T4, T5, T6)
3335 {
3336 #[inline]
3337 unsafe fn encode(
3338 self,
3339 encoder: &mut fidl::encoding::Encoder<'_, D>,
3340 offset: usize,
3341 depth: fidl::encoding::Depth,
3342 ) -> fidl::Result<()> {
3343 encoder.debug_check_bounds::<DaiFormat>(offset);
3344 unsafe {
3347 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3348 (ptr as *mut u64).write_unaligned(0);
3349 }
3350 unsafe {
3351 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3352 (ptr as *mut u64).write_unaligned(0);
3353 }
3354 unsafe {
3355 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3356 (ptr as *mut u64).write_unaligned(0);
3357 }
3358 self.0.encode(encoder, offset + 0, depth)?;
3360 self.1.encode(encoder, offset + 8, depth)?;
3361 self.2.encode(encoder, offset + 16, depth)?;
3362 self.3.encode(encoder, offset + 24, depth)?;
3363 self.4.encode(encoder, offset + 40, depth)?;
3364 self.5.encode(encoder, offset + 44, depth)?;
3365 self.6.encode(encoder, offset + 45, depth)?;
3366 Ok(())
3367 }
3368 }
3369
3370 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiFormat {
3371 #[inline(always)]
3372 fn new_empty() -> Self {
3373 Self {
3374 number_of_channels: fidl::new_empty!(u32, D),
3375 channels_to_use_bitmask: fidl::new_empty!(u64, D),
3376 sample_format: fidl::new_empty!(DaiSampleFormat, D),
3377 frame_format: fidl::new_empty!(DaiFrameFormat, D),
3378 frame_rate: fidl::new_empty!(u32, D),
3379 bits_per_slot: fidl::new_empty!(u8, D),
3380 bits_per_sample: fidl::new_empty!(u8, D),
3381 }
3382 }
3383
3384 #[inline]
3385 unsafe fn decode(
3386 &mut self,
3387 decoder: &mut fidl::encoding::Decoder<'_, D>,
3388 offset: usize,
3389 _depth: fidl::encoding::Depth,
3390 ) -> fidl::Result<()> {
3391 decoder.debug_check_bounds::<Self>(offset);
3392 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3394 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3395 let mask = 0xffffffff00000000u64;
3396 let maskedval = padval & mask;
3397 if maskedval != 0 {
3398 return Err(fidl::Error::NonZeroPadding {
3399 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3400 });
3401 }
3402 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3403 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3404 let mask = 0xffffffffffffff00u64;
3405 let maskedval = padval & mask;
3406 if maskedval != 0 {
3407 return Err(fidl::Error::NonZeroPadding {
3408 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3409 });
3410 }
3411 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3412 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3413 let mask = 0xffff000000000000u64;
3414 let maskedval = padval & mask;
3415 if maskedval != 0 {
3416 return Err(fidl::Error::NonZeroPadding {
3417 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3418 });
3419 }
3420 fidl::decode!(u32, D, &mut self.number_of_channels, decoder, offset + 0, _depth)?;
3421 fidl::decode!(u64, D, &mut self.channels_to_use_bitmask, decoder, offset + 8, _depth)?;
3422 fidl::decode!(
3423 DaiSampleFormat,
3424 D,
3425 &mut self.sample_format,
3426 decoder,
3427 offset + 16,
3428 _depth
3429 )?;
3430 fidl::decode!(DaiFrameFormat, D, &mut self.frame_format, decoder, offset + 24, _depth)?;
3431 fidl::decode!(u32, D, &mut self.frame_rate, decoder, offset + 40, _depth)?;
3432 fidl::decode!(u8, D, &mut self.bits_per_slot, decoder, offset + 44, _depth)?;
3433 fidl::decode!(u8, D, &mut self.bits_per_sample, decoder, offset + 45, _depth)?;
3434 Ok(())
3435 }
3436 }
3437
3438 impl fidl::encoding::ValueTypeMarker for DaiFrameFormatCustom {
3439 type Borrowed<'a> = &'a Self;
3440 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3441 value
3442 }
3443 }
3444
3445 unsafe impl fidl::encoding::TypeMarker for DaiFrameFormatCustom {
3446 type Owned = Self;
3447
3448 #[inline(always)]
3449 fn inline_align(_context: fidl::encoding::Context) -> usize {
3450 1
3451 }
3452
3453 #[inline(always)]
3454 fn inline_size(_context: fidl::encoding::Context) -> usize {
3455 4
3456 }
3457 }
3458
3459 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiFrameFormatCustom, D>
3460 for &DaiFrameFormatCustom
3461 {
3462 #[inline]
3463 unsafe fn encode(
3464 self,
3465 encoder: &mut fidl::encoding::Encoder<'_, D>,
3466 offset: usize,
3467 _depth: fidl::encoding::Depth,
3468 ) -> fidl::Result<()> {
3469 encoder.debug_check_bounds::<DaiFrameFormatCustom>(offset);
3470 fidl::encoding::Encode::<DaiFrameFormatCustom, D>::encode(
3472 (
3473 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.left_justified),
3474 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.sclk_on_raising),
3475 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_sync_sclks_offset),
3476 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_sync_size),
3477 ),
3478 encoder,
3479 offset,
3480 _depth,
3481 )
3482 }
3483 }
3484 unsafe impl<
3485 D: fidl::encoding::ResourceDialect,
3486 T0: fidl::encoding::Encode<bool, D>,
3487 T1: fidl::encoding::Encode<bool, D>,
3488 T2: fidl::encoding::Encode<i8, D>,
3489 T3: fidl::encoding::Encode<u8, D>,
3490 > fidl::encoding::Encode<DaiFrameFormatCustom, D> for (T0, T1, T2, T3)
3491 {
3492 #[inline]
3493 unsafe fn encode(
3494 self,
3495 encoder: &mut fidl::encoding::Encoder<'_, D>,
3496 offset: usize,
3497 depth: fidl::encoding::Depth,
3498 ) -> fidl::Result<()> {
3499 encoder.debug_check_bounds::<DaiFrameFormatCustom>(offset);
3500 self.0.encode(encoder, offset + 0, depth)?;
3504 self.1.encode(encoder, offset + 1, depth)?;
3505 self.2.encode(encoder, offset + 2, depth)?;
3506 self.3.encode(encoder, offset + 3, depth)?;
3507 Ok(())
3508 }
3509 }
3510
3511 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiFrameFormatCustom {
3512 #[inline(always)]
3513 fn new_empty() -> Self {
3514 Self {
3515 left_justified: fidl::new_empty!(bool, D),
3516 sclk_on_raising: fidl::new_empty!(bool, D),
3517 frame_sync_sclks_offset: fidl::new_empty!(i8, D),
3518 frame_sync_size: fidl::new_empty!(u8, D),
3519 }
3520 }
3521
3522 #[inline]
3523 unsafe fn decode(
3524 &mut self,
3525 decoder: &mut fidl::encoding::Decoder<'_, D>,
3526 offset: usize,
3527 _depth: fidl::encoding::Depth,
3528 ) -> fidl::Result<()> {
3529 decoder.debug_check_bounds::<Self>(offset);
3530 fidl::decode!(bool, D, &mut self.left_justified, decoder, offset + 0, _depth)?;
3532 fidl::decode!(bool, D, &mut self.sclk_on_raising, decoder, offset + 1, _depth)?;
3533 fidl::decode!(i8, D, &mut self.frame_sync_sclks_offset, decoder, offset + 2, _depth)?;
3534 fidl::decode!(u8, D, &mut self.frame_sync_size, decoder, offset + 3, _depth)?;
3535 Ok(())
3536 }
3537 }
3538
3539 impl fidl::encoding::ValueTypeMarker for DaiGetPropertiesResponse {
3540 type Borrowed<'a> = &'a Self;
3541 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3542 value
3543 }
3544 }
3545
3546 unsafe impl fidl::encoding::TypeMarker for DaiGetPropertiesResponse {
3547 type Owned = Self;
3548
3549 #[inline(always)]
3550 fn inline_align(_context: fidl::encoding::Context) -> usize {
3551 8
3552 }
3553
3554 #[inline(always)]
3555 fn inline_size(_context: fidl::encoding::Context) -> usize {
3556 16
3557 }
3558 }
3559
3560 unsafe impl<D: fidl::encoding::ResourceDialect>
3561 fidl::encoding::Encode<DaiGetPropertiesResponse, D> for &DaiGetPropertiesResponse
3562 {
3563 #[inline]
3564 unsafe fn encode(
3565 self,
3566 encoder: &mut fidl::encoding::Encoder<'_, D>,
3567 offset: usize,
3568 _depth: fidl::encoding::Depth,
3569 ) -> fidl::Result<()> {
3570 encoder.debug_check_bounds::<DaiGetPropertiesResponse>(offset);
3571 fidl::encoding::Encode::<DaiGetPropertiesResponse, D>::encode(
3573 (<DaiProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
3574 encoder,
3575 offset,
3576 _depth,
3577 )
3578 }
3579 }
3580 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DaiProperties, D>>
3581 fidl::encoding::Encode<DaiGetPropertiesResponse, D> for (T0,)
3582 {
3583 #[inline]
3584 unsafe fn encode(
3585 self,
3586 encoder: &mut fidl::encoding::Encoder<'_, D>,
3587 offset: usize,
3588 depth: fidl::encoding::Depth,
3589 ) -> fidl::Result<()> {
3590 encoder.debug_check_bounds::<DaiGetPropertiesResponse>(offset);
3591 self.0.encode(encoder, offset + 0, depth)?;
3595 Ok(())
3596 }
3597 }
3598
3599 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3600 for DaiGetPropertiesResponse
3601 {
3602 #[inline(always)]
3603 fn new_empty() -> Self {
3604 Self { properties: fidl::new_empty!(DaiProperties, D) }
3605 }
3606
3607 #[inline]
3608 unsafe fn decode(
3609 &mut self,
3610 decoder: &mut fidl::encoding::Decoder<'_, D>,
3611 offset: usize,
3612 _depth: fidl::encoding::Depth,
3613 ) -> fidl::Result<()> {
3614 decoder.debug_check_bounds::<Self>(offset);
3615 fidl::decode!(DaiProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
3617 Ok(())
3618 }
3619 }
3620
3621 impl fidl::encoding::ValueTypeMarker for DaiSupportedFormats {
3622 type Borrowed<'a> = &'a Self;
3623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3624 value
3625 }
3626 }
3627
3628 unsafe impl fidl::encoding::TypeMarker for DaiSupportedFormats {
3629 type Owned = Self;
3630
3631 #[inline(always)]
3632 fn inline_align(_context: fidl::encoding::Context) -> usize {
3633 8
3634 }
3635
3636 #[inline(always)]
3637 fn inline_size(_context: fidl::encoding::Context) -> usize {
3638 96
3639 }
3640 }
3641
3642 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiSupportedFormats, D>
3643 for &DaiSupportedFormats
3644 {
3645 #[inline]
3646 unsafe fn encode(
3647 self,
3648 encoder: &mut fidl::encoding::Encoder<'_, D>,
3649 offset: usize,
3650 _depth: fidl::encoding::Depth,
3651 ) -> fidl::Result<()> {
3652 encoder.debug_check_bounds::<DaiSupportedFormats>(offset);
3653 fidl::encoding::Encode::<DaiSupportedFormats, D>::encode(
3655 (
3656 <fidl::encoding::Vector<u32, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.number_of_channels),
3657 <fidl::encoding::Vector<DaiSampleFormat, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.sample_formats),
3658 <fidl::encoding::Vector<DaiFrameFormat, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_formats),
3659 <fidl::encoding::Vector<u32, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rates),
3660 <fidl::encoding::Vector<u8, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_slot),
3661 <fidl::encoding::Vector<u8, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_sample),
3662 ),
3663 encoder, offset, _depth
3664 )
3665 }
3666 }
3667 unsafe impl<
3668 D: fidl::encoding::ResourceDialect,
3669 T0: fidl::encoding::Encode<fidl::encoding::Vector<u32, 64>, D>,
3670 T1: fidl::encoding::Encode<fidl::encoding::Vector<DaiSampleFormat, 4>, D>,
3671 T2: fidl::encoding::Encode<fidl::encoding::Vector<DaiFrameFormat, 64>, D>,
3672 T3: fidl::encoding::Encode<fidl::encoding::Vector<u32, 64>, D>,
3673 T4: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8>, D>,
3674 T5: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8>, D>,
3675 > fidl::encoding::Encode<DaiSupportedFormats, D> for (T0, T1, T2, T3, T4, T5)
3676 {
3677 #[inline]
3678 unsafe fn encode(
3679 self,
3680 encoder: &mut fidl::encoding::Encoder<'_, D>,
3681 offset: usize,
3682 depth: fidl::encoding::Depth,
3683 ) -> fidl::Result<()> {
3684 encoder.debug_check_bounds::<DaiSupportedFormats>(offset);
3685 self.0.encode(encoder, offset + 0, depth)?;
3689 self.1.encode(encoder, offset + 16, depth)?;
3690 self.2.encode(encoder, offset + 32, depth)?;
3691 self.3.encode(encoder, offset + 48, depth)?;
3692 self.4.encode(encoder, offset + 64, depth)?;
3693 self.5.encode(encoder, offset + 80, depth)?;
3694 Ok(())
3695 }
3696 }
3697
3698 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiSupportedFormats {
3699 #[inline(always)]
3700 fn new_empty() -> Self {
3701 Self {
3702 number_of_channels: fidl::new_empty!(fidl::encoding::Vector<u32, 64>, D),
3703 sample_formats: fidl::new_empty!(fidl::encoding::Vector<DaiSampleFormat, 4>, D),
3704 frame_formats: fidl::new_empty!(fidl::encoding::Vector<DaiFrameFormat, 64>, D),
3705 frame_rates: fidl::new_empty!(fidl::encoding::Vector<u32, 64>, D),
3706 bits_per_slot: fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D),
3707 bits_per_sample: fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D),
3708 }
3709 }
3710
3711 #[inline]
3712 unsafe fn decode(
3713 &mut self,
3714 decoder: &mut fidl::encoding::Decoder<'_, D>,
3715 offset: usize,
3716 _depth: fidl::encoding::Depth,
3717 ) -> fidl::Result<()> {
3718 decoder.debug_check_bounds::<Self>(offset);
3719 fidl::decode!(fidl::encoding::Vector<u32, 64>, D, &mut self.number_of_channels, decoder, offset + 0, _depth)?;
3721 fidl::decode!(fidl::encoding::Vector<DaiSampleFormat, 4>, D, &mut self.sample_formats, decoder, offset + 16, _depth)?;
3722 fidl::decode!(fidl::encoding::Vector<DaiFrameFormat, 64>, D, &mut self.frame_formats, decoder, offset + 32, _depth)?;
3723 fidl::decode!(fidl::encoding::Vector<u32, 64>, D, &mut self.frame_rates, decoder, offset + 48, _depth)?;
3724 fidl::decode!(fidl::encoding::Vector<u8, 8>, D, &mut self.bits_per_slot, decoder, offset + 64, _depth)?;
3725 fidl::decode!(fidl::encoding::Vector<u8, 8>, D, &mut self.bits_per_sample, decoder, offset + 80, _depth)?;
3726 Ok(())
3727 }
3728 }
3729
3730 impl fidl::encoding::ValueTypeMarker for DaiGetDaiFormatsResponse {
3731 type Borrowed<'a> = &'a Self;
3732 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3733 value
3734 }
3735 }
3736
3737 unsafe impl fidl::encoding::TypeMarker for DaiGetDaiFormatsResponse {
3738 type Owned = Self;
3739
3740 #[inline(always)]
3741 fn inline_align(_context: fidl::encoding::Context) -> usize {
3742 8
3743 }
3744
3745 #[inline(always)]
3746 fn inline_size(_context: fidl::encoding::Context) -> usize {
3747 16
3748 }
3749 }
3750
3751 unsafe impl<D: fidl::encoding::ResourceDialect>
3752 fidl::encoding::Encode<DaiGetDaiFormatsResponse, D> for &DaiGetDaiFormatsResponse
3753 {
3754 #[inline]
3755 unsafe fn encode(
3756 self,
3757 encoder: &mut fidl::encoding::Encoder<'_, D>,
3758 offset: usize,
3759 _depth: fidl::encoding::Depth,
3760 ) -> fidl::Result<()> {
3761 encoder.debug_check_bounds::<DaiGetDaiFormatsResponse>(offset);
3762 fidl::encoding::Encode::<DaiGetDaiFormatsResponse, D>::encode(
3764 (
3765 <fidl::encoding::Vector<DaiSupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.dai_formats),
3766 ),
3767 encoder, offset, _depth
3768 )
3769 }
3770 }
3771 unsafe impl<
3772 D: fidl::encoding::ResourceDialect,
3773 T0: fidl::encoding::Encode<fidl::encoding::Vector<DaiSupportedFormats, 64>, D>,
3774 > fidl::encoding::Encode<DaiGetDaiFormatsResponse, D> for (T0,)
3775 {
3776 #[inline]
3777 unsafe fn encode(
3778 self,
3779 encoder: &mut fidl::encoding::Encoder<'_, D>,
3780 offset: usize,
3781 depth: fidl::encoding::Depth,
3782 ) -> fidl::Result<()> {
3783 encoder.debug_check_bounds::<DaiGetDaiFormatsResponse>(offset);
3784 self.0.encode(encoder, offset + 0, depth)?;
3788 Ok(())
3789 }
3790 }
3791
3792 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3793 for DaiGetDaiFormatsResponse
3794 {
3795 #[inline(always)]
3796 fn new_empty() -> Self {
3797 Self {
3798 dai_formats: fidl::new_empty!(fidl::encoding::Vector<DaiSupportedFormats, 64>, D),
3799 }
3800 }
3801
3802 #[inline]
3803 unsafe fn decode(
3804 &mut self,
3805 decoder: &mut fidl::encoding::Decoder<'_, D>,
3806 offset: usize,
3807 _depth: fidl::encoding::Depth,
3808 ) -> fidl::Result<()> {
3809 decoder.debug_check_bounds::<Self>(offset);
3810 fidl::decode!(fidl::encoding::Vector<DaiSupportedFormats, 64>, D, &mut self.dai_formats, decoder, offset + 0, _depth)?;
3812 Ok(())
3813 }
3814 }
3815
3816 impl fidl::encoding::ValueTypeMarker for DaiGetRingBufferFormatsResponse {
3817 type Borrowed<'a> = &'a Self;
3818 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3819 value
3820 }
3821 }
3822
3823 unsafe impl fidl::encoding::TypeMarker for DaiGetRingBufferFormatsResponse {
3824 type Owned = Self;
3825
3826 #[inline(always)]
3827 fn inline_align(_context: fidl::encoding::Context) -> usize {
3828 8
3829 }
3830
3831 #[inline(always)]
3832 fn inline_size(_context: fidl::encoding::Context) -> usize {
3833 16
3834 }
3835 }
3836
3837 unsafe impl<D: fidl::encoding::ResourceDialect>
3838 fidl::encoding::Encode<DaiGetRingBufferFormatsResponse, D>
3839 for &DaiGetRingBufferFormatsResponse
3840 {
3841 #[inline]
3842 unsafe fn encode(
3843 self,
3844 encoder: &mut fidl::encoding::Encoder<'_, D>,
3845 offset: usize,
3846 _depth: fidl::encoding::Depth,
3847 ) -> fidl::Result<()> {
3848 encoder.debug_check_bounds::<DaiGetRingBufferFormatsResponse>(offset);
3849 fidl::encoding::Encode::<DaiGetRingBufferFormatsResponse, D>::encode(
3851 (
3852 <fidl::encoding::Vector<SupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.ring_buffer_formats),
3853 ),
3854 encoder, offset, _depth
3855 )
3856 }
3857 }
3858 unsafe impl<
3859 D: fidl::encoding::ResourceDialect,
3860 T0: fidl::encoding::Encode<fidl::encoding::Vector<SupportedFormats, 64>, D>,
3861 > fidl::encoding::Encode<DaiGetRingBufferFormatsResponse, D> for (T0,)
3862 {
3863 #[inline]
3864 unsafe fn encode(
3865 self,
3866 encoder: &mut fidl::encoding::Encoder<'_, D>,
3867 offset: usize,
3868 depth: fidl::encoding::Depth,
3869 ) -> fidl::Result<()> {
3870 encoder.debug_check_bounds::<DaiGetRingBufferFormatsResponse>(offset);
3871 self.0.encode(encoder, offset + 0, depth)?;
3875 Ok(())
3876 }
3877 }
3878
3879 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3880 for DaiGetRingBufferFormatsResponse
3881 {
3882 #[inline(always)]
3883 fn new_empty() -> Self {
3884 Self {
3885 ring_buffer_formats: fidl::new_empty!(fidl::encoding::Vector<SupportedFormats, 64>, D),
3886 }
3887 }
3888
3889 #[inline]
3890 unsafe fn decode(
3891 &mut self,
3892 decoder: &mut fidl::encoding::Decoder<'_, D>,
3893 offset: usize,
3894 _depth: fidl::encoding::Depth,
3895 ) -> fidl::Result<()> {
3896 decoder.debug_check_bounds::<Self>(offset);
3897 fidl::decode!(fidl::encoding::Vector<SupportedFormats, 64>, D, &mut self.ring_buffer_formats, decoder, offset + 0, _depth)?;
3899 Ok(())
3900 }
3901 }
3902
3903 impl fidl::encoding::ValueTypeMarker for HealthGetHealthStateResponse {
3904 type Borrowed<'a> = &'a Self;
3905 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3906 value
3907 }
3908 }
3909
3910 unsafe impl fidl::encoding::TypeMarker for HealthGetHealthStateResponse {
3911 type Owned = Self;
3912
3913 #[inline(always)]
3914 fn inline_align(_context: fidl::encoding::Context) -> usize {
3915 8
3916 }
3917
3918 #[inline(always)]
3919 fn inline_size(_context: fidl::encoding::Context) -> usize {
3920 16
3921 }
3922 }
3923
3924 unsafe impl<D: fidl::encoding::ResourceDialect>
3925 fidl::encoding::Encode<HealthGetHealthStateResponse, D> for &HealthGetHealthStateResponse
3926 {
3927 #[inline]
3928 unsafe fn encode(
3929 self,
3930 encoder: &mut fidl::encoding::Encoder<'_, D>,
3931 offset: usize,
3932 _depth: fidl::encoding::Depth,
3933 ) -> fidl::Result<()> {
3934 encoder.debug_check_bounds::<HealthGetHealthStateResponse>(offset);
3935 fidl::encoding::Encode::<HealthGetHealthStateResponse, D>::encode(
3937 (<HealthState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
3938 encoder,
3939 offset,
3940 _depth,
3941 )
3942 }
3943 }
3944 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HealthState, D>>
3945 fidl::encoding::Encode<HealthGetHealthStateResponse, D> for (T0,)
3946 {
3947 #[inline]
3948 unsafe fn encode(
3949 self,
3950 encoder: &mut fidl::encoding::Encoder<'_, D>,
3951 offset: usize,
3952 depth: fidl::encoding::Depth,
3953 ) -> fidl::Result<()> {
3954 encoder.debug_check_bounds::<HealthGetHealthStateResponse>(offset);
3955 self.0.encode(encoder, offset + 0, depth)?;
3959 Ok(())
3960 }
3961 }
3962
3963 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3964 for HealthGetHealthStateResponse
3965 {
3966 #[inline(always)]
3967 fn new_empty() -> Self {
3968 Self { state: fidl::new_empty!(HealthState, D) }
3969 }
3970
3971 #[inline]
3972 unsafe fn decode(
3973 &mut self,
3974 decoder: &mut fidl::encoding::Decoder<'_, D>,
3975 offset: usize,
3976 _depth: fidl::encoding::Depth,
3977 ) -> fidl::Result<()> {
3978 decoder.debug_check_bounds::<Self>(offset);
3979 fidl::decode!(HealthState, D, &mut self.state, decoder, offset + 0, _depth)?;
3981 Ok(())
3982 }
3983 }
3984
3985 impl fidl::encoding::ValueTypeMarker for PcmFormat {
3986 type Borrowed<'a> = &'a Self;
3987 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3988 value
3989 }
3990 }
3991
3992 unsafe impl fidl::encoding::TypeMarker for PcmFormat {
3993 type Owned = Self;
3994
3995 #[inline(always)]
3996 fn inline_align(_context: fidl::encoding::Context) -> usize {
3997 4
3998 }
3999
4000 #[inline(always)]
4001 fn inline_size(_context: fidl::encoding::Context) -> usize {
4002 8
4003 }
4004 }
4005
4006 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PcmFormat, D>
4007 for &PcmFormat
4008 {
4009 #[inline]
4010 unsafe fn encode(
4011 self,
4012 encoder: &mut fidl::encoding::Encoder<'_, D>,
4013 offset: usize,
4014 _depth: fidl::encoding::Depth,
4015 ) -> fidl::Result<()> {
4016 encoder.debug_check_bounds::<PcmFormat>(offset);
4017 fidl::encoding::Encode::<PcmFormat, D>::encode(
4019 (
4020 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.number_of_channels),
4021 <SampleFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.sample_format),
4022 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.bytes_per_sample),
4023 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_bits_per_sample),
4024 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rate),
4025 ),
4026 encoder,
4027 offset,
4028 _depth,
4029 )
4030 }
4031 }
4032 unsafe impl<
4033 D: fidl::encoding::ResourceDialect,
4034 T0: fidl::encoding::Encode<u8, D>,
4035 T1: fidl::encoding::Encode<SampleFormat, D>,
4036 T2: fidl::encoding::Encode<u8, D>,
4037 T3: fidl::encoding::Encode<u8, D>,
4038 T4: fidl::encoding::Encode<u32, D>,
4039 > fidl::encoding::Encode<PcmFormat, D> for (T0, T1, T2, T3, T4)
4040 {
4041 #[inline]
4042 unsafe fn encode(
4043 self,
4044 encoder: &mut fidl::encoding::Encoder<'_, D>,
4045 offset: usize,
4046 depth: fidl::encoding::Depth,
4047 ) -> fidl::Result<()> {
4048 encoder.debug_check_bounds::<PcmFormat>(offset);
4049 self.0.encode(encoder, offset + 0, depth)?;
4053 self.1.encode(encoder, offset + 1, depth)?;
4054 self.2.encode(encoder, offset + 2, depth)?;
4055 self.3.encode(encoder, offset + 3, depth)?;
4056 self.4.encode(encoder, offset + 4, depth)?;
4057 Ok(())
4058 }
4059 }
4060
4061 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PcmFormat {
4062 #[inline(always)]
4063 fn new_empty() -> Self {
4064 Self {
4065 number_of_channels: fidl::new_empty!(u8, D),
4066 sample_format: fidl::new_empty!(SampleFormat, D),
4067 bytes_per_sample: fidl::new_empty!(u8, D),
4068 valid_bits_per_sample: fidl::new_empty!(u8, D),
4069 frame_rate: fidl::new_empty!(u32, D),
4070 }
4071 }
4072
4073 #[inline]
4074 unsafe fn decode(
4075 &mut self,
4076 decoder: &mut fidl::encoding::Decoder<'_, D>,
4077 offset: usize,
4078 _depth: fidl::encoding::Depth,
4079 ) -> fidl::Result<()> {
4080 decoder.debug_check_bounds::<Self>(offset);
4081 fidl::decode!(u8, D, &mut self.number_of_channels, decoder, offset + 0, _depth)?;
4083 fidl::decode!(SampleFormat, D, &mut self.sample_format, decoder, offset + 1, _depth)?;
4084 fidl::decode!(u8, D, &mut self.bytes_per_sample, decoder, offset + 2, _depth)?;
4085 fidl::decode!(u8, D, &mut self.valid_bits_per_sample, decoder, offset + 3, _depth)?;
4086 fidl::decode!(u32, D, &mut self.frame_rate, decoder, offset + 4, _depth)?;
4087 Ok(())
4088 }
4089 }
4090
4091 impl fidl::encoding::ValueTypeMarker for RingBufferGetPropertiesResponse {
4092 type Borrowed<'a> = &'a Self;
4093 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4094 value
4095 }
4096 }
4097
4098 unsafe impl fidl::encoding::TypeMarker for RingBufferGetPropertiesResponse {
4099 type Owned = Self;
4100
4101 #[inline(always)]
4102 fn inline_align(_context: fidl::encoding::Context) -> usize {
4103 8
4104 }
4105
4106 #[inline(always)]
4107 fn inline_size(_context: fidl::encoding::Context) -> usize {
4108 16
4109 }
4110 }
4111
4112 unsafe impl<D: fidl::encoding::ResourceDialect>
4113 fidl::encoding::Encode<RingBufferGetPropertiesResponse, D>
4114 for &RingBufferGetPropertiesResponse
4115 {
4116 #[inline]
4117 unsafe fn encode(
4118 self,
4119 encoder: &mut fidl::encoding::Encoder<'_, D>,
4120 offset: usize,
4121 _depth: fidl::encoding::Depth,
4122 ) -> fidl::Result<()> {
4123 encoder.debug_check_bounds::<RingBufferGetPropertiesResponse>(offset);
4124 fidl::encoding::Encode::<RingBufferGetPropertiesResponse, D>::encode(
4126 (<RingBufferProperties as fidl::encoding::ValueTypeMarker>::borrow(
4127 &self.properties,
4128 ),),
4129 encoder,
4130 offset,
4131 _depth,
4132 )
4133 }
4134 }
4135 unsafe impl<
4136 D: fidl::encoding::ResourceDialect,
4137 T0: fidl::encoding::Encode<RingBufferProperties, D>,
4138 > fidl::encoding::Encode<RingBufferGetPropertiesResponse, D> for (T0,)
4139 {
4140 #[inline]
4141 unsafe fn encode(
4142 self,
4143 encoder: &mut fidl::encoding::Encoder<'_, D>,
4144 offset: usize,
4145 depth: fidl::encoding::Depth,
4146 ) -> fidl::Result<()> {
4147 encoder.debug_check_bounds::<RingBufferGetPropertiesResponse>(offset);
4148 self.0.encode(encoder, offset + 0, depth)?;
4152 Ok(())
4153 }
4154 }
4155
4156 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4157 for RingBufferGetPropertiesResponse
4158 {
4159 #[inline(always)]
4160 fn new_empty() -> Self {
4161 Self { properties: fidl::new_empty!(RingBufferProperties, D) }
4162 }
4163
4164 #[inline]
4165 unsafe fn decode(
4166 &mut self,
4167 decoder: &mut fidl::encoding::Decoder<'_, D>,
4168 offset: usize,
4169 _depth: fidl::encoding::Depth,
4170 ) -> fidl::Result<()> {
4171 decoder.debug_check_bounds::<Self>(offset);
4172 fidl::decode!(
4174 RingBufferProperties,
4175 D,
4176 &mut self.properties,
4177 decoder,
4178 offset + 0,
4179 _depth
4180 )?;
4181 Ok(())
4182 }
4183 }
4184
4185 impl fidl::encoding::ValueTypeMarker for RingBufferGetVmoRequest {
4186 type Borrowed<'a> = &'a Self;
4187 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4188 value
4189 }
4190 }
4191
4192 unsafe impl fidl::encoding::TypeMarker for RingBufferGetVmoRequest {
4193 type Owned = Self;
4194
4195 #[inline(always)]
4196 fn inline_align(_context: fidl::encoding::Context) -> usize {
4197 4
4198 }
4199
4200 #[inline(always)]
4201 fn inline_size(_context: fidl::encoding::Context) -> usize {
4202 8
4203 }
4204 #[inline(always)]
4205 fn encode_is_copy() -> bool {
4206 true
4207 }
4208
4209 #[inline(always)]
4210 fn decode_is_copy() -> bool {
4211 true
4212 }
4213 }
4214
4215 unsafe impl<D: fidl::encoding::ResourceDialect>
4216 fidl::encoding::Encode<RingBufferGetVmoRequest, D> for &RingBufferGetVmoRequest
4217 {
4218 #[inline]
4219 unsafe fn encode(
4220 self,
4221 encoder: &mut fidl::encoding::Encoder<'_, D>,
4222 offset: usize,
4223 _depth: fidl::encoding::Depth,
4224 ) -> fidl::Result<()> {
4225 encoder.debug_check_bounds::<RingBufferGetVmoRequest>(offset);
4226 unsafe {
4227 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4229 (buf_ptr as *mut RingBufferGetVmoRequest)
4230 .write_unaligned((self as *const RingBufferGetVmoRequest).read());
4231 }
4234 Ok(())
4235 }
4236 }
4237 unsafe impl<
4238 D: fidl::encoding::ResourceDialect,
4239 T0: fidl::encoding::Encode<u32, D>,
4240 T1: fidl::encoding::Encode<u32, D>,
4241 > fidl::encoding::Encode<RingBufferGetVmoRequest, D> for (T0, T1)
4242 {
4243 #[inline]
4244 unsafe fn encode(
4245 self,
4246 encoder: &mut fidl::encoding::Encoder<'_, D>,
4247 offset: usize,
4248 depth: fidl::encoding::Depth,
4249 ) -> fidl::Result<()> {
4250 encoder.debug_check_bounds::<RingBufferGetVmoRequest>(offset);
4251 self.0.encode(encoder, offset + 0, depth)?;
4255 self.1.encode(encoder, offset + 4, depth)?;
4256 Ok(())
4257 }
4258 }
4259
4260 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4261 for RingBufferGetVmoRequest
4262 {
4263 #[inline(always)]
4264 fn new_empty() -> Self {
4265 Self {
4266 min_frames: fidl::new_empty!(u32, D),
4267 clock_recovery_notifications_per_ring: fidl::new_empty!(u32, D),
4268 }
4269 }
4270
4271 #[inline]
4272 unsafe fn decode(
4273 &mut self,
4274 decoder: &mut fidl::encoding::Decoder<'_, D>,
4275 offset: usize,
4276 _depth: fidl::encoding::Depth,
4277 ) -> fidl::Result<()> {
4278 decoder.debug_check_bounds::<Self>(offset);
4279 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4280 unsafe {
4283 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4284 }
4285 Ok(())
4286 }
4287 }
4288
4289 impl fidl::encoding::ValueTypeMarker for RingBufferPositionInfo {
4290 type Borrowed<'a> = &'a Self;
4291 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4292 value
4293 }
4294 }
4295
4296 unsafe impl fidl::encoding::TypeMarker for RingBufferPositionInfo {
4297 type Owned = Self;
4298
4299 #[inline(always)]
4300 fn inline_align(_context: fidl::encoding::Context) -> usize {
4301 8
4302 }
4303
4304 #[inline(always)]
4305 fn inline_size(_context: fidl::encoding::Context) -> usize {
4306 16
4307 }
4308 }
4309
4310 unsafe impl<D: fidl::encoding::ResourceDialect>
4311 fidl::encoding::Encode<RingBufferPositionInfo, D> for &RingBufferPositionInfo
4312 {
4313 #[inline]
4314 unsafe fn encode(
4315 self,
4316 encoder: &mut fidl::encoding::Encoder<'_, D>,
4317 offset: usize,
4318 _depth: fidl::encoding::Depth,
4319 ) -> fidl::Result<()> {
4320 encoder.debug_check_bounds::<RingBufferPositionInfo>(offset);
4321 unsafe {
4322 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4324 (buf_ptr as *mut RingBufferPositionInfo)
4325 .write_unaligned((self as *const RingBufferPositionInfo).read());
4326 let padding_ptr = buf_ptr.offset(8) as *mut u64;
4329 let padding_mask = 0xffffffff00000000u64;
4330 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4331 }
4332 Ok(())
4333 }
4334 }
4335 unsafe impl<
4336 D: fidl::encoding::ResourceDialect,
4337 T0: fidl::encoding::Encode<i64, D>,
4338 T1: fidl::encoding::Encode<u32, D>,
4339 > fidl::encoding::Encode<RingBufferPositionInfo, D> for (T0, T1)
4340 {
4341 #[inline]
4342 unsafe fn encode(
4343 self,
4344 encoder: &mut fidl::encoding::Encoder<'_, D>,
4345 offset: usize,
4346 depth: fidl::encoding::Depth,
4347 ) -> fidl::Result<()> {
4348 encoder.debug_check_bounds::<RingBufferPositionInfo>(offset);
4349 unsafe {
4352 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4353 (ptr as *mut u64).write_unaligned(0);
4354 }
4355 self.0.encode(encoder, offset + 0, depth)?;
4357 self.1.encode(encoder, offset + 8, depth)?;
4358 Ok(())
4359 }
4360 }
4361
4362 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4363 for RingBufferPositionInfo
4364 {
4365 #[inline(always)]
4366 fn new_empty() -> Self {
4367 Self { timestamp: fidl::new_empty!(i64, D), position: fidl::new_empty!(u32, D) }
4368 }
4369
4370 #[inline]
4371 unsafe fn decode(
4372 &mut self,
4373 decoder: &mut fidl::encoding::Decoder<'_, D>,
4374 offset: usize,
4375 _depth: fidl::encoding::Depth,
4376 ) -> fidl::Result<()> {
4377 decoder.debug_check_bounds::<Self>(offset);
4378 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4379 let ptr = unsafe { buf_ptr.offset(8) };
4381 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4382 let mask = 0xffffffff00000000u64;
4383 let maskedval = padval & mask;
4384 if maskedval != 0 {
4385 return Err(fidl::Error::NonZeroPadding {
4386 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4387 });
4388 }
4389 unsafe {
4391 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4392 }
4393 Ok(())
4394 }
4395 }
4396
4397 impl fidl::encoding::ValueTypeMarker for RingBufferSetActiveChannelsRequest {
4398 type Borrowed<'a> = &'a Self;
4399 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4400 value
4401 }
4402 }
4403
4404 unsafe impl fidl::encoding::TypeMarker for RingBufferSetActiveChannelsRequest {
4405 type Owned = Self;
4406
4407 #[inline(always)]
4408 fn inline_align(_context: fidl::encoding::Context) -> usize {
4409 8
4410 }
4411
4412 #[inline(always)]
4413 fn inline_size(_context: fidl::encoding::Context) -> usize {
4414 8
4415 }
4416 #[inline(always)]
4417 fn encode_is_copy() -> bool {
4418 true
4419 }
4420
4421 #[inline(always)]
4422 fn decode_is_copy() -> bool {
4423 true
4424 }
4425 }
4426
4427 unsafe impl<D: fidl::encoding::ResourceDialect>
4428 fidl::encoding::Encode<RingBufferSetActiveChannelsRequest, D>
4429 for &RingBufferSetActiveChannelsRequest
4430 {
4431 #[inline]
4432 unsafe fn encode(
4433 self,
4434 encoder: &mut fidl::encoding::Encoder<'_, D>,
4435 offset: usize,
4436 _depth: fidl::encoding::Depth,
4437 ) -> fidl::Result<()> {
4438 encoder.debug_check_bounds::<RingBufferSetActiveChannelsRequest>(offset);
4439 unsafe {
4440 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4442 (buf_ptr as *mut RingBufferSetActiveChannelsRequest)
4443 .write_unaligned((self as *const RingBufferSetActiveChannelsRequest).read());
4444 }
4447 Ok(())
4448 }
4449 }
4450 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4451 fidl::encoding::Encode<RingBufferSetActiveChannelsRequest, D> for (T0,)
4452 {
4453 #[inline]
4454 unsafe fn encode(
4455 self,
4456 encoder: &mut fidl::encoding::Encoder<'_, D>,
4457 offset: usize,
4458 depth: fidl::encoding::Depth,
4459 ) -> fidl::Result<()> {
4460 encoder.debug_check_bounds::<RingBufferSetActiveChannelsRequest>(offset);
4461 self.0.encode(encoder, offset + 0, depth)?;
4465 Ok(())
4466 }
4467 }
4468
4469 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4470 for RingBufferSetActiveChannelsRequest
4471 {
4472 #[inline(always)]
4473 fn new_empty() -> Self {
4474 Self { active_channels_bitmask: fidl::new_empty!(u64, D) }
4475 }
4476
4477 #[inline]
4478 unsafe fn decode(
4479 &mut self,
4480 decoder: &mut fidl::encoding::Decoder<'_, D>,
4481 offset: usize,
4482 _depth: fidl::encoding::Depth,
4483 ) -> fidl::Result<()> {
4484 decoder.debug_check_bounds::<Self>(offset);
4485 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4486 unsafe {
4489 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4490 }
4491 Ok(())
4492 }
4493 }
4494
4495 impl fidl::encoding::ValueTypeMarker for RingBufferStartResponse {
4496 type Borrowed<'a> = &'a Self;
4497 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4498 value
4499 }
4500 }
4501
4502 unsafe impl fidl::encoding::TypeMarker for RingBufferStartResponse {
4503 type Owned = Self;
4504
4505 #[inline(always)]
4506 fn inline_align(_context: fidl::encoding::Context) -> usize {
4507 8
4508 }
4509
4510 #[inline(always)]
4511 fn inline_size(_context: fidl::encoding::Context) -> usize {
4512 8
4513 }
4514 #[inline(always)]
4515 fn encode_is_copy() -> bool {
4516 true
4517 }
4518
4519 #[inline(always)]
4520 fn decode_is_copy() -> bool {
4521 true
4522 }
4523 }
4524
4525 unsafe impl<D: fidl::encoding::ResourceDialect>
4526 fidl::encoding::Encode<RingBufferStartResponse, D> for &RingBufferStartResponse
4527 {
4528 #[inline]
4529 unsafe fn encode(
4530 self,
4531 encoder: &mut fidl::encoding::Encoder<'_, D>,
4532 offset: usize,
4533 _depth: fidl::encoding::Depth,
4534 ) -> fidl::Result<()> {
4535 encoder.debug_check_bounds::<RingBufferStartResponse>(offset);
4536 unsafe {
4537 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4539 (buf_ptr as *mut RingBufferStartResponse)
4540 .write_unaligned((self as *const RingBufferStartResponse).read());
4541 }
4544 Ok(())
4545 }
4546 }
4547 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
4548 fidl::encoding::Encode<RingBufferStartResponse, D> for (T0,)
4549 {
4550 #[inline]
4551 unsafe fn encode(
4552 self,
4553 encoder: &mut fidl::encoding::Encoder<'_, D>,
4554 offset: usize,
4555 depth: fidl::encoding::Depth,
4556 ) -> fidl::Result<()> {
4557 encoder.debug_check_bounds::<RingBufferStartResponse>(offset);
4558 self.0.encode(encoder, offset + 0, depth)?;
4562 Ok(())
4563 }
4564 }
4565
4566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4567 for RingBufferStartResponse
4568 {
4569 #[inline(always)]
4570 fn new_empty() -> Self {
4571 Self { start_time: fidl::new_empty!(i64, D) }
4572 }
4573
4574 #[inline]
4575 unsafe fn decode(
4576 &mut self,
4577 decoder: &mut fidl::encoding::Decoder<'_, D>,
4578 offset: usize,
4579 _depth: fidl::encoding::Depth,
4580 ) -> fidl::Result<()> {
4581 decoder.debug_check_bounds::<Self>(offset);
4582 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4583 unsafe {
4586 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4587 }
4588 Ok(())
4589 }
4590 }
4591
4592 impl fidl::encoding::ValueTypeMarker for RingBufferWatchClockRecoveryPositionInfoResponse {
4593 type Borrowed<'a> = &'a Self;
4594 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4595 value
4596 }
4597 }
4598
4599 unsafe impl fidl::encoding::TypeMarker for RingBufferWatchClockRecoveryPositionInfoResponse {
4600 type Owned = Self;
4601
4602 #[inline(always)]
4603 fn inline_align(_context: fidl::encoding::Context) -> usize {
4604 8
4605 }
4606
4607 #[inline(always)]
4608 fn inline_size(_context: fidl::encoding::Context) -> usize {
4609 16
4610 }
4611 }
4612
4613 unsafe impl<D: fidl::encoding::ResourceDialect>
4614 fidl::encoding::Encode<RingBufferWatchClockRecoveryPositionInfoResponse, D>
4615 for &RingBufferWatchClockRecoveryPositionInfoResponse
4616 {
4617 #[inline]
4618 unsafe fn encode(
4619 self,
4620 encoder: &mut fidl::encoding::Encoder<'_, D>,
4621 offset: usize,
4622 _depth: fidl::encoding::Depth,
4623 ) -> fidl::Result<()> {
4624 encoder.debug_check_bounds::<RingBufferWatchClockRecoveryPositionInfoResponse>(offset);
4625 unsafe {
4626 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4628 (buf_ptr as *mut RingBufferWatchClockRecoveryPositionInfoResponse).write_unaligned(
4629 (self as *const RingBufferWatchClockRecoveryPositionInfoResponse).read(),
4630 );
4631 let padding_ptr = buf_ptr.offset(8) as *mut u64;
4634 let padding_mask = 0xffffffff00000000u64;
4635 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4636 }
4637 Ok(())
4638 }
4639 }
4640 unsafe impl<
4641 D: fidl::encoding::ResourceDialect,
4642 T0: fidl::encoding::Encode<RingBufferPositionInfo, D>,
4643 > fidl::encoding::Encode<RingBufferWatchClockRecoveryPositionInfoResponse, D> for (T0,)
4644 {
4645 #[inline]
4646 unsafe fn encode(
4647 self,
4648 encoder: &mut fidl::encoding::Encoder<'_, D>,
4649 offset: usize,
4650 depth: fidl::encoding::Depth,
4651 ) -> fidl::Result<()> {
4652 encoder.debug_check_bounds::<RingBufferWatchClockRecoveryPositionInfoResponse>(offset);
4653 self.0.encode(encoder, offset + 0, depth)?;
4657 Ok(())
4658 }
4659 }
4660
4661 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4662 for RingBufferWatchClockRecoveryPositionInfoResponse
4663 {
4664 #[inline(always)]
4665 fn new_empty() -> Self {
4666 Self { position_info: fidl::new_empty!(RingBufferPositionInfo, D) }
4667 }
4668
4669 #[inline]
4670 unsafe fn decode(
4671 &mut self,
4672 decoder: &mut fidl::encoding::Decoder<'_, D>,
4673 offset: usize,
4674 _depth: fidl::encoding::Depth,
4675 ) -> fidl::Result<()> {
4676 decoder.debug_check_bounds::<Self>(offset);
4677 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4678 let ptr = unsafe { buf_ptr.offset(8) };
4680 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4681 let mask = 0xffffffff00000000u64;
4682 let maskedval = padval & mask;
4683 if maskedval != 0 {
4684 return Err(fidl::Error::NonZeroPadding {
4685 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4686 });
4687 }
4688 unsafe {
4690 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4691 }
4692 Ok(())
4693 }
4694 }
4695
4696 impl fidl::encoding::ValueTypeMarker for RingBufferSetActiveChannelsResponse {
4697 type Borrowed<'a> = &'a Self;
4698 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4699 value
4700 }
4701 }
4702
4703 unsafe impl fidl::encoding::TypeMarker for RingBufferSetActiveChannelsResponse {
4704 type Owned = Self;
4705
4706 #[inline(always)]
4707 fn inline_align(_context: fidl::encoding::Context) -> usize {
4708 8
4709 }
4710
4711 #[inline(always)]
4712 fn inline_size(_context: fidl::encoding::Context) -> usize {
4713 8
4714 }
4715 #[inline(always)]
4716 fn encode_is_copy() -> bool {
4717 true
4718 }
4719
4720 #[inline(always)]
4721 fn decode_is_copy() -> bool {
4722 true
4723 }
4724 }
4725
4726 unsafe impl<D: fidl::encoding::ResourceDialect>
4727 fidl::encoding::Encode<RingBufferSetActiveChannelsResponse, D>
4728 for &RingBufferSetActiveChannelsResponse
4729 {
4730 #[inline]
4731 unsafe fn encode(
4732 self,
4733 encoder: &mut fidl::encoding::Encoder<'_, D>,
4734 offset: usize,
4735 _depth: fidl::encoding::Depth,
4736 ) -> fidl::Result<()> {
4737 encoder.debug_check_bounds::<RingBufferSetActiveChannelsResponse>(offset);
4738 unsafe {
4739 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4741 (buf_ptr as *mut RingBufferSetActiveChannelsResponse)
4742 .write_unaligned((self as *const RingBufferSetActiveChannelsResponse).read());
4743 }
4746 Ok(())
4747 }
4748 }
4749 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
4750 fidl::encoding::Encode<RingBufferSetActiveChannelsResponse, D> for (T0,)
4751 {
4752 #[inline]
4753 unsafe fn encode(
4754 self,
4755 encoder: &mut fidl::encoding::Encoder<'_, D>,
4756 offset: usize,
4757 depth: fidl::encoding::Depth,
4758 ) -> fidl::Result<()> {
4759 encoder.debug_check_bounds::<RingBufferSetActiveChannelsResponse>(offset);
4760 self.0.encode(encoder, offset + 0, depth)?;
4764 Ok(())
4765 }
4766 }
4767
4768 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4769 for RingBufferSetActiveChannelsResponse
4770 {
4771 #[inline(always)]
4772 fn new_empty() -> Self {
4773 Self { set_time: fidl::new_empty!(i64, D) }
4774 }
4775
4776 #[inline]
4777 unsafe fn decode(
4778 &mut self,
4779 decoder: &mut fidl::encoding::Decoder<'_, D>,
4780 offset: usize,
4781 _depth: fidl::encoding::Depth,
4782 ) -> fidl::Result<()> {
4783 decoder.debug_check_bounds::<Self>(offset);
4784 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4785 unsafe {
4788 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4789 }
4790 Ok(())
4791 }
4792 }
4793
4794 impl fidl::encoding::ValueTypeMarker for RingBufferWatchDelayInfoResponse {
4795 type Borrowed<'a> = &'a Self;
4796 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4797 value
4798 }
4799 }
4800
4801 unsafe impl fidl::encoding::TypeMarker for RingBufferWatchDelayInfoResponse {
4802 type Owned = Self;
4803
4804 #[inline(always)]
4805 fn inline_align(_context: fidl::encoding::Context) -> usize {
4806 8
4807 }
4808
4809 #[inline(always)]
4810 fn inline_size(_context: fidl::encoding::Context) -> usize {
4811 16
4812 }
4813 }
4814
4815 unsafe impl<D: fidl::encoding::ResourceDialect>
4816 fidl::encoding::Encode<RingBufferWatchDelayInfoResponse, D>
4817 for &RingBufferWatchDelayInfoResponse
4818 {
4819 #[inline]
4820 unsafe fn encode(
4821 self,
4822 encoder: &mut fidl::encoding::Encoder<'_, D>,
4823 offset: usize,
4824 _depth: fidl::encoding::Depth,
4825 ) -> fidl::Result<()> {
4826 encoder.debug_check_bounds::<RingBufferWatchDelayInfoResponse>(offset);
4827 fidl::encoding::Encode::<RingBufferWatchDelayInfoResponse, D>::encode(
4829 (<DelayInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.delay_info),),
4830 encoder,
4831 offset,
4832 _depth,
4833 )
4834 }
4835 }
4836 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DelayInfo, D>>
4837 fidl::encoding::Encode<RingBufferWatchDelayInfoResponse, D> for (T0,)
4838 {
4839 #[inline]
4840 unsafe fn encode(
4841 self,
4842 encoder: &mut fidl::encoding::Encoder<'_, D>,
4843 offset: usize,
4844 depth: fidl::encoding::Depth,
4845 ) -> fidl::Result<()> {
4846 encoder.debug_check_bounds::<RingBufferWatchDelayInfoResponse>(offset);
4847 self.0.encode(encoder, offset + 0, depth)?;
4851 Ok(())
4852 }
4853 }
4854
4855 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4856 for RingBufferWatchDelayInfoResponse
4857 {
4858 #[inline(always)]
4859 fn new_empty() -> Self {
4860 Self { delay_info: fidl::new_empty!(DelayInfo, D) }
4861 }
4862
4863 #[inline]
4864 unsafe fn decode(
4865 &mut self,
4866 decoder: &mut fidl::encoding::Decoder<'_, D>,
4867 offset: usize,
4868 _depth: fidl::encoding::Depth,
4869 ) -> fidl::Result<()> {
4870 decoder.debug_check_bounds::<Self>(offset);
4871 fidl::decode!(DelayInfo, D, &mut self.delay_info, decoder, offset + 0, _depth)?;
4873 Ok(())
4874 }
4875 }
4876
4877 impl fidl::encoding::ValueTypeMarker for StreamConfigGetPropertiesResponse {
4878 type Borrowed<'a> = &'a Self;
4879 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4880 value
4881 }
4882 }
4883
4884 unsafe impl fidl::encoding::TypeMarker for StreamConfigGetPropertiesResponse {
4885 type Owned = Self;
4886
4887 #[inline(always)]
4888 fn inline_align(_context: fidl::encoding::Context) -> usize {
4889 8
4890 }
4891
4892 #[inline(always)]
4893 fn inline_size(_context: fidl::encoding::Context) -> usize {
4894 16
4895 }
4896 }
4897
4898 unsafe impl<D: fidl::encoding::ResourceDialect>
4899 fidl::encoding::Encode<StreamConfigGetPropertiesResponse, D>
4900 for &StreamConfigGetPropertiesResponse
4901 {
4902 #[inline]
4903 unsafe fn encode(
4904 self,
4905 encoder: &mut fidl::encoding::Encoder<'_, D>,
4906 offset: usize,
4907 _depth: fidl::encoding::Depth,
4908 ) -> fidl::Result<()> {
4909 encoder.debug_check_bounds::<StreamConfigGetPropertiesResponse>(offset);
4910 fidl::encoding::Encode::<StreamConfigGetPropertiesResponse, D>::encode(
4912 (<StreamProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
4913 encoder,
4914 offset,
4915 _depth,
4916 )
4917 }
4918 }
4919 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamProperties, D>>
4920 fidl::encoding::Encode<StreamConfigGetPropertiesResponse, D> for (T0,)
4921 {
4922 #[inline]
4923 unsafe fn encode(
4924 self,
4925 encoder: &mut fidl::encoding::Encoder<'_, D>,
4926 offset: usize,
4927 depth: fidl::encoding::Depth,
4928 ) -> fidl::Result<()> {
4929 encoder.debug_check_bounds::<StreamConfigGetPropertiesResponse>(offset);
4930 self.0.encode(encoder, offset + 0, depth)?;
4934 Ok(())
4935 }
4936 }
4937
4938 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4939 for StreamConfigGetPropertiesResponse
4940 {
4941 #[inline(always)]
4942 fn new_empty() -> Self {
4943 Self { properties: fidl::new_empty!(StreamProperties, D) }
4944 }
4945
4946 #[inline]
4947 unsafe fn decode(
4948 &mut self,
4949 decoder: &mut fidl::encoding::Decoder<'_, D>,
4950 offset: usize,
4951 _depth: fidl::encoding::Depth,
4952 ) -> fidl::Result<()> {
4953 decoder.debug_check_bounds::<Self>(offset);
4954 fidl::decode!(StreamProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
4956 Ok(())
4957 }
4958 }
4959
4960 impl fidl::encoding::ValueTypeMarker for StreamConfigGetSupportedFormatsResponse {
4961 type Borrowed<'a> = &'a Self;
4962 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4963 value
4964 }
4965 }
4966
4967 unsafe impl fidl::encoding::TypeMarker for StreamConfigGetSupportedFormatsResponse {
4968 type Owned = Self;
4969
4970 #[inline(always)]
4971 fn inline_align(_context: fidl::encoding::Context) -> usize {
4972 8
4973 }
4974
4975 #[inline(always)]
4976 fn inline_size(_context: fidl::encoding::Context) -> usize {
4977 16
4978 }
4979 }
4980
4981 unsafe impl<D: fidl::encoding::ResourceDialect>
4982 fidl::encoding::Encode<StreamConfigGetSupportedFormatsResponse, D>
4983 for &StreamConfigGetSupportedFormatsResponse
4984 {
4985 #[inline]
4986 unsafe fn encode(
4987 self,
4988 encoder: &mut fidl::encoding::Encoder<'_, D>,
4989 offset: usize,
4990 _depth: fidl::encoding::Depth,
4991 ) -> fidl::Result<()> {
4992 encoder.debug_check_bounds::<StreamConfigGetSupportedFormatsResponse>(offset);
4993 fidl::encoding::Encode::<StreamConfigGetSupportedFormatsResponse, D>::encode(
4995 (
4996 <fidl::encoding::Vector<SupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_formats),
4997 ),
4998 encoder, offset, _depth
4999 )
5000 }
5001 }
5002 unsafe impl<
5003 D: fidl::encoding::ResourceDialect,
5004 T0: fidl::encoding::Encode<fidl::encoding::Vector<SupportedFormats, 64>, D>,
5005 > fidl::encoding::Encode<StreamConfigGetSupportedFormatsResponse, D> for (T0,)
5006 {
5007 #[inline]
5008 unsafe fn encode(
5009 self,
5010 encoder: &mut fidl::encoding::Encoder<'_, D>,
5011 offset: usize,
5012 depth: fidl::encoding::Depth,
5013 ) -> fidl::Result<()> {
5014 encoder.debug_check_bounds::<StreamConfigGetSupportedFormatsResponse>(offset);
5015 self.0.encode(encoder, offset + 0, depth)?;
5019 Ok(())
5020 }
5021 }
5022
5023 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5024 for StreamConfigGetSupportedFormatsResponse
5025 {
5026 #[inline(always)]
5027 fn new_empty() -> Self {
5028 Self {
5029 supported_formats: fidl::new_empty!(fidl::encoding::Vector<SupportedFormats, 64>, D),
5030 }
5031 }
5032
5033 #[inline]
5034 unsafe fn decode(
5035 &mut self,
5036 decoder: &mut fidl::encoding::Decoder<'_, D>,
5037 offset: usize,
5038 _depth: fidl::encoding::Depth,
5039 ) -> fidl::Result<()> {
5040 decoder.debug_check_bounds::<Self>(offset);
5041 fidl::decode!(fidl::encoding::Vector<SupportedFormats, 64>, D, &mut self.supported_formats, decoder, offset + 0, _depth)?;
5043 Ok(())
5044 }
5045 }
5046
5047 impl fidl::encoding::ValueTypeMarker for StreamConfigSetGainRequest {
5048 type Borrowed<'a> = &'a Self;
5049 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5050 value
5051 }
5052 }
5053
5054 unsafe impl fidl::encoding::TypeMarker for StreamConfigSetGainRequest {
5055 type Owned = Self;
5056
5057 #[inline(always)]
5058 fn inline_align(_context: fidl::encoding::Context) -> usize {
5059 8
5060 }
5061
5062 #[inline(always)]
5063 fn inline_size(_context: fidl::encoding::Context) -> usize {
5064 16
5065 }
5066 }
5067
5068 unsafe impl<D: fidl::encoding::ResourceDialect>
5069 fidl::encoding::Encode<StreamConfigSetGainRequest, D> for &StreamConfigSetGainRequest
5070 {
5071 #[inline]
5072 unsafe fn encode(
5073 self,
5074 encoder: &mut fidl::encoding::Encoder<'_, D>,
5075 offset: usize,
5076 _depth: fidl::encoding::Depth,
5077 ) -> fidl::Result<()> {
5078 encoder.debug_check_bounds::<StreamConfigSetGainRequest>(offset);
5079 fidl::encoding::Encode::<StreamConfigSetGainRequest, D>::encode(
5081 (<GainState as fidl::encoding::ValueTypeMarker>::borrow(&self.target_state),),
5082 encoder,
5083 offset,
5084 _depth,
5085 )
5086 }
5087 }
5088 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GainState, D>>
5089 fidl::encoding::Encode<StreamConfigSetGainRequest, D> for (T0,)
5090 {
5091 #[inline]
5092 unsafe fn encode(
5093 self,
5094 encoder: &mut fidl::encoding::Encoder<'_, D>,
5095 offset: usize,
5096 depth: fidl::encoding::Depth,
5097 ) -> fidl::Result<()> {
5098 encoder.debug_check_bounds::<StreamConfigSetGainRequest>(offset);
5099 self.0.encode(encoder, offset + 0, depth)?;
5103 Ok(())
5104 }
5105 }
5106
5107 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5108 for StreamConfigSetGainRequest
5109 {
5110 #[inline(always)]
5111 fn new_empty() -> Self {
5112 Self { target_state: fidl::new_empty!(GainState, D) }
5113 }
5114
5115 #[inline]
5116 unsafe fn decode(
5117 &mut self,
5118 decoder: &mut fidl::encoding::Decoder<'_, D>,
5119 offset: usize,
5120 _depth: fidl::encoding::Depth,
5121 ) -> fidl::Result<()> {
5122 decoder.debug_check_bounds::<Self>(offset);
5123 fidl::decode!(GainState, D, &mut self.target_state, decoder, offset + 0, _depth)?;
5125 Ok(())
5126 }
5127 }
5128
5129 impl fidl::encoding::ValueTypeMarker for StreamConfigWatchGainStateResponse {
5130 type Borrowed<'a> = &'a Self;
5131 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5132 value
5133 }
5134 }
5135
5136 unsafe impl fidl::encoding::TypeMarker for StreamConfigWatchGainStateResponse {
5137 type Owned = Self;
5138
5139 #[inline(always)]
5140 fn inline_align(_context: fidl::encoding::Context) -> usize {
5141 8
5142 }
5143
5144 #[inline(always)]
5145 fn inline_size(_context: fidl::encoding::Context) -> usize {
5146 16
5147 }
5148 }
5149
5150 unsafe impl<D: fidl::encoding::ResourceDialect>
5151 fidl::encoding::Encode<StreamConfigWatchGainStateResponse, D>
5152 for &StreamConfigWatchGainStateResponse
5153 {
5154 #[inline]
5155 unsafe fn encode(
5156 self,
5157 encoder: &mut fidl::encoding::Encoder<'_, D>,
5158 offset: usize,
5159 _depth: fidl::encoding::Depth,
5160 ) -> fidl::Result<()> {
5161 encoder.debug_check_bounds::<StreamConfigWatchGainStateResponse>(offset);
5162 fidl::encoding::Encode::<StreamConfigWatchGainStateResponse, D>::encode(
5164 (<GainState as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_state),),
5165 encoder,
5166 offset,
5167 _depth,
5168 )
5169 }
5170 }
5171 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GainState, D>>
5172 fidl::encoding::Encode<StreamConfigWatchGainStateResponse, D> for (T0,)
5173 {
5174 #[inline]
5175 unsafe fn encode(
5176 self,
5177 encoder: &mut fidl::encoding::Encoder<'_, D>,
5178 offset: usize,
5179 depth: fidl::encoding::Depth,
5180 ) -> fidl::Result<()> {
5181 encoder.debug_check_bounds::<StreamConfigWatchGainStateResponse>(offset);
5182 self.0.encode(encoder, offset + 0, depth)?;
5186 Ok(())
5187 }
5188 }
5189
5190 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5191 for StreamConfigWatchGainStateResponse
5192 {
5193 #[inline(always)]
5194 fn new_empty() -> Self {
5195 Self { gain_state: fidl::new_empty!(GainState, D) }
5196 }
5197
5198 #[inline]
5199 unsafe fn decode(
5200 &mut self,
5201 decoder: &mut fidl::encoding::Decoder<'_, D>,
5202 offset: usize,
5203 _depth: fidl::encoding::Depth,
5204 ) -> fidl::Result<()> {
5205 decoder.debug_check_bounds::<Self>(offset);
5206 fidl::decode!(GainState, D, &mut self.gain_state, decoder, offset + 0, _depth)?;
5208 Ok(())
5209 }
5210 }
5211
5212 impl fidl::encoding::ValueTypeMarker for StreamConfigWatchPlugStateResponse {
5213 type Borrowed<'a> = &'a Self;
5214 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5215 value
5216 }
5217 }
5218
5219 unsafe impl fidl::encoding::TypeMarker for StreamConfigWatchPlugStateResponse {
5220 type Owned = Self;
5221
5222 #[inline(always)]
5223 fn inline_align(_context: fidl::encoding::Context) -> usize {
5224 8
5225 }
5226
5227 #[inline(always)]
5228 fn inline_size(_context: fidl::encoding::Context) -> usize {
5229 16
5230 }
5231 }
5232
5233 unsafe impl<D: fidl::encoding::ResourceDialect>
5234 fidl::encoding::Encode<StreamConfigWatchPlugStateResponse, D>
5235 for &StreamConfigWatchPlugStateResponse
5236 {
5237 #[inline]
5238 unsafe fn encode(
5239 self,
5240 encoder: &mut fidl::encoding::Encoder<'_, D>,
5241 offset: usize,
5242 _depth: fidl::encoding::Depth,
5243 ) -> fidl::Result<()> {
5244 encoder.debug_check_bounds::<StreamConfigWatchPlugStateResponse>(offset);
5245 fidl::encoding::Encode::<StreamConfigWatchPlugStateResponse, D>::encode(
5247 (<PlugState as fidl::encoding::ValueTypeMarker>::borrow(&self.plug_state),),
5248 encoder,
5249 offset,
5250 _depth,
5251 )
5252 }
5253 }
5254 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlugState, D>>
5255 fidl::encoding::Encode<StreamConfigWatchPlugStateResponse, D> for (T0,)
5256 {
5257 #[inline]
5258 unsafe fn encode(
5259 self,
5260 encoder: &mut fidl::encoding::Encoder<'_, D>,
5261 offset: usize,
5262 depth: fidl::encoding::Depth,
5263 ) -> fidl::Result<()> {
5264 encoder.debug_check_bounds::<StreamConfigWatchPlugStateResponse>(offset);
5265 self.0.encode(encoder, offset + 0, depth)?;
5269 Ok(())
5270 }
5271 }
5272
5273 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5274 for StreamConfigWatchPlugStateResponse
5275 {
5276 #[inline(always)]
5277 fn new_empty() -> Self {
5278 Self { plug_state: fidl::new_empty!(PlugState, D) }
5279 }
5280
5281 #[inline]
5282 unsafe fn decode(
5283 &mut self,
5284 decoder: &mut fidl::encoding::Decoder<'_, D>,
5285 offset: usize,
5286 _depth: fidl::encoding::Depth,
5287 ) -> fidl::Result<()> {
5288 decoder.debug_check_bounds::<Self>(offset);
5289 fidl::decode!(PlugState, D, &mut self.plug_state, decoder, offset + 0, _depth)?;
5291 Ok(())
5292 }
5293 }
5294
5295 impl ChannelAttributes {
5296 #[inline(always)]
5297 fn max_ordinal_present(&self) -> u64 {
5298 if let Some(_) = self.max_frequency {
5299 return 2;
5300 }
5301 if let Some(_) = self.min_frequency {
5302 return 1;
5303 }
5304 0
5305 }
5306 }
5307
5308 impl fidl::encoding::ValueTypeMarker for ChannelAttributes {
5309 type Borrowed<'a> = &'a Self;
5310 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5311 value
5312 }
5313 }
5314
5315 unsafe impl fidl::encoding::TypeMarker for ChannelAttributes {
5316 type Owned = Self;
5317
5318 #[inline(always)]
5319 fn inline_align(_context: fidl::encoding::Context) -> usize {
5320 8
5321 }
5322
5323 #[inline(always)]
5324 fn inline_size(_context: fidl::encoding::Context) -> usize {
5325 16
5326 }
5327 }
5328
5329 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelAttributes, D>
5330 for &ChannelAttributes
5331 {
5332 unsafe fn encode(
5333 self,
5334 encoder: &mut fidl::encoding::Encoder<'_, D>,
5335 offset: usize,
5336 mut depth: fidl::encoding::Depth,
5337 ) -> fidl::Result<()> {
5338 encoder.debug_check_bounds::<ChannelAttributes>(offset);
5339 let max_ordinal: u64 = self.max_ordinal_present();
5341 encoder.write_num(max_ordinal, offset);
5342 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5343 if max_ordinal == 0 {
5345 return Ok(());
5346 }
5347 depth.increment()?;
5348 let envelope_size = 8;
5349 let bytes_len = max_ordinal as usize * envelope_size;
5350 #[allow(unused_variables)]
5351 let offset = encoder.out_of_line_offset(bytes_len);
5352 let mut _prev_end_offset: usize = 0;
5353 if 1 > max_ordinal {
5354 return Ok(());
5355 }
5356
5357 let cur_offset: usize = (1 - 1) * envelope_size;
5360
5361 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5363
5364 fidl::encoding::encode_in_envelope_optional::<u32, D>(
5369 self.min_frequency.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5370 encoder,
5371 offset + cur_offset,
5372 depth,
5373 )?;
5374
5375 _prev_end_offset = cur_offset + envelope_size;
5376 if 2 > max_ordinal {
5377 return Ok(());
5378 }
5379
5380 let cur_offset: usize = (2 - 1) * envelope_size;
5383
5384 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5386
5387 fidl::encoding::encode_in_envelope_optional::<u32, D>(
5392 self.max_frequency.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5393 encoder,
5394 offset + cur_offset,
5395 depth,
5396 )?;
5397
5398 _prev_end_offset = cur_offset + envelope_size;
5399
5400 Ok(())
5401 }
5402 }
5403
5404 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelAttributes {
5405 #[inline(always)]
5406 fn new_empty() -> Self {
5407 Self::default()
5408 }
5409
5410 unsafe fn decode(
5411 &mut self,
5412 decoder: &mut fidl::encoding::Decoder<'_, D>,
5413 offset: usize,
5414 mut depth: fidl::encoding::Depth,
5415 ) -> fidl::Result<()> {
5416 decoder.debug_check_bounds::<Self>(offset);
5417 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5418 None => return Err(fidl::Error::NotNullable),
5419 Some(len) => len,
5420 };
5421 if len == 0 {
5423 return Ok(());
5424 };
5425 depth.increment()?;
5426 let envelope_size = 8;
5427 let bytes_len = len * envelope_size;
5428 let offset = decoder.out_of_line_offset(bytes_len)?;
5429 let mut _next_ordinal_to_read = 0;
5431 let mut next_offset = offset;
5432 let end_offset = offset + bytes_len;
5433 _next_ordinal_to_read += 1;
5434 if next_offset >= end_offset {
5435 return Ok(());
5436 }
5437
5438 while _next_ordinal_to_read < 1 {
5440 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5441 _next_ordinal_to_read += 1;
5442 next_offset += envelope_size;
5443 }
5444
5445 let next_out_of_line = decoder.next_out_of_line();
5446 let handles_before = decoder.remaining_handles();
5447 if let Some((inlined, num_bytes, num_handles)) =
5448 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5449 {
5450 let member_inline_size =
5451 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5452 if inlined != (member_inline_size <= 4) {
5453 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5454 }
5455 let inner_offset;
5456 let mut inner_depth = depth.clone();
5457 if inlined {
5458 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5459 inner_offset = next_offset;
5460 } else {
5461 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5462 inner_depth.increment()?;
5463 }
5464 let val_ref = self.min_frequency.get_or_insert_with(|| fidl::new_empty!(u32, D));
5465 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5466 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5467 {
5468 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5469 }
5470 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5471 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5472 }
5473 }
5474
5475 next_offset += envelope_size;
5476 _next_ordinal_to_read += 1;
5477 if next_offset >= end_offset {
5478 return Ok(());
5479 }
5480
5481 while _next_ordinal_to_read < 2 {
5483 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5484 _next_ordinal_to_read += 1;
5485 next_offset += envelope_size;
5486 }
5487
5488 let next_out_of_line = decoder.next_out_of_line();
5489 let handles_before = decoder.remaining_handles();
5490 if let Some((inlined, num_bytes, num_handles)) =
5491 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5492 {
5493 let member_inline_size =
5494 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5495 if inlined != (member_inline_size <= 4) {
5496 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5497 }
5498 let inner_offset;
5499 let mut inner_depth = depth.clone();
5500 if inlined {
5501 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5502 inner_offset = next_offset;
5503 } else {
5504 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5505 inner_depth.increment()?;
5506 }
5507 let val_ref = self.max_frequency.get_or_insert_with(|| fidl::new_empty!(u32, D));
5508 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5509 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5510 {
5511 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5512 }
5513 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5514 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5515 }
5516 }
5517
5518 next_offset += envelope_size;
5519
5520 while next_offset < end_offset {
5522 _next_ordinal_to_read += 1;
5523 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5524 next_offset += envelope_size;
5525 }
5526
5527 Ok(())
5528 }
5529 }
5530
5531 impl ChannelSet {
5532 #[inline(always)]
5533 fn max_ordinal_present(&self) -> u64 {
5534 if let Some(_) = self.attributes {
5535 return 1;
5536 }
5537 0
5538 }
5539 }
5540
5541 impl fidl::encoding::ValueTypeMarker for ChannelSet {
5542 type Borrowed<'a> = &'a Self;
5543 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5544 value
5545 }
5546 }
5547
5548 unsafe impl fidl::encoding::TypeMarker for ChannelSet {
5549 type Owned = Self;
5550
5551 #[inline(always)]
5552 fn inline_align(_context: fidl::encoding::Context) -> usize {
5553 8
5554 }
5555
5556 #[inline(always)]
5557 fn inline_size(_context: fidl::encoding::Context) -> usize {
5558 16
5559 }
5560 }
5561
5562 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelSet, D>
5563 for &ChannelSet
5564 {
5565 unsafe fn encode(
5566 self,
5567 encoder: &mut fidl::encoding::Encoder<'_, D>,
5568 offset: usize,
5569 mut depth: fidl::encoding::Depth,
5570 ) -> fidl::Result<()> {
5571 encoder.debug_check_bounds::<ChannelSet>(offset);
5572 let max_ordinal: u64 = self.max_ordinal_present();
5574 encoder.write_num(max_ordinal, offset);
5575 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5576 if max_ordinal == 0 {
5578 return Ok(());
5579 }
5580 depth.increment()?;
5581 let envelope_size = 8;
5582 let bytes_len = max_ordinal as usize * envelope_size;
5583 #[allow(unused_variables)]
5584 let offset = encoder.out_of_line_offset(bytes_len);
5585 let mut _prev_end_offset: usize = 0;
5586 if 1 > max_ordinal {
5587 return Ok(());
5588 }
5589
5590 let cur_offset: usize = (1 - 1) * envelope_size;
5593
5594 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5596
5597 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ChannelAttributes, 64>, D>(
5602 self.attributes.as_ref().map(<fidl::encoding::Vector<ChannelAttributes, 64> as fidl::encoding::ValueTypeMarker>::borrow),
5603 encoder, offset + cur_offset, depth
5604 )?;
5605
5606 _prev_end_offset = cur_offset + envelope_size;
5607
5608 Ok(())
5609 }
5610 }
5611
5612 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelSet {
5613 #[inline(always)]
5614 fn new_empty() -> Self {
5615 Self::default()
5616 }
5617
5618 unsafe fn decode(
5619 &mut self,
5620 decoder: &mut fidl::encoding::Decoder<'_, D>,
5621 offset: usize,
5622 mut depth: fidl::encoding::Depth,
5623 ) -> fidl::Result<()> {
5624 decoder.debug_check_bounds::<Self>(offset);
5625 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5626 None => return Err(fidl::Error::NotNullable),
5627 Some(len) => len,
5628 };
5629 if len == 0 {
5631 return Ok(());
5632 };
5633 depth.increment()?;
5634 let envelope_size = 8;
5635 let bytes_len = len * envelope_size;
5636 let offset = decoder.out_of_line_offset(bytes_len)?;
5637 let mut _next_ordinal_to_read = 0;
5639 let mut next_offset = offset;
5640 let end_offset = offset + bytes_len;
5641 _next_ordinal_to_read += 1;
5642 if next_offset >= end_offset {
5643 return Ok(());
5644 }
5645
5646 while _next_ordinal_to_read < 1 {
5648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5649 _next_ordinal_to_read += 1;
5650 next_offset += envelope_size;
5651 }
5652
5653 let next_out_of_line = decoder.next_out_of_line();
5654 let handles_before = decoder.remaining_handles();
5655 if let Some((inlined, num_bytes, num_handles)) =
5656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5657 {
5658 let member_inline_size = <fidl::encoding::Vector<ChannelAttributes, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5659 if inlined != (member_inline_size <= 4) {
5660 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5661 }
5662 let inner_offset;
5663 let mut inner_depth = depth.clone();
5664 if inlined {
5665 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5666 inner_offset = next_offset;
5667 } else {
5668 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5669 inner_depth.increment()?;
5670 }
5671 let val_ref = self.attributes.get_or_insert_with(
5672 || fidl::new_empty!(fidl::encoding::Vector<ChannelAttributes, 64>, D),
5673 );
5674 fidl::decode!(fidl::encoding::Vector<ChannelAttributes, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
5675 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5676 {
5677 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5678 }
5679 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5680 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5681 }
5682 }
5683
5684 next_offset += envelope_size;
5685
5686 while next_offset < end_offset {
5688 _next_ordinal_to_read += 1;
5689 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5690 next_offset += envelope_size;
5691 }
5692
5693 Ok(())
5694 }
5695 }
5696
5697 impl CodecFormatInfo {
5698 #[inline(always)]
5699 fn max_ordinal_present(&self) -> u64 {
5700 if let Some(_) = self.turn_off_delay {
5701 return 3;
5702 }
5703 if let Some(_) = self.turn_on_delay {
5704 return 2;
5705 }
5706 if let Some(_) = self.external_delay {
5707 return 1;
5708 }
5709 0
5710 }
5711 }
5712
5713 impl fidl::encoding::ValueTypeMarker for CodecFormatInfo {
5714 type Borrowed<'a> = &'a Self;
5715 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5716 value
5717 }
5718 }
5719
5720 unsafe impl fidl::encoding::TypeMarker for CodecFormatInfo {
5721 type Owned = Self;
5722
5723 #[inline(always)]
5724 fn inline_align(_context: fidl::encoding::Context) -> usize {
5725 8
5726 }
5727
5728 #[inline(always)]
5729 fn inline_size(_context: fidl::encoding::Context) -> usize {
5730 16
5731 }
5732 }
5733
5734 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CodecFormatInfo, D>
5735 for &CodecFormatInfo
5736 {
5737 unsafe fn encode(
5738 self,
5739 encoder: &mut fidl::encoding::Encoder<'_, D>,
5740 offset: usize,
5741 mut depth: fidl::encoding::Depth,
5742 ) -> fidl::Result<()> {
5743 encoder.debug_check_bounds::<CodecFormatInfo>(offset);
5744 let max_ordinal: u64 = self.max_ordinal_present();
5746 encoder.write_num(max_ordinal, offset);
5747 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5748 if max_ordinal == 0 {
5750 return Ok(());
5751 }
5752 depth.increment()?;
5753 let envelope_size = 8;
5754 let bytes_len = max_ordinal as usize * envelope_size;
5755 #[allow(unused_variables)]
5756 let offset = encoder.out_of_line_offset(bytes_len);
5757 let mut _prev_end_offset: usize = 0;
5758 if 1 > max_ordinal {
5759 return Ok(());
5760 }
5761
5762 let cur_offset: usize = (1 - 1) * envelope_size;
5765
5766 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5768
5769 fidl::encoding::encode_in_envelope_optional::<i64, D>(
5774 self.external_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5775 encoder,
5776 offset + cur_offset,
5777 depth,
5778 )?;
5779
5780 _prev_end_offset = cur_offset + envelope_size;
5781 if 2 > max_ordinal {
5782 return Ok(());
5783 }
5784
5785 let cur_offset: usize = (2 - 1) * envelope_size;
5788
5789 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5791
5792 fidl::encoding::encode_in_envelope_optional::<i64, D>(
5797 self.turn_on_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5798 encoder,
5799 offset + cur_offset,
5800 depth,
5801 )?;
5802
5803 _prev_end_offset = cur_offset + envelope_size;
5804 if 3 > max_ordinal {
5805 return Ok(());
5806 }
5807
5808 let cur_offset: usize = (3 - 1) * envelope_size;
5811
5812 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5814
5815 fidl::encoding::encode_in_envelope_optional::<i64, D>(
5820 self.turn_off_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5821 encoder,
5822 offset + cur_offset,
5823 depth,
5824 )?;
5825
5826 _prev_end_offset = cur_offset + envelope_size;
5827
5828 Ok(())
5829 }
5830 }
5831
5832 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecFormatInfo {
5833 #[inline(always)]
5834 fn new_empty() -> Self {
5835 Self::default()
5836 }
5837
5838 unsafe fn decode(
5839 &mut self,
5840 decoder: &mut fidl::encoding::Decoder<'_, D>,
5841 offset: usize,
5842 mut depth: fidl::encoding::Depth,
5843 ) -> fidl::Result<()> {
5844 decoder.debug_check_bounds::<Self>(offset);
5845 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5846 None => return Err(fidl::Error::NotNullable),
5847 Some(len) => len,
5848 };
5849 if len == 0 {
5851 return Ok(());
5852 };
5853 depth.increment()?;
5854 let envelope_size = 8;
5855 let bytes_len = len * envelope_size;
5856 let offset = decoder.out_of_line_offset(bytes_len)?;
5857 let mut _next_ordinal_to_read = 0;
5859 let mut next_offset = offset;
5860 let end_offset = offset + bytes_len;
5861 _next_ordinal_to_read += 1;
5862 if next_offset >= end_offset {
5863 return Ok(());
5864 }
5865
5866 while _next_ordinal_to_read < 1 {
5868 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5869 _next_ordinal_to_read += 1;
5870 next_offset += envelope_size;
5871 }
5872
5873 let next_out_of_line = decoder.next_out_of_line();
5874 let handles_before = decoder.remaining_handles();
5875 if let Some((inlined, num_bytes, num_handles)) =
5876 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5877 {
5878 let member_inline_size =
5879 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5880 if inlined != (member_inline_size <= 4) {
5881 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5882 }
5883 let inner_offset;
5884 let mut inner_depth = depth.clone();
5885 if inlined {
5886 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5887 inner_offset = next_offset;
5888 } else {
5889 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5890 inner_depth.increment()?;
5891 }
5892 let val_ref = self.external_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
5893 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
5894 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5895 {
5896 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5897 }
5898 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5899 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5900 }
5901 }
5902
5903 next_offset += envelope_size;
5904 _next_ordinal_to_read += 1;
5905 if next_offset >= end_offset {
5906 return Ok(());
5907 }
5908
5909 while _next_ordinal_to_read < 2 {
5911 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5912 _next_ordinal_to_read += 1;
5913 next_offset += envelope_size;
5914 }
5915
5916 let next_out_of_line = decoder.next_out_of_line();
5917 let handles_before = decoder.remaining_handles();
5918 if let Some((inlined, num_bytes, num_handles)) =
5919 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5920 {
5921 let member_inline_size =
5922 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5923 if inlined != (member_inline_size <= 4) {
5924 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5925 }
5926 let inner_offset;
5927 let mut inner_depth = depth.clone();
5928 if inlined {
5929 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5930 inner_offset = next_offset;
5931 } else {
5932 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5933 inner_depth.increment()?;
5934 }
5935 let val_ref = self.turn_on_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
5936 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
5937 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5938 {
5939 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5940 }
5941 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5942 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5943 }
5944 }
5945
5946 next_offset += envelope_size;
5947 _next_ordinal_to_read += 1;
5948 if next_offset >= end_offset {
5949 return Ok(());
5950 }
5951
5952 while _next_ordinal_to_read < 3 {
5954 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5955 _next_ordinal_to_read += 1;
5956 next_offset += envelope_size;
5957 }
5958
5959 let next_out_of_line = decoder.next_out_of_line();
5960 let handles_before = decoder.remaining_handles();
5961 if let Some((inlined, num_bytes, num_handles)) =
5962 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5963 {
5964 let member_inline_size =
5965 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5966 if inlined != (member_inline_size <= 4) {
5967 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5968 }
5969 let inner_offset;
5970 let mut inner_depth = depth.clone();
5971 if inlined {
5972 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5973 inner_offset = next_offset;
5974 } else {
5975 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5976 inner_depth.increment()?;
5977 }
5978 let val_ref = self.turn_off_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
5979 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
5980 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5981 {
5982 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5983 }
5984 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5985 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5986 }
5987 }
5988
5989 next_offset += envelope_size;
5990
5991 while next_offset < end_offset {
5993 _next_ordinal_to_read += 1;
5994 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5995 next_offset += envelope_size;
5996 }
5997
5998 Ok(())
5999 }
6000 }
6001
6002 impl CodecProperties {
6003 #[inline(always)]
6004 fn max_ordinal_present(&self) -> u64 {
6005 if let Some(_) = self.plug_detect_capabilities {
6006 return 5;
6007 }
6008 if let Some(_) = self.unique_id {
6009 return 4;
6010 }
6011 if let Some(_) = self.product {
6012 return 3;
6013 }
6014 if let Some(_) = self.manufacturer {
6015 return 2;
6016 }
6017 if let Some(_) = self.is_input {
6018 return 1;
6019 }
6020 0
6021 }
6022 }
6023
6024 impl fidl::encoding::ValueTypeMarker for CodecProperties {
6025 type Borrowed<'a> = &'a Self;
6026 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6027 value
6028 }
6029 }
6030
6031 unsafe impl fidl::encoding::TypeMarker for CodecProperties {
6032 type Owned = Self;
6033
6034 #[inline(always)]
6035 fn inline_align(_context: fidl::encoding::Context) -> usize {
6036 8
6037 }
6038
6039 #[inline(always)]
6040 fn inline_size(_context: fidl::encoding::Context) -> usize {
6041 16
6042 }
6043 }
6044
6045 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CodecProperties, D>
6046 for &CodecProperties
6047 {
6048 unsafe fn encode(
6049 self,
6050 encoder: &mut fidl::encoding::Encoder<'_, D>,
6051 offset: usize,
6052 mut depth: fidl::encoding::Depth,
6053 ) -> fidl::Result<()> {
6054 encoder.debug_check_bounds::<CodecProperties>(offset);
6055 let max_ordinal: u64 = self.max_ordinal_present();
6057 encoder.write_num(max_ordinal, offset);
6058 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6059 if max_ordinal == 0 {
6061 return Ok(());
6062 }
6063 depth.increment()?;
6064 let envelope_size = 8;
6065 let bytes_len = max_ordinal as usize * envelope_size;
6066 #[allow(unused_variables)]
6067 let offset = encoder.out_of_line_offset(bytes_len);
6068 let mut _prev_end_offset: usize = 0;
6069 if 1 > max_ordinal {
6070 return Ok(());
6071 }
6072
6073 let cur_offset: usize = (1 - 1) * envelope_size;
6076
6077 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6079
6080 fidl::encoding::encode_in_envelope_optional::<bool, D>(
6085 self.is_input.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6086 encoder,
6087 offset + cur_offset,
6088 depth,
6089 )?;
6090
6091 _prev_end_offset = cur_offset + envelope_size;
6092 if 2 > max_ordinal {
6093 return Ok(());
6094 }
6095
6096 let cur_offset: usize = (2 - 1) * envelope_size;
6099
6100 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6102
6103 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
6108 self.manufacturer.as_ref().map(
6109 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
6110 ),
6111 encoder,
6112 offset + cur_offset,
6113 depth,
6114 )?;
6115
6116 _prev_end_offset = cur_offset + envelope_size;
6117 if 3 > max_ordinal {
6118 return Ok(());
6119 }
6120
6121 let cur_offset: usize = (3 - 1) * envelope_size;
6124
6125 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6127
6128 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
6133 self.product.as_ref().map(
6134 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
6135 ),
6136 encoder,
6137 offset + cur_offset,
6138 depth,
6139 )?;
6140
6141 _prev_end_offset = cur_offset + envelope_size;
6142 if 4 > max_ordinal {
6143 return Ok(());
6144 }
6145
6146 let cur_offset: usize = (4 - 1) * envelope_size;
6149
6150 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6152
6153 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
6158 self.unique_id.as_ref().map(
6159 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
6160 ),
6161 encoder,
6162 offset + cur_offset,
6163 depth,
6164 )?;
6165
6166 _prev_end_offset = cur_offset + envelope_size;
6167 if 5 > max_ordinal {
6168 return Ok(());
6169 }
6170
6171 let cur_offset: usize = (5 - 1) * envelope_size;
6174
6175 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6177
6178 fidl::encoding::encode_in_envelope_optional::<PlugDetectCapabilities, D>(
6183 self.plug_detect_capabilities
6184 .as_ref()
6185 .map(<PlugDetectCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
6186 encoder,
6187 offset + cur_offset,
6188 depth,
6189 )?;
6190
6191 _prev_end_offset = cur_offset + envelope_size;
6192
6193 Ok(())
6194 }
6195 }
6196
6197 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecProperties {
6198 #[inline(always)]
6199 fn new_empty() -> Self {
6200 Self::default()
6201 }
6202
6203 unsafe fn decode(
6204 &mut self,
6205 decoder: &mut fidl::encoding::Decoder<'_, D>,
6206 offset: usize,
6207 mut depth: fidl::encoding::Depth,
6208 ) -> fidl::Result<()> {
6209 decoder.debug_check_bounds::<Self>(offset);
6210 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6211 None => return Err(fidl::Error::NotNullable),
6212 Some(len) => len,
6213 };
6214 if len == 0 {
6216 return Ok(());
6217 };
6218 depth.increment()?;
6219 let envelope_size = 8;
6220 let bytes_len = len * envelope_size;
6221 let offset = decoder.out_of_line_offset(bytes_len)?;
6222 let mut _next_ordinal_to_read = 0;
6224 let mut next_offset = offset;
6225 let end_offset = offset + bytes_len;
6226 _next_ordinal_to_read += 1;
6227 if next_offset >= end_offset {
6228 return Ok(());
6229 }
6230
6231 while _next_ordinal_to_read < 1 {
6233 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6234 _next_ordinal_to_read += 1;
6235 next_offset += envelope_size;
6236 }
6237
6238 let next_out_of_line = decoder.next_out_of_line();
6239 let handles_before = decoder.remaining_handles();
6240 if let Some((inlined, num_bytes, num_handles)) =
6241 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6242 {
6243 let member_inline_size =
6244 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6245 if inlined != (member_inline_size <= 4) {
6246 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6247 }
6248 let inner_offset;
6249 let mut inner_depth = depth.clone();
6250 if inlined {
6251 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6252 inner_offset = next_offset;
6253 } else {
6254 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6255 inner_depth.increment()?;
6256 }
6257 let val_ref = self.is_input.get_or_insert_with(|| fidl::new_empty!(bool, D));
6258 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6259 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6260 {
6261 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6262 }
6263 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6264 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6265 }
6266 }
6267
6268 next_offset += envelope_size;
6269 _next_ordinal_to_read += 1;
6270 if next_offset >= end_offset {
6271 return Ok(());
6272 }
6273
6274 while _next_ordinal_to_read < 2 {
6276 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6277 _next_ordinal_to_read += 1;
6278 next_offset += envelope_size;
6279 }
6280
6281 let next_out_of_line = decoder.next_out_of_line();
6282 let handles_before = decoder.remaining_handles();
6283 if let Some((inlined, num_bytes, num_handles)) =
6284 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6285 {
6286 let member_inline_size =
6287 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
6288 decoder.context,
6289 );
6290 if inlined != (member_inline_size <= 4) {
6291 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6292 }
6293 let inner_offset;
6294 let mut inner_depth = depth.clone();
6295 if inlined {
6296 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6297 inner_offset = next_offset;
6298 } else {
6299 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6300 inner_depth.increment()?;
6301 }
6302 let val_ref = self
6303 .manufacturer
6304 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
6305 fidl::decode!(
6306 fidl::encoding::BoundedString<256>,
6307 D,
6308 val_ref,
6309 decoder,
6310 inner_offset,
6311 inner_depth
6312 )?;
6313 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6314 {
6315 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6316 }
6317 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6318 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6319 }
6320 }
6321
6322 next_offset += envelope_size;
6323 _next_ordinal_to_read += 1;
6324 if next_offset >= end_offset {
6325 return Ok(());
6326 }
6327
6328 while _next_ordinal_to_read < 3 {
6330 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6331 _next_ordinal_to_read += 1;
6332 next_offset += envelope_size;
6333 }
6334
6335 let next_out_of_line = decoder.next_out_of_line();
6336 let handles_before = decoder.remaining_handles();
6337 if let Some((inlined, num_bytes, num_handles)) =
6338 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6339 {
6340 let member_inline_size =
6341 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
6342 decoder.context,
6343 );
6344 if inlined != (member_inline_size <= 4) {
6345 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6346 }
6347 let inner_offset;
6348 let mut inner_depth = depth.clone();
6349 if inlined {
6350 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6351 inner_offset = next_offset;
6352 } else {
6353 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6354 inner_depth.increment()?;
6355 }
6356 let val_ref = self
6357 .product
6358 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
6359 fidl::decode!(
6360 fidl::encoding::BoundedString<256>,
6361 D,
6362 val_ref,
6363 decoder,
6364 inner_offset,
6365 inner_depth
6366 )?;
6367 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6368 {
6369 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6370 }
6371 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6372 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6373 }
6374 }
6375
6376 next_offset += envelope_size;
6377 _next_ordinal_to_read += 1;
6378 if next_offset >= end_offset {
6379 return Ok(());
6380 }
6381
6382 while _next_ordinal_to_read < 4 {
6384 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6385 _next_ordinal_to_read += 1;
6386 next_offset += envelope_size;
6387 }
6388
6389 let next_out_of_line = decoder.next_out_of_line();
6390 let handles_before = decoder.remaining_handles();
6391 if let Some((inlined, num_bytes, num_handles)) =
6392 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6393 {
6394 let member_inline_size =
6395 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
6396 decoder.context,
6397 );
6398 if inlined != (member_inline_size <= 4) {
6399 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6400 }
6401 let inner_offset;
6402 let mut inner_depth = depth.clone();
6403 if inlined {
6404 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6405 inner_offset = next_offset;
6406 } else {
6407 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6408 inner_depth.increment()?;
6409 }
6410 let val_ref = self
6411 .unique_id
6412 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
6413 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
6414 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6415 {
6416 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6417 }
6418 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6419 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6420 }
6421 }
6422
6423 next_offset += envelope_size;
6424 _next_ordinal_to_read += 1;
6425 if next_offset >= end_offset {
6426 return Ok(());
6427 }
6428
6429 while _next_ordinal_to_read < 5 {
6431 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6432 _next_ordinal_to_read += 1;
6433 next_offset += envelope_size;
6434 }
6435
6436 let next_out_of_line = decoder.next_out_of_line();
6437 let handles_before = decoder.remaining_handles();
6438 if let Some((inlined, num_bytes, num_handles)) =
6439 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6440 {
6441 let member_inline_size =
6442 <PlugDetectCapabilities as fidl::encoding::TypeMarker>::inline_size(
6443 decoder.context,
6444 );
6445 if inlined != (member_inline_size <= 4) {
6446 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6447 }
6448 let inner_offset;
6449 let mut inner_depth = depth.clone();
6450 if inlined {
6451 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6452 inner_offset = next_offset;
6453 } else {
6454 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6455 inner_depth.increment()?;
6456 }
6457 let val_ref = self
6458 .plug_detect_capabilities
6459 .get_or_insert_with(|| fidl::new_empty!(PlugDetectCapabilities, D));
6460 fidl::decode!(
6461 PlugDetectCapabilities,
6462 D,
6463 val_ref,
6464 decoder,
6465 inner_offset,
6466 inner_depth
6467 )?;
6468 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6469 {
6470 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6471 }
6472 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6473 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6474 }
6475 }
6476
6477 next_offset += envelope_size;
6478
6479 while next_offset < end_offset {
6481 _next_ordinal_to_read += 1;
6482 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6483 next_offset += envelope_size;
6484 }
6485
6486 Ok(())
6487 }
6488 }
6489
6490 impl CompositeProperties {
6491 #[inline(always)]
6492 fn max_ordinal_present(&self) -> u64 {
6493 if let Some(_) = self.clock_domain {
6494 return 5;
6495 }
6496 if let Some(_) = self.unique_id {
6497 return 4;
6498 }
6499 if let Some(_) = self.product {
6500 return 3;
6501 }
6502 if let Some(_) = self.manufacturer {
6503 return 2;
6504 }
6505 0
6506 }
6507 }
6508
6509 impl fidl::encoding::ValueTypeMarker for CompositeProperties {
6510 type Borrowed<'a> = &'a Self;
6511 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6512 value
6513 }
6514 }
6515
6516 unsafe impl fidl::encoding::TypeMarker for CompositeProperties {
6517 type Owned = Self;
6518
6519 #[inline(always)]
6520 fn inline_align(_context: fidl::encoding::Context) -> usize {
6521 8
6522 }
6523
6524 #[inline(always)]
6525 fn inline_size(_context: fidl::encoding::Context) -> usize {
6526 16
6527 }
6528 }
6529
6530 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompositeProperties, D>
6531 for &CompositeProperties
6532 {
6533 unsafe fn encode(
6534 self,
6535 encoder: &mut fidl::encoding::Encoder<'_, D>,
6536 offset: usize,
6537 mut depth: fidl::encoding::Depth,
6538 ) -> fidl::Result<()> {
6539 encoder.debug_check_bounds::<CompositeProperties>(offset);
6540 let max_ordinal: u64 = self.max_ordinal_present();
6542 encoder.write_num(max_ordinal, offset);
6543 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6544 if max_ordinal == 0 {
6546 return Ok(());
6547 }
6548 depth.increment()?;
6549 let envelope_size = 8;
6550 let bytes_len = max_ordinal as usize * envelope_size;
6551 #[allow(unused_variables)]
6552 let offset = encoder.out_of_line_offset(bytes_len);
6553 let mut _prev_end_offset: usize = 0;
6554 if 2 > max_ordinal {
6555 return Ok(());
6556 }
6557
6558 let cur_offset: usize = (2 - 1) * envelope_size;
6561
6562 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6564
6565 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
6570 self.manufacturer.as_ref().map(
6571 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
6572 ),
6573 encoder,
6574 offset + cur_offset,
6575 depth,
6576 )?;
6577
6578 _prev_end_offset = cur_offset + envelope_size;
6579 if 3 > max_ordinal {
6580 return Ok(());
6581 }
6582
6583 let cur_offset: usize = (3 - 1) * envelope_size;
6586
6587 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6589
6590 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
6595 self.product.as_ref().map(
6596 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
6597 ),
6598 encoder,
6599 offset + cur_offset,
6600 depth,
6601 )?;
6602
6603 _prev_end_offset = cur_offset + envelope_size;
6604 if 4 > max_ordinal {
6605 return Ok(());
6606 }
6607
6608 let cur_offset: usize = (4 - 1) * envelope_size;
6611
6612 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6614
6615 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
6620 self.unique_id.as_ref().map(
6621 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
6622 ),
6623 encoder,
6624 offset + cur_offset,
6625 depth,
6626 )?;
6627
6628 _prev_end_offset = cur_offset + envelope_size;
6629 if 5 > max_ordinal {
6630 return Ok(());
6631 }
6632
6633 let cur_offset: usize = (5 - 1) * envelope_size;
6636
6637 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6639
6640 fidl::encoding::encode_in_envelope_optional::<u32, D>(
6645 self.clock_domain.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
6646 encoder,
6647 offset + cur_offset,
6648 depth,
6649 )?;
6650
6651 _prev_end_offset = cur_offset + envelope_size;
6652
6653 Ok(())
6654 }
6655 }
6656
6657 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositeProperties {
6658 #[inline(always)]
6659 fn new_empty() -> Self {
6660 Self::default()
6661 }
6662
6663 unsafe fn decode(
6664 &mut self,
6665 decoder: &mut fidl::encoding::Decoder<'_, D>,
6666 offset: usize,
6667 mut depth: fidl::encoding::Depth,
6668 ) -> fidl::Result<()> {
6669 decoder.debug_check_bounds::<Self>(offset);
6670 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6671 None => return Err(fidl::Error::NotNullable),
6672 Some(len) => len,
6673 };
6674 if len == 0 {
6676 return Ok(());
6677 };
6678 depth.increment()?;
6679 let envelope_size = 8;
6680 let bytes_len = len * envelope_size;
6681 let offset = decoder.out_of_line_offset(bytes_len)?;
6682 let mut _next_ordinal_to_read = 0;
6684 let mut next_offset = offset;
6685 let end_offset = offset + bytes_len;
6686 _next_ordinal_to_read += 1;
6687 if next_offset >= end_offset {
6688 return Ok(());
6689 }
6690
6691 while _next_ordinal_to_read < 2 {
6693 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6694 _next_ordinal_to_read += 1;
6695 next_offset += envelope_size;
6696 }
6697
6698 let next_out_of_line = decoder.next_out_of_line();
6699 let handles_before = decoder.remaining_handles();
6700 if let Some((inlined, num_bytes, num_handles)) =
6701 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6702 {
6703 let member_inline_size =
6704 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
6705 decoder.context,
6706 );
6707 if inlined != (member_inline_size <= 4) {
6708 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6709 }
6710 let inner_offset;
6711 let mut inner_depth = depth.clone();
6712 if inlined {
6713 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6714 inner_offset = next_offset;
6715 } else {
6716 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6717 inner_depth.increment()?;
6718 }
6719 let val_ref = self
6720 .manufacturer
6721 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
6722 fidl::decode!(
6723 fidl::encoding::BoundedString<256>,
6724 D,
6725 val_ref,
6726 decoder,
6727 inner_offset,
6728 inner_depth
6729 )?;
6730 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6731 {
6732 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6733 }
6734 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6735 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6736 }
6737 }
6738
6739 next_offset += envelope_size;
6740 _next_ordinal_to_read += 1;
6741 if next_offset >= end_offset {
6742 return Ok(());
6743 }
6744
6745 while _next_ordinal_to_read < 3 {
6747 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6748 _next_ordinal_to_read += 1;
6749 next_offset += envelope_size;
6750 }
6751
6752 let next_out_of_line = decoder.next_out_of_line();
6753 let handles_before = decoder.remaining_handles();
6754 if let Some((inlined, num_bytes, num_handles)) =
6755 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6756 {
6757 let member_inline_size =
6758 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
6759 decoder.context,
6760 );
6761 if inlined != (member_inline_size <= 4) {
6762 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6763 }
6764 let inner_offset;
6765 let mut inner_depth = depth.clone();
6766 if inlined {
6767 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6768 inner_offset = next_offset;
6769 } else {
6770 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6771 inner_depth.increment()?;
6772 }
6773 let val_ref = self
6774 .product
6775 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
6776 fidl::decode!(
6777 fidl::encoding::BoundedString<256>,
6778 D,
6779 val_ref,
6780 decoder,
6781 inner_offset,
6782 inner_depth
6783 )?;
6784 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6785 {
6786 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6787 }
6788 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6789 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6790 }
6791 }
6792
6793 next_offset += envelope_size;
6794 _next_ordinal_to_read += 1;
6795 if next_offset >= end_offset {
6796 return Ok(());
6797 }
6798
6799 while _next_ordinal_to_read < 4 {
6801 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6802 _next_ordinal_to_read += 1;
6803 next_offset += envelope_size;
6804 }
6805
6806 let next_out_of_line = decoder.next_out_of_line();
6807 let handles_before = decoder.remaining_handles();
6808 if let Some((inlined, num_bytes, num_handles)) =
6809 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6810 {
6811 let member_inline_size =
6812 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
6813 decoder.context,
6814 );
6815 if inlined != (member_inline_size <= 4) {
6816 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6817 }
6818 let inner_offset;
6819 let mut inner_depth = depth.clone();
6820 if inlined {
6821 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6822 inner_offset = next_offset;
6823 } else {
6824 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6825 inner_depth.increment()?;
6826 }
6827 let val_ref = self
6828 .unique_id
6829 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
6830 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
6831 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6832 {
6833 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6834 }
6835 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6836 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6837 }
6838 }
6839
6840 next_offset += envelope_size;
6841 _next_ordinal_to_read += 1;
6842 if next_offset >= end_offset {
6843 return Ok(());
6844 }
6845
6846 while _next_ordinal_to_read < 5 {
6848 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6849 _next_ordinal_to_read += 1;
6850 next_offset += envelope_size;
6851 }
6852
6853 let next_out_of_line = decoder.next_out_of_line();
6854 let handles_before = decoder.remaining_handles();
6855 if let Some((inlined, num_bytes, num_handles)) =
6856 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6857 {
6858 let member_inline_size =
6859 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6860 if inlined != (member_inline_size <= 4) {
6861 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6862 }
6863 let inner_offset;
6864 let mut inner_depth = depth.clone();
6865 if inlined {
6866 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6867 inner_offset = next_offset;
6868 } else {
6869 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6870 inner_depth.increment()?;
6871 }
6872 let val_ref = self.clock_domain.get_or_insert_with(|| fidl::new_empty!(u32, D));
6873 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
6874 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6875 {
6876 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6877 }
6878 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6879 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6880 }
6881 }
6882
6883 next_offset += envelope_size;
6884
6885 while next_offset < end_offset {
6887 _next_ordinal_to_read += 1;
6888 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6889 next_offset += envelope_size;
6890 }
6891
6892 Ok(())
6893 }
6894 }
6895
6896 impl DaiProperties {
6897 #[inline(always)]
6898 fn max_ordinal_present(&self) -> u64 {
6899 if let Some(_) = self.clock_domain {
6900 return 5;
6901 }
6902 if let Some(_) = self.unique_id {
6903 return 4;
6904 }
6905 if let Some(_) = self.product_name {
6906 return 3;
6907 }
6908 if let Some(_) = self.manufacturer {
6909 return 2;
6910 }
6911 if let Some(_) = self.is_input {
6912 return 1;
6913 }
6914 0
6915 }
6916 }
6917
6918 impl fidl::encoding::ValueTypeMarker for DaiProperties {
6919 type Borrowed<'a> = &'a Self;
6920 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6921 value
6922 }
6923 }
6924
6925 unsafe impl fidl::encoding::TypeMarker for DaiProperties {
6926 type Owned = Self;
6927
6928 #[inline(always)]
6929 fn inline_align(_context: fidl::encoding::Context) -> usize {
6930 8
6931 }
6932
6933 #[inline(always)]
6934 fn inline_size(_context: fidl::encoding::Context) -> usize {
6935 16
6936 }
6937 }
6938
6939 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiProperties, D>
6940 for &DaiProperties
6941 {
6942 unsafe fn encode(
6943 self,
6944 encoder: &mut fidl::encoding::Encoder<'_, D>,
6945 offset: usize,
6946 mut depth: fidl::encoding::Depth,
6947 ) -> fidl::Result<()> {
6948 encoder.debug_check_bounds::<DaiProperties>(offset);
6949 let max_ordinal: u64 = self.max_ordinal_present();
6951 encoder.write_num(max_ordinal, offset);
6952 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6953 if max_ordinal == 0 {
6955 return Ok(());
6956 }
6957 depth.increment()?;
6958 let envelope_size = 8;
6959 let bytes_len = max_ordinal as usize * envelope_size;
6960 #[allow(unused_variables)]
6961 let offset = encoder.out_of_line_offset(bytes_len);
6962 let mut _prev_end_offset: usize = 0;
6963 if 1 > max_ordinal {
6964 return Ok(());
6965 }
6966
6967 let cur_offset: usize = (1 - 1) * envelope_size;
6970
6971 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6973
6974 fidl::encoding::encode_in_envelope_optional::<bool, D>(
6979 self.is_input.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6980 encoder,
6981 offset + cur_offset,
6982 depth,
6983 )?;
6984
6985 _prev_end_offset = cur_offset + envelope_size;
6986 if 2 > max_ordinal {
6987 return Ok(());
6988 }
6989
6990 let cur_offset: usize = (2 - 1) * envelope_size;
6993
6994 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6996
6997 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
7002 self.manufacturer.as_ref().map(
7003 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
7004 ),
7005 encoder,
7006 offset + cur_offset,
7007 depth,
7008 )?;
7009
7010 _prev_end_offset = cur_offset + envelope_size;
7011 if 3 > max_ordinal {
7012 return Ok(());
7013 }
7014
7015 let cur_offset: usize = (3 - 1) * envelope_size;
7018
7019 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7021
7022 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
7027 self.product_name.as_ref().map(
7028 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
7029 ),
7030 encoder,
7031 offset + cur_offset,
7032 depth,
7033 )?;
7034
7035 _prev_end_offset = cur_offset + envelope_size;
7036 if 4 > max_ordinal {
7037 return Ok(());
7038 }
7039
7040 let cur_offset: usize = (4 - 1) * envelope_size;
7043
7044 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7046
7047 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
7052 self.unique_id.as_ref().map(
7053 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
7054 ),
7055 encoder,
7056 offset + cur_offset,
7057 depth,
7058 )?;
7059
7060 _prev_end_offset = cur_offset + envelope_size;
7061 if 5 > max_ordinal {
7062 return Ok(());
7063 }
7064
7065 let cur_offset: usize = (5 - 1) * envelope_size;
7068
7069 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7071
7072 fidl::encoding::encode_in_envelope_optional::<u32, D>(
7077 self.clock_domain.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
7078 encoder,
7079 offset + cur_offset,
7080 depth,
7081 )?;
7082
7083 _prev_end_offset = cur_offset + envelope_size;
7084
7085 Ok(())
7086 }
7087 }
7088
7089 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiProperties {
7090 #[inline(always)]
7091 fn new_empty() -> Self {
7092 Self::default()
7093 }
7094
7095 unsafe fn decode(
7096 &mut self,
7097 decoder: &mut fidl::encoding::Decoder<'_, D>,
7098 offset: usize,
7099 mut depth: fidl::encoding::Depth,
7100 ) -> fidl::Result<()> {
7101 decoder.debug_check_bounds::<Self>(offset);
7102 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7103 None => return Err(fidl::Error::NotNullable),
7104 Some(len) => len,
7105 };
7106 if len == 0 {
7108 return Ok(());
7109 };
7110 depth.increment()?;
7111 let envelope_size = 8;
7112 let bytes_len = len * envelope_size;
7113 let offset = decoder.out_of_line_offset(bytes_len)?;
7114 let mut _next_ordinal_to_read = 0;
7116 let mut next_offset = offset;
7117 let end_offset = offset + bytes_len;
7118 _next_ordinal_to_read += 1;
7119 if next_offset >= end_offset {
7120 return Ok(());
7121 }
7122
7123 while _next_ordinal_to_read < 1 {
7125 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7126 _next_ordinal_to_read += 1;
7127 next_offset += envelope_size;
7128 }
7129
7130 let next_out_of_line = decoder.next_out_of_line();
7131 let handles_before = decoder.remaining_handles();
7132 if let Some((inlined, num_bytes, num_handles)) =
7133 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7134 {
7135 let member_inline_size =
7136 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7137 if inlined != (member_inline_size <= 4) {
7138 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7139 }
7140 let inner_offset;
7141 let mut inner_depth = depth.clone();
7142 if inlined {
7143 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7144 inner_offset = next_offset;
7145 } else {
7146 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7147 inner_depth.increment()?;
7148 }
7149 let val_ref = self.is_input.get_or_insert_with(|| fidl::new_empty!(bool, D));
7150 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7151 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7152 {
7153 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7154 }
7155 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7156 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7157 }
7158 }
7159
7160 next_offset += envelope_size;
7161 _next_ordinal_to_read += 1;
7162 if next_offset >= end_offset {
7163 return Ok(());
7164 }
7165
7166 while _next_ordinal_to_read < 2 {
7168 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7169 _next_ordinal_to_read += 1;
7170 next_offset += envelope_size;
7171 }
7172
7173 let next_out_of_line = decoder.next_out_of_line();
7174 let handles_before = decoder.remaining_handles();
7175 if let Some((inlined, num_bytes, num_handles)) =
7176 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7177 {
7178 let member_inline_size =
7179 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
7180 decoder.context,
7181 );
7182 if inlined != (member_inline_size <= 4) {
7183 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7184 }
7185 let inner_offset;
7186 let mut inner_depth = depth.clone();
7187 if inlined {
7188 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7189 inner_offset = next_offset;
7190 } else {
7191 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7192 inner_depth.increment()?;
7193 }
7194 let val_ref = self
7195 .manufacturer
7196 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
7197 fidl::decode!(
7198 fidl::encoding::BoundedString<256>,
7199 D,
7200 val_ref,
7201 decoder,
7202 inner_offset,
7203 inner_depth
7204 )?;
7205 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7206 {
7207 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7208 }
7209 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7210 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7211 }
7212 }
7213
7214 next_offset += envelope_size;
7215 _next_ordinal_to_read += 1;
7216 if next_offset >= end_offset {
7217 return Ok(());
7218 }
7219
7220 while _next_ordinal_to_read < 3 {
7222 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7223 _next_ordinal_to_read += 1;
7224 next_offset += envelope_size;
7225 }
7226
7227 let next_out_of_line = decoder.next_out_of_line();
7228 let handles_before = decoder.remaining_handles();
7229 if let Some((inlined, num_bytes, num_handles)) =
7230 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7231 {
7232 let member_inline_size =
7233 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
7234 decoder.context,
7235 );
7236 if inlined != (member_inline_size <= 4) {
7237 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7238 }
7239 let inner_offset;
7240 let mut inner_depth = depth.clone();
7241 if inlined {
7242 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7243 inner_offset = next_offset;
7244 } else {
7245 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7246 inner_depth.increment()?;
7247 }
7248 let val_ref = self
7249 .product_name
7250 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
7251 fidl::decode!(
7252 fidl::encoding::BoundedString<256>,
7253 D,
7254 val_ref,
7255 decoder,
7256 inner_offset,
7257 inner_depth
7258 )?;
7259 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7260 {
7261 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7262 }
7263 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7264 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7265 }
7266 }
7267
7268 next_offset += envelope_size;
7269 _next_ordinal_to_read += 1;
7270 if next_offset >= end_offset {
7271 return Ok(());
7272 }
7273
7274 while _next_ordinal_to_read < 4 {
7276 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7277 _next_ordinal_to_read += 1;
7278 next_offset += envelope_size;
7279 }
7280
7281 let next_out_of_line = decoder.next_out_of_line();
7282 let handles_before = decoder.remaining_handles();
7283 if let Some((inlined, num_bytes, num_handles)) =
7284 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7285 {
7286 let member_inline_size =
7287 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
7288 decoder.context,
7289 );
7290 if inlined != (member_inline_size <= 4) {
7291 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7292 }
7293 let inner_offset;
7294 let mut inner_depth = depth.clone();
7295 if inlined {
7296 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7297 inner_offset = next_offset;
7298 } else {
7299 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7300 inner_depth.increment()?;
7301 }
7302 let val_ref = self
7303 .unique_id
7304 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
7305 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
7306 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7307 {
7308 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7309 }
7310 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7311 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7312 }
7313 }
7314
7315 next_offset += envelope_size;
7316 _next_ordinal_to_read += 1;
7317 if next_offset >= end_offset {
7318 return Ok(());
7319 }
7320
7321 while _next_ordinal_to_read < 5 {
7323 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7324 _next_ordinal_to_read += 1;
7325 next_offset += envelope_size;
7326 }
7327
7328 let next_out_of_line = decoder.next_out_of_line();
7329 let handles_before = decoder.remaining_handles();
7330 if let Some((inlined, num_bytes, num_handles)) =
7331 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7332 {
7333 let member_inline_size =
7334 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7335 if inlined != (member_inline_size <= 4) {
7336 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7337 }
7338 let inner_offset;
7339 let mut inner_depth = depth.clone();
7340 if inlined {
7341 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7342 inner_offset = next_offset;
7343 } else {
7344 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7345 inner_depth.increment()?;
7346 }
7347 let val_ref = self.clock_domain.get_or_insert_with(|| fidl::new_empty!(u32, D));
7348 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
7349 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7350 {
7351 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7352 }
7353 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7354 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7355 }
7356 }
7357
7358 next_offset += envelope_size;
7359
7360 while next_offset < end_offset {
7362 _next_ordinal_to_read += 1;
7363 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7364 next_offset += envelope_size;
7365 }
7366
7367 Ok(())
7368 }
7369 }
7370
7371 impl DelayInfo {
7372 #[inline(always)]
7373 fn max_ordinal_present(&self) -> u64 {
7374 if let Some(_) = self.external_delay {
7375 return 2;
7376 }
7377 if let Some(_) = self.internal_delay {
7378 return 1;
7379 }
7380 0
7381 }
7382 }
7383
7384 impl fidl::encoding::ValueTypeMarker for DelayInfo {
7385 type Borrowed<'a> = &'a Self;
7386 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7387 value
7388 }
7389 }
7390
7391 unsafe impl fidl::encoding::TypeMarker for DelayInfo {
7392 type Owned = Self;
7393
7394 #[inline(always)]
7395 fn inline_align(_context: fidl::encoding::Context) -> usize {
7396 8
7397 }
7398
7399 #[inline(always)]
7400 fn inline_size(_context: fidl::encoding::Context) -> usize {
7401 16
7402 }
7403 }
7404
7405 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DelayInfo, D>
7406 for &DelayInfo
7407 {
7408 unsafe fn encode(
7409 self,
7410 encoder: &mut fidl::encoding::Encoder<'_, D>,
7411 offset: usize,
7412 mut depth: fidl::encoding::Depth,
7413 ) -> fidl::Result<()> {
7414 encoder.debug_check_bounds::<DelayInfo>(offset);
7415 let max_ordinal: u64 = self.max_ordinal_present();
7417 encoder.write_num(max_ordinal, offset);
7418 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7419 if max_ordinal == 0 {
7421 return Ok(());
7422 }
7423 depth.increment()?;
7424 let envelope_size = 8;
7425 let bytes_len = max_ordinal as usize * envelope_size;
7426 #[allow(unused_variables)]
7427 let offset = encoder.out_of_line_offset(bytes_len);
7428 let mut _prev_end_offset: usize = 0;
7429 if 1 > max_ordinal {
7430 return Ok(());
7431 }
7432
7433 let cur_offset: usize = (1 - 1) * envelope_size;
7436
7437 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7439
7440 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7445 self.internal_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7446 encoder,
7447 offset + cur_offset,
7448 depth,
7449 )?;
7450
7451 _prev_end_offset = cur_offset + envelope_size;
7452 if 2 > max_ordinal {
7453 return Ok(());
7454 }
7455
7456 let cur_offset: usize = (2 - 1) * envelope_size;
7459
7460 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7462
7463 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7468 self.external_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7469 encoder,
7470 offset + cur_offset,
7471 depth,
7472 )?;
7473
7474 _prev_end_offset = cur_offset + envelope_size;
7475
7476 Ok(())
7477 }
7478 }
7479
7480 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DelayInfo {
7481 #[inline(always)]
7482 fn new_empty() -> Self {
7483 Self::default()
7484 }
7485
7486 unsafe fn decode(
7487 &mut self,
7488 decoder: &mut fidl::encoding::Decoder<'_, D>,
7489 offset: usize,
7490 mut depth: fidl::encoding::Depth,
7491 ) -> fidl::Result<()> {
7492 decoder.debug_check_bounds::<Self>(offset);
7493 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7494 None => return Err(fidl::Error::NotNullable),
7495 Some(len) => len,
7496 };
7497 if len == 0 {
7499 return Ok(());
7500 };
7501 depth.increment()?;
7502 let envelope_size = 8;
7503 let bytes_len = len * envelope_size;
7504 let offset = decoder.out_of_line_offset(bytes_len)?;
7505 let mut _next_ordinal_to_read = 0;
7507 let mut next_offset = offset;
7508 let end_offset = offset + bytes_len;
7509 _next_ordinal_to_read += 1;
7510 if next_offset >= end_offset {
7511 return Ok(());
7512 }
7513
7514 while _next_ordinal_to_read < 1 {
7516 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7517 _next_ordinal_to_read += 1;
7518 next_offset += envelope_size;
7519 }
7520
7521 let next_out_of_line = decoder.next_out_of_line();
7522 let handles_before = decoder.remaining_handles();
7523 if let Some((inlined, num_bytes, num_handles)) =
7524 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7525 {
7526 let member_inline_size =
7527 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7528 if inlined != (member_inline_size <= 4) {
7529 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7530 }
7531 let inner_offset;
7532 let mut inner_depth = depth.clone();
7533 if inlined {
7534 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7535 inner_offset = next_offset;
7536 } else {
7537 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7538 inner_depth.increment()?;
7539 }
7540 let val_ref = self.internal_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
7541 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7542 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7543 {
7544 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7545 }
7546 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7547 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7548 }
7549 }
7550
7551 next_offset += envelope_size;
7552 _next_ordinal_to_read += 1;
7553 if next_offset >= end_offset {
7554 return Ok(());
7555 }
7556
7557 while _next_ordinal_to_read < 2 {
7559 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7560 _next_ordinal_to_read += 1;
7561 next_offset += envelope_size;
7562 }
7563
7564 let next_out_of_line = decoder.next_out_of_line();
7565 let handles_before = decoder.remaining_handles();
7566 if let Some((inlined, num_bytes, num_handles)) =
7567 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7568 {
7569 let member_inline_size =
7570 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7571 if inlined != (member_inline_size <= 4) {
7572 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7573 }
7574 let inner_offset;
7575 let mut inner_depth = depth.clone();
7576 if inlined {
7577 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7578 inner_offset = next_offset;
7579 } else {
7580 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7581 inner_depth.increment()?;
7582 }
7583 let val_ref = self.external_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
7584 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7585 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7586 {
7587 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7588 }
7589 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7590 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7591 }
7592 }
7593
7594 next_offset += envelope_size;
7595
7596 while next_offset < end_offset {
7598 _next_ordinal_to_read += 1;
7599 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7600 next_offset += envelope_size;
7601 }
7602
7603 Ok(())
7604 }
7605 }
7606
7607 impl Format {
7608 #[inline(always)]
7609 fn max_ordinal_present(&self) -> u64 {
7610 if let Some(_) = self.pcm_format {
7611 return 1;
7612 }
7613 0
7614 }
7615 }
7616
7617 impl fidl::encoding::ValueTypeMarker for Format {
7618 type Borrowed<'a> = &'a Self;
7619 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7620 value
7621 }
7622 }
7623
7624 unsafe impl fidl::encoding::TypeMarker for Format {
7625 type Owned = Self;
7626
7627 #[inline(always)]
7628 fn inline_align(_context: fidl::encoding::Context) -> usize {
7629 8
7630 }
7631
7632 #[inline(always)]
7633 fn inline_size(_context: fidl::encoding::Context) -> usize {
7634 16
7635 }
7636 }
7637
7638 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Format, D> for &Format {
7639 unsafe fn encode(
7640 self,
7641 encoder: &mut fidl::encoding::Encoder<'_, D>,
7642 offset: usize,
7643 mut depth: fidl::encoding::Depth,
7644 ) -> fidl::Result<()> {
7645 encoder.debug_check_bounds::<Format>(offset);
7646 let max_ordinal: u64 = self.max_ordinal_present();
7648 encoder.write_num(max_ordinal, offset);
7649 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7650 if max_ordinal == 0 {
7652 return Ok(());
7653 }
7654 depth.increment()?;
7655 let envelope_size = 8;
7656 let bytes_len = max_ordinal as usize * envelope_size;
7657 #[allow(unused_variables)]
7658 let offset = encoder.out_of_line_offset(bytes_len);
7659 let mut _prev_end_offset: usize = 0;
7660 if 1 > max_ordinal {
7661 return Ok(());
7662 }
7663
7664 let cur_offset: usize = (1 - 1) * envelope_size;
7667
7668 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7670
7671 fidl::encoding::encode_in_envelope_optional::<PcmFormat, D>(
7676 self.pcm_format
7677 .as_ref()
7678 .map(<PcmFormat as fidl::encoding::ValueTypeMarker>::borrow),
7679 encoder,
7680 offset + cur_offset,
7681 depth,
7682 )?;
7683
7684 _prev_end_offset = cur_offset + envelope_size;
7685
7686 Ok(())
7687 }
7688 }
7689
7690 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Format {
7691 #[inline(always)]
7692 fn new_empty() -> Self {
7693 Self::default()
7694 }
7695
7696 unsafe fn decode(
7697 &mut self,
7698 decoder: &mut fidl::encoding::Decoder<'_, D>,
7699 offset: usize,
7700 mut depth: fidl::encoding::Depth,
7701 ) -> fidl::Result<()> {
7702 decoder.debug_check_bounds::<Self>(offset);
7703 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7704 None => return Err(fidl::Error::NotNullable),
7705 Some(len) => len,
7706 };
7707 if len == 0 {
7709 return Ok(());
7710 };
7711 depth.increment()?;
7712 let envelope_size = 8;
7713 let bytes_len = len * envelope_size;
7714 let offset = decoder.out_of_line_offset(bytes_len)?;
7715 let mut _next_ordinal_to_read = 0;
7717 let mut next_offset = offset;
7718 let end_offset = offset + bytes_len;
7719 _next_ordinal_to_read += 1;
7720 if next_offset >= end_offset {
7721 return Ok(());
7722 }
7723
7724 while _next_ordinal_to_read < 1 {
7726 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7727 _next_ordinal_to_read += 1;
7728 next_offset += envelope_size;
7729 }
7730
7731 let next_out_of_line = decoder.next_out_of_line();
7732 let handles_before = decoder.remaining_handles();
7733 if let Some((inlined, num_bytes, num_handles)) =
7734 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7735 {
7736 let member_inline_size =
7737 <PcmFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7738 if inlined != (member_inline_size <= 4) {
7739 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7740 }
7741 let inner_offset;
7742 let mut inner_depth = depth.clone();
7743 if inlined {
7744 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7745 inner_offset = next_offset;
7746 } else {
7747 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7748 inner_depth.increment()?;
7749 }
7750 let val_ref = self.pcm_format.get_or_insert_with(|| fidl::new_empty!(PcmFormat, D));
7751 fidl::decode!(PcmFormat, D, val_ref, decoder, inner_offset, inner_depth)?;
7752 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7753 {
7754 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7755 }
7756 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7757 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7758 }
7759 }
7760
7761 next_offset += envelope_size;
7762
7763 while next_offset < end_offset {
7765 _next_ordinal_to_read += 1;
7766 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7767 next_offset += envelope_size;
7768 }
7769
7770 Ok(())
7771 }
7772 }
7773
7774 impl GainState {
7775 #[inline(always)]
7776 fn max_ordinal_present(&self) -> u64 {
7777 if let Some(_) = self.gain_db {
7778 return 3;
7779 }
7780 if let Some(_) = self.agc_enabled {
7781 return 2;
7782 }
7783 if let Some(_) = self.muted {
7784 return 1;
7785 }
7786 0
7787 }
7788 }
7789
7790 impl fidl::encoding::ValueTypeMarker for GainState {
7791 type Borrowed<'a> = &'a Self;
7792 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7793 value
7794 }
7795 }
7796
7797 unsafe impl fidl::encoding::TypeMarker for GainState {
7798 type Owned = Self;
7799
7800 #[inline(always)]
7801 fn inline_align(_context: fidl::encoding::Context) -> usize {
7802 8
7803 }
7804
7805 #[inline(always)]
7806 fn inline_size(_context: fidl::encoding::Context) -> usize {
7807 16
7808 }
7809 }
7810
7811 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GainState, D>
7812 for &GainState
7813 {
7814 unsafe fn encode(
7815 self,
7816 encoder: &mut fidl::encoding::Encoder<'_, D>,
7817 offset: usize,
7818 mut depth: fidl::encoding::Depth,
7819 ) -> fidl::Result<()> {
7820 encoder.debug_check_bounds::<GainState>(offset);
7821 let max_ordinal: u64 = self.max_ordinal_present();
7823 encoder.write_num(max_ordinal, offset);
7824 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7825 if max_ordinal == 0 {
7827 return Ok(());
7828 }
7829 depth.increment()?;
7830 let envelope_size = 8;
7831 let bytes_len = max_ordinal as usize * envelope_size;
7832 #[allow(unused_variables)]
7833 let offset = encoder.out_of_line_offset(bytes_len);
7834 let mut _prev_end_offset: usize = 0;
7835 if 1 > max_ordinal {
7836 return Ok(());
7837 }
7838
7839 let cur_offset: usize = (1 - 1) * envelope_size;
7842
7843 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7845
7846 fidl::encoding::encode_in_envelope_optional::<bool, D>(
7851 self.muted.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7852 encoder,
7853 offset + cur_offset,
7854 depth,
7855 )?;
7856
7857 _prev_end_offset = cur_offset + envelope_size;
7858 if 2 > max_ordinal {
7859 return Ok(());
7860 }
7861
7862 let cur_offset: usize = (2 - 1) * envelope_size;
7865
7866 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7868
7869 fidl::encoding::encode_in_envelope_optional::<bool, D>(
7874 self.agc_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7875 encoder,
7876 offset + cur_offset,
7877 depth,
7878 )?;
7879
7880 _prev_end_offset = cur_offset + envelope_size;
7881 if 3 > max_ordinal {
7882 return Ok(());
7883 }
7884
7885 let cur_offset: usize = (3 - 1) * envelope_size;
7888
7889 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7891
7892 fidl::encoding::encode_in_envelope_optional::<f32, D>(
7897 self.gain_db.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
7898 encoder,
7899 offset + cur_offset,
7900 depth,
7901 )?;
7902
7903 _prev_end_offset = cur_offset + envelope_size;
7904
7905 Ok(())
7906 }
7907 }
7908
7909 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GainState {
7910 #[inline(always)]
7911 fn new_empty() -> Self {
7912 Self::default()
7913 }
7914
7915 unsafe fn decode(
7916 &mut self,
7917 decoder: &mut fidl::encoding::Decoder<'_, D>,
7918 offset: usize,
7919 mut depth: fidl::encoding::Depth,
7920 ) -> fidl::Result<()> {
7921 decoder.debug_check_bounds::<Self>(offset);
7922 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7923 None => return Err(fidl::Error::NotNullable),
7924 Some(len) => len,
7925 };
7926 if len == 0 {
7928 return Ok(());
7929 };
7930 depth.increment()?;
7931 let envelope_size = 8;
7932 let bytes_len = len * envelope_size;
7933 let offset = decoder.out_of_line_offset(bytes_len)?;
7934 let mut _next_ordinal_to_read = 0;
7936 let mut next_offset = offset;
7937 let end_offset = offset + bytes_len;
7938 _next_ordinal_to_read += 1;
7939 if next_offset >= end_offset {
7940 return Ok(());
7941 }
7942
7943 while _next_ordinal_to_read < 1 {
7945 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7946 _next_ordinal_to_read += 1;
7947 next_offset += envelope_size;
7948 }
7949
7950 let next_out_of_line = decoder.next_out_of_line();
7951 let handles_before = decoder.remaining_handles();
7952 if let Some((inlined, num_bytes, num_handles)) =
7953 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7954 {
7955 let member_inline_size =
7956 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7957 if inlined != (member_inline_size <= 4) {
7958 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7959 }
7960 let inner_offset;
7961 let mut inner_depth = depth.clone();
7962 if inlined {
7963 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7964 inner_offset = next_offset;
7965 } else {
7966 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7967 inner_depth.increment()?;
7968 }
7969 let val_ref = self.muted.get_or_insert_with(|| fidl::new_empty!(bool, D));
7970 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7971 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7972 {
7973 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7974 }
7975 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7976 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7977 }
7978 }
7979
7980 next_offset += envelope_size;
7981 _next_ordinal_to_read += 1;
7982 if next_offset >= end_offset {
7983 return Ok(());
7984 }
7985
7986 while _next_ordinal_to_read < 2 {
7988 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7989 _next_ordinal_to_read += 1;
7990 next_offset += envelope_size;
7991 }
7992
7993 let next_out_of_line = decoder.next_out_of_line();
7994 let handles_before = decoder.remaining_handles();
7995 if let Some((inlined, num_bytes, num_handles)) =
7996 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7997 {
7998 let member_inline_size =
7999 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8000 if inlined != (member_inline_size <= 4) {
8001 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8002 }
8003 let inner_offset;
8004 let mut inner_depth = depth.clone();
8005 if inlined {
8006 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8007 inner_offset = next_offset;
8008 } else {
8009 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8010 inner_depth.increment()?;
8011 }
8012 let val_ref = self.agc_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
8013 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8014 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8015 {
8016 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8017 }
8018 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8019 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8020 }
8021 }
8022
8023 next_offset += envelope_size;
8024 _next_ordinal_to_read += 1;
8025 if next_offset >= end_offset {
8026 return Ok(());
8027 }
8028
8029 while _next_ordinal_to_read < 3 {
8031 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8032 _next_ordinal_to_read += 1;
8033 next_offset += envelope_size;
8034 }
8035
8036 let next_out_of_line = decoder.next_out_of_line();
8037 let handles_before = decoder.remaining_handles();
8038 if let Some((inlined, num_bytes, num_handles)) =
8039 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8040 {
8041 let member_inline_size =
8042 <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8043 if inlined != (member_inline_size <= 4) {
8044 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8045 }
8046 let inner_offset;
8047 let mut inner_depth = depth.clone();
8048 if inlined {
8049 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8050 inner_offset = next_offset;
8051 } else {
8052 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8053 inner_depth.increment()?;
8054 }
8055 let val_ref = self.gain_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
8056 fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
8057 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8058 {
8059 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8060 }
8061 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8062 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8063 }
8064 }
8065
8066 next_offset += envelope_size;
8067
8068 while next_offset < end_offset {
8070 _next_ordinal_to_read += 1;
8071 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8072 next_offset += envelope_size;
8073 }
8074
8075 Ok(())
8076 }
8077 }
8078
8079 impl HealthState {
8080 #[inline(always)]
8081 fn max_ordinal_present(&self) -> u64 {
8082 if let Some(_) = self.healthy {
8083 return 1;
8084 }
8085 0
8086 }
8087 }
8088
8089 impl fidl::encoding::ValueTypeMarker for HealthState {
8090 type Borrowed<'a> = &'a Self;
8091 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8092 value
8093 }
8094 }
8095
8096 unsafe impl fidl::encoding::TypeMarker for HealthState {
8097 type Owned = Self;
8098
8099 #[inline(always)]
8100 fn inline_align(_context: fidl::encoding::Context) -> usize {
8101 8
8102 }
8103
8104 #[inline(always)]
8105 fn inline_size(_context: fidl::encoding::Context) -> usize {
8106 16
8107 }
8108 }
8109
8110 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HealthState, D>
8111 for &HealthState
8112 {
8113 unsafe fn encode(
8114 self,
8115 encoder: &mut fidl::encoding::Encoder<'_, D>,
8116 offset: usize,
8117 mut depth: fidl::encoding::Depth,
8118 ) -> fidl::Result<()> {
8119 encoder.debug_check_bounds::<HealthState>(offset);
8120 let max_ordinal: u64 = self.max_ordinal_present();
8122 encoder.write_num(max_ordinal, offset);
8123 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8124 if max_ordinal == 0 {
8126 return Ok(());
8127 }
8128 depth.increment()?;
8129 let envelope_size = 8;
8130 let bytes_len = max_ordinal as usize * envelope_size;
8131 #[allow(unused_variables)]
8132 let offset = encoder.out_of_line_offset(bytes_len);
8133 let mut _prev_end_offset: usize = 0;
8134 if 1 > max_ordinal {
8135 return Ok(());
8136 }
8137
8138 let cur_offset: usize = (1 - 1) * envelope_size;
8141
8142 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8144
8145 fidl::encoding::encode_in_envelope_optional::<bool, D>(
8150 self.healthy.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8151 encoder,
8152 offset + cur_offset,
8153 depth,
8154 )?;
8155
8156 _prev_end_offset = cur_offset + envelope_size;
8157
8158 Ok(())
8159 }
8160 }
8161
8162 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HealthState {
8163 #[inline(always)]
8164 fn new_empty() -> Self {
8165 Self::default()
8166 }
8167
8168 unsafe fn decode(
8169 &mut self,
8170 decoder: &mut fidl::encoding::Decoder<'_, D>,
8171 offset: usize,
8172 mut depth: fidl::encoding::Depth,
8173 ) -> fidl::Result<()> {
8174 decoder.debug_check_bounds::<Self>(offset);
8175 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8176 None => return Err(fidl::Error::NotNullable),
8177 Some(len) => len,
8178 };
8179 if len == 0 {
8181 return Ok(());
8182 };
8183 depth.increment()?;
8184 let envelope_size = 8;
8185 let bytes_len = len * envelope_size;
8186 let offset = decoder.out_of_line_offset(bytes_len)?;
8187 let mut _next_ordinal_to_read = 0;
8189 let mut next_offset = offset;
8190 let end_offset = offset + bytes_len;
8191 _next_ordinal_to_read += 1;
8192 if next_offset >= end_offset {
8193 return Ok(());
8194 }
8195
8196 while _next_ordinal_to_read < 1 {
8198 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8199 _next_ordinal_to_read += 1;
8200 next_offset += envelope_size;
8201 }
8202
8203 let next_out_of_line = decoder.next_out_of_line();
8204 let handles_before = decoder.remaining_handles();
8205 if let Some((inlined, num_bytes, num_handles)) =
8206 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8207 {
8208 let member_inline_size =
8209 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8210 if inlined != (member_inline_size <= 4) {
8211 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8212 }
8213 let inner_offset;
8214 let mut inner_depth = depth.clone();
8215 if inlined {
8216 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8217 inner_offset = next_offset;
8218 } else {
8219 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8220 inner_depth.increment()?;
8221 }
8222 let val_ref = self.healthy.get_or_insert_with(|| fidl::new_empty!(bool, D));
8223 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8224 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8225 {
8226 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8227 }
8228 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8229 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8230 }
8231 }
8232
8233 next_offset += envelope_size;
8234
8235 while next_offset < end_offset {
8237 _next_ordinal_to_read += 1;
8238 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8239 next_offset += envelope_size;
8240 }
8241
8242 Ok(())
8243 }
8244 }
8245
8246 impl PcmSupportedFormats {
8247 #[inline(always)]
8248 fn max_ordinal_present(&self) -> u64 {
8249 if let Some(_) = self.frame_rates {
8250 return 5;
8251 }
8252 if let Some(_) = self.valid_bits_per_sample {
8253 return 4;
8254 }
8255 if let Some(_) = self.bytes_per_sample {
8256 return 3;
8257 }
8258 if let Some(_) = self.sample_formats {
8259 return 2;
8260 }
8261 if let Some(_) = self.channel_sets {
8262 return 1;
8263 }
8264 0
8265 }
8266 }
8267
8268 impl fidl::encoding::ValueTypeMarker for PcmSupportedFormats {
8269 type Borrowed<'a> = &'a Self;
8270 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8271 value
8272 }
8273 }
8274
8275 unsafe impl fidl::encoding::TypeMarker for PcmSupportedFormats {
8276 type Owned = Self;
8277
8278 #[inline(always)]
8279 fn inline_align(_context: fidl::encoding::Context) -> usize {
8280 8
8281 }
8282
8283 #[inline(always)]
8284 fn inline_size(_context: fidl::encoding::Context) -> usize {
8285 16
8286 }
8287 }
8288
8289 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PcmSupportedFormats, D>
8290 for &PcmSupportedFormats
8291 {
8292 unsafe fn encode(
8293 self,
8294 encoder: &mut fidl::encoding::Encoder<'_, D>,
8295 offset: usize,
8296 mut depth: fidl::encoding::Depth,
8297 ) -> fidl::Result<()> {
8298 encoder.debug_check_bounds::<PcmSupportedFormats>(offset);
8299 let max_ordinal: u64 = self.max_ordinal_present();
8301 encoder.write_num(max_ordinal, offset);
8302 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8303 if max_ordinal == 0 {
8305 return Ok(());
8306 }
8307 depth.increment()?;
8308 let envelope_size = 8;
8309 let bytes_len = max_ordinal as usize * envelope_size;
8310 #[allow(unused_variables)]
8311 let offset = encoder.out_of_line_offset(bytes_len);
8312 let mut _prev_end_offset: usize = 0;
8313 if 1 > max_ordinal {
8314 return Ok(());
8315 }
8316
8317 let cur_offset: usize = (1 - 1) * envelope_size;
8320
8321 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8323
8324 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ChannelSet, 64>, D>(
8329 self.channel_sets.as_ref().map(<fidl::encoding::Vector<ChannelSet, 64> as fidl::encoding::ValueTypeMarker>::borrow),
8330 encoder, offset + cur_offset, depth
8331 )?;
8332
8333 _prev_end_offset = cur_offset + envelope_size;
8334 if 2 > max_ordinal {
8335 return Ok(());
8336 }
8337
8338 let cur_offset: usize = (2 - 1) * envelope_size;
8341
8342 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8344
8345 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<SampleFormat, 3>, D>(
8350 self.sample_formats.as_ref().map(<fidl::encoding::Vector<SampleFormat, 3> as fidl::encoding::ValueTypeMarker>::borrow),
8351 encoder, offset + cur_offset, depth
8352 )?;
8353
8354 _prev_end_offset = cur_offset + envelope_size;
8355 if 3 > max_ordinal {
8356 return Ok(());
8357 }
8358
8359 let cur_offset: usize = (3 - 1) * envelope_size;
8362
8363 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8365
8366 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 8>, D>(
8371 self.bytes_per_sample.as_ref().map(
8372 <fidl::encoding::Vector<u8, 8> as fidl::encoding::ValueTypeMarker>::borrow,
8373 ),
8374 encoder,
8375 offset + cur_offset,
8376 depth,
8377 )?;
8378
8379 _prev_end_offset = cur_offset + envelope_size;
8380 if 4 > max_ordinal {
8381 return Ok(());
8382 }
8383
8384 let cur_offset: usize = (4 - 1) * envelope_size;
8387
8388 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8390
8391 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 8>, D>(
8396 self.valid_bits_per_sample.as_ref().map(
8397 <fidl::encoding::Vector<u8, 8> as fidl::encoding::ValueTypeMarker>::borrow,
8398 ),
8399 encoder,
8400 offset + cur_offset,
8401 depth,
8402 )?;
8403
8404 _prev_end_offset = cur_offset + envelope_size;
8405 if 5 > max_ordinal {
8406 return Ok(());
8407 }
8408
8409 let cur_offset: usize = (5 - 1) * envelope_size;
8412
8413 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8415
8416 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u32, 64>, D>(
8421 self.frame_rates.as_ref().map(
8422 <fidl::encoding::Vector<u32, 64> as fidl::encoding::ValueTypeMarker>::borrow,
8423 ),
8424 encoder,
8425 offset + cur_offset,
8426 depth,
8427 )?;
8428
8429 _prev_end_offset = cur_offset + envelope_size;
8430
8431 Ok(())
8432 }
8433 }
8434
8435 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PcmSupportedFormats {
8436 #[inline(always)]
8437 fn new_empty() -> Self {
8438 Self::default()
8439 }
8440
8441 unsafe fn decode(
8442 &mut self,
8443 decoder: &mut fidl::encoding::Decoder<'_, D>,
8444 offset: usize,
8445 mut depth: fidl::encoding::Depth,
8446 ) -> fidl::Result<()> {
8447 decoder.debug_check_bounds::<Self>(offset);
8448 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8449 None => return Err(fidl::Error::NotNullable),
8450 Some(len) => len,
8451 };
8452 if len == 0 {
8454 return Ok(());
8455 };
8456 depth.increment()?;
8457 let envelope_size = 8;
8458 let bytes_len = len * envelope_size;
8459 let offset = decoder.out_of_line_offset(bytes_len)?;
8460 let mut _next_ordinal_to_read = 0;
8462 let mut next_offset = offset;
8463 let end_offset = offset + bytes_len;
8464 _next_ordinal_to_read += 1;
8465 if next_offset >= end_offset {
8466 return Ok(());
8467 }
8468
8469 while _next_ordinal_to_read < 1 {
8471 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8472 _next_ordinal_to_read += 1;
8473 next_offset += envelope_size;
8474 }
8475
8476 let next_out_of_line = decoder.next_out_of_line();
8477 let handles_before = decoder.remaining_handles();
8478 if let Some((inlined, num_bytes, num_handles)) =
8479 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8480 {
8481 let member_inline_size = <fidl::encoding::Vector<ChannelSet, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8482 if inlined != (member_inline_size <= 4) {
8483 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8484 }
8485 let inner_offset;
8486 let mut inner_depth = depth.clone();
8487 if inlined {
8488 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8489 inner_offset = next_offset;
8490 } else {
8491 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8492 inner_depth.increment()?;
8493 }
8494 let val_ref = self.channel_sets.get_or_insert_with(
8495 || fidl::new_empty!(fidl::encoding::Vector<ChannelSet, 64>, D),
8496 );
8497 fidl::decode!(fidl::encoding::Vector<ChannelSet, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
8498 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8499 {
8500 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8501 }
8502 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8503 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8504 }
8505 }
8506
8507 next_offset += envelope_size;
8508 _next_ordinal_to_read += 1;
8509 if next_offset >= end_offset {
8510 return Ok(());
8511 }
8512
8513 while _next_ordinal_to_read < 2 {
8515 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8516 _next_ordinal_to_read += 1;
8517 next_offset += envelope_size;
8518 }
8519
8520 let next_out_of_line = decoder.next_out_of_line();
8521 let handles_before = decoder.remaining_handles();
8522 if let Some((inlined, num_bytes, num_handles)) =
8523 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8524 {
8525 let member_inline_size = <fidl::encoding::Vector<SampleFormat, 3> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8526 if inlined != (member_inline_size <= 4) {
8527 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8528 }
8529 let inner_offset;
8530 let mut inner_depth = depth.clone();
8531 if inlined {
8532 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8533 inner_offset = next_offset;
8534 } else {
8535 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8536 inner_depth.increment()?;
8537 }
8538 let val_ref = self.sample_formats.get_or_insert_with(
8539 || fidl::new_empty!(fidl::encoding::Vector<SampleFormat, 3>, D),
8540 );
8541 fidl::decode!(fidl::encoding::Vector<SampleFormat, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
8542 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8543 {
8544 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8545 }
8546 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8547 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8548 }
8549 }
8550
8551 next_offset += envelope_size;
8552 _next_ordinal_to_read += 1;
8553 if next_offset >= end_offset {
8554 return Ok(());
8555 }
8556
8557 while _next_ordinal_to_read < 3 {
8559 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8560 _next_ordinal_to_read += 1;
8561 next_offset += envelope_size;
8562 }
8563
8564 let next_out_of_line = decoder.next_out_of_line();
8565 let handles_before = decoder.remaining_handles();
8566 if let Some((inlined, num_bytes, num_handles)) =
8567 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8568 {
8569 let member_inline_size =
8570 <fidl::encoding::Vector<u8, 8> as fidl::encoding::TypeMarker>::inline_size(
8571 decoder.context,
8572 );
8573 if inlined != (member_inline_size <= 4) {
8574 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8575 }
8576 let inner_offset;
8577 let mut inner_depth = depth.clone();
8578 if inlined {
8579 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8580 inner_offset = next_offset;
8581 } else {
8582 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8583 inner_depth.increment()?;
8584 }
8585 let val_ref = self
8586 .bytes_per_sample
8587 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D));
8588 fidl::decode!(fidl::encoding::Vector<u8, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
8589 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8590 {
8591 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8592 }
8593 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8594 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8595 }
8596 }
8597
8598 next_offset += envelope_size;
8599 _next_ordinal_to_read += 1;
8600 if next_offset >= end_offset {
8601 return Ok(());
8602 }
8603
8604 while _next_ordinal_to_read < 4 {
8606 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8607 _next_ordinal_to_read += 1;
8608 next_offset += envelope_size;
8609 }
8610
8611 let next_out_of_line = decoder.next_out_of_line();
8612 let handles_before = decoder.remaining_handles();
8613 if let Some((inlined, num_bytes, num_handles)) =
8614 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8615 {
8616 let member_inline_size =
8617 <fidl::encoding::Vector<u8, 8> as fidl::encoding::TypeMarker>::inline_size(
8618 decoder.context,
8619 );
8620 if inlined != (member_inline_size <= 4) {
8621 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8622 }
8623 let inner_offset;
8624 let mut inner_depth = depth.clone();
8625 if inlined {
8626 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8627 inner_offset = next_offset;
8628 } else {
8629 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8630 inner_depth.increment()?;
8631 }
8632 let val_ref = self
8633 .valid_bits_per_sample
8634 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D));
8635 fidl::decode!(fidl::encoding::Vector<u8, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
8636 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8637 {
8638 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8639 }
8640 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8641 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8642 }
8643 }
8644
8645 next_offset += envelope_size;
8646 _next_ordinal_to_read += 1;
8647 if next_offset >= end_offset {
8648 return Ok(());
8649 }
8650
8651 while _next_ordinal_to_read < 5 {
8653 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8654 _next_ordinal_to_read += 1;
8655 next_offset += envelope_size;
8656 }
8657
8658 let next_out_of_line = decoder.next_out_of_line();
8659 let handles_before = decoder.remaining_handles();
8660 if let Some((inlined, num_bytes, num_handles)) =
8661 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8662 {
8663 let member_inline_size =
8664 <fidl::encoding::Vector<u32, 64> as fidl::encoding::TypeMarker>::inline_size(
8665 decoder.context,
8666 );
8667 if inlined != (member_inline_size <= 4) {
8668 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8669 }
8670 let inner_offset;
8671 let mut inner_depth = depth.clone();
8672 if inlined {
8673 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8674 inner_offset = next_offset;
8675 } else {
8676 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8677 inner_depth.increment()?;
8678 }
8679 let val_ref = self
8680 .frame_rates
8681 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u32, 64>, D));
8682 fidl::decode!(fidl::encoding::Vector<u32, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
8683 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8684 {
8685 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8686 }
8687 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8688 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8689 }
8690 }
8691
8692 next_offset += envelope_size;
8693
8694 while next_offset < end_offset {
8696 _next_ordinal_to_read += 1;
8697 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8698 next_offset += envelope_size;
8699 }
8700
8701 Ok(())
8702 }
8703 }
8704
8705 impl PlugState {
8706 #[inline(always)]
8707 fn max_ordinal_present(&self) -> u64 {
8708 if let Some(_) = self.plug_state_time {
8709 return 2;
8710 }
8711 if let Some(_) = self.plugged {
8712 return 1;
8713 }
8714 0
8715 }
8716 }
8717
8718 impl fidl::encoding::ValueTypeMarker for PlugState {
8719 type Borrowed<'a> = &'a Self;
8720 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8721 value
8722 }
8723 }
8724
8725 unsafe impl fidl::encoding::TypeMarker for PlugState {
8726 type Owned = Self;
8727
8728 #[inline(always)]
8729 fn inline_align(_context: fidl::encoding::Context) -> usize {
8730 8
8731 }
8732
8733 #[inline(always)]
8734 fn inline_size(_context: fidl::encoding::Context) -> usize {
8735 16
8736 }
8737 }
8738
8739 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PlugState, D>
8740 for &PlugState
8741 {
8742 unsafe fn encode(
8743 self,
8744 encoder: &mut fidl::encoding::Encoder<'_, D>,
8745 offset: usize,
8746 mut depth: fidl::encoding::Depth,
8747 ) -> fidl::Result<()> {
8748 encoder.debug_check_bounds::<PlugState>(offset);
8749 let max_ordinal: u64 = self.max_ordinal_present();
8751 encoder.write_num(max_ordinal, offset);
8752 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8753 if max_ordinal == 0 {
8755 return Ok(());
8756 }
8757 depth.increment()?;
8758 let envelope_size = 8;
8759 let bytes_len = max_ordinal as usize * envelope_size;
8760 #[allow(unused_variables)]
8761 let offset = encoder.out_of_line_offset(bytes_len);
8762 let mut _prev_end_offset: usize = 0;
8763 if 1 > max_ordinal {
8764 return Ok(());
8765 }
8766
8767 let cur_offset: usize = (1 - 1) * envelope_size;
8770
8771 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8773
8774 fidl::encoding::encode_in_envelope_optional::<bool, D>(
8779 self.plugged.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8780 encoder,
8781 offset + cur_offset,
8782 depth,
8783 )?;
8784
8785 _prev_end_offset = cur_offset + envelope_size;
8786 if 2 > max_ordinal {
8787 return Ok(());
8788 }
8789
8790 let cur_offset: usize = (2 - 1) * envelope_size;
8793
8794 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8796
8797 fidl::encoding::encode_in_envelope_optional::<i64, D>(
8802 self.plug_state_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8803 encoder,
8804 offset + cur_offset,
8805 depth,
8806 )?;
8807
8808 _prev_end_offset = cur_offset + envelope_size;
8809
8810 Ok(())
8811 }
8812 }
8813
8814 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlugState {
8815 #[inline(always)]
8816 fn new_empty() -> Self {
8817 Self::default()
8818 }
8819
8820 unsafe fn decode(
8821 &mut self,
8822 decoder: &mut fidl::encoding::Decoder<'_, D>,
8823 offset: usize,
8824 mut depth: fidl::encoding::Depth,
8825 ) -> fidl::Result<()> {
8826 decoder.debug_check_bounds::<Self>(offset);
8827 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8828 None => return Err(fidl::Error::NotNullable),
8829 Some(len) => len,
8830 };
8831 if len == 0 {
8833 return Ok(());
8834 };
8835 depth.increment()?;
8836 let envelope_size = 8;
8837 let bytes_len = len * envelope_size;
8838 let offset = decoder.out_of_line_offset(bytes_len)?;
8839 let mut _next_ordinal_to_read = 0;
8841 let mut next_offset = offset;
8842 let end_offset = offset + bytes_len;
8843 _next_ordinal_to_read += 1;
8844 if next_offset >= end_offset {
8845 return Ok(());
8846 }
8847
8848 while _next_ordinal_to_read < 1 {
8850 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8851 _next_ordinal_to_read += 1;
8852 next_offset += envelope_size;
8853 }
8854
8855 let next_out_of_line = decoder.next_out_of_line();
8856 let handles_before = decoder.remaining_handles();
8857 if let Some((inlined, num_bytes, num_handles)) =
8858 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8859 {
8860 let member_inline_size =
8861 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8862 if inlined != (member_inline_size <= 4) {
8863 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8864 }
8865 let inner_offset;
8866 let mut inner_depth = depth.clone();
8867 if inlined {
8868 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8869 inner_offset = next_offset;
8870 } else {
8871 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8872 inner_depth.increment()?;
8873 }
8874 let val_ref = self.plugged.get_or_insert_with(|| fidl::new_empty!(bool, D));
8875 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8876 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8877 {
8878 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8879 }
8880 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8881 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8882 }
8883 }
8884
8885 next_offset += envelope_size;
8886 _next_ordinal_to_read += 1;
8887 if next_offset >= end_offset {
8888 return Ok(());
8889 }
8890
8891 while _next_ordinal_to_read < 2 {
8893 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8894 _next_ordinal_to_read += 1;
8895 next_offset += envelope_size;
8896 }
8897
8898 let next_out_of_line = decoder.next_out_of_line();
8899 let handles_before = decoder.remaining_handles();
8900 if let Some((inlined, num_bytes, num_handles)) =
8901 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8902 {
8903 let member_inline_size =
8904 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8905 if inlined != (member_inline_size <= 4) {
8906 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8907 }
8908 let inner_offset;
8909 let mut inner_depth = depth.clone();
8910 if inlined {
8911 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8912 inner_offset = next_offset;
8913 } else {
8914 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8915 inner_depth.increment()?;
8916 }
8917 let val_ref = self.plug_state_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
8918 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
8919 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8920 {
8921 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8922 }
8923 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8924 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8925 }
8926 }
8927
8928 next_offset += envelope_size;
8929
8930 while next_offset < end_offset {
8932 _next_ordinal_to_read += 1;
8933 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8934 next_offset += envelope_size;
8935 }
8936
8937 Ok(())
8938 }
8939 }
8940
8941 impl RingBufferProperties {
8942 #[inline(always)]
8943 fn max_ordinal_present(&self) -> u64 {
8944 if let Some(_) = self.driver_transfer_bytes {
8945 return 5;
8946 }
8947 if let Some(_) = self.turn_on_delay {
8948 return 4;
8949 }
8950 if let Some(_) = self.needs_cache_flush_or_invalidate {
8951 return 3;
8952 }
8953 if let Some(_) = self.fifo_depth {
8954 return 2;
8955 }
8956 if let Some(_) = self.external_delay {
8957 return 1;
8958 }
8959 0
8960 }
8961 }
8962
8963 impl fidl::encoding::ValueTypeMarker for RingBufferProperties {
8964 type Borrowed<'a> = &'a Self;
8965 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8966 value
8967 }
8968 }
8969
8970 unsafe impl fidl::encoding::TypeMarker for RingBufferProperties {
8971 type Owned = Self;
8972
8973 #[inline(always)]
8974 fn inline_align(_context: fidl::encoding::Context) -> usize {
8975 8
8976 }
8977
8978 #[inline(always)]
8979 fn inline_size(_context: fidl::encoding::Context) -> usize {
8980 16
8981 }
8982 }
8983
8984 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RingBufferProperties, D>
8985 for &RingBufferProperties
8986 {
8987 unsafe fn encode(
8988 self,
8989 encoder: &mut fidl::encoding::Encoder<'_, D>,
8990 offset: usize,
8991 mut depth: fidl::encoding::Depth,
8992 ) -> fidl::Result<()> {
8993 encoder.debug_check_bounds::<RingBufferProperties>(offset);
8994 let max_ordinal: u64 = self.max_ordinal_present();
8996 encoder.write_num(max_ordinal, offset);
8997 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8998 if max_ordinal == 0 {
9000 return Ok(());
9001 }
9002 depth.increment()?;
9003 let envelope_size = 8;
9004 let bytes_len = max_ordinal as usize * envelope_size;
9005 #[allow(unused_variables)]
9006 let offset = encoder.out_of_line_offset(bytes_len);
9007 let mut _prev_end_offset: usize = 0;
9008 if 1 > max_ordinal {
9009 return Ok(());
9010 }
9011
9012 let cur_offset: usize = (1 - 1) * envelope_size;
9015
9016 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9018
9019 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9024 self.external_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9025 encoder,
9026 offset + cur_offset,
9027 depth,
9028 )?;
9029
9030 _prev_end_offset = cur_offset + envelope_size;
9031 if 2 > max_ordinal {
9032 return Ok(());
9033 }
9034
9035 let cur_offset: usize = (2 - 1) * envelope_size;
9038
9039 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9041
9042 fidl::encoding::encode_in_envelope_optional::<u32, D>(
9047 self.fifo_depth.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9048 encoder,
9049 offset + cur_offset,
9050 depth,
9051 )?;
9052
9053 _prev_end_offset = cur_offset + envelope_size;
9054 if 3 > max_ordinal {
9055 return Ok(());
9056 }
9057
9058 let cur_offset: usize = (3 - 1) * envelope_size;
9061
9062 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9064
9065 fidl::encoding::encode_in_envelope_optional::<bool, D>(
9070 self.needs_cache_flush_or_invalidate
9071 .as_ref()
9072 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9073 encoder,
9074 offset + cur_offset,
9075 depth,
9076 )?;
9077
9078 _prev_end_offset = cur_offset + envelope_size;
9079 if 4 > max_ordinal {
9080 return Ok(());
9081 }
9082
9083 let cur_offset: usize = (4 - 1) * envelope_size;
9086
9087 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9089
9090 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9095 self.turn_on_delay.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9096 encoder,
9097 offset + cur_offset,
9098 depth,
9099 )?;
9100
9101 _prev_end_offset = cur_offset + envelope_size;
9102 if 5 > max_ordinal {
9103 return Ok(());
9104 }
9105
9106 let cur_offset: usize = (5 - 1) * envelope_size;
9109
9110 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9112
9113 fidl::encoding::encode_in_envelope_optional::<u32, D>(
9118 self.driver_transfer_bytes
9119 .as_ref()
9120 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9121 encoder,
9122 offset + cur_offset,
9123 depth,
9124 )?;
9125
9126 _prev_end_offset = cur_offset + envelope_size;
9127
9128 Ok(())
9129 }
9130 }
9131
9132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RingBufferProperties {
9133 #[inline(always)]
9134 fn new_empty() -> Self {
9135 Self::default()
9136 }
9137
9138 unsafe fn decode(
9139 &mut self,
9140 decoder: &mut fidl::encoding::Decoder<'_, D>,
9141 offset: usize,
9142 mut depth: fidl::encoding::Depth,
9143 ) -> fidl::Result<()> {
9144 decoder.debug_check_bounds::<Self>(offset);
9145 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9146 None => return Err(fidl::Error::NotNullable),
9147 Some(len) => len,
9148 };
9149 if len == 0 {
9151 return Ok(());
9152 };
9153 depth.increment()?;
9154 let envelope_size = 8;
9155 let bytes_len = len * envelope_size;
9156 let offset = decoder.out_of_line_offset(bytes_len)?;
9157 let mut _next_ordinal_to_read = 0;
9159 let mut next_offset = offset;
9160 let end_offset = offset + bytes_len;
9161 _next_ordinal_to_read += 1;
9162 if next_offset >= end_offset {
9163 return Ok(());
9164 }
9165
9166 while _next_ordinal_to_read < 1 {
9168 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9169 _next_ordinal_to_read += 1;
9170 next_offset += envelope_size;
9171 }
9172
9173 let next_out_of_line = decoder.next_out_of_line();
9174 let handles_before = decoder.remaining_handles();
9175 if let Some((inlined, num_bytes, num_handles)) =
9176 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9177 {
9178 let member_inline_size =
9179 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9180 if inlined != (member_inline_size <= 4) {
9181 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9182 }
9183 let inner_offset;
9184 let mut inner_depth = depth.clone();
9185 if inlined {
9186 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9187 inner_offset = next_offset;
9188 } else {
9189 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9190 inner_depth.increment()?;
9191 }
9192 let val_ref = self.external_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
9193 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9194 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9195 {
9196 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9197 }
9198 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9199 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9200 }
9201 }
9202
9203 next_offset += envelope_size;
9204 _next_ordinal_to_read += 1;
9205 if next_offset >= end_offset {
9206 return Ok(());
9207 }
9208
9209 while _next_ordinal_to_read < 2 {
9211 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9212 _next_ordinal_to_read += 1;
9213 next_offset += envelope_size;
9214 }
9215
9216 let next_out_of_line = decoder.next_out_of_line();
9217 let handles_before = decoder.remaining_handles();
9218 if let Some((inlined, num_bytes, num_handles)) =
9219 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9220 {
9221 let member_inline_size =
9222 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9223 if inlined != (member_inline_size <= 4) {
9224 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9225 }
9226 let inner_offset;
9227 let mut inner_depth = depth.clone();
9228 if inlined {
9229 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9230 inner_offset = next_offset;
9231 } else {
9232 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9233 inner_depth.increment()?;
9234 }
9235 let val_ref = self.fifo_depth.get_or_insert_with(|| fidl::new_empty!(u32, D));
9236 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9237 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9238 {
9239 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9240 }
9241 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9242 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9243 }
9244 }
9245
9246 next_offset += envelope_size;
9247 _next_ordinal_to_read += 1;
9248 if next_offset >= end_offset {
9249 return Ok(());
9250 }
9251
9252 while _next_ordinal_to_read < 3 {
9254 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9255 _next_ordinal_to_read += 1;
9256 next_offset += envelope_size;
9257 }
9258
9259 let next_out_of_line = decoder.next_out_of_line();
9260 let handles_before = decoder.remaining_handles();
9261 if let Some((inlined, num_bytes, num_handles)) =
9262 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9263 {
9264 let member_inline_size =
9265 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9266 if inlined != (member_inline_size <= 4) {
9267 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9268 }
9269 let inner_offset;
9270 let mut inner_depth = depth.clone();
9271 if inlined {
9272 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9273 inner_offset = next_offset;
9274 } else {
9275 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9276 inner_depth.increment()?;
9277 }
9278 let val_ref = self
9279 .needs_cache_flush_or_invalidate
9280 .get_or_insert_with(|| fidl::new_empty!(bool, D));
9281 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9282 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9283 {
9284 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9285 }
9286 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9287 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9288 }
9289 }
9290
9291 next_offset += envelope_size;
9292 _next_ordinal_to_read += 1;
9293 if next_offset >= end_offset {
9294 return Ok(());
9295 }
9296
9297 while _next_ordinal_to_read < 4 {
9299 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9300 _next_ordinal_to_read += 1;
9301 next_offset += envelope_size;
9302 }
9303
9304 let next_out_of_line = decoder.next_out_of_line();
9305 let handles_before = decoder.remaining_handles();
9306 if let Some((inlined, num_bytes, num_handles)) =
9307 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9308 {
9309 let member_inline_size =
9310 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9311 if inlined != (member_inline_size <= 4) {
9312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9313 }
9314 let inner_offset;
9315 let mut inner_depth = depth.clone();
9316 if inlined {
9317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9318 inner_offset = next_offset;
9319 } else {
9320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9321 inner_depth.increment()?;
9322 }
9323 let val_ref = self.turn_on_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
9324 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9325 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9326 {
9327 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9328 }
9329 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9330 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9331 }
9332 }
9333
9334 next_offset += envelope_size;
9335 _next_ordinal_to_read += 1;
9336 if next_offset >= end_offset {
9337 return Ok(());
9338 }
9339
9340 while _next_ordinal_to_read < 5 {
9342 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9343 _next_ordinal_to_read += 1;
9344 next_offset += envelope_size;
9345 }
9346
9347 let next_out_of_line = decoder.next_out_of_line();
9348 let handles_before = decoder.remaining_handles();
9349 if let Some((inlined, num_bytes, num_handles)) =
9350 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9351 {
9352 let member_inline_size =
9353 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9354 if inlined != (member_inline_size <= 4) {
9355 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9356 }
9357 let inner_offset;
9358 let mut inner_depth = depth.clone();
9359 if inlined {
9360 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9361 inner_offset = next_offset;
9362 } else {
9363 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9364 inner_depth.increment()?;
9365 }
9366 let val_ref =
9367 self.driver_transfer_bytes.get_or_insert_with(|| fidl::new_empty!(u32, D));
9368 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9369 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9370 {
9371 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9372 }
9373 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9374 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9375 }
9376 }
9377
9378 next_offset += envelope_size;
9379
9380 while next_offset < end_offset {
9382 _next_ordinal_to_read += 1;
9383 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9384 next_offset += envelope_size;
9385 }
9386
9387 Ok(())
9388 }
9389 }
9390
9391 impl StreamProperties {
9392 #[inline(always)]
9393 fn max_ordinal_present(&self) -> u64 {
9394 if let Some(_) = self.clock_domain {
9395 return 11;
9396 }
9397 if let Some(_) = self.product {
9398 return 10;
9399 }
9400 if let Some(_) = self.manufacturer {
9401 return 9;
9402 }
9403 if let Some(_) = self.plug_detect_capabilities {
9404 return 8;
9405 }
9406 if let Some(_) = self.gain_step_db {
9407 return 7;
9408 }
9409 if let Some(_) = self.max_gain_db {
9410 return 6;
9411 }
9412 if let Some(_) = self.min_gain_db {
9413 return 5;
9414 }
9415 if let Some(_) = self.can_agc {
9416 return 4;
9417 }
9418 if let Some(_) = self.can_mute {
9419 return 3;
9420 }
9421 if let Some(_) = self.is_input {
9422 return 2;
9423 }
9424 if let Some(_) = self.unique_id {
9425 return 1;
9426 }
9427 0
9428 }
9429 }
9430
9431 impl fidl::encoding::ValueTypeMarker for StreamProperties {
9432 type Borrowed<'a> = &'a Self;
9433 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9434 value
9435 }
9436 }
9437
9438 unsafe impl fidl::encoding::TypeMarker for StreamProperties {
9439 type Owned = Self;
9440
9441 #[inline(always)]
9442 fn inline_align(_context: fidl::encoding::Context) -> usize {
9443 8
9444 }
9445
9446 #[inline(always)]
9447 fn inline_size(_context: fidl::encoding::Context) -> usize {
9448 16
9449 }
9450 }
9451
9452 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamProperties, D>
9453 for &StreamProperties
9454 {
9455 unsafe fn encode(
9456 self,
9457 encoder: &mut fidl::encoding::Encoder<'_, D>,
9458 offset: usize,
9459 mut depth: fidl::encoding::Depth,
9460 ) -> fidl::Result<()> {
9461 encoder.debug_check_bounds::<StreamProperties>(offset);
9462 let max_ordinal: u64 = self.max_ordinal_present();
9464 encoder.write_num(max_ordinal, offset);
9465 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9466 if max_ordinal == 0 {
9468 return Ok(());
9469 }
9470 depth.increment()?;
9471 let envelope_size = 8;
9472 let bytes_len = max_ordinal as usize * envelope_size;
9473 #[allow(unused_variables)]
9474 let offset = encoder.out_of_line_offset(bytes_len);
9475 let mut _prev_end_offset: usize = 0;
9476 if 1 > max_ordinal {
9477 return Ok(());
9478 }
9479
9480 let cur_offset: usize = (1 - 1) * envelope_size;
9483
9484 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9486
9487 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
9492 self.unique_id.as_ref().map(
9493 <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
9494 ),
9495 encoder,
9496 offset + cur_offset,
9497 depth,
9498 )?;
9499
9500 _prev_end_offset = cur_offset + envelope_size;
9501 if 2 > max_ordinal {
9502 return Ok(());
9503 }
9504
9505 let cur_offset: usize = (2 - 1) * envelope_size;
9508
9509 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9511
9512 fidl::encoding::encode_in_envelope_optional::<bool, D>(
9517 self.is_input.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9518 encoder,
9519 offset + cur_offset,
9520 depth,
9521 )?;
9522
9523 _prev_end_offset = cur_offset + envelope_size;
9524 if 3 > max_ordinal {
9525 return Ok(());
9526 }
9527
9528 let cur_offset: usize = (3 - 1) * envelope_size;
9531
9532 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9534
9535 fidl::encoding::encode_in_envelope_optional::<bool, D>(
9540 self.can_mute.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9541 encoder,
9542 offset + cur_offset,
9543 depth,
9544 )?;
9545
9546 _prev_end_offset = cur_offset + envelope_size;
9547 if 4 > max_ordinal {
9548 return Ok(());
9549 }
9550
9551 let cur_offset: usize = (4 - 1) * envelope_size;
9554
9555 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9557
9558 fidl::encoding::encode_in_envelope_optional::<bool, D>(
9563 self.can_agc.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9564 encoder,
9565 offset + cur_offset,
9566 depth,
9567 )?;
9568
9569 _prev_end_offset = cur_offset + envelope_size;
9570 if 5 > max_ordinal {
9571 return Ok(());
9572 }
9573
9574 let cur_offset: usize = (5 - 1) * envelope_size;
9577
9578 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9580
9581 fidl::encoding::encode_in_envelope_optional::<f32, D>(
9586 self.min_gain_db.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
9587 encoder,
9588 offset + cur_offset,
9589 depth,
9590 )?;
9591
9592 _prev_end_offset = cur_offset + envelope_size;
9593 if 6 > max_ordinal {
9594 return Ok(());
9595 }
9596
9597 let cur_offset: usize = (6 - 1) * envelope_size;
9600
9601 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9603
9604 fidl::encoding::encode_in_envelope_optional::<f32, D>(
9609 self.max_gain_db.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
9610 encoder,
9611 offset + cur_offset,
9612 depth,
9613 )?;
9614
9615 _prev_end_offset = cur_offset + envelope_size;
9616 if 7 > max_ordinal {
9617 return Ok(());
9618 }
9619
9620 let cur_offset: usize = (7 - 1) * envelope_size;
9623
9624 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9626
9627 fidl::encoding::encode_in_envelope_optional::<f32, D>(
9632 self.gain_step_db.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
9633 encoder,
9634 offset + cur_offset,
9635 depth,
9636 )?;
9637
9638 _prev_end_offset = cur_offset + envelope_size;
9639 if 8 > max_ordinal {
9640 return Ok(());
9641 }
9642
9643 let cur_offset: usize = (8 - 1) * envelope_size;
9646
9647 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9649
9650 fidl::encoding::encode_in_envelope_optional::<PlugDetectCapabilities, D>(
9655 self.plug_detect_capabilities
9656 .as_ref()
9657 .map(<PlugDetectCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
9658 encoder,
9659 offset + cur_offset,
9660 depth,
9661 )?;
9662
9663 _prev_end_offset = cur_offset + envelope_size;
9664 if 9 > max_ordinal {
9665 return Ok(());
9666 }
9667
9668 let cur_offset: usize = (9 - 1) * envelope_size;
9671
9672 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9674
9675 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
9680 self.manufacturer.as_ref().map(
9681 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
9682 ),
9683 encoder,
9684 offset + cur_offset,
9685 depth,
9686 )?;
9687
9688 _prev_end_offset = cur_offset + envelope_size;
9689 if 10 > max_ordinal {
9690 return Ok(());
9691 }
9692
9693 let cur_offset: usize = (10 - 1) * envelope_size;
9696
9697 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9699
9700 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
9705 self.product.as_ref().map(
9706 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
9707 ),
9708 encoder,
9709 offset + cur_offset,
9710 depth,
9711 )?;
9712
9713 _prev_end_offset = cur_offset + envelope_size;
9714 if 11 > max_ordinal {
9715 return Ok(());
9716 }
9717
9718 let cur_offset: usize = (11 - 1) * envelope_size;
9721
9722 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9724
9725 fidl::encoding::encode_in_envelope_optional::<u32, D>(
9730 self.clock_domain.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9731 encoder,
9732 offset + cur_offset,
9733 depth,
9734 )?;
9735
9736 _prev_end_offset = cur_offset + envelope_size;
9737
9738 Ok(())
9739 }
9740 }
9741
9742 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamProperties {
9743 #[inline(always)]
9744 fn new_empty() -> Self {
9745 Self::default()
9746 }
9747
9748 unsafe fn decode(
9749 &mut self,
9750 decoder: &mut fidl::encoding::Decoder<'_, D>,
9751 offset: usize,
9752 mut depth: fidl::encoding::Depth,
9753 ) -> fidl::Result<()> {
9754 decoder.debug_check_bounds::<Self>(offset);
9755 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9756 None => return Err(fidl::Error::NotNullable),
9757 Some(len) => len,
9758 };
9759 if len == 0 {
9761 return Ok(());
9762 };
9763 depth.increment()?;
9764 let envelope_size = 8;
9765 let bytes_len = len * envelope_size;
9766 let offset = decoder.out_of_line_offset(bytes_len)?;
9767 let mut _next_ordinal_to_read = 0;
9769 let mut next_offset = offset;
9770 let end_offset = offset + bytes_len;
9771 _next_ordinal_to_read += 1;
9772 if next_offset >= end_offset {
9773 return Ok(());
9774 }
9775
9776 while _next_ordinal_to_read < 1 {
9778 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9779 _next_ordinal_to_read += 1;
9780 next_offset += envelope_size;
9781 }
9782
9783 let next_out_of_line = decoder.next_out_of_line();
9784 let handles_before = decoder.remaining_handles();
9785 if let Some((inlined, num_bytes, num_handles)) =
9786 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9787 {
9788 let member_inline_size =
9789 <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
9790 decoder.context,
9791 );
9792 if inlined != (member_inline_size <= 4) {
9793 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9794 }
9795 let inner_offset;
9796 let mut inner_depth = depth.clone();
9797 if inlined {
9798 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9799 inner_offset = next_offset;
9800 } else {
9801 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9802 inner_depth.increment()?;
9803 }
9804 let val_ref = self
9805 .unique_id
9806 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
9807 fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
9808 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9809 {
9810 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9811 }
9812 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9813 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9814 }
9815 }
9816
9817 next_offset += envelope_size;
9818 _next_ordinal_to_read += 1;
9819 if next_offset >= end_offset {
9820 return Ok(());
9821 }
9822
9823 while _next_ordinal_to_read < 2 {
9825 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9826 _next_ordinal_to_read += 1;
9827 next_offset += envelope_size;
9828 }
9829
9830 let next_out_of_line = decoder.next_out_of_line();
9831 let handles_before = decoder.remaining_handles();
9832 if let Some((inlined, num_bytes, num_handles)) =
9833 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9834 {
9835 let member_inline_size =
9836 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9837 if inlined != (member_inline_size <= 4) {
9838 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9839 }
9840 let inner_offset;
9841 let mut inner_depth = depth.clone();
9842 if inlined {
9843 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9844 inner_offset = next_offset;
9845 } else {
9846 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9847 inner_depth.increment()?;
9848 }
9849 let val_ref = self.is_input.get_or_insert_with(|| fidl::new_empty!(bool, D));
9850 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9851 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9852 {
9853 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9854 }
9855 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9856 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9857 }
9858 }
9859
9860 next_offset += envelope_size;
9861 _next_ordinal_to_read += 1;
9862 if next_offset >= end_offset {
9863 return Ok(());
9864 }
9865
9866 while _next_ordinal_to_read < 3 {
9868 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9869 _next_ordinal_to_read += 1;
9870 next_offset += envelope_size;
9871 }
9872
9873 let next_out_of_line = decoder.next_out_of_line();
9874 let handles_before = decoder.remaining_handles();
9875 if let Some((inlined, num_bytes, num_handles)) =
9876 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9877 {
9878 let member_inline_size =
9879 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9880 if inlined != (member_inline_size <= 4) {
9881 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9882 }
9883 let inner_offset;
9884 let mut inner_depth = depth.clone();
9885 if inlined {
9886 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9887 inner_offset = next_offset;
9888 } else {
9889 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9890 inner_depth.increment()?;
9891 }
9892 let val_ref = self.can_mute.get_or_insert_with(|| fidl::new_empty!(bool, D));
9893 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9894 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9895 {
9896 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9897 }
9898 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9899 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9900 }
9901 }
9902
9903 next_offset += envelope_size;
9904 _next_ordinal_to_read += 1;
9905 if next_offset >= end_offset {
9906 return Ok(());
9907 }
9908
9909 while _next_ordinal_to_read < 4 {
9911 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9912 _next_ordinal_to_read += 1;
9913 next_offset += envelope_size;
9914 }
9915
9916 let next_out_of_line = decoder.next_out_of_line();
9917 let handles_before = decoder.remaining_handles();
9918 if let Some((inlined, num_bytes, num_handles)) =
9919 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9920 {
9921 let member_inline_size =
9922 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9923 if inlined != (member_inline_size <= 4) {
9924 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9925 }
9926 let inner_offset;
9927 let mut inner_depth = depth.clone();
9928 if inlined {
9929 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9930 inner_offset = next_offset;
9931 } else {
9932 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9933 inner_depth.increment()?;
9934 }
9935 let val_ref = self.can_agc.get_or_insert_with(|| fidl::new_empty!(bool, D));
9936 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9937 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9938 {
9939 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9940 }
9941 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9942 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9943 }
9944 }
9945
9946 next_offset += envelope_size;
9947 _next_ordinal_to_read += 1;
9948 if next_offset >= end_offset {
9949 return Ok(());
9950 }
9951
9952 while _next_ordinal_to_read < 5 {
9954 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9955 _next_ordinal_to_read += 1;
9956 next_offset += envelope_size;
9957 }
9958
9959 let next_out_of_line = decoder.next_out_of_line();
9960 let handles_before = decoder.remaining_handles();
9961 if let Some((inlined, num_bytes, num_handles)) =
9962 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9963 {
9964 let member_inline_size =
9965 <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9966 if inlined != (member_inline_size <= 4) {
9967 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9968 }
9969 let inner_offset;
9970 let mut inner_depth = depth.clone();
9971 if inlined {
9972 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9973 inner_offset = next_offset;
9974 } else {
9975 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9976 inner_depth.increment()?;
9977 }
9978 let val_ref = self.min_gain_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
9979 fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
9980 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9981 {
9982 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9983 }
9984 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9985 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9986 }
9987 }
9988
9989 next_offset += envelope_size;
9990 _next_ordinal_to_read += 1;
9991 if next_offset >= end_offset {
9992 return Ok(());
9993 }
9994
9995 while _next_ordinal_to_read < 6 {
9997 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9998 _next_ordinal_to_read += 1;
9999 next_offset += envelope_size;
10000 }
10001
10002 let next_out_of_line = decoder.next_out_of_line();
10003 let handles_before = decoder.remaining_handles();
10004 if let Some((inlined, num_bytes, num_handles)) =
10005 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10006 {
10007 let member_inline_size =
10008 <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10009 if inlined != (member_inline_size <= 4) {
10010 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10011 }
10012 let inner_offset;
10013 let mut inner_depth = depth.clone();
10014 if inlined {
10015 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10016 inner_offset = next_offset;
10017 } else {
10018 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10019 inner_depth.increment()?;
10020 }
10021 let val_ref = self.max_gain_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
10022 fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
10023 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10024 {
10025 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10026 }
10027 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10028 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10029 }
10030 }
10031
10032 next_offset += envelope_size;
10033 _next_ordinal_to_read += 1;
10034 if next_offset >= end_offset {
10035 return Ok(());
10036 }
10037
10038 while _next_ordinal_to_read < 7 {
10040 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10041 _next_ordinal_to_read += 1;
10042 next_offset += envelope_size;
10043 }
10044
10045 let next_out_of_line = decoder.next_out_of_line();
10046 let handles_before = decoder.remaining_handles();
10047 if let Some((inlined, num_bytes, num_handles)) =
10048 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10049 {
10050 let member_inline_size =
10051 <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10052 if inlined != (member_inline_size <= 4) {
10053 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10054 }
10055 let inner_offset;
10056 let mut inner_depth = depth.clone();
10057 if inlined {
10058 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10059 inner_offset = next_offset;
10060 } else {
10061 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10062 inner_depth.increment()?;
10063 }
10064 let val_ref = self.gain_step_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
10065 fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
10066 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10067 {
10068 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10069 }
10070 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10071 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10072 }
10073 }
10074
10075 next_offset += envelope_size;
10076 _next_ordinal_to_read += 1;
10077 if next_offset >= end_offset {
10078 return Ok(());
10079 }
10080
10081 while _next_ordinal_to_read < 8 {
10083 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10084 _next_ordinal_to_read += 1;
10085 next_offset += envelope_size;
10086 }
10087
10088 let next_out_of_line = decoder.next_out_of_line();
10089 let handles_before = decoder.remaining_handles();
10090 if let Some((inlined, num_bytes, num_handles)) =
10091 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10092 {
10093 let member_inline_size =
10094 <PlugDetectCapabilities as fidl::encoding::TypeMarker>::inline_size(
10095 decoder.context,
10096 );
10097 if inlined != (member_inline_size <= 4) {
10098 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10099 }
10100 let inner_offset;
10101 let mut inner_depth = depth.clone();
10102 if inlined {
10103 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10104 inner_offset = next_offset;
10105 } else {
10106 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10107 inner_depth.increment()?;
10108 }
10109 let val_ref = self
10110 .plug_detect_capabilities
10111 .get_or_insert_with(|| fidl::new_empty!(PlugDetectCapabilities, D));
10112 fidl::decode!(
10113 PlugDetectCapabilities,
10114 D,
10115 val_ref,
10116 decoder,
10117 inner_offset,
10118 inner_depth
10119 )?;
10120 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10121 {
10122 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10123 }
10124 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10125 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10126 }
10127 }
10128
10129 next_offset += envelope_size;
10130 _next_ordinal_to_read += 1;
10131 if next_offset >= end_offset {
10132 return Ok(());
10133 }
10134
10135 while _next_ordinal_to_read < 9 {
10137 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10138 _next_ordinal_to_read += 1;
10139 next_offset += envelope_size;
10140 }
10141
10142 let next_out_of_line = decoder.next_out_of_line();
10143 let handles_before = decoder.remaining_handles();
10144 if let Some((inlined, num_bytes, num_handles)) =
10145 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10146 {
10147 let member_inline_size =
10148 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
10149 decoder.context,
10150 );
10151 if inlined != (member_inline_size <= 4) {
10152 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10153 }
10154 let inner_offset;
10155 let mut inner_depth = depth.clone();
10156 if inlined {
10157 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10158 inner_offset = next_offset;
10159 } else {
10160 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10161 inner_depth.increment()?;
10162 }
10163 let val_ref = self
10164 .manufacturer
10165 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
10166 fidl::decode!(
10167 fidl::encoding::BoundedString<256>,
10168 D,
10169 val_ref,
10170 decoder,
10171 inner_offset,
10172 inner_depth
10173 )?;
10174 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10175 {
10176 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10177 }
10178 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10179 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10180 }
10181 }
10182
10183 next_offset += envelope_size;
10184 _next_ordinal_to_read += 1;
10185 if next_offset >= end_offset {
10186 return Ok(());
10187 }
10188
10189 while _next_ordinal_to_read < 10 {
10191 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10192 _next_ordinal_to_read += 1;
10193 next_offset += envelope_size;
10194 }
10195
10196 let next_out_of_line = decoder.next_out_of_line();
10197 let handles_before = decoder.remaining_handles();
10198 if let Some((inlined, num_bytes, num_handles)) =
10199 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10200 {
10201 let member_inline_size =
10202 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
10203 decoder.context,
10204 );
10205 if inlined != (member_inline_size <= 4) {
10206 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10207 }
10208 let inner_offset;
10209 let mut inner_depth = depth.clone();
10210 if inlined {
10211 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10212 inner_offset = next_offset;
10213 } else {
10214 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10215 inner_depth.increment()?;
10216 }
10217 let val_ref = self
10218 .product
10219 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
10220 fidl::decode!(
10221 fidl::encoding::BoundedString<256>,
10222 D,
10223 val_ref,
10224 decoder,
10225 inner_offset,
10226 inner_depth
10227 )?;
10228 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10229 {
10230 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10231 }
10232 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10233 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10234 }
10235 }
10236
10237 next_offset += envelope_size;
10238 _next_ordinal_to_read += 1;
10239 if next_offset >= end_offset {
10240 return Ok(());
10241 }
10242
10243 while _next_ordinal_to_read < 11 {
10245 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10246 _next_ordinal_to_read += 1;
10247 next_offset += envelope_size;
10248 }
10249
10250 let next_out_of_line = decoder.next_out_of_line();
10251 let handles_before = decoder.remaining_handles();
10252 if let Some((inlined, num_bytes, num_handles)) =
10253 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10254 {
10255 let member_inline_size =
10256 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10257 if inlined != (member_inline_size <= 4) {
10258 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10259 }
10260 let inner_offset;
10261 let mut inner_depth = depth.clone();
10262 if inlined {
10263 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10264 inner_offset = next_offset;
10265 } else {
10266 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10267 inner_depth.increment()?;
10268 }
10269 let val_ref = self.clock_domain.get_or_insert_with(|| fidl::new_empty!(u32, D));
10270 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10271 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10272 {
10273 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10274 }
10275 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10276 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10277 }
10278 }
10279
10280 next_offset += envelope_size;
10281
10282 while next_offset < end_offset {
10284 _next_ordinal_to_read += 1;
10285 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10286 next_offset += envelope_size;
10287 }
10288
10289 Ok(())
10290 }
10291 }
10292
10293 impl SupportedFormats {
10294 #[inline(always)]
10295 fn max_ordinal_present(&self) -> u64 {
10296 if let Some(_) = self.pcm_supported_formats {
10297 return 1;
10298 }
10299 0
10300 }
10301 }
10302
10303 impl fidl::encoding::ValueTypeMarker for SupportedFormats {
10304 type Borrowed<'a> = &'a Self;
10305 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10306 value
10307 }
10308 }
10309
10310 unsafe impl fidl::encoding::TypeMarker for SupportedFormats {
10311 type Owned = Self;
10312
10313 #[inline(always)]
10314 fn inline_align(_context: fidl::encoding::Context) -> usize {
10315 8
10316 }
10317
10318 #[inline(always)]
10319 fn inline_size(_context: fidl::encoding::Context) -> usize {
10320 16
10321 }
10322 }
10323
10324 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SupportedFormats, D>
10325 for &SupportedFormats
10326 {
10327 unsafe fn encode(
10328 self,
10329 encoder: &mut fidl::encoding::Encoder<'_, D>,
10330 offset: usize,
10331 mut depth: fidl::encoding::Depth,
10332 ) -> fidl::Result<()> {
10333 encoder.debug_check_bounds::<SupportedFormats>(offset);
10334 let max_ordinal: u64 = self.max_ordinal_present();
10336 encoder.write_num(max_ordinal, offset);
10337 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10338 if max_ordinal == 0 {
10340 return Ok(());
10341 }
10342 depth.increment()?;
10343 let envelope_size = 8;
10344 let bytes_len = max_ordinal as usize * envelope_size;
10345 #[allow(unused_variables)]
10346 let offset = encoder.out_of_line_offset(bytes_len);
10347 let mut _prev_end_offset: usize = 0;
10348 if 1 > max_ordinal {
10349 return Ok(());
10350 }
10351
10352 let cur_offset: usize = (1 - 1) * envelope_size;
10355
10356 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10358
10359 fidl::encoding::encode_in_envelope_optional::<PcmSupportedFormats, D>(
10364 self.pcm_supported_formats
10365 .as_ref()
10366 .map(<PcmSupportedFormats as fidl::encoding::ValueTypeMarker>::borrow),
10367 encoder,
10368 offset + cur_offset,
10369 depth,
10370 )?;
10371
10372 _prev_end_offset = cur_offset + envelope_size;
10373
10374 Ok(())
10375 }
10376 }
10377
10378 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SupportedFormats {
10379 #[inline(always)]
10380 fn new_empty() -> Self {
10381 Self::default()
10382 }
10383
10384 unsafe fn decode(
10385 &mut self,
10386 decoder: &mut fidl::encoding::Decoder<'_, D>,
10387 offset: usize,
10388 mut depth: fidl::encoding::Depth,
10389 ) -> fidl::Result<()> {
10390 decoder.debug_check_bounds::<Self>(offset);
10391 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10392 None => return Err(fidl::Error::NotNullable),
10393 Some(len) => len,
10394 };
10395 if len == 0 {
10397 return Ok(());
10398 };
10399 depth.increment()?;
10400 let envelope_size = 8;
10401 let bytes_len = len * envelope_size;
10402 let offset = decoder.out_of_line_offset(bytes_len)?;
10403 let mut _next_ordinal_to_read = 0;
10405 let mut next_offset = offset;
10406 let end_offset = offset + bytes_len;
10407 _next_ordinal_to_read += 1;
10408 if next_offset >= end_offset {
10409 return Ok(());
10410 }
10411
10412 while _next_ordinal_to_read < 1 {
10414 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10415 _next_ordinal_to_read += 1;
10416 next_offset += envelope_size;
10417 }
10418
10419 let next_out_of_line = decoder.next_out_of_line();
10420 let handles_before = decoder.remaining_handles();
10421 if let Some((inlined, num_bytes, num_handles)) =
10422 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10423 {
10424 let member_inline_size =
10425 <PcmSupportedFormats as fidl::encoding::TypeMarker>::inline_size(
10426 decoder.context,
10427 );
10428 if inlined != (member_inline_size <= 4) {
10429 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10430 }
10431 let inner_offset;
10432 let mut inner_depth = depth.clone();
10433 if inlined {
10434 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10435 inner_offset = next_offset;
10436 } else {
10437 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10438 inner_depth.increment()?;
10439 }
10440 let val_ref = self
10441 .pcm_supported_formats
10442 .get_or_insert_with(|| fidl::new_empty!(PcmSupportedFormats, D));
10443 fidl::decode!(PcmSupportedFormats, D, val_ref, decoder, inner_offset, inner_depth)?;
10444 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10445 {
10446 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10447 }
10448 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10449 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10450 }
10451 }
10452
10453 next_offset += envelope_size;
10454
10455 while next_offset < end_offset {
10457 _next_ordinal_to_read += 1;
10458 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10459 next_offset += envelope_size;
10460 }
10461
10462 Ok(())
10463 }
10464 }
10465
10466 impl fidl::encoding::ValueTypeMarker for DaiFrameFormat {
10467 type Borrowed<'a> = &'a Self;
10468 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10469 value
10470 }
10471 }
10472
10473 unsafe impl fidl::encoding::TypeMarker for DaiFrameFormat {
10474 type Owned = Self;
10475
10476 #[inline(always)]
10477 fn inline_align(_context: fidl::encoding::Context) -> usize {
10478 8
10479 }
10480
10481 #[inline(always)]
10482 fn inline_size(_context: fidl::encoding::Context) -> usize {
10483 16
10484 }
10485 }
10486
10487 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiFrameFormat, D>
10488 for &DaiFrameFormat
10489 {
10490 #[inline]
10491 unsafe fn encode(
10492 self,
10493 encoder: &mut fidl::encoding::Encoder<'_, D>,
10494 offset: usize,
10495 _depth: fidl::encoding::Depth,
10496 ) -> fidl::Result<()> {
10497 encoder.debug_check_bounds::<DaiFrameFormat>(offset);
10498 encoder.write_num::<u64>(self.ordinal(), offset);
10499 match self {
10500 DaiFrameFormat::FrameFormatStandard(ref val) => {
10501 fidl::encoding::encode_in_envelope::<DaiFrameFormatStandard, D>(
10502 <DaiFrameFormatStandard as fidl::encoding::ValueTypeMarker>::borrow(val),
10503 encoder,
10504 offset + 8,
10505 _depth,
10506 )
10507 }
10508 DaiFrameFormat::FrameFormatCustom(ref val) => {
10509 fidl::encoding::encode_in_envelope::<DaiFrameFormatCustom, D>(
10510 <DaiFrameFormatCustom as fidl::encoding::ValueTypeMarker>::borrow(val),
10511 encoder,
10512 offset + 8,
10513 _depth,
10514 )
10515 }
10516 }
10517 }
10518 }
10519
10520 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiFrameFormat {
10521 #[inline(always)]
10522 fn new_empty() -> Self {
10523 Self::FrameFormatStandard(fidl::new_empty!(DaiFrameFormatStandard, D))
10524 }
10525
10526 #[inline]
10527 unsafe fn decode(
10528 &mut self,
10529 decoder: &mut fidl::encoding::Decoder<'_, D>,
10530 offset: usize,
10531 mut depth: fidl::encoding::Depth,
10532 ) -> fidl::Result<()> {
10533 decoder.debug_check_bounds::<Self>(offset);
10534 #[allow(unused_variables)]
10535 let next_out_of_line = decoder.next_out_of_line();
10536 let handles_before = decoder.remaining_handles();
10537 let (ordinal, inlined, num_bytes, num_handles) =
10538 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10539
10540 let member_inline_size = match ordinal {
10541 1 => <DaiFrameFormatStandard as fidl::encoding::TypeMarker>::inline_size(
10542 decoder.context,
10543 ),
10544 2 => <DaiFrameFormatCustom as fidl::encoding::TypeMarker>::inline_size(
10545 decoder.context,
10546 ),
10547 _ => return Err(fidl::Error::UnknownUnionTag),
10548 };
10549
10550 if inlined != (member_inline_size <= 4) {
10551 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10552 }
10553 let _inner_offset;
10554 if inlined {
10555 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10556 _inner_offset = offset + 8;
10557 } else {
10558 depth.increment()?;
10559 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10560 }
10561 match ordinal {
10562 1 => {
10563 #[allow(irrefutable_let_patterns)]
10564 if let DaiFrameFormat::FrameFormatStandard(_) = self {
10565 } else {
10567 *self = DaiFrameFormat::FrameFormatStandard(fidl::new_empty!(
10569 DaiFrameFormatStandard,
10570 D
10571 ));
10572 }
10573 #[allow(irrefutable_let_patterns)]
10574 if let DaiFrameFormat::FrameFormatStandard(ref mut val) = self {
10575 fidl::decode!(
10576 DaiFrameFormatStandard,
10577 D,
10578 val,
10579 decoder,
10580 _inner_offset,
10581 depth
10582 )?;
10583 } else {
10584 unreachable!()
10585 }
10586 }
10587 2 => {
10588 #[allow(irrefutable_let_patterns)]
10589 if let DaiFrameFormat::FrameFormatCustom(_) = self {
10590 } else {
10592 *self = DaiFrameFormat::FrameFormatCustom(fidl::new_empty!(
10594 DaiFrameFormatCustom,
10595 D
10596 ));
10597 }
10598 #[allow(irrefutable_let_patterns)]
10599 if let DaiFrameFormat::FrameFormatCustom(ref mut val) = self {
10600 fidl::decode!(DaiFrameFormatCustom, D, val, decoder, _inner_offset, depth)?;
10601 } else {
10602 unreachable!()
10603 }
10604 }
10605 ordinal => panic!("unexpected ordinal {:?}", ordinal),
10606 }
10607 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10608 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10609 }
10610 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10611 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10612 }
10613 Ok(())
10614 }
10615 }
10616}