fidl_fuchsia_intl_common/
fidl_fuchsia_intl_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// This is the time zone reported when no time zones have been set.
12pub const DEFAULT_TIME_ZONE_ID: &str = "UTC";
13
14/// Enumeration of the days of the week.
15#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
16#[repr(u8)]
17pub enum DayOfWeek {
18    Sunday = 1,
19    Monday = 2,
20    Tuesday = 3,
21    Wednesday = 4,
22    Thursday = 5,
23    Friday = 6,
24    Saturday = 7,
25}
26
27impl DayOfWeek {
28    #[inline]
29    pub fn from_primitive(prim: u8) -> Option<Self> {
30        match prim {
31            1 => Some(Self::Sunday),
32            2 => Some(Self::Monday),
33            3 => Some(Self::Tuesday),
34            4 => Some(Self::Wednesday),
35            5 => Some(Self::Thursday),
36            6 => Some(Self::Friday),
37            7 => Some(Self::Saturday),
38            _ => None,
39        }
40    }
41
42    #[inline]
43    pub const fn into_primitive(self) -> u8 {
44        self as u8
45    }
46
47    #[deprecated = "Strict enums should not use `is_unknown`"]
48    #[inline]
49    pub fn is_unknown(&self) -> bool {
50        false
51    }
52}
53
54/// Enumeration of the months of the year.
55#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
56#[repr(u8)]
57pub enum Month {
58    January = 1,
59    February = 2,
60    March = 3,
61    April = 4,
62    May = 5,
63    June = 6,
64    July = 7,
65    August = 8,
66    September = 9,
67    October = 10,
68    November = 11,
69    December = 12,
70}
71
72impl Month {
73    #[inline]
74    pub fn from_primitive(prim: u8) -> Option<Self> {
75        match prim {
76            1 => Some(Self::January),
77            2 => Some(Self::February),
78            3 => Some(Self::March),
79            4 => Some(Self::April),
80            5 => Some(Self::May),
81            6 => Some(Self::June),
82            7 => Some(Self::July),
83            8 => Some(Self::August),
84            9 => Some(Self::September),
85            10 => Some(Self::October),
86            11 => Some(Self::November),
87            12 => Some(Self::December),
88            _ => None,
89        }
90    }
91
92    #[inline]
93    pub const fn into_primitive(self) -> u8 {
94        self as u8
95    }
96
97    #[deprecated = "Strict enums should not use `is_unknown`"]
98    #[inline]
99    pub fn is_unknown(&self) -> bool {
100        false
101    }
102}
103
104/// During a transition from daylight savings to standard time (when the clock is turned back), a
105/// civil time can correspond to two possible absolute times. This setting determines which of those
106/// times should be assumed during the conversion to absolute time.
107///
108/// TODO(https://fxbug.dev/42162861): Implement `AFTER_TRANSITION`.
109#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
110pub enum RepeatedTimeConversion {
111    /// Returns the wall clock time before the transition.
112    ///
113    /// For example, in "America/New_York" on the night of the fall transition to standard time,
114    /// `1:30 AM` is interpreted as `01:30-04:00` (EDT), which is `05:30Z`.
115    BeforeTransition,
116    #[doc(hidden)]
117    __SourceBreaking { unknown_ordinal: i32 },
118}
119
120/// Pattern that matches an unknown `RepeatedTimeConversion` member.
121#[macro_export]
122macro_rules! RepeatedTimeConversionUnknown {
123    () => {
124        _
125    };
126}
127
128impl RepeatedTimeConversion {
129    #[inline]
130    pub fn from_primitive(prim: i32) -> Option<Self> {
131        match prim {
132            1 => Some(Self::BeforeTransition),
133            _ => None,
134        }
135    }
136
137    #[inline]
138    pub fn from_primitive_allow_unknown(prim: i32) -> Self {
139        match prim {
140            1 => Self::BeforeTransition,
141            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
142        }
143    }
144
145    #[inline]
146    pub fn unknown() -> Self {
147        Self::__SourceBreaking { unknown_ordinal: 0x7fffffff }
148    }
149
150    #[inline]
151    pub const fn into_primitive(self) -> i32 {
152        match self {
153            Self::BeforeTransition => 1,
154            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
155        }
156    }
157
158    #[inline]
159    pub fn is_unknown(&self) -> bool {
160        match self {
161            Self::__SourceBreaking { unknown_ordinal: _ } => true,
162            _ => false,
163        }
164    }
165}
166
167/// During a transition from standard time to daylight savings time (when the clock is turned
168/// forward), a span of civil times is skipped (usually one hour). This setting determines how
169/// invalid civil times within this span should be treated.
170///
171/// TODO(https://fxbug.dev/42162861): Implement `BEFORE_TRANSITION` and `AFTER_TRANSITION`.
172#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
173pub enum SkippedTimeConversion {
174    /// Returns `TimeZonesError::INVALID_DATE` when trying to convert a skipped civil time.
175    Reject,
176    /// Returns the closest valid time after the requested time.
177    ///
178    /// For example, in "America/New_York" on the night of the spring transition to daylight savings
179    /// time, `2:30 AM` doesn't exist, so the next valid time, `3:00 AM` (EDT) is returned instead.
180    NextValidTime,
181    #[doc(hidden)]
182    __SourceBreaking { unknown_ordinal: i32 },
183}
184
185/// Pattern that matches an unknown `SkippedTimeConversion` member.
186#[macro_export]
187macro_rules! SkippedTimeConversionUnknown {
188    () => {
189        _
190    };
191}
192
193impl SkippedTimeConversion {
194    #[inline]
195    pub fn from_primitive(prim: i32) -> Option<Self> {
196        match prim {
197            1 => Some(Self::Reject),
198            2 => Some(Self::NextValidTime),
199            _ => None,
200        }
201    }
202
203    #[inline]
204    pub fn from_primitive_allow_unknown(prim: i32) -> Self {
205        match prim {
206            1 => Self::Reject,
207            2 => Self::NextValidTime,
208            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
209        }
210    }
211
212    #[inline]
213    pub fn unknown() -> Self {
214        Self::__SourceBreaking { unknown_ordinal: 0x7fffffff }
215    }
216
217    #[inline]
218    pub const fn into_primitive(self) -> i32 {
219        match self {
220            Self::Reject => 1,
221            Self::NextValidTime => 2,
222            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
223        }
224    }
225
226    #[inline]
227    pub fn is_unknown(&self) -> bool {
228        match self {
229            Self::__SourceBreaking { unknown_ordinal: _ } => true,
230            _ => false,
231        }
232    }
233}
234
235/// Selection of [temperature units](https://en.wikipedia.org/wiki/Degree_(temperature)).
236#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
237#[repr(u32)]
238pub enum TemperatureUnit {
239    /// The temperature should be formatted to show temperature in degrees Celsius.
240    Celsius = 0,
241    /// The temperature should be formatted to show temperature in degrees Fahrenheit.
242    Fahrenheit = 1,
243}
244
245impl TemperatureUnit {
246    #[inline]
247    pub fn from_primitive(prim: u32) -> Option<Self> {
248        match prim {
249            0 => Some(Self::Celsius),
250            1 => Some(Self::Fahrenheit),
251            _ => None,
252        }
253    }
254
255    #[inline]
256    pub const fn into_primitive(self) -> u32 {
257        self as u32
258    }
259
260    #[deprecated = "Strict enums should not use `is_unknown`"]
261    #[inline]
262    pub fn is_unknown(&self) -> bool {
263        false
264    }
265}
266
267#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
268pub enum TimeZonesError {
269    /// An internal error has occurred within the service.
270    InternalError,
271    /// The requested time zone ID is invalid.
272    UnknownTimeZone,
273    /// The provided date is out of range or invalid.
274    InvalidDate,
275    #[doc(hidden)]
276    __SourceBreaking { unknown_ordinal: i32 },
277}
278
279/// Pattern that matches an unknown `TimeZonesError` member.
280#[macro_export]
281macro_rules! TimeZonesErrorUnknown {
282    () => {
283        _
284    };
285}
286
287impl TimeZonesError {
288    #[inline]
289    pub fn from_primitive(prim: i32) -> Option<Self> {
290        match prim {
291            1 => Some(Self::InternalError),
292            2 => Some(Self::UnknownTimeZone),
293            3 => Some(Self::InvalidDate),
294            _ => None,
295        }
296    }
297
298    #[inline]
299    pub fn from_primitive_allow_unknown(prim: i32) -> Self {
300        match prim {
301            1 => Self::InternalError,
302            2 => Self::UnknownTimeZone,
303            3 => Self::InvalidDate,
304            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
305        }
306    }
307
308    #[inline]
309    pub fn unknown() -> Self {
310        Self::__SourceBreaking { unknown_ordinal: 0x7fffffff }
311    }
312
313    #[inline]
314    pub const fn into_primitive(self) -> i32 {
315        match self {
316            Self::InternalError => 1,
317            Self::UnknownTimeZone => 2,
318            Self::InvalidDate => 3,
319            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
320        }
321    }
322
323    #[inline]
324    pub fn is_unknown(&self) -> bool {
325        match self {
326            Self::__SourceBreaking { unknown_ordinal: _ } => true,
327            _ => false,
328        }
329    }
330}
331
332/// Typed identifier for a single calendar system. Currently consists only of a calendar ID.
333#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
334pub struct CalendarId {
335    /// Unicode BCP-47 Locale Identifier with an undefined language tag and a single extension
336    /// specifying the calendar ID (from
337    /// https://unicode.org/repos/cldr/trunk/common/bcp47/calendar.xml).
338    ///
339    /// Examples:
340    ///   "und-u-ca-gregory"
341    ///   "und-u-ca-islamic"
342    pub id: String,
343}
344
345impl fidl::Persistable for CalendarId {}
346
347/// Typed identifier for a single Locale, which is a set of internationalization-related properties.
348///
349/// Most APIs that consume locales will probably want to accept a vector of locales to account for
350/// priority.
351#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
352pub struct LocaleId {
353    /// Unicode BCP-47 Locale Identifier
354    /// (http://www.unicode.org/reports/tr35/#BCP_47_Conformance).
355    ///
356    /// Must be canonicalized and well-formed. This field should not be populated from arbitrary
357    /// user- or third-party input, but instead generated programmatically.
358    ///
359    /// Includes language, region, script, and variant, plus Unicode extensions (under the "u"
360    /// singleton). Other extensions are allowed but ignored.
361    ///
362    /// Examples:
363    ///   "en-US"
364    ///     American English
365    ///   "fr-u-hc-h12"
366    ///     French, with 12-hour clock
367    ///   "ar-EG-u-fw-mon-nu-latn"
368    ///     Egyptian Arabic with "Latin" numerals and first day of week on Monday
369    pub id: String,
370}
371
372impl fidl::Persistable for LocaleId {}
373
374#[derive(Clone, Debug, PartialEq)]
375pub struct PropertyProviderGetProfileResponse {
376    pub profile: Profile,
377}
378
379impl fidl::Persistable for PropertyProviderGetProfileResponse {}
380
381/// Typed identifier for a time zone.
382#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
383pub struct TimeZoneId {
384    /// Time zone ID from tzdata, e.g. "America/New_York". See https://www.iana.org/time-zones.
385    pub id: String,
386}
387
388impl fidl::Persistable for TimeZoneId {}
389
390#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
391pub struct TimeZonesAbsoluteToCivilTimeRequest {
392    /// The time zone in which to calculate a civil date and time.
393    pub time_zone_id: TimeZoneId,
394    /// The number of nanoseconds since the Unix epoch.
395    /// For example, `at_time == 0` corresponds to 1970-01-01T00:00:00.000000000Z.
396    pub absolute_time: i64,
397}
398
399impl fidl::Persistable for TimeZonesAbsoluteToCivilTimeRequest {}
400
401#[derive(Clone, Debug, PartialEq)]
402pub struct TimeZonesCivilToAbsoluteTimeRequest {
403    /// The civil date and time to convert.
404    ///
405    /// Note that `civil_time.weekday` and `civil_time.year_day` may be omitted for this method.
406    /// If present, they must be consistent with the other fields.
407    pub civil_time: CivilTime,
408    /// Conversion options for civil times that cross a daylight savings transition.
409    pub options: CivilToAbsoluteTimeOptions,
410}
411
412impl fidl::Persistable for TimeZonesCivilToAbsoluteTimeRequest {}
413
414#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
415pub struct TimeZonesGetTimeZoneInfoRequest {
416    /// The time zone ID for which to retrieve information.
417    pub time_zone_id: TimeZoneId,
418    /// The date and time at which to calculate values, in nanoseconds since the Unix epoch.
419    /// For example, `at_time == 0` corresponds to 1970-01-01T00:00:00.000000000Z.
420    pub at_time: i64,
421}
422
423impl fidl::Persistable for TimeZonesGetTimeZoneInfoRequest {}
424
425#[derive(Clone, Debug, PartialEq)]
426pub struct TimeZonesAbsoluteToCivilTimeResponse {
427    pub civil_time: CivilTime,
428}
429
430impl fidl::Persistable for TimeZonesAbsoluteToCivilTimeResponse {}
431
432#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
433#[repr(C)]
434pub struct TimeZonesCivilToAbsoluteTimeResponse {
435    pub absolute_time: i64,
436}
437
438impl fidl::Persistable for TimeZonesCivilToAbsoluteTimeResponse {}
439
440#[derive(Clone, Debug, PartialEq)]
441pub struct TimeZonesGetTimeZoneInfoResponse {
442    pub time_zone_info: TimeZoneInfo,
443}
444
445impl fidl::Persistable for TimeZonesGetTimeZoneInfoResponse {}
446
447/// Describes a time on a civil calendar (Gregorian), with nanosecond precision. This is roughly
448/// equivalent to the `tm` struct in `time.h` in the C standard library, and is intended as a
449/// structured intermediate format for printing or parsing dates.
450#[derive(Clone, Debug, Default, PartialEq)]
451pub struct CivilTime {
452    /// Year, in the closed range `[1678, 2262]`.
453    pub year: Option<u16>,
454    /// Month of the year.
455    pub month: Option<Month>,
456    /// Day of the month, in the closed range `[1, 31]`.
457    pub day: Option<u8>,
458    /// Hour of the day, in the closed range `[0, 23]`.
459    pub hour: Option<u8>,
460    /// Minute of the hour, in the closed range `[0, 59]`.
461    pub minute: Option<u8>,
462    /// Second of the minute, in the closed range `[0, 59]`.
463    ///
464    /// (Note that Fuchsia does not currently calculate leap seconds when converting dates.)
465    pub second: Option<u8>,
466    /// Nanosecond, in the closed range `[0, 999_999_999]`.
467    pub nanos: Option<u64>,
468    /// Day of the week.
469    pub weekday: Option<DayOfWeek>,
470    /// Day of the year, in the closed range `[0, 365]`.
471    pub year_day: Option<u16>,
472    /// The time zone corresponding to this time. If omitted, the default is UTC.
473    pub time_zone_id: Option<TimeZoneId>,
474    #[doc(hidden)]
475    pub __source_breaking: fidl::marker::SourceBreaking,
476}
477
478impl fidl::Persistable for CivilTime {}
479
480/// Options for `TimeZones.CivilToAbsoluteTime`.
481#[derive(Clone, Debug, Default, PartialEq)]
482pub struct CivilToAbsoluteTimeOptions {
483    /// Optional setting for handling repeated times during backward daylight savings time
484    /// transitions.
485    ///
486    /// Default: `BEFORE_TRANSITION`.
487    pub repeated_time_conversion: Option<RepeatedTimeConversion>,
488    /// Optional setting for handling skipped times during forward daylight savings time
489    /// transitions.
490    ///
491    /// Default: `NEXT_VALID_TIME`.
492    pub skipped_time_conversion: Option<SkippedTimeConversion>,
493    #[doc(hidden)]
494    pub __source_breaking: fidl::marker::SourceBreaking,
495}
496
497impl fidl::Persistable for CivilToAbsoluteTimeOptions {}
498
499/// A collection of ranked internationalization properties.
500///
501/// There is no implied origin for this information; it might come from a user account, device
502/// settings, a synthesis of user settings and app-specific overrides, or anywhere else.
503///
504/// Language-independent properties that are supported by Unicode BCP-47 Locale IDs (e.g.
505/// first-day-of-week, time zone) are denormalized into the locale IDs in `locales`.
506#[derive(Clone, Debug, Default, PartialEq)]
507pub struct Profile {
508    /// Ranked list of locales (in descending order of preference).  The vector will always
509    /// be set, and always contain at least one element. For example,
510    /// locales = [ LocaleId("en-US") ] is valid, but locales = [], or locales = <unset> is not.
511    pub locales: Option<Vec<LocaleId>>,
512    /// Ranked list of calendars (in descending order of preference).
513    /// The first entry is the primary calendar, and will be equal to the calendar indicated
514    /// in `locales`.
515    /// The vector will always be set, and always contain at least one element.
516    /// The list allows multiple ranked preferences, and is intended for use
517    /// by applications that can display multiple calendar systems.
518    pub calendars: Option<Vec<CalendarId>>,
519    /// Ranked list of time zones (in descending order). The first entry is the primary time zone,
520    /// which should be used by default for formatting dates and times; it will be equal to the
521    /// calendar indicated in `locales`.
522    /// The list is intended for use by applications that can display multiple time zones, e.g.
523    /// a world clock.
524    /// The vector will always be set, and always contain at least one element.
525    /// On Fuchsia, the default time zone is always `DEFAULT_TIME_ZONE_ID` when
526    /// no more specific time zones have been defined or selected.
527    pub time_zones: Option<Vec<TimeZoneId>>,
528    /// Selected temperature unit. The unit is always reported: if there is no
529    /// setting in the current environment, the default value of CELSIUS is
530    /// used.
531    pub temperature_unit: Option<TemperatureUnit>,
532    #[doc(hidden)]
533    pub __source_breaking: fidl::marker::SourceBreaking,
534}
535
536impl fidl::Persistable for Profile {}
537
538/// Typed identifier for a regulatory domain as specified in the IEEE 802.11 standard.
539#[derive(Clone, Debug, Default, PartialEq)]
540pub struct RegulatoryDomain {
541    /// ISO 3166-1 alpha-2, a two-letter code representing a domain of operation.
542    /// (https://www.iso.org/publication/PUB500001.html)
543    pub country_code: Option<String>,
544    #[doc(hidden)]
545    pub __source_breaking: fidl::marker::SourceBreaking,
546}
547
548impl fidl::Persistable for RegulatoryDomain {}
549
550/// Describes a Time Zone's properties at a particular moment in time.
551///
552/// TODO(https://fxbug.dev/42162409): Additional fields with a breakdown of offsets and DST status.
553#[derive(Clone, Debug, Default, PartialEq)]
554pub struct TimeZoneInfo {
555    /// The time zone's IANA ID.
556    pub id: Option<TimeZoneId>,
557    /// The total offset (including Daylight Savings, if the time zone is in Daylight Savings Time)
558    /// from UTC at the queried time (`at_time`). If the time zone is ahead of UTC, this will be a
559    /// positive value; if behind UTC, a negative value.
560    pub total_offset_at_time: Option<i64>,
561    /// Indicates whether the time zone is in Daylight Savings Time at the queried time
562    /// (`at_time`).
563    pub in_dst_at_time: Option<bool>,
564    #[doc(hidden)]
565    pub __source_breaking: fidl::marker::SourceBreaking,
566}
567
568impl fidl::Persistable for TimeZoneInfo {}
569
570mod internal {
571    use super::*;
572    unsafe impl fidl::encoding::TypeMarker for DayOfWeek {
573        type Owned = Self;
574
575        #[inline(always)]
576        fn inline_align(_context: fidl::encoding::Context) -> usize {
577            std::mem::align_of::<u8>()
578        }
579
580        #[inline(always)]
581        fn inline_size(_context: fidl::encoding::Context) -> usize {
582            std::mem::size_of::<u8>()
583        }
584
585        #[inline(always)]
586        fn encode_is_copy() -> bool {
587            true
588        }
589
590        #[inline(always)]
591        fn decode_is_copy() -> bool {
592            false
593        }
594    }
595
596    impl fidl::encoding::ValueTypeMarker for DayOfWeek {
597        type Borrowed<'a> = Self;
598        #[inline(always)]
599        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
600            *value
601        }
602    }
603
604    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DayOfWeek {
605        #[inline]
606        unsafe fn encode(
607            self,
608            encoder: &mut fidl::encoding::Encoder<'_, D>,
609            offset: usize,
610            _depth: fidl::encoding::Depth,
611        ) -> fidl::Result<()> {
612            encoder.debug_check_bounds::<Self>(offset);
613            encoder.write_num(self.into_primitive(), offset);
614            Ok(())
615        }
616    }
617
618    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DayOfWeek {
619        #[inline(always)]
620        fn new_empty() -> Self {
621            Self::Sunday
622        }
623
624        #[inline]
625        unsafe fn decode(
626            &mut self,
627            decoder: &mut fidl::encoding::Decoder<'_, D>,
628            offset: usize,
629            _depth: fidl::encoding::Depth,
630        ) -> fidl::Result<()> {
631            decoder.debug_check_bounds::<Self>(offset);
632            let prim = decoder.read_num::<u8>(offset);
633
634            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
635            Ok(())
636        }
637    }
638    unsafe impl fidl::encoding::TypeMarker for Month {
639        type Owned = Self;
640
641        #[inline(always)]
642        fn inline_align(_context: fidl::encoding::Context) -> usize {
643            std::mem::align_of::<u8>()
644        }
645
646        #[inline(always)]
647        fn inline_size(_context: fidl::encoding::Context) -> usize {
648            std::mem::size_of::<u8>()
649        }
650
651        #[inline(always)]
652        fn encode_is_copy() -> bool {
653            true
654        }
655
656        #[inline(always)]
657        fn decode_is_copy() -> bool {
658            false
659        }
660    }
661
662    impl fidl::encoding::ValueTypeMarker for Month {
663        type Borrowed<'a> = Self;
664        #[inline(always)]
665        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
666            *value
667        }
668    }
669
670    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Month {
671        #[inline]
672        unsafe fn encode(
673            self,
674            encoder: &mut fidl::encoding::Encoder<'_, D>,
675            offset: usize,
676            _depth: fidl::encoding::Depth,
677        ) -> fidl::Result<()> {
678            encoder.debug_check_bounds::<Self>(offset);
679            encoder.write_num(self.into_primitive(), offset);
680            Ok(())
681        }
682    }
683
684    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Month {
685        #[inline(always)]
686        fn new_empty() -> Self {
687            Self::January
688        }
689
690        #[inline]
691        unsafe fn decode(
692            &mut self,
693            decoder: &mut fidl::encoding::Decoder<'_, D>,
694            offset: usize,
695            _depth: fidl::encoding::Depth,
696        ) -> fidl::Result<()> {
697            decoder.debug_check_bounds::<Self>(offset);
698            let prim = decoder.read_num::<u8>(offset);
699
700            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
701            Ok(())
702        }
703    }
704    unsafe impl fidl::encoding::TypeMarker for RepeatedTimeConversion {
705        type Owned = Self;
706
707        #[inline(always)]
708        fn inline_align(_context: fidl::encoding::Context) -> usize {
709            std::mem::align_of::<i32>()
710        }
711
712        #[inline(always)]
713        fn inline_size(_context: fidl::encoding::Context) -> usize {
714            std::mem::size_of::<i32>()
715        }
716
717        #[inline(always)]
718        fn encode_is_copy() -> bool {
719            false
720        }
721
722        #[inline(always)]
723        fn decode_is_copy() -> bool {
724            false
725        }
726    }
727
728    impl fidl::encoding::ValueTypeMarker for RepeatedTimeConversion {
729        type Borrowed<'a> = Self;
730        #[inline(always)]
731        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
732            *value
733        }
734    }
735
736    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
737        for RepeatedTimeConversion
738    {
739        #[inline]
740        unsafe fn encode(
741            self,
742            encoder: &mut fidl::encoding::Encoder<'_, D>,
743            offset: usize,
744            _depth: fidl::encoding::Depth,
745        ) -> fidl::Result<()> {
746            encoder.debug_check_bounds::<Self>(offset);
747            encoder.write_num(self.into_primitive(), offset);
748            Ok(())
749        }
750    }
751
752    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
753        for RepeatedTimeConversion
754    {
755        #[inline(always)]
756        fn new_empty() -> Self {
757            Self::unknown()
758        }
759
760        #[inline]
761        unsafe fn decode(
762            &mut self,
763            decoder: &mut fidl::encoding::Decoder<'_, D>,
764            offset: usize,
765            _depth: fidl::encoding::Depth,
766        ) -> fidl::Result<()> {
767            decoder.debug_check_bounds::<Self>(offset);
768            let prim = decoder.read_num::<i32>(offset);
769
770            *self = Self::from_primitive_allow_unknown(prim);
771            Ok(())
772        }
773    }
774    unsafe impl fidl::encoding::TypeMarker for SkippedTimeConversion {
775        type Owned = Self;
776
777        #[inline(always)]
778        fn inline_align(_context: fidl::encoding::Context) -> usize {
779            std::mem::align_of::<i32>()
780        }
781
782        #[inline(always)]
783        fn inline_size(_context: fidl::encoding::Context) -> usize {
784            std::mem::size_of::<i32>()
785        }
786
787        #[inline(always)]
788        fn encode_is_copy() -> bool {
789            false
790        }
791
792        #[inline(always)]
793        fn decode_is_copy() -> bool {
794            false
795        }
796    }
797
798    impl fidl::encoding::ValueTypeMarker for SkippedTimeConversion {
799        type Borrowed<'a> = Self;
800        #[inline(always)]
801        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
802            *value
803        }
804    }
805
806    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
807        for SkippedTimeConversion
808    {
809        #[inline]
810        unsafe fn encode(
811            self,
812            encoder: &mut fidl::encoding::Encoder<'_, D>,
813            offset: usize,
814            _depth: fidl::encoding::Depth,
815        ) -> fidl::Result<()> {
816            encoder.debug_check_bounds::<Self>(offset);
817            encoder.write_num(self.into_primitive(), offset);
818            Ok(())
819        }
820    }
821
822    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SkippedTimeConversion {
823        #[inline(always)]
824        fn new_empty() -> Self {
825            Self::unknown()
826        }
827
828        #[inline]
829        unsafe fn decode(
830            &mut self,
831            decoder: &mut fidl::encoding::Decoder<'_, D>,
832            offset: usize,
833            _depth: fidl::encoding::Depth,
834        ) -> fidl::Result<()> {
835            decoder.debug_check_bounds::<Self>(offset);
836            let prim = decoder.read_num::<i32>(offset);
837
838            *self = Self::from_primitive_allow_unknown(prim);
839            Ok(())
840        }
841    }
842    unsafe impl fidl::encoding::TypeMarker for TemperatureUnit {
843        type Owned = Self;
844
845        #[inline(always)]
846        fn inline_align(_context: fidl::encoding::Context) -> usize {
847            std::mem::align_of::<u32>()
848        }
849
850        #[inline(always)]
851        fn inline_size(_context: fidl::encoding::Context) -> usize {
852            std::mem::size_of::<u32>()
853        }
854
855        #[inline(always)]
856        fn encode_is_copy() -> bool {
857            true
858        }
859
860        #[inline(always)]
861        fn decode_is_copy() -> bool {
862            false
863        }
864    }
865
866    impl fidl::encoding::ValueTypeMarker for TemperatureUnit {
867        type Borrowed<'a> = Self;
868        #[inline(always)]
869        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
870            *value
871        }
872    }
873
874    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
875        for TemperatureUnit
876    {
877        #[inline]
878        unsafe fn encode(
879            self,
880            encoder: &mut fidl::encoding::Encoder<'_, D>,
881            offset: usize,
882            _depth: fidl::encoding::Depth,
883        ) -> fidl::Result<()> {
884            encoder.debug_check_bounds::<Self>(offset);
885            encoder.write_num(self.into_primitive(), offset);
886            Ok(())
887        }
888    }
889
890    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TemperatureUnit {
891        #[inline(always)]
892        fn new_empty() -> Self {
893            Self::Celsius
894        }
895
896        #[inline]
897        unsafe fn decode(
898            &mut self,
899            decoder: &mut fidl::encoding::Decoder<'_, D>,
900            offset: usize,
901            _depth: fidl::encoding::Depth,
902        ) -> fidl::Result<()> {
903            decoder.debug_check_bounds::<Self>(offset);
904            let prim = decoder.read_num::<u32>(offset);
905
906            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
907            Ok(())
908        }
909    }
910    unsafe impl fidl::encoding::TypeMarker for TimeZonesError {
911        type Owned = Self;
912
913        #[inline(always)]
914        fn inline_align(_context: fidl::encoding::Context) -> usize {
915            std::mem::align_of::<i32>()
916        }
917
918        #[inline(always)]
919        fn inline_size(_context: fidl::encoding::Context) -> usize {
920            std::mem::size_of::<i32>()
921        }
922
923        #[inline(always)]
924        fn encode_is_copy() -> bool {
925            false
926        }
927
928        #[inline(always)]
929        fn decode_is_copy() -> bool {
930            false
931        }
932    }
933
934    impl fidl::encoding::ValueTypeMarker for TimeZonesError {
935        type Borrowed<'a> = Self;
936        #[inline(always)]
937        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
938            *value
939        }
940    }
941
942    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TimeZonesError {
943        #[inline]
944        unsafe fn encode(
945            self,
946            encoder: &mut fidl::encoding::Encoder<'_, D>,
947            offset: usize,
948            _depth: fidl::encoding::Depth,
949        ) -> fidl::Result<()> {
950            encoder.debug_check_bounds::<Self>(offset);
951            encoder.write_num(self.into_primitive(), offset);
952            Ok(())
953        }
954    }
955
956    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimeZonesError {
957        #[inline(always)]
958        fn new_empty() -> Self {
959            Self::unknown()
960        }
961
962        #[inline]
963        unsafe fn decode(
964            &mut self,
965            decoder: &mut fidl::encoding::Decoder<'_, D>,
966            offset: usize,
967            _depth: fidl::encoding::Depth,
968        ) -> fidl::Result<()> {
969            decoder.debug_check_bounds::<Self>(offset);
970            let prim = decoder.read_num::<i32>(offset);
971
972            *self = Self::from_primitive_allow_unknown(prim);
973            Ok(())
974        }
975    }
976
977    impl fidl::encoding::ValueTypeMarker for CalendarId {
978        type Borrowed<'a> = &'a Self;
979        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
980            value
981        }
982    }
983
984    unsafe impl fidl::encoding::TypeMarker for CalendarId {
985        type Owned = Self;
986
987        #[inline(always)]
988        fn inline_align(_context: fidl::encoding::Context) -> usize {
989            8
990        }
991
992        #[inline(always)]
993        fn inline_size(_context: fidl::encoding::Context) -> usize {
994            16
995        }
996    }
997
998    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CalendarId, D>
999        for &CalendarId
1000    {
1001        #[inline]
1002        unsafe fn encode(
1003            self,
1004            encoder: &mut fidl::encoding::Encoder<'_, D>,
1005            offset: usize,
1006            _depth: fidl::encoding::Depth,
1007        ) -> fidl::Result<()> {
1008            encoder.debug_check_bounds::<CalendarId>(offset);
1009            // Delegate to tuple encoding.
1010            fidl::encoding::Encode::<CalendarId, D>::encode(
1011                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1012                    &self.id,
1013                ),),
1014                encoder,
1015                offset,
1016                _depth,
1017            )
1018        }
1019    }
1020    unsafe impl<
1021            D: fidl::encoding::ResourceDialect,
1022            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1023        > fidl::encoding::Encode<CalendarId, D> for (T0,)
1024    {
1025        #[inline]
1026        unsafe fn encode(
1027            self,
1028            encoder: &mut fidl::encoding::Encoder<'_, D>,
1029            offset: usize,
1030            depth: fidl::encoding::Depth,
1031        ) -> fidl::Result<()> {
1032            encoder.debug_check_bounds::<CalendarId>(offset);
1033            // Zero out padding regions. There's no need to apply masks
1034            // because the unmasked parts will be overwritten by fields.
1035            // Write the fields.
1036            self.0.encode(encoder, offset + 0, depth)?;
1037            Ok(())
1038        }
1039    }
1040
1041    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CalendarId {
1042        #[inline(always)]
1043        fn new_empty() -> Self {
1044            Self { id: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1045        }
1046
1047        #[inline]
1048        unsafe fn decode(
1049            &mut self,
1050            decoder: &mut fidl::encoding::Decoder<'_, D>,
1051            offset: usize,
1052            _depth: fidl::encoding::Depth,
1053        ) -> fidl::Result<()> {
1054            decoder.debug_check_bounds::<Self>(offset);
1055            // Verify that padding bytes are zero.
1056            fidl::decode!(
1057                fidl::encoding::UnboundedString,
1058                D,
1059                &mut self.id,
1060                decoder,
1061                offset + 0,
1062                _depth
1063            )?;
1064            Ok(())
1065        }
1066    }
1067
1068    impl fidl::encoding::ValueTypeMarker for LocaleId {
1069        type Borrowed<'a> = &'a Self;
1070        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1071            value
1072        }
1073    }
1074
1075    unsafe impl fidl::encoding::TypeMarker for LocaleId {
1076        type Owned = Self;
1077
1078        #[inline(always)]
1079        fn inline_align(_context: fidl::encoding::Context) -> usize {
1080            8
1081        }
1082
1083        #[inline(always)]
1084        fn inline_size(_context: fidl::encoding::Context) -> usize {
1085            16
1086        }
1087    }
1088
1089    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LocaleId, D> for &LocaleId {
1090        #[inline]
1091        unsafe fn encode(
1092            self,
1093            encoder: &mut fidl::encoding::Encoder<'_, D>,
1094            offset: usize,
1095            _depth: fidl::encoding::Depth,
1096        ) -> fidl::Result<()> {
1097            encoder.debug_check_bounds::<LocaleId>(offset);
1098            // Delegate to tuple encoding.
1099            fidl::encoding::Encode::<LocaleId, D>::encode(
1100                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1101                    &self.id,
1102                ),),
1103                encoder,
1104                offset,
1105                _depth,
1106            )
1107        }
1108    }
1109    unsafe impl<
1110            D: fidl::encoding::ResourceDialect,
1111            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1112        > fidl::encoding::Encode<LocaleId, D> for (T0,)
1113    {
1114        #[inline]
1115        unsafe fn encode(
1116            self,
1117            encoder: &mut fidl::encoding::Encoder<'_, D>,
1118            offset: usize,
1119            depth: fidl::encoding::Depth,
1120        ) -> fidl::Result<()> {
1121            encoder.debug_check_bounds::<LocaleId>(offset);
1122            // Zero out padding regions. There's no need to apply masks
1123            // because the unmasked parts will be overwritten by fields.
1124            // Write the fields.
1125            self.0.encode(encoder, offset + 0, depth)?;
1126            Ok(())
1127        }
1128    }
1129
1130    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LocaleId {
1131        #[inline(always)]
1132        fn new_empty() -> Self {
1133            Self { id: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1134        }
1135
1136        #[inline]
1137        unsafe fn decode(
1138            &mut self,
1139            decoder: &mut fidl::encoding::Decoder<'_, D>,
1140            offset: usize,
1141            _depth: fidl::encoding::Depth,
1142        ) -> fidl::Result<()> {
1143            decoder.debug_check_bounds::<Self>(offset);
1144            // Verify that padding bytes are zero.
1145            fidl::decode!(
1146                fidl::encoding::UnboundedString,
1147                D,
1148                &mut self.id,
1149                decoder,
1150                offset + 0,
1151                _depth
1152            )?;
1153            Ok(())
1154        }
1155    }
1156
1157    impl fidl::encoding::ValueTypeMarker for PropertyProviderGetProfileResponse {
1158        type Borrowed<'a> = &'a Self;
1159        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1160            value
1161        }
1162    }
1163
1164    unsafe impl fidl::encoding::TypeMarker for PropertyProviderGetProfileResponse {
1165        type Owned = Self;
1166
1167        #[inline(always)]
1168        fn inline_align(_context: fidl::encoding::Context) -> usize {
1169            8
1170        }
1171
1172        #[inline(always)]
1173        fn inline_size(_context: fidl::encoding::Context) -> usize {
1174            16
1175        }
1176    }
1177
1178    unsafe impl<D: fidl::encoding::ResourceDialect>
1179        fidl::encoding::Encode<PropertyProviderGetProfileResponse, D>
1180        for &PropertyProviderGetProfileResponse
1181    {
1182        #[inline]
1183        unsafe fn encode(
1184            self,
1185            encoder: &mut fidl::encoding::Encoder<'_, D>,
1186            offset: usize,
1187            _depth: fidl::encoding::Depth,
1188        ) -> fidl::Result<()> {
1189            encoder.debug_check_bounds::<PropertyProviderGetProfileResponse>(offset);
1190            // Delegate to tuple encoding.
1191            fidl::encoding::Encode::<PropertyProviderGetProfileResponse, D>::encode(
1192                (<Profile as fidl::encoding::ValueTypeMarker>::borrow(&self.profile),),
1193                encoder,
1194                offset,
1195                _depth,
1196            )
1197        }
1198    }
1199    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Profile, D>>
1200        fidl::encoding::Encode<PropertyProviderGetProfileResponse, D> for (T0,)
1201    {
1202        #[inline]
1203        unsafe fn encode(
1204            self,
1205            encoder: &mut fidl::encoding::Encoder<'_, D>,
1206            offset: usize,
1207            depth: fidl::encoding::Depth,
1208        ) -> fidl::Result<()> {
1209            encoder.debug_check_bounds::<PropertyProviderGetProfileResponse>(offset);
1210            // Zero out padding regions. There's no need to apply masks
1211            // because the unmasked parts will be overwritten by fields.
1212            // Write the fields.
1213            self.0.encode(encoder, offset + 0, depth)?;
1214            Ok(())
1215        }
1216    }
1217
1218    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1219        for PropertyProviderGetProfileResponse
1220    {
1221        #[inline(always)]
1222        fn new_empty() -> Self {
1223            Self { profile: fidl::new_empty!(Profile, D) }
1224        }
1225
1226        #[inline]
1227        unsafe fn decode(
1228            &mut self,
1229            decoder: &mut fidl::encoding::Decoder<'_, D>,
1230            offset: usize,
1231            _depth: fidl::encoding::Depth,
1232        ) -> fidl::Result<()> {
1233            decoder.debug_check_bounds::<Self>(offset);
1234            // Verify that padding bytes are zero.
1235            fidl::decode!(Profile, D, &mut self.profile, decoder, offset + 0, _depth)?;
1236            Ok(())
1237        }
1238    }
1239
1240    impl fidl::encoding::ValueTypeMarker for TimeZoneId {
1241        type Borrowed<'a> = &'a Self;
1242        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1243            value
1244        }
1245    }
1246
1247    unsafe impl fidl::encoding::TypeMarker for TimeZoneId {
1248        type Owned = Self;
1249
1250        #[inline(always)]
1251        fn inline_align(_context: fidl::encoding::Context) -> usize {
1252            8
1253        }
1254
1255        #[inline(always)]
1256        fn inline_size(_context: fidl::encoding::Context) -> usize {
1257            16
1258        }
1259    }
1260
1261    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TimeZoneId, D>
1262        for &TimeZoneId
1263    {
1264        #[inline]
1265        unsafe fn encode(
1266            self,
1267            encoder: &mut fidl::encoding::Encoder<'_, D>,
1268            offset: usize,
1269            _depth: fidl::encoding::Depth,
1270        ) -> fidl::Result<()> {
1271            encoder.debug_check_bounds::<TimeZoneId>(offset);
1272            // Delegate to tuple encoding.
1273            fidl::encoding::Encode::<TimeZoneId, D>::encode(
1274                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1275                    &self.id,
1276                ),),
1277                encoder,
1278                offset,
1279                _depth,
1280            )
1281        }
1282    }
1283    unsafe impl<
1284            D: fidl::encoding::ResourceDialect,
1285            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1286        > fidl::encoding::Encode<TimeZoneId, D> for (T0,)
1287    {
1288        #[inline]
1289        unsafe fn encode(
1290            self,
1291            encoder: &mut fidl::encoding::Encoder<'_, D>,
1292            offset: usize,
1293            depth: fidl::encoding::Depth,
1294        ) -> fidl::Result<()> {
1295            encoder.debug_check_bounds::<TimeZoneId>(offset);
1296            // Zero out padding regions. There's no need to apply masks
1297            // because the unmasked parts will be overwritten by fields.
1298            // Write the fields.
1299            self.0.encode(encoder, offset + 0, depth)?;
1300            Ok(())
1301        }
1302    }
1303
1304    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimeZoneId {
1305        #[inline(always)]
1306        fn new_empty() -> Self {
1307            Self { id: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1308        }
1309
1310        #[inline]
1311        unsafe fn decode(
1312            &mut self,
1313            decoder: &mut fidl::encoding::Decoder<'_, D>,
1314            offset: usize,
1315            _depth: fidl::encoding::Depth,
1316        ) -> fidl::Result<()> {
1317            decoder.debug_check_bounds::<Self>(offset);
1318            // Verify that padding bytes are zero.
1319            fidl::decode!(
1320                fidl::encoding::UnboundedString,
1321                D,
1322                &mut self.id,
1323                decoder,
1324                offset + 0,
1325                _depth
1326            )?;
1327            Ok(())
1328        }
1329    }
1330
1331    impl fidl::encoding::ValueTypeMarker for TimeZonesAbsoluteToCivilTimeRequest {
1332        type Borrowed<'a> = &'a Self;
1333        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1334            value
1335        }
1336    }
1337
1338    unsafe impl fidl::encoding::TypeMarker for TimeZonesAbsoluteToCivilTimeRequest {
1339        type Owned = Self;
1340
1341        #[inline(always)]
1342        fn inline_align(_context: fidl::encoding::Context) -> usize {
1343            8
1344        }
1345
1346        #[inline(always)]
1347        fn inline_size(_context: fidl::encoding::Context) -> usize {
1348            24
1349        }
1350    }
1351
1352    unsafe impl<D: fidl::encoding::ResourceDialect>
1353        fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeRequest, D>
1354        for &TimeZonesAbsoluteToCivilTimeRequest
1355    {
1356        #[inline]
1357        unsafe fn encode(
1358            self,
1359            encoder: &mut fidl::encoding::Encoder<'_, D>,
1360            offset: usize,
1361            _depth: fidl::encoding::Depth,
1362        ) -> fidl::Result<()> {
1363            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeRequest>(offset);
1364            // Delegate to tuple encoding.
1365            fidl::encoding::Encode::<TimeZonesAbsoluteToCivilTimeRequest, D>::encode(
1366                (
1367                    <TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow(&self.time_zone_id),
1368                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.absolute_time),
1369                ),
1370                encoder,
1371                offset,
1372                _depth,
1373            )
1374        }
1375    }
1376    unsafe impl<
1377            D: fidl::encoding::ResourceDialect,
1378            T0: fidl::encoding::Encode<TimeZoneId, D>,
1379            T1: fidl::encoding::Encode<i64, D>,
1380        > fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeRequest, D> for (T0, T1)
1381    {
1382        #[inline]
1383        unsafe fn encode(
1384            self,
1385            encoder: &mut fidl::encoding::Encoder<'_, D>,
1386            offset: usize,
1387            depth: fidl::encoding::Depth,
1388        ) -> fidl::Result<()> {
1389            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeRequest>(offset);
1390            // Zero out padding regions. There's no need to apply masks
1391            // because the unmasked parts will be overwritten by fields.
1392            // Write the fields.
1393            self.0.encode(encoder, offset + 0, depth)?;
1394            self.1.encode(encoder, offset + 16, depth)?;
1395            Ok(())
1396        }
1397    }
1398
1399    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1400        for TimeZonesAbsoluteToCivilTimeRequest
1401    {
1402        #[inline(always)]
1403        fn new_empty() -> Self {
1404            Self {
1405                time_zone_id: fidl::new_empty!(TimeZoneId, D),
1406                absolute_time: fidl::new_empty!(i64, D),
1407            }
1408        }
1409
1410        #[inline]
1411        unsafe fn decode(
1412            &mut self,
1413            decoder: &mut fidl::encoding::Decoder<'_, D>,
1414            offset: usize,
1415            _depth: fidl::encoding::Depth,
1416        ) -> fidl::Result<()> {
1417            decoder.debug_check_bounds::<Self>(offset);
1418            // Verify that padding bytes are zero.
1419            fidl::decode!(TimeZoneId, D, &mut self.time_zone_id, decoder, offset + 0, _depth)?;
1420            fidl::decode!(i64, D, &mut self.absolute_time, decoder, offset + 16, _depth)?;
1421            Ok(())
1422        }
1423    }
1424
1425    impl fidl::encoding::ValueTypeMarker for TimeZonesCivilToAbsoluteTimeRequest {
1426        type Borrowed<'a> = &'a Self;
1427        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1428            value
1429        }
1430    }
1431
1432    unsafe impl fidl::encoding::TypeMarker for TimeZonesCivilToAbsoluteTimeRequest {
1433        type Owned = Self;
1434
1435        #[inline(always)]
1436        fn inline_align(_context: fidl::encoding::Context) -> usize {
1437            8
1438        }
1439
1440        #[inline(always)]
1441        fn inline_size(_context: fidl::encoding::Context) -> usize {
1442            32
1443        }
1444    }
1445
1446    unsafe impl<D: fidl::encoding::ResourceDialect>
1447        fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeRequest, D>
1448        for &TimeZonesCivilToAbsoluteTimeRequest
1449    {
1450        #[inline]
1451        unsafe fn encode(
1452            self,
1453            encoder: &mut fidl::encoding::Encoder<'_, D>,
1454            offset: usize,
1455            _depth: fidl::encoding::Depth,
1456        ) -> fidl::Result<()> {
1457            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeRequest>(offset);
1458            // Delegate to tuple encoding.
1459            fidl::encoding::Encode::<TimeZonesCivilToAbsoluteTimeRequest, D>::encode(
1460                (
1461                    <CivilTime as fidl::encoding::ValueTypeMarker>::borrow(&self.civil_time),
1462                    <CivilToAbsoluteTimeOptions as fidl::encoding::ValueTypeMarker>::borrow(
1463                        &self.options,
1464                    ),
1465                ),
1466                encoder,
1467                offset,
1468                _depth,
1469            )
1470        }
1471    }
1472    unsafe impl<
1473            D: fidl::encoding::ResourceDialect,
1474            T0: fidl::encoding::Encode<CivilTime, D>,
1475            T1: fidl::encoding::Encode<CivilToAbsoluteTimeOptions, D>,
1476        > fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeRequest, D> for (T0, T1)
1477    {
1478        #[inline]
1479        unsafe fn encode(
1480            self,
1481            encoder: &mut fidl::encoding::Encoder<'_, D>,
1482            offset: usize,
1483            depth: fidl::encoding::Depth,
1484        ) -> fidl::Result<()> {
1485            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeRequest>(offset);
1486            // Zero out padding regions. There's no need to apply masks
1487            // because the unmasked parts will be overwritten by fields.
1488            // Write the fields.
1489            self.0.encode(encoder, offset + 0, depth)?;
1490            self.1.encode(encoder, offset + 16, depth)?;
1491            Ok(())
1492        }
1493    }
1494
1495    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1496        for TimeZonesCivilToAbsoluteTimeRequest
1497    {
1498        #[inline(always)]
1499        fn new_empty() -> Self {
1500            Self {
1501                civil_time: fidl::new_empty!(CivilTime, D),
1502                options: fidl::new_empty!(CivilToAbsoluteTimeOptions, D),
1503            }
1504        }
1505
1506        #[inline]
1507        unsafe fn decode(
1508            &mut self,
1509            decoder: &mut fidl::encoding::Decoder<'_, D>,
1510            offset: usize,
1511            _depth: fidl::encoding::Depth,
1512        ) -> fidl::Result<()> {
1513            decoder.debug_check_bounds::<Self>(offset);
1514            // Verify that padding bytes are zero.
1515            fidl::decode!(CivilTime, D, &mut self.civil_time, decoder, offset + 0, _depth)?;
1516            fidl::decode!(
1517                CivilToAbsoluteTimeOptions,
1518                D,
1519                &mut self.options,
1520                decoder,
1521                offset + 16,
1522                _depth
1523            )?;
1524            Ok(())
1525        }
1526    }
1527
1528    impl fidl::encoding::ValueTypeMarker for TimeZonesGetTimeZoneInfoRequest {
1529        type Borrowed<'a> = &'a Self;
1530        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1531            value
1532        }
1533    }
1534
1535    unsafe impl fidl::encoding::TypeMarker for TimeZonesGetTimeZoneInfoRequest {
1536        type Owned = Self;
1537
1538        #[inline(always)]
1539        fn inline_align(_context: fidl::encoding::Context) -> usize {
1540            8
1541        }
1542
1543        #[inline(always)]
1544        fn inline_size(_context: fidl::encoding::Context) -> usize {
1545            24
1546        }
1547    }
1548
1549    unsafe impl<D: fidl::encoding::ResourceDialect>
1550        fidl::encoding::Encode<TimeZonesGetTimeZoneInfoRequest, D>
1551        for &TimeZonesGetTimeZoneInfoRequest
1552    {
1553        #[inline]
1554        unsafe fn encode(
1555            self,
1556            encoder: &mut fidl::encoding::Encoder<'_, D>,
1557            offset: usize,
1558            _depth: fidl::encoding::Depth,
1559        ) -> fidl::Result<()> {
1560            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoRequest>(offset);
1561            // Delegate to tuple encoding.
1562            fidl::encoding::Encode::<TimeZonesGetTimeZoneInfoRequest, D>::encode(
1563                (
1564                    <TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow(&self.time_zone_id),
1565                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.at_time),
1566                ),
1567                encoder,
1568                offset,
1569                _depth,
1570            )
1571        }
1572    }
1573    unsafe impl<
1574            D: fidl::encoding::ResourceDialect,
1575            T0: fidl::encoding::Encode<TimeZoneId, D>,
1576            T1: fidl::encoding::Encode<i64, D>,
1577        > fidl::encoding::Encode<TimeZonesGetTimeZoneInfoRequest, D> for (T0, T1)
1578    {
1579        #[inline]
1580        unsafe fn encode(
1581            self,
1582            encoder: &mut fidl::encoding::Encoder<'_, D>,
1583            offset: usize,
1584            depth: fidl::encoding::Depth,
1585        ) -> fidl::Result<()> {
1586            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoRequest>(offset);
1587            // Zero out padding regions. There's no need to apply masks
1588            // because the unmasked parts will be overwritten by fields.
1589            // Write the fields.
1590            self.0.encode(encoder, offset + 0, depth)?;
1591            self.1.encode(encoder, offset + 16, depth)?;
1592            Ok(())
1593        }
1594    }
1595
1596    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1597        for TimeZonesGetTimeZoneInfoRequest
1598    {
1599        #[inline(always)]
1600        fn new_empty() -> Self {
1601            Self {
1602                time_zone_id: fidl::new_empty!(TimeZoneId, D),
1603                at_time: fidl::new_empty!(i64, D),
1604            }
1605        }
1606
1607        #[inline]
1608        unsafe fn decode(
1609            &mut self,
1610            decoder: &mut fidl::encoding::Decoder<'_, D>,
1611            offset: usize,
1612            _depth: fidl::encoding::Depth,
1613        ) -> fidl::Result<()> {
1614            decoder.debug_check_bounds::<Self>(offset);
1615            // Verify that padding bytes are zero.
1616            fidl::decode!(TimeZoneId, D, &mut self.time_zone_id, decoder, offset + 0, _depth)?;
1617            fidl::decode!(i64, D, &mut self.at_time, decoder, offset + 16, _depth)?;
1618            Ok(())
1619        }
1620    }
1621
1622    impl fidl::encoding::ValueTypeMarker for TimeZonesAbsoluteToCivilTimeResponse {
1623        type Borrowed<'a> = &'a Self;
1624        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1625            value
1626        }
1627    }
1628
1629    unsafe impl fidl::encoding::TypeMarker for TimeZonesAbsoluteToCivilTimeResponse {
1630        type Owned = Self;
1631
1632        #[inline(always)]
1633        fn inline_align(_context: fidl::encoding::Context) -> usize {
1634            8
1635        }
1636
1637        #[inline(always)]
1638        fn inline_size(_context: fidl::encoding::Context) -> usize {
1639            16
1640        }
1641    }
1642
1643    unsafe impl<D: fidl::encoding::ResourceDialect>
1644        fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeResponse, D>
1645        for &TimeZonesAbsoluteToCivilTimeResponse
1646    {
1647        #[inline]
1648        unsafe fn encode(
1649            self,
1650            encoder: &mut fidl::encoding::Encoder<'_, D>,
1651            offset: usize,
1652            _depth: fidl::encoding::Depth,
1653        ) -> fidl::Result<()> {
1654            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeResponse>(offset);
1655            // Delegate to tuple encoding.
1656            fidl::encoding::Encode::<TimeZonesAbsoluteToCivilTimeResponse, D>::encode(
1657                (<CivilTime as fidl::encoding::ValueTypeMarker>::borrow(&self.civil_time),),
1658                encoder,
1659                offset,
1660                _depth,
1661            )
1662        }
1663    }
1664    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CivilTime, D>>
1665        fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeResponse, D> for (T0,)
1666    {
1667        #[inline]
1668        unsafe fn encode(
1669            self,
1670            encoder: &mut fidl::encoding::Encoder<'_, D>,
1671            offset: usize,
1672            depth: fidl::encoding::Depth,
1673        ) -> fidl::Result<()> {
1674            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeResponse>(offset);
1675            // Zero out padding regions. There's no need to apply masks
1676            // because the unmasked parts will be overwritten by fields.
1677            // Write the fields.
1678            self.0.encode(encoder, offset + 0, depth)?;
1679            Ok(())
1680        }
1681    }
1682
1683    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1684        for TimeZonesAbsoluteToCivilTimeResponse
1685    {
1686        #[inline(always)]
1687        fn new_empty() -> Self {
1688            Self { civil_time: fidl::new_empty!(CivilTime, D) }
1689        }
1690
1691        #[inline]
1692        unsafe fn decode(
1693            &mut self,
1694            decoder: &mut fidl::encoding::Decoder<'_, D>,
1695            offset: usize,
1696            _depth: fidl::encoding::Depth,
1697        ) -> fidl::Result<()> {
1698            decoder.debug_check_bounds::<Self>(offset);
1699            // Verify that padding bytes are zero.
1700            fidl::decode!(CivilTime, D, &mut self.civil_time, decoder, offset + 0, _depth)?;
1701            Ok(())
1702        }
1703    }
1704
1705    impl fidl::encoding::ValueTypeMarker for TimeZonesCivilToAbsoluteTimeResponse {
1706        type Borrowed<'a> = &'a Self;
1707        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1708            value
1709        }
1710    }
1711
1712    unsafe impl fidl::encoding::TypeMarker for TimeZonesCivilToAbsoluteTimeResponse {
1713        type Owned = Self;
1714
1715        #[inline(always)]
1716        fn inline_align(_context: fidl::encoding::Context) -> usize {
1717            8
1718        }
1719
1720        #[inline(always)]
1721        fn inline_size(_context: fidl::encoding::Context) -> usize {
1722            8
1723        }
1724        #[inline(always)]
1725        fn encode_is_copy() -> bool {
1726            true
1727        }
1728
1729        #[inline(always)]
1730        fn decode_is_copy() -> bool {
1731            true
1732        }
1733    }
1734
1735    unsafe impl<D: fidl::encoding::ResourceDialect>
1736        fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeResponse, D>
1737        for &TimeZonesCivilToAbsoluteTimeResponse
1738    {
1739        #[inline]
1740        unsafe fn encode(
1741            self,
1742            encoder: &mut fidl::encoding::Encoder<'_, D>,
1743            offset: usize,
1744            _depth: fidl::encoding::Depth,
1745        ) -> fidl::Result<()> {
1746            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeResponse>(offset);
1747            unsafe {
1748                // Copy the object into the buffer.
1749                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1750                (buf_ptr as *mut TimeZonesCivilToAbsoluteTimeResponse)
1751                    .write_unaligned((self as *const TimeZonesCivilToAbsoluteTimeResponse).read());
1752                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1753                // done second because the memcpy will write garbage to these bytes.
1754            }
1755            Ok(())
1756        }
1757    }
1758    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
1759        fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeResponse, D> for (T0,)
1760    {
1761        #[inline]
1762        unsafe fn encode(
1763            self,
1764            encoder: &mut fidl::encoding::Encoder<'_, D>,
1765            offset: usize,
1766            depth: fidl::encoding::Depth,
1767        ) -> fidl::Result<()> {
1768            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeResponse>(offset);
1769            // Zero out padding regions. There's no need to apply masks
1770            // because the unmasked parts will be overwritten by fields.
1771            // Write the fields.
1772            self.0.encode(encoder, offset + 0, depth)?;
1773            Ok(())
1774        }
1775    }
1776
1777    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1778        for TimeZonesCivilToAbsoluteTimeResponse
1779    {
1780        #[inline(always)]
1781        fn new_empty() -> Self {
1782            Self { absolute_time: fidl::new_empty!(i64, D) }
1783        }
1784
1785        #[inline]
1786        unsafe fn decode(
1787            &mut self,
1788            decoder: &mut fidl::encoding::Decoder<'_, D>,
1789            offset: usize,
1790            _depth: fidl::encoding::Depth,
1791        ) -> fidl::Result<()> {
1792            decoder.debug_check_bounds::<Self>(offset);
1793            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1794            // Verify that padding bytes are zero.
1795            // Copy from the buffer into the object.
1796            unsafe {
1797                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1798            }
1799            Ok(())
1800        }
1801    }
1802
1803    impl fidl::encoding::ValueTypeMarker for TimeZonesGetTimeZoneInfoResponse {
1804        type Borrowed<'a> = &'a Self;
1805        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1806            value
1807        }
1808    }
1809
1810    unsafe impl fidl::encoding::TypeMarker for TimeZonesGetTimeZoneInfoResponse {
1811        type Owned = Self;
1812
1813        #[inline(always)]
1814        fn inline_align(_context: fidl::encoding::Context) -> usize {
1815            8
1816        }
1817
1818        #[inline(always)]
1819        fn inline_size(_context: fidl::encoding::Context) -> usize {
1820            16
1821        }
1822    }
1823
1824    unsafe impl<D: fidl::encoding::ResourceDialect>
1825        fidl::encoding::Encode<TimeZonesGetTimeZoneInfoResponse, D>
1826        for &TimeZonesGetTimeZoneInfoResponse
1827    {
1828        #[inline]
1829        unsafe fn encode(
1830            self,
1831            encoder: &mut fidl::encoding::Encoder<'_, D>,
1832            offset: usize,
1833            _depth: fidl::encoding::Depth,
1834        ) -> fidl::Result<()> {
1835            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoResponse>(offset);
1836            // Delegate to tuple encoding.
1837            fidl::encoding::Encode::<TimeZonesGetTimeZoneInfoResponse, D>::encode(
1838                (<TimeZoneInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.time_zone_info),),
1839                encoder,
1840                offset,
1841                _depth,
1842            )
1843        }
1844    }
1845    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimeZoneInfo, D>>
1846        fidl::encoding::Encode<TimeZonesGetTimeZoneInfoResponse, D> for (T0,)
1847    {
1848        #[inline]
1849        unsafe fn encode(
1850            self,
1851            encoder: &mut fidl::encoding::Encoder<'_, D>,
1852            offset: usize,
1853            depth: fidl::encoding::Depth,
1854        ) -> fidl::Result<()> {
1855            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoResponse>(offset);
1856            // Zero out padding regions. There's no need to apply masks
1857            // because the unmasked parts will be overwritten by fields.
1858            // Write the fields.
1859            self.0.encode(encoder, offset + 0, depth)?;
1860            Ok(())
1861        }
1862    }
1863
1864    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1865        for TimeZonesGetTimeZoneInfoResponse
1866    {
1867        #[inline(always)]
1868        fn new_empty() -> Self {
1869            Self { time_zone_info: fidl::new_empty!(TimeZoneInfo, D) }
1870        }
1871
1872        #[inline]
1873        unsafe fn decode(
1874            &mut self,
1875            decoder: &mut fidl::encoding::Decoder<'_, D>,
1876            offset: usize,
1877            _depth: fidl::encoding::Depth,
1878        ) -> fidl::Result<()> {
1879            decoder.debug_check_bounds::<Self>(offset);
1880            // Verify that padding bytes are zero.
1881            fidl::decode!(TimeZoneInfo, D, &mut self.time_zone_info, decoder, offset + 0, _depth)?;
1882            Ok(())
1883        }
1884    }
1885
1886    impl CivilTime {
1887        #[inline(always)]
1888        fn max_ordinal_present(&self) -> u64 {
1889            if let Some(_) = self.time_zone_id {
1890                return 10;
1891            }
1892            if let Some(_) = self.year_day {
1893                return 9;
1894            }
1895            if let Some(_) = self.weekday {
1896                return 8;
1897            }
1898            if let Some(_) = self.nanos {
1899                return 7;
1900            }
1901            if let Some(_) = self.second {
1902                return 6;
1903            }
1904            if let Some(_) = self.minute {
1905                return 5;
1906            }
1907            if let Some(_) = self.hour {
1908                return 4;
1909            }
1910            if let Some(_) = self.day {
1911                return 3;
1912            }
1913            if let Some(_) = self.month {
1914                return 2;
1915            }
1916            if let Some(_) = self.year {
1917                return 1;
1918            }
1919            0
1920        }
1921    }
1922
1923    impl fidl::encoding::ValueTypeMarker for CivilTime {
1924        type Borrowed<'a> = &'a Self;
1925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1926            value
1927        }
1928    }
1929
1930    unsafe impl fidl::encoding::TypeMarker for CivilTime {
1931        type Owned = Self;
1932
1933        #[inline(always)]
1934        fn inline_align(_context: fidl::encoding::Context) -> usize {
1935            8
1936        }
1937
1938        #[inline(always)]
1939        fn inline_size(_context: fidl::encoding::Context) -> usize {
1940            16
1941        }
1942    }
1943
1944    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CivilTime, D>
1945        for &CivilTime
1946    {
1947        unsafe fn encode(
1948            self,
1949            encoder: &mut fidl::encoding::Encoder<'_, D>,
1950            offset: usize,
1951            mut depth: fidl::encoding::Depth,
1952        ) -> fidl::Result<()> {
1953            encoder.debug_check_bounds::<CivilTime>(offset);
1954            // Vector header
1955            let max_ordinal: u64 = self.max_ordinal_present();
1956            encoder.write_num(max_ordinal, offset);
1957            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1958            // Calling encoder.out_of_line_offset(0) is not allowed.
1959            if max_ordinal == 0 {
1960                return Ok(());
1961            }
1962            depth.increment()?;
1963            let envelope_size = 8;
1964            let bytes_len = max_ordinal as usize * envelope_size;
1965            #[allow(unused_variables)]
1966            let offset = encoder.out_of_line_offset(bytes_len);
1967            let mut _prev_end_offset: usize = 0;
1968            if 1 > max_ordinal {
1969                return Ok(());
1970            }
1971
1972            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1973            // are envelope_size bytes.
1974            let cur_offset: usize = (1 - 1) * envelope_size;
1975
1976            // Zero reserved fields.
1977            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1978
1979            // Safety:
1980            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1981            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1982            //   envelope_size bytes, there is always sufficient room.
1983            fidl::encoding::encode_in_envelope_optional::<u16, D>(
1984                self.year.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
1985                encoder,
1986                offset + cur_offset,
1987                depth,
1988            )?;
1989
1990            _prev_end_offset = cur_offset + envelope_size;
1991            if 2 > max_ordinal {
1992                return Ok(());
1993            }
1994
1995            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1996            // are envelope_size bytes.
1997            let cur_offset: usize = (2 - 1) * envelope_size;
1998
1999            // Zero reserved fields.
2000            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2001
2002            // Safety:
2003            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2004            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2005            //   envelope_size bytes, there is always sufficient room.
2006            fidl::encoding::encode_in_envelope_optional::<Month, D>(
2007                self.month.as_ref().map(<Month as fidl::encoding::ValueTypeMarker>::borrow),
2008                encoder,
2009                offset + cur_offset,
2010                depth,
2011            )?;
2012
2013            _prev_end_offset = cur_offset + envelope_size;
2014            if 3 > max_ordinal {
2015                return Ok(());
2016            }
2017
2018            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2019            // are envelope_size bytes.
2020            let cur_offset: usize = (3 - 1) * envelope_size;
2021
2022            // Zero reserved fields.
2023            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2024
2025            // Safety:
2026            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2027            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2028            //   envelope_size bytes, there is always sufficient room.
2029            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2030                self.day.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2031                encoder,
2032                offset + cur_offset,
2033                depth,
2034            )?;
2035
2036            _prev_end_offset = cur_offset + envelope_size;
2037            if 4 > max_ordinal {
2038                return Ok(());
2039            }
2040
2041            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2042            // are envelope_size bytes.
2043            let cur_offset: usize = (4 - 1) * envelope_size;
2044
2045            // Zero reserved fields.
2046            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2047
2048            // Safety:
2049            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2050            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2051            //   envelope_size bytes, there is always sufficient room.
2052            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2053                self.hour.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2054                encoder,
2055                offset + cur_offset,
2056                depth,
2057            )?;
2058
2059            _prev_end_offset = cur_offset + envelope_size;
2060            if 5 > max_ordinal {
2061                return Ok(());
2062            }
2063
2064            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2065            // are envelope_size bytes.
2066            let cur_offset: usize = (5 - 1) * envelope_size;
2067
2068            // Zero reserved fields.
2069            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2070
2071            // Safety:
2072            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2073            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2074            //   envelope_size bytes, there is always sufficient room.
2075            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2076                self.minute.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2077                encoder,
2078                offset + cur_offset,
2079                depth,
2080            )?;
2081
2082            _prev_end_offset = cur_offset + envelope_size;
2083            if 6 > max_ordinal {
2084                return Ok(());
2085            }
2086
2087            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2088            // are envelope_size bytes.
2089            let cur_offset: usize = (6 - 1) * envelope_size;
2090
2091            // Zero reserved fields.
2092            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2093
2094            // Safety:
2095            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2096            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2097            //   envelope_size bytes, there is always sufficient room.
2098            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2099                self.second.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2100                encoder,
2101                offset + cur_offset,
2102                depth,
2103            )?;
2104
2105            _prev_end_offset = cur_offset + envelope_size;
2106            if 7 > max_ordinal {
2107                return Ok(());
2108            }
2109
2110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2111            // are envelope_size bytes.
2112            let cur_offset: usize = (7 - 1) * envelope_size;
2113
2114            // Zero reserved fields.
2115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2116
2117            // Safety:
2118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2120            //   envelope_size bytes, there is always sufficient room.
2121            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2122                self.nanos.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2123                encoder,
2124                offset + cur_offset,
2125                depth,
2126            )?;
2127
2128            _prev_end_offset = cur_offset + envelope_size;
2129            if 8 > max_ordinal {
2130                return Ok(());
2131            }
2132
2133            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2134            // are envelope_size bytes.
2135            let cur_offset: usize = (8 - 1) * envelope_size;
2136
2137            // Zero reserved fields.
2138            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2139
2140            // Safety:
2141            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2142            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2143            //   envelope_size bytes, there is always sufficient room.
2144            fidl::encoding::encode_in_envelope_optional::<DayOfWeek, D>(
2145                self.weekday.as_ref().map(<DayOfWeek as fidl::encoding::ValueTypeMarker>::borrow),
2146                encoder,
2147                offset + cur_offset,
2148                depth,
2149            )?;
2150
2151            _prev_end_offset = cur_offset + envelope_size;
2152            if 9 > max_ordinal {
2153                return Ok(());
2154            }
2155
2156            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2157            // are envelope_size bytes.
2158            let cur_offset: usize = (9 - 1) * envelope_size;
2159
2160            // Zero reserved fields.
2161            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2162
2163            // Safety:
2164            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2165            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2166            //   envelope_size bytes, there is always sufficient room.
2167            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2168                self.year_day.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2169                encoder,
2170                offset + cur_offset,
2171                depth,
2172            )?;
2173
2174            _prev_end_offset = cur_offset + envelope_size;
2175            if 10 > max_ordinal {
2176                return Ok(());
2177            }
2178
2179            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2180            // are envelope_size bytes.
2181            let cur_offset: usize = (10 - 1) * envelope_size;
2182
2183            // Zero reserved fields.
2184            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2185
2186            // Safety:
2187            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2188            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2189            //   envelope_size bytes, there is always sufficient room.
2190            fidl::encoding::encode_in_envelope_optional::<TimeZoneId, D>(
2191                self.time_zone_id
2192                    .as_ref()
2193                    .map(<TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow),
2194                encoder,
2195                offset + cur_offset,
2196                depth,
2197            )?;
2198
2199            _prev_end_offset = cur_offset + envelope_size;
2200
2201            Ok(())
2202        }
2203    }
2204
2205    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CivilTime {
2206        #[inline(always)]
2207        fn new_empty() -> Self {
2208            Self::default()
2209        }
2210
2211        unsafe fn decode(
2212            &mut self,
2213            decoder: &mut fidl::encoding::Decoder<'_, D>,
2214            offset: usize,
2215            mut depth: fidl::encoding::Depth,
2216        ) -> fidl::Result<()> {
2217            decoder.debug_check_bounds::<Self>(offset);
2218            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2219                None => return Err(fidl::Error::NotNullable),
2220                Some(len) => len,
2221            };
2222            // Calling decoder.out_of_line_offset(0) is not allowed.
2223            if len == 0 {
2224                return Ok(());
2225            };
2226            depth.increment()?;
2227            let envelope_size = 8;
2228            let bytes_len = len * envelope_size;
2229            let offset = decoder.out_of_line_offset(bytes_len)?;
2230            // Decode the envelope for each type.
2231            let mut _next_ordinal_to_read = 0;
2232            let mut next_offset = offset;
2233            let end_offset = offset + bytes_len;
2234            _next_ordinal_to_read += 1;
2235            if next_offset >= end_offset {
2236                return Ok(());
2237            }
2238
2239            // Decode unknown envelopes for gaps in ordinals.
2240            while _next_ordinal_to_read < 1 {
2241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2242                _next_ordinal_to_read += 1;
2243                next_offset += envelope_size;
2244            }
2245
2246            let next_out_of_line = decoder.next_out_of_line();
2247            let handles_before = decoder.remaining_handles();
2248            if let Some((inlined, num_bytes, num_handles)) =
2249                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2250            {
2251                let member_inline_size =
2252                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2253                if inlined != (member_inline_size <= 4) {
2254                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2255                }
2256                let inner_offset;
2257                let mut inner_depth = depth.clone();
2258                if inlined {
2259                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2260                    inner_offset = next_offset;
2261                } else {
2262                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2263                    inner_depth.increment()?;
2264                }
2265                let val_ref = self.year.get_or_insert_with(|| fidl::new_empty!(u16, D));
2266                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2267                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2268                {
2269                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2270                }
2271                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2272                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2273                }
2274            }
2275
2276            next_offset += envelope_size;
2277            _next_ordinal_to_read += 1;
2278            if next_offset >= end_offset {
2279                return Ok(());
2280            }
2281
2282            // Decode unknown envelopes for gaps in ordinals.
2283            while _next_ordinal_to_read < 2 {
2284                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2285                _next_ordinal_to_read += 1;
2286                next_offset += envelope_size;
2287            }
2288
2289            let next_out_of_line = decoder.next_out_of_line();
2290            let handles_before = decoder.remaining_handles();
2291            if let Some((inlined, num_bytes, num_handles)) =
2292                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2293            {
2294                let member_inline_size =
2295                    <Month as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2296                if inlined != (member_inline_size <= 4) {
2297                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2298                }
2299                let inner_offset;
2300                let mut inner_depth = depth.clone();
2301                if inlined {
2302                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2303                    inner_offset = next_offset;
2304                } else {
2305                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2306                    inner_depth.increment()?;
2307                }
2308                let val_ref = self.month.get_or_insert_with(|| fidl::new_empty!(Month, D));
2309                fidl::decode!(Month, D, val_ref, decoder, inner_offset, inner_depth)?;
2310                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2311                {
2312                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2313                }
2314                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2315                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2316                }
2317            }
2318
2319            next_offset += envelope_size;
2320            _next_ordinal_to_read += 1;
2321            if next_offset >= end_offset {
2322                return Ok(());
2323            }
2324
2325            // Decode unknown envelopes for gaps in ordinals.
2326            while _next_ordinal_to_read < 3 {
2327                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2328                _next_ordinal_to_read += 1;
2329                next_offset += envelope_size;
2330            }
2331
2332            let next_out_of_line = decoder.next_out_of_line();
2333            let handles_before = decoder.remaining_handles();
2334            if let Some((inlined, num_bytes, num_handles)) =
2335                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2336            {
2337                let member_inline_size =
2338                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2339                if inlined != (member_inline_size <= 4) {
2340                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2341                }
2342                let inner_offset;
2343                let mut inner_depth = depth.clone();
2344                if inlined {
2345                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2346                    inner_offset = next_offset;
2347                } else {
2348                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2349                    inner_depth.increment()?;
2350                }
2351                let val_ref = self.day.get_or_insert_with(|| fidl::new_empty!(u8, D));
2352                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2353                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2354                {
2355                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2356                }
2357                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2358                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2359                }
2360            }
2361
2362            next_offset += envelope_size;
2363            _next_ordinal_to_read += 1;
2364            if next_offset >= end_offset {
2365                return Ok(());
2366            }
2367
2368            // Decode unknown envelopes for gaps in ordinals.
2369            while _next_ordinal_to_read < 4 {
2370                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2371                _next_ordinal_to_read += 1;
2372                next_offset += envelope_size;
2373            }
2374
2375            let next_out_of_line = decoder.next_out_of_line();
2376            let handles_before = decoder.remaining_handles();
2377            if let Some((inlined, num_bytes, num_handles)) =
2378                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2379            {
2380                let member_inline_size =
2381                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2382                if inlined != (member_inline_size <= 4) {
2383                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2384                }
2385                let inner_offset;
2386                let mut inner_depth = depth.clone();
2387                if inlined {
2388                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2389                    inner_offset = next_offset;
2390                } else {
2391                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2392                    inner_depth.increment()?;
2393                }
2394                let val_ref = self.hour.get_or_insert_with(|| fidl::new_empty!(u8, D));
2395                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2396                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2397                {
2398                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2399                }
2400                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2401                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2402                }
2403            }
2404
2405            next_offset += envelope_size;
2406            _next_ordinal_to_read += 1;
2407            if next_offset >= end_offset {
2408                return Ok(());
2409            }
2410
2411            // Decode unknown envelopes for gaps in ordinals.
2412            while _next_ordinal_to_read < 5 {
2413                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2414                _next_ordinal_to_read += 1;
2415                next_offset += envelope_size;
2416            }
2417
2418            let next_out_of_line = decoder.next_out_of_line();
2419            let handles_before = decoder.remaining_handles();
2420            if let Some((inlined, num_bytes, num_handles)) =
2421                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2422            {
2423                let member_inline_size =
2424                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2425                if inlined != (member_inline_size <= 4) {
2426                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2427                }
2428                let inner_offset;
2429                let mut inner_depth = depth.clone();
2430                if inlined {
2431                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2432                    inner_offset = next_offset;
2433                } else {
2434                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2435                    inner_depth.increment()?;
2436                }
2437                let val_ref = self.minute.get_or_insert_with(|| fidl::new_empty!(u8, D));
2438                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2439                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2440                {
2441                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2442                }
2443                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2444                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2445                }
2446            }
2447
2448            next_offset += envelope_size;
2449            _next_ordinal_to_read += 1;
2450            if next_offset >= end_offset {
2451                return Ok(());
2452            }
2453
2454            // Decode unknown envelopes for gaps in ordinals.
2455            while _next_ordinal_to_read < 6 {
2456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2457                _next_ordinal_to_read += 1;
2458                next_offset += envelope_size;
2459            }
2460
2461            let next_out_of_line = decoder.next_out_of_line();
2462            let handles_before = decoder.remaining_handles();
2463            if let Some((inlined, num_bytes, num_handles)) =
2464                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2465            {
2466                let member_inline_size =
2467                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2468                if inlined != (member_inline_size <= 4) {
2469                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2470                }
2471                let inner_offset;
2472                let mut inner_depth = depth.clone();
2473                if inlined {
2474                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2475                    inner_offset = next_offset;
2476                } else {
2477                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2478                    inner_depth.increment()?;
2479                }
2480                let val_ref = self.second.get_or_insert_with(|| fidl::new_empty!(u8, D));
2481                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2482                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2483                {
2484                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2485                }
2486                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2487                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2488                }
2489            }
2490
2491            next_offset += envelope_size;
2492            _next_ordinal_to_read += 1;
2493            if next_offset >= end_offset {
2494                return Ok(());
2495            }
2496
2497            // Decode unknown envelopes for gaps in ordinals.
2498            while _next_ordinal_to_read < 7 {
2499                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2500                _next_ordinal_to_read += 1;
2501                next_offset += envelope_size;
2502            }
2503
2504            let next_out_of_line = decoder.next_out_of_line();
2505            let handles_before = decoder.remaining_handles();
2506            if let Some((inlined, num_bytes, num_handles)) =
2507                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2508            {
2509                let member_inline_size =
2510                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2511                if inlined != (member_inline_size <= 4) {
2512                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2513                }
2514                let inner_offset;
2515                let mut inner_depth = depth.clone();
2516                if inlined {
2517                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2518                    inner_offset = next_offset;
2519                } else {
2520                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2521                    inner_depth.increment()?;
2522                }
2523                let val_ref = self.nanos.get_or_insert_with(|| fidl::new_empty!(u64, D));
2524                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2525                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2526                {
2527                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2528                }
2529                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2530                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2531                }
2532            }
2533
2534            next_offset += envelope_size;
2535            _next_ordinal_to_read += 1;
2536            if next_offset >= end_offset {
2537                return Ok(());
2538            }
2539
2540            // Decode unknown envelopes for gaps in ordinals.
2541            while _next_ordinal_to_read < 8 {
2542                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2543                _next_ordinal_to_read += 1;
2544                next_offset += envelope_size;
2545            }
2546
2547            let next_out_of_line = decoder.next_out_of_line();
2548            let handles_before = decoder.remaining_handles();
2549            if let Some((inlined, num_bytes, num_handles)) =
2550                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2551            {
2552                let member_inline_size =
2553                    <DayOfWeek as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2554                if inlined != (member_inline_size <= 4) {
2555                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2556                }
2557                let inner_offset;
2558                let mut inner_depth = depth.clone();
2559                if inlined {
2560                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2561                    inner_offset = next_offset;
2562                } else {
2563                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2564                    inner_depth.increment()?;
2565                }
2566                let val_ref = self.weekday.get_or_insert_with(|| fidl::new_empty!(DayOfWeek, D));
2567                fidl::decode!(DayOfWeek, D, val_ref, decoder, inner_offset, inner_depth)?;
2568                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2569                {
2570                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2571                }
2572                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2573                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2574                }
2575            }
2576
2577            next_offset += envelope_size;
2578            _next_ordinal_to_read += 1;
2579            if next_offset >= end_offset {
2580                return Ok(());
2581            }
2582
2583            // Decode unknown envelopes for gaps in ordinals.
2584            while _next_ordinal_to_read < 9 {
2585                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2586                _next_ordinal_to_read += 1;
2587                next_offset += envelope_size;
2588            }
2589
2590            let next_out_of_line = decoder.next_out_of_line();
2591            let handles_before = decoder.remaining_handles();
2592            if let Some((inlined, num_bytes, num_handles)) =
2593                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2594            {
2595                let member_inline_size =
2596                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2597                if inlined != (member_inline_size <= 4) {
2598                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2599                }
2600                let inner_offset;
2601                let mut inner_depth = depth.clone();
2602                if inlined {
2603                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2604                    inner_offset = next_offset;
2605                } else {
2606                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2607                    inner_depth.increment()?;
2608                }
2609                let val_ref = self.year_day.get_or_insert_with(|| fidl::new_empty!(u16, D));
2610                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2611                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2612                {
2613                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2614                }
2615                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2616                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2617                }
2618            }
2619
2620            next_offset += envelope_size;
2621            _next_ordinal_to_read += 1;
2622            if next_offset >= end_offset {
2623                return Ok(());
2624            }
2625
2626            // Decode unknown envelopes for gaps in ordinals.
2627            while _next_ordinal_to_read < 10 {
2628                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2629                _next_ordinal_to_read += 1;
2630                next_offset += envelope_size;
2631            }
2632
2633            let next_out_of_line = decoder.next_out_of_line();
2634            let handles_before = decoder.remaining_handles();
2635            if let Some((inlined, num_bytes, num_handles)) =
2636                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2637            {
2638                let member_inline_size =
2639                    <TimeZoneId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2640                if inlined != (member_inline_size <= 4) {
2641                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2642                }
2643                let inner_offset;
2644                let mut inner_depth = depth.clone();
2645                if inlined {
2646                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2647                    inner_offset = next_offset;
2648                } else {
2649                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2650                    inner_depth.increment()?;
2651                }
2652                let val_ref =
2653                    self.time_zone_id.get_or_insert_with(|| fidl::new_empty!(TimeZoneId, D));
2654                fidl::decode!(TimeZoneId, D, val_ref, decoder, inner_offset, inner_depth)?;
2655                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2656                {
2657                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2658                }
2659                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2660                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2661                }
2662            }
2663
2664            next_offset += envelope_size;
2665
2666            // Decode the remaining unknown envelopes.
2667            while next_offset < end_offset {
2668                _next_ordinal_to_read += 1;
2669                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2670                next_offset += envelope_size;
2671            }
2672
2673            Ok(())
2674        }
2675    }
2676
2677    impl CivilToAbsoluteTimeOptions {
2678        #[inline(always)]
2679        fn max_ordinal_present(&self) -> u64 {
2680            if let Some(_) = self.skipped_time_conversion {
2681                return 2;
2682            }
2683            if let Some(_) = self.repeated_time_conversion {
2684                return 1;
2685            }
2686            0
2687        }
2688    }
2689
2690    impl fidl::encoding::ValueTypeMarker for CivilToAbsoluteTimeOptions {
2691        type Borrowed<'a> = &'a Self;
2692        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2693            value
2694        }
2695    }
2696
2697    unsafe impl fidl::encoding::TypeMarker for CivilToAbsoluteTimeOptions {
2698        type Owned = Self;
2699
2700        #[inline(always)]
2701        fn inline_align(_context: fidl::encoding::Context) -> usize {
2702            8
2703        }
2704
2705        #[inline(always)]
2706        fn inline_size(_context: fidl::encoding::Context) -> usize {
2707            16
2708        }
2709    }
2710
2711    unsafe impl<D: fidl::encoding::ResourceDialect>
2712        fidl::encoding::Encode<CivilToAbsoluteTimeOptions, D> for &CivilToAbsoluteTimeOptions
2713    {
2714        unsafe fn encode(
2715            self,
2716            encoder: &mut fidl::encoding::Encoder<'_, D>,
2717            offset: usize,
2718            mut depth: fidl::encoding::Depth,
2719        ) -> fidl::Result<()> {
2720            encoder.debug_check_bounds::<CivilToAbsoluteTimeOptions>(offset);
2721            // Vector header
2722            let max_ordinal: u64 = self.max_ordinal_present();
2723            encoder.write_num(max_ordinal, offset);
2724            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2725            // Calling encoder.out_of_line_offset(0) is not allowed.
2726            if max_ordinal == 0 {
2727                return Ok(());
2728            }
2729            depth.increment()?;
2730            let envelope_size = 8;
2731            let bytes_len = max_ordinal as usize * envelope_size;
2732            #[allow(unused_variables)]
2733            let offset = encoder.out_of_line_offset(bytes_len);
2734            let mut _prev_end_offset: usize = 0;
2735            if 1 > max_ordinal {
2736                return Ok(());
2737            }
2738
2739            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2740            // are envelope_size bytes.
2741            let cur_offset: usize = (1 - 1) * envelope_size;
2742
2743            // Zero reserved fields.
2744            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2745
2746            // Safety:
2747            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2748            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2749            //   envelope_size bytes, there is always sufficient room.
2750            fidl::encoding::encode_in_envelope_optional::<RepeatedTimeConversion, D>(
2751                self.repeated_time_conversion
2752                    .as_ref()
2753                    .map(<RepeatedTimeConversion as fidl::encoding::ValueTypeMarker>::borrow),
2754                encoder,
2755                offset + cur_offset,
2756                depth,
2757            )?;
2758
2759            _prev_end_offset = cur_offset + envelope_size;
2760            if 2 > max_ordinal {
2761                return Ok(());
2762            }
2763
2764            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2765            // are envelope_size bytes.
2766            let cur_offset: usize = (2 - 1) * envelope_size;
2767
2768            // Zero reserved fields.
2769            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2770
2771            // Safety:
2772            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2773            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2774            //   envelope_size bytes, there is always sufficient room.
2775            fidl::encoding::encode_in_envelope_optional::<SkippedTimeConversion, D>(
2776                self.skipped_time_conversion
2777                    .as_ref()
2778                    .map(<SkippedTimeConversion as fidl::encoding::ValueTypeMarker>::borrow),
2779                encoder,
2780                offset + cur_offset,
2781                depth,
2782            )?;
2783
2784            _prev_end_offset = cur_offset + envelope_size;
2785
2786            Ok(())
2787        }
2788    }
2789
2790    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2791        for CivilToAbsoluteTimeOptions
2792    {
2793        #[inline(always)]
2794        fn new_empty() -> Self {
2795            Self::default()
2796        }
2797
2798        unsafe fn decode(
2799            &mut self,
2800            decoder: &mut fidl::encoding::Decoder<'_, D>,
2801            offset: usize,
2802            mut depth: fidl::encoding::Depth,
2803        ) -> fidl::Result<()> {
2804            decoder.debug_check_bounds::<Self>(offset);
2805            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2806                None => return Err(fidl::Error::NotNullable),
2807                Some(len) => len,
2808            };
2809            // Calling decoder.out_of_line_offset(0) is not allowed.
2810            if len == 0 {
2811                return Ok(());
2812            };
2813            depth.increment()?;
2814            let envelope_size = 8;
2815            let bytes_len = len * envelope_size;
2816            let offset = decoder.out_of_line_offset(bytes_len)?;
2817            // Decode the envelope for each type.
2818            let mut _next_ordinal_to_read = 0;
2819            let mut next_offset = offset;
2820            let end_offset = offset + bytes_len;
2821            _next_ordinal_to_read += 1;
2822            if next_offset >= end_offset {
2823                return Ok(());
2824            }
2825
2826            // Decode unknown envelopes for gaps in ordinals.
2827            while _next_ordinal_to_read < 1 {
2828                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2829                _next_ordinal_to_read += 1;
2830                next_offset += envelope_size;
2831            }
2832
2833            let next_out_of_line = decoder.next_out_of_line();
2834            let handles_before = decoder.remaining_handles();
2835            if let Some((inlined, num_bytes, num_handles)) =
2836                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2837            {
2838                let member_inline_size =
2839                    <RepeatedTimeConversion as fidl::encoding::TypeMarker>::inline_size(
2840                        decoder.context,
2841                    );
2842                if inlined != (member_inline_size <= 4) {
2843                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2844                }
2845                let inner_offset;
2846                let mut inner_depth = depth.clone();
2847                if inlined {
2848                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2849                    inner_offset = next_offset;
2850                } else {
2851                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2852                    inner_depth.increment()?;
2853                }
2854                let val_ref = self
2855                    .repeated_time_conversion
2856                    .get_or_insert_with(|| fidl::new_empty!(RepeatedTimeConversion, D));
2857                fidl::decode!(
2858                    RepeatedTimeConversion,
2859                    D,
2860                    val_ref,
2861                    decoder,
2862                    inner_offset,
2863                    inner_depth
2864                )?;
2865                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2866                {
2867                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2868                }
2869                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2870                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2871                }
2872            }
2873
2874            next_offset += envelope_size;
2875            _next_ordinal_to_read += 1;
2876            if next_offset >= end_offset {
2877                return Ok(());
2878            }
2879
2880            // Decode unknown envelopes for gaps in ordinals.
2881            while _next_ordinal_to_read < 2 {
2882                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2883                _next_ordinal_to_read += 1;
2884                next_offset += envelope_size;
2885            }
2886
2887            let next_out_of_line = decoder.next_out_of_line();
2888            let handles_before = decoder.remaining_handles();
2889            if let Some((inlined, num_bytes, num_handles)) =
2890                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2891            {
2892                let member_inline_size =
2893                    <SkippedTimeConversion as fidl::encoding::TypeMarker>::inline_size(
2894                        decoder.context,
2895                    );
2896                if inlined != (member_inline_size <= 4) {
2897                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2898                }
2899                let inner_offset;
2900                let mut inner_depth = depth.clone();
2901                if inlined {
2902                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2903                    inner_offset = next_offset;
2904                } else {
2905                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2906                    inner_depth.increment()?;
2907                }
2908                let val_ref = self
2909                    .skipped_time_conversion
2910                    .get_or_insert_with(|| fidl::new_empty!(SkippedTimeConversion, D));
2911                fidl::decode!(
2912                    SkippedTimeConversion,
2913                    D,
2914                    val_ref,
2915                    decoder,
2916                    inner_offset,
2917                    inner_depth
2918                )?;
2919                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2920                {
2921                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2922                }
2923                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2924                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2925                }
2926            }
2927
2928            next_offset += envelope_size;
2929
2930            // Decode the remaining unknown envelopes.
2931            while next_offset < end_offset {
2932                _next_ordinal_to_read += 1;
2933                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2934                next_offset += envelope_size;
2935            }
2936
2937            Ok(())
2938        }
2939    }
2940
2941    impl Profile {
2942        #[inline(always)]
2943        fn max_ordinal_present(&self) -> u64 {
2944            if let Some(_) = self.temperature_unit {
2945                return 4;
2946            }
2947            if let Some(_) = self.time_zones {
2948                return 3;
2949            }
2950            if let Some(_) = self.calendars {
2951                return 2;
2952            }
2953            if let Some(_) = self.locales {
2954                return 1;
2955            }
2956            0
2957        }
2958    }
2959
2960    impl fidl::encoding::ValueTypeMarker for Profile {
2961        type Borrowed<'a> = &'a Self;
2962        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2963            value
2964        }
2965    }
2966
2967    unsafe impl fidl::encoding::TypeMarker for Profile {
2968        type Owned = Self;
2969
2970        #[inline(always)]
2971        fn inline_align(_context: fidl::encoding::Context) -> usize {
2972            8
2973        }
2974
2975        #[inline(always)]
2976        fn inline_size(_context: fidl::encoding::Context) -> usize {
2977            16
2978        }
2979    }
2980
2981    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Profile, D> for &Profile {
2982        unsafe fn encode(
2983            self,
2984            encoder: &mut fidl::encoding::Encoder<'_, D>,
2985            offset: usize,
2986            mut depth: fidl::encoding::Depth,
2987        ) -> fidl::Result<()> {
2988            encoder.debug_check_bounds::<Profile>(offset);
2989            // Vector header
2990            let max_ordinal: u64 = self.max_ordinal_present();
2991            encoder.write_num(max_ordinal, offset);
2992            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2993            // Calling encoder.out_of_line_offset(0) is not allowed.
2994            if max_ordinal == 0 {
2995                return Ok(());
2996            }
2997            depth.increment()?;
2998            let envelope_size = 8;
2999            let bytes_len = max_ordinal as usize * envelope_size;
3000            #[allow(unused_variables)]
3001            let offset = encoder.out_of_line_offset(bytes_len);
3002            let mut _prev_end_offset: usize = 0;
3003            if 1 > max_ordinal {
3004                return Ok(());
3005            }
3006
3007            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3008            // are envelope_size bytes.
3009            let cur_offset: usize = (1 - 1) * envelope_size;
3010
3011            // Zero reserved fields.
3012            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3013
3014            // Safety:
3015            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3016            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3017            //   envelope_size bytes, there is always sufficient room.
3018            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<LocaleId>, D>(
3019            self.locales.as_ref().map(<fidl::encoding::UnboundedVector<LocaleId> as fidl::encoding::ValueTypeMarker>::borrow),
3020            encoder, offset + cur_offset, depth
3021        )?;
3022
3023            _prev_end_offset = cur_offset + envelope_size;
3024            if 2 > max_ordinal {
3025                return Ok(());
3026            }
3027
3028            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3029            // are envelope_size bytes.
3030            let cur_offset: usize = (2 - 1) * envelope_size;
3031
3032            // Zero reserved fields.
3033            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3034
3035            // Safety:
3036            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3037            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3038            //   envelope_size bytes, there is always sufficient room.
3039            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<CalendarId>, D>(
3040            self.calendars.as_ref().map(<fidl::encoding::UnboundedVector<CalendarId> as fidl::encoding::ValueTypeMarker>::borrow),
3041            encoder, offset + cur_offset, depth
3042        )?;
3043
3044            _prev_end_offset = cur_offset + envelope_size;
3045            if 3 > max_ordinal {
3046                return Ok(());
3047            }
3048
3049            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3050            // are envelope_size bytes.
3051            let cur_offset: usize = (3 - 1) * envelope_size;
3052
3053            // Zero reserved fields.
3054            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3055
3056            // Safety:
3057            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3058            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3059            //   envelope_size bytes, there is always sufficient room.
3060            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<TimeZoneId>, D>(
3061            self.time_zones.as_ref().map(<fidl::encoding::UnboundedVector<TimeZoneId> as fidl::encoding::ValueTypeMarker>::borrow),
3062            encoder, offset + cur_offset, depth
3063        )?;
3064
3065            _prev_end_offset = cur_offset + envelope_size;
3066            if 4 > max_ordinal {
3067                return Ok(());
3068            }
3069
3070            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3071            // are envelope_size bytes.
3072            let cur_offset: usize = (4 - 1) * envelope_size;
3073
3074            // Zero reserved fields.
3075            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3076
3077            // Safety:
3078            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3079            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3080            //   envelope_size bytes, there is always sufficient room.
3081            fidl::encoding::encode_in_envelope_optional::<TemperatureUnit, D>(
3082                self.temperature_unit
3083                    .as_ref()
3084                    .map(<TemperatureUnit as fidl::encoding::ValueTypeMarker>::borrow),
3085                encoder,
3086                offset + cur_offset,
3087                depth,
3088            )?;
3089
3090            _prev_end_offset = cur_offset + envelope_size;
3091
3092            Ok(())
3093        }
3094    }
3095
3096    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Profile {
3097        #[inline(always)]
3098        fn new_empty() -> Self {
3099            Self::default()
3100        }
3101
3102        unsafe fn decode(
3103            &mut self,
3104            decoder: &mut fidl::encoding::Decoder<'_, D>,
3105            offset: usize,
3106            mut depth: fidl::encoding::Depth,
3107        ) -> fidl::Result<()> {
3108            decoder.debug_check_bounds::<Self>(offset);
3109            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3110                None => return Err(fidl::Error::NotNullable),
3111                Some(len) => len,
3112            };
3113            // Calling decoder.out_of_line_offset(0) is not allowed.
3114            if len == 0 {
3115                return Ok(());
3116            };
3117            depth.increment()?;
3118            let envelope_size = 8;
3119            let bytes_len = len * envelope_size;
3120            let offset = decoder.out_of_line_offset(bytes_len)?;
3121            // Decode the envelope for each type.
3122            let mut _next_ordinal_to_read = 0;
3123            let mut next_offset = offset;
3124            let end_offset = offset + bytes_len;
3125            _next_ordinal_to_read += 1;
3126            if next_offset >= end_offset {
3127                return Ok(());
3128            }
3129
3130            // Decode unknown envelopes for gaps in ordinals.
3131            while _next_ordinal_to_read < 1 {
3132                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3133                _next_ordinal_to_read += 1;
3134                next_offset += envelope_size;
3135            }
3136
3137            let next_out_of_line = decoder.next_out_of_line();
3138            let handles_before = decoder.remaining_handles();
3139            if let Some((inlined, num_bytes, num_handles)) =
3140                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3141            {
3142                let member_inline_size = <fidl::encoding::UnboundedVector<LocaleId> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3143                if inlined != (member_inline_size <= 4) {
3144                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3145                }
3146                let inner_offset;
3147                let mut inner_depth = depth.clone();
3148                if inlined {
3149                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3150                    inner_offset = next_offset;
3151                } else {
3152                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3153                    inner_depth.increment()?;
3154                }
3155                let val_ref = self.locales.get_or_insert_with(|| {
3156                    fidl::new_empty!(fidl::encoding::UnboundedVector<LocaleId>, D)
3157                });
3158                fidl::decode!(
3159                    fidl::encoding::UnboundedVector<LocaleId>,
3160                    D,
3161                    val_ref,
3162                    decoder,
3163                    inner_offset,
3164                    inner_depth
3165                )?;
3166                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3167                {
3168                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3169                }
3170                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3171                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3172                }
3173            }
3174
3175            next_offset += envelope_size;
3176            _next_ordinal_to_read += 1;
3177            if next_offset >= end_offset {
3178                return Ok(());
3179            }
3180
3181            // Decode unknown envelopes for gaps in ordinals.
3182            while _next_ordinal_to_read < 2 {
3183                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3184                _next_ordinal_to_read += 1;
3185                next_offset += envelope_size;
3186            }
3187
3188            let next_out_of_line = decoder.next_out_of_line();
3189            let handles_before = decoder.remaining_handles();
3190            if let Some((inlined, num_bytes, num_handles)) =
3191                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3192            {
3193                let member_inline_size = <fidl::encoding::UnboundedVector<CalendarId> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3194                if inlined != (member_inline_size <= 4) {
3195                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3196                }
3197                let inner_offset;
3198                let mut inner_depth = depth.clone();
3199                if inlined {
3200                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3201                    inner_offset = next_offset;
3202                } else {
3203                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3204                    inner_depth.increment()?;
3205                }
3206                let val_ref = self.calendars.get_or_insert_with(|| {
3207                    fidl::new_empty!(fidl::encoding::UnboundedVector<CalendarId>, D)
3208                });
3209                fidl::decode!(
3210                    fidl::encoding::UnboundedVector<CalendarId>,
3211                    D,
3212                    val_ref,
3213                    decoder,
3214                    inner_offset,
3215                    inner_depth
3216                )?;
3217                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3218                {
3219                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3220                }
3221                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3222                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3223                }
3224            }
3225
3226            next_offset += envelope_size;
3227            _next_ordinal_to_read += 1;
3228            if next_offset >= end_offset {
3229                return Ok(());
3230            }
3231
3232            // Decode unknown envelopes for gaps in ordinals.
3233            while _next_ordinal_to_read < 3 {
3234                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3235                _next_ordinal_to_read += 1;
3236                next_offset += envelope_size;
3237            }
3238
3239            let next_out_of_line = decoder.next_out_of_line();
3240            let handles_before = decoder.remaining_handles();
3241            if let Some((inlined, num_bytes, num_handles)) =
3242                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3243            {
3244                let member_inline_size = <fidl::encoding::UnboundedVector<TimeZoneId> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3245                if inlined != (member_inline_size <= 4) {
3246                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3247                }
3248                let inner_offset;
3249                let mut inner_depth = depth.clone();
3250                if inlined {
3251                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3252                    inner_offset = next_offset;
3253                } else {
3254                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3255                    inner_depth.increment()?;
3256                }
3257                let val_ref = self.time_zones.get_or_insert_with(|| {
3258                    fidl::new_empty!(fidl::encoding::UnboundedVector<TimeZoneId>, D)
3259                });
3260                fidl::decode!(
3261                    fidl::encoding::UnboundedVector<TimeZoneId>,
3262                    D,
3263                    val_ref,
3264                    decoder,
3265                    inner_offset,
3266                    inner_depth
3267                )?;
3268                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3269                {
3270                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3271                }
3272                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3273                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3274                }
3275            }
3276
3277            next_offset += envelope_size;
3278            _next_ordinal_to_read += 1;
3279            if next_offset >= end_offset {
3280                return Ok(());
3281            }
3282
3283            // Decode unknown envelopes for gaps in ordinals.
3284            while _next_ordinal_to_read < 4 {
3285                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3286                _next_ordinal_to_read += 1;
3287                next_offset += envelope_size;
3288            }
3289
3290            let next_out_of_line = decoder.next_out_of_line();
3291            let handles_before = decoder.remaining_handles();
3292            if let Some((inlined, num_bytes, num_handles)) =
3293                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3294            {
3295                let member_inline_size =
3296                    <TemperatureUnit as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3297                if inlined != (member_inline_size <= 4) {
3298                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3299                }
3300                let inner_offset;
3301                let mut inner_depth = depth.clone();
3302                if inlined {
3303                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3304                    inner_offset = next_offset;
3305                } else {
3306                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3307                    inner_depth.increment()?;
3308                }
3309                let val_ref = self
3310                    .temperature_unit
3311                    .get_or_insert_with(|| fidl::new_empty!(TemperatureUnit, D));
3312                fidl::decode!(TemperatureUnit, D, val_ref, decoder, inner_offset, inner_depth)?;
3313                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3314                {
3315                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3316                }
3317                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3318                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3319                }
3320            }
3321
3322            next_offset += envelope_size;
3323
3324            // Decode the remaining unknown envelopes.
3325            while next_offset < end_offset {
3326                _next_ordinal_to_read += 1;
3327                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3328                next_offset += envelope_size;
3329            }
3330
3331            Ok(())
3332        }
3333    }
3334
3335    impl RegulatoryDomain {
3336        #[inline(always)]
3337        fn max_ordinal_present(&self) -> u64 {
3338            if let Some(_) = self.country_code {
3339                return 1;
3340            }
3341            0
3342        }
3343    }
3344
3345    impl fidl::encoding::ValueTypeMarker for RegulatoryDomain {
3346        type Borrowed<'a> = &'a Self;
3347        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3348            value
3349        }
3350    }
3351
3352    unsafe impl fidl::encoding::TypeMarker for RegulatoryDomain {
3353        type Owned = Self;
3354
3355        #[inline(always)]
3356        fn inline_align(_context: fidl::encoding::Context) -> usize {
3357            8
3358        }
3359
3360        #[inline(always)]
3361        fn inline_size(_context: fidl::encoding::Context) -> usize {
3362            16
3363        }
3364    }
3365
3366    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RegulatoryDomain, D>
3367        for &RegulatoryDomain
3368    {
3369        unsafe fn encode(
3370            self,
3371            encoder: &mut fidl::encoding::Encoder<'_, D>,
3372            offset: usize,
3373            mut depth: fidl::encoding::Depth,
3374        ) -> fidl::Result<()> {
3375            encoder.debug_check_bounds::<RegulatoryDomain>(offset);
3376            // Vector header
3377            let max_ordinal: u64 = self.max_ordinal_present();
3378            encoder.write_num(max_ordinal, offset);
3379            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3380            // Calling encoder.out_of_line_offset(0) is not allowed.
3381            if max_ordinal == 0 {
3382                return Ok(());
3383            }
3384            depth.increment()?;
3385            let envelope_size = 8;
3386            let bytes_len = max_ordinal as usize * envelope_size;
3387            #[allow(unused_variables)]
3388            let offset = encoder.out_of_line_offset(bytes_len);
3389            let mut _prev_end_offset: usize = 0;
3390            if 1 > max_ordinal {
3391                return Ok(());
3392            }
3393
3394            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3395            // are envelope_size bytes.
3396            let cur_offset: usize = (1 - 1) * envelope_size;
3397
3398            // Zero reserved fields.
3399            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3400
3401            // Safety:
3402            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3403            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3404            //   envelope_size bytes, there is always sufficient room.
3405            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
3406                self.country_code.as_ref().map(
3407                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3408                ),
3409                encoder,
3410                offset + cur_offset,
3411                depth,
3412            )?;
3413
3414            _prev_end_offset = cur_offset + envelope_size;
3415
3416            Ok(())
3417        }
3418    }
3419
3420    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RegulatoryDomain {
3421        #[inline(always)]
3422        fn new_empty() -> Self {
3423            Self::default()
3424        }
3425
3426        unsafe fn decode(
3427            &mut self,
3428            decoder: &mut fidl::encoding::Decoder<'_, D>,
3429            offset: usize,
3430            mut depth: fidl::encoding::Depth,
3431        ) -> fidl::Result<()> {
3432            decoder.debug_check_bounds::<Self>(offset);
3433            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3434                None => return Err(fidl::Error::NotNullable),
3435                Some(len) => len,
3436            };
3437            // Calling decoder.out_of_line_offset(0) is not allowed.
3438            if len == 0 {
3439                return Ok(());
3440            };
3441            depth.increment()?;
3442            let envelope_size = 8;
3443            let bytes_len = len * envelope_size;
3444            let offset = decoder.out_of_line_offset(bytes_len)?;
3445            // Decode the envelope for each type.
3446            let mut _next_ordinal_to_read = 0;
3447            let mut next_offset = offset;
3448            let end_offset = offset + bytes_len;
3449            _next_ordinal_to_read += 1;
3450            if next_offset >= end_offset {
3451                return Ok(());
3452            }
3453
3454            // Decode unknown envelopes for gaps in ordinals.
3455            while _next_ordinal_to_read < 1 {
3456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3457                _next_ordinal_to_read += 1;
3458                next_offset += envelope_size;
3459            }
3460
3461            let next_out_of_line = decoder.next_out_of_line();
3462            let handles_before = decoder.remaining_handles();
3463            if let Some((inlined, num_bytes, num_handles)) =
3464                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3465            {
3466                let member_inline_size =
3467                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3468                        decoder.context,
3469                    );
3470                if inlined != (member_inline_size <= 4) {
3471                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3472                }
3473                let inner_offset;
3474                let mut inner_depth = depth.clone();
3475                if inlined {
3476                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3477                    inner_offset = next_offset;
3478                } else {
3479                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3480                    inner_depth.increment()?;
3481                }
3482                let val_ref = self
3483                    .country_code
3484                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
3485                fidl::decode!(
3486                    fidl::encoding::UnboundedString,
3487                    D,
3488                    val_ref,
3489                    decoder,
3490                    inner_offset,
3491                    inner_depth
3492                )?;
3493                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3494                {
3495                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3496                }
3497                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3498                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3499                }
3500            }
3501
3502            next_offset += envelope_size;
3503
3504            // Decode the remaining unknown envelopes.
3505            while next_offset < end_offset {
3506                _next_ordinal_to_read += 1;
3507                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3508                next_offset += envelope_size;
3509            }
3510
3511            Ok(())
3512        }
3513    }
3514
3515    impl TimeZoneInfo {
3516        #[inline(always)]
3517        fn max_ordinal_present(&self) -> u64 {
3518            if let Some(_) = self.in_dst_at_time {
3519                return 3;
3520            }
3521            if let Some(_) = self.total_offset_at_time {
3522                return 2;
3523            }
3524            if let Some(_) = self.id {
3525                return 1;
3526            }
3527            0
3528        }
3529    }
3530
3531    impl fidl::encoding::ValueTypeMarker for TimeZoneInfo {
3532        type Borrowed<'a> = &'a Self;
3533        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3534            value
3535        }
3536    }
3537
3538    unsafe impl fidl::encoding::TypeMarker for TimeZoneInfo {
3539        type Owned = Self;
3540
3541        #[inline(always)]
3542        fn inline_align(_context: fidl::encoding::Context) -> usize {
3543            8
3544        }
3545
3546        #[inline(always)]
3547        fn inline_size(_context: fidl::encoding::Context) -> usize {
3548            16
3549        }
3550    }
3551
3552    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TimeZoneInfo, D>
3553        for &TimeZoneInfo
3554    {
3555        unsafe fn encode(
3556            self,
3557            encoder: &mut fidl::encoding::Encoder<'_, D>,
3558            offset: usize,
3559            mut depth: fidl::encoding::Depth,
3560        ) -> fidl::Result<()> {
3561            encoder.debug_check_bounds::<TimeZoneInfo>(offset);
3562            // Vector header
3563            let max_ordinal: u64 = self.max_ordinal_present();
3564            encoder.write_num(max_ordinal, offset);
3565            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3566            // Calling encoder.out_of_line_offset(0) is not allowed.
3567            if max_ordinal == 0 {
3568                return Ok(());
3569            }
3570            depth.increment()?;
3571            let envelope_size = 8;
3572            let bytes_len = max_ordinal as usize * envelope_size;
3573            #[allow(unused_variables)]
3574            let offset = encoder.out_of_line_offset(bytes_len);
3575            let mut _prev_end_offset: usize = 0;
3576            if 1 > max_ordinal {
3577                return Ok(());
3578            }
3579
3580            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3581            // are envelope_size bytes.
3582            let cur_offset: usize = (1 - 1) * envelope_size;
3583
3584            // Zero reserved fields.
3585            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3586
3587            // Safety:
3588            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3589            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3590            //   envelope_size bytes, there is always sufficient room.
3591            fidl::encoding::encode_in_envelope_optional::<TimeZoneId, D>(
3592                self.id.as_ref().map(<TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow),
3593                encoder,
3594                offset + cur_offset,
3595                depth,
3596            )?;
3597
3598            _prev_end_offset = cur_offset + envelope_size;
3599            if 2 > max_ordinal {
3600                return Ok(());
3601            }
3602
3603            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3604            // are envelope_size bytes.
3605            let cur_offset: usize = (2 - 1) * envelope_size;
3606
3607            // Zero reserved fields.
3608            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3609
3610            // Safety:
3611            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3612            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3613            //   envelope_size bytes, there is always sufficient room.
3614            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3615                self.total_offset_at_time
3616                    .as_ref()
3617                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3618                encoder,
3619                offset + cur_offset,
3620                depth,
3621            )?;
3622
3623            _prev_end_offset = cur_offset + envelope_size;
3624            if 3 > max_ordinal {
3625                return Ok(());
3626            }
3627
3628            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3629            // are envelope_size bytes.
3630            let cur_offset: usize = (3 - 1) * envelope_size;
3631
3632            // Zero reserved fields.
3633            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3634
3635            // Safety:
3636            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3637            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3638            //   envelope_size bytes, there is always sufficient room.
3639            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3640                self.in_dst_at_time.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3641                encoder,
3642                offset + cur_offset,
3643                depth,
3644            )?;
3645
3646            _prev_end_offset = cur_offset + envelope_size;
3647
3648            Ok(())
3649        }
3650    }
3651
3652    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimeZoneInfo {
3653        #[inline(always)]
3654        fn new_empty() -> Self {
3655            Self::default()
3656        }
3657
3658        unsafe fn decode(
3659            &mut self,
3660            decoder: &mut fidl::encoding::Decoder<'_, D>,
3661            offset: usize,
3662            mut depth: fidl::encoding::Depth,
3663        ) -> fidl::Result<()> {
3664            decoder.debug_check_bounds::<Self>(offset);
3665            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3666                None => return Err(fidl::Error::NotNullable),
3667                Some(len) => len,
3668            };
3669            // Calling decoder.out_of_line_offset(0) is not allowed.
3670            if len == 0 {
3671                return Ok(());
3672            };
3673            depth.increment()?;
3674            let envelope_size = 8;
3675            let bytes_len = len * envelope_size;
3676            let offset = decoder.out_of_line_offset(bytes_len)?;
3677            // Decode the envelope for each type.
3678            let mut _next_ordinal_to_read = 0;
3679            let mut next_offset = offset;
3680            let end_offset = offset + bytes_len;
3681            _next_ordinal_to_read += 1;
3682            if next_offset >= end_offset {
3683                return Ok(());
3684            }
3685
3686            // Decode unknown envelopes for gaps in ordinals.
3687            while _next_ordinal_to_read < 1 {
3688                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3689                _next_ordinal_to_read += 1;
3690                next_offset += envelope_size;
3691            }
3692
3693            let next_out_of_line = decoder.next_out_of_line();
3694            let handles_before = decoder.remaining_handles();
3695            if let Some((inlined, num_bytes, num_handles)) =
3696                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3697            {
3698                let member_inline_size =
3699                    <TimeZoneId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3700                if inlined != (member_inline_size <= 4) {
3701                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3702                }
3703                let inner_offset;
3704                let mut inner_depth = depth.clone();
3705                if inlined {
3706                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3707                    inner_offset = next_offset;
3708                } else {
3709                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3710                    inner_depth.increment()?;
3711                }
3712                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(TimeZoneId, D));
3713                fidl::decode!(TimeZoneId, D, val_ref, decoder, inner_offset, inner_depth)?;
3714                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3715                {
3716                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3717                }
3718                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3719                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3720                }
3721            }
3722
3723            next_offset += envelope_size;
3724            _next_ordinal_to_read += 1;
3725            if next_offset >= end_offset {
3726                return Ok(());
3727            }
3728
3729            // Decode unknown envelopes for gaps in ordinals.
3730            while _next_ordinal_to_read < 2 {
3731                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3732                _next_ordinal_to_read += 1;
3733                next_offset += envelope_size;
3734            }
3735
3736            let next_out_of_line = decoder.next_out_of_line();
3737            let handles_before = decoder.remaining_handles();
3738            if let Some((inlined, num_bytes, num_handles)) =
3739                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3740            {
3741                let member_inline_size =
3742                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3743                if inlined != (member_inline_size <= 4) {
3744                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3745                }
3746                let inner_offset;
3747                let mut inner_depth = depth.clone();
3748                if inlined {
3749                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3750                    inner_offset = next_offset;
3751                } else {
3752                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3753                    inner_depth.increment()?;
3754                }
3755                let val_ref =
3756                    self.total_offset_at_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
3757                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3758                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3759                {
3760                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3761                }
3762                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3763                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3764                }
3765            }
3766
3767            next_offset += envelope_size;
3768            _next_ordinal_to_read += 1;
3769            if next_offset >= end_offset {
3770                return Ok(());
3771            }
3772
3773            // Decode unknown envelopes for gaps in ordinals.
3774            while _next_ordinal_to_read < 3 {
3775                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3776                _next_ordinal_to_read += 1;
3777                next_offset += envelope_size;
3778            }
3779
3780            let next_out_of_line = decoder.next_out_of_line();
3781            let handles_before = decoder.remaining_handles();
3782            if let Some((inlined, num_bytes, num_handles)) =
3783                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3784            {
3785                let member_inline_size =
3786                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3787                if inlined != (member_inline_size <= 4) {
3788                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3789                }
3790                let inner_offset;
3791                let mut inner_depth = depth.clone();
3792                if inlined {
3793                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3794                    inner_offset = next_offset;
3795                } else {
3796                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3797                    inner_depth.increment()?;
3798                }
3799                let val_ref = self.in_dst_at_time.get_or_insert_with(|| fidl::new_empty!(bool, D));
3800                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3801                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3802                {
3803                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3804                }
3805                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3806                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3807                }
3808            }
3809
3810            next_offset += envelope_size;
3811
3812            // Decode the remaining unknown envelopes.
3813            while next_offset < end_offset {
3814                _next_ordinal_to_read += 1;
3815                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3816                next_offset += envelope_size;
3817            }
3818
3819            Ok(())
3820        }
3821    }
3822}