Skip to main content

fidl_fuchsia_pkg_common/
fidl_fuchsia_pkg_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// The maximum number of bytes for a `ResolutionContext`.
12///
13/// Note that this value must be less than or equal to
14/// `fuchsia.component.resolution::MAX_RESOLUTION_CONTEXT_SIZE`, since the
15/// component resolver is expected to copy or contain the context provided by
16/// the package resolver.
17pub const MAX_RESOLUTION_CONTEXT_SIZE: u32 = 8192;
18
19#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
20#[repr(u32)]
21pub enum AuthorityLookupError {
22    /// `package_url` was not a valid package URL.
23    InvalidUrl = 1,
24    /// `package_url` was pinned, which is not allowed.
25    PinnedUrlNotAllowed = 2,
26    /// This `Authority` is not aware of the repository indicated by `package_url`.
27    RepositoryNotFound = 3,
28    /// The repository indicated by `package_url` does not contain the indicated package.
29    PackageNotFound = 4,
30    /// This `Authority` failed to communicate with an upstream authority of its own, so this
31    /// `Authority` does not know if it has the package. Clients may attempt to fallback to a
32    /// different authority.
33    UpstreamConnection = 5,
34    /// There was an error with the configuration or operation of this `Authority` or its
35    /// dependencies.
36    Internal = 6,
37}
38
39impl AuthorityLookupError {
40    #[inline]
41    pub fn from_primitive(prim: u32) -> Option<Self> {
42        match prim {
43            1 => Some(Self::InvalidUrl),
44            2 => Some(Self::PinnedUrlNotAllowed),
45            3 => Some(Self::RepositoryNotFound),
46            4 => Some(Self::PackageNotFound),
47            5 => Some(Self::UpstreamConnection),
48            6 => Some(Self::Internal),
49            _ => None,
50        }
51    }
52
53    #[inline]
54    pub const fn into_primitive(self) -> u32 {
55        self as u32
56    }
57}
58
59/// Error type for [`NeededBlobs.BlobWritten`].
60#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
61#[repr(u32)]
62pub enum BlobWrittenError {
63    /// Client called BlobWritten but blob was not readable in blobfs.
64    NotWritten = 1,
65    /// Client called BlobWritten for a blob it has not yet opened.
66    UnopenedBlob = 2,
67}
68
69impl BlobWrittenError {
70    #[inline]
71    pub fn from_primitive(prim: u32) -> Option<Self> {
72        match prim {
73            1 => Some(Self::NotWritten),
74            2 => Some(Self::UnopenedBlob),
75            _ => None,
76        }
77    }
78
79    #[inline]
80    pub const fn into_primitive(self) -> u32 {
81        self as u32
82    }
83}
84
85/// How the package served by [`PackageCache.Get`] should be protected from GC.
86#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
87#[repr(u32)]
88pub enum GcProtection {
89    /// Package will be protected from GC as long as there is an open connection to the directory.
90    OpenPackageTracking = 1,
91    /// Package will be protected from GC as long as it is in the Retained index, which is
92    /// controlled by the [`RetainedPackages`] protocol. Client is responsible for ensuring
93    /// the package is in the Retained index.
94    Retained = 2,
95}
96
97impl GcProtection {
98    #[inline]
99    pub fn from_primitive(prim: u32) -> Option<Self> {
100        match prim {
101            1 => Some(Self::OpenPackageTracking),
102            2 => Some(Self::Retained),
103            _ => None,
104        }
105    }
106
107    #[inline]
108    pub const fn into_primitive(self) -> u32 {
109        self as u32
110    }
111}
112
113#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
114#[repr(u32)]
115pub enum GetInfoError {
116    /// The URL is not a known eager package.
117    UnknownUrl = 1,
118    /// The CUP data associated with the eager package failed verification.
119    Verification = 2,
120    /// The URL is a known eager package, but there are no packages available.
121    NotAvailable = 3,
122}
123
124impl GetInfoError {
125    #[inline]
126    pub fn from_primitive(prim: u32) -> Option<Self> {
127        match prim {
128            1 => Some(Self::UnknownUrl),
129            2 => Some(Self::Verification),
130            3 => Some(Self::NotAvailable),
131            _ => None,
132        }
133    }
134
135    #[inline]
136    pub const fn into_primitive(self) -> u32 {
137        self as u32
138    }
139}
140
141/// Error type for [`PackageCache.GetSubpackage`].
142#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
143#[repr(u32)]
144pub enum GetSubpackageError {
145    /// The superpackage was not open.
146    SuperpackageClosed = 1,
147    /// The requested subpackage does not exist.
148    DoesNotExist = 2,
149    /// An unspecified error occurred.
150    Internal = 3,
151}
152
153impl GetSubpackageError {
154    #[inline]
155    pub fn from_primitive(prim: u32) -> Option<Self> {
156        match prim {
157            1 => Some(Self::SuperpackageClosed),
158            2 => Some(Self::DoesNotExist),
159            3 => Some(Self::Internal),
160            _ => None,
161        }
162    }
163
164    #[inline]
165    pub const fn into_primitive(self) -> u32 {
166        self as u32
167    }
168}
169
170/// Error type for [`NeededBlobs.OpenMetaBlob`] and [`NeededBlobs.OpenBlob`].
171#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
172#[repr(u32)]
173pub enum OpenBlobError {
174    /// There is insufficient storage space available to persist this blob.
175    OutOfSpace = 1,
176    /// This blob is already open for write by another cache operation.
177    ConcurrentWrite = 2,
178    /// An unspecified error occurred during underlying I/O.
179    UnspecifiedIo = 3,
180    /// An unspecified error occurred.
181    Internal = 4,
182}
183
184impl OpenBlobError {
185    #[inline]
186    pub fn from_primitive(prim: u32) -> Option<Self> {
187        match prim {
188            1 => Some(Self::OutOfSpace),
189            2 => Some(Self::ConcurrentWrite),
190            3 => Some(Self::UnspecifiedIo),
191            4 => Some(Self::Internal),
192            _ => None,
193        }
194    }
195
196    #[inline]
197    pub const fn into_primitive(self) -> u32 {
198        self as u32
199    }
200}
201
202/// Where the repository storage is written to.
203#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
204#[repr(u32)]
205pub enum RepositoryStorageType {
206    /// Ephemeral, or in-memory storage. This repository metadata will be lost
207    /// when the process or device is restarted. The default type.
208    Ephemeral = 1,
209    /// Persistent, where the repository metadata is written to mutable storage
210    /// and is available after a reboot.
211    Persistent = 2,
212}
213
214impl RepositoryStorageType {
215    #[inline]
216    pub fn from_primitive(prim: u32) -> Option<Self> {
217        match prim {
218            1 => Some(Self::Ephemeral),
219            2 => Some(Self::Persistent),
220            _ => None,
221        }
222    }
223
224    #[inline]
225    pub const fn into_primitive(self) -> u32 {
226        self as u32
227    }
228}
229
230/// Error codes for PackageResolver operations.
231#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
232#[repr(i32)]
233pub enum ResolveError {
234    /// The resolver encountered an otherwise unspecified error while handling the request.
235    Internal = 1,
236    /// The resolver does not have permission to fetch a package blob.
237    AccessDenied = 2,
238    /// Some unspecified error during I/O.
239    Io = 3,
240    /// The package blob does not exist.
241    BlobNotFound = 4,
242    /// The package does not exist.
243    PackageNotFound = 5,
244    /// The resolver does not know about the repo.
245    RepoNotFound = 6,
246    /// There is no space available to store the package or metadata.
247    NoSpace = 7,
248    /// The resolver is currently unable to fetch a package blob.
249    UnavailableBlob = 8,
250    /// The resolver is currently unable to fetch a repository's metadata.
251    UnavailableRepoMetadata = 9,
252    /// The `package_url` provided to resolver is invalid.
253    InvalidUrl = 10,
254    /// The `context` provided to resolver is invalid.
255    InvalidContext = 11,
256}
257
258impl ResolveError {
259    #[inline]
260    pub fn from_primitive(prim: i32) -> Option<Self> {
261        match prim {
262            1 => Some(Self::Internal),
263            2 => Some(Self::AccessDenied),
264            3 => Some(Self::Io),
265            4 => Some(Self::BlobNotFound),
266            5 => Some(Self::PackageNotFound),
267            6 => Some(Self::RepoNotFound),
268            7 => Some(Self::NoSpace),
269            8 => Some(Self::UnavailableBlob),
270            9 => Some(Self::UnavailableRepoMetadata),
271            10 => Some(Self::InvalidUrl),
272            11 => Some(Self::InvalidContext),
273            _ => None,
274        }
275    }
276
277    #[inline]
278    pub const fn into_primitive(self) -> i32 {
279        self as i32
280    }
281}
282
283/// Error type for [`PackageCache.SetUpgradableUrls`].
284#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
285pub enum SetUpgradableUrlsError {
286    /// One or more URLs are not set.
287    ///
288    /// Invalid URLs or base packages are ignored, all the other packages are still set,
289    /// package resolution and GC is unblocked.
290    PartialSet,
291    /// An unspecified error occurred.
292    Internal,
293    #[doc(hidden)]
294    __SourceBreaking { unknown_ordinal: u32 },
295}
296
297/// Pattern that matches an unknown `SetUpgradableUrlsError` member.
298#[macro_export]
299macro_rules! SetUpgradableUrlsErrorUnknown {
300    () => {
301        _
302    };
303}
304
305impl SetUpgradableUrlsError {
306    #[inline]
307    pub fn from_primitive(prim: u32) -> Option<Self> {
308        match prim {
309            1 => Some(Self::PartialSet),
310            2 => Some(Self::Internal),
311            _ => None,
312        }
313    }
314
315    #[inline]
316    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
317        match prim {
318            1 => Self::PartialSet,
319            2 => Self::Internal,
320            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
321        }
322    }
323
324    #[inline]
325    pub fn unknown() -> Self {
326        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
327    }
328
329    #[inline]
330    pub const fn into_primitive(self) -> u32 {
331        match self {
332            Self::PartialSet => 1,
333            Self::Internal => 2,
334            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
335        }
336    }
337
338    #[inline]
339    pub fn is_unknown(&self) -> bool {
340        match self {
341            Self::__SourceBreaking { unknown_ordinal: _ } => true,
342            _ => false,
343        }
344    }
345}
346
347#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
348#[repr(u32)]
349pub enum WriteError {
350    /// The URL is not a known eager package.
351    UnknownUrl = 1,
352    /// The CUP data associated with the eager package failed verification.
353    Verification = 2,
354    /// Downloading the eager package failed.
355    Download = 3,
356    /// Writing the CUP data to storage failed.
357    Storage = 4,
358}
359
360impl WriteError {
361    #[inline]
362    pub fn from_primitive(prim: u32) -> Option<Self> {
363        match prim {
364            1 => Some(Self::UnknownUrl),
365            2 => Some(Self::Verification),
366            3 => Some(Self::Download),
367            4 => Some(Self::Storage),
368            _ => None,
369        }
370    }
371
372    #[inline]
373    pub const fn into_primitive(self) -> u32 {
374        self as u32
375    }
376}
377
378#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
379pub struct AuthorityLookupRequest {
380    /// The absolute package URL of the package to look up.
381    pub package_url: PackageUrl,
382}
383
384impl fidl::Persistable for AuthorityLookupRequest {}
385
386#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
387pub struct AuthorityLookupResponse {
388    /// The id of the package (the hash of its meta.far).
389    pub package_id: BlobId,
390    /// A URL of a directory on an HTTP[S] server that contains all of the blobs of the package.
391    /// The filenames of the blobs in the directory are the hex-encoded hashes of the blobs.
392    /// The blob files are contained directly in the directory (e.g. the delivery blob type
393    /// does not need to be appended to the URL).
394    pub http_blob_dir: String,
395}
396
397impl fidl::Persistable for AuthorityLookupResponse {}
398
399/// A content-addressed merkle root that describes an artifact that is tracked by the
400/// packaging system.
401#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
402#[repr(C)]
403pub struct BlobId {
404    pub merkle_root: [u8; 32],
405}
406
407impl fidl::Persistable for BlobId {}
408
409#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
410pub struct BlobIdIteratorNextResponse {
411    pub blobs: Vec<BlobId>,
412}
413
414impl fidl::Persistable for BlobIdIteratorNextResponse {}
415
416/// A tuple of the content-addressed merkle root for an artifact, along with that
417/// artifact's length in bytes.
418#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
419#[repr(C)]
420pub struct BlobInfo {
421    pub blob_id: BlobId,
422    pub length: u64,
423}
424
425impl fidl::Persistable for BlobInfo {}
426
427#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
428pub struct BlobInfoIteratorNextResponse {
429    pub blobs: Vec<BlobInfo>,
430}
431
432impl fidl::Persistable for BlobInfoIteratorNextResponse {}
433
434#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
435pub struct CupGetInfoRequest {
436    /// The eager package URL, must be unpinned.
437    pub url: PackageUrl,
438}
439
440impl fidl::Persistable for CupGetInfoRequest {}
441
442#[derive(Clone, Debug, PartialEq)]
443pub struct CupWriteRequest {
444    /// The pinned eager package URL from Omaha, must appear in CUP data.
445    pub url: PackageUrl,
446    /// The CUP data from the update check.
447    pub cup: CupData,
448}
449
450impl fidl::Persistable for CupWriteRequest {}
451
452#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
453pub struct CupGetInfoResponse {
454    pub version: String,
455    pub channel: String,
456}
457
458impl fidl::Persistable for CupGetInfoResponse {}
459
460#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
461#[repr(C)]
462pub struct NeededBlobsBlobWrittenRequest {
463    pub blob_id: BlobId,
464}
465
466impl fidl::Persistable for NeededBlobsBlobWrittenRequest {}
467
468#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
469pub struct NeededBlobsOpenBlobRequest {
470    pub blob_id: BlobId,
471    pub allow_existing: bool,
472}
473
474impl fidl::Persistable for NeededBlobsOpenBlobRequest {}
475
476#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
477pub struct PackageCacheSetUpgradableUrlsRequest {
478    pub pinned_urls: Vec<PackageUrl>,
479}
480
481impl fidl::Persistable for PackageCacheSetUpgradableUrlsRequest {}
482
483/// A single entry in the package index.
484#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
485pub struct PackageIndexEntry {
486    pub package_url: PackageUrl,
487    pub meta_far_blob_id: BlobId,
488}
489
490impl fidl::Persistable for PackageIndexEntry {}
491
492#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
493pub struct PackageIndexIteratorNextResponse {
494    pub entries: Vec<PackageIndexEntry>,
495}
496
497impl fidl::Persistable for PackageIndexIteratorNextResponse {}
498
499#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
500pub struct PackageResolverGetHashRequest {
501    pub package_url: PackageUrl,
502}
503
504impl fidl::Persistable for PackageResolverGetHashRequest {}
505
506#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
507#[repr(C)]
508pub struct PackageResolverGetHashResponse {
509    pub meta_far_blob_id: BlobId,
510}
511
512impl fidl::Persistable for PackageResolverGetHashResponse {}
513
514#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
515pub struct PackageResolverResolveWithContextResponse {
516    pub resolved_context: ResolutionContext,
517}
518
519impl fidl::Persistable for PackageResolverResolveWithContextResponse {}
520
521#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
522pub struct PackageResolverResolveResponse {
523    pub resolved_context: ResolutionContext,
524}
525
526impl fidl::Persistable for PackageResolverResolveResponse {}
527
528/// A fuchsia-pkg:// URL indicating a package.
529/// https://fuchsia.dev/fuchsia-src/concepts/packages/package_url#package_identity
530#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
531pub struct PackageUrl {
532    pub url: String,
533}
534
535impl fidl::Persistable for PackageUrl {}
536
537#[derive(Clone, Debug, PartialEq)]
538pub struct RepositoryIteratorNextResponse {
539    pub repos: Vec<RepositoryConfig>,
540}
541
542impl fidl::Persistable for RepositoryIteratorNextResponse {}
543
544#[derive(Clone, Debug, PartialEq)]
545pub struct RepositoryManagerAddMirrorRequest {
546    pub repo_url: String,
547    pub mirror: MirrorConfig,
548}
549
550impl fidl::Persistable for RepositoryManagerAddMirrorRequest {}
551
552#[derive(Clone, Debug, PartialEq)]
553pub struct RepositoryManagerAddRequest {
554    pub repo: RepositoryConfig,
555}
556
557impl fidl::Persistable for RepositoryManagerAddRequest {}
558
559#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
560pub struct RepositoryManagerRemoveMirrorRequest {
561    pub repo_url: String,
562    pub mirror_url: String,
563}
564
565impl fidl::Persistable for RepositoryManagerRemoveMirrorRequest {}
566
567#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
568pub struct RepositoryManagerRemoveRequest {
569    pub repo_url: String,
570}
571
572impl fidl::Persistable for RepositoryManagerRemoveRequest {}
573
574/// A fuchsia-pkg:// URL indicating a repository.
575/// https://fuchsia.dev/fuchsia-src/concepts/packages/package_url#repository_identity
576#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
577pub struct RepositoryUrl {
578    pub url: String,
579}
580
581impl fidl::Persistable for RepositoryUrl {}
582
583/// A package resolution context, used when resolving package URLs relative to
584/// another package.
585#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
586pub struct ResolutionContext {
587    pub bytes: Vec<u8>,
588}
589
590impl fidl::Persistable for ResolutionContext {}
591
592#[derive(Clone, Debug, Default, PartialEq)]
593pub struct CupData {
594    /// Omaha request json
595    pub request: Option<Vec<u8>>,
596    /// The public key id
597    pub key_id: Option<u64>,
598    /// ECDSA nonce.
599    pub nonce: Option<[u8; 32]>,
600    /// Omaha response json
601    pub response: Option<Vec<u8>>,
602    /// DER encoded ECDSA signature
603    pub signature: Option<Vec<u8>>,
604    #[doc(hidden)]
605    pub __source_breaking: fidl::marker::SourceBreaking,
606}
607
608impl fidl::Persistable for CupData {}
609
610/// The configuration necessary to connect to a mirror.
611#[derive(Clone, Debug, Default, PartialEq)]
612pub struct MirrorConfig {
613    /// The base URL of the TUF metadata on this mirror. Required.
614    pub mirror_url: Option<String>,
615    /// Whether or not to automatically monitor the mirror for updates. Required.
616    pub subscribe: Option<bool>,
617    /// The URL where blobs from this mirror should be fetched.  Optional.
618    /// If absent presumed to be `mirror_url + "/blobs"`.
619    pub blob_mirror_url: Option<String>,
620    #[doc(hidden)]
621    pub __source_breaking: fidl::marker::SourceBreaking,
622}
623
624impl fidl::Persistable for MirrorConfig {}
625
626/// The configuration necessary to connect to a repository and its mirrors.
627#[derive(Clone, Debug, Default, PartialEq)]
628pub struct RepositoryConfig {
629    /// A fuchsia-pkg URL identifying the repository. Required.
630    ///
631    /// Example: fuchsia-pkg://example.com/
632    pub repo_url: Option<String>,
633    /// A vector of public keys that have signed the initial trusted root
634    /// metadata. Required.
635    ///
636    /// These keys must match one of the trusted keys known to the system.
637    pub root_keys: Option<Vec<RepositoryKeyConfig>>,
638    /// The repository mirrors that serve the package contents. Required.
639    pub mirrors: Option<Vec<MirrorConfig>>,
640    /// The initial trusted root metadata version. Optional, if absent presumed
641    /// to be 1.
642    ///
643    /// This value describes the initial root metadata version the resolver will
644    /// fetch to initialize trust, once it's signatures has been verified by the
645    /// `root_keys`. It will then walk the chain of N+1, N+2, and etc to the
646    /// latest version before the resolver fetches any targets.
647    ///
648    /// It is recommended that this `root_version` number and `root_keys ` are
649    /// kept reasonably in sync with the most recent published version of the
650    /// root metadata, as that avoids the risk of an old and unused root key
651    /// being used to compromise resolvers during the trust initialization.
652    pub root_version: Option<u32>,
653    /// The number of `root_keys` that need to have signed the root metadata for it
654    /// to be considered trusted. This value must be greater than or equal to 1.
655    /// Optional, if absent presumed to be 1.
656    pub root_threshold: Option<u32>,
657    /// Whether the package resolver should check attached storage for blobs and
658    /// repository metadata. Optional, if absent presumed to be false.
659    pub use_local_mirror: Option<bool>,
660    /// Controls how repository metadata is persisted across reboots. Optional, if absent presumed
661    /// to be EPHEMERAL.
662    pub storage_type: Option<RepositoryStorageType>,
663    #[doc(hidden)]
664    pub __source_breaking: fidl::marker::SourceBreaking,
665}
666
667impl fidl::Persistable for RepositoryConfig {}
668
669/// The keys used by the repository to authenticate its packages.
670///
671/// The only supported algorithm at the moment is ed25519.
672#[derive(Clone, Debug)]
673pub enum RepositoryKeyConfig {
674    /// The raw ed25519 public key as binary data.
675    Ed25519Key(Vec<u8>),
676    #[doc(hidden)]
677    __SourceBreaking { unknown_ordinal: u64 },
678}
679
680/// Pattern that matches an unknown `RepositoryKeyConfig` member.
681#[macro_export]
682macro_rules! RepositoryKeyConfigUnknown {
683    () => {
684        _
685    };
686}
687
688// Custom PartialEq so that unknown variants are not equal to themselves.
689impl PartialEq for RepositoryKeyConfig {
690    fn eq(&self, other: &Self) -> bool {
691        match (self, other) {
692            (Self::Ed25519Key(x), Self::Ed25519Key(y)) => *x == *y,
693            _ => false,
694        }
695    }
696}
697
698impl RepositoryKeyConfig {
699    #[inline]
700    pub fn ordinal(&self) -> u64 {
701        match *self {
702            Self::Ed25519Key(_) => 1,
703            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
704        }
705    }
706
707    #[inline]
708    pub fn unknown_variant_for_testing() -> Self {
709        Self::__SourceBreaking { unknown_ordinal: 0 }
710    }
711
712    #[inline]
713    pub fn is_unknown(&self) -> bool {
714        match self {
715            Self::__SourceBreaking { .. } => true,
716            _ => false,
717        }
718    }
719}
720
721impl fidl::Persistable for RepositoryKeyConfig {}
722
723pub mod authority_ordinals {
724    pub const LOOKUP: u64 = 0x10c3e416b99c027c;
725}
726
727pub mod blob_id_iterator_ordinals {
728    pub const NEXT: u64 = 0x5eb0af0daeb8f537;
729}
730
731pub mod blob_info_iterator_ordinals {
732    pub const NEXT: u64 = 0x2b889489a59b6970;
733}
734
735pub mod cup_ordinals {
736    pub const WRITE: u64 = 0x29f30e83bda39c37;
737    pub const GET_INFO: u64 = 0x5b2cedd887209b9c;
738}
739
740pub mod font_resolver_ordinals {
741    pub const RESOLVE: u64 = 0x159f60cc5ba432da;
742}
743
744pub mod needed_blobs_ordinals {
745    pub const OPEN_META_BLOB: u64 = 0x42f385a58180f5fb;
746    pub const GET_MISSING_BLOBS: u64 = 0x44eaf14fd56e7ae1;
747    pub const OPEN_BLOB: u64 = 0x67cd4c4cd10ea9e0;
748    pub const BLOB_WRITTEN: u64 = 0x222f80ec77433f44;
749    pub const ABORT: u64 = 0x6fda8d5ebea74cbb;
750}
751
752pub mod package_cache_ordinals {
753    pub const GET: u64 = 0x15e1963f4bf123b5;
754    pub const WRITE_BLOBS: u64 = 0x5d0ed48035931dbe;
755    pub const GET_SUBPACKAGE: u64 = 0x29478df87c29ffa3;
756    pub const BASE_PACKAGE_INDEX: u64 = 0x46af9e595f8eced4;
757    pub const CACHE_PACKAGE_INDEX: u64 = 0x14a48fdb8f26ed26;
758    pub const SYNC: u64 = 0x5c10a84094535a74;
759    pub const SET_UPGRADABLE_URLS: u64 = 0x2c235f7efdb5e2d1;
760}
761
762pub mod package_index_iterator_ordinals {
763    pub const NEXT: u64 = 0x9de6bbc87c314d9;
764}
765
766pub mod package_resolver_ordinals {
767    pub const RESOLVE: u64 = 0x6611263be4052d4f;
768    pub const RESOLVE_WITH_CONTEXT: u64 = 0x4c255ae7260298d4;
769    pub const GET_HASH: u64 = 0x594e8b4db51efd87;
770}
771
772pub mod repository_iterator_ordinals {
773    pub const NEXT: u64 = 0x5502086bc0cdd25e;
774}
775
776pub mod repository_manager_ordinals {
777    pub const ADD: u64 = 0x7fff4b8c733c7151;
778    pub const REMOVE: u64 = 0x5de23dc0e0dea4ba;
779    pub const ADD_MIRROR: u64 = 0x3b7ef213730dd24c;
780    pub const REMOVE_MIRROR: u64 = 0x4682584cc47c23a2;
781    pub const LIST: u64 = 0x61837314ba6f4afb;
782}
783
784pub mod retained_blobs_ordinals {
785    pub const CLEAR: u64 = 0x3005cab30c671164;
786    pub const REPLACE: u64 = 0x2c049d51026cd0b3;
787}
788
789pub mod retained_packages_ordinals {
790    pub const CLEAR: u64 = 0x7f17476f097961ac;
791    pub const REPLACE: u64 = 0x5021e479570f3a9f;
792}
793
794mod internal {
795    use super::*;
796    unsafe impl fidl::encoding::TypeMarker for AuthorityLookupError {
797        type Owned = Self;
798
799        #[inline(always)]
800        fn inline_align(_context: fidl::encoding::Context) -> usize {
801            std::mem::align_of::<u32>()
802        }
803
804        #[inline(always)]
805        fn inline_size(_context: fidl::encoding::Context) -> usize {
806            std::mem::size_of::<u32>()
807        }
808
809        #[inline(always)]
810        fn encode_is_copy() -> bool {
811            true
812        }
813
814        #[inline(always)]
815        fn decode_is_copy() -> bool {
816            false
817        }
818    }
819
820    impl fidl::encoding::ValueTypeMarker for AuthorityLookupError {
821        type Borrowed<'a> = Self;
822        #[inline(always)]
823        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
824            *value
825        }
826    }
827
828    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
829        for AuthorityLookupError
830    {
831        #[inline]
832        unsafe fn encode(
833            self,
834            encoder: &mut fidl::encoding::Encoder<'_, D>,
835            offset: usize,
836            _depth: fidl::encoding::Depth,
837        ) -> fidl::Result<()> {
838            encoder.debug_check_bounds::<Self>(offset);
839            encoder.write_num(self.into_primitive(), offset);
840            Ok(())
841        }
842    }
843
844    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AuthorityLookupError {
845        #[inline(always)]
846        fn new_empty() -> Self {
847            Self::InvalidUrl
848        }
849
850        #[inline]
851        unsafe fn decode(
852            &mut self,
853            decoder: &mut fidl::encoding::Decoder<'_, D>,
854            offset: usize,
855            _depth: fidl::encoding::Depth,
856        ) -> fidl::Result<()> {
857            decoder.debug_check_bounds::<Self>(offset);
858            let prim = decoder.read_num::<u32>(offset);
859
860            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
861            Ok(())
862        }
863    }
864    unsafe impl fidl::encoding::TypeMarker for BlobWrittenError {
865        type Owned = Self;
866
867        #[inline(always)]
868        fn inline_align(_context: fidl::encoding::Context) -> usize {
869            std::mem::align_of::<u32>()
870        }
871
872        #[inline(always)]
873        fn inline_size(_context: fidl::encoding::Context) -> usize {
874            std::mem::size_of::<u32>()
875        }
876
877        #[inline(always)]
878        fn encode_is_copy() -> bool {
879            true
880        }
881
882        #[inline(always)]
883        fn decode_is_copy() -> bool {
884            false
885        }
886    }
887
888    impl fidl::encoding::ValueTypeMarker for BlobWrittenError {
889        type Borrowed<'a> = Self;
890        #[inline(always)]
891        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
892            *value
893        }
894    }
895
896    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
897        for BlobWrittenError
898    {
899        #[inline]
900        unsafe fn encode(
901            self,
902            encoder: &mut fidl::encoding::Encoder<'_, D>,
903            offset: usize,
904            _depth: fidl::encoding::Depth,
905        ) -> fidl::Result<()> {
906            encoder.debug_check_bounds::<Self>(offset);
907            encoder.write_num(self.into_primitive(), offset);
908            Ok(())
909        }
910    }
911
912    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlobWrittenError {
913        #[inline(always)]
914        fn new_empty() -> Self {
915            Self::NotWritten
916        }
917
918        #[inline]
919        unsafe fn decode(
920            &mut self,
921            decoder: &mut fidl::encoding::Decoder<'_, D>,
922            offset: usize,
923            _depth: fidl::encoding::Depth,
924        ) -> fidl::Result<()> {
925            decoder.debug_check_bounds::<Self>(offset);
926            let prim = decoder.read_num::<u32>(offset);
927
928            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
929            Ok(())
930        }
931    }
932    unsafe impl fidl::encoding::TypeMarker for GcProtection {
933        type Owned = Self;
934
935        #[inline(always)]
936        fn inline_align(_context: fidl::encoding::Context) -> usize {
937            std::mem::align_of::<u32>()
938        }
939
940        #[inline(always)]
941        fn inline_size(_context: fidl::encoding::Context) -> usize {
942            std::mem::size_of::<u32>()
943        }
944
945        #[inline(always)]
946        fn encode_is_copy() -> bool {
947            true
948        }
949
950        #[inline(always)]
951        fn decode_is_copy() -> bool {
952            false
953        }
954    }
955
956    impl fidl::encoding::ValueTypeMarker for GcProtection {
957        type Borrowed<'a> = Self;
958        #[inline(always)]
959        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
960            *value
961        }
962    }
963
964    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GcProtection {
965        #[inline]
966        unsafe fn encode(
967            self,
968            encoder: &mut fidl::encoding::Encoder<'_, D>,
969            offset: usize,
970            _depth: fidl::encoding::Depth,
971        ) -> fidl::Result<()> {
972            encoder.debug_check_bounds::<Self>(offset);
973            encoder.write_num(self.into_primitive(), offset);
974            Ok(())
975        }
976    }
977
978    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GcProtection {
979        #[inline(always)]
980        fn new_empty() -> Self {
981            Self::OpenPackageTracking
982        }
983
984        #[inline]
985        unsafe fn decode(
986            &mut self,
987            decoder: &mut fidl::encoding::Decoder<'_, D>,
988            offset: usize,
989            _depth: fidl::encoding::Depth,
990        ) -> fidl::Result<()> {
991            decoder.debug_check_bounds::<Self>(offset);
992            let prim = decoder.read_num::<u32>(offset);
993
994            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
995            Ok(())
996        }
997    }
998    unsafe impl fidl::encoding::TypeMarker for GetInfoError {
999        type Owned = Self;
1000
1001        #[inline(always)]
1002        fn inline_align(_context: fidl::encoding::Context) -> usize {
1003            std::mem::align_of::<u32>()
1004        }
1005
1006        #[inline(always)]
1007        fn inline_size(_context: fidl::encoding::Context) -> usize {
1008            std::mem::size_of::<u32>()
1009        }
1010
1011        #[inline(always)]
1012        fn encode_is_copy() -> bool {
1013            true
1014        }
1015
1016        #[inline(always)]
1017        fn decode_is_copy() -> bool {
1018            false
1019        }
1020    }
1021
1022    impl fidl::encoding::ValueTypeMarker for GetInfoError {
1023        type Borrowed<'a> = Self;
1024        #[inline(always)]
1025        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1026            *value
1027        }
1028    }
1029
1030    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GetInfoError {
1031        #[inline]
1032        unsafe fn encode(
1033            self,
1034            encoder: &mut fidl::encoding::Encoder<'_, D>,
1035            offset: usize,
1036            _depth: fidl::encoding::Depth,
1037        ) -> fidl::Result<()> {
1038            encoder.debug_check_bounds::<Self>(offset);
1039            encoder.write_num(self.into_primitive(), offset);
1040            Ok(())
1041        }
1042    }
1043
1044    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetInfoError {
1045        #[inline(always)]
1046        fn new_empty() -> Self {
1047            Self::UnknownUrl
1048        }
1049
1050        #[inline]
1051        unsafe fn decode(
1052            &mut self,
1053            decoder: &mut fidl::encoding::Decoder<'_, D>,
1054            offset: usize,
1055            _depth: fidl::encoding::Depth,
1056        ) -> fidl::Result<()> {
1057            decoder.debug_check_bounds::<Self>(offset);
1058            let prim = decoder.read_num::<u32>(offset);
1059
1060            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1061            Ok(())
1062        }
1063    }
1064    unsafe impl fidl::encoding::TypeMarker for GetSubpackageError {
1065        type Owned = Self;
1066
1067        #[inline(always)]
1068        fn inline_align(_context: fidl::encoding::Context) -> usize {
1069            std::mem::align_of::<u32>()
1070        }
1071
1072        #[inline(always)]
1073        fn inline_size(_context: fidl::encoding::Context) -> usize {
1074            std::mem::size_of::<u32>()
1075        }
1076
1077        #[inline(always)]
1078        fn encode_is_copy() -> bool {
1079            true
1080        }
1081
1082        #[inline(always)]
1083        fn decode_is_copy() -> bool {
1084            false
1085        }
1086    }
1087
1088    impl fidl::encoding::ValueTypeMarker for GetSubpackageError {
1089        type Borrowed<'a> = Self;
1090        #[inline(always)]
1091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1092            *value
1093        }
1094    }
1095
1096    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1097        for GetSubpackageError
1098    {
1099        #[inline]
1100        unsafe fn encode(
1101            self,
1102            encoder: &mut fidl::encoding::Encoder<'_, D>,
1103            offset: usize,
1104            _depth: fidl::encoding::Depth,
1105        ) -> fidl::Result<()> {
1106            encoder.debug_check_bounds::<Self>(offset);
1107            encoder.write_num(self.into_primitive(), offset);
1108            Ok(())
1109        }
1110    }
1111
1112    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetSubpackageError {
1113        #[inline(always)]
1114        fn new_empty() -> Self {
1115            Self::SuperpackageClosed
1116        }
1117
1118        #[inline]
1119        unsafe fn decode(
1120            &mut self,
1121            decoder: &mut fidl::encoding::Decoder<'_, D>,
1122            offset: usize,
1123            _depth: fidl::encoding::Depth,
1124        ) -> fidl::Result<()> {
1125            decoder.debug_check_bounds::<Self>(offset);
1126            let prim = decoder.read_num::<u32>(offset);
1127
1128            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1129            Ok(())
1130        }
1131    }
1132    unsafe impl fidl::encoding::TypeMarker for OpenBlobError {
1133        type Owned = Self;
1134
1135        #[inline(always)]
1136        fn inline_align(_context: fidl::encoding::Context) -> usize {
1137            std::mem::align_of::<u32>()
1138        }
1139
1140        #[inline(always)]
1141        fn inline_size(_context: fidl::encoding::Context) -> usize {
1142            std::mem::size_of::<u32>()
1143        }
1144
1145        #[inline(always)]
1146        fn encode_is_copy() -> bool {
1147            true
1148        }
1149
1150        #[inline(always)]
1151        fn decode_is_copy() -> bool {
1152            false
1153        }
1154    }
1155
1156    impl fidl::encoding::ValueTypeMarker for OpenBlobError {
1157        type Borrowed<'a> = Self;
1158        #[inline(always)]
1159        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1160            *value
1161        }
1162    }
1163
1164    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OpenBlobError {
1165        #[inline]
1166        unsafe fn encode(
1167            self,
1168            encoder: &mut fidl::encoding::Encoder<'_, D>,
1169            offset: usize,
1170            _depth: fidl::encoding::Depth,
1171        ) -> fidl::Result<()> {
1172            encoder.debug_check_bounds::<Self>(offset);
1173            encoder.write_num(self.into_primitive(), offset);
1174            Ok(())
1175        }
1176    }
1177
1178    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenBlobError {
1179        #[inline(always)]
1180        fn new_empty() -> Self {
1181            Self::OutOfSpace
1182        }
1183
1184        #[inline]
1185        unsafe fn decode(
1186            &mut self,
1187            decoder: &mut fidl::encoding::Decoder<'_, D>,
1188            offset: usize,
1189            _depth: fidl::encoding::Depth,
1190        ) -> fidl::Result<()> {
1191            decoder.debug_check_bounds::<Self>(offset);
1192            let prim = decoder.read_num::<u32>(offset);
1193
1194            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1195            Ok(())
1196        }
1197    }
1198    unsafe impl fidl::encoding::TypeMarker for RepositoryStorageType {
1199        type Owned = Self;
1200
1201        #[inline(always)]
1202        fn inline_align(_context: fidl::encoding::Context) -> usize {
1203            std::mem::align_of::<u32>()
1204        }
1205
1206        #[inline(always)]
1207        fn inline_size(_context: fidl::encoding::Context) -> usize {
1208            std::mem::size_of::<u32>()
1209        }
1210
1211        #[inline(always)]
1212        fn encode_is_copy() -> bool {
1213            true
1214        }
1215
1216        #[inline(always)]
1217        fn decode_is_copy() -> bool {
1218            false
1219        }
1220    }
1221
1222    impl fidl::encoding::ValueTypeMarker for RepositoryStorageType {
1223        type Borrowed<'a> = Self;
1224        #[inline(always)]
1225        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1226            *value
1227        }
1228    }
1229
1230    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1231        for RepositoryStorageType
1232    {
1233        #[inline]
1234        unsafe fn encode(
1235            self,
1236            encoder: &mut fidl::encoding::Encoder<'_, D>,
1237            offset: usize,
1238            _depth: fidl::encoding::Depth,
1239        ) -> fidl::Result<()> {
1240            encoder.debug_check_bounds::<Self>(offset);
1241            encoder.write_num(self.into_primitive(), offset);
1242            Ok(())
1243        }
1244    }
1245
1246    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryStorageType {
1247        #[inline(always)]
1248        fn new_empty() -> Self {
1249            Self::Ephemeral
1250        }
1251
1252        #[inline]
1253        unsafe fn decode(
1254            &mut self,
1255            decoder: &mut fidl::encoding::Decoder<'_, D>,
1256            offset: usize,
1257            _depth: fidl::encoding::Depth,
1258        ) -> fidl::Result<()> {
1259            decoder.debug_check_bounds::<Self>(offset);
1260            let prim = decoder.read_num::<u32>(offset);
1261
1262            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1263            Ok(())
1264        }
1265    }
1266    unsafe impl fidl::encoding::TypeMarker for ResolveError {
1267        type Owned = Self;
1268
1269        #[inline(always)]
1270        fn inline_align(_context: fidl::encoding::Context) -> usize {
1271            std::mem::align_of::<i32>()
1272        }
1273
1274        #[inline(always)]
1275        fn inline_size(_context: fidl::encoding::Context) -> usize {
1276            std::mem::size_of::<i32>()
1277        }
1278
1279        #[inline(always)]
1280        fn encode_is_copy() -> bool {
1281            true
1282        }
1283
1284        #[inline(always)]
1285        fn decode_is_copy() -> bool {
1286            false
1287        }
1288    }
1289
1290    impl fidl::encoding::ValueTypeMarker for ResolveError {
1291        type Borrowed<'a> = Self;
1292        #[inline(always)]
1293        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1294            *value
1295        }
1296    }
1297
1298    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResolveError {
1299        #[inline]
1300        unsafe fn encode(
1301            self,
1302            encoder: &mut fidl::encoding::Encoder<'_, D>,
1303            offset: usize,
1304            _depth: fidl::encoding::Depth,
1305        ) -> fidl::Result<()> {
1306            encoder.debug_check_bounds::<Self>(offset);
1307            encoder.write_num(self.into_primitive(), offset);
1308            Ok(())
1309        }
1310    }
1311
1312    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveError {
1313        #[inline(always)]
1314        fn new_empty() -> Self {
1315            Self::Internal
1316        }
1317
1318        #[inline]
1319        unsafe fn decode(
1320            &mut self,
1321            decoder: &mut fidl::encoding::Decoder<'_, D>,
1322            offset: usize,
1323            _depth: fidl::encoding::Depth,
1324        ) -> fidl::Result<()> {
1325            decoder.debug_check_bounds::<Self>(offset);
1326            let prim = decoder.read_num::<i32>(offset);
1327
1328            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1329            Ok(())
1330        }
1331    }
1332    unsafe impl fidl::encoding::TypeMarker for SetUpgradableUrlsError {
1333        type Owned = Self;
1334
1335        #[inline(always)]
1336        fn inline_align(_context: fidl::encoding::Context) -> usize {
1337            std::mem::align_of::<u32>()
1338        }
1339
1340        #[inline(always)]
1341        fn inline_size(_context: fidl::encoding::Context) -> usize {
1342            std::mem::size_of::<u32>()
1343        }
1344
1345        #[inline(always)]
1346        fn encode_is_copy() -> bool {
1347            false
1348        }
1349
1350        #[inline(always)]
1351        fn decode_is_copy() -> bool {
1352            false
1353        }
1354    }
1355
1356    impl fidl::encoding::ValueTypeMarker for SetUpgradableUrlsError {
1357        type Borrowed<'a> = Self;
1358        #[inline(always)]
1359        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1360            *value
1361        }
1362    }
1363
1364    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1365        for SetUpgradableUrlsError
1366    {
1367        #[inline]
1368        unsafe fn encode(
1369            self,
1370            encoder: &mut fidl::encoding::Encoder<'_, D>,
1371            offset: usize,
1372            _depth: fidl::encoding::Depth,
1373        ) -> fidl::Result<()> {
1374            encoder.debug_check_bounds::<Self>(offset);
1375            encoder.write_num(self.into_primitive(), offset);
1376            Ok(())
1377        }
1378    }
1379
1380    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1381        for SetUpgradableUrlsError
1382    {
1383        #[inline(always)]
1384        fn new_empty() -> Self {
1385            Self::unknown()
1386        }
1387
1388        #[inline]
1389        unsafe fn decode(
1390            &mut self,
1391            decoder: &mut fidl::encoding::Decoder<'_, D>,
1392            offset: usize,
1393            _depth: fidl::encoding::Depth,
1394        ) -> fidl::Result<()> {
1395            decoder.debug_check_bounds::<Self>(offset);
1396            let prim = decoder.read_num::<u32>(offset);
1397
1398            *self = Self::from_primitive_allow_unknown(prim);
1399            Ok(())
1400        }
1401    }
1402    unsafe impl fidl::encoding::TypeMarker for WriteError {
1403        type Owned = Self;
1404
1405        #[inline(always)]
1406        fn inline_align(_context: fidl::encoding::Context) -> usize {
1407            std::mem::align_of::<u32>()
1408        }
1409
1410        #[inline(always)]
1411        fn inline_size(_context: fidl::encoding::Context) -> usize {
1412            std::mem::size_of::<u32>()
1413        }
1414
1415        #[inline(always)]
1416        fn encode_is_copy() -> bool {
1417            true
1418        }
1419
1420        #[inline(always)]
1421        fn decode_is_copy() -> bool {
1422            false
1423        }
1424    }
1425
1426    impl fidl::encoding::ValueTypeMarker for WriteError {
1427        type Borrowed<'a> = Self;
1428        #[inline(always)]
1429        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1430            *value
1431        }
1432    }
1433
1434    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WriteError {
1435        #[inline]
1436        unsafe fn encode(
1437            self,
1438            encoder: &mut fidl::encoding::Encoder<'_, D>,
1439            offset: usize,
1440            _depth: fidl::encoding::Depth,
1441        ) -> fidl::Result<()> {
1442            encoder.debug_check_bounds::<Self>(offset);
1443            encoder.write_num(self.into_primitive(), offset);
1444            Ok(())
1445        }
1446    }
1447
1448    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteError {
1449        #[inline(always)]
1450        fn new_empty() -> Self {
1451            Self::UnknownUrl
1452        }
1453
1454        #[inline]
1455        unsafe fn decode(
1456            &mut self,
1457            decoder: &mut fidl::encoding::Decoder<'_, D>,
1458            offset: usize,
1459            _depth: fidl::encoding::Depth,
1460        ) -> fidl::Result<()> {
1461            decoder.debug_check_bounds::<Self>(offset);
1462            let prim = decoder.read_num::<u32>(offset);
1463
1464            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1465            Ok(())
1466        }
1467    }
1468
1469    impl fidl::encoding::ValueTypeMarker for AuthorityLookupRequest {
1470        type Borrowed<'a> = &'a Self;
1471        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1472            value
1473        }
1474    }
1475
1476    unsafe impl fidl::encoding::TypeMarker for AuthorityLookupRequest {
1477        type Owned = Self;
1478
1479        #[inline(always)]
1480        fn inline_align(_context: fidl::encoding::Context) -> usize {
1481            8
1482        }
1483
1484        #[inline(always)]
1485        fn inline_size(_context: fidl::encoding::Context) -> usize {
1486            16
1487        }
1488    }
1489
1490    unsafe impl<D: fidl::encoding::ResourceDialect>
1491        fidl::encoding::Encode<AuthorityLookupRequest, D> for &AuthorityLookupRequest
1492    {
1493        #[inline]
1494        unsafe fn encode(
1495            self,
1496            encoder: &mut fidl::encoding::Encoder<'_, D>,
1497            offset: usize,
1498            _depth: fidl::encoding::Depth,
1499        ) -> fidl::Result<()> {
1500            encoder.debug_check_bounds::<AuthorityLookupRequest>(offset);
1501            // Delegate to tuple encoding.
1502            fidl::encoding::Encode::<AuthorityLookupRequest, D>::encode(
1503                (<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),),
1504                encoder,
1505                offset,
1506                _depth,
1507            )
1508        }
1509    }
1510    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PackageUrl, D>>
1511        fidl::encoding::Encode<AuthorityLookupRequest, D> for (T0,)
1512    {
1513        #[inline]
1514        unsafe fn encode(
1515            self,
1516            encoder: &mut fidl::encoding::Encoder<'_, D>,
1517            offset: usize,
1518            depth: fidl::encoding::Depth,
1519        ) -> fidl::Result<()> {
1520            encoder.debug_check_bounds::<AuthorityLookupRequest>(offset);
1521            // Zero out padding regions. There's no need to apply masks
1522            // because the unmasked parts will be overwritten by fields.
1523            // Write the fields.
1524            self.0.encode(encoder, offset + 0, depth)?;
1525            Ok(())
1526        }
1527    }
1528
1529    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1530        for AuthorityLookupRequest
1531    {
1532        #[inline(always)]
1533        fn new_empty() -> Self {
1534            Self { package_url: fidl::new_empty!(PackageUrl, D) }
1535        }
1536
1537        #[inline]
1538        unsafe fn decode(
1539            &mut self,
1540            decoder: &mut fidl::encoding::Decoder<'_, D>,
1541            offset: usize,
1542            _depth: fidl::encoding::Depth,
1543        ) -> fidl::Result<()> {
1544            decoder.debug_check_bounds::<Self>(offset);
1545            // Verify that padding bytes are zero.
1546            fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
1547            Ok(())
1548        }
1549    }
1550
1551    impl fidl::encoding::ValueTypeMarker for AuthorityLookupResponse {
1552        type Borrowed<'a> = &'a Self;
1553        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1554            value
1555        }
1556    }
1557
1558    unsafe impl fidl::encoding::TypeMarker for AuthorityLookupResponse {
1559        type Owned = Self;
1560
1561        #[inline(always)]
1562        fn inline_align(_context: fidl::encoding::Context) -> usize {
1563            8
1564        }
1565
1566        #[inline(always)]
1567        fn inline_size(_context: fidl::encoding::Context) -> usize {
1568            48
1569        }
1570    }
1571
1572    unsafe impl<D: fidl::encoding::ResourceDialect>
1573        fidl::encoding::Encode<AuthorityLookupResponse, D> for &AuthorityLookupResponse
1574    {
1575        #[inline]
1576        unsafe fn encode(
1577            self,
1578            encoder: &mut fidl::encoding::Encoder<'_, D>,
1579            offset: usize,
1580            _depth: fidl::encoding::Depth,
1581        ) -> fidl::Result<()> {
1582            encoder.debug_check_bounds::<AuthorityLookupResponse>(offset);
1583            // Delegate to tuple encoding.
1584            fidl::encoding::Encode::<AuthorityLookupResponse, D>::encode(
1585                (
1586                    <BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.package_id),
1587                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.http_blob_dir),
1588                ),
1589                encoder, offset, _depth
1590            )
1591        }
1592    }
1593    unsafe impl<
1594        D: fidl::encoding::ResourceDialect,
1595        T0: fidl::encoding::Encode<BlobId, D>,
1596        T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
1597    > fidl::encoding::Encode<AuthorityLookupResponse, D> for (T0, T1)
1598    {
1599        #[inline]
1600        unsafe fn encode(
1601            self,
1602            encoder: &mut fidl::encoding::Encoder<'_, D>,
1603            offset: usize,
1604            depth: fidl::encoding::Depth,
1605        ) -> fidl::Result<()> {
1606            encoder.debug_check_bounds::<AuthorityLookupResponse>(offset);
1607            // Zero out padding regions. There's no need to apply masks
1608            // because the unmasked parts will be overwritten by fields.
1609            // Write the fields.
1610            self.0.encode(encoder, offset + 0, depth)?;
1611            self.1.encode(encoder, offset + 32, depth)?;
1612            Ok(())
1613        }
1614    }
1615
1616    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1617        for AuthorityLookupResponse
1618    {
1619        #[inline(always)]
1620        fn new_empty() -> Self {
1621            Self {
1622                package_id: fidl::new_empty!(BlobId, D),
1623                http_blob_dir: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
1624            }
1625        }
1626
1627        #[inline]
1628        unsafe fn decode(
1629            &mut self,
1630            decoder: &mut fidl::encoding::Decoder<'_, D>,
1631            offset: usize,
1632            _depth: fidl::encoding::Depth,
1633        ) -> fidl::Result<()> {
1634            decoder.debug_check_bounds::<Self>(offset);
1635            // Verify that padding bytes are zero.
1636            fidl::decode!(BlobId, D, &mut self.package_id, decoder, offset + 0, _depth)?;
1637            fidl::decode!(
1638                fidl::encoding::BoundedString<1024>,
1639                D,
1640                &mut self.http_blob_dir,
1641                decoder,
1642                offset + 32,
1643                _depth
1644            )?;
1645            Ok(())
1646        }
1647    }
1648
1649    impl fidl::encoding::ValueTypeMarker for BlobId {
1650        type Borrowed<'a> = &'a Self;
1651        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1652            value
1653        }
1654    }
1655
1656    unsafe impl fidl::encoding::TypeMarker for BlobId {
1657        type Owned = Self;
1658
1659        #[inline(always)]
1660        fn inline_align(_context: fidl::encoding::Context) -> usize {
1661            1
1662        }
1663
1664        #[inline(always)]
1665        fn inline_size(_context: fidl::encoding::Context) -> usize {
1666            32
1667        }
1668        #[inline(always)]
1669        fn encode_is_copy() -> bool {
1670            true
1671        }
1672
1673        #[inline(always)]
1674        fn decode_is_copy() -> bool {
1675            true
1676        }
1677    }
1678
1679    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlobId, D> for &BlobId {
1680        #[inline]
1681        unsafe fn encode(
1682            self,
1683            encoder: &mut fidl::encoding::Encoder<'_, D>,
1684            offset: usize,
1685            _depth: fidl::encoding::Depth,
1686        ) -> fidl::Result<()> {
1687            encoder.debug_check_bounds::<BlobId>(offset);
1688            unsafe {
1689                // Copy the object into the buffer.
1690                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1691                (buf_ptr as *mut BlobId).write_unaligned((self as *const BlobId).read());
1692                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1693                // done second because the memcpy will write garbage to these bytes.
1694            }
1695            Ok(())
1696        }
1697    }
1698    unsafe impl<
1699        D: fidl::encoding::ResourceDialect,
1700        T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 32>, D>,
1701    > fidl::encoding::Encode<BlobId, D> for (T0,)
1702    {
1703        #[inline]
1704        unsafe fn encode(
1705            self,
1706            encoder: &mut fidl::encoding::Encoder<'_, D>,
1707            offset: usize,
1708            depth: fidl::encoding::Depth,
1709        ) -> fidl::Result<()> {
1710            encoder.debug_check_bounds::<BlobId>(offset);
1711            // Zero out padding regions. There's no need to apply masks
1712            // because the unmasked parts will be overwritten by fields.
1713            // Write the fields.
1714            self.0.encode(encoder, offset + 0, depth)?;
1715            Ok(())
1716        }
1717    }
1718
1719    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlobId {
1720        #[inline(always)]
1721        fn new_empty() -> Self {
1722            Self { merkle_root: fidl::new_empty!(fidl::encoding::Array<u8, 32>, D) }
1723        }
1724
1725        #[inline]
1726        unsafe fn decode(
1727            &mut self,
1728            decoder: &mut fidl::encoding::Decoder<'_, D>,
1729            offset: usize,
1730            _depth: fidl::encoding::Depth,
1731        ) -> fidl::Result<()> {
1732            decoder.debug_check_bounds::<Self>(offset);
1733            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1734            // Verify that padding bytes are zero.
1735            // Copy from the buffer into the object.
1736            unsafe {
1737                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
1738            }
1739            Ok(())
1740        }
1741    }
1742
1743    impl fidl::encoding::ValueTypeMarker for BlobIdIteratorNextResponse {
1744        type Borrowed<'a> = &'a Self;
1745        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1746            value
1747        }
1748    }
1749
1750    unsafe impl fidl::encoding::TypeMarker for BlobIdIteratorNextResponse {
1751        type Owned = Self;
1752
1753        #[inline(always)]
1754        fn inline_align(_context: fidl::encoding::Context) -> usize {
1755            8
1756        }
1757
1758        #[inline(always)]
1759        fn inline_size(_context: fidl::encoding::Context) -> usize {
1760            16
1761        }
1762    }
1763
1764    unsafe impl<D: fidl::encoding::ResourceDialect>
1765        fidl::encoding::Encode<BlobIdIteratorNextResponse, D> for &BlobIdIteratorNextResponse
1766    {
1767        #[inline]
1768        unsafe fn encode(
1769            self,
1770            encoder: &mut fidl::encoding::Encoder<'_, D>,
1771            offset: usize,
1772            _depth: fidl::encoding::Depth,
1773        ) -> fidl::Result<()> {
1774            encoder.debug_check_bounds::<BlobIdIteratorNextResponse>(offset);
1775            // Delegate to tuple encoding.
1776            fidl::encoding::Encode::<BlobIdIteratorNextResponse, D>::encode(
1777                (
1778                    <fidl::encoding::UnboundedVector<BlobId> as fidl::encoding::ValueTypeMarker>::borrow(&self.blobs),
1779                ),
1780                encoder, offset, _depth
1781            )
1782        }
1783    }
1784    unsafe impl<
1785        D: fidl::encoding::ResourceDialect,
1786        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<BlobId>, D>,
1787    > fidl::encoding::Encode<BlobIdIteratorNextResponse, D> for (T0,)
1788    {
1789        #[inline]
1790        unsafe fn encode(
1791            self,
1792            encoder: &mut fidl::encoding::Encoder<'_, D>,
1793            offset: usize,
1794            depth: fidl::encoding::Depth,
1795        ) -> fidl::Result<()> {
1796            encoder.debug_check_bounds::<BlobIdIteratorNextResponse>(offset);
1797            // Zero out padding regions. There's no need to apply masks
1798            // because the unmasked parts will be overwritten by fields.
1799            // Write the fields.
1800            self.0.encode(encoder, offset + 0, depth)?;
1801            Ok(())
1802        }
1803    }
1804
1805    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1806        for BlobIdIteratorNextResponse
1807    {
1808        #[inline(always)]
1809        fn new_empty() -> Self {
1810            Self { blobs: fidl::new_empty!(fidl::encoding::UnboundedVector<BlobId>, D) }
1811        }
1812
1813        #[inline]
1814        unsafe fn decode(
1815            &mut self,
1816            decoder: &mut fidl::encoding::Decoder<'_, D>,
1817            offset: usize,
1818            _depth: fidl::encoding::Depth,
1819        ) -> fidl::Result<()> {
1820            decoder.debug_check_bounds::<Self>(offset);
1821            // Verify that padding bytes are zero.
1822            fidl::decode!(
1823                fidl::encoding::UnboundedVector<BlobId>,
1824                D,
1825                &mut self.blobs,
1826                decoder,
1827                offset + 0,
1828                _depth
1829            )?;
1830            Ok(())
1831        }
1832    }
1833
1834    impl fidl::encoding::ValueTypeMarker for BlobInfo {
1835        type Borrowed<'a> = &'a Self;
1836        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1837            value
1838        }
1839    }
1840
1841    unsafe impl fidl::encoding::TypeMarker for BlobInfo {
1842        type Owned = Self;
1843
1844        #[inline(always)]
1845        fn inline_align(_context: fidl::encoding::Context) -> usize {
1846            8
1847        }
1848
1849        #[inline(always)]
1850        fn inline_size(_context: fidl::encoding::Context) -> usize {
1851            40
1852        }
1853        #[inline(always)]
1854        fn encode_is_copy() -> bool {
1855            true
1856        }
1857
1858        #[inline(always)]
1859        fn decode_is_copy() -> bool {
1860            true
1861        }
1862    }
1863
1864    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BlobInfo, D> for &BlobInfo {
1865        #[inline]
1866        unsafe fn encode(
1867            self,
1868            encoder: &mut fidl::encoding::Encoder<'_, D>,
1869            offset: usize,
1870            _depth: fidl::encoding::Depth,
1871        ) -> fidl::Result<()> {
1872            encoder.debug_check_bounds::<BlobInfo>(offset);
1873            unsafe {
1874                // Copy the object into the buffer.
1875                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1876                (buf_ptr as *mut BlobInfo).write_unaligned((self as *const BlobInfo).read());
1877                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1878                // done second because the memcpy will write garbage to these bytes.
1879            }
1880            Ok(())
1881        }
1882    }
1883    unsafe impl<
1884        D: fidl::encoding::ResourceDialect,
1885        T0: fidl::encoding::Encode<BlobId, D>,
1886        T1: fidl::encoding::Encode<u64, D>,
1887    > fidl::encoding::Encode<BlobInfo, D> for (T0, T1)
1888    {
1889        #[inline]
1890        unsafe fn encode(
1891            self,
1892            encoder: &mut fidl::encoding::Encoder<'_, D>,
1893            offset: usize,
1894            depth: fidl::encoding::Depth,
1895        ) -> fidl::Result<()> {
1896            encoder.debug_check_bounds::<BlobInfo>(offset);
1897            // Zero out padding regions. There's no need to apply masks
1898            // because the unmasked parts will be overwritten by fields.
1899            // Write the fields.
1900            self.0.encode(encoder, offset + 0, depth)?;
1901            self.1.encode(encoder, offset + 32, depth)?;
1902            Ok(())
1903        }
1904    }
1905
1906    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlobInfo {
1907        #[inline(always)]
1908        fn new_empty() -> Self {
1909            Self { blob_id: fidl::new_empty!(BlobId, D), length: fidl::new_empty!(u64, D) }
1910        }
1911
1912        #[inline]
1913        unsafe fn decode(
1914            &mut self,
1915            decoder: &mut fidl::encoding::Decoder<'_, D>,
1916            offset: usize,
1917            _depth: fidl::encoding::Depth,
1918        ) -> fidl::Result<()> {
1919            decoder.debug_check_bounds::<Self>(offset);
1920            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1921            // Verify that padding bytes are zero.
1922            // Copy from the buffer into the object.
1923            unsafe {
1924                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
1925            }
1926            Ok(())
1927        }
1928    }
1929
1930    impl fidl::encoding::ValueTypeMarker for BlobInfoIteratorNextResponse {
1931        type Borrowed<'a> = &'a Self;
1932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1933            value
1934        }
1935    }
1936
1937    unsafe impl fidl::encoding::TypeMarker for BlobInfoIteratorNextResponse {
1938        type Owned = Self;
1939
1940        #[inline(always)]
1941        fn inline_align(_context: fidl::encoding::Context) -> usize {
1942            8
1943        }
1944
1945        #[inline(always)]
1946        fn inline_size(_context: fidl::encoding::Context) -> usize {
1947            16
1948        }
1949    }
1950
1951    unsafe impl<D: fidl::encoding::ResourceDialect>
1952        fidl::encoding::Encode<BlobInfoIteratorNextResponse, D> for &BlobInfoIteratorNextResponse
1953    {
1954        #[inline]
1955        unsafe fn encode(
1956            self,
1957            encoder: &mut fidl::encoding::Encoder<'_, D>,
1958            offset: usize,
1959            _depth: fidl::encoding::Depth,
1960        ) -> fidl::Result<()> {
1961            encoder.debug_check_bounds::<BlobInfoIteratorNextResponse>(offset);
1962            // Delegate to tuple encoding.
1963            fidl::encoding::Encode::<BlobInfoIteratorNextResponse, D>::encode(
1964                (
1965                    <fidl::encoding::UnboundedVector<BlobInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.blobs),
1966                ),
1967                encoder, offset, _depth
1968            )
1969        }
1970    }
1971    unsafe impl<
1972        D: fidl::encoding::ResourceDialect,
1973        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<BlobInfo>, D>,
1974    > fidl::encoding::Encode<BlobInfoIteratorNextResponse, D> for (T0,)
1975    {
1976        #[inline]
1977        unsafe fn encode(
1978            self,
1979            encoder: &mut fidl::encoding::Encoder<'_, D>,
1980            offset: usize,
1981            depth: fidl::encoding::Depth,
1982        ) -> fidl::Result<()> {
1983            encoder.debug_check_bounds::<BlobInfoIteratorNextResponse>(offset);
1984            // Zero out padding regions. There's no need to apply masks
1985            // because the unmasked parts will be overwritten by fields.
1986            // Write the fields.
1987            self.0.encode(encoder, offset + 0, depth)?;
1988            Ok(())
1989        }
1990    }
1991
1992    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1993        for BlobInfoIteratorNextResponse
1994    {
1995        #[inline(always)]
1996        fn new_empty() -> Self {
1997            Self { blobs: fidl::new_empty!(fidl::encoding::UnboundedVector<BlobInfo>, D) }
1998        }
1999
2000        #[inline]
2001        unsafe fn decode(
2002            &mut self,
2003            decoder: &mut fidl::encoding::Decoder<'_, D>,
2004            offset: usize,
2005            _depth: fidl::encoding::Depth,
2006        ) -> fidl::Result<()> {
2007            decoder.debug_check_bounds::<Self>(offset);
2008            // Verify that padding bytes are zero.
2009            fidl::decode!(
2010                fidl::encoding::UnboundedVector<BlobInfo>,
2011                D,
2012                &mut self.blobs,
2013                decoder,
2014                offset + 0,
2015                _depth
2016            )?;
2017            Ok(())
2018        }
2019    }
2020
2021    impl fidl::encoding::ValueTypeMarker for CupGetInfoRequest {
2022        type Borrowed<'a> = &'a Self;
2023        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2024            value
2025        }
2026    }
2027
2028    unsafe impl fidl::encoding::TypeMarker for CupGetInfoRequest {
2029        type Owned = Self;
2030
2031        #[inline(always)]
2032        fn inline_align(_context: fidl::encoding::Context) -> usize {
2033            8
2034        }
2035
2036        #[inline(always)]
2037        fn inline_size(_context: fidl::encoding::Context) -> usize {
2038            16
2039        }
2040    }
2041
2042    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupGetInfoRequest, D>
2043        for &CupGetInfoRequest
2044    {
2045        #[inline]
2046        unsafe fn encode(
2047            self,
2048            encoder: &mut fidl::encoding::Encoder<'_, D>,
2049            offset: usize,
2050            _depth: fidl::encoding::Depth,
2051        ) -> fidl::Result<()> {
2052            encoder.debug_check_bounds::<CupGetInfoRequest>(offset);
2053            // Delegate to tuple encoding.
2054            fidl::encoding::Encode::<CupGetInfoRequest, D>::encode(
2055                (<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.url),),
2056                encoder,
2057                offset,
2058                _depth,
2059            )
2060        }
2061    }
2062    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PackageUrl, D>>
2063        fidl::encoding::Encode<CupGetInfoRequest, D> for (T0,)
2064    {
2065        #[inline]
2066        unsafe fn encode(
2067            self,
2068            encoder: &mut fidl::encoding::Encoder<'_, D>,
2069            offset: usize,
2070            depth: fidl::encoding::Depth,
2071        ) -> fidl::Result<()> {
2072            encoder.debug_check_bounds::<CupGetInfoRequest>(offset);
2073            // Zero out padding regions. There's no need to apply masks
2074            // because the unmasked parts will be overwritten by fields.
2075            // Write the fields.
2076            self.0.encode(encoder, offset + 0, depth)?;
2077            Ok(())
2078        }
2079    }
2080
2081    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupGetInfoRequest {
2082        #[inline(always)]
2083        fn new_empty() -> Self {
2084            Self { url: fidl::new_empty!(PackageUrl, D) }
2085        }
2086
2087        #[inline]
2088        unsafe fn decode(
2089            &mut self,
2090            decoder: &mut fidl::encoding::Decoder<'_, D>,
2091            offset: usize,
2092            _depth: fidl::encoding::Depth,
2093        ) -> fidl::Result<()> {
2094            decoder.debug_check_bounds::<Self>(offset);
2095            // Verify that padding bytes are zero.
2096            fidl::decode!(PackageUrl, D, &mut self.url, decoder, offset + 0, _depth)?;
2097            Ok(())
2098        }
2099    }
2100
2101    impl fidl::encoding::ValueTypeMarker for CupWriteRequest {
2102        type Borrowed<'a> = &'a Self;
2103        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2104            value
2105        }
2106    }
2107
2108    unsafe impl fidl::encoding::TypeMarker for CupWriteRequest {
2109        type Owned = Self;
2110
2111        #[inline(always)]
2112        fn inline_align(_context: fidl::encoding::Context) -> usize {
2113            8
2114        }
2115
2116        #[inline(always)]
2117        fn inline_size(_context: fidl::encoding::Context) -> usize {
2118            32
2119        }
2120    }
2121
2122    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupWriteRequest, D>
2123        for &CupWriteRequest
2124    {
2125        #[inline]
2126        unsafe fn encode(
2127            self,
2128            encoder: &mut fidl::encoding::Encoder<'_, D>,
2129            offset: usize,
2130            _depth: fidl::encoding::Depth,
2131        ) -> fidl::Result<()> {
2132            encoder.debug_check_bounds::<CupWriteRequest>(offset);
2133            // Delegate to tuple encoding.
2134            fidl::encoding::Encode::<CupWriteRequest, D>::encode(
2135                (
2136                    <PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
2137                    <CupData as fidl::encoding::ValueTypeMarker>::borrow(&self.cup),
2138                ),
2139                encoder,
2140                offset,
2141                _depth,
2142            )
2143        }
2144    }
2145    unsafe impl<
2146        D: fidl::encoding::ResourceDialect,
2147        T0: fidl::encoding::Encode<PackageUrl, D>,
2148        T1: fidl::encoding::Encode<CupData, D>,
2149    > fidl::encoding::Encode<CupWriteRequest, D> for (T0, T1)
2150    {
2151        #[inline]
2152        unsafe fn encode(
2153            self,
2154            encoder: &mut fidl::encoding::Encoder<'_, D>,
2155            offset: usize,
2156            depth: fidl::encoding::Depth,
2157        ) -> fidl::Result<()> {
2158            encoder.debug_check_bounds::<CupWriteRequest>(offset);
2159            // Zero out padding regions. There's no need to apply masks
2160            // because the unmasked parts will be overwritten by fields.
2161            // Write the fields.
2162            self.0.encode(encoder, offset + 0, depth)?;
2163            self.1.encode(encoder, offset + 16, depth)?;
2164            Ok(())
2165        }
2166    }
2167
2168    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupWriteRequest {
2169        #[inline(always)]
2170        fn new_empty() -> Self {
2171            Self { url: fidl::new_empty!(PackageUrl, D), cup: fidl::new_empty!(CupData, D) }
2172        }
2173
2174        #[inline]
2175        unsafe fn decode(
2176            &mut self,
2177            decoder: &mut fidl::encoding::Decoder<'_, D>,
2178            offset: usize,
2179            _depth: fidl::encoding::Depth,
2180        ) -> fidl::Result<()> {
2181            decoder.debug_check_bounds::<Self>(offset);
2182            // Verify that padding bytes are zero.
2183            fidl::decode!(PackageUrl, D, &mut self.url, decoder, offset + 0, _depth)?;
2184            fidl::decode!(CupData, D, &mut self.cup, decoder, offset + 16, _depth)?;
2185            Ok(())
2186        }
2187    }
2188
2189    impl fidl::encoding::ValueTypeMarker for CupGetInfoResponse {
2190        type Borrowed<'a> = &'a Self;
2191        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2192            value
2193        }
2194    }
2195
2196    unsafe impl fidl::encoding::TypeMarker for CupGetInfoResponse {
2197        type Owned = Self;
2198
2199        #[inline(always)]
2200        fn inline_align(_context: fidl::encoding::Context) -> usize {
2201            8
2202        }
2203
2204        #[inline(always)]
2205        fn inline_size(_context: fidl::encoding::Context) -> usize {
2206            32
2207        }
2208    }
2209
2210    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupGetInfoResponse, D>
2211        for &CupGetInfoResponse
2212    {
2213        #[inline]
2214        unsafe fn encode(
2215            self,
2216            encoder: &mut fidl::encoding::Encoder<'_, D>,
2217            offset: usize,
2218            _depth: fidl::encoding::Depth,
2219        ) -> fidl::Result<()> {
2220            encoder.debug_check_bounds::<CupGetInfoResponse>(offset);
2221            // Delegate to tuple encoding.
2222            fidl::encoding::Encode::<CupGetInfoResponse, D>::encode(
2223                (
2224                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
2225                        &self.version,
2226                    ),
2227                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
2228                        &self.channel,
2229                    ),
2230                ),
2231                encoder,
2232                offset,
2233                _depth,
2234            )
2235        }
2236    }
2237    unsafe impl<
2238        D: fidl::encoding::ResourceDialect,
2239        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
2240        T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
2241    > fidl::encoding::Encode<CupGetInfoResponse, D> for (T0, T1)
2242    {
2243        #[inline]
2244        unsafe fn encode(
2245            self,
2246            encoder: &mut fidl::encoding::Encoder<'_, D>,
2247            offset: usize,
2248            depth: fidl::encoding::Depth,
2249        ) -> fidl::Result<()> {
2250            encoder.debug_check_bounds::<CupGetInfoResponse>(offset);
2251            // Zero out padding regions. There's no need to apply masks
2252            // because the unmasked parts will be overwritten by fields.
2253            // Write the fields.
2254            self.0.encode(encoder, offset + 0, depth)?;
2255            self.1.encode(encoder, offset + 16, depth)?;
2256            Ok(())
2257        }
2258    }
2259
2260    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupGetInfoResponse {
2261        #[inline(always)]
2262        fn new_empty() -> Self {
2263            Self {
2264                version: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
2265                channel: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
2266            }
2267        }
2268
2269        #[inline]
2270        unsafe fn decode(
2271            &mut self,
2272            decoder: &mut fidl::encoding::Decoder<'_, D>,
2273            offset: usize,
2274            _depth: fidl::encoding::Depth,
2275        ) -> fidl::Result<()> {
2276            decoder.debug_check_bounds::<Self>(offset);
2277            // Verify that padding bytes are zero.
2278            fidl::decode!(
2279                fidl::encoding::BoundedString<64>,
2280                D,
2281                &mut self.version,
2282                decoder,
2283                offset + 0,
2284                _depth
2285            )?;
2286            fidl::decode!(
2287                fidl::encoding::BoundedString<128>,
2288                D,
2289                &mut self.channel,
2290                decoder,
2291                offset + 16,
2292                _depth
2293            )?;
2294            Ok(())
2295        }
2296    }
2297
2298    impl fidl::encoding::ValueTypeMarker for NeededBlobsBlobWrittenRequest {
2299        type Borrowed<'a> = &'a Self;
2300        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2301            value
2302        }
2303    }
2304
2305    unsafe impl fidl::encoding::TypeMarker for NeededBlobsBlobWrittenRequest {
2306        type Owned = Self;
2307
2308        #[inline(always)]
2309        fn inline_align(_context: fidl::encoding::Context) -> usize {
2310            1
2311        }
2312
2313        #[inline(always)]
2314        fn inline_size(_context: fidl::encoding::Context) -> usize {
2315            32
2316        }
2317        #[inline(always)]
2318        fn encode_is_copy() -> bool {
2319            true
2320        }
2321
2322        #[inline(always)]
2323        fn decode_is_copy() -> bool {
2324            true
2325        }
2326    }
2327
2328    unsafe impl<D: fidl::encoding::ResourceDialect>
2329        fidl::encoding::Encode<NeededBlobsBlobWrittenRequest, D>
2330        for &NeededBlobsBlobWrittenRequest
2331    {
2332        #[inline]
2333        unsafe fn encode(
2334            self,
2335            encoder: &mut fidl::encoding::Encoder<'_, D>,
2336            offset: usize,
2337            _depth: fidl::encoding::Depth,
2338        ) -> fidl::Result<()> {
2339            encoder.debug_check_bounds::<NeededBlobsBlobWrittenRequest>(offset);
2340            unsafe {
2341                // Copy the object into the buffer.
2342                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2343                (buf_ptr as *mut NeededBlobsBlobWrittenRequest)
2344                    .write_unaligned((self as *const NeededBlobsBlobWrittenRequest).read());
2345                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2346                // done second because the memcpy will write garbage to these bytes.
2347            }
2348            Ok(())
2349        }
2350    }
2351    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
2352        fidl::encoding::Encode<NeededBlobsBlobWrittenRequest, D> for (T0,)
2353    {
2354        #[inline]
2355        unsafe fn encode(
2356            self,
2357            encoder: &mut fidl::encoding::Encoder<'_, D>,
2358            offset: usize,
2359            depth: fidl::encoding::Depth,
2360        ) -> fidl::Result<()> {
2361            encoder.debug_check_bounds::<NeededBlobsBlobWrittenRequest>(offset);
2362            // Zero out padding regions. There's no need to apply masks
2363            // because the unmasked parts will be overwritten by fields.
2364            // Write the fields.
2365            self.0.encode(encoder, offset + 0, depth)?;
2366            Ok(())
2367        }
2368    }
2369
2370    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2371        for NeededBlobsBlobWrittenRequest
2372    {
2373        #[inline(always)]
2374        fn new_empty() -> Self {
2375            Self { blob_id: fidl::new_empty!(BlobId, D) }
2376        }
2377
2378        #[inline]
2379        unsafe fn decode(
2380            &mut self,
2381            decoder: &mut fidl::encoding::Decoder<'_, D>,
2382            offset: usize,
2383            _depth: fidl::encoding::Depth,
2384        ) -> fidl::Result<()> {
2385            decoder.debug_check_bounds::<Self>(offset);
2386            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2387            // Verify that padding bytes are zero.
2388            // Copy from the buffer into the object.
2389            unsafe {
2390                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2391            }
2392            Ok(())
2393        }
2394    }
2395
2396    impl fidl::encoding::ValueTypeMarker for NeededBlobsOpenBlobRequest {
2397        type Borrowed<'a> = &'a Self;
2398        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2399            value
2400        }
2401    }
2402
2403    unsafe impl fidl::encoding::TypeMarker for NeededBlobsOpenBlobRequest {
2404        type Owned = Self;
2405
2406        #[inline(always)]
2407        fn inline_align(_context: fidl::encoding::Context) -> usize {
2408            1
2409        }
2410
2411        #[inline(always)]
2412        fn inline_size(_context: fidl::encoding::Context) -> usize {
2413            33
2414        }
2415    }
2416
2417    unsafe impl<D: fidl::encoding::ResourceDialect>
2418        fidl::encoding::Encode<NeededBlobsOpenBlobRequest, D> for &NeededBlobsOpenBlobRequest
2419    {
2420        #[inline]
2421        unsafe fn encode(
2422            self,
2423            encoder: &mut fidl::encoding::Encoder<'_, D>,
2424            offset: usize,
2425            _depth: fidl::encoding::Depth,
2426        ) -> fidl::Result<()> {
2427            encoder.debug_check_bounds::<NeededBlobsOpenBlobRequest>(offset);
2428            // Delegate to tuple encoding.
2429            fidl::encoding::Encode::<NeededBlobsOpenBlobRequest, D>::encode(
2430                (
2431                    <BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.blob_id),
2432                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allow_existing),
2433                ),
2434                encoder,
2435                offset,
2436                _depth,
2437            )
2438        }
2439    }
2440    unsafe impl<
2441        D: fidl::encoding::ResourceDialect,
2442        T0: fidl::encoding::Encode<BlobId, D>,
2443        T1: fidl::encoding::Encode<bool, D>,
2444    > fidl::encoding::Encode<NeededBlobsOpenBlobRequest, D> for (T0, T1)
2445    {
2446        #[inline]
2447        unsafe fn encode(
2448            self,
2449            encoder: &mut fidl::encoding::Encoder<'_, D>,
2450            offset: usize,
2451            depth: fidl::encoding::Depth,
2452        ) -> fidl::Result<()> {
2453            encoder.debug_check_bounds::<NeededBlobsOpenBlobRequest>(offset);
2454            // Zero out padding regions. There's no need to apply masks
2455            // because the unmasked parts will be overwritten by fields.
2456            // Write the fields.
2457            self.0.encode(encoder, offset + 0, depth)?;
2458            self.1.encode(encoder, offset + 32, depth)?;
2459            Ok(())
2460        }
2461    }
2462
2463    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2464        for NeededBlobsOpenBlobRequest
2465    {
2466        #[inline(always)]
2467        fn new_empty() -> Self {
2468            Self { blob_id: fidl::new_empty!(BlobId, D), allow_existing: fidl::new_empty!(bool, D) }
2469        }
2470
2471        #[inline]
2472        unsafe fn decode(
2473            &mut self,
2474            decoder: &mut fidl::encoding::Decoder<'_, D>,
2475            offset: usize,
2476            _depth: fidl::encoding::Depth,
2477        ) -> fidl::Result<()> {
2478            decoder.debug_check_bounds::<Self>(offset);
2479            // Verify that padding bytes are zero.
2480            fidl::decode!(BlobId, D, &mut self.blob_id, decoder, offset + 0, _depth)?;
2481            fidl::decode!(bool, D, &mut self.allow_existing, decoder, offset + 32, _depth)?;
2482            Ok(())
2483        }
2484    }
2485
2486    impl fidl::encoding::ValueTypeMarker for PackageCacheSetUpgradableUrlsRequest {
2487        type Borrowed<'a> = &'a Self;
2488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2489            value
2490        }
2491    }
2492
2493    unsafe impl fidl::encoding::TypeMarker for PackageCacheSetUpgradableUrlsRequest {
2494        type Owned = Self;
2495
2496        #[inline(always)]
2497        fn inline_align(_context: fidl::encoding::Context) -> usize {
2498            8
2499        }
2500
2501        #[inline(always)]
2502        fn inline_size(_context: fidl::encoding::Context) -> usize {
2503            16
2504        }
2505    }
2506
2507    unsafe impl<D: fidl::encoding::ResourceDialect>
2508        fidl::encoding::Encode<PackageCacheSetUpgradableUrlsRequest, D>
2509        for &PackageCacheSetUpgradableUrlsRequest
2510    {
2511        #[inline]
2512        unsafe fn encode(
2513            self,
2514            encoder: &mut fidl::encoding::Encoder<'_, D>,
2515            offset: usize,
2516            _depth: fidl::encoding::Depth,
2517        ) -> fidl::Result<()> {
2518            encoder.debug_check_bounds::<PackageCacheSetUpgradableUrlsRequest>(offset);
2519            // Delegate to tuple encoding.
2520            fidl::encoding::Encode::<PackageCacheSetUpgradableUrlsRequest, D>::encode(
2521                (
2522                    <fidl::encoding::UnboundedVector<PackageUrl> as fidl::encoding::ValueTypeMarker>::borrow(&self.pinned_urls),
2523                ),
2524                encoder, offset, _depth
2525            )
2526        }
2527    }
2528    unsafe impl<
2529        D: fidl::encoding::ResourceDialect,
2530        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<PackageUrl>, D>,
2531    > fidl::encoding::Encode<PackageCacheSetUpgradableUrlsRequest, D> for (T0,)
2532    {
2533        #[inline]
2534        unsafe fn encode(
2535            self,
2536            encoder: &mut fidl::encoding::Encoder<'_, D>,
2537            offset: usize,
2538            depth: fidl::encoding::Depth,
2539        ) -> fidl::Result<()> {
2540            encoder.debug_check_bounds::<PackageCacheSetUpgradableUrlsRequest>(offset);
2541            // Zero out padding regions. There's no need to apply masks
2542            // because the unmasked parts will be overwritten by fields.
2543            // Write the fields.
2544            self.0.encode(encoder, offset + 0, depth)?;
2545            Ok(())
2546        }
2547    }
2548
2549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2550        for PackageCacheSetUpgradableUrlsRequest
2551    {
2552        #[inline(always)]
2553        fn new_empty() -> Self {
2554            Self { pinned_urls: fidl::new_empty!(fidl::encoding::UnboundedVector<PackageUrl>, D) }
2555        }
2556
2557        #[inline]
2558        unsafe fn decode(
2559            &mut self,
2560            decoder: &mut fidl::encoding::Decoder<'_, D>,
2561            offset: usize,
2562            _depth: fidl::encoding::Depth,
2563        ) -> fidl::Result<()> {
2564            decoder.debug_check_bounds::<Self>(offset);
2565            // Verify that padding bytes are zero.
2566            fidl::decode!(
2567                fidl::encoding::UnboundedVector<PackageUrl>,
2568                D,
2569                &mut self.pinned_urls,
2570                decoder,
2571                offset + 0,
2572                _depth
2573            )?;
2574            Ok(())
2575        }
2576    }
2577
2578    impl fidl::encoding::ValueTypeMarker for PackageIndexEntry {
2579        type Borrowed<'a> = &'a Self;
2580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2581            value
2582        }
2583    }
2584
2585    unsafe impl fidl::encoding::TypeMarker for PackageIndexEntry {
2586        type Owned = Self;
2587
2588        #[inline(always)]
2589        fn inline_align(_context: fidl::encoding::Context) -> usize {
2590            8
2591        }
2592
2593        #[inline(always)]
2594        fn inline_size(_context: fidl::encoding::Context) -> usize {
2595            48
2596        }
2597    }
2598
2599    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PackageIndexEntry, D>
2600        for &PackageIndexEntry
2601    {
2602        #[inline]
2603        unsafe fn encode(
2604            self,
2605            encoder: &mut fidl::encoding::Encoder<'_, D>,
2606            offset: usize,
2607            _depth: fidl::encoding::Depth,
2608        ) -> fidl::Result<()> {
2609            encoder.debug_check_bounds::<PackageIndexEntry>(offset);
2610            // Delegate to tuple encoding.
2611            fidl::encoding::Encode::<PackageIndexEntry, D>::encode(
2612                (
2613                    <PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),
2614                    <BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.meta_far_blob_id),
2615                ),
2616                encoder,
2617                offset,
2618                _depth,
2619            )
2620        }
2621    }
2622    unsafe impl<
2623        D: fidl::encoding::ResourceDialect,
2624        T0: fidl::encoding::Encode<PackageUrl, D>,
2625        T1: fidl::encoding::Encode<BlobId, D>,
2626    > fidl::encoding::Encode<PackageIndexEntry, D> for (T0, T1)
2627    {
2628        #[inline]
2629        unsafe fn encode(
2630            self,
2631            encoder: &mut fidl::encoding::Encoder<'_, D>,
2632            offset: usize,
2633            depth: fidl::encoding::Depth,
2634        ) -> fidl::Result<()> {
2635            encoder.debug_check_bounds::<PackageIndexEntry>(offset);
2636            // Zero out padding regions. There's no need to apply masks
2637            // because the unmasked parts will be overwritten by fields.
2638            // Write the fields.
2639            self.0.encode(encoder, offset + 0, depth)?;
2640            self.1.encode(encoder, offset + 16, depth)?;
2641            Ok(())
2642        }
2643    }
2644
2645    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PackageIndexEntry {
2646        #[inline(always)]
2647        fn new_empty() -> Self {
2648            Self {
2649                package_url: fidl::new_empty!(PackageUrl, D),
2650                meta_far_blob_id: fidl::new_empty!(BlobId, D),
2651            }
2652        }
2653
2654        #[inline]
2655        unsafe fn decode(
2656            &mut self,
2657            decoder: &mut fidl::encoding::Decoder<'_, D>,
2658            offset: usize,
2659            _depth: fidl::encoding::Depth,
2660        ) -> fidl::Result<()> {
2661            decoder.debug_check_bounds::<Self>(offset);
2662            // Verify that padding bytes are zero.
2663            fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
2664            fidl::decode!(BlobId, D, &mut self.meta_far_blob_id, decoder, offset + 16, _depth)?;
2665            Ok(())
2666        }
2667    }
2668
2669    impl fidl::encoding::ValueTypeMarker for PackageIndexIteratorNextResponse {
2670        type Borrowed<'a> = &'a Self;
2671        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2672            value
2673        }
2674    }
2675
2676    unsafe impl fidl::encoding::TypeMarker for PackageIndexIteratorNextResponse {
2677        type Owned = Self;
2678
2679        #[inline(always)]
2680        fn inline_align(_context: fidl::encoding::Context) -> usize {
2681            8
2682        }
2683
2684        #[inline(always)]
2685        fn inline_size(_context: fidl::encoding::Context) -> usize {
2686            16
2687        }
2688    }
2689
2690    unsafe impl<D: fidl::encoding::ResourceDialect>
2691        fidl::encoding::Encode<PackageIndexIteratorNextResponse, D>
2692        for &PackageIndexIteratorNextResponse
2693    {
2694        #[inline]
2695        unsafe fn encode(
2696            self,
2697            encoder: &mut fidl::encoding::Encoder<'_, D>,
2698            offset: usize,
2699            _depth: fidl::encoding::Depth,
2700        ) -> fidl::Result<()> {
2701            encoder.debug_check_bounds::<PackageIndexIteratorNextResponse>(offset);
2702            // Delegate to tuple encoding.
2703            fidl::encoding::Encode::<PackageIndexIteratorNextResponse, D>::encode(
2704                (
2705                    <fidl::encoding::UnboundedVector<PackageIndexEntry> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
2706                ),
2707                encoder, offset, _depth
2708            )
2709        }
2710    }
2711    unsafe impl<
2712        D: fidl::encoding::ResourceDialect,
2713        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<PackageIndexEntry>, D>,
2714    > fidl::encoding::Encode<PackageIndexIteratorNextResponse, D> for (T0,)
2715    {
2716        #[inline]
2717        unsafe fn encode(
2718            self,
2719            encoder: &mut fidl::encoding::Encoder<'_, D>,
2720            offset: usize,
2721            depth: fidl::encoding::Depth,
2722        ) -> fidl::Result<()> {
2723            encoder.debug_check_bounds::<PackageIndexIteratorNextResponse>(offset);
2724            // Zero out padding regions. There's no need to apply masks
2725            // because the unmasked parts will be overwritten by fields.
2726            // Write the fields.
2727            self.0.encode(encoder, offset + 0, depth)?;
2728            Ok(())
2729        }
2730    }
2731
2732    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2733        for PackageIndexIteratorNextResponse
2734    {
2735        #[inline(always)]
2736        fn new_empty() -> Self {
2737            Self {
2738                entries: fidl::new_empty!(fidl::encoding::UnboundedVector<PackageIndexEntry>, D),
2739            }
2740        }
2741
2742        #[inline]
2743        unsafe fn decode(
2744            &mut self,
2745            decoder: &mut fidl::encoding::Decoder<'_, D>,
2746            offset: usize,
2747            _depth: fidl::encoding::Depth,
2748        ) -> fidl::Result<()> {
2749            decoder.debug_check_bounds::<Self>(offset);
2750            // Verify that padding bytes are zero.
2751            fidl::decode!(
2752                fidl::encoding::UnboundedVector<PackageIndexEntry>,
2753                D,
2754                &mut self.entries,
2755                decoder,
2756                offset + 0,
2757                _depth
2758            )?;
2759            Ok(())
2760        }
2761    }
2762
2763    impl fidl::encoding::ValueTypeMarker for PackageResolverGetHashRequest {
2764        type Borrowed<'a> = &'a Self;
2765        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2766            value
2767        }
2768    }
2769
2770    unsafe impl fidl::encoding::TypeMarker for PackageResolverGetHashRequest {
2771        type Owned = Self;
2772
2773        #[inline(always)]
2774        fn inline_align(_context: fidl::encoding::Context) -> usize {
2775            8
2776        }
2777
2778        #[inline(always)]
2779        fn inline_size(_context: fidl::encoding::Context) -> usize {
2780            16
2781        }
2782    }
2783
2784    unsafe impl<D: fidl::encoding::ResourceDialect>
2785        fidl::encoding::Encode<PackageResolverGetHashRequest, D>
2786        for &PackageResolverGetHashRequest
2787    {
2788        #[inline]
2789        unsafe fn encode(
2790            self,
2791            encoder: &mut fidl::encoding::Encoder<'_, D>,
2792            offset: usize,
2793            _depth: fidl::encoding::Depth,
2794        ) -> fidl::Result<()> {
2795            encoder.debug_check_bounds::<PackageResolverGetHashRequest>(offset);
2796            // Delegate to tuple encoding.
2797            fidl::encoding::Encode::<PackageResolverGetHashRequest, D>::encode(
2798                (<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),),
2799                encoder,
2800                offset,
2801                _depth,
2802            )
2803        }
2804    }
2805    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PackageUrl, D>>
2806        fidl::encoding::Encode<PackageResolverGetHashRequest, D> for (T0,)
2807    {
2808        #[inline]
2809        unsafe fn encode(
2810            self,
2811            encoder: &mut fidl::encoding::Encoder<'_, D>,
2812            offset: usize,
2813            depth: fidl::encoding::Depth,
2814        ) -> fidl::Result<()> {
2815            encoder.debug_check_bounds::<PackageResolverGetHashRequest>(offset);
2816            // Zero out padding regions. There's no need to apply masks
2817            // because the unmasked parts will be overwritten by fields.
2818            // Write the fields.
2819            self.0.encode(encoder, offset + 0, depth)?;
2820            Ok(())
2821        }
2822    }
2823
2824    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2825        for PackageResolverGetHashRequest
2826    {
2827        #[inline(always)]
2828        fn new_empty() -> Self {
2829            Self { package_url: fidl::new_empty!(PackageUrl, D) }
2830        }
2831
2832        #[inline]
2833        unsafe fn decode(
2834            &mut self,
2835            decoder: &mut fidl::encoding::Decoder<'_, D>,
2836            offset: usize,
2837            _depth: fidl::encoding::Depth,
2838        ) -> fidl::Result<()> {
2839            decoder.debug_check_bounds::<Self>(offset);
2840            // Verify that padding bytes are zero.
2841            fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
2842            Ok(())
2843        }
2844    }
2845
2846    impl fidl::encoding::ValueTypeMarker for PackageResolverGetHashResponse {
2847        type Borrowed<'a> = &'a Self;
2848        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2849            value
2850        }
2851    }
2852
2853    unsafe impl fidl::encoding::TypeMarker for PackageResolverGetHashResponse {
2854        type Owned = Self;
2855
2856        #[inline(always)]
2857        fn inline_align(_context: fidl::encoding::Context) -> usize {
2858            1
2859        }
2860
2861        #[inline(always)]
2862        fn inline_size(_context: fidl::encoding::Context) -> usize {
2863            32
2864        }
2865        #[inline(always)]
2866        fn encode_is_copy() -> bool {
2867            true
2868        }
2869
2870        #[inline(always)]
2871        fn decode_is_copy() -> bool {
2872            true
2873        }
2874    }
2875
2876    unsafe impl<D: fidl::encoding::ResourceDialect>
2877        fidl::encoding::Encode<PackageResolverGetHashResponse, D>
2878        for &PackageResolverGetHashResponse
2879    {
2880        #[inline]
2881        unsafe fn encode(
2882            self,
2883            encoder: &mut fidl::encoding::Encoder<'_, D>,
2884            offset: usize,
2885            _depth: fidl::encoding::Depth,
2886        ) -> fidl::Result<()> {
2887            encoder.debug_check_bounds::<PackageResolverGetHashResponse>(offset);
2888            unsafe {
2889                // Copy the object into the buffer.
2890                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2891                (buf_ptr as *mut PackageResolverGetHashResponse)
2892                    .write_unaligned((self as *const PackageResolverGetHashResponse).read());
2893                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2894                // done second because the memcpy will write garbage to these bytes.
2895            }
2896            Ok(())
2897        }
2898    }
2899    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
2900        fidl::encoding::Encode<PackageResolverGetHashResponse, D> for (T0,)
2901    {
2902        #[inline]
2903        unsafe fn encode(
2904            self,
2905            encoder: &mut fidl::encoding::Encoder<'_, D>,
2906            offset: usize,
2907            depth: fidl::encoding::Depth,
2908        ) -> fidl::Result<()> {
2909            encoder.debug_check_bounds::<PackageResolverGetHashResponse>(offset);
2910            // Zero out padding regions. There's no need to apply masks
2911            // because the unmasked parts will be overwritten by fields.
2912            // Write the fields.
2913            self.0.encode(encoder, offset + 0, depth)?;
2914            Ok(())
2915        }
2916    }
2917
2918    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2919        for PackageResolverGetHashResponse
2920    {
2921        #[inline(always)]
2922        fn new_empty() -> Self {
2923            Self { meta_far_blob_id: fidl::new_empty!(BlobId, D) }
2924        }
2925
2926        #[inline]
2927        unsafe fn decode(
2928            &mut self,
2929            decoder: &mut fidl::encoding::Decoder<'_, D>,
2930            offset: usize,
2931            _depth: fidl::encoding::Depth,
2932        ) -> fidl::Result<()> {
2933            decoder.debug_check_bounds::<Self>(offset);
2934            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2935            // Verify that padding bytes are zero.
2936            // Copy from the buffer into the object.
2937            unsafe {
2938                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2939            }
2940            Ok(())
2941        }
2942    }
2943
2944    impl fidl::encoding::ValueTypeMarker for PackageResolverResolveWithContextResponse {
2945        type Borrowed<'a> = &'a Self;
2946        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2947            value
2948        }
2949    }
2950
2951    unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveWithContextResponse {
2952        type Owned = Self;
2953
2954        #[inline(always)]
2955        fn inline_align(_context: fidl::encoding::Context) -> usize {
2956            8
2957        }
2958
2959        #[inline(always)]
2960        fn inline_size(_context: fidl::encoding::Context) -> usize {
2961            16
2962        }
2963    }
2964
2965    unsafe impl<D: fidl::encoding::ResourceDialect>
2966        fidl::encoding::Encode<PackageResolverResolveWithContextResponse, D>
2967        for &PackageResolverResolveWithContextResponse
2968    {
2969        #[inline]
2970        unsafe fn encode(
2971            self,
2972            encoder: &mut fidl::encoding::Encoder<'_, D>,
2973            offset: usize,
2974            _depth: fidl::encoding::Depth,
2975        ) -> fidl::Result<()> {
2976            encoder.debug_check_bounds::<PackageResolverResolveWithContextResponse>(offset);
2977            // Delegate to tuple encoding.
2978            fidl::encoding::Encode::<PackageResolverResolveWithContextResponse, D>::encode(
2979                (<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(
2980                    &self.resolved_context,
2981                ),),
2982                encoder,
2983                offset,
2984                _depth,
2985            )
2986        }
2987    }
2988    unsafe impl<
2989        D: fidl::encoding::ResourceDialect,
2990        T0: fidl::encoding::Encode<ResolutionContext, D>,
2991    > fidl::encoding::Encode<PackageResolverResolveWithContextResponse, D> for (T0,)
2992    {
2993        #[inline]
2994        unsafe fn encode(
2995            self,
2996            encoder: &mut fidl::encoding::Encoder<'_, D>,
2997            offset: usize,
2998            depth: fidl::encoding::Depth,
2999        ) -> fidl::Result<()> {
3000            encoder.debug_check_bounds::<PackageResolverResolveWithContextResponse>(offset);
3001            // Zero out padding regions. There's no need to apply masks
3002            // because the unmasked parts will be overwritten by fields.
3003            // Write the fields.
3004            self.0.encode(encoder, offset + 0, depth)?;
3005            Ok(())
3006        }
3007    }
3008
3009    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3010        for PackageResolverResolveWithContextResponse
3011    {
3012        #[inline(always)]
3013        fn new_empty() -> Self {
3014            Self { resolved_context: fidl::new_empty!(ResolutionContext, D) }
3015        }
3016
3017        #[inline]
3018        unsafe fn decode(
3019            &mut self,
3020            decoder: &mut fidl::encoding::Decoder<'_, D>,
3021            offset: usize,
3022            _depth: fidl::encoding::Depth,
3023        ) -> fidl::Result<()> {
3024            decoder.debug_check_bounds::<Self>(offset);
3025            // Verify that padding bytes are zero.
3026            fidl::decode!(
3027                ResolutionContext,
3028                D,
3029                &mut self.resolved_context,
3030                decoder,
3031                offset + 0,
3032                _depth
3033            )?;
3034            Ok(())
3035        }
3036    }
3037
3038    impl fidl::encoding::ValueTypeMarker for PackageResolverResolveResponse {
3039        type Borrowed<'a> = &'a Self;
3040        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3041            value
3042        }
3043    }
3044
3045    unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveResponse {
3046        type Owned = Self;
3047
3048        #[inline(always)]
3049        fn inline_align(_context: fidl::encoding::Context) -> usize {
3050            8
3051        }
3052
3053        #[inline(always)]
3054        fn inline_size(_context: fidl::encoding::Context) -> usize {
3055            16
3056        }
3057    }
3058
3059    unsafe impl<D: fidl::encoding::ResourceDialect>
3060        fidl::encoding::Encode<PackageResolverResolveResponse, D>
3061        for &PackageResolverResolveResponse
3062    {
3063        #[inline]
3064        unsafe fn encode(
3065            self,
3066            encoder: &mut fidl::encoding::Encoder<'_, D>,
3067            offset: usize,
3068            _depth: fidl::encoding::Depth,
3069        ) -> fidl::Result<()> {
3070            encoder.debug_check_bounds::<PackageResolverResolveResponse>(offset);
3071            // Delegate to tuple encoding.
3072            fidl::encoding::Encode::<PackageResolverResolveResponse, D>::encode(
3073                (<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(
3074                    &self.resolved_context,
3075                ),),
3076                encoder,
3077                offset,
3078                _depth,
3079            )
3080        }
3081    }
3082    unsafe impl<
3083        D: fidl::encoding::ResourceDialect,
3084        T0: fidl::encoding::Encode<ResolutionContext, D>,
3085    > fidl::encoding::Encode<PackageResolverResolveResponse, D> for (T0,)
3086    {
3087        #[inline]
3088        unsafe fn encode(
3089            self,
3090            encoder: &mut fidl::encoding::Encoder<'_, D>,
3091            offset: usize,
3092            depth: fidl::encoding::Depth,
3093        ) -> fidl::Result<()> {
3094            encoder.debug_check_bounds::<PackageResolverResolveResponse>(offset);
3095            // Zero out padding regions. There's no need to apply masks
3096            // because the unmasked parts will be overwritten by fields.
3097            // Write the fields.
3098            self.0.encode(encoder, offset + 0, depth)?;
3099            Ok(())
3100        }
3101    }
3102
3103    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3104        for PackageResolverResolveResponse
3105    {
3106        #[inline(always)]
3107        fn new_empty() -> Self {
3108            Self { resolved_context: fidl::new_empty!(ResolutionContext, D) }
3109        }
3110
3111        #[inline]
3112        unsafe fn decode(
3113            &mut self,
3114            decoder: &mut fidl::encoding::Decoder<'_, D>,
3115            offset: usize,
3116            _depth: fidl::encoding::Depth,
3117        ) -> fidl::Result<()> {
3118            decoder.debug_check_bounds::<Self>(offset);
3119            // Verify that padding bytes are zero.
3120            fidl::decode!(
3121                ResolutionContext,
3122                D,
3123                &mut self.resolved_context,
3124                decoder,
3125                offset + 0,
3126                _depth
3127            )?;
3128            Ok(())
3129        }
3130    }
3131
3132    impl fidl::encoding::ValueTypeMarker for PackageUrl {
3133        type Borrowed<'a> = &'a Self;
3134        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3135            value
3136        }
3137    }
3138
3139    unsafe impl fidl::encoding::TypeMarker for PackageUrl {
3140        type Owned = Self;
3141
3142        #[inline(always)]
3143        fn inline_align(_context: fidl::encoding::Context) -> usize {
3144            8
3145        }
3146
3147        #[inline(always)]
3148        fn inline_size(_context: fidl::encoding::Context) -> usize {
3149            16
3150        }
3151    }
3152
3153    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PackageUrl, D>
3154        for &PackageUrl
3155    {
3156        #[inline]
3157        unsafe fn encode(
3158            self,
3159            encoder: &mut fidl::encoding::Encoder<'_, D>,
3160            offset: usize,
3161            _depth: fidl::encoding::Depth,
3162        ) -> fidl::Result<()> {
3163            encoder.debug_check_bounds::<PackageUrl>(offset);
3164            // Delegate to tuple encoding.
3165            fidl::encoding::Encode::<PackageUrl, D>::encode(
3166                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
3167                    &self.url,
3168                ),),
3169                encoder,
3170                offset,
3171                _depth,
3172            )
3173        }
3174    }
3175    unsafe impl<
3176        D: fidl::encoding::ResourceDialect,
3177        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
3178    > fidl::encoding::Encode<PackageUrl, D> for (T0,)
3179    {
3180        #[inline]
3181        unsafe fn encode(
3182            self,
3183            encoder: &mut fidl::encoding::Encoder<'_, D>,
3184            offset: usize,
3185            depth: fidl::encoding::Depth,
3186        ) -> fidl::Result<()> {
3187            encoder.debug_check_bounds::<PackageUrl>(offset);
3188            // Zero out padding regions. There's no need to apply masks
3189            // because the unmasked parts will be overwritten by fields.
3190            // Write the fields.
3191            self.0.encode(encoder, offset + 0, depth)?;
3192            Ok(())
3193        }
3194    }
3195
3196    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PackageUrl {
3197        #[inline(always)]
3198        fn new_empty() -> Self {
3199            Self { url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
3200        }
3201
3202        #[inline]
3203        unsafe fn decode(
3204            &mut self,
3205            decoder: &mut fidl::encoding::Decoder<'_, D>,
3206            offset: usize,
3207            _depth: fidl::encoding::Depth,
3208        ) -> fidl::Result<()> {
3209            decoder.debug_check_bounds::<Self>(offset);
3210            // Verify that padding bytes are zero.
3211            fidl::decode!(
3212                fidl::encoding::BoundedString<4096>,
3213                D,
3214                &mut self.url,
3215                decoder,
3216                offset + 0,
3217                _depth
3218            )?;
3219            Ok(())
3220        }
3221    }
3222
3223    impl fidl::encoding::ValueTypeMarker for RepositoryIteratorNextResponse {
3224        type Borrowed<'a> = &'a Self;
3225        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3226            value
3227        }
3228    }
3229
3230    unsafe impl fidl::encoding::TypeMarker for RepositoryIteratorNextResponse {
3231        type Owned = Self;
3232
3233        #[inline(always)]
3234        fn inline_align(_context: fidl::encoding::Context) -> usize {
3235            8
3236        }
3237
3238        #[inline(always)]
3239        fn inline_size(_context: fidl::encoding::Context) -> usize {
3240            16
3241        }
3242    }
3243
3244    unsafe impl<D: fidl::encoding::ResourceDialect>
3245        fidl::encoding::Encode<RepositoryIteratorNextResponse, D>
3246        for &RepositoryIteratorNextResponse
3247    {
3248        #[inline]
3249        unsafe fn encode(
3250            self,
3251            encoder: &mut fidl::encoding::Encoder<'_, D>,
3252            offset: usize,
3253            _depth: fidl::encoding::Depth,
3254        ) -> fidl::Result<()> {
3255            encoder.debug_check_bounds::<RepositoryIteratorNextResponse>(offset);
3256            // Delegate to tuple encoding.
3257            fidl::encoding::Encode::<RepositoryIteratorNextResponse, D>::encode(
3258                (
3259                    <fidl::encoding::UnboundedVector<RepositoryConfig> as fidl::encoding::ValueTypeMarker>::borrow(&self.repos),
3260                ),
3261                encoder, offset, _depth
3262            )
3263        }
3264    }
3265    unsafe impl<
3266        D: fidl::encoding::ResourceDialect,
3267        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RepositoryConfig>, D>,
3268    > fidl::encoding::Encode<RepositoryIteratorNextResponse, D> for (T0,)
3269    {
3270        #[inline]
3271        unsafe fn encode(
3272            self,
3273            encoder: &mut fidl::encoding::Encoder<'_, D>,
3274            offset: usize,
3275            depth: fidl::encoding::Depth,
3276        ) -> fidl::Result<()> {
3277            encoder.debug_check_bounds::<RepositoryIteratorNextResponse>(offset);
3278            // Zero out padding regions. There's no need to apply masks
3279            // because the unmasked parts will be overwritten by fields.
3280            // Write the fields.
3281            self.0.encode(encoder, offset + 0, depth)?;
3282            Ok(())
3283        }
3284    }
3285
3286    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3287        for RepositoryIteratorNextResponse
3288    {
3289        #[inline(always)]
3290        fn new_empty() -> Self {
3291            Self { repos: fidl::new_empty!(fidl::encoding::UnboundedVector<RepositoryConfig>, D) }
3292        }
3293
3294        #[inline]
3295        unsafe fn decode(
3296            &mut self,
3297            decoder: &mut fidl::encoding::Decoder<'_, D>,
3298            offset: usize,
3299            _depth: fidl::encoding::Depth,
3300        ) -> fidl::Result<()> {
3301            decoder.debug_check_bounds::<Self>(offset);
3302            // Verify that padding bytes are zero.
3303            fidl::decode!(
3304                fidl::encoding::UnboundedVector<RepositoryConfig>,
3305                D,
3306                &mut self.repos,
3307                decoder,
3308                offset + 0,
3309                _depth
3310            )?;
3311            Ok(())
3312        }
3313    }
3314
3315    impl fidl::encoding::ValueTypeMarker for RepositoryManagerAddMirrorRequest {
3316        type Borrowed<'a> = &'a Self;
3317        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3318            value
3319        }
3320    }
3321
3322    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerAddMirrorRequest {
3323        type Owned = Self;
3324
3325        #[inline(always)]
3326        fn inline_align(_context: fidl::encoding::Context) -> usize {
3327            8
3328        }
3329
3330        #[inline(always)]
3331        fn inline_size(_context: fidl::encoding::Context) -> usize {
3332            32
3333        }
3334    }
3335
3336    unsafe impl<D: fidl::encoding::ResourceDialect>
3337        fidl::encoding::Encode<RepositoryManagerAddMirrorRequest, D>
3338        for &RepositoryManagerAddMirrorRequest
3339    {
3340        #[inline]
3341        unsafe fn encode(
3342            self,
3343            encoder: &mut fidl::encoding::Encoder<'_, D>,
3344            offset: usize,
3345            _depth: fidl::encoding::Depth,
3346        ) -> fidl::Result<()> {
3347            encoder.debug_check_bounds::<RepositoryManagerAddMirrorRequest>(offset);
3348            // Delegate to tuple encoding.
3349            fidl::encoding::Encode::<RepositoryManagerAddMirrorRequest, D>::encode(
3350                (
3351                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3352                        &self.repo_url,
3353                    ),
3354                    <MirrorConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.mirror),
3355                ),
3356                encoder,
3357                offset,
3358                _depth,
3359            )
3360        }
3361    }
3362    unsafe impl<
3363        D: fidl::encoding::ResourceDialect,
3364        T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3365        T1: fidl::encoding::Encode<MirrorConfig, D>,
3366    > fidl::encoding::Encode<RepositoryManagerAddMirrorRequest, D> for (T0, T1)
3367    {
3368        #[inline]
3369        unsafe fn encode(
3370            self,
3371            encoder: &mut fidl::encoding::Encoder<'_, D>,
3372            offset: usize,
3373            depth: fidl::encoding::Depth,
3374        ) -> fidl::Result<()> {
3375            encoder.debug_check_bounds::<RepositoryManagerAddMirrorRequest>(offset);
3376            // Zero out padding regions. There's no need to apply masks
3377            // because the unmasked parts will be overwritten by fields.
3378            // Write the fields.
3379            self.0.encode(encoder, offset + 0, depth)?;
3380            self.1.encode(encoder, offset + 16, depth)?;
3381            Ok(())
3382        }
3383    }
3384
3385    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3386        for RepositoryManagerAddMirrorRequest
3387    {
3388        #[inline(always)]
3389        fn new_empty() -> Self {
3390            Self {
3391                repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3392                mirror: fidl::new_empty!(MirrorConfig, D),
3393            }
3394        }
3395
3396        #[inline]
3397        unsafe fn decode(
3398            &mut self,
3399            decoder: &mut fidl::encoding::Decoder<'_, D>,
3400            offset: usize,
3401            _depth: fidl::encoding::Depth,
3402        ) -> fidl::Result<()> {
3403            decoder.debug_check_bounds::<Self>(offset);
3404            // Verify that padding bytes are zero.
3405            fidl::decode!(
3406                fidl::encoding::UnboundedString,
3407                D,
3408                &mut self.repo_url,
3409                decoder,
3410                offset + 0,
3411                _depth
3412            )?;
3413            fidl::decode!(MirrorConfig, D, &mut self.mirror, decoder, offset + 16, _depth)?;
3414            Ok(())
3415        }
3416    }
3417
3418    impl fidl::encoding::ValueTypeMarker for RepositoryManagerAddRequest {
3419        type Borrowed<'a> = &'a Self;
3420        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3421            value
3422        }
3423    }
3424
3425    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerAddRequest {
3426        type Owned = Self;
3427
3428        #[inline(always)]
3429        fn inline_align(_context: fidl::encoding::Context) -> usize {
3430            8
3431        }
3432
3433        #[inline(always)]
3434        fn inline_size(_context: fidl::encoding::Context) -> usize {
3435            16
3436        }
3437    }
3438
3439    unsafe impl<D: fidl::encoding::ResourceDialect>
3440        fidl::encoding::Encode<RepositoryManagerAddRequest, D> for &RepositoryManagerAddRequest
3441    {
3442        #[inline]
3443        unsafe fn encode(
3444            self,
3445            encoder: &mut fidl::encoding::Encoder<'_, D>,
3446            offset: usize,
3447            _depth: fidl::encoding::Depth,
3448        ) -> fidl::Result<()> {
3449            encoder.debug_check_bounds::<RepositoryManagerAddRequest>(offset);
3450            // Delegate to tuple encoding.
3451            fidl::encoding::Encode::<RepositoryManagerAddRequest, D>::encode(
3452                (<RepositoryConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.repo),),
3453                encoder,
3454                offset,
3455                _depth,
3456            )
3457        }
3458    }
3459    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RepositoryConfig, D>>
3460        fidl::encoding::Encode<RepositoryManagerAddRequest, D> for (T0,)
3461    {
3462        #[inline]
3463        unsafe fn encode(
3464            self,
3465            encoder: &mut fidl::encoding::Encoder<'_, D>,
3466            offset: usize,
3467            depth: fidl::encoding::Depth,
3468        ) -> fidl::Result<()> {
3469            encoder.debug_check_bounds::<RepositoryManagerAddRequest>(offset);
3470            // Zero out padding regions. There's no need to apply masks
3471            // because the unmasked parts will be overwritten by fields.
3472            // Write the fields.
3473            self.0.encode(encoder, offset + 0, depth)?;
3474            Ok(())
3475        }
3476    }
3477
3478    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3479        for RepositoryManagerAddRequest
3480    {
3481        #[inline(always)]
3482        fn new_empty() -> Self {
3483            Self { repo: fidl::new_empty!(RepositoryConfig, D) }
3484        }
3485
3486        #[inline]
3487        unsafe fn decode(
3488            &mut self,
3489            decoder: &mut fidl::encoding::Decoder<'_, D>,
3490            offset: usize,
3491            _depth: fidl::encoding::Depth,
3492        ) -> fidl::Result<()> {
3493            decoder.debug_check_bounds::<Self>(offset);
3494            // Verify that padding bytes are zero.
3495            fidl::decode!(RepositoryConfig, D, &mut self.repo, decoder, offset + 0, _depth)?;
3496            Ok(())
3497        }
3498    }
3499
3500    impl fidl::encoding::ValueTypeMarker for RepositoryManagerRemoveMirrorRequest {
3501        type Borrowed<'a> = &'a Self;
3502        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3503            value
3504        }
3505    }
3506
3507    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerRemoveMirrorRequest {
3508        type Owned = Self;
3509
3510        #[inline(always)]
3511        fn inline_align(_context: fidl::encoding::Context) -> usize {
3512            8
3513        }
3514
3515        #[inline(always)]
3516        fn inline_size(_context: fidl::encoding::Context) -> usize {
3517            32
3518        }
3519    }
3520
3521    unsafe impl<D: fidl::encoding::ResourceDialect>
3522        fidl::encoding::Encode<RepositoryManagerRemoveMirrorRequest, D>
3523        for &RepositoryManagerRemoveMirrorRequest
3524    {
3525        #[inline]
3526        unsafe fn encode(
3527            self,
3528            encoder: &mut fidl::encoding::Encoder<'_, D>,
3529            offset: usize,
3530            _depth: fidl::encoding::Depth,
3531        ) -> fidl::Result<()> {
3532            encoder.debug_check_bounds::<RepositoryManagerRemoveMirrorRequest>(offset);
3533            // Delegate to tuple encoding.
3534            fidl::encoding::Encode::<RepositoryManagerRemoveMirrorRequest, D>::encode(
3535                (
3536                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3537                        &self.repo_url,
3538                    ),
3539                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3540                        &self.mirror_url,
3541                    ),
3542                ),
3543                encoder,
3544                offset,
3545                _depth,
3546            )
3547        }
3548    }
3549    unsafe impl<
3550        D: fidl::encoding::ResourceDialect,
3551        T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3552        T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3553    > fidl::encoding::Encode<RepositoryManagerRemoveMirrorRequest, D> for (T0, T1)
3554    {
3555        #[inline]
3556        unsafe fn encode(
3557            self,
3558            encoder: &mut fidl::encoding::Encoder<'_, D>,
3559            offset: usize,
3560            depth: fidl::encoding::Depth,
3561        ) -> fidl::Result<()> {
3562            encoder.debug_check_bounds::<RepositoryManagerRemoveMirrorRequest>(offset);
3563            // Zero out padding regions. There's no need to apply masks
3564            // because the unmasked parts will be overwritten by fields.
3565            // Write the fields.
3566            self.0.encode(encoder, offset + 0, depth)?;
3567            self.1.encode(encoder, offset + 16, depth)?;
3568            Ok(())
3569        }
3570    }
3571
3572    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3573        for RepositoryManagerRemoveMirrorRequest
3574    {
3575        #[inline(always)]
3576        fn new_empty() -> Self {
3577            Self {
3578                repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3579                mirror_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3580            }
3581        }
3582
3583        #[inline]
3584        unsafe fn decode(
3585            &mut self,
3586            decoder: &mut fidl::encoding::Decoder<'_, D>,
3587            offset: usize,
3588            _depth: fidl::encoding::Depth,
3589        ) -> fidl::Result<()> {
3590            decoder.debug_check_bounds::<Self>(offset);
3591            // Verify that padding bytes are zero.
3592            fidl::decode!(
3593                fidl::encoding::UnboundedString,
3594                D,
3595                &mut self.repo_url,
3596                decoder,
3597                offset + 0,
3598                _depth
3599            )?;
3600            fidl::decode!(
3601                fidl::encoding::UnboundedString,
3602                D,
3603                &mut self.mirror_url,
3604                decoder,
3605                offset + 16,
3606                _depth
3607            )?;
3608            Ok(())
3609        }
3610    }
3611
3612    impl fidl::encoding::ValueTypeMarker for RepositoryManagerRemoveRequest {
3613        type Borrowed<'a> = &'a Self;
3614        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3615            value
3616        }
3617    }
3618
3619    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerRemoveRequest {
3620        type Owned = Self;
3621
3622        #[inline(always)]
3623        fn inline_align(_context: fidl::encoding::Context) -> usize {
3624            8
3625        }
3626
3627        #[inline(always)]
3628        fn inline_size(_context: fidl::encoding::Context) -> usize {
3629            16
3630        }
3631    }
3632
3633    unsafe impl<D: fidl::encoding::ResourceDialect>
3634        fidl::encoding::Encode<RepositoryManagerRemoveRequest, D>
3635        for &RepositoryManagerRemoveRequest
3636    {
3637        #[inline]
3638        unsafe fn encode(
3639            self,
3640            encoder: &mut fidl::encoding::Encoder<'_, D>,
3641            offset: usize,
3642            _depth: fidl::encoding::Depth,
3643        ) -> fidl::Result<()> {
3644            encoder.debug_check_bounds::<RepositoryManagerRemoveRequest>(offset);
3645            // Delegate to tuple encoding.
3646            fidl::encoding::Encode::<RepositoryManagerRemoveRequest, D>::encode(
3647                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3648                    &self.repo_url,
3649                ),),
3650                encoder,
3651                offset,
3652                _depth,
3653            )
3654        }
3655    }
3656    unsafe impl<
3657        D: fidl::encoding::ResourceDialect,
3658        T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3659    > fidl::encoding::Encode<RepositoryManagerRemoveRequest, D> for (T0,)
3660    {
3661        #[inline]
3662        unsafe fn encode(
3663            self,
3664            encoder: &mut fidl::encoding::Encoder<'_, D>,
3665            offset: usize,
3666            depth: fidl::encoding::Depth,
3667        ) -> fidl::Result<()> {
3668            encoder.debug_check_bounds::<RepositoryManagerRemoveRequest>(offset);
3669            // Zero out padding regions. There's no need to apply masks
3670            // because the unmasked parts will be overwritten by fields.
3671            // Write the fields.
3672            self.0.encode(encoder, offset + 0, depth)?;
3673            Ok(())
3674        }
3675    }
3676
3677    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3678        for RepositoryManagerRemoveRequest
3679    {
3680        #[inline(always)]
3681        fn new_empty() -> Self {
3682            Self { repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
3683        }
3684
3685        #[inline]
3686        unsafe fn decode(
3687            &mut self,
3688            decoder: &mut fidl::encoding::Decoder<'_, D>,
3689            offset: usize,
3690            _depth: fidl::encoding::Depth,
3691        ) -> fidl::Result<()> {
3692            decoder.debug_check_bounds::<Self>(offset);
3693            // Verify that padding bytes are zero.
3694            fidl::decode!(
3695                fidl::encoding::UnboundedString,
3696                D,
3697                &mut self.repo_url,
3698                decoder,
3699                offset + 0,
3700                _depth
3701            )?;
3702            Ok(())
3703        }
3704    }
3705
3706    impl fidl::encoding::ValueTypeMarker for RepositoryUrl {
3707        type Borrowed<'a> = &'a Self;
3708        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3709            value
3710        }
3711    }
3712
3713    unsafe impl fidl::encoding::TypeMarker for RepositoryUrl {
3714        type Owned = Self;
3715
3716        #[inline(always)]
3717        fn inline_align(_context: fidl::encoding::Context) -> usize {
3718            8
3719        }
3720
3721        #[inline(always)]
3722        fn inline_size(_context: fidl::encoding::Context) -> usize {
3723            16
3724        }
3725    }
3726
3727    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryUrl, D>
3728        for &RepositoryUrl
3729    {
3730        #[inline]
3731        unsafe fn encode(
3732            self,
3733            encoder: &mut fidl::encoding::Encoder<'_, D>,
3734            offset: usize,
3735            _depth: fidl::encoding::Depth,
3736        ) -> fidl::Result<()> {
3737            encoder.debug_check_bounds::<RepositoryUrl>(offset);
3738            // Delegate to tuple encoding.
3739            fidl::encoding::Encode::<RepositoryUrl, D>::encode(
3740                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
3741                    &self.url,
3742                ),),
3743                encoder,
3744                offset,
3745                _depth,
3746            )
3747        }
3748    }
3749    unsafe impl<
3750        D: fidl::encoding::ResourceDialect,
3751        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
3752    > fidl::encoding::Encode<RepositoryUrl, D> for (T0,)
3753    {
3754        #[inline]
3755        unsafe fn encode(
3756            self,
3757            encoder: &mut fidl::encoding::Encoder<'_, D>,
3758            offset: usize,
3759            depth: fidl::encoding::Depth,
3760        ) -> fidl::Result<()> {
3761            encoder.debug_check_bounds::<RepositoryUrl>(offset);
3762            // Zero out padding regions. There's no need to apply masks
3763            // because the unmasked parts will be overwritten by fields.
3764            // Write the fields.
3765            self.0.encode(encoder, offset + 0, depth)?;
3766            Ok(())
3767        }
3768    }
3769
3770    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryUrl {
3771        #[inline(always)]
3772        fn new_empty() -> Self {
3773            Self { url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
3774        }
3775
3776        #[inline]
3777        unsafe fn decode(
3778            &mut self,
3779            decoder: &mut fidl::encoding::Decoder<'_, D>,
3780            offset: usize,
3781            _depth: fidl::encoding::Depth,
3782        ) -> fidl::Result<()> {
3783            decoder.debug_check_bounds::<Self>(offset);
3784            // Verify that padding bytes are zero.
3785            fidl::decode!(
3786                fidl::encoding::BoundedString<4096>,
3787                D,
3788                &mut self.url,
3789                decoder,
3790                offset + 0,
3791                _depth
3792            )?;
3793            Ok(())
3794        }
3795    }
3796
3797    impl fidl::encoding::ValueTypeMarker for ResolutionContext {
3798        type Borrowed<'a> = &'a Self;
3799        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3800            value
3801        }
3802    }
3803
3804    unsafe impl fidl::encoding::TypeMarker for ResolutionContext {
3805        type Owned = Self;
3806
3807        #[inline(always)]
3808        fn inline_align(_context: fidl::encoding::Context) -> usize {
3809            8
3810        }
3811
3812        #[inline(always)]
3813        fn inline_size(_context: fidl::encoding::Context) -> usize {
3814            16
3815        }
3816    }
3817
3818    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolutionContext, D>
3819        for &ResolutionContext
3820    {
3821        #[inline]
3822        unsafe fn encode(
3823            self,
3824            encoder: &mut fidl::encoding::Encoder<'_, D>,
3825            offset: usize,
3826            _depth: fidl::encoding::Depth,
3827        ) -> fidl::Result<()> {
3828            encoder.debug_check_bounds::<ResolutionContext>(offset);
3829            // Delegate to tuple encoding.
3830            fidl::encoding::Encode::<ResolutionContext, D>::encode(
3831                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
3832                    &self.bytes,
3833                ),),
3834                encoder,
3835                offset,
3836                _depth,
3837            )
3838        }
3839    }
3840    unsafe impl<
3841        D: fidl::encoding::ResourceDialect,
3842        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
3843    > fidl::encoding::Encode<ResolutionContext, D> for (T0,)
3844    {
3845        #[inline]
3846        unsafe fn encode(
3847            self,
3848            encoder: &mut fidl::encoding::Encoder<'_, D>,
3849            offset: usize,
3850            depth: fidl::encoding::Depth,
3851        ) -> fidl::Result<()> {
3852            encoder.debug_check_bounds::<ResolutionContext>(offset);
3853            // Zero out padding regions. There's no need to apply masks
3854            // because the unmasked parts will be overwritten by fields.
3855            // Write the fields.
3856            self.0.encode(encoder, offset + 0, depth)?;
3857            Ok(())
3858        }
3859    }
3860
3861    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolutionContext {
3862        #[inline(always)]
3863        fn new_empty() -> Self {
3864            Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
3865        }
3866
3867        #[inline]
3868        unsafe fn decode(
3869            &mut self,
3870            decoder: &mut fidl::encoding::Decoder<'_, D>,
3871            offset: usize,
3872            _depth: fidl::encoding::Depth,
3873        ) -> fidl::Result<()> {
3874            decoder.debug_check_bounds::<Self>(offset);
3875            // Verify that padding bytes are zero.
3876            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
3877            Ok(())
3878        }
3879    }
3880
3881    impl CupData {
3882        #[inline(always)]
3883        fn max_ordinal_present(&self) -> u64 {
3884            if let Some(_) = self.signature {
3885                return 5;
3886            }
3887            if let Some(_) = self.response {
3888                return 4;
3889            }
3890            if let Some(_) = self.nonce {
3891                return 3;
3892            }
3893            if let Some(_) = self.key_id {
3894                return 2;
3895            }
3896            if let Some(_) = self.request {
3897                return 1;
3898            }
3899            0
3900        }
3901    }
3902
3903    impl fidl::encoding::ValueTypeMarker for CupData {
3904        type Borrowed<'a> = &'a Self;
3905        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3906            value
3907        }
3908    }
3909
3910    unsafe impl fidl::encoding::TypeMarker for CupData {
3911        type Owned = Self;
3912
3913        #[inline(always)]
3914        fn inline_align(_context: fidl::encoding::Context) -> usize {
3915            8
3916        }
3917
3918        #[inline(always)]
3919        fn inline_size(_context: fidl::encoding::Context) -> usize {
3920            16
3921        }
3922    }
3923
3924    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupData, D> for &CupData {
3925        unsafe fn encode(
3926            self,
3927            encoder: &mut fidl::encoding::Encoder<'_, D>,
3928            offset: usize,
3929            mut depth: fidl::encoding::Depth,
3930        ) -> fidl::Result<()> {
3931            encoder.debug_check_bounds::<CupData>(offset);
3932            // Vector header
3933            let max_ordinal: u64 = self.max_ordinal_present();
3934            encoder.write_num(max_ordinal, offset);
3935            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3936            // Calling encoder.out_of_line_offset(0) is not allowed.
3937            if max_ordinal == 0 {
3938                return Ok(());
3939            }
3940            depth.increment()?;
3941            let envelope_size = 8;
3942            let bytes_len = max_ordinal as usize * envelope_size;
3943            #[allow(unused_variables)]
3944            let offset = encoder.out_of_line_offset(bytes_len);
3945            let mut _prev_end_offset: usize = 0;
3946            if 1 > max_ordinal {
3947                return Ok(());
3948            }
3949
3950            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3951            // are envelope_size bytes.
3952            let cur_offset: usize = (1 - 1) * envelope_size;
3953
3954            // Zero reserved fields.
3955            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3956
3957            // Safety:
3958            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3959            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3960            //   envelope_size bytes, there is always sufficient room.
3961            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 65536>, D>(
3962                self.request.as_ref().map(
3963                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow,
3964                ),
3965                encoder,
3966                offset + cur_offset,
3967                depth,
3968            )?;
3969
3970            _prev_end_offset = cur_offset + envelope_size;
3971            if 2 > max_ordinal {
3972                return Ok(());
3973            }
3974
3975            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3976            // are envelope_size bytes.
3977            let cur_offset: usize = (2 - 1) * envelope_size;
3978
3979            // Zero reserved fields.
3980            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3981
3982            // Safety:
3983            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3984            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3985            //   envelope_size bytes, there is always sufficient room.
3986            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3987                self.key_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3988                encoder,
3989                offset + cur_offset,
3990                depth,
3991            )?;
3992
3993            _prev_end_offset = cur_offset + envelope_size;
3994            if 3 > max_ordinal {
3995                return Ok(());
3996            }
3997
3998            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3999            // are envelope_size bytes.
4000            let cur_offset: usize = (3 - 1) * envelope_size;
4001
4002            // Zero reserved fields.
4003            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4004
4005            // Safety:
4006            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4007            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4008            //   envelope_size bytes, there is always sufficient room.
4009            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 32>, D>(
4010                self.nonce.as_ref().map(
4011                    <fidl::encoding::Array<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4012                ),
4013                encoder,
4014                offset + cur_offset,
4015                depth,
4016            )?;
4017
4018            _prev_end_offset = cur_offset + envelope_size;
4019            if 4 > max_ordinal {
4020                return Ok(());
4021            }
4022
4023            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4024            // are envelope_size bytes.
4025            let cur_offset: usize = (4 - 1) * envelope_size;
4026
4027            // Zero reserved fields.
4028            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4029
4030            // Safety:
4031            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4032            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4033            //   envelope_size bytes, there is always sufficient room.
4034            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 65536>, D>(
4035                self.response.as_ref().map(
4036                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow,
4037                ),
4038                encoder,
4039                offset + cur_offset,
4040                depth,
4041            )?;
4042
4043            _prev_end_offset = cur_offset + envelope_size;
4044            if 5 > max_ordinal {
4045                return Ok(());
4046            }
4047
4048            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4049            // are envelope_size bytes.
4050            let cur_offset: usize = (5 - 1) * envelope_size;
4051
4052            // Zero reserved fields.
4053            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4054
4055            // Safety:
4056            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4057            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4058            //   envelope_size bytes, there is always sufficient room.
4059            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 72>, D>(
4060                self.signature.as_ref().map(
4061                    <fidl::encoding::Vector<u8, 72> as fidl::encoding::ValueTypeMarker>::borrow,
4062                ),
4063                encoder,
4064                offset + cur_offset,
4065                depth,
4066            )?;
4067
4068            _prev_end_offset = cur_offset + envelope_size;
4069
4070            Ok(())
4071        }
4072    }
4073
4074    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupData {
4075        #[inline(always)]
4076        fn new_empty() -> Self {
4077            Self::default()
4078        }
4079
4080        unsafe fn decode(
4081            &mut self,
4082            decoder: &mut fidl::encoding::Decoder<'_, D>,
4083            offset: usize,
4084            mut depth: fidl::encoding::Depth,
4085        ) -> fidl::Result<()> {
4086            decoder.debug_check_bounds::<Self>(offset);
4087            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4088                None => return Err(fidl::Error::NotNullable),
4089                Some(len) => len,
4090            };
4091            // Calling decoder.out_of_line_offset(0) is not allowed.
4092            if len == 0 {
4093                return Ok(());
4094            };
4095            depth.increment()?;
4096            let envelope_size = 8;
4097            let bytes_len = len * envelope_size;
4098            let offset = decoder.out_of_line_offset(bytes_len)?;
4099            // Decode the envelope for each type.
4100            let mut _next_ordinal_to_read = 0;
4101            let mut next_offset = offset;
4102            let end_offset = offset + bytes_len;
4103            _next_ordinal_to_read += 1;
4104            if next_offset >= end_offset {
4105                return Ok(());
4106            }
4107
4108            // Decode unknown envelopes for gaps in ordinals.
4109            while _next_ordinal_to_read < 1 {
4110                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4111                _next_ordinal_to_read += 1;
4112                next_offset += envelope_size;
4113            }
4114
4115            let next_out_of_line = decoder.next_out_of_line();
4116            let handles_before = decoder.remaining_handles();
4117            if let Some((inlined, num_bytes, num_handles)) =
4118                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4119            {
4120                let member_inline_size =
4121                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::TypeMarker>::inline_size(
4122                        decoder.context,
4123                    );
4124                if inlined != (member_inline_size <= 4) {
4125                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4126                }
4127                let inner_offset;
4128                let mut inner_depth = depth.clone();
4129                if inlined {
4130                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4131                    inner_offset = next_offset;
4132                } else {
4133                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4134                    inner_depth.increment()?;
4135                }
4136                let val_ref = self
4137                    .request
4138                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D));
4139                fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, val_ref, decoder, inner_offset, inner_depth)?;
4140                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4141                {
4142                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4143                }
4144                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4145                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4146                }
4147            }
4148
4149            next_offset += envelope_size;
4150            _next_ordinal_to_read += 1;
4151            if next_offset >= end_offset {
4152                return Ok(());
4153            }
4154
4155            // Decode unknown envelopes for gaps in ordinals.
4156            while _next_ordinal_to_read < 2 {
4157                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4158                _next_ordinal_to_read += 1;
4159                next_offset += envelope_size;
4160            }
4161
4162            let next_out_of_line = decoder.next_out_of_line();
4163            let handles_before = decoder.remaining_handles();
4164            if let Some((inlined, num_bytes, num_handles)) =
4165                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4166            {
4167                let member_inline_size =
4168                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4169                if inlined != (member_inline_size <= 4) {
4170                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4171                }
4172                let inner_offset;
4173                let mut inner_depth = depth.clone();
4174                if inlined {
4175                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4176                    inner_offset = next_offset;
4177                } else {
4178                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4179                    inner_depth.increment()?;
4180                }
4181                let val_ref = self.key_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
4182                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4183                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4184                {
4185                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4186                }
4187                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4188                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4189                }
4190            }
4191
4192            next_offset += envelope_size;
4193            _next_ordinal_to_read += 1;
4194            if next_offset >= end_offset {
4195                return Ok(());
4196            }
4197
4198            // Decode unknown envelopes for gaps in ordinals.
4199            while _next_ordinal_to_read < 3 {
4200                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4201                _next_ordinal_to_read += 1;
4202                next_offset += envelope_size;
4203            }
4204
4205            let next_out_of_line = decoder.next_out_of_line();
4206            let handles_before = decoder.remaining_handles();
4207            if let Some((inlined, num_bytes, num_handles)) =
4208                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4209            {
4210                let member_inline_size =
4211                    <fidl::encoding::Array<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
4212                        decoder.context,
4213                    );
4214                if inlined != (member_inline_size <= 4) {
4215                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4216                }
4217                let inner_offset;
4218                let mut inner_depth = depth.clone();
4219                if inlined {
4220                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4221                    inner_offset = next_offset;
4222                } else {
4223                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4224                    inner_depth.increment()?;
4225                }
4226                let val_ref = self
4227                    .nonce
4228                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 32>, D));
4229                fidl::decode!(fidl::encoding::Array<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
4230                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4231                {
4232                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4233                }
4234                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4235                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4236                }
4237            }
4238
4239            next_offset += envelope_size;
4240            _next_ordinal_to_read += 1;
4241            if next_offset >= end_offset {
4242                return Ok(());
4243            }
4244
4245            // Decode unknown envelopes for gaps in ordinals.
4246            while _next_ordinal_to_read < 4 {
4247                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4248                _next_ordinal_to_read += 1;
4249                next_offset += envelope_size;
4250            }
4251
4252            let next_out_of_line = decoder.next_out_of_line();
4253            let handles_before = decoder.remaining_handles();
4254            if let Some((inlined, num_bytes, num_handles)) =
4255                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4256            {
4257                let member_inline_size =
4258                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::TypeMarker>::inline_size(
4259                        decoder.context,
4260                    );
4261                if inlined != (member_inline_size <= 4) {
4262                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4263                }
4264                let inner_offset;
4265                let mut inner_depth = depth.clone();
4266                if inlined {
4267                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4268                    inner_offset = next_offset;
4269                } else {
4270                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4271                    inner_depth.increment()?;
4272                }
4273                let val_ref = self
4274                    .response
4275                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D));
4276                fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, val_ref, decoder, inner_offset, inner_depth)?;
4277                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4278                {
4279                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4280                }
4281                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4282                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4283                }
4284            }
4285
4286            next_offset += envelope_size;
4287            _next_ordinal_to_read += 1;
4288            if next_offset >= end_offset {
4289                return Ok(());
4290            }
4291
4292            // Decode unknown envelopes for gaps in ordinals.
4293            while _next_ordinal_to_read < 5 {
4294                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4295                _next_ordinal_to_read += 1;
4296                next_offset += envelope_size;
4297            }
4298
4299            let next_out_of_line = decoder.next_out_of_line();
4300            let handles_before = decoder.remaining_handles();
4301            if let Some((inlined, num_bytes, num_handles)) =
4302                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4303            {
4304                let member_inline_size =
4305                    <fidl::encoding::Vector<u8, 72> as fidl::encoding::TypeMarker>::inline_size(
4306                        decoder.context,
4307                    );
4308                if inlined != (member_inline_size <= 4) {
4309                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4310                }
4311                let inner_offset;
4312                let mut inner_depth = depth.clone();
4313                if inlined {
4314                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4315                    inner_offset = next_offset;
4316                } else {
4317                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4318                    inner_depth.increment()?;
4319                }
4320                let val_ref = self
4321                    .signature
4322                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 72>, D));
4323                fidl::decode!(fidl::encoding::Vector<u8, 72>, D, val_ref, decoder, inner_offset, inner_depth)?;
4324                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4325                {
4326                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4327                }
4328                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4329                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4330                }
4331            }
4332
4333            next_offset += envelope_size;
4334
4335            // Decode the remaining unknown envelopes.
4336            while next_offset < end_offset {
4337                _next_ordinal_to_read += 1;
4338                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4339                next_offset += envelope_size;
4340            }
4341
4342            Ok(())
4343        }
4344    }
4345
4346    impl MirrorConfig {
4347        #[inline(always)]
4348        fn max_ordinal_present(&self) -> u64 {
4349            if let Some(_) = self.blob_mirror_url {
4350                return 4;
4351            }
4352            if let Some(_) = self.subscribe {
4353                return 2;
4354            }
4355            if let Some(_) = self.mirror_url {
4356                return 1;
4357            }
4358            0
4359        }
4360    }
4361
4362    impl fidl::encoding::ValueTypeMarker for MirrorConfig {
4363        type Borrowed<'a> = &'a Self;
4364        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4365            value
4366        }
4367    }
4368
4369    unsafe impl fidl::encoding::TypeMarker for MirrorConfig {
4370        type Owned = Self;
4371
4372        #[inline(always)]
4373        fn inline_align(_context: fidl::encoding::Context) -> usize {
4374            8
4375        }
4376
4377        #[inline(always)]
4378        fn inline_size(_context: fidl::encoding::Context) -> usize {
4379            16
4380        }
4381    }
4382
4383    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MirrorConfig, D>
4384        for &MirrorConfig
4385    {
4386        unsafe fn encode(
4387            self,
4388            encoder: &mut fidl::encoding::Encoder<'_, D>,
4389            offset: usize,
4390            mut depth: fidl::encoding::Depth,
4391        ) -> fidl::Result<()> {
4392            encoder.debug_check_bounds::<MirrorConfig>(offset);
4393            // Vector header
4394            let max_ordinal: u64 = self.max_ordinal_present();
4395            encoder.write_num(max_ordinal, offset);
4396            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4397            // Calling encoder.out_of_line_offset(0) is not allowed.
4398            if max_ordinal == 0 {
4399                return Ok(());
4400            }
4401            depth.increment()?;
4402            let envelope_size = 8;
4403            let bytes_len = max_ordinal as usize * envelope_size;
4404            #[allow(unused_variables)]
4405            let offset = encoder.out_of_line_offset(bytes_len);
4406            let mut _prev_end_offset: usize = 0;
4407            if 1 > max_ordinal {
4408                return Ok(());
4409            }
4410
4411            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4412            // are envelope_size bytes.
4413            let cur_offset: usize = (1 - 1) * envelope_size;
4414
4415            // Zero reserved fields.
4416            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4417
4418            // Safety:
4419            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4420            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4421            //   envelope_size bytes, there is always sufficient room.
4422            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4423                self.mirror_url.as_ref().map(
4424                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4425                ),
4426                encoder,
4427                offset + cur_offset,
4428                depth,
4429            )?;
4430
4431            _prev_end_offset = cur_offset + envelope_size;
4432            if 2 > max_ordinal {
4433                return Ok(());
4434            }
4435
4436            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4437            // are envelope_size bytes.
4438            let cur_offset: usize = (2 - 1) * envelope_size;
4439
4440            // Zero reserved fields.
4441            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4442
4443            // Safety:
4444            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4445            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4446            //   envelope_size bytes, there is always sufficient room.
4447            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4448                self.subscribe.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4449                encoder,
4450                offset + cur_offset,
4451                depth,
4452            )?;
4453
4454            _prev_end_offset = cur_offset + envelope_size;
4455            if 4 > max_ordinal {
4456                return Ok(());
4457            }
4458
4459            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4460            // are envelope_size bytes.
4461            let cur_offset: usize = (4 - 1) * envelope_size;
4462
4463            // Zero reserved fields.
4464            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4465
4466            // Safety:
4467            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4468            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4469            //   envelope_size bytes, there is always sufficient room.
4470            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4471                self.blob_mirror_url.as_ref().map(
4472                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4473                ),
4474                encoder,
4475                offset + cur_offset,
4476                depth,
4477            )?;
4478
4479            _prev_end_offset = cur_offset + envelope_size;
4480
4481            Ok(())
4482        }
4483    }
4484
4485    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MirrorConfig {
4486        #[inline(always)]
4487        fn new_empty() -> Self {
4488            Self::default()
4489        }
4490
4491        unsafe fn decode(
4492            &mut self,
4493            decoder: &mut fidl::encoding::Decoder<'_, D>,
4494            offset: usize,
4495            mut depth: fidl::encoding::Depth,
4496        ) -> fidl::Result<()> {
4497            decoder.debug_check_bounds::<Self>(offset);
4498            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4499                None => return Err(fidl::Error::NotNullable),
4500                Some(len) => len,
4501            };
4502            // Calling decoder.out_of_line_offset(0) is not allowed.
4503            if len == 0 {
4504                return Ok(());
4505            };
4506            depth.increment()?;
4507            let envelope_size = 8;
4508            let bytes_len = len * envelope_size;
4509            let offset = decoder.out_of_line_offset(bytes_len)?;
4510            // Decode the envelope for each type.
4511            let mut _next_ordinal_to_read = 0;
4512            let mut next_offset = offset;
4513            let end_offset = offset + bytes_len;
4514            _next_ordinal_to_read += 1;
4515            if next_offset >= end_offset {
4516                return Ok(());
4517            }
4518
4519            // Decode unknown envelopes for gaps in ordinals.
4520            while _next_ordinal_to_read < 1 {
4521                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4522                _next_ordinal_to_read += 1;
4523                next_offset += envelope_size;
4524            }
4525
4526            let next_out_of_line = decoder.next_out_of_line();
4527            let handles_before = decoder.remaining_handles();
4528            if let Some((inlined, num_bytes, num_handles)) =
4529                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4530            {
4531                let member_inline_size =
4532                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4533                        decoder.context,
4534                    );
4535                if inlined != (member_inline_size <= 4) {
4536                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4537                }
4538                let inner_offset;
4539                let mut inner_depth = depth.clone();
4540                if inlined {
4541                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4542                    inner_offset = next_offset;
4543                } else {
4544                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4545                    inner_depth.increment()?;
4546                }
4547                let val_ref = self
4548                    .mirror_url
4549                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4550                fidl::decode!(
4551                    fidl::encoding::UnboundedString,
4552                    D,
4553                    val_ref,
4554                    decoder,
4555                    inner_offset,
4556                    inner_depth
4557                )?;
4558                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4559                {
4560                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4561                }
4562                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4563                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4564                }
4565            }
4566
4567            next_offset += envelope_size;
4568            _next_ordinal_to_read += 1;
4569            if next_offset >= end_offset {
4570                return Ok(());
4571            }
4572
4573            // Decode unknown envelopes for gaps in ordinals.
4574            while _next_ordinal_to_read < 2 {
4575                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4576                _next_ordinal_to_read += 1;
4577                next_offset += envelope_size;
4578            }
4579
4580            let next_out_of_line = decoder.next_out_of_line();
4581            let handles_before = decoder.remaining_handles();
4582            if let Some((inlined, num_bytes, num_handles)) =
4583                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4584            {
4585                let member_inline_size =
4586                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4587                if inlined != (member_inline_size <= 4) {
4588                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4589                }
4590                let inner_offset;
4591                let mut inner_depth = depth.clone();
4592                if inlined {
4593                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4594                    inner_offset = next_offset;
4595                } else {
4596                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4597                    inner_depth.increment()?;
4598                }
4599                let val_ref = self.subscribe.get_or_insert_with(|| fidl::new_empty!(bool, D));
4600                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4601                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4602                {
4603                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4604                }
4605                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4606                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4607                }
4608            }
4609
4610            next_offset += envelope_size;
4611            _next_ordinal_to_read += 1;
4612            if next_offset >= end_offset {
4613                return Ok(());
4614            }
4615
4616            // Decode unknown envelopes for gaps in ordinals.
4617            while _next_ordinal_to_read < 4 {
4618                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4619                _next_ordinal_to_read += 1;
4620                next_offset += envelope_size;
4621            }
4622
4623            let next_out_of_line = decoder.next_out_of_line();
4624            let handles_before = decoder.remaining_handles();
4625            if let Some((inlined, num_bytes, num_handles)) =
4626                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4627            {
4628                let member_inline_size =
4629                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4630                        decoder.context,
4631                    );
4632                if inlined != (member_inline_size <= 4) {
4633                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4634                }
4635                let inner_offset;
4636                let mut inner_depth = depth.clone();
4637                if inlined {
4638                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4639                    inner_offset = next_offset;
4640                } else {
4641                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4642                    inner_depth.increment()?;
4643                }
4644                let val_ref = self
4645                    .blob_mirror_url
4646                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4647                fidl::decode!(
4648                    fidl::encoding::UnboundedString,
4649                    D,
4650                    val_ref,
4651                    decoder,
4652                    inner_offset,
4653                    inner_depth
4654                )?;
4655                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4656                {
4657                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4658                }
4659                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4660                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4661                }
4662            }
4663
4664            next_offset += envelope_size;
4665
4666            // Decode the remaining unknown envelopes.
4667            while next_offset < end_offset {
4668                _next_ordinal_to_read += 1;
4669                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4670                next_offset += envelope_size;
4671            }
4672
4673            Ok(())
4674        }
4675    }
4676
4677    impl RepositoryConfig {
4678        #[inline(always)]
4679        fn max_ordinal_present(&self) -> u64 {
4680            if let Some(_) = self.storage_type {
4681                return 8;
4682            }
4683            if let Some(_) = self.use_local_mirror {
4684                return 7;
4685            }
4686            if let Some(_) = self.root_threshold {
4687                return 6;
4688            }
4689            if let Some(_) = self.root_version {
4690                return 5;
4691            }
4692            if let Some(_) = self.mirrors {
4693                return 3;
4694            }
4695            if let Some(_) = self.root_keys {
4696                return 2;
4697            }
4698            if let Some(_) = self.repo_url {
4699                return 1;
4700            }
4701            0
4702        }
4703    }
4704
4705    impl fidl::encoding::ValueTypeMarker for RepositoryConfig {
4706        type Borrowed<'a> = &'a Self;
4707        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4708            value
4709        }
4710    }
4711
4712    unsafe impl fidl::encoding::TypeMarker for RepositoryConfig {
4713        type Owned = Self;
4714
4715        #[inline(always)]
4716        fn inline_align(_context: fidl::encoding::Context) -> usize {
4717            8
4718        }
4719
4720        #[inline(always)]
4721        fn inline_size(_context: fidl::encoding::Context) -> usize {
4722            16
4723        }
4724    }
4725
4726    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryConfig, D>
4727        for &RepositoryConfig
4728    {
4729        unsafe fn encode(
4730            self,
4731            encoder: &mut fidl::encoding::Encoder<'_, D>,
4732            offset: usize,
4733            mut depth: fidl::encoding::Depth,
4734        ) -> fidl::Result<()> {
4735            encoder.debug_check_bounds::<RepositoryConfig>(offset);
4736            // Vector header
4737            let max_ordinal: u64 = self.max_ordinal_present();
4738            encoder.write_num(max_ordinal, offset);
4739            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4740            // Calling encoder.out_of_line_offset(0) is not allowed.
4741            if max_ordinal == 0 {
4742                return Ok(());
4743            }
4744            depth.increment()?;
4745            let envelope_size = 8;
4746            let bytes_len = max_ordinal as usize * envelope_size;
4747            #[allow(unused_variables)]
4748            let offset = encoder.out_of_line_offset(bytes_len);
4749            let mut _prev_end_offset: usize = 0;
4750            if 1 > max_ordinal {
4751                return Ok(());
4752            }
4753
4754            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4755            // are envelope_size bytes.
4756            let cur_offset: usize = (1 - 1) * envelope_size;
4757
4758            // Zero reserved fields.
4759            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4760
4761            // Safety:
4762            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4763            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4764            //   envelope_size bytes, there is always sufficient room.
4765            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4766                self.repo_url.as_ref().map(
4767                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4768                ),
4769                encoder,
4770                offset + cur_offset,
4771                depth,
4772            )?;
4773
4774            _prev_end_offset = cur_offset + envelope_size;
4775            if 2 > max_ordinal {
4776                return Ok(());
4777            }
4778
4779            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4780            // are envelope_size bytes.
4781            let cur_offset: usize = (2 - 1) * envelope_size;
4782
4783            // Zero reserved fields.
4784            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4785
4786            // Safety:
4787            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4788            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4789            //   envelope_size bytes, there is always sufficient room.
4790            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<RepositoryKeyConfig>, D>(
4791            self.root_keys.as_ref().map(<fidl::encoding::UnboundedVector<RepositoryKeyConfig> as fidl::encoding::ValueTypeMarker>::borrow),
4792            encoder, offset + cur_offset, depth
4793        )?;
4794
4795            _prev_end_offset = cur_offset + envelope_size;
4796            if 3 > max_ordinal {
4797                return Ok(());
4798            }
4799
4800            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4801            // are envelope_size bytes.
4802            let cur_offset: usize = (3 - 1) * envelope_size;
4803
4804            // Zero reserved fields.
4805            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4806
4807            // Safety:
4808            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4809            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4810            //   envelope_size bytes, there is always sufficient room.
4811            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<MirrorConfig>, D>(
4812            self.mirrors.as_ref().map(<fidl::encoding::UnboundedVector<MirrorConfig> as fidl::encoding::ValueTypeMarker>::borrow),
4813            encoder, offset + cur_offset, depth
4814        )?;
4815
4816            _prev_end_offset = cur_offset + envelope_size;
4817            if 5 > max_ordinal {
4818                return Ok(());
4819            }
4820
4821            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4822            // are envelope_size bytes.
4823            let cur_offset: usize = (5 - 1) * envelope_size;
4824
4825            // Zero reserved fields.
4826            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4827
4828            // Safety:
4829            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4830            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4831            //   envelope_size bytes, there is always sufficient room.
4832            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4833                self.root_version.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4834                encoder,
4835                offset + cur_offset,
4836                depth,
4837            )?;
4838
4839            _prev_end_offset = cur_offset + envelope_size;
4840            if 6 > max_ordinal {
4841                return Ok(());
4842            }
4843
4844            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4845            // are envelope_size bytes.
4846            let cur_offset: usize = (6 - 1) * envelope_size;
4847
4848            // Zero reserved fields.
4849            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4850
4851            // Safety:
4852            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4853            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4854            //   envelope_size bytes, there is always sufficient room.
4855            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4856                self.root_threshold.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4857                encoder,
4858                offset + cur_offset,
4859                depth,
4860            )?;
4861
4862            _prev_end_offset = cur_offset + envelope_size;
4863            if 7 > max_ordinal {
4864                return Ok(());
4865            }
4866
4867            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4868            // are envelope_size bytes.
4869            let cur_offset: usize = (7 - 1) * envelope_size;
4870
4871            // Zero reserved fields.
4872            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4873
4874            // Safety:
4875            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4876            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4877            //   envelope_size bytes, there is always sufficient room.
4878            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4879                self.use_local_mirror
4880                    .as_ref()
4881                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4882                encoder,
4883                offset + cur_offset,
4884                depth,
4885            )?;
4886
4887            _prev_end_offset = cur_offset + envelope_size;
4888            if 8 > max_ordinal {
4889                return Ok(());
4890            }
4891
4892            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4893            // are envelope_size bytes.
4894            let cur_offset: usize = (8 - 1) * envelope_size;
4895
4896            // Zero reserved fields.
4897            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4898
4899            // Safety:
4900            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4901            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4902            //   envelope_size bytes, there is always sufficient room.
4903            fidl::encoding::encode_in_envelope_optional::<RepositoryStorageType, D>(
4904                self.storage_type
4905                    .as_ref()
4906                    .map(<RepositoryStorageType as fidl::encoding::ValueTypeMarker>::borrow),
4907                encoder,
4908                offset + cur_offset,
4909                depth,
4910            )?;
4911
4912            _prev_end_offset = cur_offset + envelope_size;
4913
4914            Ok(())
4915        }
4916    }
4917
4918    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryConfig {
4919        #[inline(always)]
4920        fn new_empty() -> Self {
4921            Self::default()
4922        }
4923
4924        unsafe fn decode(
4925            &mut self,
4926            decoder: &mut fidl::encoding::Decoder<'_, D>,
4927            offset: usize,
4928            mut depth: fidl::encoding::Depth,
4929        ) -> fidl::Result<()> {
4930            decoder.debug_check_bounds::<Self>(offset);
4931            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4932                None => return Err(fidl::Error::NotNullable),
4933                Some(len) => len,
4934            };
4935            // Calling decoder.out_of_line_offset(0) is not allowed.
4936            if len == 0 {
4937                return Ok(());
4938            };
4939            depth.increment()?;
4940            let envelope_size = 8;
4941            let bytes_len = len * envelope_size;
4942            let offset = decoder.out_of_line_offset(bytes_len)?;
4943            // Decode the envelope for each type.
4944            let mut _next_ordinal_to_read = 0;
4945            let mut next_offset = offset;
4946            let end_offset = offset + bytes_len;
4947            _next_ordinal_to_read += 1;
4948            if next_offset >= end_offset {
4949                return Ok(());
4950            }
4951
4952            // Decode unknown envelopes for gaps in ordinals.
4953            while _next_ordinal_to_read < 1 {
4954                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4955                _next_ordinal_to_read += 1;
4956                next_offset += envelope_size;
4957            }
4958
4959            let next_out_of_line = decoder.next_out_of_line();
4960            let handles_before = decoder.remaining_handles();
4961            if let Some((inlined, num_bytes, num_handles)) =
4962                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4963            {
4964                let member_inline_size =
4965                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4966                        decoder.context,
4967                    );
4968                if inlined != (member_inline_size <= 4) {
4969                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4970                }
4971                let inner_offset;
4972                let mut inner_depth = depth.clone();
4973                if inlined {
4974                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4975                    inner_offset = next_offset;
4976                } else {
4977                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4978                    inner_depth.increment()?;
4979                }
4980                let val_ref = self
4981                    .repo_url
4982                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4983                fidl::decode!(
4984                    fidl::encoding::UnboundedString,
4985                    D,
4986                    val_ref,
4987                    decoder,
4988                    inner_offset,
4989                    inner_depth
4990                )?;
4991                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4992                {
4993                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4994                }
4995                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4996                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4997                }
4998            }
4999
5000            next_offset += envelope_size;
5001            _next_ordinal_to_read += 1;
5002            if next_offset >= end_offset {
5003                return Ok(());
5004            }
5005
5006            // Decode unknown envelopes for gaps in ordinals.
5007            while _next_ordinal_to_read < 2 {
5008                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5009                _next_ordinal_to_read += 1;
5010                next_offset += envelope_size;
5011            }
5012
5013            let next_out_of_line = decoder.next_out_of_line();
5014            let handles_before = decoder.remaining_handles();
5015            if let Some((inlined, num_bytes, num_handles)) =
5016                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5017            {
5018                let member_inline_size = <fidl::encoding::UnboundedVector<RepositoryKeyConfig> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5019                if inlined != (member_inline_size <= 4) {
5020                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5021                }
5022                let inner_offset;
5023                let mut inner_depth = depth.clone();
5024                if inlined {
5025                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5026                    inner_offset = next_offset;
5027                } else {
5028                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5029                    inner_depth.increment()?;
5030                }
5031                let val_ref = self.root_keys.get_or_insert_with(|| {
5032                    fidl::new_empty!(fidl::encoding::UnboundedVector<RepositoryKeyConfig>, D)
5033                });
5034                fidl::decode!(
5035                    fidl::encoding::UnboundedVector<RepositoryKeyConfig>,
5036                    D,
5037                    val_ref,
5038                    decoder,
5039                    inner_offset,
5040                    inner_depth
5041                )?;
5042                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5043                {
5044                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5045                }
5046                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5047                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5048                }
5049            }
5050
5051            next_offset += envelope_size;
5052            _next_ordinal_to_read += 1;
5053            if next_offset >= end_offset {
5054                return Ok(());
5055            }
5056
5057            // Decode unknown envelopes for gaps in ordinals.
5058            while _next_ordinal_to_read < 3 {
5059                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5060                _next_ordinal_to_read += 1;
5061                next_offset += envelope_size;
5062            }
5063
5064            let next_out_of_line = decoder.next_out_of_line();
5065            let handles_before = decoder.remaining_handles();
5066            if let Some((inlined, num_bytes, num_handles)) =
5067                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5068            {
5069                let member_inline_size = <fidl::encoding::UnboundedVector<MirrorConfig> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5070                if inlined != (member_inline_size <= 4) {
5071                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5072                }
5073                let inner_offset;
5074                let mut inner_depth = depth.clone();
5075                if inlined {
5076                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5077                    inner_offset = next_offset;
5078                } else {
5079                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5080                    inner_depth.increment()?;
5081                }
5082                let val_ref = self.mirrors.get_or_insert_with(|| {
5083                    fidl::new_empty!(fidl::encoding::UnboundedVector<MirrorConfig>, D)
5084                });
5085                fidl::decode!(
5086                    fidl::encoding::UnboundedVector<MirrorConfig>,
5087                    D,
5088                    val_ref,
5089                    decoder,
5090                    inner_offset,
5091                    inner_depth
5092                )?;
5093                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5094                {
5095                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5096                }
5097                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5098                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5099                }
5100            }
5101
5102            next_offset += envelope_size;
5103            _next_ordinal_to_read += 1;
5104            if next_offset >= end_offset {
5105                return Ok(());
5106            }
5107
5108            // Decode unknown envelopes for gaps in ordinals.
5109            while _next_ordinal_to_read < 5 {
5110                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5111                _next_ordinal_to_read += 1;
5112                next_offset += envelope_size;
5113            }
5114
5115            let next_out_of_line = decoder.next_out_of_line();
5116            let handles_before = decoder.remaining_handles();
5117            if let Some((inlined, num_bytes, num_handles)) =
5118                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5119            {
5120                let member_inline_size =
5121                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5122                if inlined != (member_inline_size <= 4) {
5123                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5124                }
5125                let inner_offset;
5126                let mut inner_depth = depth.clone();
5127                if inlined {
5128                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5129                    inner_offset = next_offset;
5130                } else {
5131                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5132                    inner_depth.increment()?;
5133                }
5134                let val_ref = self.root_version.get_or_insert_with(|| fidl::new_empty!(u32, D));
5135                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5136                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5137                {
5138                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5139                }
5140                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5141                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5142                }
5143            }
5144
5145            next_offset += envelope_size;
5146            _next_ordinal_to_read += 1;
5147            if next_offset >= end_offset {
5148                return Ok(());
5149            }
5150
5151            // Decode unknown envelopes for gaps in ordinals.
5152            while _next_ordinal_to_read < 6 {
5153                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5154                _next_ordinal_to_read += 1;
5155                next_offset += envelope_size;
5156            }
5157
5158            let next_out_of_line = decoder.next_out_of_line();
5159            let handles_before = decoder.remaining_handles();
5160            if let Some((inlined, num_bytes, num_handles)) =
5161                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5162            {
5163                let member_inline_size =
5164                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5165                if inlined != (member_inline_size <= 4) {
5166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5167                }
5168                let inner_offset;
5169                let mut inner_depth = depth.clone();
5170                if inlined {
5171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5172                    inner_offset = next_offset;
5173                } else {
5174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5175                    inner_depth.increment()?;
5176                }
5177                let val_ref = self.root_threshold.get_or_insert_with(|| fidl::new_empty!(u32, D));
5178                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5180                {
5181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5182                }
5183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5185                }
5186            }
5187
5188            next_offset += envelope_size;
5189            _next_ordinal_to_read += 1;
5190            if next_offset >= end_offset {
5191                return Ok(());
5192            }
5193
5194            // Decode unknown envelopes for gaps in ordinals.
5195            while _next_ordinal_to_read < 7 {
5196                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5197                _next_ordinal_to_read += 1;
5198                next_offset += envelope_size;
5199            }
5200
5201            let next_out_of_line = decoder.next_out_of_line();
5202            let handles_before = decoder.remaining_handles();
5203            if let Some((inlined, num_bytes, num_handles)) =
5204                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5205            {
5206                let member_inline_size =
5207                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5208                if inlined != (member_inline_size <= 4) {
5209                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5210                }
5211                let inner_offset;
5212                let mut inner_depth = depth.clone();
5213                if inlined {
5214                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5215                    inner_offset = next_offset;
5216                } else {
5217                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5218                    inner_depth.increment()?;
5219                }
5220                let val_ref =
5221                    self.use_local_mirror.get_or_insert_with(|| fidl::new_empty!(bool, D));
5222                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5223                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5224                {
5225                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5226                }
5227                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5228                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5229                }
5230            }
5231
5232            next_offset += envelope_size;
5233            _next_ordinal_to_read += 1;
5234            if next_offset >= end_offset {
5235                return Ok(());
5236            }
5237
5238            // Decode unknown envelopes for gaps in ordinals.
5239            while _next_ordinal_to_read < 8 {
5240                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5241                _next_ordinal_to_read += 1;
5242                next_offset += envelope_size;
5243            }
5244
5245            let next_out_of_line = decoder.next_out_of_line();
5246            let handles_before = decoder.remaining_handles();
5247            if let Some((inlined, num_bytes, num_handles)) =
5248                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5249            {
5250                let member_inline_size =
5251                    <RepositoryStorageType as fidl::encoding::TypeMarker>::inline_size(
5252                        decoder.context,
5253                    );
5254                if inlined != (member_inline_size <= 4) {
5255                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5256                }
5257                let inner_offset;
5258                let mut inner_depth = depth.clone();
5259                if inlined {
5260                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5261                    inner_offset = next_offset;
5262                } else {
5263                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5264                    inner_depth.increment()?;
5265                }
5266                let val_ref = self
5267                    .storage_type
5268                    .get_or_insert_with(|| fidl::new_empty!(RepositoryStorageType, D));
5269                fidl::decode!(
5270                    RepositoryStorageType,
5271                    D,
5272                    val_ref,
5273                    decoder,
5274                    inner_offset,
5275                    inner_depth
5276                )?;
5277                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5278                {
5279                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5280                }
5281                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5282                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5283                }
5284            }
5285
5286            next_offset += envelope_size;
5287
5288            // Decode the remaining unknown envelopes.
5289            while next_offset < end_offset {
5290                _next_ordinal_to_read += 1;
5291                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5292                next_offset += envelope_size;
5293            }
5294
5295            Ok(())
5296        }
5297    }
5298
5299    impl fidl::encoding::ValueTypeMarker for RepositoryKeyConfig {
5300        type Borrowed<'a> = &'a Self;
5301        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5302            value
5303        }
5304    }
5305
5306    unsafe impl fidl::encoding::TypeMarker for RepositoryKeyConfig {
5307        type Owned = Self;
5308
5309        #[inline(always)]
5310        fn inline_align(_context: fidl::encoding::Context) -> usize {
5311            8
5312        }
5313
5314        #[inline(always)]
5315        fn inline_size(_context: fidl::encoding::Context) -> usize {
5316            16
5317        }
5318    }
5319
5320    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryKeyConfig, D>
5321        for &RepositoryKeyConfig
5322    {
5323        #[inline]
5324        unsafe fn encode(
5325            self,
5326            encoder: &mut fidl::encoding::Encoder<'_, D>,
5327            offset: usize,
5328            _depth: fidl::encoding::Depth,
5329        ) -> fidl::Result<()> {
5330            encoder.debug_check_bounds::<RepositoryKeyConfig>(offset);
5331            encoder.write_num::<u64>(self.ordinal(), offset);
5332            match self {
5333            RepositoryKeyConfig::Ed25519Key(ref val) => {
5334                fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
5335                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
5336                    encoder, offset + 8, _depth
5337                )
5338            }
5339            RepositoryKeyConfig::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5340        }
5341        }
5342    }
5343
5344    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryKeyConfig {
5345        #[inline(always)]
5346        fn new_empty() -> Self {
5347            Self::__SourceBreaking { unknown_ordinal: 0 }
5348        }
5349
5350        #[inline]
5351        unsafe fn decode(
5352            &mut self,
5353            decoder: &mut fidl::encoding::Decoder<'_, D>,
5354            offset: usize,
5355            mut depth: fidl::encoding::Depth,
5356        ) -> fidl::Result<()> {
5357            decoder.debug_check_bounds::<Self>(offset);
5358            #[allow(unused_variables)]
5359            let next_out_of_line = decoder.next_out_of_line();
5360            let handles_before = decoder.remaining_handles();
5361            let (ordinal, inlined, num_bytes, num_handles) =
5362                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5363
5364            let member_inline_size = match ordinal {
5365                1 => {
5366                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
5367                        decoder.context,
5368                    )
5369                }
5370                0 => return Err(fidl::Error::UnknownUnionTag),
5371                _ => num_bytes as usize,
5372            };
5373
5374            if inlined != (member_inline_size <= 4) {
5375                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5376            }
5377            let _inner_offset;
5378            if inlined {
5379                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5380                _inner_offset = offset + 8;
5381            } else {
5382                depth.increment()?;
5383                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5384            }
5385            match ordinal {
5386                1 => {
5387                    #[allow(irrefutable_let_patterns)]
5388                    if let RepositoryKeyConfig::Ed25519Key(_) = self {
5389                        // Do nothing, read the value into the object
5390                    } else {
5391                        // Initialize `self` to the right variant
5392                        *self = RepositoryKeyConfig::Ed25519Key(fidl::new_empty!(
5393                            fidl::encoding::UnboundedVector<u8>,
5394                            D
5395                        ));
5396                    }
5397                    #[allow(irrefutable_let_patterns)]
5398                    if let RepositoryKeyConfig::Ed25519Key(ref mut val) = self {
5399                        fidl::decode!(
5400                            fidl::encoding::UnboundedVector<u8>,
5401                            D,
5402                            val,
5403                            decoder,
5404                            _inner_offset,
5405                            depth
5406                        )?;
5407                    } else {
5408                        unreachable!()
5409                    }
5410                }
5411                #[allow(deprecated)]
5412                ordinal => {
5413                    for _ in 0..num_handles {
5414                        decoder.drop_next_handle()?;
5415                    }
5416                    *self = RepositoryKeyConfig::__SourceBreaking { unknown_ordinal: ordinal };
5417                }
5418            }
5419            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5420                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5421            }
5422            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5423                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5424            }
5425            Ok(())
5426        }
5427    }
5428}