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