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