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)]
408#[repr(C)]
409pub struct NeededBlobsOpenBlobRequest {
410    pub blob_id: BlobId,
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            32
2101        }
2102        #[inline(always)]
2103        fn encode_is_copy() -> bool {
2104            true
2105        }
2106
2107        #[inline(always)]
2108        fn decode_is_copy() -> bool {
2109            true
2110        }
2111    }
2112
2113    unsafe impl<D: fidl::encoding::ResourceDialect>
2114        fidl::encoding::Encode<NeededBlobsOpenBlobRequest, D> for &NeededBlobsOpenBlobRequest
2115    {
2116        #[inline]
2117        unsafe fn encode(
2118            self,
2119            encoder: &mut fidl::encoding::Encoder<'_, D>,
2120            offset: usize,
2121            _depth: fidl::encoding::Depth,
2122        ) -> fidl::Result<()> {
2123            encoder.debug_check_bounds::<NeededBlobsOpenBlobRequest>(offset);
2124            unsafe {
2125                // Copy the object into the buffer.
2126                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2127                (buf_ptr as *mut NeededBlobsOpenBlobRequest)
2128                    .write_unaligned((self as *const NeededBlobsOpenBlobRequest).read());
2129                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2130                // done second because the memcpy will write garbage to these bytes.
2131            }
2132            Ok(())
2133        }
2134    }
2135    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
2136        fidl::encoding::Encode<NeededBlobsOpenBlobRequest, D> for (T0,)
2137    {
2138        #[inline]
2139        unsafe fn encode(
2140            self,
2141            encoder: &mut fidl::encoding::Encoder<'_, D>,
2142            offset: usize,
2143            depth: fidl::encoding::Depth,
2144        ) -> fidl::Result<()> {
2145            encoder.debug_check_bounds::<NeededBlobsOpenBlobRequest>(offset);
2146            // Zero out padding regions. There's no need to apply masks
2147            // because the unmasked parts will be overwritten by fields.
2148            // Write the fields.
2149            self.0.encode(encoder, offset + 0, depth)?;
2150            Ok(())
2151        }
2152    }
2153
2154    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2155        for NeededBlobsOpenBlobRequest
2156    {
2157        #[inline(always)]
2158        fn new_empty() -> Self {
2159            Self { blob_id: fidl::new_empty!(BlobId, D) }
2160        }
2161
2162        #[inline]
2163        unsafe fn decode(
2164            &mut self,
2165            decoder: &mut fidl::encoding::Decoder<'_, D>,
2166            offset: usize,
2167            _depth: fidl::encoding::Depth,
2168        ) -> fidl::Result<()> {
2169            decoder.debug_check_bounds::<Self>(offset);
2170            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2171            // Verify that padding bytes are zero.
2172            // Copy from the buffer into the object.
2173            unsafe {
2174                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2175            }
2176            Ok(())
2177        }
2178    }
2179
2180    impl fidl::encoding::ValueTypeMarker for PackageCacheSetUpgradableUrlsRequest {
2181        type Borrowed<'a> = &'a Self;
2182        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2183            value
2184        }
2185    }
2186
2187    unsafe impl fidl::encoding::TypeMarker for PackageCacheSetUpgradableUrlsRequest {
2188        type Owned = Self;
2189
2190        #[inline(always)]
2191        fn inline_align(_context: fidl::encoding::Context) -> usize {
2192            8
2193        }
2194
2195        #[inline(always)]
2196        fn inline_size(_context: fidl::encoding::Context) -> usize {
2197            16
2198        }
2199    }
2200
2201    unsafe impl<D: fidl::encoding::ResourceDialect>
2202        fidl::encoding::Encode<PackageCacheSetUpgradableUrlsRequest, D>
2203        for &PackageCacheSetUpgradableUrlsRequest
2204    {
2205        #[inline]
2206        unsafe fn encode(
2207            self,
2208            encoder: &mut fidl::encoding::Encoder<'_, D>,
2209            offset: usize,
2210            _depth: fidl::encoding::Depth,
2211        ) -> fidl::Result<()> {
2212            encoder.debug_check_bounds::<PackageCacheSetUpgradableUrlsRequest>(offset);
2213            // Delegate to tuple encoding.
2214            fidl::encoding::Encode::<PackageCacheSetUpgradableUrlsRequest, D>::encode(
2215                (
2216                    <fidl::encoding::UnboundedVector<PackageUrl> as fidl::encoding::ValueTypeMarker>::borrow(&self.pinned_urls),
2217                ),
2218                encoder, offset, _depth
2219            )
2220        }
2221    }
2222    unsafe impl<
2223            D: fidl::encoding::ResourceDialect,
2224            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<PackageUrl>, D>,
2225        > fidl::encoding::Encode<PackageCacheSetUpgradableUrlsRequest, D> for (T0,)
2226    {
2227        #[inline]
2228        unsafe fn encode(
2229            self,
2230            encoder: &mut fidl::encoding::Encoder<'_, D>,
2231            offset: usize,
2232            depth: fidl::encoding::Depth,
2233        ) -> fidl::Result<()> {
2234            encoder.debug_check_bounds::<PackageCacheSetUpgradableUrlsRequest>(offset);
2235            // Zero out padding regions. There's no need to apply masks
2236            // because the unmasked parts will be overwritten by fields.
2237            // Write the fields.
2238            self.0.encode(encoder, offset + 0, depth)?;
2239            Ok(())
2240        }
2241    }
2242
2243    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2244        for PackageCacheSetUpgradableUrlsRequest
2245    {
2246        #[inline(always)]
2247        fn new_empty() -> Self {
2248            Self { pinned_urls: fidl::new_empty!(fidl::encoding::UnboundedVector<PackageUrl>, D) }
2249        }
2250
2251        #[inline]
2252        unsafe fn decode(
2253            &mut self,
2254            decoder: &mut fidl::encoding::Decoder<'_, D>,
2255            offset: usize,
2256            _depth: fidl::encoding::Depth,
2257        ) -> fidl::Result<()> {
2258            decoder.debug_check_bounds::<Self>(offset);
2259            // Verify that padding bytes are zero.
2260            fidl::decode!(
2261                fidl::encoding::UnboundedVector<PackageUrl>,
2262                D,
2263                &mut self.pinned_urls,
2264                decoder,
2265                offset + 0,
2266                _depth
2267            )?;
2268            Ok(())
2269        }
2270    }
2271
2272    impl fidl::encoding::ValueTypeMarker for PackageIndexEntry {
2273        type Borrowed<'a> = &'a Self;
2274        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2275            value
2276        }
2277    }
2278
2279    unsafe impl fidl::encoding::TypeMarker for PackageIndexEntry {
2280        type Owned = Self;
2281
2282        #[inline(always)]
2283        fn inline_align(_context: fidl::encoding::Context) -> usize {
2284            8
2285        }
2286
2287        #[inline(always)]
2288        fn inline_size(_context: fidl::encoding::Context) -> usize {
2289            48
2290        }
2291    }
2292
2293    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PackageIndexEntry, D>
2294        for &PackageIndexEntry
2295    {
2296        #[inline]
2297        unsafe fn encode(
2298            self,
2299            encoder: &mut fidl::encoding::Encoder<'_, D>,
2300            offset: usize,
2301            _depth: fidl::encoding::Depth,
2302        ) -> fidl::Result<()> {
2303            encoder.debug_check_bounds::<PackageIndexEntry>(offset);
2304            // Delegate to tuple encoding.
2305            fidl::encoding::Encode::<PackageIndexEntry, D>::encode(
2306                (
2307                    <PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),
2308                    <BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.meta_far_blob_id),
2309                ),
2310                encoder,
2311                offset,
2312                _depth,
2313            )
2314        }
2315    }
2316    unsafe impl<
2317            D: fidl::encoding::ResourceDialect,
2318            T0: fidl::encoding::Encode<PackageUrl, D>,
2319            T1: fidl::encoding::Encode<BlobId, D>,
2320        > fidl::encoding::Encode<PackageIndexEntry, D> for (T0, T1)
2321    {
2322        #[inline]
2323        unsafe fn encode(
2324            self,
2325            encoder: &mut fidl::encoding::Encoder<'_, D>,
2326            offset: usize,
2327            depth: fidl::encoding::Depth,
2328        ) -> fidl::Result<()> {
2329            encoder.debug_check_bounds::<PackageIndexEntry>(offset);
2330            // Zero out padding regions. There's no need to apply masks
2331            // because the unmasked parts will be overwritten by fields.
2332            // Write the fields.
2333            self.0.encode(encoder, offset + 0, depth)?;
2334            self.1.encode(encoder, offset + 16, depth)?;
2335            Ok(())
2336        }
2337    }
2338
2339    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PackageIndexEntry {
2340        #[inline(always)]
2341        fn new_empty() -> Self {
2342            Self {
2343                package_url: fidl::new_empty!(PackageUrl, D),
2344                meta_far_blob_id: fidl::new_empty!(BlobId, D),
2345            }
2346        }
2347
2348        #[inline]
2349        unsafe fn decode(
2350            &mut self,
2351            decoder: &mut fidl::encoding::Decoder<'_, D>,
2352            offset: usize,
2353            _depth: fidl::encoding::Depth,
2354        ) -> fidl::Result<()> {
2355            decoder.debug_check_bounds::<Self>(offset);
2356            // Verify that padding bytes are zero.
2357            fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
2358            fidl::decode!(BlobId, D, &mut self.meta_far_blob_id, decoder, offset + 16, _depth)?;
2359            Ok(())
2360        }
2361    }
2362
2363    impl fidl::encoding::ValueTypeMarker for PackageIndexIteratorNextResponse {
2364        type Borrowed<'a> = &'a Self;
2365        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2366            value
2367        }
2368    }
2369
2370    unsafe impl fidl::encoding::TypeMarker for PackageIndexIteratorNextResponse {
2371        type Owned = Self;
2372
2373        #[inline(always)]
2374        fn inline_align(_context: fidl::encoding::Context) -> usize {
2375            8
2376        }
2377
2378        #[inline(always)]
2379        fn inline_size(_context: fidl::encoding::Context) -> usize {
2380            16
2381        }
2382    }
2383
2384    unsafe impl<D: fidl::encoding::ResourceDialect>
2385        fidl::encoding::Encode<PackageIndexIteratorNextResponse, D>
2386        for &PackageIndexIteratorNextResponse
2387    {
2388        #[inline]
2389        unsafe fn encode(
2390            self,
2391            encoder: &mut fidl::encoding::Encoder<'_, D>,
2392            offset: usize,
2393            _depth: fidl::encoding::Depth,
2394        ) -> fidl::Result<()> {
2395            encoder.debug_check_bounds::<PackageIndexIteratorNextResponse>(offset);
2396            // Delegate to tuple encoding.
2397            fidl::encoding::Encode::<PackageIndexIteratorNextResponse, D>::encode(
2398                (
2399                    <fidl::encoding::UnboundedVector<PackageIndexEntry> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
2400                ),
2401                encoder, offset, _depth
2402            )
2403        }
2404    }
2405    unsafe impl<
2406            D: fidl::encoding::ResourceDialect,
2407            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<PackageIndexEntry>, D>,
2408        > fidl::encoding::Encode<PackageIndexIteratorNextResponse, D> for (T0,)
2409    {
2410        #[inline]
2411        unsafe fn encode(
2412            self,
2413            encoder: &mut fidl::encoding::Encoder<'_, D>,
2414            offset: usize,
2415            depth: fidl::encoding::Depth,
2416        ) -> fidl::Result<()> {
2417            encoder.debug_check_bounds::<PackageIndexIteratorNextResponse>(offset);
2418            // Zero out padding regions. There's no need to apply masks
2419            // because the unmasked parts will be overwritten by fields.
2420            // Write the fields.
2421            self.0.encode(encoder, offset + 0, depth)?;
2422            Ok(())
2423        }
2424    }
2425
2426    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2427        for PackageIndexIteratorNextResponse
2428    {
2429        #[inline(always)]
2430        fn new_empty() -> Self {
2431            Self {
2432                entries: fidl::new_empty!(fidl::encoding::UnboundedVector<PackageIndexEntry>, D),
2433            }
2434        }
2435
2436        #[inline]
2437        unsafe fn decode(
2438            &mut self,
2439            decoder: &mut fidl::encoding::Decoder<'_, D>,
2440            offset: usize,
2441            _depth: fidl::encoding::Depth,
2442        ) -> fidl::Result<()> {
2443            decoder.debug_check_bounds::<Self>(offset);
2444            // Verify that padding bytes are zero.
2445            fidl::decode!(
2446                fidl::encoding::UnboundedVector<PackageIndexEntry>,
2447                D,
2448                &mut self.entries,
2449                decoder,
2450                offset + 0,
2451                _depth
2452            )?;
2453            Ok(())
2454        }
2455    }
2456
2457    impl fidl::encoding::ValueTypeMarker for PackageResolverGetHashRequest {
2458        type Borrowed<'a> = &'a Self;
2459        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2460            value
2461        }
2462    }
2463
2464    unsafe impl fidl::encoding::TypeMarker for PackageResolverGetHashRequest {
2465        type Owned = Self;
2466
2467        #[inline(always)]
2468        fn inline_align(_context: fidl::encoding::Context) -> usize {
2469            8
2470        }
2471
2472        #[inline(always)]
2473        fn inline_size(_context: fidl::encoding::Context) -> usize {
2474            16
2475        }
2476    }
2477
2478    unsafe impl<D: fidl::encoding::ResourceDialect>
2479        fidl::encoding::Encode<PackageResolverGetHashRequest, D>
2480        for &PackageResolverGetHashRequest
2481    {
2482        #[inline]
2483        unsafe fn encode(
2484            self,
2485            encoder: &mut fidl::encoding::Encoder<'_, D>,
2486            offset: usize,
2487            _depth: fidl::encoding::Depth,
2488        ) -> fidl::Result<()> {
2489            encoder.debug_check_bounds::<PackageResolverGetHashRequest>(offset);
2490            // Delegate to tuple encoding.
2491            fidl::encoding::Encode::<PackageResolverGetHashRequest, D>::encode(
2492                (<PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),),
2493                encoder,
2494                offset,
2495                _depth,
2496            )
2497        }
2498    }
2499    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PackageUrl, D>>
2500        fidl::encoding::Encode<PackageResolverGetHashRequest, D> for (T0,)
2501    {
2502        #[inline]
2503        unsafe fn encode(
2504            self,
2505            encoder: &mut fidl::encoding::Encoder<'_, D>,
2506            offset: usize,
2507            depth: fidl::encoding::Depth,
2508        ) -> fidl::Result<()> {
2509            encoder.debug_check_bounds::<PackageResolverGetHashRequest>(offset);
2510            // Zero out padding regions. There's no need to apply masks
2511            // because the unmasked parts will be overwritten by fields.
2512            // Write the fields.
2513            self.0.encode(encoder, offset + 0, depth)?;
2514            Ok(())
2515        }
2516    }
2517
2518    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2519        for PackageResolverGetHashRequest
2520    {
2521        #[inline(always)]
2522        fn new_empty() -> Self {
2523            Self { package_url: fidl::new_empty!(PackageUrl, D) }
2524        }
2525
2526        #[inline]
2527        unsafe fn decode(
2528            &mut self,
2529            decoder: &mut fidl::encoding::Decoder<'_, D>,
2530            offset: usize,
2531            _depth: fidl::encoding::Depth,
2532        ) -> fidl::Result<()> {
2533            decoder.debug_check_bounds::<Self>(offset);
2534            // Verify that padding bytes are zero.
2535            fidl::decode!(PackageUrl, D, &mut self.package_url, decoder, offset + 0, _depth)?;
2536            Ok(())
2537        }
2538    }
2539
2540    impl fidl::encoding::ValueTypeMarker for PackageResolverGetHashResponse {
2541        type Borrowed<'a> = &'a Self;
2542        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2543            value
2544        }
2545    }
2546
2547    unsafe impl fidl::encoding::TypeMarker for PackageResolverGetHashResponse {
2548        type Owned = Self;
2549
2550        #[inline(always)]
2551        fn inline_align(_context: fidl::encoding::Context) -> usize {
2552            1
2553        }
2554
2555        #[inline(always)]
2556        fn inline_size(_context: fidl::encoding::Context) -> usize {
2557            32
2558        }
2559        #[inline(always)]
2560        fn encode_is_copy() -> bool {
2561            true
2562        }
2563
2564        #[inline(always)]
2565        fn decode_is_copy() -> bool {
2566            true
2567        }
2568    }
2569
2570    unsafe impl<D: fidl::encoding::ResourceDialect>
2571        fidl::encoding::Encode<PackageResolverGetHashResponse, D>
2572        for &PackageResolverGetHashResponse
2573    {
2574        #[inline]
2575        unsafe fn encode(
2576            self,
2577            encoder: &mut fidl::encoding::Encoder<'_, D>,
2578            offset: usize,
2579            _depth: fidl::encoding::Depth,
2580        ) -> fidl::Result<()> {
2581            encoder.debug_check_bounds::<PackageResolverGetHashResponse>(offset);
2582            unsafe {
2583                // Copy the object into the buffer.
2584                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2585                (buf_ptr as *mut PackageResolverGetHashResponse)
2586                    .write_unaligned((self as *const PackageResolverGetHashResponse).read());
2587                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2588                // done second because the memcpy will write garbage to these bytes.
2589            }
2590            Ok(())
2591        }
2592    }
2593    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BlobId, D>>
2594        fidl::encoding::Encode<PackageResolverGetHashResponse, D> for (T0,)
2595    {
2596        #[inline]
2597        unsafe fn encode(
2598            self,
2599            encoder: &mut fidl::encoding::Encoder<'_, D>,
2600            offset: usize,
2601            depth: fidl::encoding::Depth,
2602        ) -> fidl::Result<()> {
2603            encoder.debug_check_bounds::<PackageResolverGetHashResponse>(offset);
2604            // Zero out padding regions. There's no need to apply masks
2605            // because the unmasked parts will be overwritten by fields.
2606            // Write the fields.
2607            self.0.encode(encoder, offset + 0, depth)?;
2608            Ok(())
2609        }
2610    }
2611
2612    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2613        for PackageResolverGetHashResponse
2614    {
2615        #[inline(always)]
2616        fn new_empty() -> Self {
2617            Self { meta_far_blob_id: fidl::new_empty!(BlobId, D) }
2618        }
2619
2620        #[inline]
2621        unsafe fn decode(
2622            &mut self,
2623            decoder: &mut fidl::encoding::Decoder<'_, D>,
2624            offset: usize,
2625            _depth: fidl::encoding::Depth,
2626        ) -> fidl::Result<()> {
2627            decoder.debug_check_bounds::<Self>(offset);
2628            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2629            // Verify that padding bytes are zero.
2630            // Copy from the buffer into the object.
2631            unsafe {
2632                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
2633            }
2634            Ok(())
2635        }
2636    }
2637
2638    impl fidl::encoding::ValueTypeMarker for PackageResolverResolveWithContextResponse {
2639        type Borrowed<'a> = &'a Self;
2640        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2641            value
2642        }
2643    }
2644
2645    unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveWithContextResponse {
2646        type Owned = Self;
2647
2648        #[inline(always)]
2649        fn inline_align(_context: fidl::encoding::Context) -> usize {
2650            8
2651        }
2652
2653        #[inline(always)]
2654        fn inline_size(_context: fidl::encoding::Context) -> usize {
2655            16
2656        }
2657    }
2658
2659    unsafe impl<D: fidl::encoding::ResourceDialect>
2660        fidl::encoding::Encode<PackageResolverResolveWithContextResponse, D>
2661        for &PackageResolverResolveWithContextResponse
2662    {
2663        #[inline]
2664        unsafe fn encode(
2665            self,
2666            encoder: &mut fidl::encoding::Encoder<'_, D>,
2667            offset: usize,
2668            _depth: fidl::encoding::Depth,
2669        ) -> fidl::Result<()> {
2670            encoder.debug_check_bounds::<PackageResolverResolveWithContextResponse>(offset);
2671            // Delegate to tuple encoding.
2672            fidl::encoding::Encode::<PackageResolverResolveWithContextResponse, D>::encode(
2673                (<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(
2674                    &self.resolved_context,
2675                ),),
2676                encoder,
2677                offset,
2678                _depth,
2679            )
2680        }
2681    }
2682    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ResolutionContext, D>>
2683        fidl::encoding::Encode<PackageResolverResolveWithContextResponse, D> for (T0,)
2684    {
2685        #[inline]
2686        unsafe fn encode(
2687            self,
2688            encoder: &mut fidl::encoding::Encoder<'_, D>,
2689            offset: usize,
2690            depth: fidl::encoding::Depth,
2691        ) -> fidl::Result<()> {
2692            encoder.debug_check_bounds::<PackageResolverResolveWithContextResponse>(offset);
2693            // Zero out padding regions. There's no need to apply masks
2694            // because the unmasked parts will be overwritten by fields.
2695            // Write the fields.
2696            self.0.encode(encoder, offset + 0, depth)?;
2697            Ok(())
2698        }
2699    }
2700
2701    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2702        for PackageResolverResolveWithContextResponse
2703    {
2704        #[inline(always)]
2705        fn new_empty() -> Self {
2706            Self { resolved_context: fidl::new_empty!(ResolutionContext, D) }
2707        }
2708
2709        #[inline]
2710        unsafe fn decode(
2711            &mut self,
2712            decoder: &mut fidl::encoding::Decoder<'_, D>,
2713            offset: usize,
2714            _depth: fidl::encoding::Depth,
2715        ) -> fidl::Result<()> {
2716            decoder.debug_check_bounds::<Self>(offset);
2717            // Verify that padding bytes are zero.
2718            fidl::decode!(
2719                ResolutionContext,
2720                D,
2721                &mut self.resolved_context,
2722                decoder,
2723                offset + 0,
2724                _depth
2725            )?;
2726            Ok(())
2727        }
2728    }
2729
2730    impl fidl::encoding::ValueTypeMarker for PackageResolverResolveResponse {
2731        type Borrowed<'a> = &'a Self;
2732        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2733            value
2734        }
2735    }
2736
2737    unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveResponse {
2738        type Owned = Self;
2739
2740        #[inline(always)]
2741        fn inline_align(_context: fidl::encoding::Context) -> usize {
2742            8
2743        }
2744
2745        #[inline(always)]
2746        fn inline_size(_context: fidl::encoding::Context) -> usize {
2747            16
2748        }
2749    }
2750
2751    unsafe impl<D: fidl::encoding::ResourceDialect>
2752        fidl::encoding::Encode<PackageResolverResolveResponse, D>
2753        for &PackageResolverResolveResponse
2754    {
2755        #[inline]
2756        unsafe fn encode(
2757            self,
2758            encoder: &mut fidl::encoding::Encoder<'_, D>,
2759            offset: usize,
2760            _depth: fidl::encoding::Depth,
2761        ) -> fidl::Result<()> {
2762            encoder.debug_check_bounds::<PackageResolverResolveResponse>(offset);
2763            // Delegate to tuple encoding.
2764            fidl::encoding::Encode::<PackageResolverResolveResponse, D>::encode(
2765                (<ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(
2766                    &self.resolved_context,
2767                ),),
2768                encoder,
2769                offset,
2770                _depth,
2771            )
2772        }
2773    }
2774    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ResolutionContext, D>>
2775        fidl::encoding::Encode<PackageResolverResolveResponse, D> for (T0,)
2776    {
2777        #[inline]
2778        unsafe fn encode(
2779            self,
2780            encoder: &mut fidl::encoding::Encoder<'_, D>,
2781            offset: usize,
2782            depth: fidl::encoding::Depth,
2783        ) -> fidl::Result<()> {
2784            encoder.debug_check_bounds::<PackageResolverResolveResponse>(offset);
2785            // Zero out padding regions. There's no need to apply masks
2786            // because the unmasked parts will be overwritten by fields.
2787            // Write the fields.
2788            self.0.encode(encoder, offset + 0, depth)?;
2789            Ok(())
2790        }
2791    }
2792
2793    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2794        for PackageResolverResolveResponse
2795    {
2796        #[inline(always)]
2797        fn new_empty() -> Self {
2798            Self { resolved_context: fidl::new_empty!(ResolutionContext, D) }
2799        }
2800
2801        #[inline]
2802        unsafe fn decode(
2803            &mut self,
2804            decoder: &mut fidl::encoding::Decoder<'_, D>,
2805            offset: usize,
2806            _depth: fidl::encoding::Depth,
2807        ) -> fidl::Result<()> {
2808            decoder.debug_check_bounds::<Self>(offset);
2809            // Verify that padding bytes are zero.
2810            fidl::decode!(
2811                ResolutionContext,
2812                D,
2813                &mut self.resolved_context,
2814                decoder,
2815                offset + 0,
2816                _depth
2817            )?;
2818            Ok(())
2819        }
2820    }
2821
2822    impl fidl::encoding::ValueTypeMarker for PackageUrl {
2823        type Borrowed<'a> = &'a Self;
2824        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2825            value
2826        }
2827    }
2828
2829    unsafe impl fidl::encoding::TypeMarker for PackageUrl {
2830        type Owned = Self;
2831
2832        #[inline(always)]
2833        fn inline_align(_context: fidl::encoding::Context) -> usize {
2834            8
2835        }
2836
2837        #[inline(always)]
2838        fn inline_size(_context: fidl::encoding::Context) -> usize {
2839            16
2840        }
2841    }
2842
2843    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PackageUrl, D>
2844        for &PackageUrl
2845    {
2846        #[inline]
2847        unsafe fn encode(
2848            self,
2849            encoder: &mut fidl::encoding::Encoder<'_, D>,
2850            offset: usize,
2851            _depth: fidl::encoding::Depth,
2852        ) -> fidl::Result<()> {
2853            encoder.debug_check_bounds::<PackageUrl>(offset);
2854            // Delegate to tuple encoding.
2855            fidl::encoding::Encode::<PackageUrl, D>::encode(
2856                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
2857                    &self.url,
2858                ),),
2859                encoder,
2860                offset,
2861                _depth,
2862            )
2863        }
2864    }
2865    unsafe impl<
2866            D: fidl::encoding::ResourceDialect,
2867            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
2868        > fidl::encoding::Encode<PackageUrl, D> for (T0,)
2869    {
2870        #[inline]
2871        unsafe fn encode(
2872            self,
2873            encoder: &mut fidl::encoding::Encoder<'_, D>,
2874            offset: usize,
2875            depth: fidl::encoding::Depth,
2876        ) -> fidl::Result<()> {
2877            encoder.debug_check_bounds::<PackageUrl>(offset);
2878            // Zero out padding regions. There's no need to apply masks
2879            // because the unmasked parts will be overwritten by fields.
2880            // Write the fields.
2881            self.0.encode(encoder, offset + 0, depth)?;
2882            Ok(())
2883        }
2884    }
2885
2886    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PackageUrl {
2887        #[inline(always)]
2888        fn new_empty() -> Self {
2889            Self { url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
2890        }
2891
2892        #[inline]
2893        unsafe fn decode(
2894            &mut self,
2895            decoder: &mut fidl::encoding::Decoder<'_, D>,
2896            offset: usize,
2897            _depth: fidl::encoding::Depth,
2898        ) -> fidl::Result<()> {
2899            decoder.debug_check_bounds::<Self>(offset);
2900            // Verify that padding bytes are zero.
2901            fidl::decode!(
2902                fidl::encoding::BoundedString<4096>,
2903                D,
2904                &mut self.url,
2905                decoder,
2906                offset + 0,
2907                _depth
2908            )?;
2909            Ok(())
2910        }
2911    }
2912
2913    impl fidl::encoding::ValueTypeMarker for RepositoryIteratorNextResponse {
2914        type Borrowed<'a> = &'a Self;
2915        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2916            value
2917        }
2918    }
2919
2920    unsafe impl fidl::encoding::TypeMarker for RepositoryIteratorNextResponse {
2921        type Owned = Self;
2922
2923        #[inline(always)]
2924        fn inline_align(_context: fidl::encoding::Context) -> usize {
2925            8
2926        }
2927
2928        #[inline(always)]
2929        fn inline_size(_context: fidl::encoding::Context) -> usize {
2930            16
2931        }
2932    }
2933
2934    unsafe impl<D: fidl::encoding::ResourceDialect>
2935        fidl::encoding::Encode<RepositoryIteratorNextResponse, D>
2936        for &RepositoryIteratorNextResponse
2937    {
2938        #[inline]
2939        unsafe fn encode(
2940            self,
2941            encoder: &mut fidl::encoding::Encoder<'_, D>,
2942            offset: usize,
2943            _depth: fidl::encoding::Depth,
2944        ) -> fidl::Result<()> {
2945            encoder.debug_check_bounds::<RepositoryIteratorNextResponse>(offset);
2946            // Delegate to tuple encoding.
2947            fidl::encoding::Encode::<RepositoryIteratorNextResponse, D>::encode(
2948                (
2949                    <fidl::encoding::UnboundedVector<RepositoryConfig> as fidl::encoding::ValueTypeMarker>::borrow(&self.repos),
2950                ),
2951                encoder, offset, _depth
2952            )
2953        }
2954    }
2955    unsafe impl<
2956            D: fidl::encoding::ResourceDialect,
2957            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RepositoryConfig>, D>,
2958        > fidl::encoding::Encode<RepositoryIteratorNextResponse, D> for (T0,)
2959    {
2960        #[inline]
2961        unsafe fn encode(
2962            self,
2963            encoder: &mut fidl::encoding::Encoder<'_, D>,
2964            offset: usize,
2965            depth: fidl::encoding::Depth,
2966        ) -> fidl::Result<()> {
2967            encoder.debug_check_bounds::<RepositoryIteratorNextResponse>(offset);
2968            // Zero out padding regions. There's no need to apply masks
2969            // because the unmasked parts will be overwritten by fields.
2970            // Write the fields.
2971            self.0.encode(encoder, offset + 0, depth)?;
2972            Ok(())
2973        }
2974    }
2975
2976    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2977        for RepositoryIteratorNextResponse
2978    {
2979        #[inline(always)]
2980        fn new_empty() -> Self {
2981            Self { repos: fidl::new_empty!(fidl::encoding::UnboundedVector<RepositoryConfig>, D) }
2982        }
2983
2984        #[inline]
2985        unsafe fn decode(
2986            &mut self,
2987            decoder: &mut fidl::encoding::Decoder<'_, D>,
2988            offset: usize,
2989            _depth: fidl::encoding::Depth,
2990        ) -> fidl::Result<()> {
2991            decoder.debug_check_bounds::<Self>(offset);
2992            // Verify that padding bytes are zero.
2993            fidl::decode!(
2994                fidl::encoding::UnboundedVector<RepositoryConfig>,
2995                D,
2996                &mut self.repos,
2997                decoder,
2998                offset + 0,
2999                _depth
3000            )?;
3001            Ok(())
3002        }
3003    }
3004
3005    impl fidl::encoding::ValueTypeMarker for RepositoryManagerAddMirrorRequest {
3006        type Borrowed<'a> = &'a Self;
3007        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3008            value
3009        }
3010    }
3011
3012    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerAddMirrorRequest {
3013        type Owned = Self;
3014
3015        #[inline(always)]
3016        fn inline_align(_context: fidl::encoding::Context) -> usize {
3017            8
3018        }
3019
3020        #[inline(always)]
3021        fn inline_size(_context: fidl::encoding::Context) -> usize {
3022            32
3023        }
3024    }
3025
3026    unsafe impl<D: fidl::encoding::ResourceDialect>
3027        fidl::encoding::Encode<RepositoryManagerAddMirrorRequest, D>
3028        for &RepositoryManagerAddMirrorRequest
3029    {
3030        #[inline]
3031        unsafe fn encode(
3032            self,
3033            encoder: &mut fidl::encoding::Encoder<'_, D>,
3034            offset: usize,
3035            _depth: fidl::encoding::Depth,
3036        ) -> fidl::Result<()> {
3037            encoder.debug_check_bounds::<RepositoryManagerAddMirrorRequest>(offset);
3038            // Delegate to tuple encoding.
3039            fidl::encoding::Encode::<RepositoryManagerAddMirrorRequest, D>::encode(
3040                (
3041                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3042                        &self.repo_url,
3043                    ),
3044                    <MirrorConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.mirror),
3045                ),
3046                encoder,
3047                offset,
3048                _depth,
3049            )
3050        }
3051    }
3052    unsafe impl<
3053            D: fidl::encoding::ResourceDialect,
3054            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3055            T1: fidl::encoding::Encode<MirrorConfig, D>,
3056        > fidl::encoding::Encode<RepositoryManagerAddMirrorRequest, D> for (T0, T1)
3057    {
3058        #[inline]
3059        unsafe fn encode(
3060            self,
3061            encoder: &mut fidl::encoding::Encoder<'_, D>,
3062            offset: usize,
3063            depth: fidl::encoding::Depth,
3064        ) -> fidl::Result<()> {
3065            encoder.debug_check_bounds::<RepositoryManagerAddMirrorRequest>(offset);
3066            // Zero out padding regions. There's no need to apply masks
3067            // because the unmasked parts will be overwritten by fields.
3068            // Write the fields.
3069            self.0.encode(encoder, offset + 0, depth)?;
3070            self.1.encode(encoder, offset + 16, depth)?;
3071            Ok(())
3072        }
3073    }
3074
3075    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3076        for RepositoryManagerAddMirrorRequest
3077    {
3078        #[inline(always)]
3079        fn new_empty() -> Self {
3080            Self {
3081                repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3082                mirror: fidl::new_empty!(MirrorConfig, D),
3083            }
3084        }
3085
3086        #[inline]
3087        unsafe fn decode(
3088            &mut self,
3089            decoder: &mut fidl::encoding::Decoder<'_, D>,
3090            offset: usize,
3091            _depth: fidl::encoding::Depth,
3092        ) -> fidl::Result<()> {
3093            decoder.debug_check_bounds::<Self>(offset);
3094            // Verify that padding bytes are zero.
3095            fidl::decode!(
3096                fidl::encoding::UnboundedString,
3097                D,
3098                &mut self.repo_url,
3099                decoder,
3100                offset + 0,
3101                _depth
3102            )?;
3103            fidl::decode!(MirrorConfig, D, &mut self.mirror, decoder, offset + 16, _depth)?;
3104            Ok(())
3105        }
3106    }
3107
3108    impl fidl::encoding::ValueTypeMarker for RepositoryManagerAddRequest {
3109        type Borrowed<'a> = &'a Self;
3110        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3111            value
3112        }
3113    }
3114
3115    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerAddRequest {
3116        type Owned = Self;
3117
3118        #[inline(always)]
3119        fn inline_align(_context: fidl::encoding::Context) -> usize {
3120            8
3121        }
3122
3123        #[inline(always)]
3124        fn inline_size(_context: fidl::encoding::Context) -> usize {
3125            16
3126        }
3127    }
3128
3129    unsafe impl<D: fidl::encoding::ResourceDialect>
3130        fidl::encoding::Encode<RepositoryManagerAddRequest, D> for &RepositoryManagerAddRequest
3131    {
3132        #[inline]
3133        unsafe fn encode(
3134            self,
3135            encoder: &mut fidl::encoding::Encoder<'_, D>,
3136            offset: usize,
3137            _depth: fidl::encoding::Depth,
3138        ) -> fidl::Result<()> {
3139            encoder.debug_check_bounds::<RepositoryManagerAddRequest>(offset);
3140            // Delegate to tuple encoding.
3141            fidl::encoding::Encode::<RepositoryManagerAddRequest, D>::encode(
3142                (<RepositoryConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.repo),),
3143                encoder,
3144                offset,
3145                _depth,
3146            )
3147        }
3148    }
3149    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RepositoryConfig, D>>
3150        fidl::encoding::Encode<RepositoryManagerAddRequest, D> for (T0,)
3151    {
3152        #[inline]
3153        unsafe fn encode(
3154            self,
3155            encoder: &mut fidl::encoding::Encoder<'_, D>,
3156            offset: usize,
3157            depth: fidl::encoding::Depth,
3158        ) -> fidl::Result<()> {
3159            encoder.debug_check_bounds::<RepositoryManagerAddRequest>(offset);
3160            // Zero out padding regions. There's no need to apply masks
3161            // because the unmasked parts will be overwritten by fields.
3162            // Write the fields.
3163            self.0.encode(encoder, offset + 0, depth)?;
3164            Ok(())
3165        }
3166    }
3167
3168    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3169        for RepositoryManagerAddRequest
3170    {
3171        #[inline(always)]
3172        fn new_empty() -> Self {
3173            Self { repo: fidl::new_empty!(RepositoryConfig, D) }
3174        }
3175
3176        #[inline]
3177        unsafe fn decode(
3178            &mut self,
3179            decoder: &mut fidl::encoding::Decoder<'_, D>,
3180            offset: usize,
3181            _depth: fidl::encoding::Depth,
3182        ) -> fidl::Result<()> {
3183            decoder.debug_check_bounds::<Self>(offset);
3184            // Verify that padding bytes are zero.
3185            fidl::decode!(RepositoryConfig, D, &mut self.repo, decoder, offset + 0, _depth)?;
3186            Ok(())
3187        }
3188    }
3189
3190    impl fidl::encoding::ValueTypeMarker for RepositoryManagerRemoveMirrorRequest {
3191        type Borrowed<'a> = &'a Self;
3192        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3193            value
3194        }
3195    }
3196
3197    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerRemoveMirrorRequest {
3198        type Owned = Self;
3199
3200        #[inline(always)]
3201        fn inline_align(_context: fidl::encoding::Context) -> usize {
3202            8
3203        }
3204
3205        #[inline(always)]
3206        fn inline_size(_context: fidl::encoding::Context) -> usize {
3207            32
3208        }
3209    }
3210
3211    unsafe impl<D: fidl::encoding::ResourceDialect>
3212        fidl::encoding::Encode<RepositoryManagerRemoveMirrorRequest, D>
3213        for &RepositoryManagerRemoveMirrorRequest
3214    {
3215        #[inline]
3216        unsafe fn encode(
3217            self,
3218            encoder: &mut fidl::encoding::Encoder<'_, D>,
3219            offset: usize,
3220            _depth: fidl::encoding::Depth,
3221        ) -> fidl::Result<()> {
3222            encoder.debug_check_bounds::<RepositoryManagerRemoveMirrorRequest>(offset);
3223            // Delegate to tuple encoding.
3224            fidl::encoding::Encode::<RepositoryManagerRemoveMirrorRequest, D>::encode(
3225                (
3226                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3227                        &self.repo_url,
3228                    ),
3229                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3230                        &self.mirror_url,
3231                    ),
3232                ),
3233                encoder,
3234                offset,
3235                _depth,
3236            )
3237        }
3238    }
3239    unsafe impl<
3240            D: fidl::encoding::ResourceDialect,
3241            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3242            T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3243        > fidl::encoding::Encode<RepositoryManagerRemoveMirrorRequest, D> for (T0, T1)
3244    {
3245        #[inline]
3246        unsafe fn encode(
3247            self,
3248            encoder: &mut fidl::encoding::Encoder<'_, D>,
3249            offset: usize,
3250            depth: fidl::encoding::Depth,
3251        ) -> fidl::Result<()> {
3252            encoder.debug_check_bounds::<RepositoryManagerRemoveMirrorRequest>(offset);
3253            // Zero out padding regions. There's no need to apply masks
3254            // because the unmasked parts will be overwritten by fields.
3255            // Write the fields.
3256            self.0.encode(encoder, offset + 0, depth)?;
3257            self.1.encode(encoder, offset + 16, depth)?;
3258            Ok(())
3259        }
3260    }
3261
3262    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3263        for RepositoryManagerRemoveMirrorRequest
3264    {
3265        #[inline(always)]
3266        fn new_empty() -> Self {
3267            Self {
3268                repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3269                mirror_url: fidl::new_empty!(fidl::encoding::UnboundedString, D),
3270            }
3271        }
3272
3273        #[inline]
3274        unsafe fn decode(
3275            &mut self,
3276            decoder: &mut fidl::encoding::Decoder<'_, D>,
3277            offset: usize,
3278            _depth: fidl::encoding::Depth,
3279        ) -> fidl::Result<()> {
3280            decoder.debug_check_bounds::<Self>(offset);
3281            // Verify that padding bytes are zero.
3282            fidl::decode!(
3283                fidl::encoding::UnboundedString,
3284                D,
3285                &mut self.repo_url,
3286                decoder,
3287                offset + 0,
3288                _depth
3289            )?;
3290            fidl::decode!(
3291                fidl::encoding::UnboundedString,
3292                D,
3293                &mut self.mirror_url,
3294                decoder,
3295                offset + 16,
3296                _depth
3297            )?;
3298            Ok(())
3299        }
3300    }
3301
3302    impl fidl::encoding::ValueTypeMarker for RepositoryManagerRemoveRequest {
3303        type Borrowed<'a> = &'a Self;
3304        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3305            value
3306        }
3307    }
3308
3309    unsafe impl fidl::encoding::TypeMarker for RepositoryManagerRemoveRequest {
3310        type Owned = Self;
3311
3312        #[inline(always)]
3313        fn inline_align(_context: fidl::encoding::Context) -> usize {
3314            8
3315        }
3316
3317        #[inline(always)]
3318        fn inline_size(_context: fidl::encoding::Context) -> usize {
3319            16
3320        }
3321    }
3322
3323    unsafe impl<D: fidl::encoding::ResourceDialect>
3324        fidl::encoding::Encode<RepositoryManagerRemoveRequest, D>
3325        for &RepositoryManagerRemoveRequest
3326    {
3327        #[inline]
3328        unsafe fn encode(
3329            self,
3330            encoder: &mut fidl::encoding::Encoder<'_, D>,
3331            offset: usize,
3332            _depth: fidl::encoding::Depth,
3333        ) -> fidl::Result<()> {
3334            encoder.debug_check_bounds::<RepositoryManagerRemoveRequest>(offset);
3335            // Delegate to tuple encoding.
3336            fidl::encoding::Encode::<RepositoryManagerRemoveRequest, D>::encode(
3337                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
3338                    &self.repo_url,
3339                ),),
3340                encoder,
3341                offset,
3342                _depth,
3343            )
3344        }
3345    }
3346    unsafe impl<
3347            D: fidl::encoding::ResourceDialect,
3348            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
3349        > fidl::encoding::Encode<RepositoryManagerRemoveRequest, D> for (T0,)
3350    {
3351        #[inline]
3352        unsafe fn encode(
3353            self,
3354            encoder: &mut fidl::encoding::Encoder<'_, D>,
3355            offset: usize,
3356            depth: fidl::encoding::Depth,
3357        ) -> fidl::Result<()> {
3358            encoder.debug_check_bounds::<RepositoryManagerRemoveRequest>(offset);
3359            // Zero out padding regions. There's no need to apply masks
3360            // because the unmasked parts will be overwritten by fields.
3361            // Write the fields.
3362            self.0.encode(encoder, offset + 0, depth)?;
3363            Ok(())
3364        }
3365    }
3366
3367    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3368        for RepositoryManagerRemoveRequest
3369    {
3370        #[inline(always)]
3371        fn new_empty() -> Self {
3372            Self { repo_url: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
3373        }
3374
3375        #[inline]
3376        unsafe fn decode(
3377            &mut self,
3378            decoder: &mut fidl::encoding::Decoder<'_, D>,
3379            offset: usize,
3380            _depth: fidl::encoding::Depth,
3381        ) -> fidl::Result<()> {
3382            decoder.debug_check_bounds::<Self>(offset);
3383            // Verify that padding bytes are zero.
3384            fidl::decode!(
3385                fidl::encoding::UnboundedString,
3386                D,
3387                &mut self.repo_url,
3388                decoder,
3389                offset + 0,
3390                _depth
3391            )?;
3392            Ok(())
3393        }
3394    }
3395
3396    impl fidl::encoding::ValueTypeMarker for RepositoryUrl {
3397        type Borrowed<'a> = &'a Self;
3398        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3399            value
3400        }
3401    }
3402
3403    unsafe impl fidl::encoding::TypeMarker for RepositoryUrl {
3404        type Owned = Self;
3405
3406        #[inline(always)]
3407        fn inline_align(_context: fidl::encoding::Context) -> usize {
3408            8
3409        }
3410
3411        #[inline(always)]
3412        fn inline_size(_context: fidl::encoding::Context) -> usize {
3413            16
3414        }
3415    }
3416
3417    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryUrl, D>
3418        for &RepositoryUrl
3419    {
3420        #[inline]
3421        unsafe fn encode(
3422            self,
3423            encoder: &mut fidl::encoding::Encoder<'_, D>,
3424            offset: usize,
3425            _depth: fidl::encoding::Depth,
3426        ) -> fidl::Result<()> {
3427            encoder.debug_check_bounds::<RepositoryUrl>(offset);
3428            // Delegate to tuple encoding.
3429            fidl::encoding::Encode::<RepositoryUrl, D>::encode(
3430                (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
3431                    &self.url,
3432                ),),
3433                encoder,
3434                offset,
3435                _depth,
3436            )
3437        }
3438    }
3439    unsafe impl<
3440            D: fidl::encoding::ResourceDialect,
3441            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
3442        > fidl::encoding::Encode<RepositoryUrl, D> for (T0,)
3443    {
3444        #[inline]
3445        unsafe fn encode(
3446            self,
3447            encoder: &mut fidl::encoding::Encoder<'_, D>,
3448            offset: usize,
3449            depth: fidl::encoding::Depth,
3450        ) -> fidl::Result<()> {
3451            encoder.debug_check_bounds::<RepositoryUrl>(offset);
3452            // Zero out padding regions. There's no need to apply masks
3453            // because the unmasked parts will be overwritten by fields.
3454            // Write the fields.
3455            self.0.encode(encoder, offset + 0, depth)?;
3456            Ok(())
3457        }
3458    }
3459
3460    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryUrl {
3461        #[inline(always)]
3462        fn new_empty() -> Self {
3463            Self { url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
3464        }
3465
3466        #[inline]
3467        unsafe fn decode(
3468            &mut self,
3469            decoder: &mut fidl::encoding::Decoder<'_, D>,
3470            offset: usize,
3471            _depth: fidl::encoding::Depth,
3472        ) -> fidl::Result<()> {
3473            decoder.debug_check_bounds::<Self>(offset);
3474            // Verify that padding bytes are zero.
3475            fidl::decode!(
3476                fidl::encoding::BoundedString<4096>,
3477                D,
3478                &mut self.url,
3479                decoder,
3480                offset + 0,
3481                _depth
3482            )?;
3483            Ok(())
3484        }
3485    }
3486
3487    impl fidl::encoding::ValueTypeMarker for ResolutionContext {
3488        type Borrowed<'a> = &'a Self;
3489        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3490            value
3491        }
3492    }
3493
3494    unsafe impl fidl::encoding::TypeMarker for ResolutionContext {
3495        type Owned = Self;
3496
3497        #[inline(always)]
3498        fn inline_align(_context: fidl::encoding::Context) -> usize {
3499            8
3500        }
3501
3502        #[inline(always)]
3503        fn inline_size(_context: fidl::encoding::Context) -> usize {
3504            16
3505        }
3506    }
3507
3508    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolutionContext, D>
3509        for &ResolutionContext
3510    {
3511        #[inline]
3512        unsafe fn encode(
3513            self,
3514            encoder: &mut fidl::encoding::Encoder<'_, D>,
3515            offset: usize,
3516            _depth: fidl::encoding::Depth,
3517        ) -> fidl::Result<()> {
3518            encoder.debug_check_bounds::<ResolutionContext>(offset);
3519            // Delegate to tuple encoding.
3520            fidl::encoding::Encode::<ResolutionContext, D>::encode(
3521                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
3522                    &self.bytes,
3523                ),),
3524                encoder,
3525                offset,
3526                _depth,
3527            )
3528        }
3529    }
3530    unsafe impl<
3531            D: fidl::encoding::ResourceDialect,
3532            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
3533        > fidl::encoding::Encode<ResolutionContext, D> for (T0,)
3534    {
3535        #[inline]
3536        unsafe fn encode(
3537            self,
3538            encoder: &mut fidl::encoding::Encoder<'_, D>,
3539            offset: usize,
3540            depth: fidl::encoding::Depth,
3541        ) -> fidl::Result<()> {
3542            encoder.debug_check_bounds::<ResolutionContext>(offset);
3543            // Zero out padding regions. There's no need to apply masks
3544            // because the unmasked parts will be overwritten by fields.
3545            // Write the fields.
3546            self.0.encode(encoder, offset + 0, depth)?;
3547            Ok(())
3548        }
3549    }
3550
3551    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolutionContext {
3552        #[inline(always)]
3553        fn new_empty() -> Self {
3554            Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
3555        }
3556
3557        #[inline]
3558        unsafe fn decode(
3559            &mut self,
3560            decoder: &mut fidl::encoding::Decoder<'_, D>,
3561            offset: usize,
3562            _depth: fidl::encoding::Depth,
3563        ) -> fidl::Result<()> {
3564            decoder.debug_check_bounds::<Self>(offset);
3565            // Verify that padding bytes are zero.
3566            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
3567            Ok(())
3568        }
3569    }
3570
3571    impl CupData {
3572        #[inline(always)]
3573        fn max_ordinal_present(&self) -> u64 {
3574            if let Some(_) = self.signature {
3575                return 5;
3576            }
3577            if let Some(_) = self.response {
3578                return 4;
3579            }
3580            if let Some(_) = self.nonce {
3581                return 3;
3582            }
3583            if let Some(_) = self.key_id {
3584                return 2;
3585            }
3586            if let Some(_) = self.request {
3587                return 1;
3588            }
3589            0
3590        }
3591    }
3592
3593    impl fidl::encoding::ValueTypeMarker for CupData {
3594        type Borrowed<'a> = &'a Self;
3595        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3596            value
3597        }
3598    }
3599
3600    unsafe impl fidl::encoding::TypeMarker for CupData {
3601        type Owned = Self;
3602
3603        #[inline(always)]
3604        fn inline_align(_context: fidl::encoding::Context) -> usize {
3605            8
3606        }
3607
3608        #[inline(always)]
3609        fn inline_size(_context: fidl::encoding::Context) -> usize {
3610            16
3611        }
3612    }
3613
3614    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CupData, D> for &CupData {
3615        unsafe fn encode(
3616            self,
3617            encoder: &mut fidl::encoding::Encoder<'_, D>,
3618            offset: usize,
3619            mut depth: fidl::encoding::Depth,
3620        ) -> fidl::Result<()> {
3621            encoder.debug_check_bounds::<CupData>(offset);
3622            // Vector header
3623            let max_ordinal: u64 = self.max_ordinal_present();
3624            encoder.write_num(max_ordinal, offset);
3625            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3626            // Calling encoder.out_of_line_offset(0) is not allowed.
3627            if max_ordinal == 0 {
3628                return Ok(());
3629            }
3630            depth.increment()?;
3631            let envelope_size = 8;
3632            let bytes_len = max_ordinal as usize * envelope_size;
3633            #[allow(unused_variables)]
3634            let offset = encoder.out_of_line_offset(bytes_len);
3635            let mut _prev_end_offset: usize = 0;
3636            if 1 > max_ordinal {
3637                return Ok(());
3638            }
3639
3640            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3641            // are envelope_size bytes.
3642            let cur_offset: usize = (1 - 1) * envelope_size;
3643
3644            // Zero reserved fields.
3645            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3646
3647            // Safety:
3648            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3649            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3650            //   envelope_size bytes, there is always sufficient room.
3651            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 65536>, D>(
3652                self.request.as_ref().map(
3653                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow,
3654                ),
3655                encoder,
3656                offset + cur_offset,
3657                depth,
3658            )?;
3659
3660            _prev_end_offset = cur_offset + envelope_size;
3661            if 2 > max_ordinal {
3662                return Ok(());
3663            }
3664
3665            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3666            // are envelope_size bytes.
3667            let cur_offset: usize = (2 - 1) * envelope_size;
3668
3669            // Zero reserved fields.
3670            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3671
3672            // Safety:
3673            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3674            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3675            //   envelope_size bytes, there is always sufficient room.
3676            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3677                self.key_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3678                encoder,
3679                offset + cur_offset,
3680                depth,
3681            )?;
3682
3683            _prev_end_offset = cur_offset + envelope_size;
3684            if 3 > max_ordinal {
3685                return Ok(());
3686            }
3687
3688            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3689            // are envelope_size bytes.
3690            let cur_offset: usize = (3 - 1) * envelope_size;
3691
3692            // Zero reserved fields.
3693            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3694
3695            // Safety:
3696            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3697            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3698            //   envelope_size bytes, there is always sufficient room.
3699            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 32>, D>(
3700                self.nonce.as_ref().map(
3701                    <fidl::encoding::Array<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
3702                ),
3703                encoder,
3704                offset + cur_offset,
3705                depth,
3706            )?;
3707
3708            _prev_end_offset = cur_offset + envelope_size;
3709            if 4 > max_ordinal {
3710                return Ok(());
3711            }
3712
3713            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3714            // are envelope_size bytes.
3715            let cur_offset: usize = (4 - 1) * envelope_size;
3716
3717            // Zero reserved fields.
3718            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3719
3720            // Safety:
3721            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3722            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3723            //   envelope_size bytes, there is always sufficient room.
3724            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 65536>, D>(
3725                self.response.as_ref().map(
3726                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow,
3727                ),
3728                encoder,
3729                offset + cur_offset,
3730                depth,
3731            )?;
3732
3733            _prev_end_offset = cur_offset + envelope_size;
3734            if 5 > max_ordinal {
3735                return Ok(());
3736            }
3737
3738            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3739            // are envelope_size bytes.
3740            let cur_offset: usize = (5 - 1) * envelope_size;
3741
3742            // Zero reserved fields.
3743            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3744
3745            // Safety:
3746            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3747            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3748            //   envelope_size bytes, there is always sufficient room.
3749            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 72>, D>(
3750                self.signature.as_ref().map(
3751                    <fidl::encoding::Vector<u8, 72> as fidl::encoding::ValueTypeMarker>::borrow,
3752                ),
3753                encoder,
3754                offset + cur_offset,
3755                depth,
3756            )?;
3757
3758            _prev_end_offset = cur_offset + envelope_size;
3759
3760            Ok(())
3761        }
3762    }
3763
3764    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CupData {
3765        #[inline(always)]
3766        fn new_empty() -> Self {
3767            Self::default()
3768        }
3769
3770        unsafe fn decode(
3771            &mut self,
3772            decoder: &mut fidl::encoding::Decoder<'_, D>,
3773            offset: usize,
3774            mut depth: fidl::encoding::Depth,
3775        ) -> fidl::Result<()> {
3776            decoder.debug_check_bounds::<Self>(offset);
3777            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3778                None => return Err(fidl::Error::NotNullable),
3779                Some(len) => len,
3780            };
3781            // Calling decoder.out_of_line_offset(0) is not allowed.
3782            if len == 0 {
3783                return Ok(());
3784            };
3785            depth.increment()?;
3786            let envelope_size = 8;
3787            let bytes_len = len * envelope_size;
3788            let offset = decoder.out_of_line_offset(bytes_len)?;
3789            // Decode the envelope for each type.
3790            let mut _next_ordinal_to_read = 0;
3791            let mut next_offset = offset;
3792            let end_offset = offset + bytes_len;
3793            _next_ordinal_to_read += 1;
3794            if next_offset >= end_offset {
3795                return Ok(());
3796            }
3797
3798            // Decode unknown envelopes for gaps in ordinals.
3799            while _next_ordinal_to_read < 1 {
3800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3801                _next_ordinal_to_read += 1;
3802                next_offset += envelope_size;
3803            }
3804
3805            let next_out_of_line = decoder.next_out_of_line();
3806            let handles_before = decoder.remaining_handles();
3807            if let Some((inlined, num_bytes, num_handles)) =
3808                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3809            {
3810                let member_inline_size =
3811                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::TypeMarker>::inline_size(
3812                        decoder.context,
3813                    );
3814                if inlined != (member_inline_size <= 4) {
3815                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3816                }
3817                let inner_offset;
3818                let mut inner_depth = depth.clone();
3819                if inlined {
3820                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3821                    inner_offset = next_offset;
3822                } else {
3823                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3824                    inner_depth.increment()?;
3825                }
3826                let val_ref = self
3827                    .request
3828                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D));
3829                fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, val_ref, decoder, inner_offset, inner_depth)?;
3830                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3831                {
3832                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3833                }
3834                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3835                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3836                }
3837            }
3838
3839            next_offset += envelope_size;
3840            _next_ordinal_to_read += 1;
3841            if next_offset >= end_offset {
3842                return Ok(());
3843            }
3844
3845            // Decode unknown envelopes for gaps in ordinals.
3846            while _next_ordinal_to_read < 2 {
3847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3848                _next_ordinal_to_read += 1;
3849                next_offset += envelope_size;
3850            }
3851
3852            let next_out_of_line = decoder.next_out_of_line();
3853            let handles_before = decoder.remaining_handles();
3854            if let Some((inlined, num_bytes, num_handles)) =
3855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3856            {
3857                let member_inline_size =
3858                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3859                if inlined != (member_inline_size <= 4) {
3860                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3861                }
3862                let inner_offset;
3863                let mut inner_depth = depth.clone();
3864                if inlined {
3865                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3866                    inner_offset = next_offset;
3867                } else {
3868                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3869                    inner_depth.increment()?;
3870                }
3871                let val_ref = self.key_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
3872                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3873                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3874                {
3875                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3876                }
3877                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3878                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3879                }
3880            }
3881
3882            next_offset += envelope_size;
3883            _next_ordinal_to_read += 1;
3884            if next_offset >= end_offset {
3885                return Ok(());
3886            }
3887
3888            // Decode unknown envelopes for gaps in ordinals.
3889            while _next_ordinal_to_read < 3 {
3890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3891                _next_ordinal_to_read += 1;
3892                next_offset += envelope_size;
3893            }
3894
3895            let next_out_of_line = decoder.next_out_of_line();
3896            let handles_before = decoder.remaining_handles();
3897            if let Some((inlined, num_bytes, num_handles)) =
3898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3899            {
3900                let member_inline_size =
3901                    <fidl::encoding::Array<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
3902                        decoder.context,
3903                    );
3904                if inlined != (member_inline_size <= 4) {
3905                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3906                }
3907                let inner_offset;
3908                let mut inner_depth = depth.clone();
3909                if inlined {
3910                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3911                    inner_offset = next_offset;
3912                } else {
3913                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3914                    inner_depth.increment()?;
3915                }
3916                let val_ref = self
3917                    .nonce
3918                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 32>, D));
3919                fidl::decode!(fidl::encoding::Array<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
3920                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3921                {
3922                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3923                }
3924                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3925                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3926                }
3927            }
3928
3929            next_offset += envelope_size;
3930            _next_ordinal_to_read += 1;
3931            if next_offset >= end_offset {
3932                return Ok(());
3933            }
3934
3935            // Decode unknown envelopes for gaps in ordinals.
3936            while _next_ordinal_to_read < 4 {
3937                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3938                _next_ordinal_to_read += 1;
3939                next_offset += envelope_size;
3940            }
3941
3942            let next_out_of_line = decoder.next_out_of_line();
3943            let handles_before = decoder.remaining_handles();
3944            if let Some((inlined, num_bytes, num_handles)) =
3945                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3946            {
3947                let member_inline_size =
3948                    <fidl::encoding::Vector<u8, 65536> as fidl::encoding::TypeMarker>::inline_size(
3949                        decoder.context,
3950                    );
3951                if inlined != (member_inline_size <= 4) {
3952                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3953                }
3954                let inner_offset;
3955                let mut inner_depth = depth.clone();
3956                if inlined {
3957                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3958                    inner_offset = next_offset;
3959                } else {
3960                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3961                    inner_depth.increment()?;
3962                }
3963                let val_ref = self
3964                    .response
3965                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D));
3966                fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, val_ref, decoder, inner_offset, inner_depth)?;
3967                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3968                {
3969                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3970                }
3971                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3972                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3973                }
3974            }
3975
3976            next_offset += envelope_size;
3977            _next_ordinal_to_read += 1;
3978            if next_offset >= end_offset {
3979                return Ok(());
3980            }
3981
3982            // Decode unknown envelopes for gaps in ordinals.
3983            while _next_ordinal_to_read < 5 {
3984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3985                _next_ordinal_to_read += 1;
3986                next_offset += envelope_size;
3987            }
3988
3989            let next_out_of_line = decoder.next_out_of_line();
3990            let handles_before = decoder.remaining_handles();
3991            if let Some((inlined, num_bytes, num_handles)) =
3992                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3993            {
3994                let member_inline_size =
3995                    <fidl::encoding::Vector<u8, 72> as fidl::encoding::TypeMarker>::inline_size(
3996                        decoder.context,
3997                    );
3998                if inlined != (member_inline_size <= 4) {
3999                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4000                }
4001                let inner_offset;
4002                let mut inner_depth = depth.clone();
4003                if inlined {
4004                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4005                    inner_offset = next_offset;
4006                } else {
4007                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4008                    inner_depth.increment()?;
4009                }
4010                let val_ref = self
4011                    .signature
4012                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 72>, D));
4013                fidl::decode!(fidl::encoding::Vector<u8, 72>, D, val_ref, decoder, inner_offset, inner_depth)?;
4014                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4015                {
4016                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4017                }
4018                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4019                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4020                }
4021            }
4022
4023            next_offset += envelope_size;
4024
4025            // Decode the remaining unknown envelopes.
4026            while next_offset < end_offset {
4027                _next_ordinal_to_read += 1;
4028                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4029                next_offset += envelope_size;
4030            }
4031
4032            Ok(())
4033        }
4034    }
4035
4036    impl MirrorConfig {
4037        #[inline(always)]
4038        fn max_ordinal_present(&self) -> u64 {
4039            if let Some(_) = self.blob_mirror_url {
4040                return 4;
4041            }
4042            if let Some(_) = self.subscribe {
4043                return 2;
4044            }
4045            if let Some(_) = self.mirror_url {
4046                return 1;
4047            }
4048            0
4049        }
4050    }
4051
4052    impl fidl::encoding::ValueTypeMarker for MirrorConfig {
4053        type Borrowed<'a> = &'a Self;
4054        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4055            value
4056        }
4057    }
4058
4059    unsafe impl fidl::encoding::TypeMarker for MirrorConfig {
4060        type Owned = Self;
4061
4062        #[inline(always)]
4063        fn inline_align(_context: fidl::encoding::Context) -> usize {
4064            8
4065        }
4066
4067        #[inline(always)]
4068        fn inline_size(_context: fidl::encoding::Context) -> usize {
4069            16
4070        }
4071    }
4072
4073    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MirrorConfig, D>
4074        for &MirrorConfig
4075    {
4076        unsafe fn encode(
4077            self,
4078            encoder: &mut fidl::encoding::Encoder<'_, D>,
4079            offset: usize,
4080            mut depth: fidl::encoding::Depth,
4081        ) -> fidl::Result<()> {
4082            encoder.debug_check_bounds::<MirrorConfig>(offset);
4083            // Vector header
4084            let max_ordinal: u64 = self.max_ordinal_present();
4085            encoder.write_num(max_ordinal, offset);
4086            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4087            // Calling encoder.out_of_line_offset(0) is not allowed.
4088            if max_ordinal == 0 {
4089                return Ok(());
4090            }
4091            depth.increment()?;
4092            let envelope_size = 8;
4093            let bytes_len = max_ordinal as usize * envelope_size;
4094            #[allow(unused_variables)]
4095            let offset = encoder.out_of_line_offset(bytes_len);
4096            let mut _prev_end_offset: usize = 0;
4097            if 1 > max_ordinal {
4098                return Ok(());
4099            }
4100
4101            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4102            // are envelope_size bytes.
4103            let cur_offset: usize = (1 - 1) * envelope_size;
4104
4105            // Zero reserved fields.
4106            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4107
4108            // Safety:
4109            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4110            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4111            //   envelope_size bytes, there is always sufficient room.
4112            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4113                self.mirror_url.as_ref().map(
4114                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4115                ),
4116                encoder,
4117                offset + cur_offset,
4118                depth,
4119            )?;
4120
4121            _prev_end_offset = cur_offset + envelope_size;
4122            if 2 > max_ordinal {
4123                return Ok(());
4124            }
4125
4126            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4127            // are envelope_size bytes.
4128            let cur_offset: usize = (2 - 1) * envelope_size;
4129
4130            // Zero reserved fields.
4131            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4132
4133            // Safety:
4134            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4135            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4136            //   envelope_size bytes, there is always sufficient room.
4137            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4138                self.subscribe.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4139                encoder,
4140                offset + cur_offset,
4141                depth,
4142            )?;
4143
4144            _prev_end_offset = cur_offset + envelope_size;
4145            if 4 > max_ordinal {
4146                return Ok(());
4147            }
4148
4149            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4150            // are envelope_size bytes.
4151            let cur_offset: usize = (4 - 1) * envelope_size;
4152
4153            // Zero reserved fields.
4154            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4155
4156            // Safety:
4157            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4158            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4159            //   envelope_size bytes, there is always sufficient room.
4160            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4161                self.blob_mirror_url.as_ref().map(
4162                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4163                ),
4164                encoder,
4165                offset + cur_offset,
4166                depth,
4167            )?;
4168
4169            _prev_end_offset = cur_offset + envelope_size;
4170
4171            Ok(())
4172        }
4173    }
4174
4175    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MirrorConfig {
4176        #[inline(always)]
4177        fn new_empty() -> Self {
4178            Self::default()
4179        }
4180
4181        unsafe fn decode(
4182            &mut self,
4183            decoder: &mut fidl::encoding::Decoder<'_, D>,
4184            offset: usize,
4185            mut depth: fidl::encoding::Depth,
4186        ) -> fidl::Result<()> {
4187            decoder.debug_check_bounds::<Self>(offset);
4188            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4189                None => return Err(fidl::Error::NotNullable),
4190                Some(len) => len,
4191            };
4192            // Calling decoder.out_of_line_offset(0) is not allowed.
4193            if len == 0 {
4194                return Ok(());
4195            };
4196            depth.increment()?;
4197            let envelope_size = 8;
4198            let bytes_len = len * envelope_size;
4199            let offset = decoder.out_of_line_offset(bytes_len)?;
4200            // Decode the envelope for each type.
4201            let mut _next_ordinal_to_read = 0;
4202            let mut next_offset = offset;
4203            let end_offset = offset + bytes_len;
4204            _next_ordinal_to_read += 1;
4205            if next_offset >= end_offset {
4206                return Ok(());
4207            }
4208
4209            // Decode unknown envelopes for gaps in ordinals.
4210            while _next_ordinal_to_read < 1 {
4211                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4212                _next_ordinal_to_read += 1;
4213                next_offset += envelope_size;
4214            }
4215
4216            let next_out_of_line = decoder.next_out_of_line();
4217            let handles_before = decoder.remaining_handles();
4218            if let Some((inlined, num_bytes, num_handles)) =
4219                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4220            {
4221                let member_inline_size =
4222                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4223                        decoder.context,
4224                    );
4225                if inlined != (member_inline_size <= 4) {
4226                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4227                }
4228                let inner_offset;
4229                let mut inner_depth = depth.clone();
4230                if inlined {
4231                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4232                    inner_offset = next_offset;
4233                } else {
4234                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4235                    inner_depth.increment()?;
4236                }
4237                let val_ref = self
4238                    .mirror_url
4239                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4240                fidl::decode!(
4241                    fidl::encoding::UnboundedString,
4242                    D,
4243                    val_ref,
4244                    decoder,
4245                    inner_offset,
4246                    inner_depth
4247                )?;
4248                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4249                {
4250                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4251                }
4252                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4253                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4254                }
4255            }
4256
4257            next_offset += envelope_size;
4258            _next_ordinal_to_read += 1;
4259            if next_offset >= end_offset {
4260                return Ok(());
4261            }
4262
4263            // Decode unknown envelopes for gaps in ordinals.
4264            while _next_ordinal_to_read < 2 {
4265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4266                _next_ordinal_to_read += 1;
4267                next_offset += envelope_size;
4268            }
4269
4270            let next_out_of_line = decoder.next_out_of_line();
4271            let handles_before = decoder.remaining_handles();
4272            if let Some((inlined, num_bytes, num_handles)) =
4273                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4274            {
4275                let member_inline_size =
4276                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4277                if inlined != (member_inline_size <= 4) {
4278                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4279                }
4280                let inner_offset;
4281                let mut inner_depth = depth.clone();
4282                if inlined {
4283                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4284                    inner_offset = next_offset;
4285                } else {
4286                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4287                    inner_depth.increment()?;
4288                }
4289                let val_ref = self.subscribe.get_or_insert_with(|| fidl::new_empty!(bool, D));
4290                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4291                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4292                {
4293                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4294                }
4295                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4296                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4297                }
4298            }
4299
4300            next_offset += envelope_size;
4301            _next_ordinal_to_read += 1;
4302            if next_offset >= end_offset {
4303                return Ok(());
4304            }
4305
4306            // Decode unknown envelopes for gaps in ordinals.
4307            while _next_ordinal_to_read < 4 {
4308                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4309                _next_ordinal_to_read += 1;
4310                next_offset += envelope_size;
4311            }
4312
4313            let next_out_of_line = decoder.next_out_of_line();
4314            let handles_before = decoder.remaining_handles();
4315            if let Some((inlined, num_bytes, num_handles)) =
4316                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4317            {
4318                let member_inline_size =
4319                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4320                        decoder.context,
4321                    );
4322                if inlined != (member_inline_size <= 4) {
4323                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4324                }
4325                let inner_offset;
4326                let mut inner_depth = depth.clone();
4327                if inlined {
4328                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4329                    inner_offset = next_offset;
4330                } else {
4331                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4332                    inner_depth.increment()?;
4333                }
4334                let val_ref = self
4335                    .blob_mirror_url
4336                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4337                fidl::decode!(
4338                    fidl::encoding::UnboundedString,
4339                    D,
4340                    val_ref,
4341                    decoder,
4342                    inner_offset,
4343                    inner_depth
4344                )?;
4345                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4346                {
4347                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4348                }
4349                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4350                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4351                }
4352            }
4353
4354            next_offset += envelope_size;
4355
4356            // Decode the remaining unknown envelopes.
4357            while next_offset < end_offset {
4358                _next_ordinal_to_read += 1;
4359                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4360                next_offset += envelope_size;
4361            }
4362
4363            Ok(())
4364        }
4365    }
4366
4367    impl RepositoryConfig {
4368        #[inline(always)]
4369        fn max_ordinal_present(&self) -> u64 {
4370            if let Some(_) = self.storage_type {
4371                return 8;
4372            }
4373            if let Some(_) = self.use_local_mirror {
4374                return 7;
4375            }
4376            if let Some(_) = self.root_threshold {
4377                return 6;
4378            }
4379            if let Some(_) = self.root_version {
4380                return 5;
4381            }
4382            if let Some(_) = self.mirrors {
4383                return 3;
4384            }
4385            if let Some(_) = self.root_keys {
4386                return 2;
4387            }
4388            if let Some(_) = self.repo_url {
4389                return 1;
4390            }
4391            0
4392        }
4393    }
4394
4395    impl fidl::encoding::ValueTypeMarker for RepositoryConfig {
4396        type Borrowed<'a> = &'a Self;
4397        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4398            value
4399        }
4400    }
4401
4402    unsafe impl fidl::encoding::TypeMarker for RepositoryConfig {
4403        type Owned = Self;
4404
4405        #[inline(always)]
4406        fn inline_align(_context: fidl::encoding::Context) -> usize {
4407            8
4408        }
4409
4410        #[inline(always)]
4411        fn inline_size(_context: fidl::encoding::Context) -> usize {
4412            16
4413        }
4414    }
4415
4416    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryConfig, D>
4417        for &RepositoryConfig
4418    {
4419        unsafe fn encode(
4420            self,
4421            encoder: &mut fidl::encoding::Encoder<'_, D>,
4422            offset: usize,
4423            mut depth: fidl::encoding::Depth,
4424        ) -> fidl::Result<()> {
4425            encoder.debug_check_bounds::<RepositoryConfig>(offset);
4426            // Vector header
4427            let max_ordinal: u64 = self.max_ordinal_present();
4428            encoder.write_num(max_ordinal, offset);
4429            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4430            // Calling encoder.out_of_line_offset(0) is not allowed.
4431            if max_ordinal == 0 {
4432                return Ok(());
4433            }
4434            depth.increment()?;
4435            let envelope_size = 8;
4436            let bytes_len = max_ordinal as usize * envelope_size;
4437            #[allow(unused_variables)]
4438            let offset = encoder.out_of_line_offset(bytes_len);
4439            let mut _prev_end_offset: usize = 0;
4440            if 1 > max_ordinal {
4441                return Ok(());
4442            }
4443
4444            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4445            // are envelope_size bytes.
4446            let cur_offset: usize = (1 - 1) * envelope_size;
4447
4448            // Zero reserved fields.
4449            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4450
4451            // Safety:
4452            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4453            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4454            //   envelope_size bytes, there is always sufficient room.
4455            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
4456                self.repo_url.as_ref().map(
4457                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
4458                ),
4459                encoder,
4460                offset + cur_offset,
4461                depth,
4462            )?;
4463
4464            _prev_end_offset = cur_offset + envelope_size;
4465            if 2 > max_ordinal {
4466                return Ok(());
4467            }
4468
4469            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4470            // are envelope_size bytes.
4471            let cur_offset: usize = (2 - 1) * envelope_size;
4472
4473            // Zero reserved fields.
4474            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4475
4476            // Safety:
4477            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4478            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4479            //   envelope_size bytes, there is always sufficient room.
4480            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<RepositoryKeyConfig>, D>(
4481            self.root_keys.as_ref().map(<fidl::encoding::UnboundedVector<RepositoryKeyConfig> as fidl::encoding::ValueTypeMarker>::borrow),
4482            encoder, offset + cur_offset, depth
4483        )?;
4484
4485            _prev_end_offset = cur_offset + envelope_size;
4486            if 3 > max_ordinal {
4487                return Ok(());
4488            }
4489
4490            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4491            // are envelope_size bytes.
4492            let cur_offset: usize = (3 - 1) * envelope_size;
4493
4494            // Zero reserved fields.
4495            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4496
4497            // Safety:
4498            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4499            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4500            //   envelope_size bytes, there is always sufficient room.
4501            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<MirrorConfig>, D>(
4502            self.mirrors.as_ref().map(<fidl::encoding::UnboundedVector<MirrorConfig> as fidl::encoding::ValueTypeMarker>::borrow),
4503            encoder, offset + cur_offset, depth
4504        )?;
4505
4506            _prev_end_offset = cur_offset + envelope_size;
4507            if 5 > max_ordinal {
4508                return Ok(());
4509            }
4510
4511            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4512            // are envelope_size bytes.
4513            let cur_offset: usize = (5 - 1) * envelope_size;
4514
4515            // Zero reserved fields.
4516            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4517
4518            // Safety:
4519            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4520            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4521            //   envelope_size bytes, there is always sufficient room.
4522            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4523                self.root_version.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4524                encoder,
4525                offset + cur_offset,
4526                depth,
4527            )?;
4528
4529            _prev_end_offset = cur_offset + envelope_size;
4530            if 6 > max_ordinal {
4531                return Ok(());
4532            }
4533
4534            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4535            // are envelope_size bytes.
4536            let cur_offset: usize = (6 - 1) * envelope_size;
4537
4538            // Zero reserved fields.
4539            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4540
4541            // Safety:
4542            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4543            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4544            //   envelope_size bytes, there is always sufficient room.
4545            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4546                self.root_threshold.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4547                encoder,
4548                offset + cur_offset,
4549                depth,
4550            )?;
4551
4552            _prev_end_offset = cur_offset + envelope_size;
4553            if 7 > max_ordinal {
4554                return Ok(());
4555            }
4556
4557            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4558            // are envelope_size bytes.
4559            let cur_offset: usize = (7 - 1) * envelope_size;
4560
4561            // Zero reserved fields.
4562            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4563
4564            // Safety:
4565            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4566            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4567            //   envelope_size bytes, there is always sufficient room.
4568            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4569                self.use_local_mirror
4570                    .as_ref()
4571                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4572                encoder,
4573                offset + cur_offset,
4574                depth,
4575            )?;
4576
4577            _prev_end_offset = cur_offset + envelope_size;
4578            if 8 > max_ordinal {
4579                return Ok(());
4580            }
4581
4582            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4583            // are envelope_size bytes.
4584            let cur_offset: usize = (8 - 1) * envelope_size;
4585
4586            // Zero reserved fields.
4587            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4588
4589            // Safety:
4590            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4591            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4592            //   envelope_size bytes, there is always sufficient room.
4593            fidl::encoding::encode_in_envelope_optional::<RepositoryStorageType, D>(
4594                self.storage_type
4595                    .as_ref()
4596                    .map(<RepositoryStorageType as fidl::encoding::ValueTypeMarker>::borrow),
4597                encoder,
4598                offset + cur_offset,
4599                depth,
4600            )?;
4601
4602            _prev_end_offset = cur_offset + envelope_size;
4603
4604            Ok(())
4605        }
4606    }
4607
4608    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryConfig {
4609        #[inline(always)]
4610        fn new_empty() -> Self {
4611            Self::default()
4612        }
4613
4614        unsafe fn decode(
4615            &mut self,
4616            decoder: &mut fidl::encoding::Decoder<'_, D>,
4617            offset: usize,
4618            mut depth: fidl::encoding::Depth,
4619        ) -> fidl::Result<()> {
4620            decoder.debug_check_bounds::<Self>(offset);
4621            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4622                None => return Err(fidl::Error::NotNullable),
4623                Some(len) => len,
4624            };
4625            // Calling decoder.out_of_line_offset(0) is not allowed.
4626            if len == 0 {
4627                return Ok(());
4628            };
4629            depth.increment()?;
4630            let envelope_size = 8;
4631            let bytes_len = len * envelope_size;
4632            let offset = decoder.out_of_line_offset(bytes_len)?;
4633            // Decode the envelope for each type.
4634            let mut _next_ordinal_to_read = 0;
4635            let mut next_offset = offset;
4636            let end_offset = offset + bytes_len;
4637            _next_ordinal_to_read += 1;
4638            if next_offset >= end_offset {
4639                return Ok(());
4640            }
4641
4642            // Decode unknown envelopes for gaps in ordinals.
4643            while _next_ordinal_to_read < 1 {
4644                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4645                _next_ordinal_to_read += 1;
4646                next_offset += envelope_size;
4647            }
4648
4649            let next_out_of_line = decoder.next_out_of_line();
4650            let handles_before = decoder.remaining_handles();
4651            if let Some((inlined, num_bytes, num_handles)) =
4652                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4653            {
4654                let member_inline_size =
4655                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
4656                        decoder.context,
4657                    );
4658                if inlined != (member_inline_size <= 4) {
4659                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4660                }
4661                let inner_offset;
4662                let mut inner_depth = depth.clone();
4663                if inlined {
4664                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4665                    inner_offset = next_offset;
4666                } else {
4667                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4668                    inner_depth.increment()?;
4669                }
4670                let val_ref = self
4671                    .repo_url
4672                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
4673                fidl::decode!(
4674                    fidl::encoding::UnboundedString,
4675                    D,
4676                    val_ref,
4677                    decoder,
4678                    inner_offset,
4679                    inner_depth
4680                )?;
4681                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4682                {
4683                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4684                }
4685                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4686                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4687                }
4688            }
4689
4690            next_offset += envelope_size;
4691            _next_ordinal_to_read += 1;
4692            if next_offset >= end_offset {
4693                return Ok(());
4694            }
4695
4696            // Decode unknown envelopes for gaps in ordinals.
4697            while _next_ordinal_to_read < 2 {
4698                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4699                _next_ordinal_to_read += 1;
4700                next_offset += envelope_size;
4701            }
4702
4703            let next_out_of_line = decoder.next_out_of_line();
4704            let handles_before = decoder.remaining_handles();
4705            if let Some((inlined, num_bytes, num_handles)) =
4706                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4707            {
4708                let member_inline_size = <fidl::encoding::UnboundedVector<RepositoryKeyConfig> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4709                if inlined != (member_inline_size <= 4) {
4710                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4711                }
4712                let inner_offset;
4713                let mut inner_depth = depth.clone();
4714                if inlined {
4715                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4716                    inner_offset = next_offset;
4717                } else {
4718                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4719                    inner_depth.increment()?;
4720                }
4721                let val_ref = self.root_keys.get_or_insert_with(|| {
4722                    fidl::new_empty!(fidl::encoding::UnboundedVector<RepositoryKeyConfig>, D)
4723                });
4724                fidl::decode!(
4725                    fidl::encoding::UnboundedVector<RepositoryKeyConfig>,
4726                    D,
4727                    val_ref,
4728                    decoder,
4729                    inner_offset,
4730                    inner_depth
4731                )?;
4732                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4733                {
4734                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4735                }
4736                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4737                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4738                }
4739            }
4740
4741            next_offset += envelope_size;
4742            _next_ordinal_to_read += 1;
4743            if next_offset >= end_offset {
4744                return Ok(());
4745            }
4746
4747            // Decode unknown envelopes for gaps in ordinals.
4748            while _next_ordinal_to_read < 3 {
4749                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4750                _next_ordinal_to_read += 1;
4751                next_offset += envelope_size;
4752            }
4753
4754            let next_out_of_line = decoder.next_out_of_line();
4755            let handles_before = decoder.remaining_handles();
4756            if let Some((inlined, num_bytes, num_handles)) =
4757                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4758            {
4759                let member_inline_size = <fidl::encoding::UnboundedVector<MirrorConfig> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4760                if inlined != (member_inline_size <= 4) {
4761                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4762                }
4763                let inner_offset;
4764                let mut inner_depth = depth.clone();
4765                if inlined {
4766                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4767                    inner_offset = next_offset;
4768                } else {
4769                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4770                    inner_depth.increment()?;
4771                }
4772                let val_ref = self.mirrors.get_or_insert_with(|| {
4773                    fidl::new_empty!(fidl::encoding::UnboundedVector<MirrorConfig>, D)
4774                });
4775                fidl::decode!(
4776                    fidl::encoding::UnboundedVector<MirrorConfig>,
4777                    D,
4778                    val_ref,
4779                    decoder,
4780                    inner_offset,
4781                    inner_depth
4782                )?;
4783                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4784                {
4785                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4786                }
4787                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4788                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4789                }
4790            }
4791
4792            next_offset += envelope_size;
4793            _next_ordinal_to_read += 1;
4794            if next_offset >= end_offset {
4795                return Ok(());
4796            }
4797
4798            // Decode unknown envelopes for gaps in ordinals.
4799            while _next_ordinal_to_read < 5 {
4800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4801                _next_ordinal_to_read += 1;
4802                next_offset += envelope_size;
4803            }
4804
4805            let next_out_of_line = decoder.next_out_of_line();
4806            let handles_before = decoder.remaining_handles();
4807            if let Some((inlined, num_bytes, num_handles)) =
4808                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4809            {
4810                let member_inline_size =
4811                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4812                if inlined != (member_inline_size <= 4) {
4813                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4814                }
4815                let inner_offset;
4816                let mut inner_depth = depth.clone();
4817                if inlined {
4818                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4819                    inner_offset = next_offset;
4820                } else {
4821                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4822                    inner_depth.increment()?;
4823                }
4824                let val_ref = self.root_version.get_or_insert_with(|| fidl::new_empty!(u32, D));
4825                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4826                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4827                {
4828                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4829                }
4830                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4831                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4832                }
4833            }
4834
4835            next_offset += envelope_size;
4836            _next_ordinal_to_read += 1;
4837            if next_offset >= end_offset {
4838                return Ok(());
4839            }
4840
4841            // Decode unknown envelopes for gaps in ordinals.
4842            while _next_ordinal_to_read < 6 {
4843                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4844                _next_ordinal_to_read += 1;
4845                next_offset += envelope_size;
4846            }
4847
4848            let next_out_of_line = decoder.next_out_of_line();
4849            let handles_before = decoder.remaining_handles();
4850            if let Some((inlined, num_bytes, num_handles)) =
4851                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4852            {
4853                let member_inline_size =
4854                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4855                if inlined != (member_inline_size <= 4) {
4856                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4857                }
4858                let inner_offset;
4859                let mut inner_depth = depth.clone();
4860                if inlined {
4861                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4862                    inner_offset = next_offset;
4863                } else {
4864                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4865                    inner_depth.increment()?;
4866                }
4867                let val_ref = self.root_threshold.get_or_insert_with(|| fidl::new_empty!(u32, D));
4868                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4869                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4870                {
4871                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4872                }
4873                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4874                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4875                }
4876            }
4877
4878            next_offset += envelope_size;
4879            _next_ordinal_to_read += 1;
4880            if next_offset >= end_offset {
4881                return Ok(());
4882            }
4883
4884            // Decode unknown envelopes for gaps in ordinals.
4885            while _next_ordinal_to_read < 7 {
4886                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4887                _next_ordinal_to_read += 1;
4888                next_offset += envelope_size;
4889            }
4890
4891            let next_out_of_line = decoder.next_out_of_line();
4892            let handles_before = decoder.remaining_handles();
4893            if let Some((inlined, num_bytes, num_handles)) =
4894                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4895            {
4896                let member_inline_size =
4897                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4898                if inlined != (member_inline_size <= 4) {
4899                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4900                }
4901                let inner_offset;
4902                let mut inner_depth = depth.clone();
4903                if inlined {
4904                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4905                    inner_offset = next_offset;
4906                } else {
4907                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4908                    inner_depth.increment()?;
4909                }
4910                let val_ref =
4911                    self.use_local_mirror.get_or_insert_with(|| fidl::new_empty!(bool, D));
4912                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4913                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4914                {
4915                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4916                }
4917                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4918                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4919                }
4920            }
4921
4922            next_offset += envelope_size;
4923            _next_ordinal_to_read += 1;
4924            if next_offset >= end_offset {
4925                return Ok(());
4926            }
4927
4928            // Decode unknown envelopes for gaps in ordinals.
4929            while _next_ordinal_to_read < 8 {
4930                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4931                _next_ordinal_to_read += 1;
4932                next_offset += envelope_size;
4933            }
4934
4935            let next_out_of_line = decoder.next_out_of_line();
4936            let handles_before = decoder.remaining_handles();
4937            if let Some((inlined, num_bytes, num_handles)) =
4938                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4939            {
4940                let member_inline_size =
4941                    <RepositoryStorageType as fidl::encoding::TypeMarker>::inline_size(
4942                        decoder.context,
4943                    );
4944                if inlined != (member_inline_size <= 4) {
4945                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4946                }
4947                let inner_offset;
4948                let mut inner_depth = depth.clone();
4949                if inlined {
4950                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4951                    inner_offset = next_offset;
4952                } else {
4953                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4954                    inner_depth.increment()?;
4955                }
4956                let val_ref = self
4957                    .storage_type
4958                    .get_or_insert_with(|| fidl::new_empty!(RepositoryStorageType, D));
4959                fidl::decode!(
4960                    RepositoryStorageType,
4961                    D,
4962                    val_ref,
4963                    decoder,
4964                    inner_offset,
4965                    inner_depth
4966                )?;
4967                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4968                {
4969                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4970                }
4971                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4972                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4973                }
4974            }
4975
4976            next_offset += envelope_size;
4977
4978            // Decode the remaining unknown envelopes.
4979            while next_offset < end_offset {
4980                _next_ordinal_to_read += 1;
4981                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4982                next_offset += envelope_size;
4983            }
4984
4985            Ok(())
4986        }
4987    }
4988
4989    impl fidl::encoding::ValueTypeMarker for RepositoryKeyConfig {
4990        type Borrowed<'a> = &'a Self;
4991        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4992            value
4993        }
4994    }
4995
4996    unsafe impl fidl::encoding::TypeMarker for RepositoryKeyConfig {
4997        type Owned = Self;
4998
4999        #[inline(always)]
5000        fn inline_align(_context: fidl::encoding::Context) -> usize {
5001            8
5002        }
5003
5004        #[inline(always)]
5005        fn inline_size(_context: fidl::encoding::Context) -> usize {
5006            16
5007        }
5008    }
5009
5010    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RepositoryKeyConfig, D>
5011        for &RepositoryKeyConfig
5012    {
5013        #[inline]
5014        unsafe fn encode(
5015            self,
5016            encoder: &mut fidl::encoding::Encoder<'_, D>,
5017            offset: usize,
5018            _depth: fidl::encoding::Depth,
5019        ) -> fidl::Result<()> {
5020            encoder.debug_check_bounds::<RepositoryKeyConfig>(offset);
5021            encoder.write_num::<u64>(self.ordinal(), offset);
5022            match self {
5023            RepositoryKeyConfig::Ed25519Key(ref val) => {
5024                fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
5025                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
5026                    encoder, offset + 8, _depth
5027                )
5028            }
5029            RepositoryKeyConfig::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5030        }
5031        }
5032    }
5033
5034    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepositoryKeyConfig {
5035        #[inline(always)]
5036        fn new_empty() -> Self {
5037            Self::__SourceBreaking { unknown_ordinal: 0 }
5038        }
5039
5040        #[inline]
5041        unsafe fn decode(
5042            &mut self,
5043            decoder: &mut fidl::encoding::Decoder<'_, D>,
5044            offset: usize,
5045            mut depth: fidl::encoding::Depth,
5046        ) -> fidl::Result<()> {
5047            decoder.debug_check_bounds::<Self>(offset);
5048            #[allow(unused_variables)]
5049            let next_out_of_line = decoder.next_out_of_line();
5050            let handles_before = decoder.remaining_handles();
5051            let (ordinal, inlined, num_bytes, num_handles) =
5052                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5053
5054            let member_inline_size = match ordinal {
5055                1 => {
5056                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
5057                        decoder.context,
5058                    )
5059                }
5060                0 => return Err(fidl::Error::UnknownUnionTag),
5061                _ => num_bytes as usize,
5062            };
5063
5064            if inlined != (member_inline_size <= 4) {
5065                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5066            }
5067            let _inner_offset;
5068            if inlined {
5069                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5070                _inner_offset = offset + 8;
5071            } else {
5072                depth.increment()?;
5073                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5074            }
5075            match ordinal {
5076                1 => {
5077                    #[allow(irrefutable_let_patterns)]
5078                    if let RepositoryKeyConfig::Ed25519Key(_) = self {
5079                        // Do nothing, read the value into the object
5080                    } else {
5081                        // Initialize `self` to the right variant
5082                        *self = RepositoryKeyConfig::Ed25519Key(fidl::new_empty!(
5083                            fidl::encoding::UnboundedVector<u8>,
5084                            D
5085                        ));
5086                    }
5087                    #[allow(irrefutable_let_patterns)]
5088                    if let RepositoryKeyConfig::Ed25519Key(ref mut val) = self {
5089                        fidl::decode!(
5090                            fidl::encoding::UnboundedVector<u8>,
5091                            D,
5092                            val,
5093                            decoder,
5094                            _inner_offset,
5095                            depth
5096                        )?;
5097                    } else {
5098                        unreachable!()
5099                    }
5100                }
5101                #[allow(deprecated)]
5102                ordinal => {
5103                    for _ in 0..num_handles {
5104                        decoder.drop_next_handle()?;
5105                    }
5106                    *self = RepositoryKeyConfig::__SourceBreaking { unknown_ordinal: ordinal };
5107                }
5108            }
5109            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5110                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5111            }
5112            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5113                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5114            }
5115            Ok(())
5116        }
5117    }
5118}