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