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
552pub mod property_provider_ordinals {
553    pub const GET_PROFILE: u64 = 0x10bf06e68d36d3eb;
554    pub const ON_CHANGE: u64 = 0x26b9ed6e23c46991;
555}
556
557pub mod time_zones_ordinals {
558    pub const ABSOLUTE_TO_CIVIL_TIME: u64 = 0x25377a4d9196e205;
559    pub const CIVIL_TO_ABSOLUTE_TIME: u64 = 0xc1277c7a1413aa6;
560    pub const GET_TIME_ZONE_INFO: u64 = 0x2144cbac1d76fe65;
561}
562
563mod internal {
564    use super::*;
565    unsafe impl fidl::encoding::TypeMarker for DayOfWeek {
566        type Owned = Self;
567
568        #[inline(always)]
569        fn inline_align(_context: fidl::encoding::Context) -> usize {
570            std::mem::align_of::<u8>()
571        }
572
573        #[inline(always)]
574        fn inline_size(_context: fidl::encoding::Context) -> usize {
575            std::mem::size_of::<u8>()
576        }
577
578        #[inline(always)]
579        fn encode_is_copy() -> bool {
580            true
581        }
582
583        #[inline(always)]
584        fn decode_is_copy() -> bool {
585            false
586        }
587    }
588
589    impl fidl::encoding::ValueTypeMarker for DayOfWeek {
590        type Borrowed<'a> = Self;
591        #[inline(always)]
592        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
593            *value
594        }
595    }
596
597    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DayOfWeek {
598        #[inline]
599        unsafe fn encode(
600            self,
601            encoder: &mut fidl::encoding::Encoder<'_, D>,
602            offset: usize,
603            _depth: fidl::encoding::Depth,
604        ) -> fidl::Result<()> {
605            encoder.debug_check_bounds::<Self>(offset);
606            encoder.write_num(self.into_primitive(), offset);
607            Ok(())
608        }
609    }
610
611    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DayOfWeek {
612        #[inline(always)]
613        fn new_empty() -> Self {
614            Self::Sunday
615        }
616
617        #[inline]
618        unsafe fn decode(
619            &mut self,
620            decoder: &mut fidl::encoding::Decoder<'_, D>,
621            offset: usize,
622            _depth: fidl::encoding::Depth,
623        ) -> fidl::Result<()> {
624            decoder.debug_check_bounds::<Self>(offset);
625            let prim = decoder.read_num::<u8>(offset);
626
627            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
628            Ok(())
629        }
630    }
631    unsafe impl fidl::encoding::TypeMarker for Month {
632        type Owned = Self;
633
634        #[inline(always)]
635        fn inline_align(_context: fidl::encoding::Context) -> usize {
636            std::mem::align_of::<u8>()
637        }
638
639        #[inline(always)]
640        fn inline_size(_context: fidl::encoding::Context) -> usize {
641            std::mem::size_of::<u8>()
642        }
643
644        #[inline(always)]
645        fn encode_is_copy() -> bool {
646            true
647        }
648
649        #[inline(always)]
650        fn decode_is_copy() -> bool {
651            false
652        }
653    }
654
655    impl fidl::encoding::ValueTypeMarker for Month {
656        type Borrowed<'a> = Self;
657        #[inline(always)]
658        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
659            *value
660        }
661    }
662
663    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Month {
664        #[inline]
665        unsafe fn encode(
666            self,
667            encoder: &mut fidl::encoding::Encoder<'_, D>,
668            offset: usize,
669            _depth: fidl::encoding::Depth,
670        ) -> fidl::Result<()> {
671            encoder.debug_check_bounds::<Self>(offset);
672            encoder.write_num(self.into_primitive(), offset);
673            Ok(())
674        }
675    }
676
677    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Month {
678        #[inline(always)]
679        fn new_empty() -> Self {
680            Self::January
681        }
682
683        #[inline]
684        unsafe fn decode(
685            &mut self,
686            decoder: &mut fidl::encoding::Decoder<'_, D>,
687            offset: usize,
688            _depth: fidl::encoding::Depth,
689        ) -> fidl::Result<()> {
690            decoder.debug_check_bounds::<Self>(offset);
691            let prim = decoder.read_num::<u8>(offset);
692
693            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
694            Ok(())
695        }
696    }
697    unsafe impl fidl::encoding::TypeMarker for RepeatedTimeConversion {
698        type Owned = Self;
699
700        #[inline(always)]
701        fn inline_align(_context: fidl::encoding::Context) -> usize {
702            std::mem::align_of::<i32>()
703        }
704
705        #[inline(always)]
706        fn inline_size(_context: fidl::encoding::Context) -> usize {
707            std::mem::size_of::<i32>()
708        }
709
710        #[inline(always)]
711        fn encode_is_copy() -> bool {
712            false
713        }
714
715        #[inline(always)]
716        fn decode_is_copy() -> bool {
717            false
718        }
719    }
720
721    impl fidl::encoding::ValueTypeMarker for RepeatedTimeConversion {
722        type Borrowed<'a> = Self;
723        #[inline(always)]
724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
725            *value
726        }
727    }
728
729    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
730        for RepeatedTimeConversion
731    {
732        #[inline]
733        unsafe fn encode(
734            self,
735            encoder: &mut fidl::encoding::Encoder<'_, D>,
736            offset: usize,
737            _depth: fidl::encoding::Depth,
738        ) -> fidl::Result<()> {
739            encoder.debug_check_bounds::<Self>(offset);
740            encoder.write_num(self.into_primitive(), offset);
741            Ok(())
742        }
743    }
744
745    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
746        for RepeatedTimeConversion
747    {
748        #[inline(always)]
749        fn new_empty() -> Self {
750            Self::unknown()
751        }
752
753        #[inline]
754        unsafe fn decode(
755            &mut self,
756            decoder: &mut fidl::encoding::Decoder<'_, D>,
757            offset: usize,
758            _depth: fidl::encoding::Depth,
759        ) -> fidl::Result<()> {
760            decoder.debug_check_bounds::<Self>(offset);
761            let prim = decoder.read_num::<i32>(offset);
762
763            *self = Self::from_primitive_allow_unknown(prim);
764            Ok(())
765        }
766    }
767    unsafe impl fidl::encoding::TypeMarker for SkippedTimeConversion {
768        type Owned = Self;
769
770        #[inline(always)]
771        fn inline_align(_context: fidl::encoding::Context) -> usize {
772            std::mem::align_of::<i32>()
773        }
774
775        #[inline(always)]
776        fn inline_size(_context: fidl::encoding::Context) -> usize {
777            std::mem::size_of::<i32>()
778        }
779
780        #[inline(always)]
781        fn encode_is_copy() -> bool {
782            false
783        }
784
785        #[inline(always)]
786        fn decode_is_copy() -> bool {
787            false
788        }
789    }
790
791    impl fidl::encoding::ValueTypeMarker for SkippedTimeConversion {
792        type Borrowed<'a> = Self;
793        #[inline(always)]
794        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
795            *value
796        }
797    }
798
799    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
800        for SkippedTimeConversion
801    {
802        #[inline]
803        unsafe fn encode(
804            self,
805            encoder: &mut fidl::encoding::Encoder<'_, D>,
806            offset: usize,
807            _depth: fidl::encoding::Depth,
808        ) -> fidl::Result<()> {
809            encoder.debug_check_bounds::<Self>(offset);
810            encoder.write_num(self.into_primitive(), offset);
811            Ok(())
812        }
813    }
814
815    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SkippedTimeConversion {
816        #[inline(always)]
817        fn new_empty() -> Self {
818            Self::unknown()
819        }
820
821        #[inline]
822        unsafe fn decode(
823            &mut self,
824            decoder: &mut fidl::encoding::Decoder<'_, D>,
825            offset: usize,
826            _depth: fidl::encoding::Depth,
827        ) -> fidl::Result<()> {
828            decoder.debug_check_bounds::<Self>(offset);
829            let prim = decoder.read_num::<i32>(offset);
830
831            *self = Self::from_primitive_allow_unknown(prim);
832            Ok(())
833        }
834    }
835    unsafe impl fidl::encoding::TypeMarker for TemperatureUnit {
836        type Owned = Self;
837
838        #[inline(always)]
839        fn inline_align(_context: fidl::encoding::Context) -> usize {
840            std::mem::align_of::<u32>()
841        }
842
843        #[inline(always)]
844        fn inline_size(_context: fidl::encoding::Context) -> usize {
845            std::mem::size_of::<u32>()
846        }
847
848        #[inline(always)]
849        fn encode_is_copy() -> bool {
850            true
851        }
852
853        #[inline(always)]
854        fn decode_is_copy() -> bool {
855            false
856        }
857    }
858
859    impl fidl::encoding::ValueTypeMarker for TemperatureUnit {
860        type Borrowed<'a> = Self;
861        #[inline(always)]
862        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
863            *value
864        }
865    }
866
867    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
868        for TemperatureUnit
869    {
870        #[inline]
871        unsafe fn encode(
872            self,
873            encoder: &mut fidl::encoding::Encoder<'_, D>,
874            offset: usize,
875            _depth: fidl::encoding::Depth,
876        ) -> fidl::Result<()> {
877            encoder.debug_check_bounds::<Self>(offset);
878            encoder.write_num(self.into_primitive(), offset);
879            Ok(())
880        }
881    }
882
883    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TemperatureUnit {
884        #[inline(always)]
885        fn new_empty() -> Self {
886            Self::Celsius
887        }
888
889        #[inline]
890        unsafe fn decode(
891            &mut self,
892            decoder: &mut fidl::encoding::Decoder<'_, D>,
893            offset: usize,
894            _depth: fidl::encoding::Depth,
895        ) -> fidl::Result<()> {
896            decoder.debug_check_bounds::<Self>(offset);
897            let prim = decoder.read_num::<u32>(offset);
898
899            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
900            Ok(())
901        }
902    }
903    unsafe impl fidl::encoding::TypeMarker for TimeZonesError {
904        type Owned = Self;
905
906        #[inline(always)]
907        fn inline_align(_context: fidl::encoding::Context) -> usize {
908            std::mem::align_of::<i32>()
909        }
910
911        #[inline(always)]
912        fn inline_size(_context: fidl::encoding::Context) -> usize {
913            std::mem::size_of::<i32>()
914        }
915
916        #[inline(always)]
917        fn encode_is_copy() -> bool {
918            false
919        }
920
921        #[inline(always)]
922        fn decode_is_copy() -> bool {
923            false
924        }
925    }
926
927    impl fidl::encoding::ValueTypeMarker for TimeZonesError {
928        type Borrowed<'a> = Self;
929        #[inline(always)]
930        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
931            *value
932        }
933    }
934
935    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TimeZonesError {
936        #[inline]
937        unsafe fn encode(
938            self,
939            encoder: &mut fidl::encoding::Encoder<'_, D>,
940            offset: usize,
941            _depth: fidl::encoding::Depth,
942        ) -> fidl::Result<()> {
943            encoder.debug_check_bounds::<Self>(offset);
944            encoder.write_num(self.into_primitive(), offset);
945            Ok(())
946        }
947    }
948
949    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimeZonesError {
950        #[inline(always)]
951        fn new_empty() -> Self {
952            Self::unknown()
953        }
954
955        #[inline]
956        unsafe fn decode(
957            &mut self,
958            decoder: &mut fidl::encoding::Decoder<'_, D>,
959            offset: usize,
960            _depth: fidl::encoding::Depth,
961        ) -> fidl::Result<()> {
962            decoder.debug_check_bounds::<Self>(offset);
963            let prim = decoder.read_num::<i32>(offset);
964
965            *self = Self::from_primitive_allow_unknown(prim);
966            Ok(())
967        }
968    }
969
970    impl fidl::encoding::ValueTypeMarker for CalendarId {
971        type Borrowed<'a> = &'a Self;
972        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
973            value
974        }
975    }
976
977    unsafe impl fidl::encoding::TypeMarker for CalendarId {
978        type Owned = Self;
979
980        #[inline(always)]
981        fn inline_align(_context: fidl::encoding::Context) -> usize {
982            8
983        }
984
985        #[inline(always)]
986        fn inline_size(_context: fidl::encoding::Context) -> usize {
987            16
988        }
989    }
990
991    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CalendarId, D>
992        for &CalendarId
993    {
994        #[inline]
995        unsafe fn encode(
996            self,
997            encoder: &mut fidl::encoding::Encoder<'_, D>,
998            offset: usize,
999            _depth: fidl::encoding::Depth,
1000        ) -> fidl::Result<()> {
1001            encoder.debug_check_bounds::<CalendarId>(offset);
1002            // Delegate to tuple encoding.
1003            fidl::encoding::Encode::<CalendarId, D>::encode(
1004                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1005                    &self.id,
1006                ),),
1007                encoder,
1008                offset,
1009                _depth,
1010            )
1011        }
1012    }
1013    unsafe impl<
1014            D: fidl::encoding::ResourceDialect,
1015            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1016        > fidl::encoding::Encode<CalendarId, D> for (T0,)
1017    {
1018        #[inline]
1019        unsafe fn encode(
1020            self,
1021            encoder: &mut fidl::encoding::Encoder<'_, D>,
1022            offset: usize,
1023            depth: fidl::encoding::Depth,
1024        ) -> fidl::Result<()> {
1025            encoder.debug_check_bounds::<CalendarId>(offset);
1026            // Zero out padding regions. There's no need to apply masks
1027            // because the unmasked parts will be overwritten by fields.
1028            // Write the fields.
1029            self.0.encode(encoder, offset + 0, depth)?;
1030            Ok(())
1031        }
1032    }
1033
1034    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CalendarId {
1035        #[inline(always)]
1036        fn new_empty() -> Self {
1037            Self { id: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1038        }
1039
1040        #[inline]
1041        unsafe fn decode(
1042            &mut self,
1043            decoder: &mut fidl::encoding::Decoder<'_, D>,
1044            offset: usize,
1045            _depth: fidl::encoding::Depth,
1046        ) -> fidl::Result<()> {
1047            decoder.debug_check_bounds::<Self>(offset);
1048            // Verify that padding bytes are zero.
1049            fidl::decode!(
1050                fidl::encoding::UnboundedString,
1051                D,
1052                &mut self.id,
1053                decoder,
1054                offset + 0,
1055                _depth
1056            )?;
1057            Ok(())
1058        }
1059    }
1060
1061    impl fidl::encoding::ValueTypeMarker for LocaleId {
1062        type Borrowed<'a> = &'a Self;
1063        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1064            value
1065        }
1066    }
1067
1068    unsafe impl fidl::encoding::TypeMarker for LocaleId {
1069        type Owned = Self;
1070
1071        #[inline(always)]
1072        fn inline_align(_context: fidl::encoding::Context) -> usize {
1073            8
1074        }
1075
1076        #[inline(always)]
1077        fn inline_size(_context: fidl::encoding::Context) -> usize {
1078            16
1079        }
1080    }
1081
1082    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LocaleId, D> for &LocaleId {
1083        #[inline]
1084        unsafe fn encode(
1085            self,
1086            encoder: &mut fidl::encoding::Encoder<'_, D>,
1087            offset: usize,
1088            _depth: fidl::encoding::Depth,
1089        ) -> fidl::Result<()> {
1090            encoder.debug_check_bounds::<LocaleId>(offset);
1091            // Delegate to tuple encoding.
1092            fidl::encoding::Encode::<LocaleId, D>::encode(
1093                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1094                    &self.id,
1095                ),),
1096                encoder,
1097                offset,
1098                _depth,
1099            )
1100        }
1101    }
1102    unsafe impl<
1103            D: fidl::encoding::ResourceDialect,
1104            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1105        > fidl::encoding::Encode<LocaleId, D> for (T0,)
1106    {
1107        #[inline]
1108        unsafe fn encode(
1109            self,
1110            encoder: &mut fidl::encoding::Encoder<'_, D>,
1111            offset: usize,
1112            depth: fidl::encoding::Depth,
1113        ) -> fidl::Result<()> {
1114            encoder.debug_check_bounds::<LocaleId>(offset);
1115            // Zero out padding regions. There's no need to apply masks
1116            // because the unmasked parts will be overwritten by fields.
1117            // Write the fields.
1118            self.0.encode(encoder, offset + 0, depth)?;
1119            Ok(())
1120        }
1121    }
1122
1123    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LocaleId {
1124        #[inline(always)]
1125        fn new_empty() -> Self {
1126            Self { id: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1127        }
1128
1129        #[inline]
1130        unsafe fn decode(
1131            &mut self,
1132            decoder: &mut fidl::encoding::Decoder<'_, D>,
1133            offset: usize,
1134            _depth: fidl::encoding::Depth,
1135        ) -> fidl::Result<()> {
1136            decoder.debug_check_bounds::<Self>(offset);
1137            // Verify that padding bytes are zero.
1138            fidl::decode!(
1139                fidl::encoding::UnboundedString,
1140                D,
1141                &mut self.id,
1142                decoder,
1143                offset + 0,
1144                _depth
1145            )?;
1146            Ok(())
1147        }
1148    }
1149
1150    impl fidl::encoding::ValueTypeMarker for PropertyProviderGetProfileResponse {
1151        type Borrowed<'a> = &'a Self;
1152        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1153            value
1154        }
1155    }
1156
1157    unsafe impl fidl::encoding::TypeMarker for PropertyProviderGetProfileResponse {
1158        type Owned = Self;
1159
1160        #[inline(always)]
1161        fn inline_align(_context: fidl::encoding::Context) -> usize {
1162            8
1163        }
1164
1165        #[inline(always)]
1166        fn inline_size(_context: fidl::encoding::Context) -> usize {
1167            16
1168        }
1169    }
1170
1171    unsafe impl<D: fidl::encoding::ResourceDialect>
1172        fidl::encoding::Encode<PropertyProviderGetProfileResponse, D>
1173        for &PropertyProviderGetProfileResponse
1174    {
1175        #[inline]
1176        unsafe fn encode(
1177            self,
1178            encoder: &mut fidl::encoding::Encoder<'_, D>,
1179            offset: usize,
1180            _depth: fidl::encoding::Depth,
1181        ) -> fidl::Result<()> {
1182            encoder.debug_check_bounds::<PropertyProviderGetProfileResponse>(offset);
1183            // Delegate to tuple encoding.
1184            fidl::encoding::Encode::<PropertyProviderGetProfileResponse, D>::encode(
1185                (<Profile as fidl::encoding::ValueTypeMarker>::borrow(&self.profile),),
1186                encoder,
1187                offset,
1188                _depth,
1189            )
1190        }
1191    }
1192    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Profile, D>>
1193        fidl::encoding::Encode<PropertyProviderGetProfileResponse, D> for (T0,)
1194    {
1195        #[inline]
1196        unsafe fn encode(
1197            self,
1198            encoder: &mut fidl::encoding::Encoder<'_, D>,
1199            offset: usize,
1200            depth: fidl::encoding::Depth,
1201        ) -> fidl::Result<()> {
1202            encoder.debug_check_bounds::<PropertyProviderGetProfileResponse>(offset);
1203            // Zero out padding regions. There's no need to apply masks
1204            // because the unmasked parts will be overwritten by fields.
1205            // Write the fields.
1206            self.0.encode(encoder, offset + 0, depth)?;
1207            Ok(())
1208        }
1209    }
1210
1211    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1212        for PropertyProviderGetProfileResponse
1213    {
1214        #[inline(always)]
1215        fn new_empty() -> Self {
1216            Self { profile: fidl::new_empty!(Profile, D) }
1217        }
1218
1219        #[inline]
1220        unsafe fn decode(
1221            &mut self,
1222            decoder: &mut fidl::encoding::Decoder<'_, D>,
1223            offset: usize,
1224            _depth: fidl::encoding::Depth,
1225        ) -> fidl::Result<()> {
1226            decoder.debug_check_bounds::<Self>(offset);
1227            // Verify that padding bytes are zero.
1228            fidl::decode!(Profile, D, &mut self.profile, decoder, offset + 0, _depth)?;
1229            Ok(())
1230        }
1231    }
1232
1233    impl fidl::encoding::ValueTypeMarker for TimeZoneId {
1234        type Borrowed<'a> = &'a Self;
1235        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1236            value
1237        }
1238    }
1239
1240    unsafe impl fidl::encoding::TypeMarker for TimeZoneId {
1241        type Owned = Self;
1242
1243        #[inline(always)]
1244        fn inline_align(_context: fidl::encoding::Context) -> usize {
1245            8
1246        }
1247
1248        #[inline(always)]
1249        fn inline_size(_context: fidl::encoding::Context) -> usize {
1250            16
1251        }
1252    }
1253
1254    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TimeZoneId, D>
1255        for &TimeZoneId
1256    {
1257        #[inline]
1258        unsafe fn encode(
1259            self,
1260            encoder: &mut fidl::encoding::Encoder<'_, D>,
1261            offset: usize,
1262            _depth: fidl::encoding::Depth,
1263        ) -> fidl::Result<()> {
1264            encoder.debug_check_bounds::<TimeZoneId>(offset);
1265            // Delegate to tuple encoding.
1266            fidl::encoding::Encode::<TimeZoneId, D>::encode(
1267                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1268                    &self.id,
1269                ),),
1270                encoder,
1271                offset,
1272                _depth,
1273            )
1274        }
1275    }
1276    unsafe impl<
1277            D: fidl::encoding::ResourceDialect,
1278            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1279        > fidl::encoding::Encode<TimeZoneId, D> for (T0,)
1280    {
1281        #[inline]
1282        unsafe fn encode(
1283            self,
1284            encoder: &mut fidl::encoding::Encoder<'_, D>,
1285            offset: usize,
1286            depth: fidl::encoding::Depth,
1287        ) -> fidl::Result<()> {
1288            encoder.debug_check_bounds::<TimeZoneId>(offset);
1289            // Zero out padding regions. There's no need to apply masks
1290            // because the unmasked parts will be overwritten by fields.
1291            // Write the fields.
1292            self.0.encode(encoder, offset + 0, depth)?;
1293            Ok(())
1294        }
1295    }
1296
1297    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimeZoneId {
1298        #[inline(always)]
1299        fn new_empty() -> Self {
1300            Self { id: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1301        }
1302
1303        #[inline]
1304        unsafe fn decode(
1305            &mut self,
1306            decoder: &mut fidl::encoding::Decoder<'_, D>,
1307            offset: usize,
1308            _depth: fidl::encoding::Depth,
1309        ) -> fidl::Result<()> {
1310            decoder.debug_check_bounds::<Self>(offset);
1311            // Verify that padding bytes are zero.
1312            fidl::decode!(
1313                fidl::encoding::UnboundedString,
1314                D,
1315                &mut self.id,
1316                decoder,
1317                offset + 0,
1318                _depth
1319            )?;
1320            Ok(())
1321        }
1322    }
1323
1324    impl fidl::encoding::ValueTypeMarker for TimeZonesAbsoluteToCivilTimeRequest {
1325        type Borrowed<'a> = &'a Self;
1326        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1327            value
1328        }
1329    }
1330
1331    unsafe impl fidl::encoding::TypeMarker for TimeZonesAbsoluteToCivilTimeRequest {
1332        type Owned = Self;
1333
1334        #[inline(always)]
1335        fn inline_align(_context: fidl::encoding::Context) -> usize {
1336            8
1337        }
1338
1339        #[inline(always)]
1340        fn inline_size(_context: fidl::encoding::Context) -> usize {
1341            24
1342        }
1343    }
1344
1345    unsafe impl<D: fidl::encoding::ResourceDialect>
1346        fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeRequest, D>
1347        for &TimeZonesAbsoluteToCivilTimeRequest
1348    {
1349        #[inline]
1350        unsafe fn encode(
1351            self,
1352            encoder: &mut fidl::encoding::Encoder<'_, D>,
1353            offset: usize,
1354            _depth: fidl::encoding::Depth,
1355        ) -> fidl::Result<()> {
1356            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeRequest>(offset);
1357            // Delegate to tuple encoding.
1358            fidl::encoding::Encode::<TimeZonesAbsoluteToCivilTimeRequest, D>::encode(
1359                (
1360                    <TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow(&self.time_zone_id),
1361                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.absolute_time),
1362                ),
1363                encoder,
1364                offset,
1365                _depth,
1366            )
1367        }
1368    }
1369    unsafe impl<
1370            D: fidl::encoding::ResourceDialect,
1371            T0: fidl::encoding::Encode<TimeZoneId, D>,
1372            T1: fidl::encoding::Encode<i64, D>,
1373        > fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeRequest, D> for (T0, T1)
1374    {
1375        #[inline]
1376        unsafe fn encode(
1377            self,
1378            encoder: &mut fidl::encoding::Encoder<'_, D>,
1379            offset: usize,
1380            depth: fidl::encoding::Depth,
1381        ) -> fidl::Result<()> {
1382            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeRequest>(offset);
1383            // Zero out padding regions. There's no need to apply masks
1384            // because the unmasked parts will be overwritten by fields.
1385            // Write the fields.
1386            self.0.encode(encoder, offset + 0, depth)?;
1387            self.1.encode(encoder, offset + 16, depth)?;
1388            Ok(())
1389        }
1390    }
1391
1392    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1393        for TimeZonesAbsoluteToCivilTimeRequest
1394    {
1395        #[inline(always)]
1396        fn new_empty() -> Self {
1397            Self {
1398                time_zone_id: fidl::new_empty!(TimeZoneId, D),
1399                absolute_time: fidl::new_empty!(i64, D),
1400            }
1401        }
1402
1403        #[inline]
1404        unsafe fn decode(
1405            &mut self,
1406            decoder: &mut fidl::encoding::Decoder<'_, D>,
1407            offset: usize,
1408            _depth: fidl::encoding::Depth,
1409        ) -> fidl::Result<()> {
1410            decoder.debug_check_bounds::<Self>(offset);
1411            // Verify that padding bytes are zero.
1412            fidl::decode!(TimeZoneId, D, &mut self.time_zone_id, decoder, offset + 0, _depth)?;
1413            fidl::decode!(i64, D, &mut self.absolute_time, decoder, offset + 16, _depth)?;
1414            Ok(())
1415        }
1416    }
1417
1418    impl fidl::encoding::ValueTypeMarker for TimeZonesCivilToAbsoluteTimeRequest {
1419        type Borrowed<'a> = &'a Self;
1420        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1421            value
1422        }
1423    }
1424
1425    unsafe impl fidl::encoding::TypeMarker for TimeZonesCivilToAbsoluteTimeRequest {
1426        type Owned = Self;
1427
1428        #[inline(always)]
1429        fn inline_align(_context: fidl::encoding::Context) -> usize {
1430            8
1431        }
1432
1433        #[inline(always)]
1434        fn inline_size(_context: fidl::encoding::Context) -> usize {
1435            32
1436        }
1437    }
1438
1439    unsafe impl<D: fidl::encoding::ResourceDialect>
1440        fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeRequest, D>
1441        for &TimeZonesCivilToAbsoluteTimeRequest
1442    {
1443        #[inline]
1444        unsafe fn encode(
1445            self,
1446            encoder: &mut fidl::encoding::Encoder<'_, D>,
1447            offset: usize,
1448            _depth: fidl::encoding::Depth,
1449        ) -> fidl::Result<()> {
1450            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeRequest>(offset);
1451            // Delegate to tuple encoding.
1452            fidl::encoding::Encode::<TimeZonesCivilToAbsoluteTimeRequest, D>::encode(
1453                (
1454                    <CivilTime as fidl::encoding::ValueTypeMarker>::borrow(&self.civil_time),
1455                    <CivilToAbsoluteTimeOptions as fidl::encoding::ValueTypeMarker>::borrow(
1456                        &self.options,
1457                    ),
1458                ),
1459                encoder,
1460                offset,
1461                _depth,
1462            )
1463        }
1464    }
1465    unsafe impl<
1466            D: fidl::encoding::ResourceDialect,
1467            T0: fidl::encoding::Encode<CivilTime, D>,
1468            T1: fidl::encoding::Encode<CivilToAbsoluteTimeOptions, D>,
1469        > fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeRequest, D> for (T0, T1)
1470    {
1471        #[inline]
1472        unsafe fn encode(
1473            self,
1474            encoder: &mut fidl::encoding::Encoder<'_, D>,
1475            offset: usize,
1476            depth: fidl::encoding::Depth,
1477        ) -> fidl::Result<()> {
1478            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeRequest>(offset);
1479            // Zero out padding regions. There's no need to apply masks
1480            // because the unmasked parts will be overwritten by fields.
1481            // Write the fields.
1482            self.0.encode(encoder, offset + 0, depth)?;
1483            self.1.encode(encoder, offset + 16, depth)?;
1484            Ok(())
1485        }
1486    }
1487
1488    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1489        for TimeZonesCivilToAbsoluteTimeRequest
1490    {
1491        #[inline(always)]
1492        fn new_empty() -> Self {
1493            Self {
1494                civil_time: fidl::new_empty!(CivilTime, D),
1495                options: fidl::new_empty!(CivilToAbsoluteTimeOptions, D),
1496            }
1497        }
1498
1499        #[inline]
1500        unsafe fn decode(
1501            &mut self,
1502            decoder: &mut fidl::encoding::Decoder<'_, D>,
1503            offset: usize,
1504            _depth: fidl::encoding::Depth,
1505        ) -> fidl::Result<()> {
1506            decoder.debug_check_bounds::<Self>(offset);
1507            // Verify that padding bytes are zero.
1508            fidl::decode!(CivilTime, D, &mut self.civil_time, decoder, offset + 0, _depth)?;
1509            fidl::decode!(
1510                CivilToAbsoluteTimeOptions,
1511                D,
1512                &mut self.options,
1513                decoder,
1514                offset + 16,
1515                _depth
1516            )?;
1517            Ok(())
1518        }
1519    }
1520
1521    impl fidl::encoding::ValueTypeMarker for TimeZonesGetTimeZoneInfoRequest {
1522        type Borrowed<'a> = &'a Self;
1523        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1524            value
1525        }
1526    }
1527
1528    unsafe impl fidl::encoding::TypeMarker for TimeZonesGetTimeZoneInfoRequest {
1529        type Owned = Self;
1530
1531        #[inline(always)]
1532        fn inline_align(_context: fidl::encoding::Context) -> usize {
1533            8
1534        }
1535
1536        #[inline(always)]
1537        fn inline_size(_context: fidl::encoding::Context) -> usize {
1538            24
1539        }
1540    }
1541
1542    unsafe impl<D: fidl::encoding::ResourceDialect>
1543        fidl::encoding::Encode<TimeZonesGetTimeZoneInfoRequest, D>
1544        for &TimeZonesGetTimeZoneInfoRequest
1545    {
1546        #[inline]
1547        unsafe fn encode(
1548            self,
1549            encoder: &mut fidl::encoding::Encoder<'_, D>,
1550            offset: usize,
1551            _depth: fidl::encoding::Depth,
1552        ) -> fidl::Result<()> {
1553            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoRequest>(offset);
1554            // Delegate to tuple encoding.
1555            fidl::encoding::Encode::<TimeZonesGetTimeZoneInfoRequest, D>::encode(
1556                (
1557                    <TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow(&self.time_zone_id),
1558                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.at_time),
1559                ),
1560                encoder,
1561                offset,
1562                _depth,
1563            )
1564        }
1565    }
1566    unsafe impl<
1567            D: fidl::encoding::ResourceDialect,
1568            T0: fidl::encoding::Encode<TimeZoneId, D>,
1569            T1: fidl::encoding::Encode<i64, D>,
1570        > fidl::encoding::Encode<TimeZonesGetTimeZoneInfoRequest, D> for (T0, T1)
1571    {
1572        #[inline]
1573        unsafe fn encode(
1574            self,
1575            encoder: &mut fidl::encoding::Encoder<'_, D>,
1576            offset: usize,
1577            depth: fidl::encoding::Depth,
1578        ) -> fidl::Result<()> {
1579            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoRequest>(offset);
1580            // Zero out padding regions. There's no need to apply masks
1581            // because the unmasked parts will be overwritten by fields.
1582            // Write the fields.
1583            self.0.encode(encoder, offset + 0, depth)?;
1584            self.1.encode(encoder, offset + 16, depth)?;
1585            Ok(())
1586        }
1587    }
1588
1589    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1590        for TimeZonesGetTimeZoneInfoRequest
1591    {
1592        #[inline(always)]
1593        fn new_empty() -> Self {
1594            Self {
1595                time_zone_id: fidl::new_empty!(TimeZoneId, D),
1596                at_time: fidl::new_empty!(i64, D),
1597            }
1598        }
1599
1600        #[inline]
1601        unsafe fn decode(
1602            &mut self,
1603            decoder: &mut fidl::encoding::Decoder<'_, D>,
1604            offset: usize,
1605            _depth: fidl::encoding::Depth,
1606        ) -> fidl::Result<()> {
1607            decoder.debug_check_bounds::<Self>(offset);
1608            // Verify that padding bytes are zero.
1609            fidl::decode!(TimeZoneId, D, &mut self.time_zone_id, decoder, offset + 0, _depth)?;
1610            fidl::decode!(i64, D, &mut self.at_time, decoder, offset + 16, _depth)?;
1611            Ok(())
1612        }
1613    }
1614
1615    impl fidl::encoding::ValueTypeMarker for TimeZonesAbsoluteToCivilTimeResponse {
1616        type Borrowed<'a> = &'a Self;
1617        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1618            value
1619        }
1620    }
1621
1622    unsafe impl fidl::encoding::TypeMarker for TimeZonesAbsoluteToCivilTimeResponse {
1623        type Owned = Self;
1624
1625        #[inline(always)]
1626        fn inline_align(_context: fidl::encoding::Context) -> usize {
1627            8
1628        }
1629
1630        #[inline(always)]
1631        fn inline_size(_context: fidl::encoding::Context) -> usize {
1632            16
1633        }
1634    }
1635
1636    unsafe impl<D: fidl::encoding::ResourceDialect>
1637        fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeResponse, D>
1638        for &TimeZonesAbsoluteToCivilTimeResponse
1639    {
1640        #[inline]
1641        unsafe fn encode(
1642            self,
1643            encoder: &mut fidl::encoding::Encoder<'_, D>,
1644            offset: usize,
1645            _depth: fidl::encoding::Depth,
1646        ) -> fidl::Result<()> {
1647            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeResponse>(offset);
1648            // Delegate to tuple encoding.
1649            fidl::encoding::Encode::<TimeZonesAbsoluteToCivilTimeResponse, D>::encode(
1650                (<CivilTime as fidl::encoding::ValueTypeMarker>::borrow(&self.civil_time),),
1651                encoder,
1652                offset,
1653                _depth,
1654            )
1655        }
1656    }
1657    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CivilTime, D>>
1658        fidl::encoding::Encode<TimeZonesAbsoluteToCivilTimeResponse, D> for (T0,)
1659    {
1660        #[inline]
1661        unsafe fn encode(
1662            self,
1663            encoder: &mut fidl::encoding::Encoder<'_, D>,
1664            offset: usize,
1665            depth: fidl::encoding::Depth,
1666        ) -> fidl::Result<()> {
1667            encoder.debug_check_bounds::<TimeZonesAbsoluteToCivilTimeResponse>(offset);
1668            // Zero out padding regions. There's no need to apply masks
1669            // because the unmasked parts will be overwritten by fields.
1670            // Write the fields.
1671            self.0.encode(encoder, offset + 0, depth)?;
1672            Ok(())
1673        }
1674    }
1675
1676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1677        for TimeZonesAbsoluteToCivilTimeResponse
1678    {
1679        #[inline(always)]
1680        fn new_empty() -> Self {
1681            Self { civil_time: fidl::new_empty!(CivilTime, D) }
1682        }
1683
1684        #[inline]
1685        unsafe fn decode(
1686            &mut self,
1687            decoder: &mut fidl::encoding::Decoder<'_, D>,
1688            offset: usize,
1689            _depth: fidl::encoding::Depth,
1690        ) -> fidl::Result<()> {
1691            decoder.debug_check_bounds::<Self>(offset);
1692            // Verify that padding bytes are zero.
1693            fidl::decode!(CivilTime, D, &mut self.civil_time, decoder, offset + 0, _depth)?;
1694            Ok(())
1695        }
1696    }
1697
1698    impl fidl::encoding::ValueTypeMarker for TimeZonesCivilToAbsoluteTimeResponse {
1699        type Borrowed<'a> = &'a Self;
1700        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1701            value
1702        }
1703    }
1704
1705    unsafe impl fidl::encoding::TypeMarker for TimeZonesCivilToAbsoluteTimeResponse {
1706        type Owned = Self;
1707
1708        #[inline(always)]
1709        fn inline_align(_context: fidl::encoding::Context) -> usize {
1710            8
1711        }
1712
1713        #[inline(always)]
1714        fn inline_size(_context: fidl::encoding::Context) -> usize {
1715            8
1716        }
1717        #[inline(always)]
1718        fn encode_is_copy() -> bool {
1719            true
1720        }
1721
1722        #[inline(always)]
1723        fn decode_is_copy() -> bool {
1724            true
1725        }
1726    }
1727
1728    unsafe impl<D: fidl::encoding::ResourceDialect>
1729        fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeResponse, D>
1730        for &TimeZonesCivilToAbsoluteTimeResponse
1731    {
1732        #[inline]
1733        unsafe fn encode(
1734            self,
1735            encoder: &mut fidl::encoding::Encoder<'_, D>,
1736            offset: usize,
1737            _depth: fidl::encoding::Depth,
1738        ) -> fidl::Result<()> {
1739            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeResponse>(offset);
1740            unsafe {
1741                // Copy the object into the buffer.
1742                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1743                (buf_ptr as *mut TimeZonesCivilToAbsoluteTimeResponse)
1744                    .write_unaligned((self as *const TimeZonesCivilToAbsoluteTimeResponse).read());
1745                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1746                // done second because the memcpy will write garbage to these bytes.
1747            }
1748            Ok(())
1749        }
1750    }
1751    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
1752        fidl::encoding::Encode<TimeZonesCivilToAbsoluteTimeResponse, D> for (T0,)
1753    {
1754        #[inline]
1755        unsafe fn encode(
1756            self,
1757            encoder: &mut fidl::encoding::Encoder<'_, D>,
1758            offset: usize,
1759            depth: fidl::encoding::Depth,
1760        ) -> fidl::Result<()> {
1761            encoder.debug_check_bounds::<TimeZonesCivilToAbsoluteTimeResponse>(offset);
1762            // Zero out padding regions. There's no need to apply masks
1763            // because the unmasked parts will be overwritten by fields.
1764            // Write the fields.
1765            self.0.encode(encoder, offset + 0, depth)?;
1766            Ok(())
1767        }
1768    }
1769
1770    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1771        for TimeZonesCivilToAbsoluteTimeResponse
1772    {
1773        #[inline(always)]
1774        fn new_empty() -> Self {
1775            Self { absolute_time: fidl::new_empty!(i64, D) }
1776        }
1777
1778        #[inline]
1779        unsafe fn decode(
1780            &mut self,
1781            decoder: &mut fidl::encoding::Decoder<'_, D>,
1782            offset: usize,
1783            _depth: fidl::encoding::Depth,
1784        ) -> fidl::Result<()> {
1785            decoder.debug_check_bounds::<Self>(offset);
1786            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1787            // Verify that padding bytes are zero.
1788            // Copy from the buffer into the object.
1789            unsafe {
1790                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1791            }
1792            Ok(())
1793        }
1794    }
1795
1796    impl fidl::encoding::ValueTypeMarker for TimeZonesGetTimeZoneInfoResponse {
1797        type Borrowed<'a> = &'a Self;
1798        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1799            value
1800        }
1801    }
1802
1803    unsafe impl fidl::encoding::TypeMarker for TimeZonesGetTimeZoneInfoResponse {
1804        type Owned = Self;
1805
1806        #[inline(always)]
1807        fn inline_align(_context: fidl::encoding::Context) -> usize {
1808            8
1809        }
1810
1811        #[inline(always)]
1812        fn inline_size(_context: fidl::encoding::Context) -> usize {
1813            16
1814        }
1815    }
1816
1817    unsafe impl<D: fidl::encoding::ResourceDialect>
1818        fidl::encoding::Encode<TimeZonesGetTimeZoneInfoResponse, D>
1819        for &TimeZonesGetTimeZoneInfoResponse
1820    {
1821        #[inline]
1822        unsafe fn encode(
1823            self,
1824            encoder: &mut fidl::encoding::Encoder<'_, D>,
1825            offset: usize,
1826            _depth: fidl::encoding::Depth,
1827        ) -> fidl::Result<()> {
1828            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoResponse>(offset);
1829            // Delegate to tuple encoding.
1830            fidl::encoding::Encode::<TimeZonesGetTimeZoneInfoResponse, D>::encode(
1831                (<TimeZoneInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.time_zone_info),),
1832                encoder,
1833                offset,
1834                _depth,
1835            )
1836        }
1837    }
1838    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TimeZoneInfo, D>>
1839        fidl::encoding::Encode<TimeZonesGetTimeZoneInfoResponse, D> for (T0,)
1840    {
1841        #[inline]
1842        unsafe fn encode(
1843            self,
1844            encoder: &mut fidl::encoding::Encoder<'_, D>,
1845            offset: usize,
1846            depth: fidl::encoding::Depth,
1847        ) -> fidl::Result<()> {
1848            encoder.debug_check_bounds::<TimeZonesGetTimeZoneInfoResponse>(offset);
1849            // Zero out padding regions. There's no need to apply masks
1850            // because the unmasked parts will be overwritten by fields.
1851            // Write the fields.
1852            self.0.encode(encoder, offset + 0, depth)?;
1853            Ok(())
1854        }
1855    }
1856
1857    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1858        for TimeZonesGetTimeZoneInfoResponse
1859    {
1860        #[inline(always)]
1861        fn new_empty() -> Self {
1862            Self { time_zone_info: fidl::new_empty!(TimeZoneInfo, D) }
1863        }
1864
1865        #[inline]
1866        unsafe fn decode(
1867            &mut self,
1868            decoder: &mut fidl::encoding::Decoder<'_, D>,
1869            offset: usize,
1870            _depth: fidl::encoding::Depth,
1871        ) -> fidl::Result<()> {
1872            decoder.debug_check_bounds::<Self>(offset);
1873            // Verify that padding bytes are zero.
1874            fidl::decode!(TimeZoneInfo, D, &mut self.time_zone_info, decoder, offset + 0, _depth)?;
1875            Ok(())
1876        }
1877    }
1878
1879    impl CivilTime {
1880        #[inline(always)]
1881        fn max_ordinal_present(&self) -> u64 {
1882            if let Some(_) = self.time_zone_id {
1883                return 10;
1884            }
1885            if let Some(_) = self.year_day {
1886                return 9;
1887            }
1888            if let Some(_) = self.weekday {
1889                return 8;
1890            }
1891            if let Some(_) = self.nanos {
1892                return 7;
1893            }
1894            if let Some(_) = self.second {
1895                return 6;
1896            }
1897            if let Some(_) = self.minute {
1898                return 5;
1899            }
1900            if let Some(_) = self.hour {
1901                return 4;
1902            }
1903            if let Some(_) = self.day {
1904                return 3;
1905            }
1906            if let Some(_) = self.month {
1907                return 2;
1908            }
1909            if let Some(_) = self.year {
1910                return 1;
1911            }
1912            0
1913        }
1914    }
1915
1916    impl fidl::encoding::ValueTypeMarker for CivilTime {
1917        type Borrowed<'a> = &'a Self;
1918        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1919            value
1920        }
1921    }
1922
1923    unsafe impl fidl::encoding::TypeMarker for CivilTime {
1924        type Owned = Self;
1925
1926        #[inline(always)]
1927        fn inline_align(_context: fidl::encoding::Context) -> usize {
1928            8
1929        }
1930
1931        #[inline(always)]
1932        fn inline_size(_context: fidl::encoding::Context) -> usize {
1933            16
1934        }
1935    }
1936
1937    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CivilTime, D>
1938        for &CivilTime
1939    {
1940        unsafe fn encode(
1941            self,
1942            encoder: &mut fidl::encoding::Encoder<'_, D>,
1943            offset: usize,
1944            mut depth: fidl::encoding::Depth,
1945        ) -> fidl::Result<()> {
1946            encoder.debug_check_bounds::<CivilTime>(offset);
1947            // Vector header
1948            let max_ordinal: u64 = self.max_ordinal_present();
1949            encoder.write_num(max_ordinal, offset);
1950            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1951            // Calling encoder.out_of_line_offset(0) is not allowed.
1952            if max_ordinal == 0 {
1953                return Ok(());
1954            }
1955            depth.increment()?;
1956            let envelope_size = 8;
1957            let bytes_len = max_ordinal as usize * envelope_size;
1958            #[allow(unused_variables)]
1959            let offset = encoder.out_of_line_offset(bytes_len);
1960            let mut _prev_end_offset: usize = 0;
1961            if 1 > max_ordinal {
1962                return Ok(());
1963            }
1964
1965            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1966            // are envelope_size bytes.
1967            let cur_offset: usize = (1 - 1) * envelope_size;
1968
1969            // Zero reserved fields.
1970            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1971
1972            // Safety:
1973            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1974            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1975            //   envelope_size bytes, there is always sufficient room.
1976            fidl::encoding::encode_in_envelope_optional::<u16, D>(
1977                self.year.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
1978                encoder,
1979                offset + cur_offset,
1980                depth,
1981            )?;
1982
1983            _prev_end_offset = cur_offset + envelope_size;
1984            if 2 > max_ordinal {
1985                return Ok(());
1986            }
1987
1988            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1989            // are envelope_size bytes.
1990            let cur_offset: usize = (2 - 1) * envelope_size;
1991
1992            // Zero reserved fields.
1993            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1994
1995            // Safety:
1996            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1997            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1998            //   envelope_size bytes, there is always sufficient room.
1999            fidl::encoding::encode_in_envelope_optional::<Month, D>(
2000                self.month.as_ref().map(<Month as fidl::encoding::ValueTypeMarker>::borrow),
2001                encoder,
2002                offset + cur_offset,
2003                depth,
2004            )?;
2005
2006            _prev_end_offset = cur_offset + envelope_size;
2007            if 3 > max_ordinal {
2008                return Ok(());
2009            }
2010
2011            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2012            // are envelope_size bytes.
2013            let cur_offset: usize = (3 - 1) * envelope_size;
2014
2015            // Zero reserved fields.
2016            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2017
2018            // Safety:
2019            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2020            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2021            //   envelope_size bytes, there is always sufficient room.
2022            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2023                self.day.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2024                encoder,
2025                offset + cur_offset,
2026                depth,
2027            )?;
2028
2029            _prev_end_offset = cur_offset + envelope_size;
2030            if 4 > max_ordinal {
2031                return Ok(());
2032            }
2033
2034            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2035            // are envelope_size bytes.
2036            let cur_offset: usize = (4 - 1) * envelope_size;
2037
2038            // Zero reserved fields.
2039            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2040
2041            // Safety:
2042            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2043            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2044            //   envelope_size bytes, there is always sufficient room.
2045            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2046                self.hour.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2047                encoder,
2048                offset + cur_offset,
2049                depth,
2050            )?;
2051
2052            _prev_end_offset = cur_offset + envelope_size;
2053            if 5 > max_ordinal {
2054                return Ok(());
2055            }
2056
2057            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2058            // are envelope_size bytes.
2059            let cur_offset: usize = (5 - 1) * envelope_size;
2060
2061            // Zero reserved fields.
2062            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2063
2064            // Safety:
2065            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2066            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2067            //   envelope_size bytes, there is always sufficient room.
2068            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2069                self.minute.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2070                encoder,
2071                offset + cur_offset,
2072                depth,
2073            )?;
2074
2075            _prev_end_offset = cur_offset + envelope_size;
2076            if 6 > max_ordinal {
2077                return Ok(());
2078            }
2079
2080            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2081            // are envelope_size bytes.
2082            let cur_offset: usize = (6 - 1) * envelope_size;
2083
2084            // Zero reserved fields.
2085            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2086
2087            // Safety:
2088            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2089            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2090            //   envelope_size bytes, there is always sufficient room.
2091            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2092                self.second.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2093                encoder,
2094                offset + cur_offset,
2095                depth,
2096            )?;
2097
2098            _prev_end_offset = cur_offset + envelope_size;
2099            if 7 > max_ordinal {
2100                return Ok(());
2101            }
2102
2103            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2104            // are envelope_size bytes.
2105            let cur_offset: usize = (7 - 1) * envelope_size;
2106
2107            // Zero reserved fields.
2108            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2109
2110            // Safety:
2111            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2112            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2113            //   envelope_size bytes, there is always sufficient room.
2114            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2115                self.nanos.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2116                encoder,
2117                offset + cur_offset,
2118                depth,
2119            )?;
2120
2121            _prev_end_offset = cur_offset + envelope_size;
2122            if 8 > max_ordinal {
2123                return Ok(());
2124            }
2125
2126            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2127            // are envelope_size bytes.
2128            let cur_offset: usize = (8 - 1) * envelope_size;
2129
2130            // Zero reserved fields.
2131            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2132
2133            // Safety:
2134            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2135            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2136            //   envelope_size bytes, there is always sufficient room.
2137            fidl::encoding::encode_in_envelope_optional::<DayOfWeek, D>(
2138                self.weekday.as_ref().map(<DayOfWeek as fidl::encoding::ValueTypeMarker>::borrow),
2139                encoder,
2140                offset + cur_offset,
2141                depth,
2142            )?;
2143
2144            _prev_end_offset = cur_offset + envelope_size;
2145            if 9 > max_ordinal {
2146                return Ok(());
2147            }
2148
2149            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2150            // are envelope_size bytes.
2151            let cur_offset: usize = (9 - 1) * envelope_size;
2152
2153            // Zero reserved fields.
2154            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2155
2156            // Safety:
2157            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2158            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2159            //   envelope_size bytes, there is always sufficient room.
2160            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2161                self.year_day.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2162                encoder,
2163                offset + cur_offset,
2164                depth,
2165            )?;
2166
2167            _prev_end_offset = cur_offset + envelope_size;
2168            if 10 > max_ordinal {
2169                return Ok(());
2170            }
2171
2172            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2173            // are envelope_size bytes.
2174            let cur_offset: usize = (10 - 1) * envelope_size;
2175
2176            // Zero reserved fields.
2177            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2178
2179            // Safety:
2180            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2181            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2182            //   envelope_size bytes, there is always sufficient room.
2183            fidl::encoding::encode_in_envelope_optional::<TimeZoneId, D>(
2184                self.time_zone_id
2185                    .as_ref()
2186                    .map(<TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow),
2187                encoder,
2188                offset + cur_offset,
2189                depth,
2190            )?;
2191
2192            _prev_end_offset = cur_offset + envelope_size;
2193
2194            Ok(())
2195        }
2196    }
2197
2198    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CivilTime {
2199        #[inline(always)]
2200        fn new_empty() -> Self {
2201            Self::default()
2202        }
2203
2204        unsafe fn decode(
2205            &mut self,
2206            decoder: &mut fidl::encoding::Decoder<'_, D>,
2207            offset: usize,
2208            mut depth: fidl::encoding::Depth,
2209        ) -> fidl::Result<()> {
2210            decoder.debug_check_bounds::<Self>(offset);
2211            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2212                None => return Err(fidl::Error::NotNullable),
2213                Some(len) => len,
2214            };
2215            // Calling decoder.out_of_line_offset(0) is not allowed.
2216            if len == 0 {
2217                return Ok(());
2218            };
2219            depth.increment()?;
2220            let envelope_size = 8;
2221            let bytes_len = len * envelope_size;
2222            let offset = decoder.out_of_line_offset(bytes_len)?;
2223            // Decode the envelope for each type.
2224            let mut _next_ordinal_to_read = 0;
2225            let mut next_offset = offset;
2226            let end_offset = offset + bytes_len;
2227            _next_ordinal_to_read += 1;
2228            if next_offset >= end_offset {
2229                return Ok(());
2230            }
2231
2232            // Decode unknown envelopes for gaps in ordinals.
2233            while _next_ordinal_to_read < 1 {
2234                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2235                _next_ordinal_to_read += 1;
2236                next_offset += envelope_size;
2237            }
2238
2239            let next_out_of_line = decoder.next_out_of_line();
2240            let handles_before = decoder.remaining_handles();
2241            if let Some((inlined, num_bytes, num_handles)) =
2242                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2243            {
2244                let member_inline_size =
2245                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2246                if inlined != (member_inline_size <= 4) {
2247                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2248                }
2249                let inner_offset;
2250                let mut inner_depth = depth.clone();
2251                if inlined {
2252                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2253                    inner_offset = next_offset;
2254                } else {
2255                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2256                    inner_depth.increment()?;
2257                }
2258                let val_ref = self.year.get_or_insert_with(|| fidl::new_empty!(u16, D));
2259                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2260                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2261                {
2262                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2263                }
2264                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2265                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2266                }
2267            }
2268
2269            next_offset += envelope_size;
2270            _next_ordinal_to_read += 1;
2271            if next_offset >= end_offset {
2272                return Ok(());
2273            }
2274
2275            // Decode unknown envelopes for gaps in ordinals.
2276            while _next_ordinal_to_read < 2 {
2277                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2278                _next_ordinal_to_read += 1;
2279                next_offset += envelope_size;
2280            }
2281
2282            let next_out_of_line = decoder.next_out_of_line();
2283            let handles_before = decoder.remaining_handles();
2284            if let Some((inlined, num_bytes, num_handles)) =
2285                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2286            {
2287                let member_inline_size =
2288                    <Month as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2289                if inlined != (member_inline_size <= 4) {
2290                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2291                }
2292                let inner_offset;
2293                let mut inner_depth = depth.clone();
2294                if inlined {
2295                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2296                    inner_offset = next_offset;
2297                } else {
2298                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2299                    inner_depth.increment()?;
2300                }
2301                let val_ref = self.month.get_or_insert_with(|| fidl::new_empty!(Month, D));
2302                fidl::decode!(Month, D, val_ref, decoder, inner_offset, inner_depth)?;
2303                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2304                {
2305                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2306                }
2307                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2308                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2309                }
2310            }
2311
2312            next_offset += envelope_size;
2313            _next_ordinal_to_read += 1;
2314            if next_offset >= end_offset {
2315                return Ok(());
2316            }
2317
2318            // Decode unknown envelopes for gaps in ordinals.
2319            while _next_ordinal_to_read < 3 {
2320                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2321                _next_ordinal_to_read += 1;
2322                next_offset += envelope_size;
2323            }
2324
2325            let next_out_of_line = decoder.next_out_of_line();
2326            let handles_before = decoder.remaining_handles();
2327            if let Some((inlined, num_bytes, num_handles)) =
2328                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2329            {
2330                let member_inline_size =
2331                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2332                if inlined != (member_inline_size <= 4) {
2333                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2334                }
2335                let inner_offset;
2336                let mut inner_depth = depth.clone();
2337                if inlined {
2338                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2339                    inner_offset = next_offset;
2340                } else {
2341                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2342                    inner_depth.increment()?;
2343                }
2344                let val_ref = self.day.get_or_insert_with(|| fidl::new_empty!(u8, D));
2345                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2346                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2347                {
2348                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2349                }
2350                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2351                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2352                }
2353            }
2354
2355            next_offset += envelope_size;
2356            _next_ordinal_to_read += 1;
2357            if next_offset >= end_offset {
2358                return Ok(());
2359            }
2360
2361            // Decode unknown envelopes for gaps in ordinals.
2362            while _next_ordinal_to_read < 4 {
2363                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2364                _next_ordinal_to_read += 1;
2365                next_offset += envelope_size;
2366            }
2367
2368            let next_out_of_line = decoder.next_out_of_line();
2369            let handles_before = decoder.remaining_handles();
2370            if let Some((inlined, num_bytes, num_handles)) =
2371                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2372            {
2373                let member_inline_size =
2374                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2375                if inlined != (member_inline_size <= 4) {
2376                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2377                }
2378                let inner_offset;
2379                let mut inner_depth = depth.clone();
2380                if inlined {
2381                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2382                    inner_offset = next_offset;
2383                } else {
2384                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2385                    inner_depth.increment()?;
2386                }
2387                let val_ref = self.hour.get_or_insert_with(|| fidl::new_empty!(u8, D));
2388                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2389                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2390                {
2391                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2392                }
2393                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2394                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2395                }
2396            }
2397
2398            next_offset += envelope_size;
2399            _next_ordinal_to_read += 1;
2400            if next_offset >= end_offset {
2401                return Ok(());
2402            }
2403
2404            // Decode unknown envelopes for gaps in ordinals.
2405            while _next_ordinal_to_read < 5 {
2406                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2407                _next_ordinal_to_read += 1;
2408                next_offset += envelope_size;
2409            }
2410
2411            let next_out_of_line = decoder.next_out_of_line();
2412            let handles_before = decoder.remaining_handles();
2413            if let Some((inlined, num_bytes, num_handles)) =
2414                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2415            {
2416                let member_inline_size =
2417                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2418                if inlined != (member_inline_size <= 4) {
2419                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2420                }
2421                let inner_offset;
2422                let mut inner_depth = depth.clone();
2423                if inlined {
2424                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2425                    inner_offset = next_offset;
2426                } else {
2427                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2428                    inner_depth.increment()?;
2429                }
2430                let val_ref = self.minute.get_or_insert_with(|| fidl::new_empty!(u8, D));
2431                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2432                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2433                {
2434                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2435                }
2436                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2437                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2438                }
2439            }
2440
2441            next_offset += envelope_size;
2442            _next_ordinal_to_read += 1;
2443            if next_offset >= end_offset {
2444                return Ok(());
2445            }
2446
2447            // Decode unknown envelopes for gaps in ordinals.
2448            while _next_ordinal_to_read < 6 {
2449                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2450                _next_ordinal_to_read += 1;
2451                next_offset += envelope_size;
2452            }
2453
2454            let next_out_of_line = decoder.next_out_of_line();
2455            let handles_before = decoder.remaining_handles();
2456            if let Some((inlined, num_bytes, num_handles)) =
2457                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2458            {
2459                let member_inline_size =
2460                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2461                if inlined != (member_inline_size <= 4) {
2462                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2463                }
2464                let inner_offset;
2465                let mut inner_depth = depth.clone();
2466                if inlined {
2467                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2468                    inner_offset = next_offset;
2469                } else {
2470                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2471                    inner_depth.increment()?;
2472                }
2473                let val_ref = self.second.get_or_insert_with(|| fidl::new_empty!(u8, D));
2474                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2475                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2476                {
2477                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2478                }
2479                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2480                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2481                }
2482            }
2483
2484            next_offset += envelope_size;
2485            _next_ordinal_to_read += 1;
2486            if next_offset >= end_offset {
2487                return Ok(());
2488            }
2489
2490            // Decode unknown envelopes for gaps in ordinals.
2491            while _next_ordinal_to_read < 7 {
2492                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2493                _next_ordinal_to_read += 1;
2494                next_offset += envelope_size;
2495            }
2496
2497            let next_out_of_line = decoder.next_out_of_line();
2498            let handles_before = decoder.remaining_handles();
2499            if let Some((inlined, num_bytes, num_handles)) =
2500                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2501            {
2502                let member_inline_size =
2503                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2504                if inlined != (member_inline_size <= 4) {
2505                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2506                }
2507                let inner_offset;
2508                let mut inner_depth = depth.clone();
2509                if inlined {
2510                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2511                    inner_offset = next_offset;
2512                } else {
2513                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2514                    inner_depth.increment()?;
2515                }
2516                let val_ref = self.nanos.get_or_insert_with(|| fidl::new_empty!(u64, D));
2517                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2518                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2519                {
2520                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2521                }
2522                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2523                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2524                }
2525            }
2526
2527            next_offset += envelope_size;
2528            _next_ordinal_to_read += 1;
2529            if next_offset >= end_offset {
2530                return Ok(());
2531            }
2532
2533            // Decode unknown envelopes for gaps in ordinals.
2534            while _next_ordinal_to_read < 8 {
2535                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2536                _next_ordinal_to_read += 1;
2537                next_offset += envelope_size;
2538            }
2539
2540            let next_out_of_line = decoder.next_out_of_line();
2541            let handles_before = decoder.remaining_handles();
2542            if let Some((inlined, num_bytes, num_handles)) =
2543                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2544            {
2545                let member_inline_size =
2546                    <DayOfWeek as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2547                if inlined != (member_inline_size <= 4) {
2548                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2549                }
2550                let inner_offset;
2551                let mut inner_depth = depth.clone();
2552                if inlined {
2553                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2554                    inner_offset = next_offset;
2555                } else {
2556                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2557                    inner_depth.increment()?;
2558                }
2559                let val_ref = self.weekday.get_or_insert_with(|| fidl::new_empty!(DayOfWeek, D));
2560                fidl::decode!(DayOfWeek, D, val_ref, decoder, inner_offset, inner_depth)?;
2561                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2562                {
2563                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2564                }
2565                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2566                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2567                }
2568            }
2569
2570            next_offset += envelope_size;
2571            _next_ordinal_to_read += 1;
2572            if next_offset >= end_offset {
2573                return Ok(());
2574            }
2575
2576            // Decode unknown envelopes for gaps in ordinals.
2577            while _next_ordinal_to_read < 9 {
2578                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2579                _next_ordinal_to_read += 1;
2580                next_offset += envelope_size;
2581            }
2582
2583            let next_out_of_line = decoder.next_out_of_line();
2584            let handles_before = decoder.remaining_handles();
2585            if let Some((inlined, num_bytes, num_handles)) =
2586                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2587            {
2588                let member_inline_size =
2589                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2590                if inlined != (member_inline_size <= 4) {
2591                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2592                }
2593                let inner_offset;
2594                let mut inner_depth = depth.clone();
2595                if inlined {
2596                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2597                    inner_offset = next_offset;
2598                } else {
2599                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2600                    inner_depth.increment()?;
2601                }
2602                let val_ref = self.year_day.get_or_insert_with(|| fidl::new_empty!(u16, D));
2603                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2604                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2605                {
2606                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2607                }
2608                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2609                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2610                }
2611            }
2612
2613            next_offset += envelope_size;
2614            _next_ordinal_to_read += 1;
2615            if next_offset >= end_offset {
2616                return Ok(());
2617            }
2618
2619            // Decode unknown envelopes for gaps in ordinals.
2620            while _next_ordinal_to_read < 10 {
2621                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2622                _next_ordinal_to_read += 1;
2623                next_offset += envelope_size;
2624            }
2625
2626            let next_out_of_line = decoder.next_out_of_line();
2627            let handles_before = decoder.remaining_handles();
2628            if let Some((inlined, num_bytes, num_handles)) =
2629                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2630            {
2631                let member_inline_size =
2632                    <TimeZoneId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2633                if inlined != (member_inline_size <= 4) {
2634                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2635                }
2636                let inner_offset;
2637                let mut inner_depth = depth.clone();
2638                if inlined {
2639                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2640                    inner_offset = next_offset;
2641                } else {
2642                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2643                    inner_depth.increment()?;
2644                }
2645                let val_ref =
2646                    self.time_zone_id.get_or_insert_with(|| fidl::new_empty!(TimeZoneId, D));
2647                fidl::decode!(TimeZoneId, D, val_ref, decoder, inner_offset, inner_depth)?;
2648                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2649                {
2650                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2651                }
2652                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2653                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2654                }
2655            }
2656
2657            next_offset += envelope_size;
2658
2659            // Decode the remaining unknown envelopes.
2660            while next_offset < end_offset {
2661                _next_ordinal_to_read += 1;
2662                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2663                next_offset += envelope_size;
2664            }
2665
2666            Ok(())
2667        }
2668    }
2669
2670    impl CivilToAbsoluteTimeOptions {
2671        #[inline(always)]
2672        fn max_ordinal_present(&self) -> u64 {
2673            if let Some(_) = self.skipped_time_conversion {
2674                return 2;
2675            }
2676            if let Some(_) = self.repeated_time_conversion {
2677                return 1;
2678            }
2679            0
2680        }
2681    }
2682
2683    impl fidl::encoding::ValueTypeMarker for CivilToAbsoluteTimeOptions {
2684        type Borrowed<'a> = &'a Self;
2685        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2686            value
2687        }
2688    }
2689
2690    unsafe impl fidl::encoding::TypeMarker for CivilToAbsoluteTimeOptions {
2691        type Owned = Self;
2692
2693        #[inline(always)]
2694        fn inline_align(_context: fidl::encoding::Context) -> usize {
2695            8
2696        }
2697
2698        #[inline(always)]
2699        fn inline_size(_context: fidl::encoding::Context) -> usize {
2700            16
2701        }
2702    }
2703
2704    unsafe impl<D: fidl::encoding::ResourceDialect>
2705        fidl::encoding::Encode<CivilToAbsoluteTimeOptions, D> for &CivilToAbsoluteTimeOptions
2706    {
2707        unsafe fn encode(
2708            self,
2709            encoder: &mut fidl::encoding::Encoder<'_, D>,
2710            offset: usize,
2711            mut depth: fidl::encoding::Depth,
2712        ) -> fidl::Result<()> {
2713            encoder.debug_check_bounds::<CivilToAbsoluteTimeOptions>(offset);
2714            // Vector header
2715            let max_ordinal: u64 = self.max_ordinal_present();
2716            encoder.write_num(max_ordinal, offset);
2717            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2718            // Calling encoder.out_of_line_offset(0) is not allowed.
2719            if max_ordinal == 0 {
2720                return Ok(());
2721            }
2722            depth.increment()?;
2723            let envelope_size = 8;
2724            let bytes_len = max_ordinal as usize * envelope_size;
2725            #[allow(unused_variables)]
2726            let offset = encoder.out_of_line_offset(bytes_len);
2727            let mut _prev_end_offset: usize = 0;
2728            if 1 > max_ordinal {
2729                return Ok(());
2730            }
2731
2732            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2733            // are envelope_size bytes.
2734            let cur_offset: usize = (1 - 1) * envelope_size;
2735
2736            // Zero reserved fields.
2737            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2738
2739            // Safety:
2740            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2741            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2742            //   envelope_size bytes, there is always sufficient room.
2743            fidl::encoding::encode_in_envelope_optional::<RepeatedTimeConversion, D>(
2744                self.repeated_time_conversion
2745                    .as_ref()
2746                    .map(<RepeatedTimeConversion as fidl::encoding::ValueTypeMarker>::borrow),
2747                encoder,
2748                offset + cur_offset,
2749                depth,
2750            )?;
2751
2752            _prev_end_offset = cur_offset + envelope_size;
2753            if 2 > max_ordinal {
2754                return Ok(());
2755            }
2756
2757            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2758            // are envelope_size bytes.
2759            let cur_offset: usize = (2 - 1) * envelope_size;
2760
2761            // Zero reserved fields.
2762            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2763
2764            // Safety:
2765            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2766            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2767            //   envelope_size bytes, there is always sufficient room.
2768            fidl::encoding::encode_in_envelope_optional::<SkippedTimeConversion, D>(
2769                self.skipped_time_conversion
2770                    .as_ref()
2771                    .map(<SkippedTimeConversion as fidl::encoding::ValueTypeMarker>::borrow),
2772                encoder,
2773                offset + cur_offset,
2774                depth,
2775            )?;
2776
2777            _prev_end_offset = cur_offset + envelope_size;
2778
2779            Ok(())
2780        }
2781    }
2782
2783    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2784        for CivilToAbsoluteTimeOptions
2785    {
2786        #[inline(always)]
2787        fn new_empty() -> Self {
2788            Self::default()
2789        }
2790
2791        unsafe fn decode(
2792            &mut self,
2793            decoder: &mut fidl::encoding::Decoder<'_, D>,
2794            offset: usize,
2795            mut depth: fidl::encoding::Depth,
2796        ) -> fidl::Result<()> {
2797            decoder.debug_check_bounds::<Self>(offset);
2798            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2799                None => return Err(fidl::Error::NotNullable),
2800                Some(len) => len,
2801            };
2802            // Calling decoder.out_of_line_offset(0) is not allowed.
2803            if len == 0 {
2804                return Ok(());
2805            };
2806            depth.increment()?;
2807            let envelope_size = 8;
2808            let bytes_len = len * envelope_size;
2809            let offset = decoder.out_of_line_offset(bytes_len)?;
2810            // Decode the envelope for each type.
2811            let mut _next_ordinal_to_read = 0;
2812            let mut next_offset = offset;
2813            let end_offset = offset + bytes_len;
2814            _next_ordinal_to_read += 1;
2815            if next_offset >= end_offset {
2816                return Ok(());
2817            }
2818
2819            // Decode unknown envelopes for gaps in ordinals.
2820            while _next_ordinal_to_read < 1 {
2821                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2822                _next_ordinal_to_read += 1;
2823                next_offset += envelope_size;
2824            }
2825
2826            let next_out_of_line = decoder.next_out_of_line();
2827            let handles_before = decoder.remaining_handles();
2828            if let Some((inlined, num_bytes, num_handles)) =
2829                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2830            {
2831                let member_inline_size =
2832                    <RepeatedTimeConversion as fidl::encoding::TypeMarker>::inline_size(
2833                        decoder.context,
2834                    );
2835                if inlined != (member_inline_size <= 4) {
2836                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2837                }
2838                let inner_offset;
2839                let mut inner_depth = depth.clone();
2840                if inlined {
2841                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2842                    inner_offset = next_offset;
2843                } else {
2844                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2845                    inner_depth.increment()?;
2846                }
2847                let val_ref = self
2848                    .repeated_time_conversion
2849                    .get_or_insert_with(|| fidl::new_empty!(RepeatedTimeConversion, D));
2850                fidl::decode!(
2851                    RepeatedTimeConversion,
2852                    D,
2853                    val_ref,
2854                    decoder,
2855                    inner_offset,
2856                    inner_depth
2857                )?;
2858                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2859                {
2860                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2861                }
2862                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2863                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2864                }
2865            }
2866
2867            next_offset += envelope_size;
2868            _next_ordinal_to_read += 1;
2869            if next_offset >= end_offset {
2870                return Ok(());
2871            }
2872
2873            // Decode unknown envelopes for gaps in ordinals.
2874            while _next_ordinal_to_read < 2 {
2875                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2876                _next_ordinal_to_read += 1;
2877                next_offset += envelope_size;
2878            }
2879
2880            let next_out_of_line = decoder.next_out_of_line();
2881            let handles_before = decoder.remaining_handles();
2882            if let Some((inlined, num_bytes, num_handles)) =
2883                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2884            {
2885                let member_inline_size =
2886                    <SkippedTimeConversion as fidl::encoding::TypeMarker>::inline_size(
2887                        decoder.context,
2888                    );
2889                if inlined != (member_inline_size <= 4) {
2890                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2891                }
2892                let inner_offset;
2893                let mut inner_depth = depth.clone();
2894                if inlined {
2895                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2896                    inner_offset = next_offset;
2897                } else {
2898                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2899                    inner_depth.increment()?;
2900                }
2901                let val_ref = self
2902                    .skipped_time_conversion
2903                    .get_or_insert_with(|| fidl::new_empty!(SkippedTimeConversion, D));
2904                fidl::decode!(
2905                    SkippedTimeConversion,
2906                    D,
2907                    val_ref,
2908                    decoder,
2909                    inner_offset,
2910                    inner_depth
2911                )?;
2912                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2913                {
2914                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2915                }
2916                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2917                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2918                }
2919            }
2920
2921            next_offset += envelope_size;
2922
2923            // Decode the remaining unknown envelopes.
2924            while next_offset < end_offset {
2925                _next_ordinal_to_read += 1;
2926                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2927                next_offset += envelope_size;
2928            }
2929
2930            Ok(())
2931        }
2932    }
2933
2934    impl Profile {
2935        #[inline(always)]
2936        fn max_ordinal_present(&self) -> u64 {
2937            if let Some(_) = self.temperature_unit {
2938                return 4;
2939            }
2940            if let Some(_) = self.time_zones {
2941                return 3;
2942            }
2943            if let Some(_) = self.calendars {
2944                return 2;
2945            }
2946            if let Some(_) = self.locales {
2947                return 1;
2948            }
2949            0
2950        }
2951    }
2952
2953    impl fidl::encoding::ValueTypeMarker for Profile {
2954        type Borrowed<'a> = &'a Self;
2955        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2956            value
2957        }
2958    }
2959
2960    unsafe impl fidl::encoding::TypeMarker for Profile {
2961        type Owned = Self;
2962
2963        #[inline(always)]
2964        fn inline_align(_context: fidl::encoding::Context) -> usize {
2965            8
2966        }
2967
2968        #[inline(always)]
2969        fn inline_size(_context: fidl::encoding::Context) -> usize {
2970            16
2971        }
2972    }
2973
2974    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Profile, D> for &Profile {
2975        unsafe fn encode(
2976            self,
2977            encoder: &mut fidl::encoding::Encoder<'_, D>,
2978            offset: usize,
2979            mut depth: fidl::encoding::Depth,
2980        ) -> fidl::Result<()> {
2981            encoder.debug_check_bounds::<Profile>(offset);
2982            // Vector header
2983            let max_ordinal: u64 = self.max_ordinal_present();
2984            encoder.write_num(max_ordinal, offset);
2985            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2986            // Calling encoder.out_of_line_offset(0) is not allowed.
2987            if max_ordinal == 0 {
2988                return Ok(());
2989            }
2990            depth.increment()?;
2991            let envelope_size = 8;
2992            let bytes_len = max_ordinal as usize * envelope_size;
2993            #[allow(unused_variables)]
2994            let offset = encoder.out_of_line_offset(bytes_len);
2995            let mut _prev_end_offset: usize = 0;
2996            if 1 > max_ordinal {
2997                return Ok(());
2998            }
2999
3000            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3001            // are envelope_size bytes.
3002            let cur_offset: usize = (1 - 1) * envelope_size;
3003
3004            // Zero reserved fields.
3005            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3006
3007            // Safety:
3008            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3009            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3010            //   envelope_size bytes, there is always sufficient room.
3011            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<LocaleId>, D>(
3012            self.locales.as_ref().map(<fidl::encoding::UnboundedVector<LocaleId> as fidl::encoding::ValueTypeMarker>::borrow),
3013            encoder, offset + cur_offset, depth
3014        )?;
3015
3016            _prev_end_offset = cur_offset + envelope_size;
3017            if 2 > max_ordinal {
3018                return Ok(());
3019            }
3020
3021            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3022            // are envelope_size bytes.
3023            let cur_offset: usize = (2 - 1) * envelope_size;
3024
3025            // Zero reserved fields.
3026            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3027
3028            // Safety:
3029            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3030            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3031            //   envelope_size bytes, there is always sufficient room.
3032            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<CalendarId>, D>(
3033            self.calendars.as_ref().map(<fidl::encoding::UnboundedVector<CalendarId> as fidl::encoding::ValueTypeMarker>::borrow),
3034            encoder, offset + cur_offset, depth
3035        )?;
3036
3037            _prev_end_offset = cur_offset + envelope_size;
3038            if 3 > max_ordinal {
3039                return Ok(());
3040            }
3041
3042            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3043            // are envelope_size bytes.
3044            let cur_offset: usize = (3 - 1) * envelope_size;
3045
3046            // Zero reserved fields.
3047            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3048
3049            // Safety:
3050            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3051            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3052            //   envelope_size bytes, there is always sufficient room.
3053            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<TimeZoneId>, D>(
3054            self.time_zones.as_ref().map(<fidl::encoding::UnboundedVector<TimeZoneId> as fidl::encoding::ValueTypeMarker>::borrow),
3055            encoder, offset + cur_offset, depth
3056        )?;
3057
3058            _prev_end_offset = cur_offset + envelope_size;
3059            if 4 > max_ordinal {
3060                return Ok(());
3061            }
3062
3063            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3064            // are envelope_size bytes.
3065            let cur_offset: usize = (4 - 1) * envelope_size;
3066
3067            // Zero reserved fields.
3068            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3069
3070            // Safety:
3071            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3072            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3073            //   envelope_size bytes, there is always sufficient room.
3074            fidl::encoding::encode_in_envelope_optional::<TemperatureUnit, D>(
3075                self.temperature_unit
3076                    .as_ref()
3077                    .map(<TemperatureUnit as fidl::encoding::ValueTypeMarker>::borrow),
3078                encoder,
3079                offset + cur_offset,
3080                depth,
3081            )?;
3082
3083            _prev_end_offset = cur_offset + envelope_size;
3084
3085            Ok(())
3086        }
3087    }
3088
3089    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Profile {
3090        #[inline(always)]
3091        fn new_empty() -> Self {
3092            Self::default()
3093        }
3094
3095        unsafe fn decode(
3096            &mut self,
3097            decoder: &mut fidl::encoding::Decoder<'_, D>,
3098            offset: usize,
3099            mut depth: fidl::encoding::Depth,
3100        ) -> fidl::Result<()> {
3101            decoder.debug_check_bounds::<Self>(offset);
3102            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3103                None => return Err(fidl::Error::NotNullable),
3104                Some(len) => len,
3105            };
3106            // Calling decoder.out_of_line_offset(0) is not allowed.
3107            if len == 0 {
3108                return Ok(());
3109            };
3110            depth.increment()?;
3111            let envelope_size = 8;
3112            let bytes_len = len * envelope_size;
3113            let offset = decoder.out_of_line_offset(bytes_len)?;
3114            // Decode the envelope for each type.
3115            let mut _next_ordinal_to_read = 0;
3116            let mut next_offset = offset;
3117            let end_offset = offset + bytes_len;
3118            _next_ordinal_to_read += 1;
3119            if next_offset >= end_offset {
3120                return Ok(());
3121            }
3122
3123            // Decode unknown envelopes for gaps in ordinals.
3124            while _next_ordinal_to_read < 1 {
3125                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3126                _next_ordinal_to_read += 1;
3127                next_offset += envelope_size;
3128            }
3129
3130            let next_out_of_line = decoder.next_out_of_line();
3131            let handles_before = decoder.remaining_handles();
3132            if let Some((inlined, num_bytes, num_handles)) =
3133                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3134            {
3135                let member_inline_size = <fidl::encoding::UnboundedVector<LocaleId> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3136                if inlined != (member_inline_size <= 4) {
3137                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3138                }
3139                let inner_offset;
3140                let mut inner_depth = depth.clone();
3141                if inlined {
3142                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3143                    inner_offset = next_offset;
3144                } else {
3145                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3146                    inner_depth.increment()?;
3147                }
3148                let val_ref = self.locales.get_or_insert_with(|| {
3149                    fidl::new_empty!(fidl::encoding::UnboundedVector<LocaleId>, D)
3150                });
3151                fidl::decode!(
3152                    fidl::encoding::UnboundedVector<LocaleId>,
3153                    D,
3154                    val_ref,
3155                    decoder,
3156                    inner_offset,
3157                    inner_depth
3158                )?;
3159                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3160                {
3161                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3162                }
3163                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3164                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3165                }
3166            }
3167
3168            next_offset += envelope_size;
3169            _next_ordinal_to_read += 1;
3170            if next_offset >= end_offset {
3171                return Ok(());
3172            }
3173
3174            // Decode unknown envelopes for gaps in ordinals.
3175            while _next_ordinal_to_read < 2 {
3176                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3177                _next_ordinal_to_read += 1;
3178                next_offset += envelope_size;
3179            }
3180
3181            let next_out_of_line = decoder.next_out_of_line();
3182            let handles_before = decoder.remaining_handles();
3183            if let Some((inlined, num_bytes, num_handles)) =
3184                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3185            {
3186                let member_inline_size = <fidl::encoding::UnboundedVector<CalendarId> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3187                if inlined != (member_inline_size <= 4) {
3188                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3189                }
3190                let inner_offset;
3191                let mut inner_depth = depth.clone();
3192                if inlined {
3193                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3194                    inner_offset = next_offset;
3195                } else {
3196                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3197                    inner_depth.increment()?;
3198                }
3199                let val_ref = self.calendars.get_or_insert_with(|| {
3200                    fidl::new_empty!(fidl::encoding::UnboundedVector<CalendarId>, D)
3201                });
3202                fidl::decode!(
3203                    fidl::encoding::UnboundedVector<CalendarId>,
3204                    D,
3205                    val_ref,
3206                    decoder,
3207                    inner_offset,
3208                    inner_depth
3209                )?;
3210                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3211                {
3212                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3213                }
3214                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3215                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3216                }
3217            }
3218
3219            next_offset += envelope_size;
3220            _next_ordinal_to_read += 1;
3221            if next_offset >= end_offset {
3222                return Ok(());
3223            }
3224
3225            // Decode unknown envelopes for gaps in ordinals.
3226            while _next_ordinal_to_read < 3 {
3227                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3228                _next_ordinal_to_read += 1;
3229                next_offset += envelope_size;
3230            }
3231
3232            let next_out_of_line = decoder.next_out_of_line();
3233            let handles_before = decoder.remaining_handles();
3234            if let Some((inlined, num_bytes, num_handles)) =
3235                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3236            {
3237                let member_inline_size = <fidl::encoding::UnboundedVector<TimeZoneId> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3238                if inlined != (member_inline_size <= 4) {
3239                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3240                }
3241                let inner_offset;
3242                let mut inner_depth = depth.clone();
3243                if inlined {
3244                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3245                    inner_offset = next_offset;
3246                } else {
3247                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3248                    inner_depth.increment()?;
3249                }
3250                let val_ref = self.time_zones.get_or_insert_with(|| {
3251                    fidl::new_empty!(fidl::encoding::UnboundedVector<TimeZoneId>, D)
3252                });
3253                fidl::decode!(
3254                    fidl::encoding::UnboundedVector<TimeZoneId>,
3255                    D,
3256                    val_ref,
3257                    decoder,
3258                    inner_offset,
3259                    inner_depth
3260                )?;
3261                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3262                {
3263                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3264                }
3265                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3266                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3267                }
3268            }
3269
3270            next_offset += envelope_size;
3271            _next_ordinal_to_read += 1;
3272            if next_offset >= end_offset {
3273                return Ok(());
3274            }
3275
3276            // Decode unknown envelopes for gaps in ordinals.
3277            while _next_ordinal_to_read < 4 {
3278                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3279                _next_ordinal_to_read += 1;
3280                next_offset += envelope_size;
3281            }
3282
3283            let next_out_of_line = decoder.next_out_of_line();
3284            let handles_before = decoder.remaining_handles();
3285            if let Some((inlined, num_bytes, num_handles)) =
3286                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3287            {
3288                let member_inline_size =
3289                    <TemperatureUnit as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3290                if inlined != (member_inline_size <= 4) {
3291                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3292                }
3293                let inner_offset;
3294                let mut inner_depth = depth.clone();
3295                if inlined {
3296                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3297                    inner_offset = next_offset;
3298                } else {
3299                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3300                    inner_depth.increment()?;
3301                }
3302                let val_ref = self
3303                    .temperature_unit
3304                    .get_or_insert_with(|| fidl::new_empty!(TemperatureUnit, D));
3305                fidl::decode!(TemperatureUnit, D, val_ref, decoder, inner_offset, inner_depth)?;
3306                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3307                {
3308                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3309                }
3310                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3311                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3312                }
3313            }
3314
3315            next_offset += envelope_size;
3316
3317            // Decode the remaining unknown envelopes.
3318            while next_offset < end_offset {
3319                _next_ordinal_to_read += 1;
3320                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3321                next_offset += envelope_size;
3322            }
3323
3324            Ok(())
3325        }
3326    }
3327
3328    impl RegulatoryDomain {
3329        #[inline(always)]
3330        fn max_ordinal_present(&self) -> u64 {
3331            if let Some(_) = self.country_code {
3332                return 1;
3333            }
3334            0
3335        }
3336    }
3337
3338    impl fidl::encoding::ValueTypeMarker for RegulatoryDomain {
3339        type Borrowed<'a> = &'a Self;
3340        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3341            value
3342        }
3343    }
3344
3345    unsafe impl fidl::encoding::TypeMarker for RegulatoryDomain {
3346        type Owned = Self;
3347
3348        #[inline(always)]
3349        fn inline_align(_context: fidl::encoding::Context) -> usize {
3350            8
3351        }
3352
3353        #[inline(always)]
3354        fn inline_size(_context: fidl::encoding::Context) -> usize {
3355            16
3356        }
3357    }
3358
3359    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RegulatoryDomain, D>
3360        for &RegulatoryDomain
3361    {
3362        unsafe fn encode(
3363            self,
3364            encoder: &mut fidl::encoding::Encoder<'_, D>,
3365            offset: usize,
3366            mut depth: fidl::encoding::Depth,
3367        ) -> fidl::Result<()> {
3368            encoder.debug_check_bounds::<RegulatoryDomain>(offset);
3369            // Vector header
3370            let max_ordinal: u64 = self.max_ordinal_present();
3371            encoder.write_num(max_ordinal, offset);
3372            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3373            // Calling encoder.out_of_line_offset(0) is not allowed.
3374            if max_ordinal == 0 {
3375                return Ok(());
3376            }
3377            depth.increment()?;
3378            let envelope_size = 8;
3379            let bytes_len = max_ordinal as usize * envelope_size;
3380            #[allow(unused_variables)]
3381            let offset = encoder.out_of_line_offset(bytes_len);
3382            let mut _prev_end_offset: usize = 0;
3383            if 1 > max_ordinal {
3384                return Ok(());
3385            }
3386
3387            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3388            // are envelope_size bytes.
3389            let cur_offset: usize = (1 - 1) * envelope_size;
3390
3391            // Zero reserved fields.
3392            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3393
3394            // Safety:
3395            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3396            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3397            //   envelope_size bytes, there is always sufficient room.
3398            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
3399                self.country_code.as_ref().map(
3400                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3401                ),
3402                encoder,
3403                offset + cur_offset,
3404                depth,
3405            )?;
3406
3407            _prev_end_offset = cur_offset + envelope_size;
3408
3409            Ok(())
3410        }
3411    }
3412
3413    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RegulatoryDomain {
3414        #[inline(always)]
3415        fn new_empty() -> Self {
3416            Self::default()
3417        }
3418
3419        unsafe fn decode(
3420            &mut self,
3421            decoder: &mut fidl::encoding::Decoder<'_, D>,
3422            offset: usize,
3423            mut depth: fidl::encoding::Depth,
3424        ) -> fidl::Result<()> {
3425            decoder.debug_check_bounds::<Self>(offset);
3426            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3427                None => return Err(fidl::Error::NotNullable),
3428                Some(len) => len,
3429            };
3430            // Calling decoder.out_of_line_offset(0) is not allowed.
3431            if len == 0 {
3432                return Ok(());
3433            };
3434            depth.increment()?;
3435            let envelope_size = 8;
3436            let bytes_len = len * envelope_size;
3437            let offset = decoder.out_of_line_offset(bytes_len)?;
3438            // Decode the envelope for each type.
3439            let mut _next_ordinal_to_read = 0;
3440            let mut next_offset = offset;
3441            let end_offset = offset + bytes_len;
3442            _next_ordinal_to_read += 1;
3443            if next_offset >= end_offset {
3444                return Ok(());
3445            }
3446
3447            // Decode unknown envelopes for gaps in ordinals.
3448            while _next_ordinal_to_read < 1 {
3449                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3450                _next_ordinal_to_read += 1;
3451                next_offset += envelope_size;
3452            }
3453
3454            let next_out_of_line = decoder.next_out_of_line();
3455            let handles_before = decoder.remaining_handles();
3456            if let Some((inlined, num_bytes, num_handles)) =
3457                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3458            {
3459                let member_inline_size =
3460                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3461                        decoder.context,
3462                    );
3463                if inlined != (member_inline_size <= 4) {
3464                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3465                }
3466                let inner_offset;
3467                let mut inner_depth = depth.clone();
3468                if inlined {
3469                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3470                    inner_offset = next_offset;
3471                } else {
3472                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3473                    inner_depth.increment()?;
3474                }
3475                let val_ref = self
3476                    .country_code
3477                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
3478                fidl::decode!(
3479                    fidl::encoding::UnboundedString,
3480                    D,
3481                    val_ref,
3482                    decoder,
3483                    inner_offset,
3484                    inner_depth
3485                )?;
3486                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3487                {
3488                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3489                }
3490                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3491                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3492                }
3493            }
3494
3495            next_offset += envelope_size;
3496
3497            // Decode the remaining unknown envelopes.
3498            while next_offset < end_offset {
3499                _next_ordinal_to_read += 1;
3500                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3501                next_offset += envelope_size;
3502            }
3503
3504            Ok(())
3505        }
3506    }
3507
3508    impl TimeZoneInfo {
3509        #[inline(always)]
3510        fn max_ordinal_present(&self) -> u64 {
3511            if let Some(_) = self.in_dst_at_time {
3512                return 3;
3513            }
3514            if let Some(_) = self.total_offset_at_time {
3515                return 2;
3516            }
3517            if let Some(_) = self.id {
3518                return 1;
3519            }
3520            0
3521        }
3522    }
3523
3524    impl fidl::encoding::ValueTypeMarker for TimeZoneInfo {
3525        type Borrowed<'a> = &'a Self;
3526        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3527            value
3528        }
3529    }
3530
3531    unsafe impl fidl::encoding::TypeMarker for TimeZoneInfo {
3532        type Owned = Self;
3533
3534        #[inline(always)]
3535        fn inline_align(_context: fidl::encoding::Context) -> usize {
3536            8
3537        }
3538
3539        #[inline(always)]
3540        fn inline_size(_context: fidl::encoding::Context) -> usize {
3541            16
3542        }
3543    }
3544
3545    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TimeZoneInfo, D>
3546        for &TimeZoneInfo
3547    {
3548        unsafe fn encode(
3549            self,
3550            encoder: &mut fidl::encoding::Encoder<'_, D>,
3551            offset: usize,
3552            mut depth: fidl::encoding::Depth,
3553        ) -> fidl::Result<()> {
3554            encoder.debug_check_bounds::<TimeZoneInfo>(offset);
3555            // Vector header
3556            let max_ordinal: u64 = self.max_ordinal_present();
3557            encoder.write_num(max_ordinal, offset);
3558            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3559            // Calling encoder.out_of_line_offset(0) is not allowed.
3560            if max_ordinal == 0 {
3561                return Ok(());
3562            }
3563            depth.increment()?;
3564            let envelope_size = 8;
3565            let bytes_len = max_ordinal as usize * envelope_size;
3566            #[allow(unused_variables)]
3567            let offset = encoder.out_of_line_offset(bytes_len);
3568            let mut _prev_end_offset: usize = 0;
3569            if 1 > max_ordinal {
3570                return Ok(());
3571            }
3572
3573            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3574            // are envelope_size bytes.
3575            let cur_offset: usize = (1 - 1) * envelope_size;
3576
3577            // Zero reserved fields.
3578            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3579
3580            // Safety:
3581            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3582            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3583            //   envelope_size bytes, there is always sufficient room.
3584            fidl::encoding::encode_in_envelope_optional::<TimeZoneId, D>(
3585                self.id.as_ref().map(<TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow),
3586                encoder,
3587                offset + cur_offset,
3588                depth,
3589            )?;
3590
3591            _prev_end_offset = cur_offset + envelope_size;
3592            if 2 > max_ordinal {
3593                return Ok(());
3594            }
3595
3596            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3597            // are envelope_size bytes.
3598            let cur_offset: usize = (2 - 1) * envelope_size;
3599
3600            // Zero reserved fields.
3601            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3602
3603            // Safety:
3604            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3605            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3606            //   envelope_size bytes, there is always sufficient room.
3607            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3608                self.total_offset_at_time
3609                    .as_ref()
3610                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3611                encoder,
3612                offset + cur_offset,
3613                depth,
3614            )?;
3615
3616            _prev_end_offset = cur_offset + envelope_size;
3617            if 3 > max_ordinal {
3618                return Ok(());
3619            }
3620
3621            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3622            // are envelope_size bytes.
3623            let cur_offset: usize = (3 - 1) * envelope_size;
3624
3625            // Zero reserved fields.
3626            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3627
3628            // Safety:
3629            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3630            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3631            //   envelope_size bytes, there is always sufficient room.
3632            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3633                self.in_dst_at_time.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3634                encoder,
3635                offset + cur_offset,
3636                depth,
3637            )?;
3638
3639            _prev_end_offset = cur_offset + envelope_size;
3640
3641            Ok(())
3642        }
3643    }
3644
3645    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimeZoneInfo {
3646        #[inline(always)]
3647        fn new_empty() -> Self {
3648            Self::default()
3649        }
3650
3651        unsafe fn decode(
3652            &mut self,
3653            decoder: &mut fidl::encoding::Decoder<'_, D>,
3654            offset: usize,
3655            mut depth: fidl::encoding::Depth,
3656        ) -> fidl::Result<()> {
3657            decoder.debug_check_bounds::<Self>(offset);
3658            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3659                None => return Err(fidl::Error::NotNullable),
3660                Some(len) => len,
3661            };
3662            // Calling decoder.out_of_line_offset(0) is not allowed.
3663            if len == 0 {
3664                return Ok(());
3665            };
3666            depth.increment()?;
3667            let envelope_size = 8;
3668            let bytes_len = len * envelope_size;
3669            let offset = decoder.out_of_line_offset(bytes_len)?;
3670            // Decode the envelope for each type.
3671            let mut _next_ordinal_to_read = 0;
3672            let mut next_offset = offset;
3673            let end_offset = offset + bytes_len;
3674            _next_ordinal_to_read += 1;
3675            if next_offset >= end_offset {
3676                return Ok(());
3677            }
3678
3679            // Decode unknown envelopes for gaps in ordinals.
3680            while _next_ordinal_to_read < 1 {
3681                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3682                _next_ordinal_to_read += 1;
3683                next_offset += envelope_size;
3684            }
3685
3686            let next_out_of_line = decoder.next_out_of_line();
3687            let handles_before = decoder.remaining_handles();
3688            if let Some((inlined, num_bytes, num_handles)) =
3689                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3690            {
3691                let member_inline_size =
3692                    <TimeZoneId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3693                if inlined != (member_inline_size <= 4) {
3694                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3695                }
3696                let inner_offset;
3697                let mut inner_depth = depth.clone();
3698                if inlined {
3699                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3700                    inner_offset = next_offset;
3701                } else {
3702                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3703                    inner_depth.increment()?;
3704                }
3705                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(TimeZoneId, D));
3706                fidl::decode!(TimeZoneId, D, val_ref, decoder, inner_offset, inner_depth)?;
3707                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3708                {
3709                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3710                }
3711                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3712                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3713                }
3714            }
3715
3716            next_offset += envelope_size;
3717            _next_ordinal_to_read += 1;
3718            if next_offset >= end_offset {
3719                return Ok(());
3720            }
3721
3722            // Decode unknown envelopes for gaps in ordinals.
3723            while _next_ordinal_to_read < 2 {
3724                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3725                _next_ordinal_to_read += 1;
3726                next_offset += envelope_size;
3727            }
3728
3729            let next_out_of_line = decoder.next_out_of_line();
3730            let handles_before = decoder.remaining_handles();
3731            if let Some((inlined, num_bytes, num_handles)) =
3732                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3733            {
3734                let member_inline_size =
3735                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3736                if inlined != (member_inline_size <= 4) {
3737                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3738                }
3739                let inner_offset;
3740                let mut inner_depth = depth.clone();
3741                if inlined {
3742                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3743                    inner_offset = next_offset;
3744                } else {
3745                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3746                    inner_depth.increment()?;
3747                }
3748                let val_ref =
3749                    self.total_offset_at_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
3750                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3751                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3752                {
3753                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3754                }
3755                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3756                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3757                }
3758            }
3759
3760            next_offset += envelope_size;
3761            _next_ordinal_to_read += 1;
3762            if next_offset >= end_offset {
3763                return Ok(());
3764            }
3765
3766            // Decode unknown envelopes for gaps in ordinals.
3767            while _next_ordinal_to_read < 3 {
3768                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3769                _next_ordinal_to_read += 1;
3770                next_offset += envelope_size;
3771            }
3772
3773            let next_out_of_line = decoder.next_out_of_line();
3774            let handles_before = decoder.remaining_handles();
3775            if let Some((inlined, num_bytes, num_handles)) =
3776                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3777            {
3778                let member_inline_size =
3779                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3780                if inlined != (member_inline_size <= 4) {
3781                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3782                }
3783                let inner_offset;
3784                let mut inner_depth = depth.clone();
3785                if inlined {
3786                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3787                    inner_offset = next_offset;
3788                } else {
3789                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3790                    inner_depth.increment()?;
3791                }
3792                let val_ref = self.in_dst_at_time.get_or_insert_with(|| fidl::new_empty!(bool, D));
3793                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3794                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3795                {
3796                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3797                }
3798                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3799                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3800                }
3801            }
3802
3803            next_offset += envelope_size;
3804
3805            // Decode the remaining unknown envelopes.
3806            while next_offset < end_offset {
3807                _next_ordinal_to_read += 1;
3808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3809                next_offset += envelope_size;
3810            }
3811
3812            Ok(())
3813        }
3814    }
3815}