fidl_fuchsia_fonts__common/
fidl_fuchsia_fonts__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
11pub type Weight = u16;
12
13/// Default slant of a typeface when none is specified.
14pub const DEFAULT_SLANT: Slant = Slant::Upright;
15
16/// Default weight of a typeface when none is specified.
17pub const DEFAULT_WEIGHT: u16 = WEIGHT_NORMAL as u16;
18
19/// Default width of a typeface when none is specified.
20pub const DEFAULT_WIDTH: Width = Width::Normal;
21
22/// The maximum number of code points allowed in a typeface query.
23pub const MAX_FACE_QUERY_CODE_POINTS: u32 = 128;
24
25/// The maximum number of preferred languages allowed in a typeface query.
26pub const MAX_FACE_QUERY_LANGUAGES: u32 = 8;
27
28/// The maximum length of a font family name.
29pub const MAX_FAMILY_NAME_LENGTH: u32 = 128;
30
31/// The maximum number of styles that will be returned for a font family.
32pub const MAX_FAMILY_STYLES: u32 = 300;
33
34/// The maximum length of a typeface's Postscript name. The limit comes from the OpenType `name`
35/// table specification.
36pub const MAX_POSTSCRIPT_TYPEFACE_NAME_LENGTH: u32 = 63;
37
38/// The maximum length of a typeface's full name.
39pub const MAX_TYPEFACE_NAME_LENGTH: u32 = 128;
40
41/// Deprecated. See `FaceRequestFlags`.
42/// Disables approximate style matching. The service will only return font that
43/// matches the requested style exactly.
44pub const REQUEST_FLAG_EXACT_MATCH: u32 = 2;
45
46/// Deprecated. See `FaceRequestFlags`.
47/// Disables font fallback. The service won't try to search fallback font set if
48/// there is no requested font family or if it doesn't contain requested
49/// character.
50pub const REQUEST_FLAG_NO_FALLBACK: u32 = 1;
51
52pub const WEIGHT_BLACK: u16 = 900;
53
54pub const WEIGHT_BOLD: u16 = 700;
55
56pub const WEIGHT_EXTRA_BOLD: u16 = 800;
57
58pub const WEIGHT_EXTRA_LIGHT: u16 = 200;
59
60pub const WEIGHT_LIGHT: u16 = 300;
61
62pub const WEIGHT_MEDIUM: u16 = 500;
63
64pub const WEIGHT_NORMAL: u16 = 400;
65
66pub const WEIGHT_SEMI_BOLD: u16 = 600;
67
68pub const WEIGHT_THIN: u16 = 100;
69
70bitflags! {
71    /// Boolean flags for `TypefaceRequest`.
72    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
73    pub struct TypefaceRequestFlags: u32 {
74        /// Disables font family fallback. The service won't try to search the fallback font set if the
75        /// requested font family doesn't exist or if it doesn't contain the requested code point.
76        const EXACT_FAMILY = 1;
77        /// Disables approximate style matching. The service will only return a face that matches the
78        /// requested style exactly. For example, there will be no substitutions of "medium" for a
79        /// requested "semi-bold" weight, or "oblique" for a requested "italic" slant.
80        const EXACT_STYLE = 2;
81    }
82}
83
84impl TypefaceRequestFlags {}
85
86/// Options for what the font server should do if the client requests a typeface that is not yet
87/// cached.
88#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
89#[repr(u32)]
90pub enum CacheMissPolicy {
91    /// The server will attempt to load the uncached typeface before providing a response. This is
92    /// the *default* behavior.
93    ///
94    /// This option is not recommended for synchronous clients that block rendering while waiting
95    /// for a font.
96    BlockUntilDownloaded = 1,
97    /// The server will tell the client that the uncached typeface is unavailable, by returning an
98    /// empty [`fuchsia.fonts/TypefaceResponse`]. The uncached typeface may be downloaded
99    /// asynchronously to be available for future requests.
100    ///
101    /// This is similar to `font-display: block` in CSS.
102    ReturnEmptyResponse = 2,
103    /// The server will attempt to provide a cached fallback typeface (if allowed by the fallback
104    /// restrictions in [`fuchsia.fonts/TypefaceRequestFlags`]). The uncached typeface may be
105    /// downloaded asynchronously to be available for future requests.
106    ///
107    /// This is similar to `font-display: swap` in CSS.
108    ReturnFallback = 3,
109}
110
111impl CacheMissPolicy {
112    #[inline]
113    pub fn from_primitive(prim: u32) -> Option<Self> {
114        match prim {
115            1 => Some(Self::BlockUntilDownloaded),
116            2 => Some(Self::ReturnEmptyResponse),
117            3 => Some(Self::ReturnFallback),
118            _ => None,
119        }
120    }
121
122    #[inline]
123    pub const fn into_primitive(self) -> u32 {
124        self as u32
125    }
126}
127
128/// Deprecated. See `GenericFontFamily`.
129#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
130#[repr(u32)]
131pub enum FallbackGroup {
132    None = 0,
133    Serif = 1,
134    SansSerif = 2,
135    Monospace = 3,
136    Cursive = 4,
137    Fantasy = 5,
138}
139
140impl FallbackGroup {
141    #[inline]
142    pub fn from_primitive(prim: u32) -> Option<Self> {
143        match prim {
144            0 => Some(Self::None),
145            1 => Some(Self::Serif),
146            2 => Some(Self::SansSerif),
147            3 => Some(Self::Monospace),
148            4 => Some(Self::Cursive),
149            5 => Some(Self::Fantasy),
150            _ => None,
151        }
152    }
153
154    #[inline]
155    pub const fn into_primitive(self) -> u32 {
156        self as u32
157    }
158}
159
160/// Generic groups of font families that can serve as fallbacks for a specific family.
161///
162/// Every font family belongs to some _generic_ font family (see examples below).
163///
164/// If an exact requested family is unavailable but a fallback group is specified in the request,
165/// the provider may return some other family that belongs to the fallback group. For example, if
166/// the client requests the "Arial" family with a `SANS_SERIF` fallback, and "Arial" is unavailable,
167/// the provider may return another available sans serif family, such as "Roboto Regular", instead.
168///
169/// See also:
170/// https://www.w3.org/TR/css-fonts-4/#generic-font-families
171#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
172#[repr(u32)]
173pub enum GenericFontFamily {
174    /// Glyphs have little "serifs", hooks, or notches at the ends of most strokes.
175    /// Examples: Georgia, Noto Serif, Times New Roman.
176    Serif = 1,
177    /// Glyphs that have no serifs at the ends of most strokes.
178    /// Examples: Arial, Noto Sans, Roboto, Tahoma.
179    SansSerif = 2,
180    /// Fixed-width fonts.
181    /// Examples: Consolas, Courier New, Inconsolata.
182    Monospace = 3,
183    /// Handwritten or cursive fonts.
184    /// Examples: Brush Script, Comic Sans, Lucida Calligraphy.
185    Cursive = 4,
186    /// Decorative fonts.
187    /// Examples: Impact, Papyrus.
188    Fantasy = 5,
189    /// The default user interface font on the target platform.
190    /// This is included for completeness with the CSS specification; font manifests should not
191    /// declare that a font belongs to the `SYSTEM_UI` generic family, but instead should declare a
192    /// more specific option (e.g. `SERIF` for Roboto).
193    ///
194    /// Not commonly used.
195    SystemUi = 6,
196    /// Fonts that are used specifically for rendering emoji code points.
197    /// Examples: Noto Color Emoji.
198    Emoji = 7,
199    /// Fonts that are used primarily for rendering mathematical expressions.
200    ///
201    /// Not commonly used.
202    Math = 8,
203    /// A group of Chinese fonts between serif and cursive, often used for official Chinese
204    /// Government documents.
205    ///
206    /// Not commonly used.
207    Fangsong = 9,
208}
209
210impl GenericFontFamily {
211    #[inline]
212    pub fn from_primitive(prim: u32) -> Option<Self> {
213        match prim {
214            1 => Some(Self::Serif),
215            2 => Some(Self::SansSerif),
216            3 => Some(Self::Monospace),
217            4 => Some(Self::Cursive),
218            5 => Some(Self::Fantasy),
219            6 => Some(Self::SystemUi),
220            7 => Some(Self::Emoji),
221            8 => Some(Self::Math),
222            9 => Some(Self::Fangsong),
223            _ => None,
224        }
225    }
226
227    #[inline]
228    pub const fn into_primitive(self) -> u32 {
229        self as u32
230    }
231}
232
233/// The type of slant of a type face.
234#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
235#[repr(u32)]
236pub enum Slant {
237    /// The default; upright glyphs.
238    Upright = 1,
239    /// Specially designed, slanted and slightly calligraphic glyphs.
240    Italic = 2,
241    /// Skewed glyphs. Oblique usually means an geometric transformation of the upright variant,
242    /// rather than a custom-designed variant.
243    Oblique = 3,
244}
245
246impl Slant {
247    #[inline]
248    pub fn from_primitive(prim: u32) -> Option<Self> {
249        match prim {
250            1 => Some(Self::Upright),
251            2 => Some(Self::Italic),
252            3 => Some(Self::Oblique),
253            _ => None,
254        }
255    }
256
257    #[inline]
258    pub const fn into_primitive(self) -> u32 {
259        self as u32
260    }
261}
262
263/// Horizontal width class of the glyphs.
264///
265/// See https://docs.microsoft.com/en-us/typography/opentype/spec/os2#uswidthclass.
266#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
267#[repr(u32)]
268pub enum Width {
269    /// 50% of normal width
270    UltraCondensed = 1,
271    /// 62.5% of normal width
272    ExtraCondensed = 2,
273    /// 75% of normal width
274    Condensed = 3,
275    /// 87.5% of normal width
276    SemiCondensed = 4,
277    /// Normal width
278    Normal = 5,
279    /// 112.5% of normal width
280    SemiExpanded = 6,
281    /// 125% of normal width
282    Expanded = 7,
283    /// 150% of normal width
284    ExtraExpanded = 8,
285    /// 200% of normal width
286    UltraExpanded = 9,
287}
288
289impl Width {
290    #[inline]
291    pub fn from_primitive(prim: u32) -> Option<Self> {
292        match prim {
293            1 => Some(Self::UltraCondensed),
294            2 => Some(Self::ExtraCondensed),
295            3 => Some(Self::Condensed),
296            4 => Some(Self::SemiCondensed),
297            5 => Some(Self::Normal),
298            6 => Some(Self::SemiExpanded),
299            7 => Some(Self::Expanded),
300            8 => Some(Self::ExtraExpanded),
301            9 => Some(Self::UltraExpanded),
302            _ => None,
303        }
304    }
305
306    #[inline]
307    pub const fn into_primitive(self) -> u32 {
308        self as u32
309    }
310}
311
312/// Deprecated. See `FontFamilyInfo`.
313///
314/// Information about font family that can be requested using GetFamilyInfo().
315#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
316pub struct FamilyInfo {
317    /// Canonical font family name. Note that this may be different from the
318    /// value passed to GetFamilyInfo() because GetFamilyInfo() also resolves
319    /// font aliases and ignores case. For example GetFamilyInfo("robotoslab")
320    /// will FamilyInfo.name = "Robot Slab".
321    pub name: String,
322    /// Unordered list of all available styles in the family.
323    pub styles: Vec<Style>,
324}
325
326impl fidl::Persistable for FamilyInfo {}
327
328/// The name of a family of fonts.
329///
330/// Examples: "Roboto", "Noto Serif".
331#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
332pub struct FamilyName {
333    /// The characters that make up the name.
334    pub name: String,
335}
336
337impl fidl::Persistable for FamilyName {}
338
339#[derive(Clone, Debug, PartialEq)]
340pub struct FontSetEventListenerOnFontSetUpdatedRequest {
341    pub event: FontSetUpdatedEvent,
342}
343
344impl fidl::Persistable for FontSetEventListenerOnFontSetUpdatedRequest {}
345
346#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
347pub struct ProviderGetFamilyInfoRequest {
348    pub family: String,
349}
350
351impl fidl::Persistable for ProviderGetFamilyInfoRequest {}
352
353#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
354pub struct ProviderGetFamilyInfoResponse {
355    pub family_info: Option<Box<FamilyInfo>>,
356}
357
358impl fidl::Persistable for ProviderGetFamilyInfoResponse {}
359
360#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
361pub struct ProviderGetFontFamilyInfoRequest {
362    pub family: FamilyName,
363}
364
365impl fidl::Persistable for ProviderGetFontFamilyInfoRequest {}
366
367#[derive(Clone, Debug, PartialEq)]
368pub struct ProviderGetFontFamilyInfoResponse {
369    pub family_info: FontFamilyInfo,
370}
371
372impl fidl::Persistable for ProviderGetFontFamilyInfoResponse {}
373
374#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
375pub struct ProviderGetFontRequest {
376    pub request: Request,
377}
378
379impl fidl::Persistable for ProviderGetFontRequest {}
380
381#[derive(Clone, Debug, PartialEq)]
382pub struct ProviderGetTypefaceRequest {
383    pub request: TypefaceRequest,
384}
385
386impl fidl::Persistable for ProviderGetTypefaceRequest {}
387
388/// Deprecated. See `FaceRequest`.
389#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
390pub struct Request {
391    /// Desired font family name, e.g. "Roboto". Font family search is
392    /// case-insensitive. In case when there is no specified family or the
393    /// specified family doesn't have glyph for the requested `character` then
394    /// a font from another family may be returned. This behavior can be disabled
395    /// using `REQUEST_FLAG_NO_FALLBACK`.
396    pub family: Option<String>,
397    /// For example, 400 is normal, 700 is bold.
398    pub weight: u32,
399    /// Numeric values matching OS/2 & Windows Metrics usWidthClass table.
400    /// https://www.microsoft.com/typography/otspec/os2.htm
401    /// For example, 5 is normal.
402    pub width: u32,
403    pub slant: Slant,
404    /// BCP47 language tags in order of preference. See
405    /// https://tools.ietf.org/html/bcp47 .
406    pub language: Option<Vec<String>>,
407    /// Codepoint for the character that must be present in the returned font or 0.
408    /// Caller that specify this field are expected to extract character set from
409    /// the result and cache it in order to avoid calling the API more than
410    /// necessary.
411    pub character: u32,
412    /// Fallback group preference. Caller can leave this field set to NONE. In
413    /// that case the font provider will use fallback group of the specified font
414    /// family.
415    pub fallback_group: FallbackGroup,
416    pub flags: u32,
417}
418
419impl fidl::Persistable for Request {}
420
421/// Deprecated.
422/// See `Style2`.
423#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
424pub struct Style {
425    pub weight: u32,
426    pub width: u32,
427    pub slant: Slant,
428}
429
430impl fidl::Persistable for Style {}
431
432/// Information about a font family that can be requested using `Provider.GetFontFamilyInfo()`.
433///
434/// If a matching font family is not found, the table will be empty.
435#[derive(Clone, Debug, Default, PartialEq)]
436pub struct FontFamilyInfo {
437    /// Canonical font family name. Note that this may be different from the value passed to
438    /// `GetFontFamilyInfo()` due to the resolution of font aliases, and/or differences in
439    /// whitespace and capitalization.
440    pub name: Option<FamilyName>,
441    /// Unordered list of all available styles in the family.
442    pub styles: Option<Vec<Style2>>,
443    #[doc(hidden)]
444    pub __source_breaking: fidl::marker::SourceBreaking,
445}
446
447impl fidl::Persistable for FontFamilyInfo {}
448
449/// An event indicating that the set of fonts available in the `Provider` has changed. This is most
450/// frequently caused by an ephemeral font being downloaded and cached. Clients should consider
451/// re-requesting fonts and re-rendering any displayed text.
452#[derive(Clone, Debug, Default, PartialEq)]
453pub struct FontSetUpdatedEvent {
454    #[doc(hidden)]
455    pub __source_breaking: fidl::marker::SourceBreaking,
456}
457
458impl fidl::Persistable for FontSetUpdatedEvent {}
459
460/// Style properties that can be used when requesting or describing a type face.
461#[derive(Clone, Debug, Default, PartialEq)]
462pub struct Style2 {
463    /// See `Slant`.
464    pub slant: Option<Slant>,
465    /// Weight or thickness of the glyphs. Allowed values are integers in the range [1, 1000], but
466    /// most real-world font families only support some integer multiples of 100:
467    /// {100, 200, ..., 900}. Normal text (`WEIGHT_NORMAL`) is 400; `WEIGHT_BOLD` is 700.
468    ///
469    /// See:
470    /// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Common_weight_name_mapping
471    /// https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass
472    pub weight: Option<u16>,
473    /// See `Width`.
474    pub width: Option<Width>,
475    #[doc(hidden)]
476    pub __source_breaking: fidl::marker::SourceBreaking,
477}
478
479impl fidl::Persistable for Style2 {}
480
481/// Parameters for looking up a typeface.
482#[derive(Clone, Debug, Default, PartialEq)]
483pub struct TypefaceQuery {
484    /// Desired font family name, e.g. "Roboto". Font family search is case-insensitive.
485    ///
486    /// Note: In cases where the specified family doesn't exist, or the specified family doesn't
487    /// have a glyph for the requested `code_point`, a face from another family may be returned.
488    /// This behavior can be disabled using `TypefaceRequestFlags.EXACT_FAMILY`.
489    pub family: Option<FamilyName>,
490    /// Style properties of the desired typeface.
491    pub style: Option<Style2>,
492    /// Language tags in order of preference. This allows disambiguating code points that map
493    /// to different glyphs in different languages (e.g. CJK code points).
494    ///
495    /// See `fuchsia.intl.LocaleId`.
496    pub languages: Option<Vec<fidl_fuchsia_intl__common::LocaleId>>,
497    /// Optional code points for which glyphs must be present in the returned face.
498    ///
499    /// Callers that specify this field are expected to extract the character set from the result
500    /// and cache it in order to avoid calling the API more than necessary.
501    pub code_points: Option<Vec<u32>>,
502    /// A generic font family to fall back to if an exact match is unavailable or does not contain
503    /// the requested code point.
504    ///
505    /// Every font family belongs to a generic family (configured in the font manifest). If a
506    /// particular font family doesn't contain a requested code point, the provider can search for
507    /// the code point in other font families _in the same generic family_ as a fallback.
508    ///
509    /// Specifying `fallback_family` in a query allows the client to override the generic family
510    /// that would be used as a fallback.
511    pub fallback_family: Option<GenericFontFamily>,
512    /// The exact Postscript name of the typeface to look up. This corresponds to name ID `6` in
513    /// the TrueType/OpenType `name` table.
514    ///
515    /// All characters must be in the printable ASCII range (U+0021 to U+007E), and must not be
516    /// '[', ']', '(', ')', '{', '}', '<', '>', '/', or '%'.
517    ///
518    /// If this field is specified, all the other query fields are ignored.
519    pub postscript_name: Option<String>,
520    /// The exact full name of the typeface to look up. This corresponds to name ID `4` in the
521    /// TrueType/OpenType `name` table.
522    ///
523    /// If this field is specified, all the other query fields are ignored.
524    pub full_name: Option<String>,
525    #[doc(hidden)]
526    pub __source_breaking: fidl::marker::SourceBreaking,
527}
528
529impl fidl::Persistable for TypefaceQuery {}
530
531/// Parameters for requesting a typeface.
532#[derive(Clone, Debug, Default, PartialEq)]
533pub struct TypefaceRequest {
534    /// Parameters for looking up a typeface.
535    pub query: Option<TypefaceQuery>,
536    /// Flags for how to process the request, such as which kinds of substitutions are permitted.
537    pub flags: Option<TypefaceRequestFlags>,
538    /// Setting for what to do if the requested typeface exists but is not cached, and therefore
539    /// cannot be served immediately.
540    ///
541    /// If this field is empty, the default policy is
542    /// [`fuchsia.fonts/CacheMissPolicy.BLOCK_UNTIL_DOWNLOADED`].
543    ///
544    /// If the client needs an immediate response, it can choose one of the non-blocking policies.
545    /// In this case, clients can also register to be notified when new fonts have been added to the
546    /// cache by calling [`fuchsia.fonts/Provider.RegisterFontSetEventListener`].
547    pub cache_miss_policy: Option<CacheMissPolicy>,
548    #[doc(hidden)]
549    pub __source_breaking: fidl::marker::SourceBreaking,
550}
551
552impl fidl::Persistable for TypefaceRequest {}
553
554pub mod font_set_event_listener_ordinals {
555    pub const ON_FONT_SET_UPDATED: u64 = 0xf0cd2d121f881f9;
556}
557
558pub mod provider_ordinals {
559    pub const GET_FONT: u64 = 0x6daeaad83184076b;
560    pub const GET_FAMILY_INFO: u64 = 0x27aba13280090db3;
561    pub const GET_TYPEFACE: u64 = 0x5481d24f1a4b0671;
562    pub const GET_FONT_FAMILY_INFO: u64 = 0x7520ee83bf25c9ca;
563    pub const REGISTER_FONT_SET_EVENT_LISTENER: u64 = 0x196898fd17cb694c;
564}
565
566mod internal {
567    use super::*;
568    unsafe impl fidl::encoding::TypeMarker for TypefaceRequestFlags {
569        type Owned = Self;
570
571        #[inline(always)]
572        fn inline_align(_context: fidl::encoding::Context) -> usize {
573            4
574        }
575
576        #[inline(always)]
577        fn inline_size(_context: fidl::encoding::Context) -> usize {
578            4
579        }
580    }
581
582    impl fidl::encoding::ValueTypeMarker for TypefaceRequestFlags {
583        type Borrowed<'a> = Self;
584        #[inline(always)]
585        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
586            *value
587        }
588    }
589
590    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
591        for TypefaceRequestFlags
592    {
593        #[inline]
594        unsafe fn encode(
595            self,
596            encoder: &mut fidl::encoding::Encoder<'_, D>,
597            offset: usize,
598            _depth: fidl::encoding::Depth,
599        ) -> fidl::Result<()> {
600            encoder.debug_check_bounds::<Self>(offset);
601            if self.bits() & Self::all().bits() != self.bits() {
602                return Err(fidl::Error::InvalidBitsValue);
603            }
604            encoder.write_num(self.bits(), offset);
605            Ok(())
606        }
607    }
608
609    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TypefaceRequestFlags {
610        #[inline(always)]
611        fn new_empty() -> Self {
612            Self::empty()
613        }
614
615        #[inline]
616        unsafe fn decode(
617            &mut self,
618            decoder: &mut fidl::encoding::Decoder<'_, D>,
619            offset: usize,
620            _depth: fidl::encoding::Depth,
621        ) -> fidl::Result<()> {
622            decoder.debug_check_bounds::<Self>(offset);
623            let prim = decoder.read_num::<u32>(offset);
624            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
625            Ok(())
626        }
627    }
628    unsafe impl fidl::encoding::TypeMarker for CacheMissPolicy {
629        type Owned = Self;
630
631        #[inline(always)]
632        fn inline_align(_context: fidl::encoding::Context) -> usize {
633            std::mem::align_of::<u32>()
634        }
635
636        #[inline(always)]
637        fn inline_size(_context: fidl::encoding::Context) -> usize {
638            std::mem::size_of::<u32>()
639        }
640
641        #[inline(always)]
642        fn encode_is_copy() -> bool {
643            true
644        }
645
646        #[inline(always)]
647        fn decode_is_copy() -> bool {
648            false
649        }
650    }
651
652    impl fidl::encoding::ValueTypeMarker for CacheMissPolicy {
653        type Borrowed<'a> = Self;
654        #[inline(always)]
655        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
656            *value
657        }
658    }
659
660    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
661        for CacheMissPolicy
662    {
663        #[inline]
664        unsafe fn encode(
665            self,
666            encoder: &mut fidl::encoding::Encoder<'_, D>,
667            offset: usize,
668            _depth: fidl::encoding::Depth,
669        ) -> fidl::Result<()> {
670            encoder.debug_check_bounds::<Self>(offset);
671            encoder.write_num(self.into_primitive(), offset);
672            Ok(())
673        }
674    }
675
676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CacheMissPolicy {
677        #[inline(always)]
678        fn new_empty() -> Self {
679            Self::BlockUntilDownloaded
680        }
681
682        #[inline]
683        unsafe fn decode(
684            &mut self,
685            decoder: &mut fidl::encoding::Decoder<'_, D>,
686            offset: usize,
687            _depth: fidl::encoding::Depth,
688        ) -> fidl::Result<()> {
689            decoder.debug_check_bounds::<Self>(offset);
690            let prim = decoder.read_num::<u32>(offset);
691
692            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
693            Ok(())
694        }
695    }
696    unsafe impl fidl::encoding::TypeMarker for FallbackGroup {
697        type Owned = Self;
698
699        #[inline(always)]
700        fn inline_align(_context: fidl::encoding::Context) -> usize {
701            std::mem::align_of::<u32>()
702        }
703
704        #[inline(always)]
705        fn inline_size(_context: fidl::encoding::Context) -> usize {
706            std::mem::size_of::<u32>()
707        }
708
709        #[inline(always)]
710        fn encode_is_copy() -> bool {
711            true
712        }
713
714        #[inline(always)]
715        fn decode_is_copy() -> bool {
716            false
717        }
718    }
719
720    impl fidl::encoding::ValueTypeMarker for FallbackGroup {
721        type Borrowed<'a> = Self;
722        #[inline(always)]
723        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
724            *value
725        }
726    }
727
728    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FallbackGroup {
729        #[inline]
730        unsafe fn encode(
731            self,
732            encoder: &mut fidl::encoding::Encoder<'_, D>,
733            offset: usize,
734            _depth: fidl::encoding::Depth,
735        ) -> fidl::Result<()> {
736            encoder.debug_check_bounds::<Self>(offset);
737            encoder.write_num(self.into_primitive(), offset);
738            Ok(())
739        }
740    }
741
742    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FallbackGroup {
743        #[inline(always)]
744        fn new_empty() -> Self {
745            Self::None
746        }
747
748        #[inline]
749        unsafe fn decode(
750            &mut self,
751            decoder: &mut fidl::encoding::Decoder<'_, D>,
752            offset: usize,
753            _depth: fidl::encoding::Depth,
754        ) -> fidl::Result<()> {
755            decoder.debug_check_bounds::<Self>(offset);
756            let prim = decoder.read_num::<u32>(offset);
757
758            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
759            Ok(())
760        }
761    }
762    unsafe impl fidl::encoding::TypeMarker for GenericFontFamily {
763        type Owned = Self;
764
765        #[inline(always)]
766        fn inline_align(_context: fidl::encoding::Context) -> usize {
767            std::mem::align_of::<u32>()
768        }
769
770        #[inline(always)]
771        fn inline_size(_context: fidl::encoding::Context) -> usize {
772            std::mem::size_of::<u32>()
773        }
774
775        #[inline(always)]
776        fn encode_is_copy() -> bool {
777            true
778        }
779
780        #[inline(always)]
781        fn decode_is_copy() -> bool {
782            false
783        }
784    }
785
786    impl fidl::encoding::ValueTypeMarker for GenericFontFamily {
787        type Borrowed<'a> = Self;
788        #[inline(always)]
789        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
790            *value
791        }
792    }
793
794    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
795        for GenericFontFamily
796    {
797        #[inline]
798        unsafe fn encode(
799            self,
800            encoder: &mut fidl::encoding::Encoder<'_, D>,
801            offset: usize,
802            _depth: fidl::encoding::Depth,
803        ) -> fidl::Result<()> {
804            encoder.debug_check_bounds::<Self>(offset);
805            encoder.write_num(self.into_primitive(), offset);
806            Ok(())
807        }
808    }
809
810    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GenericFontFamily {
811        #[inline(always)]
812        fn new_empty() -> Self {
813            Self::Serif
814        }
815
816        #[inline]
817        unsafe fn decode(
818            &mut self,
819            decoder: &mut fidl::encoding::Decoder<'_, D>,
820            offset: usize,
821            _depth: fidl::encoding::Depth,
822        ) -> fidl::Result<()> {
823            decoder.debug_check_bounds::<Self>(offset);
824            let prim = decoder.read_num::<u32>(offset);
825
826            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
827            Ok(())
828        }
829    }
830    unsafe impl fidl::encoding::TypeMarker for Slant {
831        type Owned = Self;
832
833        #[inline(always)]
834        fn inline_align(_context: fidl::encoding::Context) -> usize {
835            std::mem::align_of::<u32>()
836        }
837
838        #[inline(always)]
839        fn inline_size(_context: fidl::encoding::Context) -> usize {
840            std::mem::size_of::<u32>()
841        }
842
843        #[inline(always)]
844        fn encode_is_copy() -> bool {
845            true
846        }
847
848        #[inline(always)]
849        fn decode_is_copy() -> bool {
850            false
851        }
852    }
853
854    impl fidl::encoding::ValueTypeMarker for Slant {
855        type Borrowed<'a> = Self;
856        #[inline(always)]
857        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
858            *value
859        }
860    }
861
862    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Slant {
863        #[inline]
864        unsafe fn encode(
865            self,
866            encoder: &mut fidl::encoding::Encoder<'_, D>,
867            offset: usize,
868            _depth: fidl::encoding::Depth,
869        ) -> fidl::Result<()> {
870            encoder.debug_check_bounds::<Self>(offset);
871            encoder.write_num(self.into_primitive(), offset);
872            Ok(())
873        }
874    }
875
876    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Slant {
877        #[inline(always)]
878        fn new_empty() -> Self {
879            Self::Upright
880        }
881
882        #[inline]
883        unsafe fn decode(
884            &mut self,
885            decoder: &mut fidl::encoding::Decoder<'_, D>,
886            offset: usize,
887            _depth: fidl::encoding::Depth,
888        ) -> fidl::Result<()> {
889            decoder.debug_check_bounds::<Self>(offset);
890            let prim = decoder.read_num::<u32>(offset);
891
892            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
893            Ok(())
894        }
895    }
896    unsafe impl fidl::encoding::TypeMarker for Width {
897        type Owned = Self;
898
899        #[inline(always)]
900        fn inline_align(_context: fidl::encoding::Context) -> usize {
901            std::mem::align_of::<u32>()
902        }
903
904        #[inline(always)]
905        fn inline_size(_context: fidl::encoding::Context) -> usize {
906            std::mem::size_of::<u32>()
907        }
908
909        #[inline(always)]
910        fn encode_is_copy() -> bool {
911            true
912        }
913
914        #[inline(always)]
915        fn decode_is_copy() -> bool {
916            false
917        }
918    }
919
920    impl fidl::encoding::ValueTypeMarker for Width {
921        type Borrowed<'a> = Self;
922        #[inline(always)]
923        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
924            *value
925        }
926    }
927
928    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Width {
929        #[inline]
930        unsafe fn encode(
931            self,
932            encoder: &mut fidl::encoding::Encoder<'_, D>,
933            offset: usize,
934            _depth: fidl::encoding::Depth,
935        ) -> fidl::Result<()> {
936            encoder.debug_check_bounds::<Self>(offset);
937            encoder.write_num(self.into_primitive(), offset);
938            Ok(())
939        }
940    }
941
942    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Width {
943        #[inline(always)]
944        fn new_empty() -> Self {
945            Self::UltraCondensed
946        }
947
948        #[inline]
949        unsafe fn decode(
950            &mut self,
951            decoder: &mut fidl::encoding::Decoder<'_, D>,
952            offset: usize,
953            _depth: fidl::encoding::Depth,
954        ) -> fidl::Result<()> {
955            decoder.debug_check_bounds::<Self>(offset);
956            let prim = decoder.read_num::<u32>(offset);
957
958            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
959            Ok(())
960        }
961    }
962
963    impl fidl::encoding::ValueTypeMarker for FamilyInfo {
964        type Borrowed<'a> = &'a Self;
965        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
966            value
967        }
968    }
969
970    unsafe impl fidl::encoding::TypeMarker for FamilyInfo {
971        type Owned = Self;
972
973        #[inline(always)]
974        fn inline_align(_context: fidl::encoding::Context) -> usize {
975            8
976        }
977
978        #[inline(always)]
979        fn inline_size(_context: fidl::encoding::Context) -> usize {
980            32
981        }
982    }
983
984    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FamilyInfo, D>
985        for &FamilyInfo
986    {
987        #[inline]
988        unsafe fn encode(
989            self,
990            encoder: &mut fidl::encoding::Encoder<'_, D>,
991            offset: usize,
992            _depth: fidl::encoding::Depth,
993        ) -> fidl::Result<()> {
994            encoder.debug_check_bounds::<FamilyInfo>(offset);
995            // Delegate to tuple encoding.
996            fidl::encoding::Encode::<FamilyInfo, D>::encode(
997                (
998                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
999                        &self.name,
1000                    ),
1001                    <fidl::encoding::Vector<Style, 300> as fidl::encoding::ValueTypeMarker>::borrow(
1002                        &self.styles,
1003                    ),
1004                ),
1005                encoder,
1006                offset,
1007                _depth,
1008            )
1009        }
1010    }
1011    unsafe impl<
1012            D: fidl::encoding::ResourceDialect,
1013            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
1014            T1: fidl::encoding::Encode<fidl::encoding::Vector<Style, 300>, D>,
1015        > fidl::encoding::Encode<FamilyInfo, D> for (T0, T1)
1016    {
1017        #[inline]
1018        unsafe fn encode(
1019            self,
1020            encoder: &mut fidl::encoding::Encoder<'_, D>,
1021            offset: usize,
1022            depth: fidl::encoding::Depth,
1023        ) -> fidl::Result<()> {
1024            encoder.debug_check_bounds::<FamilyInfo>(offset);
1025            // Zero out padding regions. There's no need to apply masks
1026            // because the unmasked parts will be overwritten by fields.
1027            // Write the fields.
1028            self.0.encode(encoder, offset + 0, depth)?;
1029            self.1.encode(encoder, offset + 16, depth)?;
1030            Ok(())
1031        }
1032    }
1033
1034    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FamilyInfo {
1035        #[inline(always)]
1036        fn new_empty() -> Self {
1037            Self {
1038                name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
1039                styles: fidl::new_empty!(fidl::encoding::Vector<Style, 300>, D),
1040            }
1041        }
1042
1043        #[inline]
1044        unsafe fn decode(
1045            &mut self,
1046            decoder: &mut fidl::encoding::Decoder<'_, D>,
1047            offset: usize,
1048            _depth: fidl::encoding::Depth,
1049        ) -> fidl::Result<()> {
1050            decoder.debug_check_bounds::<Self>(offset);
1051            // Verify that padding bytes are zero.
1052            fidl::decode!(
1053                fidl::encoding::BoundedString<128>,
1054                D,
1055                &mut self.name,
1056                decoder,
1057                offset + 0,
1058                _depth
1059            )?;
1060            fidl::decode!(fidl::encoding::Vector<Style, 300>, D, &mut self.styles, decoder, offset + 16, _depth)?;
1061            Ok(())
1062        }
1063    }
1064
1065    impl fidl::encoding::ValueTypeMarker for FamilyName {
1066        type Borrowed<'a> = &'a Self;
1067        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1068            value
1069        }
1070    }
1071
1072    unsafe impl fidl::encoding::TypeMarker for FamilyName {
1073        type Owned = Self;
1074
1075        #[inline(always)]
1076        fn inline_align(_context: fidl::encoding::Context) -> usize {
1077            8
1078        }
1079
1080        #[inline(always)]
1081        fn inline_size(_context: fidl::encoding::Context) -> usize {
1082            16
1083        }
1084    }
1085
1086    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FamilyName, D>
1087        for &FamilyName
1088    {
1089        #[inline]
1090        unsafe fn encode(
1091            self,
1092            encoder: &mut fidl::encoding::Encoder<'_, D>,
1093            offset: usize,
1094            _depth: fidl::encoding::Depth,
1095        ) -> fidl::Result<()> {
1096            encoder.debug_check_bounds::<FamilyName>(offset);
1097            // Delegate to tuple encoding.
1098            fidl::encoding::Encode::<FamilyName, D>::encode(
1099                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
1100                    &self.name,
1101                ),),
1102                encoder,
1103                offset,
1104                _depth,
1105            )
1106        }
1107    }
1108    unsafe impl<
1109            D: fidl::encoding::ResourceDialect,
1110            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
1111        > fidl::encoding::Encode<FamilyName, D> for (T0,)
1112    {
1113        #[inline]
1114        unsafe fn encode(
1115            self,
1116            encoder: &mut fidl::encoding::Encoder<'_, D>,
1117            offset: usize,
1118            depth: fidl::encoding::Depth,
1119        ) -> fidl::Result<()> {
1120            encoder.debug_check_bounds::<FamilyName>(offset);
1121            // Zero out padding regions. There's no need to apply masks
1122            // because the unmasked parts will be overwritten by fields.
1123            // Write the fields.
1124            self.0.encode(encoder, offset + 0, depth)?;
1125            Ok(())
1126        }
1127    }
1128
1129    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FamilyName {
1130        #[inline(always)]
1131        fn new_empty() -> Self {
1132            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
1133        }
1134
1135        #[inline]
1136        unsafe fn decode(
1137            &mut self,
1138            decoder: &mut fidl::encoding::Decoder<'_, D>,
1139            offset: usize,
1140            _depth: fidl::encoding::Depth,
1141        ) -> fidl::Result<()> {
1142            decoder.debug_check_bounds::<Self>(offset);
1143            // Verify that padding bytes are zero.
1144            fidl::decode!(
1145                fidl::encoding::BoundedString<128>,
1146                D,
1147                &mut self.name,
1148                decoder,
1149                offset + 0,
1150                _depth
1151            )?;
1152            Ok(())
1153        }
1154    }
1155
1156    impl fidl::encoding::ValueTypeMarker for FontSetEventListenerOnFontSetUpdatedRequest {
1157        type Borrowed<'a> = &'a Self;
1158        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1159            value
1160        }
1161    }
1162
1163    unsafe impl fidl::encoding::TypeMarker for FontSetEventListenerOnFontSetUpdatedRequest {
1164        type Owned = Self;
1165
1166        #[inline(always)]
1167        fn inline_align(_context: fidl::encoding::Context) -> usize {
1168            8
1169        }
1170
1171        #[inline(always)]
1172        fn inline_size(_context: fidl::encoding::Context) -> usize {
1173            16
1174        }
1175    }
1176
1177    unsafe impl<D: fidl::encoding::ResourceDialect>
1178        fidl::encoding::Encode<FontSetEventListenerOnFontSetUpdatedRequest, D>
1179        for &FontSetEventListenerOnFontSetUpdatedRequest
1180    {
1181        #[inline]
1182        unsafe fn encode(
1183            self,
1184            encoder: &mut fidl::encoding::Encoder<'_, D>,
1185            offset: usize,
1186            _depth: fidl::encoding::Depth,
1187        ) -> fidl::Result<()> {
1188            encoder.debug_check_bounds::<FontSetEventListenerOnFontSetUpdatedRequest>(offset);
1189            // Delegate to tuple encoding.
1190            fidl::encoding::Encode::<FontSetEventListenerOnFontSetUpdatedRequest, D>::encode(
1191                (<FontSetUpdatedEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event),),
1192                encoder,
1193                offset,
1194                _depth,
1195            )
1196        }
1197    }
1198    unsafe impl<
1199            D: fidl::encoding::ResourceDialect,
1200            T0: fidl::encoding::Encode<FontSetUpdatedEvent, D>,
1201        > fidl::encoding::Encode<FontSetEventListenerOnFontSetUpdatedRequest, D> for (T0,)
1202    {
1203        #[inline]
1204        unsafe fn encode(
1205            self,
1206            encoder: &mut fidl::encoding::Encoder<'_, D>,
1207            offset: usize,
1208            depth: fidl::encoding::Depth,
1209        ) -> fidl::Result<()> {
1210            encoder.debug_check_bounds::<FontSetEventListenerOnFontSetUpdatedRequest>(offset);
1211            // Zero out padding regions. There's no need to apply masks
1212            // because the unmasked parts will be overwritten by fields.
1213            // Write the fields.
1214            self.0.encode(encoder, offset + 0, depth)?;
1215            Ok(())
1216        }
1217    }
1218
1219    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1220        for FontSetEventListenerOnFontSetUpdatedRequest
1221    {
1222        #[inline(always)]
1223        fn new_empty() -> Self {
1224            Self { event: fidl::new_empty!(FontSetUpdatedEvent, D) }
1225        }
1226
1227        #[inline]
1228        unsafe fn decode(
1229            &mut self,
1230            decoder: &mut fidl::encoding::Decoder<'_, D>,
1231            offset: usize,
1232            _depth: fidl::encoding::Depth,
1233        ) -> fidl::Result<()> {
1234            decoder.debug_check_bounds::<Self>(offset);
1235            // Verify that padding bytes are zero.
1236            fidl::decode!(FontSetUpdatedEvent, D, &mut self.event, decoder, offset + 0, _depth)?;
1237            Ok(())
1238        }
1239    }
1240
1241    impl fidl::encoding::ValueTypeMarker for ProviderGetFamilyInfoRequest {
1242        type Borrowed<'a> = &'a Self;
1243        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1244            value
1245        }
1246    }
1247
1248    unsafe impl fidl::encoding::TypeMarker for ProviderGetFamilyInfoRequest {
1249        type Owned = Self;
1250
1251        #[inline(always)]
1252        fn inline_align(_context: fidl::encoding::Context) -> usize {
1253            8
1254        }
1255
1256        #[inline(always)]
1257        fn inline_size(_context: fidl::encoding::Context) -> usize {
1258            16
1259        }
1260    }
1261
1262    unsafe impl<D: fidl::encoding::ResourceDialect>
1263        fidl::encoding::Encode<ProviderGetFamilyInfoRequest, D> for &ProviderGetFamilyInfoRequest
1264    {
1265        #[inline]
1266        unsafe fn encode(
1267            self,
1268            encoder: &mut fidl::encoding::Encoder<'_, D>,
1269            offset: usize,
1270            _depth: fidl::encoding::Depth,
1271        ) -> fidl::Result<()> {
1272            encoder.debug_check_bounds::<ProviderGetFamilyInfoRequest>(offset);
1273            // Delegate to tuple encoding.
1274            fidl::encoding::Encode::<ProviderGetFamilyInfoRequest, D>::encode(
1275                (<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
1276                    &self.family,
1277                ),),
1278                encoder,
1279                offset,
1280                _depth,
1281            )
1282        }
1283    }
1284    unsafe impl<
1285            D: fidl::encoding::ResourceDialect,
1286            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
1287        > fidl::encoding::Encode<ProviderGetFamilyInfoRequest, D> for (T0,)
1288    {
1289        #[inline]
1290        unsafe fn encode(
1291            self,
1292            encoder: &mut fidl::encoding::Encoder<'_, D>,
1293            offset: usize,
1294            depth: fidl::encoding::Depth,
1295        ) -> fidl::Result<()> {
1296            encoder.debug_check_bounds::<ProviderGetFamilyInfoRequest>(offset);
1297            // Zero out padding regions. There's no need to apply masks
1298            // because the unmasked parts will be overwritten by fields.
1299            // Write the fields.
1300            self.0.encode(encoder, offset + 0, depth)?;
1301            Ok(())
1302        }
1303    }
1304
1305    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1306        for ProviderGetFamilyInfoRequest
1307    {
1308        #[inline(always)]
1309        fn new_empty() -> Self {
1310            Self { family: fidl::new_empty!(fidl::encoding::BoundedString<128>, D) }
1311        }
1312
1313        #[inline]
1314        unsafe fn decode(
1315            &mut self,
1316            decoder: &mut fidl::encoding::Decoder<'_, D>,
1317            offset: usize,
1318            _depth: fidl::encoding::Depth,
1319        ) -> fidl::Result<()> {
1320            decoder.debug_check_bounds::<Self>(offset);
1321            // Verify that padding bytes are zero.
1322            fidl::decode!(
1323                fidl::encoding::BoundedString<128>,
1324                D,
1325                &mut self.family,
1326                decoder,
1327                offset + 0,
1328                _depth
1329            )?;
1330            Ok(())
1331        }
1332    }
1333
1334    impl fidl::encoding::ValueTypeMarker for ProviderGetFamilyInfoResponse {
1335        type Borrowed<'a> = &'a Self;
1336        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1337            value
1338        }
1339    }
1340
1341    unsafe impl fidl::encoding::TypeMarker for ProviderGetFamilyInfoResponse {
1342        type Owned = Self;
1343
1344        #[inline(always)]
1345        fn inline_align(_context: fidl::encoding::Context) -> usize {
1346            8
1347        }
1348
1349        #[inline(always)]
1350        fn inline_size(_context: fidl::encoding::Context) -> usize {
1351            8
1352        }
1353    }
1354
1355    unsafe impl<D: fidl::encoding::ResourceDialect>
1356        fidl::encoding::Encode<ProviderGetFamilyInfoResponse, D>
1357        for &ProviderGetFamilyInfoResponse
1358    {
1359        #[inline]
1360        unsafe fn encode(
1361            self,
1362            encoder: &mut fidl::encoding::Encoder<'_, D>,
1363            offset: usize,
1364            _depth: fidl::encoding::Depth,
1365        ) -> fidl::Result<()> {
1366            encoder.debug_check_bounds::<ProviderGetFamilyInfoResponse>(offset);
1367            // Delegate to tuple encoding.
1368            fidl::encoding::Encode::<ProviderGetFamilyInfoResponse, D>::encode(
1369                (<fidl::encoding::Boxed<FamilyInfo> as fidl::encoding::ValueTypeMarker>::borrow(
1370                    &self.family_info,
1371                ),),
1372                encoder,
1373                offset,
1374                _depth,
1375            )
1376        }
1377    }
1378    unsafe impl<
1379            D: fidl::encoding::ResourceDialect,
1380            T0: fidl::encoding::Encode<fidl::encoding::Boxed<FamilyInfo>, D>,
1381        > fidl::encoding::Encode<ProviderGetFamilyInfoResponse, D> for (T0,)
1382    {
1383        #[inline]
1384        unsafe fn encode(
1385            self,
1386            encoder: &mut fidl::encoding::Encoder<'_, D>,
1387            offset: usize,
1388            depth: fidl::encoding::Depth,
1389        ) -> fidl::Result<()> {
1390            encoder.debug_check_bounds::<ProviderGetFamilyInfoResponse>(offset);
1391            // Zero out padding regions. There's no need to apply masks
1392            // because the unmasked parts will be overwritten by fields.
1393            // Write the fields.
1394            self.0.encode(encoder, offset + 0, depth)?;
1395            Ok(())
1396        }
1397    }
1398
1399    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1400        for ProviderGetFamilyInfoResponse
1401    {
1402        #[inline(always)]
1403        fn new_empty() -> Self {
1404            Self { family_info: fidl::new_empty!(fidl::encoding::Boxed<FamilyInfo>, D) }
1405        }
1406
1407        #[inline]
1408        unsafe fn decode(
1409            &mut self,
1410            decoder: &mut fidl::encoding::Decoder<'_, D>,
1411            offset: usize,
1412            _depth: fidl::encoding::Depth,
1413        ) -> fidl::Result<()> {
1414            decoder.debug_check_bounds::<Self>(offset);
1415            // Verify that padding bytes are zero.
1416            fidl::decode!(
1417                fidl::encoding::Boxed<FamilyInfo>,
1418                D,
1419                &mut self.family_info,
1420                decoder,
1421                offset + 0,
1422                _depth
1423            )?;
1424            Ok(())
1425        }
1426    }
1427
1428    impl fidl::encoding::ValueTypeMarker for ProviderGetFontFamilyInfoRequest {
1429        type Borrowed<'a> = &'a Self;
1430        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1431            value
1432        }
1433    }
1434
1435    unsafe impl fidl::encoding::TypeMarker for ProviderGetFontFamilyInfoRequest {
1436        type Owned = Self;
1437
1438        #[inline(always)]
1439        fn inline_align(_context: fidl::encoding::Context) -> usize {
1440            8
1441        }
1442
1443        #[inline(always)]
1444        fn inline_size(_context: fidl::encoding::Context) -> usize {
1445            16
1446        }
1447    }
1448
1449    unsafe impl<D: fidl::encoding::ResourceDialect>
1450        fidl::encoding::Encode<ProviderGetFontFamilyInfoRequest, D>
1451        for &ProviderGetFontFamilyInfoRequest
1452    {
1453        #[inline]
1454        unsafe fn encode(
1455            self,
1456            encoder: &mut fidl::encoding::Encoder<'_, D>,
1457            offset: usize,
1458            _depth: fidl::encoding::Depth,
1459        ) -> fidl::Result<()> {
1460            encoder.debug_check_bounds::<ProviderGetFontFamilyInfoRequest>(offset);
1461            // Delegate to tuple encoding.
1462            fidl::encoding::Encode::<ProviderGetFontFamilyInfoRequest, D>::encode(
1463                (<FamilyName as fidl::encoding::ValueTypeMarker>::borrow(&self.family),),
1464                encoder,
1465                offset,
1466                _depth,
1467            )
1468        }
1469    }
1470    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FamilyName, D>>
1471        fidl::encoding::Encode<ProviderGetFontFamilyInfoRequest, D> for (T0,)
1472    {
1473        #[inline]
1474        unsafe fn encode(
1475            self,
1476            encoder: &mut fidl::encoding::Encoder<'_, D>,
1477            offset: usize,
1478            depth: fidl::encoding::Depth,
1479        ) -> fidl::Result<()> {
1480            encoder.debug_check_bounds::<ProviderGetFontFamilyInfoRequest>(offset);
1481            // Zero out padding regions. There's no need to apply masks
1482            // because the unmasked parts will be overwritten by fields.
1483            // Write the fields.
1484            self.0.encode(encoder, offset + 0, depth)?;
1485            Ok(())
1486        }
1487    }
1488
1489    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1490        for ProviderGetFontFamilyInfoRequest
1491    {
1492        #[inline(always)]
1493        fn new_empty() -> Self {
1494            Self { family: fidl::new_empty!(FamilyName, D) }
1495        }
1496
1497        #[inline]
1498        unsafe fn decode(
1499            &mut self,
1500            decoder: &mut fidl::encoding::Decoder<'_, D>,
1501            offset: usize,
1502            _depth: fidl::encoding::Depth,
1503        ) -> fidl::Result<()> {
1504            decoder.debug_check_bounds::<Self>(offset);
1505            // Verify that padding bytes are zero.
1506            fidl::decode!(FamilyName, D, &mut self.family, decoder, offset + 0, _depth)?;
1507            Ok(())
1508        }
1509    }
1510
1511    impl fidl::encoding::ValueTypeMarker for ProviderGetFontFamilyInfoResponse {
1512        type Borrowed<'a> = &'a Self;
1513        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1514            value
1515        }
1516    }
1517
1518    unsafe impl fidl::encoding::TypeMarker for ProviderGetFontFamilyInfoResponse {
1519        type Owned = Self;
1520
1521        #[inline(always)]
1522        fn inline_align(_context: fidl::encoding::Context) -> usize {
1523            8
1524        }
1525
1526        #[inline(always)]
1527        fn inline_size(_context: fidl::encoding::Context) -> usize {
1528            16
1529        }
1530    }
1531
1532    unsafe impl<D: fidl::encoding::ResourceDialect>
1533        fidl::encoding::Encode<ProviderGetFontFamilyInfoResponse, D>
1534        for &ProviderGetFontFamilyInfoResponse
1535    {
1536        #[inline]
1537        unsafe fn encode(
1538            self,
1539            encoder: &mut fidl::encoding::Encoder<'_, D>,
1540            offset: usize,
1541            _depth: fidl::encoding::Depth,
1542        ) -> fidl::Result<()> {
1543            encoder.debug_check_bounds::<ProviderGetFontFamilyInfoResponse>(offset);
1544            // Delegate to tuple encoding.
1545            fidl::encoding::Encode::<ProviderGetFontFamilyInfoResponse, D>::encode(
1546                (<FontFamilyInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.family_info),),
1547                encoder,
1548                offset,
1549                _depth,
1550            )
1551        }
1552    }
1553    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FontFamilyInfo, D>>
1554        fidl::encoding::Encode<ProviderGetFontFamilyInfoResponse, D> for (T0,)
1555    {
1556        #[inline]
1557        unsafe fn encode(
1558            self,
1559            encoder: &mut fidl::encoding::Encoder<'_, D>,
1560            offset: usize,
1561            depth: fidl::encoding::Depth,
1562        ) -> fidl::Result<()> {
1563            encoder.debug_check_bounds::<ProviderGetFontFamilyInfoResponse>(offset);
1564            // Zero out padding regions. There's no need to apply masks
1565            // because the unmasked parts will be overwritten by fields.
1566            // Write the fields.
1567            self.0.encode(encoder, offset + 0, depth)?;
1568            Ok(())
1569        }
1570    }
1571
1572    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1573        for ProviderGetFontFamilyInfoResponse
1574    {
1575        #[inline(always)]
1576        fn new_empty() -> Self {
1577            Self { family_info: fidl::new_empty!(FontFamilyInfo, D) }
1578        }
1579
1580        #[inline]
1581        unsafe fn decode(
1582            &mut self,
1583            decoder: &mut fidl::encoding::Decoder<'_, D>,
1584            offset: usize,
1585            _depth: fidl::encoding::Depth,
1586        ) -> fidl::Result<()> {
1587            decoder.debug_check_bounds::<Self>(offset);
1588            // Verify that padding bytes are zero.
1589            fidl::decode!(FontFamilyInfo, D, &mut self.family_info, decoder, offset + 0, _depth)?;
1590            Ok(())
1591        }
1592    }
1593
1594    impl fidl::encoding::ValueTypeMarker for ProviderGetFontRequest {
1595        type Borrowed<'a> = &'a Self;
1596        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1597            value
1598        }
1599    }
1600
1601    unsafe impl fidl::encoding::TypeMarker for ProviderGetFontRequest {
1602        type Owned = Self;
1603
1604        #[inline(always)]
1605        fn inline_align(_context: fidl::encoding::Context) -> usize {
1606            8
1607        }
1608
1609        #[inline(always)]
1610        fn inline_size(_context: fidl::encoding::Context) -> usize {
1611            64
1612        }
1613    }
1614
1615    unsafe impl<D: fidl::encoding::ResourceDialect>
1616        fidl::encoding::Encode<ProviderGetFontRequest, D> for &ProviderGetFontRequest
1617    {
1618        #[inline]
1619        unsafe fn encode(
1620            self,
1621            encoder: &mut fidl::encoding::Encoder<'_, D>,
1622            offset: usize,
1623            _depth: fidl::encoding::Depth,
1624        ) -> fidl::Result<()> {
1625            encoder.debug_check_bounds::<ProviderGetFontRequest>(offset);
1626            // Delegate to tuple encoding.
1627            fidl::encoding::Encode::<ProviderGetFontRequest, D>::encode(
1628                (<Request as fidl::encoding::ValueTypeMarker>::borrow(&self.request),),
1629                encoder,
1630                offset,
1631                _depth,
1632            )
1633        }
1634    }
1635    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Request, D>>
1636        fidl::encoding::Encode<ProviderGetFontRequest, D> for (T0,)
1637    {
1638        #[inline]
1639        unsafe fn encode(
1640            self,
1641            encoder: &mut fidl::encoding::Encoder<'_, D>,
1642            offset: usize,
1643            depth: fidl::encoding::Depth,
1644        ) -> fidl::Result<()> {
1645            encoder.debug_check_bounds::<ProviderGetFontRequest>(offset);
1646            // Zero out padding regions. There's no need to apply masks
1647            // because the unmasked parts will be overwritten by fields.
1648            // Write the fields.
1649            self.0.encode(encoder, offset + 0, depth)?;
1650            Ok(())
1651        }
1652    }
1653
1654    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1655        for ProviderGetFontRequest
1656    {
1657        #[inline(always)]
1658        fn new_empty() -> Self {
1659            Self { request: fidl::new_empty!(Request, D) }
1660        }
1661
1662        #[inline]
1663        unsafe fn decode(
1664            &mut self,
1665            decoder: &mut fidl::encoding::Decoder<'_, D>,
1666            offset: usize,
1667            _depth: fidl::encoding::Depth,
1668        ) -> fidl::Result<()> {
1669            decoder.debug_check_bounds::<Self>(offset);
1670            // Verify that padding bytes are zero.
1671            fidl::decode!(Request, D, &mut self.request, decoder, offset + 0, _depth)?;
1672            Ok(())
1673        }
1674    }
1675
1676    impl fidl::encoding::ValueTypeMarker for ProviderGetTypefaceRequest {
1677        type Borrowed<'a> = &'a Self;
1678        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1679            value
1680        }
1681    }
1682
1683    unsafe impl fidl::encoding::TypeMarker for ProviderGetTypefaceRequest {
1684        type Owned = Self;
1685
1686        #[inline(always)]
1687        fn inline_align(_context: fidl::encoding::Context) -> usize {
1688            8
1689        }
1690
1691        #[inline(always)]
1692        fn inline_size(_context: fidl::encoding::Context) -> usize {
1693            16
1694        }
1695    }
1696
1697    unsafe impl<D: fidl::encoding::ResourceDialect>
1698        fidl::encoding::Encode<ProviderGetTypefaceRequest, D> for &ProviderGetTypefaceRequest
1699    {
1700        #[inline]
1701        unsafe fn encode(
1702            self,
1703            encoder: &mut fidl::encoding::Encoder<'_, D>,
1704            offset: usize,
1705            _depth: fidl::encoding::Depth,
1706        ) -> fidl::Result<()> {
1707            encoder.debug_check_bounds::<ProviderGetTypefaceRequest>(offset);
1708            // Delegate to tuple encoding.
1709            fidl::encoding::Encode::<ProviderGetTypefaceRequest, D>::encode(
1710                (<TypefaceRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),),
1711                encoder,
1712                offset,
1713                _depth,
1714            )
1715        }
1716    }
1717    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TypefaceRequest, D>>
1718        fidl::encoding::Encode<ProviderGetTypefaceRequest, D> for (T0,)
1719    {
1720        #[inline]
1721        unsafe fn encode(
1722            self,
1723            encoder: &mut fidl::encoding::Encoder<'_, D>,
1724            offset: usize,
1725            depth: fidl::encoding::Depth,
1726        ) -> fidl::Result<()> {
1727            encoder.debug_check_bounds::<ProviderGetTypefaceRequest>(offset);
1728            // Zero out padding regions. There's no need to apply masks
1729            // because the unmasked parts will be overwritten by fields.
1730            // Write the fields.
1731            self.0.encode(encoder, offset + 0, depth)?;
1732            Ok(())
1733        }
1734    }
1735
1736    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1737        for ProviderGetTypefaceRequest
1738    {
1739        #[inline(always)]
1740        fn new_empty() -> Self {
1741            Self { request: fidl::new_empty!(TypefaceRequest, D) }
1742        }
1743
1744        #[inline]
1745        unsafe fn decode(
1746            &mut self,
1747            decoder: &mut fidl::encoding::Decoder<'_, D>,
1748            offset: usize,
1749            _depth: fidl::encoding::Depth,
1750        ) -> fidl::Result<()> {
1751            decoder.debug_check_bounds::<Self>(offset);
1752            // Verify that padding bytes are zero.
1753            fidl::decode!(TypefaceRequest, D, &mut self.request, decoder, offset + 0, _depth)?;
1754            Ok(())
1755        }
1756    }
1757
1758    impl fidl::encoding::ValueTypeMarker for Request {
1759        type Borrowed<'a> = &'a Self;
1760        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1761            value
1762        }
1763    }
1764
1765    unsafe impl fidl::encoding::TypeMarker for Request {
1766        type Owned = Self;
1767
1768        #[inline(always)]
1769        fn inline_align(_context: fidl::encoding::Context) -> usize {
1770            8
1771        }
1772
1773        #[inline(always)]
1774        fn inline_size(_context: fidl::encoding::Context) -> usize {
1775            64
1776        }
1777    }
1778
1779    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Request, D> for &Request {
1780        #[inline]
1781        unsafe fn encode(
1782            self,
1783            encoder: &mut fidl::encoding::Encoder<'_, D>,
1784            offset: usize,
1785            _depth: fidl::encoding::Depth,
1786        ) -> fidl::Result<()> {
1787            encoder.debug_check_bounds::<Request>(offset);
1788            // Delegate to tuple encoding.
1789            fidl::encoding::Encode::<Request, D>::encode(
1790                (
1791                    <fidl::encoding::Optional<fidl::encoding::BoundedString<128>> as fidl::encoding::ValueTypeMarker>::borrow(&self.family),
1792                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.weight),
1793                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
1794                    <Slant as fidl::encoding::ValueTypeMarker>::borrow(&self.slant),
1795                    <fidl::encoding::Optional<fidl::encoding::Vector<fidl::encoding::BoundedString<35>, 8>> as fidl::encoding::ValueTypeMarker>::borrow(&self.language),
1796                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.character),
1797                    <FallbackGroup as fidl::encoding::ValueTypeMarker>::borrow(&self.fallback_group),
1798                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
1799                ),
1800                encoder, offset, _depth
1801            )
1802        }
1803    }
1804    unsafe impl<
1805            D: fidl::encoding::ResourceDialect,
1806            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<128>>, D>,
1807            T1: fidl::encoding::Encode<u32, D>,
1808            T2: fidl::encoding::Encode<u32, D>,
1809            T3: fidl::encoding::Encode<Slant, D>,
1810            T4: fidl::encoding::Encode<
1811                fidl::encoding::Optional<
1812                    fidl::encoding::Vector<fidl::encoding::BoundedString<35>, 8>,
1813                >,
1814                D,
1815            >,
1816            T5: fidl::encoding::Encode<u32, D>,
1817            T6: fidl::encoding::Encode<FallbackGroup, D>,
1818            T7: fidl::encoding::Encode<u32, D>,
1819        > fidl::encoding::Encode<Request, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
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::<Request>(offset);
1829            // Zero out padding regions. There's no need to apply masks
1830            // because the unmasked parts will be overwritten by fields.
1831            unsafe {
1832                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1833                (ptr as *mut u64).write_unaligned(0);
1834            }
1835            unsafe {
1836                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
1837                (ptr as *mut u64).write_unaligned(0);
1838            }
1839            // Write the fields.
1840            self.0.encode(encoder, offset + 0, depth)?;
1841            self.1.encode(encoder, offset + 16, depth)?;
1842            self.2.encode(encoder, offset + 20, depth)?;
1843            self.3.encode(encoder, offset + 24, depth)?;
1844            self.4.encode(encoder, offset + 32, depth)?;
1845            self.5.encode(encoder, offset + 48, depth)?;
1846            self.6.encode(encoder, offset + 52, depth)?;
1847            self.7.encode(encoder, offset + 56, depth)?;
1848            Ok(())
1849        }
1850    }
1851
1852    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Request {
1853        #[inline(always)]
1854        fn new_empty() -> Self {
1855            Self {
1856                family: fidl::new_empty!(
1857                    fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1858                    D
1859                ),
1860                weight: fidl::new_empty!(u32, D),
1861                width: fidl::new_empty!(u32, D),
1862                slant: fidl::new_empty!(Slant, D),
1863                language: fidl::new_empty!(
1864                    fidl::encoding::Optional<
1865                        fidl::encoding::Vector<fidl::encoding::BoundedString<35>, 8>,
1866                    >,
1867                    D
1868                ),
1869                character: fidl::new_empty!(u32, D),
1870                fallback_group: fidl::new_empty!(FallbackGroup, D),
1871                flags: fidl::new_empty!(u32, D),
1872            }
1873        }
1874
1875        #[inline]
1876        unsafe fn decode(
1877            &mut self,
1878            decoder: &mut fidl::encoding::Decoder<'_, D>,
1879            offset: usize,
1880            _depth: fidl::encoding::Depth,
1881        ) -> fidl::Result<()> {
1882            decoder.debug_check_bounds::<Self>(offset);
1883            // Verify that padding bytes are zero.
1884            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1885            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1886            let mask = 0xffffffff00000000u64;
1887            let maskedval = padval & mask;
1888            if maskedval != 0 {
1889                return Err(fidl::Error::NonZeroPadding {
1890                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1891                });
1892            }
1893            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
1894            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1895            let mask = 0xffffffff00000000u64;
1896            let maskedval = padval & mask;
1897            if maskedval != 0 {
1898                return Err(fidl::Error::NonZeroPadding {
1899                    padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
1900                });
1901            }
1902            fidl::decode!(
1903                fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1904                D,
1905                &mut self.family,
1906                decoder,
1907                offset + 0,
1908                _depth
1909            )?;
1910            fidl::decode!(u32, D, &mut self.weight, decoder, offset + 16, _depth)?;
1911            fidl::decode!(u32, D, &mut self.width, decoder, offset + 20, _depth)?;
1912            fidl::decode!(Slant, D, &mut self.slant, decoder, offset + 24, _depth)?;
1913            fidl::decode!(
1914                fidl::encoding::Optional<
1915                    fidl::encoding::Vector<fidl::encoding::BoundedString<35>, 8>,
1916                >,
1917                D,
1918                &mut self.language,
1919                decoder,
1920                offset + 32,
1921                _depth
1922            )?;
1923            fidl::decode!(u32, D, &mut self.character, decoder, offset + 48, _depth)?;
1924            fidl::decode!(
1925                FallbackGroup,
1926                D,
1927                &mut self.fallback_group,
1928                decoder,
1929                offset + 52,
1930                _depth
1931            )?;
1932            fidl::decode!(u32, D, &mut self.flags, decoder, offset + 56, _depth)?;
1933            Ok(())
1934        }
1935    }
1936
1937    impl fidl::encoding::ValueTypeMarker for Style {
1938        type Borrowed<'a> = &'a Self;
1939        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1940            value
1941        }
1942    }
1943
1944    unsafe impl fidl::encoding::TypeMarker for Style {
1945        type Owned = Self;
1946
1947        #[inline(always)]
1948        fn inline_align(_context: fidl::encoding::Context) -> usize {
1949            4
1950        }
1951
1952        #[inline(always)]
1953        fn inline_size(_context: fidl::encoding::Context) -> usize {
1954            12
1955        }
1956    }
1957
1958    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Style, D> for &Style {
1959        #[inline]
1960        unsafe fn encode(
1961            self,
1962            encoder: &mut fidl::encoding::Encoder<'_, D>,
1963            offset: usize,
1964            _depth: fidl::encoding::Depth,
1965        ) -> fidl::Result<()> {
1966            encoder.debug_check_bounds::<Style>(offset);
1967            // Delegate to tuple encoding.
1968            fidl::encoding::Encode::<Style, D>::encode(
1969                (
1970                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.weight),
1971                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
1972                    <Slant as fidl::encoding::ValueTypeMarker>::borrow(&self.slant),
1973                ),
1974                encoder,
1975                offset,
1976                _depth,
1977            )
1978        }
1979    }
1980    unsafe impl<
1981            D: fidl::encoding::ResourceDialect,
1982            T0: fidl::encoding::Encode<u32, D>,
1983            T1: fidl::encoding::Encode<u32, D>,
1984            T2: fidl::encoding::Encode<Slant, D>,
1985        > fidl::encoding::Encode<Style, D> for (T0, T1, T2)
1986    {
1987        #[inline]
1988        unsafe fn encode(
1989            self,
1990            encoder: &mut fidl::encoding::Encoder<'_, D>,
1991            offset: usize,
1992            depth: fidl::encoding::Depth,
1993        ) -> fidl::Result<()> {
1994            encoder.debug_check_bounds::<Style>(offset);
1995            // Zero out padding regions. There's no need to apply masks
1996            // because the unmasked parts will be overwritten by fields.
1997            // Write the fields.
1998            self.0.encode(encoder, offset + 0, depth)?;
1999            self.1.encode(encoder, offset + 4, depth)?;
2000            self.2.encode(encoder, offset + 8, depth)?;
2001            Ok(())
2002        }
2003    }
2004
2005    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Style {
2006        #[inline(always)]
2007        fn new_empty() -> Self {
2008            Self {
2009                weight: fidl::new_empty!(u32, D),
2010                width: fidl::new_empty!(u32, D),
2011                slant: fidl::new_empty!(Slant, D),
2012            }
2013        }
2014
2015        #[inline]
2016        unsafe fn decode(
2017            &mut self,
2018            decoder: &mut fidl::encoding::Decoder<'_, D>,
2019            offset: usize,
2020            _depth: fidl::encoding::Depth,
2021        ) -> fidl::Result<()> {
2022            decoder.debug_check_bounds::<Self>(offset);
2023            // Verify that padding bytes are zero.
2024            fidl::decode!(u32, D, &mut self.weight, decoder, offset + 0, _depth)?;
2025            fidl::decode!(u32, D, &mut self.width, decoder, offset + 4, _depth)?;
2026            fidl::decode!(Slant, D, &mut self.slant, decoder, offset + 8, _depth)?;
2027            Ok(())
2028        }
2029    }
2030
2031    impl FontFamilyInfo {
2032        #[inline(always)]
2033        fn max_ordinal_present(&self) -> u64 {
2034            if let Some(_) = self.styles {
2035                return 2;
2036            }
2037            if let Some(_) = self.name {
2038                return 1;
2039            }
2040            0
2041        }
2042    }
2043
2044    impl fidl::encoding::ValueTypeMarker for FontFamilyInfo {
2045        type Borrowed<'a> = &'a Self;
2046        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2047            value
2048        }
2049    }
2050
2051    unsafe impl fidl::encoding::TypeMarker for FontFamilyInfo {
2052        type Owned = Self;
2053
2054        #[inline(always)]
2055        fn inline_align(_context: fidl::encoding::Context) -> usize {
2056            8
2057        }
2058
2059        #[inline(always)]
2060        fn inline_size(_context: fidl::encoding::Context) -> usize {
2061            16
2062        }
2063    }
2064
2065    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FontFamilyInfo, D>
2066        for &FontFamilyInfo
2067    {
2068        unsafe fn encode(
2069            self,
2070            encoder: &mut fidl::encoding::Encoder<'_, D>,
2071            offset: usize,
2072            mut depth: fidl::encoding::Depth,
2073        ) -> fidl::Result<()> {
2074            encoder.debug_check_bounds::<FontFamilyInfo>(offset);
2075            // Vector header
2076            let max_ordinal: u64 = self.max_ordinal_present();
2077            encoder.write_num(max_ordinal, offset);
2078            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2079            // Calling encoder.out_of_line_offset(0) is not allowed.
2080            if max_ordinal == 0 {
2081                return Ok(());
2082            }
2083            depth.increment()?;
2084            let envelope_size = 8;
2085            let bytes_len = max_ordinal as usize * envelope_size;
2086            #[allow(unused_variables)]
2087            let offset = encoder.out_of_line_offset(bytes_len);
2088            let mut _prev_end_offset: usize = 0;
2089            if 1 > max_ordinal {
2090                return Ok(());
2091            }
2092
2093            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2094            // are envelope_size bytes.
2095            let cur_offset: usize = (1 - 1) * envelope_size;
2096
2097            // Zero reserved fields.
2098            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2099
2100            // Safety:
2101            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2102            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2103            //   envelope_size bytes, there is always sufficient room.
2104            fidl::encoding::encode_in_envelope_optional::<FamilyName, D>(
2105                self.name.as_ref().map(<FamilyName as fidl::encoding::ValueTypeMarker>::borrow),
2106                encoder,
2107                offset + cur_offset,
2108                depth,
2109            )?;
2110
2111            _prev_end_offset = cur_offset + envelope_size;
2112            if 2 > max_ordinal {
2113                return Ok(());
2114            }
2115
2116            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2117            // are envelope_size bytes.
2118            let cur_offset: usize = (2 - 1) * envelope_size;
2119
2120            // Zero reserved fields.
2121            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2122
2123            // Safety:
2124            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2125            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2126            //   envelope_size bytes, there is always sufficient room.
2127            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Style2, 300>, D>(
2128            self.styles.as_ref().map(<fidl::encoding::Vector<Style2, 300> as fidl::encoding::ValueTypeMarker>::borrow),
2129            encoder, offset + cur_offset, depth
2130        )?;
2131
2132            _prev_end_offset = cur_offset + envelope_size;
2133
2134            Ok(())
2135        }
2136    }
2137
2138    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FontFamilyInfo {
2139        #[inline(always)]
2140        fn new_empty() -> Self {
2141            Self::default()
2142        }
2143
2144        unsafe fn decode(
2145            &mut self,
2146            decoder: &mut fidl::encoding::Decoder<'_, D>,
2147            offset: usize,
2148            mut depth: fidl::encoding::Depth,
2149        ) -> fidl::Result<()> {
2150            decoder.debug_check_bounds::<Self>(offset);
2151            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2152                None => return Err(fidl::Error::NotNullable),
2153                Some(len) => len,
2154            };
2155            // Calling decoder.out_of_line_offset(0) is not allowed.
2156            if len == 0 {
2157                return Ok(());
2158            };
2159            depth.increment()?;
2160            let envelope_size = 8;
2161            let bytes_len = len * envelope_size;
2162            let offset = decoder.out_of_line_offset(bytes_len)?;
2163            // Decode the envelope for each type.
2164            let mut _next_ordinal_to_read = 0;
2165            let mut next_offset = offset;
2166            let end_offset = offset + bytes_len;
2167            _next_ordinal_to_read += 1;
2168            if next_offset >= end_offset {
2169                return Ok(());
2170            }
2171
2172            // Decode unknown envelopes for gaps in ordinals.
2173            while _next_ordinal_to_read < 1 {
2174                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2175                _next_ordinal_to_read += 1;
2176                next_offset += envelope_size;
2177            }
2178
2179            let next_out_of_line = decoder.next_out_of_line();
2180            let handles_before = decoder.remaining_handles();
2181            if let Some((inlined, num_bytes, num_handles)) =
2182                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2183            {
2184                let member_inline_size =
2185                    <FamilyName as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2186                if inlined != (member_inline_size <= 4) {
2187                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2188                }
2189                let inner_offset;
2190                let mut inner_depth = depth.clone();
2191                if inlined {
2192                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2193                    inner_offset = next_offset;
2194                } else {
2195                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2196                    inner_depth.increment()?;
2197                }
2198                let val_ref = self.name.get_or_insert_with(|| fidl::new_empty!(FamilyName, D));
2199                fidl::decode!(FamilyName, D, val_ref, decoder, inner_offset, inner_depth)?;
2200                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2201                {
2202                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2203                }
2204                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2205                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2206                }
2207            }
2208
2209            next_offset += envelope_size;
2210            _next_ordinal_to_read += 1;
2211            if next_offset >= end_offset {
2212                return Ok(());
2213            }
2214
2215            // Decode unknown envelopes for gaps in ordinals.
2216            while _next_ordinal_to_read < 2 {
2217                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2218                _next_ordinal_to_read += 1;
2219                next_offset += envelope_size;
2220            }
2221
2222            let next_out_of_line = decoder.next_out_of_line();
2223            let handles_before = decoder.remaining_handles();
2224            if let Some((inlined, num_bytes, num_handles)) =
2225                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2226            {
2227                let member_inline_size = <fidl::encoding::Vector<Style2, 300> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2228                if inlined != (member_inline_size <= 4) {
2229                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2230                }
2231                let inner_offset;
2232                let mut inner_depth = depth.clone();
2233                if inlined {
2234                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2235                    inner_offset = next_offset;
2236                } else {
2237                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2238                    inner_depth.increment()?;
2239                }
2240                let val_ref = self.styles.get_or_insert_with(
2241                    || fidl::new_empty!(fidl::encoding::Vector<Style2, 300>, D),
2242                );
2243                fidl::decode!(fidl::encoding::Vector<Style2, 300>, D, val_ref, decoder, inner_offset, inner_depth)?;
2244                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2245                {
2246                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2247                }
2248                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2249                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2250                }
2251            }
2252
2253            next_offset += envelope_size;
2254
2255            // Decode the remaining unknown envelopes.
2256            while next_offset < end_offset {
2257                _next_ordinal_to_read += 1;
2258                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2259                next_offset += envelope_size;
2260            }
2261
2262            Ok(())
2263        }
2264    }
2265
2266    impl FontSetUpdatedEvent {
2267        #[inline(always)]
2268        fn max_ordinal_present(&self) -> u64 {
2269            0
2270        }
2271    }
2272
2273    impl fidl::encoding::ValueTypeMarker for FontSetUpdatedEvent {
2274        type Borrowed<'a> = &'a Self;
2275        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2276            value
2277        }
2278    }
2279
2280    unsafe impl fidl::encoding::TypeMarker for FontSetUpdatedEvent {
2281        type Owned = Self;
2282
2283        #[inline(always)]
2284        fn inline_align(_context: fidl::encoding::Context) -> usize {
2285            8
2286        }
2287
2288        #[inline(always)]
2289        fn inline_size(_context: fidl::encoding::Context) -> usize {
2290            16
2291        }
2292    }
2293
2294    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FontSetUpdatedEvent, D>
2295        for &FontSetUpdatedEvent
2296    {
2297        unsafe fn encode(
2298            self,
2299            encoder: &mut fidl::encoding::Encoder<'_, D>,
2300            offset: usize,
2301            mut depth: fidl::encoding::Depth,
2302        ) -> fidl::Result<()> {
2303            encoder.debug_check_bounds::<FontSetUpdatedEvent>(offset);
2304            // Vector header
2305            let max_ordinal: u64 = self.max_ordinal_present();
2306            encoder.write_num(max_ordinal, offset);
2307            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2308            // Calling encoder.out_of_line_offset(0) is not allowed.
2309            if max_ordinal == 0 {
2310                return Ok(());
2311            }
2312            depth.increment()?;
2313            let envelope_size = 8;
2314            let bytes_len = max_ordinal as usize * envelope_size;
2315            #[allow(unused_variables)]
2316            let offset = encoder.out_of_line_offset(bytes_len);
2317            let mut _prev_end_offset: usize = 0;
2318
2319            Ok(())
2320        }
2321    }
2322
2323    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FontSetUpdatedEvent {
2324        #[inline(always)]
2325        fn new_empty() -> Self {
2326            Self::default()
2327        }
2328
2329        unsafe fn decode(
2330            &mut self,
2331            decoder: &mut fidl::encoding::Decoder<'_, D>,
2332            offset: usize,
2333            mut depth: fidl::encoding::Depth,
2334        ) -> fidl::Result<()> {
2335            decoder.debug_check_bounds::<Self>(offset);
2336            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2337                None => return Err(fidl::Error::NotNullable),
2338                Some(len) => len,
2339            };
2340            // Calling decoder.out_of_line_offset(0) is not allowed.
2341            if len == 0 {
2342                return Ok(());
2343            };
2344            depth.increment()?;
2345            let envelope_size = 8;
2346            let bytes_len = len * envelope_size;
2347            let offset = decoder.out_of_line_offset(bytes_len)?;
2348            // Decode the envelope for each type.
2349            let mut _next_ordinal_to_read = 0;
2350            let mut next_offset = offset;
2351            let end_offset = offset + bytes_len;
2352
2353            // Decode the remaining unknown envelopes.
2354            while next_offset < end_offset {
2355                _next_ordinal_to_read += 1;
2356                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2357                next_offset += envelope_size;
2358            }
2359
2360            Ok(())
2361        }
2362    }
2363
2364    impl Style2 {
2365        #[inline(always)]
2366        fn max_ordinal_present(&self) -> u64 {
2367            if let Some(_) = self.width {
2368                return 3;
2369            }
2370            if let Some(_) = self.weight {
2371                return 2;
2372            }
2373            if let Some(_) = self.slant {
2374                return 1;
2375            }
2376            0
2377        }
2378    }
2379
2380    impl fidl::encoding::ValueTypeMarker for Style2 {
2381        type Borrowed<'a> = &'a Self;
2382        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2383            value
2384        }
2385    }
2386
2387    unsafe impl fidl::encoding::TypeMarker for Style2 {
2388        type Owned = Self;
2389
2390        #[inline(always)]
2391        fn inline_align(_context: fidl::encoding::Context) -> usize {
2392            8
2393        }
2394
2395        #[inline(always)]
2396        fn inline_size(_context: fidl::encoding::Context) -> usize {
2397            16
2398        }
2399    }
2400
2401    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Style2, D> for &Style2 {
2402        unsafe fn encode(
2403            self,
2404            encoder: &mut fidl::encoding::Encoder<'_, D>,
2405            offset: usize,
2406            mut depth: fidl::encoding::Depth,
2407        ) -> fidl::Result<()> {
2408            encoder.debug_check_bounds::<Style2>(offset);
2409            // Vector header
2410            let max_ordinal: u64 = self.max_ordinal_present();
2411            encoder.write_num(max_ordinal, offset);
2412            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2413            // Calling encoder.out_of_line_offset(0) is not allowed.
2414            if max_ordinal == 0 {
2415                return Ok(());
2416            }
2417            depth.increment()?;
2418            let envelope_size = 8;
2419            let bytes_len = max_ordinal as usize * envelope_size;
2420            #[allow(unused_variables)]
2421            let offset = encoder.out_of_line_offset(bytes_len);
2422            let mut _prev_end_offset: usize = 0;
2423            if 1 > max_ordinal {
2424                return Ok(());
2425            }
2426
2427            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2428            // are envelope_size bytes.
2429            let cur_offset: usize = (1 - 1) * envelope_size;
2430
2431            // Zero reserved fields.
2432            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2433
2434            // Safety:
2435            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2436            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2437            //   envelope_size bytes, there is always sufficient room.
2438            fidl::encoding::encode_in_envelope_optional::<Slant, D>(
2439                self.slant.as_ref().map(<Slant as fidl::encoding::ValueTypeMarker>::borrow),
2440                encoder,
2441                offset + cur_offset,
2442                depth,
2443            )?;
2444
2445            _prev_end_offset = cur_offset + envelope_size;
2446            if 2 > max_ordinal {
2447                return Ok(());
2448            }
2449
2450            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2451            // are envelope_size bytes.
2452            let cur_offset: usize = (2 - 1) * envelope_size;
2453
2454            // Zero reserved fields.
2455            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2456
2457            // Safety:
2458            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2459            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2460            //   envelope_size bytes, there is always sufficient room.
2461            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2462                self.weight.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2463                encoder,
2464                offset + cur_offset,
2465                depth,
2466            )?;
2467
2468            _prev_end_offset = cur_offset + envelope_size;
2469            if 3 > max_ordinal {
2470                return Ok(());
2471            }
2472
2473            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2474            // are envelope_size bytes.
2475            let cur_offset: usize = (3 - 1) * envelope_size;
2476
2477            // Zero reserved fields.
2478            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2479
2480            // Safety:
2481            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2482            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2483            //   envelope_size bytes, there is always sufficient room.
2484            fidl::encoding::encode_in_envelope_optional::<Width, D>(
2485                self.width.as_ref().map(<Width as fidl::encoding::ValueTypeMarker>::borrow),
2486                encoder,
2487                offset + cur_offset,
2488                depth,
2489            )?;
2490
2491            _prev_end_offset = cur_offset + envelope_size;
2492
2493            Ok(())
2494        }
2495    }
2496
2497    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Style2 {
2498        #[inline(always)]
2499        fn new_empty() -> Self {
2500            Self::default()
2501        }
2502
2503        unsafe fn decode(
2504            &mut self,
2505            decoder: &mut fidl::encoding::Decoder<'_, D>,
2506            offset: usize,
2507            mut depth: fidl::encoding::Depth,
2508        ) -> fidl::Result<()> {
2509            decoder.debug_check_bounds::<Self>(offset);
2510            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2511                None => return Err(fidl::Error::NotNullable),
2512                Some(len) => len,
2513            };
2514            // Calling decoder.out_of_line_offset(0) is not allowed.
2515            if len == 0 {
2516                return Ok(());
2517            };
2518            depth.increment()?;
2519            let envelope_size = 8;
2520            let bytes_len = len * envelope_size;
2521            let offset = decoder.out_of_line_offset(bytes_len)?;
2522            // Decode the envelope for each type.
2523            let mut _next_ordinal_to_read = 0;
2524            let mut next_offset = offset;
2525            let end_offset = offset + bytes_len;
2526            _next_ordinal_to_read += 1;
2527            if next_offset >= end_offset {
2528                return Ok(());
2529            }
2530
2531            // Decode unknown envelopes for gaps in ordinals.
2532            while _next_ordinal_to_read < 1 {
2533                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2534                _next_ordinal_to_read += 1;
2535                next_offset += envelope_size;
2536            }
2537
2538            let next_out_of_line = decoder.next_out_of_line();
2539            let handles_before = decoder.remaining_handles();
2540            if let Some((inlined, num_bytes, num_handles)) =
2541                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2542            {
2543                let member_inline_size =
2544                    <Slant as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2545                if inlined != (member_inline_size <= 4) {
2546                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2547                }
2548                let inner_offset;
2549                let mut inner_depth = depth.clone();
2550                if inlined {
2551                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2552                    inner_offset = next_offset;
2553                } else {
2554                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2555                    inner_depth.increment()?;
2556                }
2557                let val_ref = self.slant.get_or_insert_with(|| fidl::new_empty!(Slant, D));
2558                fidl::decode!(Slant, D, val_ref, decoder, inner_offset, inner_depth)?;
2559                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2560                {
2561                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2562                }
2563                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2564                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2565                }
2566            }
2567
2568            next_offset += envelope_size;
2569            _next_ordinal_to_read += 1;
2570            if next_offset >= end_offset {
2571                return Ok(());
2572            }
2573
2574            // Decode unknown envelopes for gaps in ordinals.
2575            while _next_ordinal_to_read < 2 {
2576                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2577                _next_ordinal_to_read += 1;
2578                next_offset += envelope_size;
2579            }
2580
2581            let next_out_of_line = decoder.next_out_of_line();
2582            let handles_before = decoder.remaining_handles();
2583            if let Some((inlined, num_bytes, num_handles)) =
2584                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2585            {
2586                let member_inline_size =
2587                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2588                if inlined != (member_inline_size <= 4) {
2589                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2590                }
2591                let inner_offset;
2592                let mut inner_depth = depth.clone();
2593                if inlined {
2594                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2595                    inner_offset = next_offset;
2596                } else {
2597                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2598                    inner_depth.increment()?;
2599                }
2600                let val_ref = self.weight.get_or_insert_with(|| fidl::new_empty!(u16, D));
2601                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2602                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2603                {
2604                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2605                }
2606                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2607                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2608                }
2609            }
2610
2611            next_offset += envelope_size;
2612            _next_ordinal_to_read += 1;
2613            if next_offset >= end_offset {
2614                return Ok(());
2615            }
2616
2617            // Decode unknown envelopes for gaps in ordinals.
2618            while _next_ordinal_to_read < 3 {
2619                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2620                _next_ordinal_to_read += 1;
2621                next_offset += envelope_size;
2622            }
2623
2624            let next_out_of_line = decoder.next_out_of_line();
2625            let handles_before = decoder.remaining_handles();
2626            if let Some((inlined, num_bytes, num_handles)) =
2627                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2628            {
2629                let member_inline_size =
2630                    <Width as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2631                if inlined != (member_inline_size <= 4) {
2632                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2633                }
2634                let inner_offset;
2635                let mut inner_depth = depth.clone();
2636                if inlined {
2637                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2638                    inner_offset = next_offset;
2639                } else {
2640                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2641                    inner_depth.increment()?;
2642                }
2643                let val_ref = self.width.get_or_insert_with(|| fidl::new_empty!(Width, D));
2644                fidl::decode!(Width, D, val_ref, decoder, inner_offset, inner_depth)?;
2645                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2646                {
2647                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2648                }
2649                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2650                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2651                }
2652            }
2653
2654            next_offset += envelope_size;
2655
2656            // Decode the remaining unknown envelopes.
2657            while next_offset < end_offset {
2658                _next_ordinal_to_read += 1;
2659                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2660                next_offset += envelope_size;
2661            }
2662
2663            Ok(())
2664        }
2665    }
2666
2667    impl TypefaceQuery {
2668        #[inline(always)]
2669        fn max_ordinal_present(&self) -> u64 {
2670            if let Some(_) = self.full_name {
2671                return 7;
2672            }
2673            if let Some(_) = self.postscript_name {
2674                return 6;
2675            }
2676            if let Some(_) = self.fallback_family {
2677                return 5;
2678            }
2679            if let Some(_) = self.code_points {
2680                return 4;
2681            }
2682            if let Some(_) = self.languages {
2683                return 3;
2684            }
2685            if let Some(_) = self.style {
2686                return 2;
2687            }
2688            if let Some(_) = self.family {
2689                return 1;
2690            }
2691            0
2692        }
2693    }
2694
2695    impl fidl::encoding::ValueTypeMarker for TypefaceQuery {
2696        type Borrowed<'a> = &'a Self;
2697        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2698            value
2699        }
2700    }
2701
2702    unsafe impl fidl::encoding::TypeMarker for TypefaceQuery {
2703        type Owned = Self;
2704
2705        #[inline(always)]
2706        fn inline_align(_context: fidl::encoding::Context) -> usize {
2707            8
2708        }
2709
2710        #[inline(always)]
2711        fn inline_size(_context: fidl::encoding::Context) -> usize {
2712            16
2713        }
2714    }
2715
2716    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TypefaceQuery, D>
2717        for &TypefaceQuery
2718    {
2719        unsafe fn encode(
2720            self,
2721            encoder: &mut fidl::encoding::Encoder<'_, D>,
2722            offset: usize,
2723            mut depth: fidl::encoding::Depth,
2724        ) -> fidl::Result<()> {
2725            encoder.debug_check_bounds::<TypefaceQuery>(offset);
2726            // Vector header
2727            let max_ordinal: u64 = self.max_ordinal_present();
2728            encoder.write_num(max_ordinal, offset);
2729            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2730            // Calling encoder.out_of_line_offset(0) is not allowed.
2731            if max_ordinal == 0 {
2732                return Ok(());
2733            }
2734            depth.increment()?;
2735            let envelope_size = 8;
2736            let bytes_len = max_ordinal as usize * envelope_size;
2737            #[allow(unused_variables)]
2738            let offset = encoder.out_of_line_offset(bytes_len);
2739            let mut _prev_end_offset: usize = 0;
2740            if 1 > max_ordinal {
2741                return Ok(());
2742            }
2743
2744            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2745            // are envelope_size bytes.
2746            let cur_offset: usize = (1 - 1) * envelope_size;
2747
2748            // Zero reserved fields.
2749            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2750
2751            // Safety:
2752            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2753            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2754            //   envelope_size bytes, there is always sufficient room.
2755            fidl::encoding::encode_in_envelope_optional::<FamilyName, D>(
2756                self.family.as_ref().map(<FamilyName as fidl::encoding::ValueTypeMarker>::borrow),
2757                encoder,
2758                offset + cur_offset,
2759                depth,
2760            )?;
2761
2762            _prev_end_offset = cur_offset + envelope_size;
2763            if 2 > max_ordinal {
2764                return Ok(());
2765            }
2766
2767            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2768            // are envelope_size bytes.
2769            let cur_offset: usize = (2 - 1) * envelope_size;
2770
2771            // Zero reserved fields.
2772            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2773
2774            // Safety:
2775            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2776            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2777            //   envelope_size bytes, there is always sufficient room.
2778            fidl::encoding::encode_in_envelope_optional::<Style2, D>(
2779                self.style.as_ref().map(<Style2 as fidl::encoding::ValueTypeMarker>::borrow),
2780                encoder,
2781                offset + cur_offset,
2782                depth,
2783            )?;
2784
2785            _prev_end_offset = cur_offset + envelope_size;
2786            if 3 > max_ordinal {
2787                return Ok(());
2788            }
2789
2790            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2791            // are envelope_size bytes.
2792            let cur_offset: usize = (3 - 1) * envelope_size;
2793
2794            // Zero reserved fields.
2795            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2796
2797            // Safety:
2798            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2799            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2800            //   envelope_size bytes, there is always sufficient room.
2801            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 8>, D>(
2802            self.languages.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 8> as fidl::encoding::ValueTypeMarker>::borrow),
2803            encoder, offset + cur_offset, depth
2804        )?;
2805
2806            _prev_end_offset = cur_offset + envelope_size;
2807            if 4 > max_ordinal {
2808                return Ok(());
2809            }
2810
2811            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2812            // are envelope_size bytes.
2813            let cur_offset: usize = (4 - 1) * envelope_size;
2814
2815            // Zero reserved fields.
2816            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2817
2818            // Safety:
2819            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2820            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2821            //   envelope_size bytes, there is always sufficient room.
2822            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u32, 128>, D>(
2823                self.code_points.as_ref().map(
2824                    <fidl::encoding::Vector<u32, 128> as fidl::encoding::ValueTypeMarker>::borrow,
2825                ),
2826                encoder,
2827                offset + cur_offset,
2828                depth,
2829            )?;
2830
2831            _prev_end_offset = cur_offset + envelope_size;
2832            if 5 > max_ordinal {
2833                return Ok(());
2834            }
2835
2836            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2837            // are envelope_size bytes.
2838            let cur_offset: usize = (5 - 1) * envelope_size;
2839
2840            // Zero reserved fields.
2841            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2842
2843            // Safety:
2844            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2845            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2846            //   envelope_size bytes, there is always sufficient room.
2847            fidl::encoding::encode_in_envelope_optional::<GenericFontFamily, D>(
2848                self.fallback_family
2849                    .as_ref()
2850                    .map(<GenericFontFamily as fidl::encoding::ValueTypeMarker>::borrow),
2851                encoder,
2852                offset + cur_offset,
2853                depth,
2854            )?;
2855
2856            _prev_end_offset = cur_offset + envelope_size;
2857            if 6 > max_ordinal {
2858                return Ok(());
2859            }
2860
2861            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2862            // are envelope_size bytes.
2863            let cur_offset: usize = (6 - 1) * envelope_size;
2864
2865            // Zero reserved fields.
2866            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2867
2868            // Safety:
2869            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2870            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2871            //   envelope_size bytes, there is always sufficient room.
2872            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<63>, D>(
2873                self.postscript_name.as_ref().map(
2874                    <fidl::encoding::BoundedString<63> as fidl::encoding::ValueTypeMarker>::borrow,
2875                ),
2876                encoder,
2877                offset + cur_offset,
2878                depth,
2879            )?;
2880
2881            _prev_end_offset = cur_offset + envelope_size;
2882            if 7 > max_ordinal {
2883                return Ok(());
2884            }
2885
2886            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2887            // are envelope_size bytes.
2888            let cur_offset: usize = (7 - 1) * envelope_size;
2889
2890            // Zero reserved fields.
2891            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2892
2893            // Safety:
2894            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2895            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2896            //   envelope_size bytes, there is always sufficient room.
2897            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
2898                self.full_name.as_ref().map(
2899                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
2900                ),
2901                encoder,
2902                offset + cur_offset,
2903                depth,
2904            )?;
2905
2906            _prev_end_offset = cur_offset + envelope_size;
2907
2908            Ok(())
2909        }
2910    }
2911
2912    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TypefaceQuery {
2913        #[inline(always)]
2914        fn new_empty() -> Self {
2915            Self::default()
2916        }
2917
2918        unsafe fn decode(
2919            &mut self,
2920            decoder: &mut fidl::encoding::Decoder<'_, D>,
2921            offset: usize,
2922            mut depth: fidl::encoding::Depth,
2923        ) -> fidl::Result<()> {
2924            decoder.debug_check_bounds::<Self>(offset);
2925            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2926                None => return Err(fidl::Error::NotNullable),
2927                Some(len) => len,
2928            };
2929            // Calling decoder.out_of_line_offset(0) is not allowed.
2930            if len == 0 {
2931                return Ok(());
2932            };
2933            depth.increment()?;
2934            let envelope_size = 8;
2935            let bytes_len = len * envelope_size;
2936            let offset = decoder.out_of_line_offset(bytes_len)?;
2937            // Decode the envelope for each type.
2938            let mut _next_ordinal_to_read = 0;
2939            let mut next_offset = offset;
2940            let end_offset = offset + bytes_len;
2941            _next_ordinal_to_read += 1;
2942            if next_offset >= end_offset {
2943                return Ok(());
2944            }
2945
2946            // Decode unknown envelopes for gaps in ordinals.
2947            while _next_ordinal_to_read < 1 {
2948                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2949                _next_ordinal_to_read += 1;
2950                next_offset += envelope_size;
2951            }
2952
2953            let next_out_of_line = decoder.next_out_of_line();
2954            let handles_before = decoder.remaining_handles();
2955            if let Some((inlined, num_bytes, num_handles)) =
2956                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2957            {
2958                let member_inline_size =
2959                    <FamilyName as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2960                if inlined != (member_inline_size <= 4) {
2961                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2962                }
2963                let inner_offset;
2964                let mut inner_depth = depth.clone();
2965                if inlined {
2966                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2967                    inner_offset = next_offset;
2968                } else {
2969                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2970                    inner_depth.increment()?;
2971                }
2972                let val_ref = self.family.get_or_insert_with(|| fidl::new_empty!(FamilyName, D));
2973                fidl::decode!(FamilyName, D, val_ref, decoder, inner_offset, inner_depth)?;
2974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2975                {
2976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2977                }
2978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2980                }
2981            }
2982
2983            next_offset += envelope_size;
2984            _next_ordinal_to_read += 1;
2985            if next_offset >= end_offset {
2986                return Ok(());
2987            }
2988
2989            // Decode unknown envelopes for gaps in ordinals.
2990            while _next_ordinal_to_read < 2 {
2991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2992                _next_ordinal_to_read += 1;
2993                next_offset += envelope_size;
2994            }
2995
2996            let next_out_of_line = decoder.next_out_of_line();
2997            let handles_before = decoder.remaining_handles();
2998            if let Some((inlined, num_bytes, num_handles)) =
2999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3000            {
3001                let member_inline_size =
3002                    <Style2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3003                if inlined != (member_inline_size <= 4) {
3004                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3005                }
3006                let inner_offset;
3007                let mut inner_depth = depth.clone();
3008                if inlined {
3009                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3010                    inner_offset = next_offset;
3011                } else {
3012                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3013                    inner_depth.increment()?;
3014                }
3015                let val_ref = self.style.get_or_insert_with(|| fidl::new_empty!(Style2, D));
3016                fidl::decode!(Style2, D, val_ref, decoder, inner_offset, inner_depth)?;
3017                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3018                {
3019                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3020                }
3021                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3022                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3023                }
3024            }
3025
3026            next_offset += envelope_size;
3027            _next_ordinal_to_read += 1;
3028            if next_offset >= end_offset {
3029                return Ok(());
3030            }
3031
3032            // Decode unknown envelopes for gaps in ordinals.
3033            while _next_ordinal_to_read < 3 {
3034                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3035                _next_ordinal_to_read += 1;
3036                next_offset += envelope_size;
3037            }
3038
3039            let next_out_of_line = decoder.next_out_of_line();
3040            let handles_before = decoder.remaining_handles();
3041            if let Some((inlined, num_bytes, num_handles)) =
3042                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3043            {
3044                let member_inline_size = <fidl::encoding::Vector<
3045                    fidl_fuchsia_intl__common::LocaleId,
3046                    8,
3047                > as fidl::encoding::TypeMarker>::inline_size(
3048                    decoder.context
3049                );
3050                if inlined != (member_inline_size <= 4) {
3051                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3052                }
3053                let inner_offset;
3054                let mut inner_depth = depth.clone();
3055                if inlined {
3056                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3057                    inner_offset = next_offset;
3058                } else {
3059                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3060                    inner_depth.increment()?;
3061                }
3062                let val_ref =
3063                self.languages.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 8>, D));
3064                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
3065                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3066                {
3067                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3068                }
3069                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3070                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3071                }
3072            }
3073
3074            next_offset += envelope_size;
3075            _next_ordinal_to_read += 1;
3076            if next_offset >= end_offset {
3077                return Ok(());
3078            }
3079
3080            // Decode unknown envelopes for gaps in ordinals.
3081            while _next_ordinal_to_read < 4 {
3082                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3083                _next_ordinal_to_read += 1;
3084                next_offset += envelope_size;
3085            }
3086
3087            let next_out_of_line = decoder.next_out_of_line();
3088            let handles_before = decoder.remaining_handles();
3089            if let Some((inlined, num_bytes, num_handles)) =
3090                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3091            {
3092                let member_inline_size =
3093                    <fidl::encoding::Vector<u32, 128> as fidl::encoding::TypeMarker>::inline_size(
3094                        decoder.context,
3095                    );
3096                if inlined != (member_inline_size <= 4) {
3097                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3098                }
3099                let inner_offset;
3100                let mut inner_depth = depth.clone();
3101                if inlined {
3102                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3103                    inner_offset = next_offset;
3104                } else {
3105                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3106                    inner_depth.increment()?;
3107                }
3108                let val_ref = self
3109                    .code_points
3110                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u32, 128>, D));
3111                fidl::decode!(fidl::encoding::Vector<u32, 128>, D, val_ref, decoder, inner_offset, inner_depth)?;
3112                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3113                {
3114                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3115                }
3116                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3117                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3118                }
3119            }
3120
3121            next_offset += envelope_size;
3122            _next_ordinal_to_read += 1;
3123            if next_offset >= end_offset {
3124                return Ok(());
3125            }
3126
3127            // Decode unknown envelopes for gaps in ordinals.
3128            while _next_ordinal_to_read < 5 {
3129                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3130                _next_ordinal_to_read += 1;
3131                next_offset += envelope_size;
3132            }
3133
3134            let next_out_of_line = decoder.next_out_of_line();
3135            let handles_before = decoder.remaining_handles();
3136            if let Some((inlined, num_bytes, num_handles)) =
3137                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3138            {
3139                let member_inline_size =
3140                    <GenericFontFamily as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3141                if inlined != (member_inline_size <= 4) {
3142                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3143                }
3144                let inner_offset;
3145                let mut inner_depth = depth.clone();
3146                if inlined {
3147                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3148                    inner_offset = next_offset;
3149                } else {
3150                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3151                    inner_depth.increment()?;
3152                }
3153                let val_ref = self
3154                    .fallback_family
3155                    .get_or_insert_with(|| fidl::new_empty!(GenericFontFamily, D));
3156                fidl::decode!(GenericFontFamily, D, val_ref, decoder, inner_offset, inner_depth)?;
3157                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3158                {
3159                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3160                }
3161                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3162                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3163                }
3164            }
3165
3166            next_offset += envelope_size;
3167            _next_ordinal_to_read += 1;
3168            if next_offset >= end_offset {
3169                return Ok(());
3170            }
3171
3172            // Decode unknown envelopes for gaps in ordinals.
3173            while _next_ordinal_to_read < 6 {
3174                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3175                _next_ordinal_to_read += 1;
3176                next_offset += envelope_size;
3177            }
3178
3179            let next_out_of_line = decoder.next_out_of_line();
3180            let handles_before = decoder.remaining_handles();
3181            if let Some((inlined, num_bytes, num_handles)) =
3182                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3183            {
3184                let member_inline_size =
3185                    <fidl::encoding::BoundedString<63> as fidl::encoding::TypeMarker>::inline_size(
3186                        decoder.context,
3187                    );
3188                if inlined != (member_inline_size <= 4) {
3189                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3190                }
3191                let inner_offset;
3192                let mut inner_depth = depth.clone();
3193                if inlined {
3194                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3195                    inner_offset = next_offset;
3196                } else {
3197                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3198                    inner_depth.increment()?;
3199                }
3200                let val_ref = self
3201                    .postscript_name
3202                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<63>, D));
3203                fidl::decode!(
3204                    fidl::encoding::BoundedString<63>,
3205                    D,
3206                    val_ref,
3207                    decoder,
3208                    inner_offset,
3209                    inner_depth
3210                )?;
3211                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3212                {
3213                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3214                }
3215                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3216                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3217                }
3218            }
3219
3220            next_offset += envelope_size;
3221            _next_ordinal_to_read += 1;
3222            if next_offset >= end_offset {
3223                return Ok(());
3224            }
3225
3226            // Decode unknown envelopes for gaps in ordinals.
3227            while _next_ordinal_to_read < 7 {
3228                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3229                _next_ordinal_to_read += 1;
3230                next_offset += envelope_size;
3231            }
3232
3233            let next_out_of_line = decoder.next_out_of_line();
3234            let handles_before = decoder.remaining_handles();
3235            if let Some((inlined, num_bytes, num_handles)) =
3236                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3237            {
3238                let member_inline_size =
3239                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
3240                        decoder.context,
3241                    );
3242                if inlined != (member_inline_size <= 4) {
3243                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3244                }
3245                let inner_offset;
3246                let mut inner_depth = depth.clone();
3247                if inlined {
3248                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3249                    inner_offset = next_offset;
3250                } else {
3251                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3252                    inner_depth.increment()?;
3253                }
3254                let val_ref = self
3255                    .full_name
3256                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
3257                fidl::decode!(
3258                    fidl::encoding::BoundedString<128>,
3259                    D,
3260                    val_ref,
3261                    decoder,
3262                    inner_offset,
3263                    inner_depth
3264                )?;
3265                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3266                {
3267                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3268                }
3269                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3270                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3271                }
3272            }
3273
3274            next_offset += envelope_size;
3275
3276            // Decode the remaining unknown envelopes.
3277            while next_offset < end_offset {
3278                _next_ordinal_to_read += 1;
3279                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3280                next_offset += envelope_size;
3281            }
3282
3283            Ok(())
3284        }
3285    }
3286
3287    impl TypefaceRequest {
3288        #[inline(always)]
3289        fn max_ordinal_present(&self) -> u64 {
3290            if let Some(_) = self.cache_miss_policy {
3291                return 3;
3292            }
3293            if let Some(_) = self.flags {
3294                return 2;
3295            }
3296            if let Some(_) = self.query {
3297                return 1;
3298            }
3299            0
3300        }
3301    }
3302
3303    impl fidl::encoding::ValueTypeMarker for TypefaceRequest {
3304        type Borrowed<'a> = &'a Self;
3305        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3306            value
3307        }
3308    }
3309
3310    unsafe impl fidl::encoding::TypeMarker for TypefaceRequest {
3311        type Owned = Self;
3312
3313        #[inline(always)]
3314        fn inline_align(_context: fidl::encoding::Context) -> usize {
3315            8
3316        }
3317
3318        #[inline(always)]
3319        fn inline_size(_context: fidl::encoding::Context) -> usize {
3320            16
3321        }
3322    }
3323
3324    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TypefaceRequest, D>
3325        for &TypefaceRequest
3326    {
3327        unsafe fn encode(
3328            self,
3329            encoder: &mut fidl::encoding::Encoder<'_, D>,
3330            offset: usize,
3331            mut depth: fidl::encoding::Depth,
3332        ) -> fidl::Result<()> {
3333            encoder.debug_check_bounds::<TypefaceRequest>(offset);
3334            // Vector header
3335            let max_ordinal: u64 = self.max_ordinal_present();
3336            encoder.write_num(max_ordinal, offset);
3337            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3338            // Calling encoder.out_of_line_offset(0) is not allowed.
3339            if max_ordinal == 0 {
3340                return Ok(());
3341            }
3342            depth.increment()?;
3343            let envelope_size = 8;
3344            let bytes_len = max_ordinal as usize * envelope_size;
3345            #[allow(unused_variables)]
3346            let offset = encoder.out_of_line_offset(bytes_len);
3347            let mut _prev_end_offset: usize = 0;
3348            if 1 > max_ordinal {
3349                return Ok(());
3350            }
3351
3352            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3353            // are envelope_size bytes.
3354            let cur_offset: usize = (1 - 1) * envelope_size;
3355
3356            // Zero reserved fields.
3357            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3358
3359            // Safety:
3360            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3361            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3362            //   envelope_size bytes, there is always sufficient room.
3363            fidl::encoding::encode_in_envelope_optional::<TypefaceQuery, D>(
3364                self.query.as_ref().map(<TypefaceQuery as fidl::encoding::ValueTypeMarker>::borrow),
3365                encoder,
3366                offset + cur_offset,
3367                depth,
3368            )?;
3369
3370            _prev_end_offset = cur_offset + envelope_size;
3371            if 2 > max_ordinal {
3372                return Ok(());
3373            }
3374
3375            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3376            // are envelope_size bytes.
3377            let cur_offset: usize = (2 - 1) * envelope_size;
3378
3379            // Zero reserved fields.
3380            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3381
3382            // Safety:
3383            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3384            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3385            //   envelope_size bytes, there is always sufficient room.
3386            fidl::encoding::encode_in_envelope_optional::<TypefaceRequestFlags, D>(
3387                self.flags
3388                    .as_ref()
3389                    .map(<TypefaceRequestFlags as fidl::encoding::ValueTypeMarker>::borrow),
3390                encoder,
3391                offset + cur_offset,
3392                depth,
3393            )?;
3394
3395            _prev_end_offset = cur_offset + envelope_size;
3396            if 3 > max_ordinal {
3397                return Ok(());
3398            }
3399
3400            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3401            // are envelope_size bytes.
3402            let cur_offset: usize = (3 - 1) * envelope_size;
3403
3404            // Zero reserved fields.
3405            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3406
3407            // Safety:
3408            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3409            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3410            //   envelope_size bytes, there is always sufficient room.
3411            fidl::encoding::encode_in_envelope_optional::<CacheMissPolicy, D>(
3412                self.cache_miss_policy
3413                    .as_ref()
3414                    .map(<CacheMissPolicy as fidl::encoding::ValueTypeMarker>::borrow),
3415                encoder,
3416                offset + cur_offset,
3417                depth,
3418            )?;
3419
3420            _prev_end_offset = cur_offset + envelope_size;
3421
3422            Ok(())
3423        }
3424    }
3425
3426    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TypefaceRequest {
3427        #[inline(always)]
3428        fn new_empty() -> Self {
3429            Self::default()
3430        }
3431
3432        unsafe fn decode(
3433            &mut self,
3434            decoder: &mut fidl::encoding::Decoder<'_, D>,
3435            offset: usize,
3436            mut depth: fidl::encoding::Depth,
3437        ) -> fidl::Result<()> {
3438            decoder.debug_check_bounds::<Self>(offset);
3439            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3440                None => return Err(fidl::Error::NotNullable),
3441                Some(len) => len,
3442            };
3443            // Calling decoder.out_of_line_offset(0) is not allowed.
3444            if len == 0 {
3445                return Ok(());
3446            };
3447            depth.increment()?;
3448            let envelope_size = 8;
3449            let bytes_len = len * envelope_size;
3450            let offset = decoder.out_of_line_offset(bytes_len)?;
3451            // Decode the envelope for each type.
3452            let mut _next_ordinal_to_read = 0;
3453            let mut next_offset = offset;
3454            let end_offset = offset + bytes_len;
3455            _next_ordinal_to_read += 1;
3456            if next_offset >= end_offset {
3457                return Ok(());
3458            }
3459
3460            // Decode unknown envelopes for gaps in ordinals.
3461            while _next_ordinal_to_read < 1 {
3462                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3463                _next_ordinal_to_read += 1;
3464                next_offset += envelope_size;
3465            }
3466
3467            let next_out_of_line = decoder.next_out_of_line();
3468            let handles_before = decoder.remaining_handles();
3469            if let Some((inlined, num_bytes, num_handles)) =
3470                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3471            {
3472                let member_inline_size =
3473                    <TypefaceQuery as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3474                if inlined != (member_inline_size <= 4) {
3475                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3476                }
3477                let inner_offset;
3478                let mut inner_depth = depth.clone();
3479                if inlined {
3480                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3481                    inner_offset = next_offset;
3482                } else {
3483                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3484                    inner_depth.increment()?;
3485                }
3486                let val_ref = self.query.get_or_insert_with(|| fidl::new_empty!(TypefaceQuery, D));
3487                fidl::decode!(TypefaceQuery, D, val_ref, decoder, inner_offset, inner_depth)?;
3488                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3489                {
3490                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3491                }
3492                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3493                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3494                }
3495            }
3496
3497            next_offset += envelope_size;
3498            _next_ordinal_to_read += 1;
3499            if next_offset >= end_offset {
3500                return Ok(());
3501            }
3502
3503            // Decode unknown envelopes for gaps in ordinals.
3504            while _next_ordinal_to_read < 2 {
3505                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3506                _next_ordinal_to_read += 1;
3507                next_offset += envelope_size;
3508            }
3509
3510            let next_out_of_line = decoder.next_out_of_line();
3511            let handles_before = decoder.remaining_handles();
3512            if let Some((inlined, num_bytes, num_handles)) =
3513                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3514            {
3515                let member_inline_size =
3516                    <TypefaceRequestFlags as fidl::encoding::TypeMarker>::inline_size(
3517                        decoder.context,
3518                    );
3519                if inlined != (member_inline_size <= 4) {
3520                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3521                }
3522                let inner_offset;
3523                let mut inner_depth = depth.clone();
3524                if inlined {
3525                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3526                    inner_offset = next_offset;
3527                } else {
3528                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3529                    inner_depth.increment()?;
3530                }
3531                let val_ref =
3532                    self.flags.get_or_insert_with(|| fidl::new_empty!(TypefaceRequestFlags, D));
3533                fidl::decode!(
3534                    TypefaceRequestFlags,
3535                    D,
3536                    val_ref,
3537                    decoder,
3538                    inner_offset,
3539                    inner_depth
3540                )?;
3541                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3542                {
3543                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3544                }
3545                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3546                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3547                }
3548            }
3549
3550            next_offset += envelope_size;
3551            _next_ordinal_to_read += 1;
3552            if next_offset >= end_offset {
3553                return Ok(());
3554            }
3555
3556            // Decode unknown envelopes for gaps in ordinals.
3557            while _next_ordinal_to_read < 3 {
3558                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3559                _next_ordinal_to_read += 1;
3560                next_offset += envelope_size;
3561            }
3562
3563            let next_out_of_line = decoder.next_out_of_line();
3564            let handles_before = decoder.remaining_handles();
3565            if let Some((inlined, num_bytes, num_handles)) =
3566                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3567            {
3568                let member_inline_size =
3569                    <CacheMissPolicy as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3570                if inlined != (member_inline_size <= 4) {
3571                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3572                }
3573                let inner_offset;
3574                let mut inner_depth = depth.clone();
3575                if inlined {
3576                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3577                    inner_offset = next_offset;
3578                } else {
3579                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3580                    inner_depth.increment()?;
3581                }
3582                let val_ref = self
3583                    .cache_miss_policy
3584                    .get_or_insert_with(|| fidl::new_empty!(CacheMissPolicy, D));
3585                fidl::decode!(CacheMissPolicy, D, val_ref, decoder, inner_offset, inner_depth)?;
3586                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3587                {
3588                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3589                }
3590                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3591                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3592                }
3593            }
3594
3595            next_offset += envelope_size;
3596
3597            // Decode the remaining unknown envelopes.
3598            while next_offset < end_offset {
3599                _next_ordinal_to_read += 1;
3600                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3601                next_offset += envelope_size;
3602            }
3603
3604            Ok(())
3605        }
3606    }
3607}