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