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