Skip to main content

fidl_fuchsia_driver_lab_common/
fidl_fuchsia_driver_lab_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
11pub const MAX_ALLOWLIST_RULES: u32 = 256;
12
13pub const MAX_AUDIT_PAGE_ENTRIES: u32 = 64;
14
15pub const MAX_NAME_LENGTH: u32 = 64;
16
17pub const MAX_OPERATION_LENGTH: u32 = 32;
18
19/// Bounds declared by the protocol; runtime target limits may be smaller.
20pub const MAX_RESOURCES: u32 = 64;
21
22pub const MAX_SEQUENCE_ITEMS: u32 = 64;
23
24pub const MAX_SNAPSHOT_ITEMS: u32 = 64;
25
26pub const MAX_STRING_LENGTH: u32 = 128;
27
28pub const MAX_TRANSFER_SIZE: u32 = 8192;
29
30/// Access classes distinguished by policy. A grant for one class never
31/// authorizes another.
32#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
33#[repr(u32)]
34pub enum AccessClass {
35    ReadOnce = 1,
36    Snapshot = 2,
37    Write = 3,
38    Poll = 4,
39    Sequence = 5,
40    Protocol = 6,
41    Interrupt = 7,
42}
43
44impl AccessClass {
45    #[inline]
46    pub fn from_primitive(prim: u32) -> Option<Self> {
47        match prim {
48            1 => Some(Self::ReadOnce),
49            2 => Some(Self::Snapshot),
50            3 => Some(Self::Write),
51            4 => Some(Self::Poll),
52            5 => Some(Self::Sequence),
53            6 => Some(Self::Protocol),
54            7 => Some(Self::Interrupt),
55            _ => None,
56        }
57    }
58
59    #[inline]
60    pub const fn into_primitive(self) -> u32 {
61        self as u32
62    }
63}
64
65#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
66pub enum AuditDecision {
67    Allowed,
68    Denied,
69    #[doc(hidden)]
70    __SourceBreaking {
71        unknown_ordinal: u32,
72    },
73}
74
75/// Pattern that matches an unknown `AuditDecision` member.
76#[macro_export]
77macro_rules! AuditDecisionUnknown {
78    () => {
79        _
80    };
81}
82
83impl AuditDecision {
84    #[inline]
85    pub fn from_primitive(prim: u32) -> Option<Self> {
86        match prim {
87            1 => Some(Self::Allowed),
88            2 => Some(Self::Denied),
89            _ => None,
90        }
91    }
92
93    #[inline]
94    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
95        match prim {
96            1 => Self::Allowed,
97            2 => Self::Denied,
98            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
99        }
100    }
101
102    #[inline]
103    pub fn unknown() -> Self {
104        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
105    }
106
107    #[inline]
108    pub const fn into_primitive(self) -> u32 {
109        match self {
110            Self::Allowed => 1,
111            Self::Denied => 2,
112            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
113        }
114    }
115
116    #[inline]
117    pub fn is_unknown(&self) -> bool {
118        match self {
119            Self::__SourceBreaking { unknown_ordinal: _ } => true,
120            _ => false,
121        }
122    }
123}
124
125#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
126pub enum AuditStatus {
127    Ok,
128    Rejected,
129    BackendFault,
130    #[doc(hidden)]
131    __SourceBreaking {
132        unknown_ordinal: u32,
133    },
134}
135
136/// Pattern that matches an unknown `AuditStatus` member.
137#[macro_export]
138macro_rules! AuditStatusUnknown {
139    () => {
140        _
141    };
142}
143
144impl AuditStatus {
145    #[inline]
146    pub fn from_primitive(prim: u32) -> Option<Self> {
147        match prim {
148            1 => Some(Self::Ok),
149            2 => Some(Self::Rejected),
150            3 => Some(Self::BackendFault),
151            _ => None,
152        }
153    }
154
155    #[inline]
156    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
157        match prim {
158            1 => Self::Ok,
159            2 => Self::Rejected,
160            3 => Self::BackendFault,
161            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
162        }
163    }
164
165    #[inline]
166    pub fn unknown() -> Self {
167        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
168    }
169
170    #[inline]
171    pub const fn into_primitive(self) -> u32 {
172        match self {
173            Self::Ok => 1,
174            Self::Rejected => 2,
175            Self::BackendFault => 3,
176            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
177        }
178    }
179
180    #[inline]
181    pub fn is_unknown(&self) -> bool {
182        match self {
183            Self::__SourceBreaking { unknown_ordinal: _ } => true,
184            _ => false,
185        }
186    }
187}
188
189#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
190pub enum BarrierVariant {
191    Memory,
192    #[doc(hidden)]
193    __SourceBreaking {
194        unknown_ordinal: u32,
195    },
196}
197
198/// Pattern that matches an unknown `BarrierVariant` member.
199#[macro_export]
200macro_rules! BarrierVariantUnknown {
201    () => {
202        _
203    };
204}
205
206impl BarrierVariant {
207    #[inline]
208    pub fn from_primitive(prim: u32) -> Option<Self> {
209        match prim {
210            1 => Some(Self::Memory),
211            _ => None,
212        }
213    }
214
215    #[inline]
216    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
217        match prim {
218            1 => Self::Memory,
219            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
220        }
221    }
222
223    #[inline]
224    pub fn unknown() -> Self {
225        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
226    }
227
228    #[inline]
229    pub const fn into_primitive(self) -> u32 {
230        match self {
231            Self::Memory => 1,
232            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
233        }
234    }
235
236    #[inline]
237    pub fn is_unknown(&self) -> bool {
238        match self {
239            Self::__SourceBreaking { unknown_ordinal: _ } => true,
240            _ => false,
241        }
242    }
243}
244
245#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
246pub enum OpenSessionError {
247    NotAccepting,
248    StaleBootId,
249    StaleProxyGeneration,
250    StaleResourceDigest,
251    StalePolicyDigest,
252    /// The offending rule and reason are recorded in the audit ring.
253    RejectedAllowlist,
254    MutationLeaseHeld,
255    /// The request set a reserved (phase 2) expectation field.
256    UnsupportedExpectation,
257    #[doc(hidden)]
258    __SourceBreaking {
259        unknown_ordinal: u32,
260    },
261}
262
263/// Pattern that matches an unknown `OpenSessionError` member.
264#[macro_export]
265macro_rules! OpenSessionErrorUnknown {
266    () => {
267        _
268    };
269}
270
271impl OpenSessionError {
272    #[inline]
273    pub fn from_primitive(prim: u32) -> Option<Self> {
274        match prim {
275            1 => Some(Self::NotAccepting),
276            2 => Some(Self::StaleBootId),
277            3 => Some(Self::StaleProxyGeneration),
278            4 => Some(Self::StaleResourceDigest),
279            5 => Some(Self::StalePolicyDigest),
280            6 => Some(Self::RejectedAllowlist),
281            7 => Some(Self::MutationLeaseHeld),
282            8 => Some(Self::UnsupportedExpectation),
283            _ => None,
284        }
285    }
286
287    #[inline]
288    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
289        match prim {
290            1 => Self::NotAccepting,
291            2 => Self::StaleBootId,
292            3 => Self::StaleProxyGeneration,
293            4 => Self::StaleResourceDigest,
294            5 => Self::StalePolicyDigest,
295            6 => Self::RejectedAllowlist,
296            7 => Self::MutationLeaseHeld,
297            8 => Self::UnsupportedExpectation,
298            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
299        }
300    }
301
302    #[inline]
303    pub fn unknown() -> Self {
304        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
305    }
306
307    #[inline]
308    pub const fn into_primitive(self) -> u32 {
309        match self {
310            Self::NotAccepting => 1,
311            Self::StaleBootId => 2,
312            Self::StaleProxyGeneration => 3,
313            Self::StaleResourceDigest => 4,
314            Self::StalePolicyDigest => 5,
315            Self::RejectedAllowlist => 6,
316            Self::MutationLeaseHeld => 7,
317            Self::UnsupportedExpectation => 8,
318            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
319        }
320    }
321
322    #[inline]
323    pub fn is_unknown(&self) -> bool {
324        match self {
325            Self::__SourceBreaking { unknown_ordinal: _ } => true,
326            _ => false,
327        }
328    }
329}
330
331/// Machine-readable reason an operation, allowlist rule, or session open
332/// was refused. `BACKEND_FAULT` is an execution failure after policy
333/// allowed the operation; the audit ring records the distinction.
334#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
335pub enum OperationError {
336    UnknownResource,
337    UnsupportedWidth,
338    UnsupportedAccessClass,
339    Misaligned,
340    OffsetOverflow,
341    OutOfLogicalBounds,
342    OutOfMappedBounds,
343    NotPermittedByCeiling,
344    HardDenied,
345    UnknownReadsNotPermitted,
346    NotInAllowlist,
347    LimitExceeded,
348    StaleIdentity,
349    MutationLeaseContention,
350    NotAccepting,
351    BackendFault,
352    /// The request set a field this phase does not implement (for
353    /// example a phase 2 takeover expectation). Fail closed rather than
354    /// silently ignoring the field.
355    UnsupportedExpectation,
356    PreconditionFailed,
357    MissingPrecondition,
358    Timeout,
359    ReadOnlySession,
360    WriteNotPermitted,
361    PollNotPermitted,
362    UnsupportedMethod,
363    TransferTooLarge,
364    #[doc(hidden)]
365    __SourceBreaking {
366        unknown_ordinal: u32,
367    },
368}
369
370/// Pattern that matches an unknown `OperationError` member.
371#[macro_export]
372macro_rules! OperationErrorUnknown {
373    () => {
374        _
375    };
376}
377
378impl OperationError {
379    #[inline]
380    pub fn from_primitive(prim: u32) -> Option<Self> {
381        match prim {
382            1 => Some(Self::UnknownResource),
383            2 => Some(Self::UnsupportedWidth),
384            3 => Some(Self::UnsupportedAccessClass),
385            4 => Some(Self::Misaligned),
386            5 => Some(Self::OffsetOverflow),
387            6 => Some(Self::OutOfLogicalBounds),
388            7 => Some(Self::OutOfMappedBounds),
389            8 => Some(Self::NotPermittedByCeiling),
390            9 => Some(Self::HardDenied),
391            10 => Some(Self::UnknownReadsNotPermitted),
392            11 => Some(Self::NotInAllowlist),
393            12 => Some(Self::LimitExceeded),
394            13 => Some(Self::StaleIdentity),
395            14 => Some(Self::MutationLeaseContention),
396            15 => Some(Self::NotAccepting),
397            16 => Some(Self::BackendFault),
398            17 => Some(Self::UnsupportedExpectation),
399            18 => Some(Self::PreconditionFailed),
400            19 => Some(Self::MissingPrecondition),
401            20 => Some(Self::Timeout),
402            21 => Some(Self::ReadOnlySession),
403            22 => Some(Self::WriteNotPermitted),
404            23 => Some(Self::PollNotPermitted),
405            24 => Some(Self::UnsupportedMethod),
406            25 => Some(Self::TransferTooLarge),
407            _ => None,
408        }
409    }
410
411    #[inline]
412    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
413        match prim {
414            1 => Self::UnknownResource,
415            2 => Self::UnsupportedWidth,
416            3 => Self::UnsupportedAccessClass,
417            4 => Self::Misaligned,
418            5 => Self::OffsetOverflow,
419            6 => Self::OutOfLogicalBounds,
420            7 => Self::OutOfMappedBounds,
421            8 => Self::NotPermittedByCeiling,
422            9 => Self::HardDenied,
423            10 => Self::UnknownReadsNotPermitted,
424            11 => Self::NotInAllowlist,
425            12 => Self::LimitExceeded,
426            13 => Self::StaleIdentity,
427            14 => Self::MutationLeaseContention,
428            15 => Self::NotAccepting,
429            16 => Self::BackendFault,
430            17 => Self::UnsupportedExpectation,
431            18 => Self::PreconditionFailed,
432            19 => Self::MissingPrecondition,
433            20 => Self::Timeout,
434            21 => Self::ReadOnlySession,
435            22 => Self::WriteNotPermitted,
436            23 => Self::PollNotPermitted,
437            24 => Self::UnsupportedMethod,
438            25 => Self::TransferTooLarge,
439            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
440        }
441    }
442
443    #[inline]
444    pub fn unknown() -> Self {
445        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
446    }
447
448    #[inline]
449    pub const fn into_primitive(self) -> u32 {
450        match self {
451            Self::UnknownResource => 1,
452            Self::UnsupportedWidth => 2,
453            Self::UnsupportedAccessClass => 3,
454            Self::Misaligned => 4,
455            Self::OffsetOverflow => 5,
456            Self::OutOfLogicalBounds => 6,
457            Self::OutOfMappedBounds => 7,
458            Self::NotPermittedByCeiling => 8,
459            Self::HardDenied => 9,
460            Self::UnknownReadsNotPermitted => 10,
461            Self::NotInAllowlist => 11,
462            Self::LimitExceeded => 12,
463            Self::StaleIdentity => 13,
464            Self::MutationLeaseContention => 14,
465            Self::NotAccepting => 15,
466            Self::BackendFault => 16,
467            Self::UnsupportedExpectation => 17,
468            Self::PreconditionFailed => 18,
469            Self::MissingPrecondition => 19,
470            Self::Timeout => 20,
471            Self::ReadOnlySession => 21,
472            Self::WriteNotPermitted => 22,
473            Self::PollNotPermitted => 23,
474            Self::UnsupportedMethod => 24,
475            Self::TransferTooLarge => 25,
476            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
477        }
478    }
479
480    #[inline]
481    pub fn is_unknown(&self) -> bool {
482        match self {
483            Self::__SourceBreaking { unknown_ordinal: _ } => true,
484            _ => false,
485        }
486    }
487}
488
489#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
490pub enum ResourceKind {
491    Mmio,
492    Gpio,
493    I2C,
494    Spi,
495    Interrupt,
496    Clock,
497    Reset,
498    Serial,
499    #[doc(hidden)]
500    __SourceBreaking {
501        unknown_ordinal: u32,
502    },
503}
504
505/// Pattern that matches an unknown `ResourceKind` member.
506#[macro_export]
507macro_rules! ResourceKindUnknown {
508    () => {
509        _
510    };
511}
512
513impl ResourceKind {
514    #[inline]
515    pub fn from_primitive(prim: u32) -> Option<Self> {
516        match prim {
517            1 => Some(Self::Mmio),
518            2 => Some(Self::Gpio),
519            3 => Some(Self::I2C),
520            4 => Some(Self::Spi),
521            5 => Some(Self::Interrupt),
522            6 => Some(Self::Clock),
523            7 => Some(Self::Reset),
524            8 => Some(Self::Serial),
525            _ => None,
526        }
527    }
528
529    #[inline]
530    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
531        match prim {
532            1 => Self::Mmio,
533            2 => Self::Gpio,
534            3 => Self::I2C,
535            4 => Self::Spi,
536            5 => Self::Interrupt,
537            6 => Self::Clock,
538            7 => Self::Reset,
539            8 => Self::Serial,
540            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
541        }
542    }
543
544    #[inline]
545    pub fn unknown() -> Self {
546        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
547    }
548
549    #[inline]
550    pub const fn into_primitive(self) -> u32 {
551        match self {
552            Self::Mmio => 1,
553            Self::Gpio => 2,
554            Self::I2C => 3,
555            Self::Spi => 4,
556            Self::Interrupt => 5,
557            Self::Clock => 6,
558            Self::Reset => 7,
559            Self::Serial => 8,
560            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
561        }
562    }
563
564    #[inline]
565    pub fn is_unknown(&self) -> bool {
566        match self {
567            Self::__SourceBreaking { unknown_ordinal: _ } => true,
568            _ => false,
569        }
570    }
571}
572
573#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
574#[repr(u32)]
575pub enum SessionMode {
576    ReadOnly = 1,
577    Mutating = 2,
578}
579
580impl SessionMode {
581    #[inline]
582    pub fn from_primitive(prim: u32) -> Option<Self> {
583        match prim {
584            1 => Some(Self::ReadOnly),
585            2 => Some(Self::Mutating),
586            _ => None,
587        }
588    }
589
590    #[inline]
591    pub const fn into_primitive(self) -> u32 {
592        self as u32
593    }
594}
595
596/// Managed-takeover lifecycle state. Phase 1 never activates takeover,
597/// so the only reported state is `NOT_ACTIVE`; phase 2 adds the takeover
598/// and restoration states without a major version change.
599#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
600pub enum TakeoverState {
601    NotActive,
602    #[doc(hidden)]
603    __SourceBreaking {
604        unknown_ordinal: u32,
605    },
606}
607
608/// Pattern that matches an unknown `TakeoverState` member.
609#[macro_export]
610macro_rules! TakeoverStateUnknown {
611    () => {
612        _
613    };
614}
615
616impl TakeoverState {
617    #[inline]
618    pub fn from_primitive(prim: u32) -> Option<Self> {
619        match prim {
620            1 => Some(Self::NotActive),
621            _ => None,
622        }
623    }
624
625    #[inline]
626    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
627        match prim {
628            1 => Self::NotActive,
629            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
630        }
631    }
632
633    #[inline]
634    pub fn unknown() -> Self {
635        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
636    }
637
638    #[inline]
639    pub const fn into_primitive(self) -> u32 {
640        match self {
641            Self::NotActive => 1,
642            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
643        }
644    }
645
646    #[inline]
647    pub fn is_unknown(&self) -> bool {
648        match self {
649            Self::__SourceBreaking { unknown_ordinal: _ } => true,
650            _ => false,
651        }
652    }
653}
654
655/// One exact session allowlist rule. Wildcards do not exist.
656#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
657pub struct AccessRule {
658    pub resource: u32,
659    /// Byte offset from the start of the logical resource.
660    pub offset: u64,
661    /// Access width in bytes.
662    pub width: u32,
663    pub class: AccessClass,
664}
665
666impl fidl::Persistable for AccessRule {}
667
668#[derive(Clone, Debug, PartialEq)]
669pub struct AuditPage {
670    /// Entries with sequence >= the requested cursor, oldest first.
671    pub entries: Vec<AuditEntry>,
672    /// Whether `oldest_retained` is meaningful (the ring is nonempty).
673    pub has_oldest: bool,
674    /// Oldest sequence still retained. A cursor older than this indicates
675    /// entries were overwritten before they were drained.
676    pub oldest_retained: u64,
677    /// Cursor to pass to the next read.
678    pub next_cursor: u64,
679}
680
681impl fidl::Persistable for AuditPage {}
682
683#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
684pub struct Barrier;
685
686impl fidl::Persistable for Barrier {}
687
688#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
689#[repr(C)]
690pub struct ClockDisableResult {
691    pub audit_seq: u64,
692    pub timestamp_ns: i64,
693}
694
695impl fidl::Persistable for ClockDisableResult {}
696
697#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
698#[repr(C)]
699pub struct ClockEnableResult {
700    pub audit_seq: u64,
701    pub timestamp_ns: i64,
702}
703
704impl fidl::Persistable for ClockEnableResult {}
705
706#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
707#[repr(C)]
708pub struct ClockGetRateResult {
709    pub hz: u64,
710    pub audit_seq: u64,
711    pub timestamp_ns: i64,
712}
713
714impl fidl::Persistable for ClockGetRateResult {}
715
716#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
717pub struct ClockIsEnabledResult {
718    pub enabled: bool,
719    pub audit_seq: u64,
720    pub timestamp_ns: i64,
721}
722
723impl fidl::Persistable for ClockIsEnabledResult {}
724
725#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
726#[repr(C)]
727pub struct ClockQueryRateResult {
728    pub hz_out: u64,
729    pub audit_seq: u64,
730    pub timestamp_ns: i64,
731}
732
733impl fidl::Persistable for ClockQueryRateResult {}
734
735#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
736#[repr(C)]
737pub struct ClockSetRateResult {
738    pub audit_seq: u64,
739    pub timestamp_ns: i64,
740}
741
742impl fidl::Persistable for ClockSetRateResult {}
743
744#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
745pub struct DelayNs;
746
747impl fidl::Persistable for DelayNs {}
748
749#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
750pub struct GpioEndpointWriteRequest {
751    pub value: bool,
752}
753
754impl fidl::Persistable for GpioEndpointWriteRequest {}
755
756#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
757#[repr(C)]
758pub struct GpioRead {
759    pub resource: u32,
760}
761
762impl fidl::Persistable for GpioRead {}
763
764#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
765pub struct GpioReadResult {
766    pub value: bool,
767    pub audit_seq: u64,
768    pub timestamp_ns: i64,
769}
770
771impl fidl::Persistable for GpioReadResult {}
772
773#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
774pub struct GpioWrite {
775    pub resource: u32,
776    pub value: bool,
777}
778
779impl fidl::Persistable for GpioWrite {}
780
781#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
782#[repr(C)]
783pub struct GpioWriteResult {
784    pub audit_seq: u64,
785    pub timestamp_ns: i64,
786}
787
788impl fidl::Persistable for GpioWriteResult {}
789
790#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
791pub struct I2cEndpointTransferRequest {
792    pub write_data: Vec<u8>,
793    pub read_length: u32,
794}
795
796impl fidl::Persistable for I2cEndpointTransferRequest {}
797
798#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
799pub struct I2cTransfer {
800    pub resource: u32,
801    pub write_data: Vec<u8>,
802    pub read_length: u32,
803}
804
805impl fidl::Persistable for I2cTransfer {}
806
807#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
808pub struct I2cTransferResult {
809    pub read_data: Vec<u8>,
810    pub audit_seq: u64,
811    pub timestamp_ns: i64,
812}
813
814impl fidl::Persistable for I2cTransferResult {}
815
816#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
817#[repr(C)]
818pub struct InterruptResult {
819    pub resource: u32,
820    pub sequence: u64,
821    pub count: u64,
822    pub timestamp_ns: i64,
823    pub coalesced_count: u64,
824}
825
826impl fidl::Persistable for InterruptResult {}
827
828#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
829#[repr(C)]
830pub struct Poll32 {
831    pub resource: u32,
832    pub offset: u64,
833    pub expected: u32,
834    pub mask: u32,
835    pub interval_ns: i64,
836    pub timeout_ns: i64,
837}
838
839impl fidl::Persistable for Poll32 {}
840
841#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
842#[repr(C)]
843pub struct PollResult {
844    pub value: u32,
845    pub audit_seq: u64,
846    pub timestamp_ns: i64,
847}
848
849impl fidl::Persistable for PollResult {}
850
851#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
852#[repr(C)]
853pub struct ProxyOpenSessionResponse {
854    pub session_id: u64,
855}
856
857impl fidl::Persistable for ProxyOpenSessionResponse {}
858
859#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
860#[repr(C)]
861pub struct Read32 {
862    pub resource: u32,
863    pub offset: u64,
864}
865
866impl fidl::Persistable for Read32 {}
867
868#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
869#[repr(C)]
870pub struct ReadResult {
871    pub value: u32,
872    pub audit_seq: u64,
873    pub timestamp_ns: i64,
874}
875
876impl fidl::Persistable for ReadResult {}
877
878#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
879#[repr(C)]
880pub struct ResetAssertResult {
881    pub audit_seq: u64,
882    pub timestamp_ns: i64,
883}
884
885impl fidl::Persistable for ResetAssertResult {}
886
887#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
888#[repr(C)]
889pub struct ResetDeassertResult {
890    pub audit_seq: u64,
891    pub timestamp_ns: i64,
892}
893
894impl fidl::Persistable for ResetDeassertResult {}
895
896#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
897pub struct ResetStatusResult {
898    pub asserted: bool,
899    pub audit_seq: u64,
900    pub timestamp_ns: i64,
901}
902
903impl fidl::Persistable for ResetStatusResult {}
904
905#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
906#[repr(C)]
907pub struct ResetToggleResult {
908    pub audit_seq: u64,
909    pub timestamp_ns: i64,
910}
911
912impl fidl::Persistable for ResetToggleResult {}
913
914#[derive(Clone, Debug, PartialEq)]
915pub struct SequenceItemResult {
916    pub index: u32,
917    pub ok: bool,
918    pub outcome: SequenceItemOutcome,
919}
920
921impl fidl::Persistable for SequenceItemResult {}
922
923#[derive(Clone, Debug, PartialEq)]
924pub struct SequenceResult {
925    pub results: Vec<SequenceItemResult>,
926    pub complete: bool,
927}
928
929impl fidl::Persistable for SequenceResult {}
930
931#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
932pub struct SerialReadResult {
933    pub data: Vec<u8>,
934    pub audit_seq: u64,
935    pub timestamp_ns: i64,
936}
937
938impl fidl::Persistable for SerialReadResult {}
939
940#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
941#[repr(C)]
942pub struct SerialWriteResult {
943    pub audit_seq: u64,
944    pub timestamp_ns: i64,
945}
946
947impl fidl::Persistable for SerialWriteResult {}
948
949#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
950#[repr(C)]
951pub struct SessionClockDisableRequest {
952    pub resource: u32,
953}
954
955impl fidl::Persistable for SessionClockDisableRequest {}
956
957#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
958#[repr(C)]
959pub struct SessionClockEnableRequest {
960    pub resource: u32,
961}
962
963impl fidl::Persistable for SessionClockEnableRequest {}
964
965#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
966#[repr(C)]
967pub struct SessionClockGetRateRequest {
968    pub resource: u32,
969}
970
971impl fidl::Persistable for SessionClockGetRateRequest {}
972
973#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
974#[repr(C)]
975pub struct SessionClockIsEnabledRequest {
976    pub resource: u32,
977}
978
979impl fidl::Persistable for SessionClockIsEnabledRequest {}
980
981#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
982#[repr(C)]
983pub struct SessionClockQueryRateRequest {
984    pub resource: u32,
985    pub hz_in: u64,
986}
987
988impl fidl::Persistable for SessionClockQueryRateRequest {}
989
990#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
991#[repr(C)]
992pub struct SessionClockSetRateRequest {
993    pub resource: u32,
994    pub hz: u64,
995}
996
997impl fidl::Persistable for SessionClockSetRateRequest {}
998
999#[derive(Clone, Debug, PartialEq)]
1000pub struct SessionExecuteSequenceRequest {
1001    pub items: Vec<SequenceItem>,
1002}
1003
1004impl fidl::Persistable for SessionExecuteSequenceRequest {}
1005
1006#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1007#[repr(C)]
1008pub struct SessionGpioReadRequest {
1009    pub resource: u32,
1010}
1011
1012impl fidl::Persistable for SessionGpioReadRequest {}
1013
1014#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1015pub struct SessionGpioWriteRequest {
1016    pub resource: u32,
1017    pub value: bool,
1018}
1019
1020impl fidl::Persistable for SessionGpioWriteRequest {}
1021
1022#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1023pub struct SessionI2cTransferRequest {
1024    pub resource: u32,
1025    pub write_data: Vec<u8>,
1026    pub read_length: u32,
1027}
1028
1029impl fidl::Persistable for SessionI2cTransferRequest {}
1030
1031#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1032#[repr(C)]
1033pub struct SessionPoll32Request {
1034    pub resource: u32,
1035    pub offset: u64,
1036    pub expected: u32,
1037    pub mask: u32,
1038    pub interval_ns: i64,
1039    pub timeout_ns: i64,
1040}
1041
1042impl fidl::Persistable for SessionPoll32Request {}
1043
1044#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1045#[repr(C)]
1046pub struct SessionRead32Request {
1047    pub resource: u32,
1048    pub offset: u64,
1049}
1050
1051impl fidl::Persistable for SessionRead32Request {}
1052
1053#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1054#[repr(C)]
1055pub struct SessionReadAuditRequest {
1056    pub cursor: u64,
1057    pub limit: u32,
1058}
1059
1060impl fidl::Persistable for SessionReadAuditRequest {}
1061
1062#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1063#[repr(C)]
1064pub struct SessionResetAssertRequest {
1065    pub resource: u32,
1066}
1067
1068impl fidl::Persistable for SessionResetAssertRequest {}
1069
1070#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1071#[repr(C)]
1072pub struct SessionResetDeassertRequest {
1073    pub resource: u32,
1074}
1075
1076impl fidl::Persistable for SessionResetDeassertRequest {}
1077
1078#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1079#[repr(C)]
1080pub struct SessionResetStatusRequest {
1081    pub resource: u32,
1082}
1083
1084impl fidl::Persistable for SessionResetStatusRequest {}
1085
1086#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1087#[repr(C)]
1088pub struct SessionResetToggleRequest {
1089    pub resource: u32,
1090}
1091
1092impl fidl::Persistable for SessionResetToggleRequest {}
1093
1094#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1095#[repr(C)]
1096pub struct SessionSerialReadRequest {
1097    pub resource: u32,
1098}
1099
1100impl fidl::Persistable for SessionSerialReadRequest {}
1101
1102#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1103pub struct SessionSerialWriteRequest {
1104    pub resource: u32,
1105    pub data: Vec<u8>,
1106}
1107
1108impl fidl::Persistable for SessionSerialWriteRequest {}
1109
1110#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1111pub struct SessionSnapshotRequest {
1112    pub items: Vec<SnapshotItem>,
1113}
1114
1115impl fidl::Persistable for SessionSnapshotRequest {}
1116
1117#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1118pub struct SessionSpiTransmitRequest {
1119    pub resource: u32,
1120    pub tx_data: Vec<u8>,
1121}
1122
1123impl fidl::Persistable for SessionSpiTransmitRequest {}
1124
1125#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1126#[repr(C)]
1127pub struct SessionWaitForInterruptRequest {
1128    pub resource: u32,
1129    pub after_sequence: u64,
1130    pub timeout_ns: i64,
1131}
1132
1133impl fidl::Persistable for SessionWaitForInterruptRequest {}
1134
1135#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1136pub struct SessionWrite32Request {
1137    pub resource: u32,
1138    pub offset: u64,
1139    pub value: u32,
1140    pub write_mask: u32,
1141    pub precondition: Option<Box<WritePrecondition>>,
1142    pub readback: bool,
1143}
1144
1145impl fidl::Persistable for SessionWrite32Request {}
1146
1147#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1148#[repr(C)]
1149pub struct SnapshotItem {
1150    pub resource: u32,
1151    pub offset: u64,
1152}
1153
1154impl fidl::Persistable for SnapshotItem {}
1155
1156#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1157pub struct SnapshotItemResult {
1158    pub item: SnapshotItem,
1159    /// False when this item's backend access failed.
1160    pub ok: bool,
1161    /// Valid only when `ok` is true.
1162    pub value: u32,
1163    pub audit_seq: u64,
1164    pub timestamp_ns: i64,
1165}
1166
1167impl fidl::Persistable for SnapshotItemResult {}
1168
1169#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1170pub struct SnapshotResult {
1171    /// One result per item that began execution, in request order.
1172    pub results: Vec<SnapshotItemResult>,
1173    /// False when execution stopped at a backend failure; later items
1174    /// never began. A snapshot is an ordered series of reads, never an
1175    /// atomic hardware snapshot.
1176    pub complete: bool,
1177}
1178
1179impl fidl::Persistable for SnapshotResult {}
1180
1181#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1182pub struct SpiEndpointTransmitRequest {
1183    pub tx_data: Vec<u8>,
1184}
1185
1186impl fidl::Persistable for SpiEndpointTransmitRequest {}
1187
1188#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1189pub struct SpiTransmit {
1190    pub resource: u32,
1191    pub tx_data: Vec<u8>,
1192}
1193
1194impl fidl::Persistable for SpiTransmit {}
1195
1196#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1197pub struct SpiTransmitResult {
1198    pub rx_data: Vec<u8>,
1199    pub audit_seq: u64,
1200    pub timestamp_ns: i64,
1201}
1202
1203impl fidl::Persistable for SpiTransmitResult {}
1204
1205#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1206pub struct Write32 {
1207    pub resource: u32,
1208    pub offset: u64,
1209    pub value: u32,
1210    pub write_mask: u32,
1211    pub precondition: Option<Box<WritePrecondition>>,
1212    pub readback: bool,
1213}
1214
1215impl fidl::Persistable for Write32 {}
1216
1217#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1218#[repr(C)]
1219pub struct WritePrecondition {
1220    pub expected: u32,
1221    pub mask: u32,
1222}
1223
1224impl fidl::Persistable for WritePrecondition {}
1225
1226#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1227#[repr(C)]
1228pub struct WriteResult {
1229    /// Present if readback was configured or requested.
1230    pub readback_value: u32,
1231    pub audit_seq: u64,
1232    pub timestamp_ns: i64,
1233}
1234
1235impl fidl::Persistable for WriteResult {}
1236
1237#[derive(Clone, Debug, Default, PartialEq)]
1238pub struct AuditEntry {
1239    pub seq: Option<u64>,
1240    pub session: Option<u64>,
1241    pub resource: Option<u32>,
1242    pub operation: Option<String>,
1243    pub offset: Option<u64>,
1244    pub decision: Option<AuditDecision>,
1245    /// Present only when `decision` is `DENIED`.
1246    pub denial: Option<OperationError>,
1247    pub status: Option<AuditStatus>,
1248    pub value: Option<u32>,
1249    pub timestamp_ns: Option<i64>,
1250    /// Host run identifier, present on session-open records where the
1251    /// session-to-run association is established.
1252    pub run_id: Option<String>,
1253    /// Index within a multi-item operation (for example a snapshot).
1254    pub item_index: Option<u32>,
1255    /// Instance identity stamped at drain time, so drained evidence is
1256    /// interpretable without the live instance.
1257    pub proxy_generation: Option<u64>,
1258    pub boot_id: Option<String>,
1259    #[doc(hidden)]
1260    pub __source_breaking: fidl::marker::SourceBreaking,
1261}
1262
1263impl fidl::Persistable for AuditEntry {}
1264
1265/// Expected proxy identity. A mismatch -- including an absent required
1266/// field -- is rejected before allowlist validation and before any
1267/// hardware access. Extensible so phase 2 can add takeover expectations
1268/// without a major version change.
1269#[derive(Clone, Debug, Default, PartialEq)]
1270pub struct Expectations {
1271    /// Required. Absence is a stale-boot-id rejection.
1272    pub boot_id: Option<String>,
1273    /// Required. Absence is a stale-proxy-generation rejection.
1274    pub proxy_generation: Option<u64>,
1275    /// Required. Absence is a stale-resource-digest rejection.
1276    pub resource_digest: Option<String>,
1277    /// Required. Absence is a stale-policy-digest rejection.
1278    pub policy_digest: Option<String>,
1279    /// Reserved for phase 2: the Driver Manager topology generation the
1280    /// host observed. Setting it in phase 1 is rejected as
1281    /// `UNSUPPORTED_EXPECTATION`.
1282    pub topology_generation: Option<u64>,
1283    /// Reserved for phase 2: URL of the driver expected bound before
1284    /// takeover. Setting it in phase 1 is rejected as
1285    /// `UNSUPPORTED_EXPECTATION`.
1286    pub bound_driver_url: Option<String>,
1287    #[doc(hidden)]
1288    pub __source_breaking: fidl::marker::SourceBreaking,
1289}
1290
1291impl fidl::Persistable for Expectations {}
1292
1293#[derive(Clone, Debug, Default, PartialEq)]
1294pub struct ProxyDescription {
1295    pub protocol_major: Option<u32>,
1296    pub protocol_minor: Option<u32>,
1297    pub proxy_generation: Option<u64>,
1298    pub boot_id: Option<String>,
1299    /// Whole-instance resource-description digest.
1300    pub resource_digest: Option<String>,
1301    pub policy_digest: Option<String>,
1302    pub resources: Option<Vec<ResourceDescription>>,
1303    pub max_snapshot_items: Option<u32>,
1304    pub audit_capacity: Option<u64>,
1305    /// Moniker of the node this proxy instance is bound to. Absent until
1306    /// the proxy is bound to a node.
1307    pub node_moniker: Option<String>,
1308    /// Reserved for phase 2: Driver Manager topology generation at bind
1309    /// time, used for takeover staleness. Absent in phase 1.
1310    pub topology_generation: Option<u64>,
1311    /// Takeover lifecycle state. Phase 1 reports `NOT_ACTIVE`.
1312    pub takeover: Option<TakeoverState>,
1313    #[doc(hidden)]
1314    pub __source_breaking: fidl::marker::SourceBreaking,
1315}
1316
1317impl fidl::Persistable for ProxyDescription {}
1318
1319/// Logical description of one offered resource. Never contains physical
1320/// addresses or raw handles.
1321#[derive(Clone, Debug, Default, PartialEq)]
1322pub struct ResourceDescription {
1323    pub id: Option<u32>,
1324    pub name: Option<String>,
1325    pub kind: Option<ResourceKind>,
1326    pub logical_size: Option<u64>,
1327    /// Per-resource description digest used for persistent grant matching.
1328    pub digest: Option<String>,
1329    #[doc(hidden)]
1330    pub __source_breaking: fidl::marker::SourceBreaking,
1331}
1332
1333impl fidl::Persistable for ResourceDescription {}
1334
1335/// Host-supplied provenance recorded with the session. Diagnostic, not
1336/// authorization.
1337#[derive(Clone, Debug, Default, PartialEq)]
1338pub struct RunContext {
1339    pub run_id: Option<String>,
1340    pub case_id: Option<String>,
1341    pub plan_digest: Option<String>,
1342    pub host_tool_version: Option<String>,
1343    #[doc(hidden)]
1344    pub __source_breaking: fidl::marker::SourceBreaking,
1345}
1346
1347impl fidl::Persistable for RunContext {}
1348
1349#[derive(Clone, Debug)]
1350pub enum SequenceItem {
1351    Read32(Read32),
1352    Write32(Write32),
1353    Poll32(Poll32),
1354    DelayNs(i64),
1355    Barrier(BarrierVariant),
1356    GpioRead(GpioRead),
1357    GpioWrite(GpioWrite),
1358    I2cTransfer(I2cTransfer),
1359    SpiTransmit(SpiTransmit),
1360    #[doc(hidden)]
1361    __SourceBreaking {
1362        unknown_ordinal: u64,
1363    },
1364}
1365
1366/// Pattern that matches an unknown `SequenceItem` member.
1367#[macro_export]
1368macro_rules! SequenceItemUnknown {
1369    () => {
1370        _
1371    };
1372}
1373
1374// Custom PartialEq so that unknown variants are not equal to themselves.
1375impl PartialEq for SequenceItem {
1376    fn eq(&self, other: &Self) -> bool {
1377        match (self, other) {
1378            (Self::Read32(x), Self::Read32(y)) => *x == *y,
1379            (Self::Write32(x), Self::Write32(y)) => *x == *y,
1380            (Self::Poll32(x), Self::Poll32(y)) => *x == *y,
1381            (Self::DelayNs(x), Self::DelayNs(y)) => *x == *y,
1382            (Self::Barrier(x), Self::Barrier(y)) => *x == *y,
1383            (Self::GpioRead(x), Self::GpioRead(y)) => *x == *y,
1384            (Self::GpioWrite(x), Self::GpioWrite(y)) => *x == *y,
1385            (Self::I2cTransfer(x), Self::I2cTransfer(y)) => *x == *y,
1386            (Self::SpiTransmit(x), Self::SpiTransmit(y)) => *x == *y,
1387            _ => false,
1388        }
1389    }
1390}
1391
1392impl SequenceItem {
1393    #[inline]
1394    pub fn ordinal(&self) -> u64 {
1395        match *self {
1396            Self::Read32(_) => 1,
1397            Self::Write32(_) => 2,
1398            Self::Poll32(_) => 3,
1399            Self::DelayNs(_) => 4,
1400            Self::Barrier(_) => 5,
1401            Self::GpioRead(_) => 6,
1402            Self::GpioWrite(_) => 7,
1403            Self::I2cTransfer(_) => 8,
1404            Self::SpiTransmit(_) => 9,
1405            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1406        }
1407    }
1408
1409    #[inline]
1410    pub fn unknown_variant_for_testing() -> Self {
1411        Self::__SourceBreaking { unknown_ordinal: 0 }
1412    }
1413
1414    #[inline]
1415    pub fn is_unknown(&self) -> bool {
1416        match self {
1417            Self::__SourceBreaking { .. } => true,
1418            _ => false,
1419        }
1420    }
1421}
1422
1423impl fidl::Persistable for SequenceItem {}
1424
1425#[derive(Clone, Debug)]
1426pub enum SequenceItemOutcome {
1427    Read32(ReadResult),
1428    Write32(WriteResult),
1429    Poll32(PollResult),
1430    DelayNs(DelayNs),
1431    Barrier(Barrier),
1432    Error(OperationError),
1433    GpioRead(GpioReadResult),
1434    GpioWrite(GpioWriteResult),
1435    I2cTransfer(I2cTransferResult),
1436    SpiTransmit(SpiTransmitResult),
1437    #[doc(hidden)]
1438    __SourceBreaking {
1439        unknown_ordinal: u64,
1440    },
1441}
1442
1443/// Pattern that matches an unknown `SequenceItemOutcome` member.
1444#[macro_export]
1445macro_rules! SequenceItemOutcomeUnknown {
1446    () => {
1447        _
1448    };
1449}
1450
1451// Custom PartialEq so that unknown variants are not equal to themselves.
1452impl PartialEq for SequenceItemOutcome {
1453    fn eq(&self, other: &Self) -> bool {
1454        match (self, other) {
1455            (Self::Read32(x), Self::Read32(y)) => *x == *y,
1456            (Self::Write32(x), Self::Write32(y)) => *x == *y,
1457            (Self::Poll32(x), Self::Poll32(y)) => *x == *y,
1458            (Self::DelayNs(x), Self::DelayNs(y)) => *x == *y,
1459            (Self::Barrier(x), Self::Barrier(y)) => *x == *y,
1460            (Self::Error(x), Self::Error(y)) => *x == *y,
1461            (Self::GpioRead(x), Self::GpioRead(y)) => *x == *y,
1462            (Self::GpioWrite(x), Self::GpioWrite(y)) => *x == *y,
1463            (Self::I2cTransfer(x), Self::I2cTransfer(y)) => *x == *y,
1464            (Self::SpiTransmit(x), Self::SpiTransmit(y)) => *x == *y,
1465            _ => false,
1466        }
1467    }
1468}
1469
1470impl SequenceItemOutcome {
1471    #[inline]
1472    pub fn ordinal(&self) -> u64 {
1473        match *self {
1474            Self::Read32(_) => 1,
1475            Self::Write32(_) => 2,
1476            Self::Poll32(_) => 3,
1477            Self::DelayNs(_) => 4,
1478            Self::Barrier(_) => 5,
1479            Self::Error(_) => 6,
1480            Self::GpioRead(_) => 7,
1481            Self::GpioWrite(_) => 8,
1482            Self::I2cTransfer(_) => 9,
1483            Self::SpiTransmit(_) => 10,
1484            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1485        }
1486    }
1487
1488    #[inline]
1489    pub fn unknown_variant_for_testing() -> Self {
1490        Self::__SourceBreaking { unknown_ordinal: 0 }
1491    }
1492
1493    #[inline]
1494    pub fn is_unknown(&self) -> bool {
1495        match self {
1496            Self::__SourceBreaking { .. } => true,
1497            _ => false,
1498        }
1499    }
1500}
1501
1502impl fidl::Persistable for SequenceItemOutcome {}
1503
1504pub mod gpio_endpoint_ordinals {
1505    pub const READ: u64 = 0xb7efebe5882f6f1;
1506    pub const WRITE: u64 = 0x3d1822432f45c309;
1507}
1508
1509pub mod i2c_endpoint_ordinals {
1510    pub const TRANSFER: u64 = 0xbb27bd944e8143;
1511}
1512
1513pub mod proxy__ordinals {
1514    pub const DESCRIBE: u64 = 0x7a79d503792884fb;
1515    pub const OPEN_SESSION: u64 = 0x31decc49da4ed5f4;
1516}
1517
1518pub mod session_ordinals {
1519    pub const READ32: u64 = 0x7afec1bfecc09a54;
1520    pub const SNAPSHOT: u64 = 0x5fa90e4c39fa72e1;
1521    pub const READ_AUDIT: u64 = 0x4906c4144e00f4c4;
1522    pub const WRITE32: u64 = 0x80dcccde698980c;
1523    pub const POLL32: u64 = 0x3b9c26d1582fff7d;
1524    pub const EXECUTE_SEQUENCE: u64 = 0xf0500bd7555a614;
1525    pub const GPIO_READ: u64 = 0xb01fc817332de51;
1526    pub const GPIO_WRITE: u64 = 0x27cfbd9ffaf5c6e7;
1527    pub const I2C_TRANSFER: u64 = 0x67016bc41336f298;
1528    pub const SPI_TRANSMIT: u64 = 0x3429847e2877d4d7;
1529    pub const OPEN_GPIO: u64 = 0x5bd9f23cba94897;
1530    pub const OPEN_I2C: u64 = 0x17ba936a44a14633;
1531    pub const OPEN_SPI: u64 = 0x3ee7e7cea84dfc9d;
1532    pub const WAIT_FOR_INTERRUPT: u64 = 0x276a31c24a164cdb;
1533    pub const CLOCK_ENABLE: u64 = 0x774b563ebff897eb;
1534    pub const CLOCK_DISABLE: u64 = 0x642c11d03db8b873;
1535    pub const CLOCK_IS_ENABLED: u64 = 0x36a033a7a1322174;
1536    pub const CLOCK_SET_RATE: u64 = 0x4dbc4012d4289048;
1537    pub const CLOCK_QUERY_RATE: u64 = 0x11b9fe61ad09ff5e;
1538    pub const CLOCK_GET_RATE: u64 = 0x4f3c0e2259e5e46;
1539    pub const RESET_ASSERT: u64 = 0x5788d4842384c111;
1540    pub const RESET_DEASSERT: u64 = 0x632c13fc5e08d3e2;
1541    pub const RESET_TOGGLE: u64 = 0x2b2b14cb6a5e4c98;
1542    pub const RESET_STATUS: u64 = 0x1790a96ce5f3b3d9;
1543    pub const SERIAL_READ: u64 = 0x2b76818805a351fd;
1544    pub const SERIAL_WRITE: u64 = 0x5345a3e2317a792f;
1545}
1546
1547pub mod spi_endpoint_ordinals {
1548    pub const TRANSMIT: u64 = 0x71f374cd592ecaa3;
1549}
1550
1551mod internal {
1552    use super::*;
1553    unsafe impl fidl::encoding::TypeMarker for AccessClass {
1554        type Owned = Self;
1555
1556        #[inline(always)]
1557        fn inline_align(_context: fidl::encoding::Context) -> usize {
1558            std::mem::align_of::<u32>()
1559        }
1560
1561        #[inline(always)]
1562        fn inline_size(_context: fidl::encoding::Context) -> usize {
1563            std::mem::size_of::<u32>()
1564        }
1565
1566        #[inline(always)]
1567        fn encode_is_copy() -> bool {
1568            true
1569        }
1570
1571        #[inline(always)]
1572        fn decode_is_copy() -> bool {
1573            false
1574        }
1575    }
1576
1577    impl fidl::encoding::ValueTypeMarker for AccessClass {
1578        type Borrowed<'a> = Self;
1579        #[inline(always)]
1580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1581            *value
1582        }
1583    }
1584
1585    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AccessClass {
1586        #[inline]
1587        unsafe fn encode(
1588            self,
1589            encoder: &mut fidl::encoding::Encoder<'_, D>,
1590            offset: usize,
1591            _depth: fidl::encoding::Depth,
1592        ) -> fidl::Result<()> {
1593            encoder.debug_check_bounds::<Self>(offset);
1594            encoder.write_num(self.into_primitive(), offset);
1595            Ok(())
1596        }
1597    }
1598
1599    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessClass {
1600        #[inline(always)]
1601        fn new_empty() -> Self {
1602            Self::ReadOnce
1603        }
1604
1605        #[inline]
1606        unsafe fn decode(
1607            &mut self,
1608            decoder: &mut fidl::encoding::Decoder<'_, D>,
1609            offset: usize,
1610            _depth: fidl::encoding::Depth,
1611        ) -> fidl::Result<()> {
1612            decoder.debug_check_bounds::<Self>(offset);
1613            let prim = decoder.read_num::<u32>(offset);
1614
1615            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1616            Ok(())
1617        }
1618    }
1619    unsafe impl fidl::encoding::TypeMarker for AuditDecision {
1620        type Owned = Self;
1621
1622        #[inline(always)]
1623        fn inline_align(_context: fidl::encoding::Context) -> usize {
1624            std::mem::align_of::<u32>()
1625        }
1626
1627        #[inline(always)]
1628        fn inline_size(_context: fidl::encoding::Context) -> usize {
1629            std::mem::size_of::<u32>()
1630        }
1631
1632        #[inline(always)]
1633        fn encode_is_copy() -> bool {
1634            false
1635        }
1636
1637        #[inline(always)]
1638        fn decode_is_copy() -> bool {
1639            false
1640        }
1641    }
1642
1643    impl fidl::encoding::ValueTypeMarker for AuditDecision {
1644        type Borrowed<'a> = Self;
1645        #[inline(always)]
1646        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1647            *value
1648        }
1649    }
1650
1651    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AuditDecision {
1652        #[inline]
1653        unsafe fn encode(
1654            self,
1655            encoder: &mut fidl::encoding::Encoder<'_, D>,
1656            offset: usize,
1657            _depth: fidl::encoding::Depth,
1658        ) -> fidl::Result<()> {
1659            encoder.debug_check_bounds::<Self>(offset);
1660            encoder.write_num(self.into_primitive(), offset);
1661            Ok(())
1662        }
1663    }
1664
1665    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AuditDecision {
1666        #[inline(always)]
1667        fn new_empty() -> Self {
1668            Self::unknown()
1669        }
1670
1671        #[inline]
1672        unsafe fn decode(
1673            &mut self,
1674            decoder: &mut fidl::encoding::Decoder<'_, D>,
1675            offset: usize,
1676            _depth: fidl::encoding::Depth,
1677        ) -> fidl::Result<()> {
1678            decoder.debug_check_bounds::<Self>(offset);
1679            let prim = decoder.read_num::<u32>(offset);
1680
1681            *self = Self::from_primitive_allow_unknown(prim);
1682            Ok(())
1683        }
1684    }
1685    unsafe impl fidl::encoding::TypeMarker for AuditStatus {
1686        type Owned = Self;
1687
1688        #[inline(always)]
1689        fn inline_align(_context: fidl::encoding::Context) -> usize {
1690            std::mem::align_of::<u32>()
1691        }
1692
1693        #[inline(always)]
1694        fn inline_size(_context: fidl::encoding::Context) -> usize {
1695            std::mem::size_of::<u32>()
1696        }
1697
1698        #[inline(always)]
1699        fn encode_is_copy() -> bool {
1700            false
1701        }
1702
1703        #[inline(always)]
1704        fn decode_is_copy() -> bool {
1705            false
1706        }
1707    }
1708
1709    impl fidl::encoding::ValueTypeMarker for AuditStatus {
1710        type Borrowed<'a> = Self;
1711        #[inline(always)]
1712        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1713            *value
1714        }
1715    }
1716
1717    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AuditStatus {
1718        #[inline]
1719        unsafe fn encode(
1720            self,
1721            encoder: &mut fidl::encoding::Encoder<'_, D>,
1722            offset: usize,
1723            _depth: fidl::encoding::Depth,
1724        ) -> fidl::Result<()> {
1725            encoder.debug_check_bounds::<Self>(offset);
1726            encoder.write_num(self.into_primitive(), offset);
1727            Ok(())
1728        }
1729    }
1730
1731    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AuditStatus {
1732        #[inline(always)]
1733        fn new_empty() -> Self {
1734            Self::unknown()
1735        }
1736
1737        #[inline]
1738        unsafe fn decode(
1739            &mut self,
1740            decoder: &mut fidl::encoding::Decoder<'_, D>,
1741            offset: usize,
1742            _depth: fidl::encoding::Depth,
1743        ) -> fidl::Result<()> {
1744            decoder.debug_check_bounds::<Self>(offset);
1745            let prim = decoder.read_num::<u32>(offset);
1746
1747            *self = Self::from_primitive_allow_unknown(prim);
1748            Ok(())
1749        }
1750    }
1751    unsafe impl fidl::encoding::TypeMarker for BarrierVariant {
1752        type Owned = Self;
1753
1754        #[inline(always)]
1755        fn inline_align(_context: fidl::encoding::Context) -> usize {
1756            std::mem::align_of::<u32>()
1757        }
1758
1759        #[inline(always)]
1760        fn inline_size(_context: fidl::encoding::Context) -> usize {
1761            std::mem::size_of::<u32>()
1762        }
1763
1764        #[inline(always)]
1765        fn encode_is_copy() -> bool {
1766            false
1767        }
1768
1769        #[inline(always)]
1770        fn decode_is_copy() -> bool {
1771            false
1772        }
1773    }
1774
1775    impl fidl::encoding::ValueTypeMarker for BarrierVariant {
1776        type Borrowed<'a> = Self;
1777        #[inline(always)]
1778        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1779            *value
1780        }
1781    }
1782
1783    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BarrierVariant {
1784        #[inline]
1785        unsafe fn encode(
1786            self,
1787            encoder: &mut fidl::encoding::Encoder<'_, D>,
1788            offset: usize,
1789            _depth: fidl::encoding::Depth,
1790        ) -> fidl::Result<()> {
1791            encoder.debug_check_bounds::<Self>(offset);
1792            encoder.write_num(self.into_primitive(), offset);
1793            Ok(())
1794        }
1795    }
1796
1797    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BarrierVariant {
1798        #[inline(always)]
1799        fn new_empty() -> Self {
1800            Self::unknown()
1801        }
1802
1803        #[inline]
1804        unsafe fn decode(
1805            &mut self,
1806            decoder: &mut fidl::encoding::Decoder<'_, D>,
1807            offset: usize,
1808            _depth: fidl::encoding::Depth,
1809        ) -> fidl::Result<()> {
1810            decoder.debug_check_bounds::<Self>(offset);
1811            let prim = decoder.read_num::<u32>(offset);
1812
1813            *self = Self::from_primitive_allow_unknown(prim);
1814            Ok(())
1815        }
1816    }
1817    unsafe impl fidl::encoding::TypeMarker for OpenSessionError {
1818        type Owned = Self;
1819
1820        #[inline(always)]
1821        fn inline_align(_context: fidl::encoding::Context) -> usize {
1822            std::mem::align_of::<u32>()
1823        }
1824
1825        #[inline(always)]
1826        fn inline_size(_context: fidl::encoding::Context) -> usize {
1827            std::mem::size_of::<u32>()
1828        }
1829
1830        #[inline(always)]
1831        fn encode_is_copy() -> bool {
1832            false
1833        }
1834
1835        #[inline(always)]
1836        fn decode_is_copy() -> bool {
1837            false
1838        }
1839    }
1840
1841    impl fidl::encoding::ValueTypeMarker for OpenSessionError {
1842        type Borrowed<'a> = Self;
1843        #[inline(always)]
1844        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1845            *value
1846        }
1847    }
1848
1849    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1850        for OpenSessionError
1851    {
1852        #[inline]
1853        unsafe fn encode(
1854            self,
1855            encoder: &mut fidl::encoding::Encoder<'_, D>,
1856            offset: usize,
1857            _depth: fidl::encoding::Depth,
1858        ) -> fidl::Result<()> {
1859            encoder.debug_check_bounds::<Self>(offset);
1860            encoder.write_num(self.into_primitive(), offset);
1861            Ok(())
1862        }
1863    }
1864
1865    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenSessionError {
1866        #[inline(always)]
1867        fn new_empty() -> Self {
1868            Self::unknown()
1869        }
1870
1871        #[inline]
1872        unsafe fn decode(
1873            &mut self,
1874            decoder: &mut fidl::encoding::Decoder<'_, D>,
1875            offset: usize,
1876            _depth: fidl::encoding::Depth,
1877        ) -> fidl::Result<()> {
1878            decoder.debug_check_bounds::<Self>(offset);
1879            let prim = decoder.read_num::<u32>(offset);
1880
1881            *self = Self::from_primitive_allow_unknown(prim);
1882            Ok(())
1883        }
1884    }
1885    unsafe impl fidl::encoding::TypeMarker for OperationError {
1886        type Owned = Self;
1887
1888        #[inline(always)]
1889        fn inline_align(_context: fidl::encoding::Context) -> usize {
1890            std::mem::align_of::<u32>()
1891        }
1892
1893        #[inline(always)]
1894        fn inline_size(_context: fidl::encoding::Context) -> usize {
1895            std::mem::size_of::<u32>()
1896        }
1897
1898        #[inline(always)]
1899        fn encode_is_copy() -> bool {
1900            false
1901        }
1902
1903        #[inline(always)]
1904        fn decode_is_copy() -> bool {
1905            false
1906        }
1907    }
1908
1909    impl fidl::encoding::ValueTypeMarker for OperationError {
1910        type Borrowed<'a> = Self;
1911        #[inline(always)]
1912        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1913            *value
1914        }
1915    }
1916
1917    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OperationError {
1918        #[inline]
1919        unsafe fn encode(
1920            self,
1921            encoder: &mut fidl::encoding::Encoder<'_, D>,
1922            offset: usize,
1923            _depth: fidl::encoding::Depth,
1924        ) -> fidl::Result<()> {
1925            encoder.debug_check_bounds::<Self>(offset);
1926            encoder.write_num(self.into_primitive(), offset);
1927            Ok(())
1928        }
1929    }
1930
1931    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OperationError {
1932        #[inline(always)]
1933        fn new_empty() -> Self {
1934            Self::unknown()
1935        }
1936
1937        #[inline]
1938        unsafe fn decode(
1939            &mut self,
1940            decoder: &mut fidl::encoding::Decoder<'_, D>,
1941            offset: usize,
1942            _depth: fidl::encoding::Depth,
1943        ) -> fidl::Result<()> {
1944            decoder.debug_check_bounds::<Self>(offset);
1945            let prim = decoder.read_num::<u32>(offset);
1946
1947            *self = Self::from_primitive_allow_unknown(prim);
1948            Ok(())
1949        }
1950    }
1951    unsafe impl fidl::encoding::TypeMarker for ResourceKind {
1952        type Owned = Self;
1953
1954        #[inline(always)]
1955        fn inline_align(_context: fidl::encoding::Context) -> usize {
1956            std::mem::align_of::<u32>()
1957        }
1958
1959        #[inline(always)]
1960        fn inline_size(_context: fidl::encoding::Context) -> usize {
1961            std::mem::size_of::<u32>()
1962        }
1963
1964        #[inline(always)]
1965        fn encode_is_copy() -> bool {
1966            false
1967        }
1968
1969        #[inline(always)]
1970        fn decode_is_copy() -> bool {
1971            false
1972        }
1973    }
1974
1975    impl fidl::encoding::ValueTypeMarker for ResourceKind {
1976        type Borrowed<'a> = Self;
1977        #[inline(always)]
1978        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1979            *value
1980        }
1981    }
1982
1983    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResourceKind {
1984        #[inline]
1985        unsafe fn encode(
1986            self,
1987            encoder: &mut fidl::encoding::Encoder<'_, D>,
1988            offset: usize,
1989            _depth: fidl::encoding::Depth,
1990        ) -> fidl::Result<()> {
1991            encoder.debug_check_bounds::<Self>(offset);
1992            encoder.write_num(self.into_primitive(), offset);
1993            Ok(())
1994        }
1995    }
1996
1997    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResourceKind {
1998        #[inline(always)]
1999        fn new_empty() -> Self {
2000            Self::unknown()
2001        }
2002
2003        #[inline]
2004        unsafe fn decode(
2005            &mut self,
2006            decoder: &mut fidl::encoding::Decoder<'_, D>,
2007            offset: usize,
2008            _depth: fidl::encoding::Depth,
2009        ) -> fidl::Result<()> {
2010            decoder.debug_check_bounds::<Self>(offset);
2011            let prim = decoder.read_num::<u32>(offset);
2012
2013            *self = Self::from_primitive_allow_unknown(prim);
2014            Ok(())
2015        }
2016    }
2017    unsafe impl fidl::encoding::TypeMarker for SessionMode {
2018        type Owned = Self;
2019
2020        #[inline(always)]
2021        fn inline_align(_context: fidl::encoding::Context) -> usize {
2022            std::mem::align_of::<u32>()
2023        }
2024
2025        #[inline(always)]
2026        fn inline_size(_context: fidl::encoding::Context) -> usize {
2027            std::mem::size_of::<u32>()
2028        }
2029
2030        #[inline(always)]
2031        fn encode_is_copy() -> bool {
2032            true
2033        }
2034
2035        #[inline(always)]
2036        fn decode_is_copy() -> bool {
2037            false
2038        }
2039    }
2040
2041    impl fidl::encoding::ValueTypeMarker for SessionMode {
2042        type Borrowed<'a> = Self;
2043        #[inline(always)]
2044        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2045            *value
2046        }
2047    }
2048
2049    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SessionMode {
2050        #[inline]
2051        unsafe fn encode(
2052            self,
2053            encoder: &mut fidl::encoding::Encoder<'_, D>,
2054            offset: usize,
2055            _depth: fidl::encoding::Depth,
2056        ) -> fidl::Result<()> {
2057            encoder.debug_check_bounds::<Self>(offset);
2058            encoder.write_num(self.into_primitive(), offset);
2059            Ok(())
2060        }
2061    }
2062
2063    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionMode {
2064        #[inline(always)]
2065        fn new_empty() -> Self {
2066            Self::ReadOnly
2067        }
2068
2069        #[inline]
2070        unsafe fn decode(
2071            &mut self,
2072            decoder: &mut fidl::encoding::Decoder<'_, D>,
2073            offset: usize,
2074            _depth: fidl::encoding::Depth,
2075        ) -> fidl::Result<()> {
2076            decoder.debug_check_bounds::<Self>(offset);
2077            let prim = decoder.read_num::<u32>(offset);
2078
2079            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2080            Ok(())
2081        }
2082    }
2083    unsafe impl fidl::encoding::TypeMarker for TakeoverState {
2084        type Owned = Self;
2085
2086        #[inline(always)]
2087        fn inline_align(_context: fidl::encoding::Context) -> usize {
2088            std::mem::align_of::<u32>()
2089        }
2090
2091        #[inline(always)]
2092        fn inline_size(_context: fidl::encoding::Context) -> usize {
2093            std::mem::size_of::<u32>()
2094        }
2095
2096        #[inline(always)]
2097        fn encode_is_copy() -> bool {
2098            false
2099        }
2100
2101        #[inline(always)]
2102        fn decode_is_copy() -> bool {
2103            false
2104        }
2105    }
2106
2107    impl fidl::encoding::ValueTypeMarker for TakeoverState {
2108        type Borrowed<'a> = Self;
2109        #[inline(always)]
2110        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2111            *value
2112        }
2113    }
2114
2115    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TakeoverState {
2116        #[inline]
2117        unsafe fn encode(
2118            self,
2119            encoder: &mut fidl::encoding::Encoder<'_, D>,
2120            offset: usize,
2121            _depth: fidl::encoding::Depth,
2122        ) -> fidl::Result<()> {
2123            encoder.debug_check_bounds::<Self>(offset);
2124            encoder.write_num(self.into_primitive(), offset);
2125            Ok(())
2126        }
2127    }
2128
2129    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TakeoverState {
2130        #[inline(always)]
2131        fn new_empty() -> Self {
2132            Self::unknown()
2133        }
2134
2135        #[inline]
2136        unsafe fn decode(
2137            &mut self,
2138            decoder: &mut fidl::encoding::Decoder<'_, D>,
2139            offset: usize,
2140            _depth: fidl::encoding::Depth,
2141        ) -> fidl::Result<()> {
2142            decoder.debug_check_bounds::<Self>(offset);
2143            let prim = decoder.read_num::<u32>(offset);
2144
2145            *self = Self::from_primitive_allow_unknown(prim);
2146            Ok(())
2147        }
2148    }
2149
2150    impl fidl::encoding::ValueTypeMarker for AccessRule {
2151        type Borrowed<'a> = &'a Self;
2152        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2153            value
2154        }
2155    }
2156
2157    unsafe impl fidl::encoding::TypeMarker for AccessRule {
2158        type Owned = Self;
2159
2160        #[inline(always)]
2161        fn inline_align(_context: fidl::encoding::Context) -> usize {
2162            8
2163        }
2164
2165        #[inline(always)]
2166        fn inline_size(_context: fidl::encoding::Context) -> usize {
2167            24
2168        }
2169    }
2170
2171    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessRule, D>
2172        for &AccessRule
2173    {
2174        #[inline]
2175        unsafe fn encode(
2176            self,
2177            encoder: &mut fidl::encoding::Encoder<'_, D>,
2178            offset: usize,
2179            _depth: fidl::encoding::Depth,
2180        ) -> fidl::Result<()> {
2181            encoder.debug_check_bounds::<AccessRule>(offset);
2182            // Delegate to tuple encoding.
2183            fidl::encoding::Encode::<AccessRule, D>::encode(
2184                (
2185                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
2186                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
2187                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
2188                    <AccessClass as fidl::encoding::ValueTypeMarker>::borrow(&self.class),
2189                ),
2190                encoder,
2191                offset,
2192                _depth,
2193            )
2194        }
2195    }
2196    unsafe impl<
2197        D: fidl::encoding::ResourceDialect,
2198        T0: fidl::encoding::Encode<u32, D>,
2199        T1: fidl::encoding::Encode<u64, D>,
2200        T2: fidl::encoding::Encode<u32, D>,
2201        T3: fidl::encoding::Encode<AccessClass, D>,
2202    > fidl::encoding::Encode<AccessRule, D> for (T0, T1, T2, T3)
2203    {
2204        #[inline]
2205        unsafe fn encode(
2206            self,
2207            encoder: &mut fidl::encoding::Encoder<'_, D>,
2208            offset: usize,
2209            depth: fidl::encoding::Depth,
2210        ) -> fidl::Result<()> {
2211            encoder.debug_check_bounds::<AccessRule>(offset);
2212            // Zero out padding regions. There's no need to apply masks
2213            // because the unmasked parts will be overwritten by fields.
2214            unsafe {
2215                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2216                (ptr as *mut u64).write_unaligned(0);
2217            }
2218            // Write the fields.
2219            self.0.encode(encoder, offset + 0, depth)?;
2220            self.1.encode(encoder, offset + 8, depth)?;
2221            self.2.encode(encoder, offset + 16, depth)?;
2222            self.3.encode(encoder, offset + 20, depth)?;
2223            Ok(())
2224        }
2225    }
2226
2227    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessRule {
2228        #[inline(always)]
2229        fn new_empty() -> Self {
2230            Self {
2231                resource: fidl::new_empty!(u32, D),
2232                offset: fidl::new_empty!(u64, D),
2233                width: fidl::new_empty!(u32, D),
2234                class: fidl::new_empty!(AccessClass, D),
2235            }
2236        }
2237
2238        #[inline]
2239        unsafe fn decode(
2240            &mut self,
2241            decoder: &mut fidl::encoding::Decoder<'_, D>,
2242            offset: usize,
2243            _depth: fidl::encoding::Depth,
2244        ) -> fidl::Result<()> {
2245            decoder.debug_check_bounds::<Self>(offset);
2246            // Verify that padding bytes are zero.
2247            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2248            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2249            let mask = 0xffffffff00000000u64;
2250            let maskedval = padval & mask;
2251            if maskedval != 0 {
2252                return Err(fidl::Error::NonZeroPadding {
2253                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2254                });
2255            }
2256            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
2257            fidl::decode!(u64, D, &mut self.offset, decoder, offset + 8, _depth)?;
2258            fidl::decode!(u32, D, &mut self.width, decoder, offset + 16, _depth)?;
2259            fidl::decode!(AccessClass, D, &mut self.class, decoder, offset + 20, _depth)?;
2260            Ok(())
2261        }
2262    }
2263
2264    impl fidl::encoding::ValueTypeMarker for AuditPage {
2265        type Borrowed<'a> = &'a Self;
2266        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2267            value
2268        }
2269    }
2270
2271    unsafe impl fidl::encoding::TypeMarker for AuditPage {
2272        type Owned = Self;
2273
2274        #[inline(always)]
2275        fn inline_align(_context: fidl::encoding::Context) -> usize {
2276            8
2277        }
2278
2279        #[inline(always)]
2280        fn inline_size(_context: fidl::encoding::Context) -> usize {
2281            40
2282        }
2283    }
2284
2285    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AuditPage, D>
2286        for &AuditPage
2287    {
2288        #[inline]
2289        unsafe fn encode(
2290            self,
2291            encoder: &mut fidl::encoding::Encoder<'_, D>,
2292            offset: usize,
2293            _depth: fidl::encoding::Depth,
2294        ) -> fidl::Result<()> {
2295            encoder.debug_check_bounds::<AuditPage>(offset);
2296            // Delegate to tuple encoding.
2297            fidl::encoding::Encode::<AuditPage, D>::encode(
2298                (
2299                    <fidl::encoding::Vector<AuditEntry, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.entries),
2300                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_oldest),
2301                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.oldest_retained),
2302                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.next_cursor),
2303                ),
2304                encoder, offset, _depth
2305            )
2306        }
2307    }
2308    unsafe impl<
2309        D: fidl::encoding::ResourceDialect,
2310        T0: fidl::encoding::Encode<fidl::encoding::Vector<AuditEntry, 64>, D>,
2311        T1: fidl::encoding::Encode<bool, D>,
2312        T2: fidl::encoding::Encode<u64, D>,
2313        T3: fidl::encoding::Encode<u64, D>,
2314    > fidl::encoding::Encode<AuditPage, D> for (T0, T1, T2, T3)
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::<AuditPage>(offset);
2324            // Zero out padding regions. There's no need to apply masks
2325            // because the unmasked parts will be overwritten by fields.
2326            unsafe {
2327                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2328                (ptr as *mut u64).write_unaligned(0);
2329            }
2330            // Write the fields.
2331            self.0.encode(encoder, offset + 0, depth)?;
2332            self.1.encode(encoder, offset + 16, depth)?;
2333            self.2.encode(encoder, offset + 24, depth)?;
2334            self.3.encode(encoder, offset + 32, depth)?;
2335            Ok(())
2336        }
2337    }
2338
2339    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AuditPage {
2340        #[inline(always)]
2341        fn new_empty() -> Self {
2342            Self {
2343                entries: fidl::new_empty!(fidl::encoding::Vector<AuditEntry, 64>, D),
2344                has_oldest: fidl::new_empty!(bool, D),
2345                oldest_retained: fidl::new_empty!(u64, D),
2346                next_cursor: fidl::new_empty!(u64, D),
2347            }
2348        }
2349
2350        #[inline]
2351        unsafe fn decode(
2352            &mut self,
2353            decoder: &mut fidl::encoding::Decoder<'_, D>,
2354            offset: usize,
2355            _depth: fidl::encoding::Depth,
2356        ) -> fidl::Result<()> {
2357            decoder.debug_check_bounds::<Self>(offset);
2358            // Verify that padding bytes are zero.
2359            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2360            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2361            let mask = 0xffffffffffffff00u64;
2362            let maskedval = padval & mask;
2363            if maskedval != 0 {
2364                return Err(fidl::Error::NonZeroPadding {
2365                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2366                });
2367            }
2368            fidl::decode!(fidl::encoding::Vector<AuditEntry, 64>, D, &mut self.entries, decoder, offset + 0, _depth)?;
2369            fidl::decode!(bool, D, &mut self.has_oldest, decoder, offset + 16, _depth)?;
2370            fidl::decode!(u64, D, &mut self.oldest_retained, decoder, offset + 24, _depth)?;
2371            fidl::decode!(u64, D, &mut self.next_cursor, decoder, offset + 32, _depth)?;
2372            Ok(())
2373        }
2374    }
2375
2376    impl fidl::encoding::ValueTypeMarker for Barrier {
2377        type Borrowed<'a> = &'a Self;
2378        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2379            value
2380        }
2381    }
2382
2383    unsafe impl fidl::encoding::TypeMarker for Barrier {
2384        type Owned = Self;
2385
2386        #[inline(always)]
2387        fn inline_align(_context: fidl::encoding::Context) -> usize {
2388            1
2389        }
2390
2391        #[inline(always)]
2392        fn inline_size(_context: fidl::encoding::Context) -> usize {
2393            1
2394        }
2395    }
2396
2397    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Barrier, D> for &Barrier {
2398        #[inline]
2399        unsafe fn encode(
2400            self,
2401            encoder: &mut fidl::encoding::Encoder<'_, D>,
2402            offset: usize,
2403            _depth: fidl::encoding::Depth,
2404        ) -> fidl::Result<()> {
2405            encoder.debug_check_bounds::<Barrier>(offset);
2406            encoder.write_num(0u8, offset);
2407            Ok(())
2408        }
2409    }
2410
2411    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Barrier {
2412        #[inline(always)]
2413        fn new_empty() -> Self {
2414            Self
2415        }
2416
2417        #[inline]
2418        unsafe fn decode(
2419            &mut self,
2420            decoder: &mut fidl::encoding::Decoder<'_, D>,
2421            offset: usize,
2422            _depth: fidl::encoding::Depth,
2423        ) -> fidl::Result<()> {
2424            decoder.debug_check_bounds::<Self>(offset);
2425            match decoder.read_num::<u8>(offset) {
2426                0 => Ok(()),
2427                _ => Err(fidl::Error::Invalid),
2428            }
2429        }
2430    }
2431
2432    impl fidl::encoding::ValueTypeMarker for ClockDisableResult {
2433        type Borrowed<'a> = &'a Self;
2434        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2435            value
2436        }
2437    }
2438
2439    unsafe impl fidl::encoding::TypeMarker for ClockDisableResult {
2440        type Owned = Self;
2441
2442        #[inline(always)]
2443        fn inline_align(_context: fidl::encoding::Context) -> usize {
2444            8
2445        }
2446
2447        #[inline(always)]
2448        fn inline_size(_context: fidl::encoding::Context) -> usize {
2449            16
2450        }
2451        #[inline(always)]
2452        fn encode_is_copy() -> bool {
2453            true
2454        }
2455
2456        #[inline(always)]
2457        fn decode_is_copy() -> bool {
2458            true
2459        }
2460    }
2461
2462    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClockDisableResult, D>
2463        for &ClockDisableResult
2464    {
2465        #[inline]
2466        unsafe fn encode(
2467            self,
2468            encoder: &mut fidl::encoding::Encoder<'_, D>,
2469            offset: usize,
2470            _depth: fidl::encoding::Depth,
2471        ) -> fidl::Result<()> {
2472            encoder.debug_check_bounds::<ClockDisableResult>(offset);
2473            unsafe {
2474                // Copy the object into the buffer.
2475                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2476                (buf_ptr as *mut ClockDisableResult)
2477                    .write_unaligned((self as *const ClockDisableResult).read());
2478                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2479                // done second because the memcpy will write garbage to these bytes.
2480            }
2481            Ok(())
2482        }
2483    }
2484    unsafe impl<
2485        D: fidl::encoding::ResourceDialect,
2486        T0: fidl::encoding::Encode<u64, D>,
2487        T1: fidl::encoding::Encode<i64, D>,
2488    > fidl::encoding::Encode<ClockDisableResult, D> for (T0, T1)
2489    {
2490        #[inline]
2491        unsafe fn encode(
2492            self,
2493            encoder: &mut fidl::encoding::Encoder<'_, D>,
2494            offset: usize,
2495            depth: fidl::encoding::Depth,
2496        ) -> fidl::Result<()> {
2497            encoder.debug_check_bounds::<ClockDisableResult>(offset);
2498            // Zero out padding regions. There's no need to apply masks
2499            // because the unmasked parts will be overwritten by fields.
2500            // Write the fields.
2501            self.0.encode(encoder, offset + 0, depth)?;
2502            self.1.encode(encoder, offset + 8, depth)?;
2503            Ok(())
2504        }
2505    }
2506
2507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClockDisableResult {
2508        #[inline(always)]
2509        fn new_empty() -> Self {
2510            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
2511        }
2512
2513        #[inline]
2514        unsafe fn decode(
2515            &mut self,
2516            decoder: &mut fidl::encoding::Decoder<'_, D>,
2517            offset: usize,
2518            _depth: fidl::encoding::Depth,
2519        ) -> fidl::Result<()> {
2520            decoder.debug_check_bounds::<Self>(offset);
2521            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2522            // Verify that padding bytes are zero.
2523            // Copy from the buffer into the object.
2524            unsafe {
2525                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2526            }
2527            Ok(())
2528        }
2529    }
2530
2531    impl fidl::encoding::ValueTypeMarker for ClockEnableResult {
2532        type Borrowed<'a> = &'a Self;
2533        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2534            value
2535        }
2536    }
2537
2538    unsafe impl fidl::encoding::TypeMarker for ClockEnableResult {
2539        type Owned = Self;
2540
2541        #[inline(always)]
2542        fn inline_align(_context: fidl::encoding::Context) -> usize {
2543            8
2544        }
2545
2546        #[inline(always)]
2547        fn inline_size(_context: fidl::encoding::Context) -> usize {
2548            16
2549        }
2550        #[inline(always)]
2551        fn encode_is_copy() -> bool {
2552            true
2553        }
2554
2555        #[inline(always)]
2556        fn decode_is_copy() -> bool {
2557            true
2558        }
2559    }
2560
2561    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClockEnableResult, D>
2562        for &ClockEnableResult
2563    {
2564        #[inline]
2565        unsafe fn encode(
2566            self,
2567            encoder: &mut fidl::encoding::Encoder<'_, D>,
2568            offset: usize,
2569            _depth: fidl::encoding::Depth,
2570        ) -> fidl::Result<()> {
2571            encoder.debug_check_bounds::<ClockEnableResult>(offset);
2572            unsafe {
2573                // Copy the object into the buffer.
2574                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2575                (buf_ptr as *mut ClockEnableResult)
2576                    .write_unaligned((self as *const ClockEnableResult).read());
2577                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2578                // done second because the memcpy will write garbage to these bytes.
2579            }
2580            Ok(())
2581        }
2582    }
2583    unsafe impl<
2584        D: fidl::encoding::ResourceDialect,
2585        T0: fidl::encoding::Encode<u64, D>,
2586        T1: fidl::encoding::Encode<i64, D>,
2587    > fidl::encoding::Encode<ClockEnableResult, D> for (T0, T1)
2588    {
2589        #[inline]
2590        unsafe fn encode(
2591            self,
2592            encoder: &mut fidl::encoding::Encoder<'_, D>,
2593            offset: usize,
2594            depth: fidl::encoding::Depth,
2595        ) -> fidl::Result<()> {
2596            encoder.debug_check_bounds::<ClockEnableResult>(offset);
2597            // Zero out padding regions. There's no need to apply masks
2598            // because the unmasked parts will be overwritten by fields.
2599            // Write the fields.
2600            self.0.encode(encoder, offset + 0, depth)?;
2601            self.1.encode(encoder, offset + 8, depth)?;
2602            Ok(())
2603        }
2604    }
2605
2606    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClockEnableResult {
2607        #[inline(always)]
2608        fn new_empty() -> Self {
2609            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
2610        }
2611
2612        #[inline]
2613        unsafe fn decode(
2614            &mut self,
2615            decoder: &mut fidl::encoding::Decoder<'_, D>,
2616            offset: usize,
2617            _depth: fidl::encoding::Depth,
2618        ) -> fidl::Result<()> {
2619            decoder.debug_check_bounds::<Self>(offset);
2620            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2621            // Verify that padding bytes are zero.
2622            // Copy from the buffer into the object.
2623            unsafe {
2624                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2625            }
2626            Ok(())
2627        }
2628    }
2629
2630    impl fidl::encoding::ValueTypeMarker for ClockGetRateResult {
2631        type Borrowed<'a> = &'a Self;
2632        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2633            value
2634        }
2635    }
2636
2637    unsafe impl fidl::encoding::TypeMarker for ClockGetRateResult {
2638        type Owned = Self;
2639
2640        #[inline(always)]
2641        fn inline_align(_context: fidl::encoding::Context) -> usize {
2642            8
2643        }
2644
2645        #[inline(always)]
2646        fn inline_size(_context: fidl::encoding::Context) -> usize {
2647            24
2648        }
2649        #[inline(always)]
2650        fn encode_is_copy() -> bool {
2651            true
2652        }
2653
2654        #[inline(always)]
2655        fn decode_is_copy() -> bool {
2656            true
2657        }
2658    }
2659
2660    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClockGetRateResult, D>
2661        for &ClockGetRateResult
2662    {
2663        #[inline]
2664        unsafe fn encode(
2665            self,
2666            encoder: &mut fidl::encoding::Encoder<'_, D>,
2667            offset: usize,
2668            _depth: fidl::encoding::Depth,
2669        ) -> fidl::Result<()> {
2670            encoder.debug_check_bounds::<ClockGetRateResult>(offset);
2671            unsafe {
2672                // Copy the object into the buffer.
2673                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2674                (buf_ptr as *mut ClockGetRateResult)
2675                    .write_unaligned((self as *const ClockGetRateResult).read());
2676                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2677                // done second because the memcpy will write garbage to these bytes.
2678            }
2679            Ok(())
2680        }
2681    }
2682    unsafe impl<
2683        D: fidl::encoding::ResourceDialect,
2684        T0: fidl::encoding::Encode<u64, D>,
2685        T1: fidl::encoding::Encode<u64, D>,
2686        T2: fidl::encoding::Encode<i64, D>,
2687    > fidl::encoding::Encode<ClockGetRateResult, D> for (T0, T1, T2)
2688    {
2689        #[inline]
2690        unsafe fn encode(
2691            self,
2692            encoder: &mut fidl::encoding::Encoder<'_, D>,
2693            offset: usize,
2694            depth: fidl::encoding::Depth,
2695        ) -> fidl::Result<()> {
2696            encoder.debug_check_bounds::<ClockGetRateResult>(offset);
2697            // Zero out padding regions. There's no need to apply masks
2698            // because the unmasked parts will be overwritten by fields.
2699            // Write the fields.
2700            self.0.encode(encoder, offset + 0, depth)?;
2701            self.1.encode(encoder, offset + 8, depth)?;
2702            self.2.encode(encoder, offset + 16, depth)?;
2703            Ok(())
2704        }
2705    }
2706
2707    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClockGetRateResult {
2708        #[inline(always)]
2709        fn new_empty() -> Self {
2710            Self {
2711                hz: fidl::new_empty!(u64, D),
2712                audit_seq: fidl::new_empty!(u64, D),
2713                timestamp_ns: fidl::new_empty!(i64, D),
2714            }
2715        }
2716
2717        #[inline]
2718        unsafe fn decode(
2719            &mut self,
2720            decoder: &mut fidl::encoding::Decoder<'_, D>,
2721            offset: usize,
2722            _depth: fidl::encoding::Depth,
2723        ) -> fidl::Result<()> {
2724            decoder.debug_check_bounds::<Self>(offset);
2725            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2726            // Verify that padding bytes are zero.
2727            // Copy from the buffer into the object.
2728            unsafe {
2729                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
2730            }
2731            Ok(())
2732        }
2733    }
2734
2735    impl fidl::encoding::ValueTypeMarker for ClockIsEnabledResult {
2736        type Borrowed<'a> = &'a Self;
2737        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2738            value
2739        }
2740    }
2741
2742    unsafe impl fidl::encoding::TypeMarker for ClockIsEnabledResult {
2743        type Owned = Self;
2744
2745        #[inline(always)]
2746        fn inline_align(_context: fidl::encoding::Context) -> usize {
2747            8
2748        }
2749
2750        #[inline(always)]
2751        fn inline_size(_context: fidl::encoding::Context) -> usize {
2752            24
2753        }
2754    }
2755
2756    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClockIsEnabledResult, D>
2757        for &ClockIsEnabledResult
2758    {
2759        #[inline]
2760        unsafe fn encode(
2761            self,
2762            encoder: &mut fidl::encoding::Encoder<'_, D>,
2763            offset: usize,
2764            _depth: fidl::encoding::Depth,
2765        ) -> fidl::Result<()> {
2766            encoder.debug_check_bounds::<ClockIsEnabledResult>(offset);
2767            // Delegate to tuple encoding.
2768            fidl::encoding::Encode::<ClockIsEnabledResult, D>::encode(
2769                (
2770                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),
2771                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
2772                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
2773                ),
2774                encoder,
2775                offset,
2776                _depth,
2777            )
2778        }
2779    }
2780    unsafe impl<
2781        D: fidl::encoding::ResourceDialect,
2782        T0: fidl::encoding::Encode<bool, D>,
2783        T1: fidl::encoding::Encode<u64, D>,
2784        T2: fidl::encoding::Encode<i64, D>,
2785    > fidl::encoding::Encode<ClockIsEnabledResult, D> for (T0, T1, T2)
2786    {
2787        #[inline]
2788        unsafe fn encode(
2789            self,
2790            encoder: &mut fidl::encoding::Encoder<'_, D>,
2791            offset: usize,
2792            depth: fidl::encoding::Depth,
2793        ) -> fidl::Result<()> {
2794            encoder.debug_check_bounds::<ClockIsEnabledResult>(offset);
2795            // Zero out padding regions. There's no need to apply masks
2796            // because the unmasked parts will be overwritten by fields.
2797            unsafe {
2798                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2799                (ptr as *mut u64).write_unaligned(0);
2800            }
2801            // Write the fields.
2802            self.0.encode(encoder, offset + 0, depth)?;
2803            self.1.encode(encoder, offset + 8, depth)?;
2804            self.2.encode(encoder, offset + 16, depth)?;
2805            Ok(())
2806        }
2807    }
2808
2809    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClockIsEnabledResult {
2810        #[inline(always)]
2811        fn new_empty() -> Self {
2812            Self {
2813                enabled: fidl::new_empty!(bool, D),
2814                audit_seq: fidl::new_empty!(u64, D),
2815                timestamp_ns: fidl::new_empty!(i64, D),
2816            }
2817        }
2818
2819        #[inline]
2820        unsafe fn decode(
2821            &mut self,
2822            decoder: &mut fidl::encoding::Decoder<'_, D>,
2823            offset: usize,
2824            _depth: fidl::encoding::Depth,
2825        ) -> fidl::Result<()> {
2826            decoder.debug_check_bounds::<Self>(offset);
2827            // Verify that padding bytes are zero.
2828            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2829            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2830            let mask = 0xffffffffffffff00u64;
2831            let maskedval = padval & mask;
2832            if maskedval != 0 {
2833                return Err(fidl::Error::NonZeroPadding {
2834                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2835                });
2836            }
2837            fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
2838            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 8, _depth)?;
2839            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 16, _depth)?;
2840            Ok(())
2841        }
2842    }
2843
2844    impl fidl::encoding::ValueTypeMarker for ClockQueryRateResult {
2845        type Borrowed<'a> = &'a Self;
2846        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2847            value
2848        }
2849    }
2850
2851    unsafe impl fidl::encoding::TypeMarker for ClockQueryRateResult {
2852        type Owned = Self;
2853
2854        #[inline(always)]
2855        fn inline_align(_context: fidl::encoding::Context) -> usize {
2856            8
2857        }
2858
2859        #[inline(always)]
2860        fn inline_size(_context: fidl::encoding::Context) -> usize {
2861            24
2862        }
2863        #[inline(always)]
2864        fn encode_is_copy() -> bool {
2865            true
2866        }
2867
2868        #[inline(always)]
2869        fn decode_is_copy() -> bool {
2870            true
2871        }
2872    }
2873
2874    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClockQueryRateResult, D>
2875        for &ClockQueryRateResult
2876    {
2877        #[inline]
2878        unsafe fn encode(
2879            self,
2880            encoder: &mut fidl::encoding::Encoder<'_, D>,
2881            offset: usize,
2882            _depth: fidl::encoding::Depth,
2883        ) -> fidl::Result<()> {
2884            encoder.debug_check_bounds::<ClockQueryRateResult>(offset);
2885            unsafe {
2886                // Copy the object into the buffer.
2887                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2888                (buf_ptr as *mut ClockQueryRateResult)
2889                    .write_unaligned((self as *const ClockQueryRateResult).read());
2890                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2891                // done second because the memcpy will write garbage to these bytes.
2892            }
2893            Ok(())
2894        }
2895    }
2896    unsafe impl<
2897        D: fidl::encoding::ResourceDialect,
2898        T0: fidl::encoding::Encode<u64, D>,
2899        T1: fidl::encoding::Encode<u64, D>,
2900        T2: fidl::encoding::Encode<i64, D>,
2901    > fidl::encoding::Encode<ClockQueryRateResult, D> for (T0, T1, T2)
2902    {
2903        #[inline]
2904        unsafe fn encode(
2905            self,
2906            encoder: &mut fidl::encoding::Encoder<'_, D>,
2907            offset: usize,
2908            depth: fidl::encoding::Depth,
2909        ) -> fidl::Result<()> {
2910            encoder.debug_check_bounds::<ClockQueryRateResult>(offset);
2911            // Zero out padding regions. There's no need to apply masks
2912            // because the unmasked parts will be overwritten by fields.
2913            // Write the fields.
2914            self.0.encode(encoder, offset + 0, depth)?;
2915            self.1.encode(encoder, offset + 8, depth)?;
2916            self.2.encode(encoder, offset + 16, depth)?;
2917            Ok(())
2918        }
2919    }
2920
2921    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClockQueryRateResult {
2922        #[inline(always)]
2923        fn new_empty() -> Self {
2924            Self {
2925                hz_out: fidl::new_empty!(u64, D),
2926                audit_seq: fidl::new_empty!(u64, D),
2927                timestamp_ns: fidl::new_empty!(i64, D),
2928            }
2929        }
2930
2931        #[inline]
2932        unsafe fn decode(
2933            &mut self,
2934            decoder: &mut fidl::encoding::Decoder<'_, D>,
2935            offset: usize,
2936            _depth: fidl::encoding::Depth,
2937        ) -> fidl::Result<()> {
2938            decoder.debug_check_bounds::<Self>(offset);
2939            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2940            // Verify that padding bytes are zero.
2941            // Copy from the buffer into the object.
2942            unsafe {
2943                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
2944            }
2945            Ok(())
2946        }
2947    }
2948
2949    impl fidl::encoding::ValueTypeMarker for ClockSetRateResult {
2950        type Borrowed<'a> = &'a Self;
2951        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2952            value
2953        }
2954    }
2955
2956    unsafe impl fidl::encoding::TypeMarker for ClockSetRateResult {
2957        type Owned = Self;
2958
2959        #[inline(always)]
2960        fn inline_align(_context: fidl::encoding::Context) -> usize {
2961            8
2962        }
2963
2964        #[inline(always)]
2965        fn inline_size(_context: fidl::encoding::Context) -> usize {
2966            16
2967        }
2968        #[inline(always)]
2969        fn encode_is_copy() -> bool {
2970            true
2971        }
2972
2973        #[inline(always)]
2974        fn decode_is_copy() -> bool {
2975            true
2976        }
2977    }
2978
2979    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClockSetRateResult, D>
2980        for &ClockSetRateResult
2981    {
2982        #[inline]
2983        unsafe fn encode(
2984            self,
2985            encoder: &mut fidl::encoding::Encoder<'_, D>,
2986            offset: usize,
2987            _depth: fidl::encoding::Depth,
2988        ) -> fidl::Result<()> {
2989            encoder.debug_check_bounds::<ClockSetRateResult>(offset);
2990            unsafe {
2991                // Copy the object into the buffer.
2992                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2993                (buf_ptr as *mut ClockSetRateResult)
2994                    .write_unaligned((self as *const ClockSetRateResult).read());
2995                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2996                // done second because the memcpy will write garbage to these bytes.
2997            }
2998            Ok(())
2999        }
3000    }
3001    unsafe impl<
3002        D: fidl::encoding::ResourceDialect,
3003        T0: fidl::encoding::Encode<u64, D>,
3004        T1: fidl::encoding::Encode<i64, D>,
3005    > fidl::encoding::Encode<ClockSetRateResult, D> for (T0, T1)
3006    {
3007        #[inline]
3008        unsafe fn encode(
3009            self,
3010            encoder: &mut fidl::encoding::Encoder<'_, D>,
3011            offset: usize,
3012            depth: fidl::encoding::Depth,
3013        ) -> fidl::Result<()> {
3014            encoder.debug_check_bounds::<ClockSetRateResult>(offset);
3015            // Zero out padding regions. There's no need to apply masks
3016            // because the unmasked parts will be overwritten by fields.
3017            // Write the fields.
3018            self.0.encode(encoder, offset + 0, depth)?;
3019            self.1.encode(encoder, offset + 8, depth)?;
3020            Ok(())
3021        }
3022    }
3023
3024    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClockSetRateResult {
3025        #[inline(always)]
3026        fn new_empty() -> Self {
3027            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
3028        }
3029
3030        #[inline]
3031        unsafe fn decode(
3032            &mut self,
3033            decoder: &mut fidl::encoding::Decoder<'_, D>,
3034            offset: usize,
3035            _depth: fidl::encoding::Depth,
3036        ) -> fidl::Result<()> {
3037            decoder.debug_check_bounds::<Self>(offset);
3038            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3039            // Verify that padding bytes are zero.
3040            // Copy from the buffer into the object.
3041            unsafe {
3042                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3043            }
3044            Ok(())
3045        }
3046    }
3047
3048    impl fidl::encoding::ValueTypeMarker for DelayNs {
3049        type Borrowed<'a> = &'a Self;
3050        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3051            value
3052        }
3053    }
3054
3055    unsafe impl fidl::encoding::TypeMarker for DelayNs {
3056        type Owned = Self;
3057
3058        #[inline(always)]
3059        fn inline_align(_context: fidl::encoding::Context) -> usize {
3060            1
3061        }
3062
3063        #[inline(always)]
3064        fn inline_size(_context: fidl::encoding::Context) -> usize {
3065            1
3066        }
3067    }
3068
3069    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DelayNs, D> for &DelayNs {
3070        #[inline]
3071        unsafe fn encode(
3072            self,
3073            encoder: &mut fidl::encoding::Encoder<'_, D>,
3074            offset: usize,
3075            _depth: fidl::encoding::Depth,
3076        ) -> fidl::Result<()> {
3077            encoder.debug_check_bounds::<DelayNs>(offset);
3078            encoder.write_num(0u8, offset);
3079            Ok(())
3080        }
3081    }
3082
3083    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DelayNs {
3084        #[inline(always)]
3085        fn new_empty() -> Self {
3086            Self
3087        }
3088
3089        #[inline]
3090        unsafe fn decode(
3091            &mut self,
3092            decoder: &mut fidl::encoding::Decoder<'_, D>,
3093            offset: usize,
3094            _depth: fidl::encoding::Depth,
3095        ) -> fidl::Result<()> {
3096            decoder.debug_check_bounds::<Self>(offset);
3097            match decoder.read_num::<u8>(offset) {
3098                0 => Ok(()),
3099                _ => Err(fidl::Error::Invalid),
3100            }
3101        }
3102    }
3103
3104    impl fidl::encoding::ValueTypeMarker for GpioEndpointWriteRequest {
3105        type Borrowed<'a> = &'a Self;
3106        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3107            value
3108        }
3109    }
3110
3111    unsafe impl fidl::encoding::TypeMarker for GpioEndpointWriteRequest {
3112        type Owned = Self;
3113
3114        #[inline(always)]
3115        fn inline_align(_context: fidl::encoding::Context) -> usize {
3116            1
3117        }
3118
3119        #[inline(always)]
3120        fn inline_size(_context: fidl::encoding::Context) -> usize {
3121            1
3122        }
3123    }
3124
3125    unsafe impl<D: fidl::encoding::ResourceDialect>
3126        fidl::encoding::Encode<GpioEndpointWriteRequest, D> for &GpioEndpointWriteRequest
3127    {
3128        #[inline]
3129        unsafe fn encode(
3130            self,
3131            encoder: &mut fidl::encoding::Encoder<'_, D>,
3132            offset: usize,
3133            _depth: fidl::encoding::Depth,
3134        ) -> fidl::Result<()> {
3135            encoder.debug_check_bounds::<GpioEndpointWriteRequest>(offset);
3136            // Delegate to tuple encoding.
3137            fidl::encoding::Encode::<GpioEndpointWriteRequest, D>::encode(
3138                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
3139                encoder,
3140                offset,
3141                _depth,
3142            )
3143        }
3144    }
3145    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3146        fidl::encoding::Encode<GpioEndpointWriteRequest, D> for (T0,)
3147    {
3148        #[inline]
3149        unsafe fn encode(
3150            self,
3151            encoder: &mut fidl::encoding::Encoder<'_, D>,
3152            offset: usize,
3153            depth: fidl::encoding::Depth,
3154        ) -> fidl::Result<()> {
3155            encoder.debug_check_bounds::<GpioEndpointWriteRequest>(offset);
3156            // Zero out padding regions. There's no need to apply masks
3157            // because the unmasked parts will be overwritten by fields.
3158            // Write the fields.
3159            self.0.encode(encoder, offset + 0, depth)?;
3160            Ok(())
3161        }
3162    }
3163
3164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3165        for GpioEndpointWriteRequest
3166    {
3167        #[inline(always)]
3168        fn new_empty() -> Self {
3169            Self { value: fidl::new_empty!(bool, D) }
3170        }
3171
3172        #[inline]
3173        unsafe fn decode(
3174            &mut self,
3175            decoder: &mut fidl::encoding::Decoder<'_, D>,
3176            offset: usize,
3177            _depth: fidl::encoding::Depth,
3178        ) -> fidl::Result<()> {
3179            decoder.debug_check_bounds::<Self>(offset);
3180            // Verify that padding bytes are zero.
3181            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3182            Ok(())
3183        }
3184    }
3185
3186    impl fidl::encoding::ValueTypeMarker for GpioRead {
3187        type Borrowed<'a> = &'a Self;
3188        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3189            value
3190        }
3191    }
3192
3193    unsafe impl fidl::encoding::TypeMarker for GpioRead {
3194        type Owned = Self;
3195
3196        #[inline(always)]
3197        fn inline_align(_context: fidl::encoding::Context) -> usize {
3198            4
3199        }
3200
3201        #[inline(always)]
3202        fn inline_size(_context: fidl::encoding::Context) -> usize {
3203            4
3204        }
3205        #[inline(always)]
3206        fn encode_is_copy() -> bool {
3207            true
3208        }
3209
3210        #[inline(always)]
3211        fn decode_is_copy() -> bool {
3212            true
3213        }
3214    }
3215
3216    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GpioRead, D> for &GpioRead {
3217        #[inline]
3218        unsafe fn encode(
3219            self,
3220            encoder: &mut fidl::encoding::Encoder<'_, D>,
3221            offset: usize,
3222            _depth: fidl::encoding::Depth,
3223        ) -> fidl::Result<()> {
3224            encoder.debug_check_bounds::<GpioRead>(offset);
3225            unsafe {
3226                // Copy the object into the buffer.
3227                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3228                (buf_ptr as *mut GpioRead).write_unaligned((self as *const GpioRead).read());
3229                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3230                // done second because the memcpy will write garbage to these bytes.
3231            }
3232            Ok(())
3233        }
3234    }
3235    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3236        fidl::encoding::Encode<GpioRead, D> for (T0,)
3237    {
3238        #[inline]
3239        unsafe fn encode(
3240            self,
3241            encoder: &mut fidl::encoding::Encoder<'_, D>,
3242            offset: usize,
3243            depth: fidl::encoding::Depth,
3244        ) -> fidl::Result<()> {
3245            encoder.debug_check_bounds::<GpioRead>(offset);
3246            // Zero out padding regions. There's no need to apply masks
3247            // because the unmasked parts will be overwritten by fields.
3248            // Write the fields.
3249            self.0.encode(encoder, offset + 0, depth)?;
3250            Ok(())
3251        }
3252    }
3253
3254    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GpioRead {
3255        #[inline(always)]
3256        fn new_empty() -> Self {
3257            Self { resource: fidl::new_empty!(u32, D) }
3258        }
3259
3260        #[inline]
3261        unsafe fn decode(
3262            &mut self,
3263            decoder: &mut fidl::encoding::Decoder<'_, D>,
3264            offset: usize,
3265            _depth: fidl::encoding::Depth,
3266        ) -> fidl::Result<()> {
3267            decoder.debug_check_bounds::<Self>(offset);
3268            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3269            // Verify that padding bytes are zero.
3270            // Copy from the buffer into the object.
3271            unsafe {
3272                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3273            }
3274            Ok(())
3275        }
3276    }
3277
3278    impl fidl::encoding::ValueTypeMarker for GpioReadResult {
3279        type Borrowed<'a> = &'a Self;
3280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3281            value
3282        }
3283    }
3284
3285    unsafe impl fidl::encoding::TypeMarker for GpioReadResult {
3286        type Owned = Self;
3287
3288        #[inline(always)]
3289        fn inline_align(_context: fidl::encoding::Context) -> usize {
3290            8
3291        }
3292
3293        #[inline(always)]
3294        fn inline_size(_context: fidl::encoding::Context) -> usize {
3295            24
3296        }
3297    }
3298
3299    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GpioReadResult, D>
3300        for &GpioReadResult
3301    {
3302        #[inline]
3303        unsafe fn encode(
3304            self,
3305            encoder: &mut fidl::encoding::Encoder<'_, D>,
3306            offset: usize,
3307            _depth: fidl::encoding::Depth,
3308        ) -> fidl::Result<()> {
3309            encoder.debug_check_bounds::<GpioReadResult>(offset);
3310            // Delegate to tuple encoding.
3311            fidl::encoding::Encode::<GpioReadResult, D>::encode(
3312                (
3313                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3314                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
3315                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
3316                ),
3317                encoder,
3318                offset,
3319                _depth,
3320            )
3321        }
3322    }
3323    unsafe impl<
3324        D: fidl::encoding::ResourceDialect,
3325        T0: fidl::encoding::Encode<bool, D>,
3326        T1: fidl::encoding::Encode<u64, D>,
3327        T2: fidl::encoding::Encode<i64, D>,
3328    > fidl::encoding::Encode<GpioReadResult, D> for (T0, T1, T2)
3329    {
3330        #[inline]
3331        unsafe fn encode(
3332            self,
3333            encoder: &mut fidl::encoding::Encoder<'_, D>,
3334            offset: usize,
3335            depth: fidl::encoding::Depth,
3336        ) -> fidl::Result<()> {
3337            encoder.debug_check_bounds::<GpioReadResult>(offset);
3338            // Zero out padding regions. There's no need to apply masks
3339            // because the unmasked parts will be overwritten by fields.
3340            unsafe {
3341                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3342                (ptr as *mut u64).write_unaligned(0);
3343            }
3344            // Write the fields.
3345            self.0.encode(encoder, offset + 0, depth)?;
3346            self.1.encode(encoder, offset + 8, depth)?;
3347            self.2.encode(encoder, offset + 16, depth)?;
3348            Ok(())
3349        }
3350    }
3351
3352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GpioReadResult {
3353        #[inline(always)]
3354        fn new_empty() -> Self {
3355            Self {
3356                value: fidl::new_empty!(bool, D),
3357                audit_seq: fidl::new_empty!(u64, D),
3358                timestamp_ns: fidl::new_empty!(i64, D),
3359            }
3360        }
3361
3362        #[inline]
3363        unsafe fn decode(
3364            &mut self,
3365            decoder: &mut fidl::encoding::Decoder<'_, D>,
3366            offset: usize,
3367            _depth: fidl::encoding::Depth,
3368        ) -> fidl::Result<()> {
3369            decoder.debug_check_bounds::<Self>(offset);
3370            // Verify that padding bytes are zero.
3371            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3372            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3373            let mask = 0xffffffffffffff00u64;
3374            let maskedval = padval & mask;
3375            if maskedval != 0 {
3376                return Err(fidl::Error::NonZeroPadding {
3377                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3378                });
3379            }
3380            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
3381            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 8, _depth)?;
3382            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 16, _depth)?;
3383            Ok(())
3384        }
3385    }
3386
3387    impl fidl::encoding::ValueTypeMarker for GpioWrite {
3388        type Borrowed<'a> = &'a Self;
3389        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3390            value
3391        }
3392    }
3393
3394    unsafe impl fidl::encoding::TypeMarker for GpioWrite {
3395        type Owned = Self;
3396
3397        #[inline(always)]
3398        fn inline_align(_context: fidl::encoding::Context) -> usize {
3399            4
3400        }
3401
3402        #[inline(always)]
3403        fn inline_size(_context: fidl::encoding::Context) -> usize {
3404            8
3405        }
3406    }
3407
3408    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GpioWrite, D>
3409        for &GpioWrite
3410    {
3411        #[inline]
3412        unsafe fn encode(
3413            self,
3414            encoder: &mut fidl::encoding::Encoder<'_, D>,
3415            offset: usize,
3416            _depth: fidl::encoding::Depth,
3417        ) -> fidl::Result<()> {
3418            encoder.debug_check_bounds::<GpioWrite>(offset);
3419            // Delegate to tuple encoding.
3420            fidl::encoding::Encode::<GpioWrite, D>::encode(
3421                (
3422                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
3423                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
3424                ),
3425                encoder,
3426                offset,
3427                _depth,
3428            )
3429        }
3430    }
3431    unsafe impl<
3432        D: fidl::encoding::ResourceDialect,
3433        T0: fidl::encoding::Encode<u32, D>,
3434        T1: fidl::encoding::Encode<bool, D>,
3435    > fidl::encoding::Encode<GpioWrite, D> for (T0, T1)
3436    {
3437        #[inline]
3438        unsafe fn encode(
3439            self,
3440            encoder: &mut fidl::encoding::Encoder<'_, D>,
3441            offset: usize,
3442            depth: fidl::encoding::Depth,
3443        ) -> fidl::Result<()> {
3444            encoder.debug_check_bounds::<GpioWrite>(offset);
3445            // Zero out padding regions. There's no need to apply masks
3446            // because the unmasked parts will be overwritten by fields.
3447            unsafe {
3448                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
3449                (ptr as *mut u32).write_unaligned(0);
3450            }
3451            // Write the fields.
3452            self.0.encode(encoder, offset + 0, depth)?;
3453            self.1.encode(encoder, offset + 4, depth)?;
3454            Ok(())
3455        }
3456    }
3457
3458    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GpioWrite {
3459        #[inline(always)]
3460        fn new_empty() -> Self {
3461            Self { resource: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
3462        }
3463
3464        #[inline]
3465        unsafe fn decode(
3466            &mut self,
3467            decoder: &mut fidl::encoding::Decoder<'_, D>,
3468            offset: usize,
3469            _depth: fidl::encoding::Depth,
3470        ) -> fidl::Result<()> {
3471            decoder.debug_check_bounds::<Self>(offset);
3472            // Verify that padding bytes are zero.
3473            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
3474            let padval = unsafe { (ptr as *const u32).read_unaligned() };
3475            let mask = 0xffffff00u32;
3476            let maskedval = padval & mask;
3477            if maskedval != 0 {
3478                return Err(fidl::Error::NonZeroPadding {
3479                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
3480                });
3481            }
3482            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
3483            fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
3484            Ok(())
3485        }
3486    }
3487
3488    impl fidl::encoding::ValueTypeMarker for GpioWriteResult {
3489        type Borrowed<'a> = &'a Self;
3490        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3491            value
3492        }
3493    }
3494
3495    unsafe impl fidl::encoding::TypeMarker for GpioWriteResult {
3496        type Owned = Self;
3497
3498        #[inline(always)]
3499        fn inline_align(_context: fidl::encoding::Context) -> usize {
3500            8
3501        }
3502
3503        #[inline(always)]
3504        fn inline_size(_context: fidl::encoding::Context) -> usize {
3505            16
3506        }
3507        #[inline(always)]
3508        fn encode_is_copy() -> bool {
3509            true
3510        }
3511
3512        #[inline(always)]
3513        fn decode_is_copy() -> bool {
3514            true
3515        }
3516    }
3517
3518    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GpioWriteResult, D>
3519        for &GpioWriteResult
3520    {
3521        #[inline]
3522        unsafe fn encode(
3523            self,
3524            encoder: &mut fidl::encoding::Encoder<'_, D>,
3525            offset: usize,
3526            _depth: fidl::encoding::Depth,
3527        ) -> fidl::Result<()> {
3528            encoder.debug_check_bounds::<GpioWriteResult>(offset);
3529            unsafe {
3530                // Copy the object into the buffer.
3531                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3532                (buf_ptr as *mut GpioWriteResult)
3533                    .write_unaligned((self as *const GpioWriteResult).read());
3534                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3535                // done second because the memcpy will write garbage to these bytes.
3536            }
3537            Ok(())
3538        }
3539    }
3540    unsafe impl<
3541        D: fidl::encoding::ResourceDialect,
3542        T0: fidl::encoding::Encode<u64, D>,
3543        T1: fidl::encoding::Encode<i64, D>,
3544    > fidl::encoding::Encode<GpioWriteResult, D> for (T0, T1)
3545    {
3546        #[inline]
3547        unsafe fn encode(
3548            self,
3549            encoder: &mut fidl::encoding::Encoder<'_, D>,
3550            offset: usize,
3551            depth: fidl::encoding::Depth,
3552        ) -> fidl::Result<()> {
3553            encoder.debug_check_bounds::<GpioWriteResult>(offset);
3554            // Zero out padding regions. There's no need to apply masks
3555            // because the unmasked parts will be overwritten by fields.
3556            // Write the fields.
3557            self.0.encode(encoder, offset + 0, depth)?;
3558            self.1.encode(encoder, offset + 8, depth)?;
3559            Ok(())
3560        }
3561    }
3562
3563    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GpioWriteResult {
3564        #[inline(always)]
3565        fn new_empty() -> Self {
3566            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
3567        }
3568
3569        #[inline]
3570        unsafe fn decode(
3571            &mut self,
3572            decoder: &mut fidl::encoding::Decoder<'_, D>,
3573            offset: usize,
3574            _depth: fidl::encoding::Depth,
3575        ) -> fidl::Result<()> {
3576            decoder.debug_check_bounds::<Self>(offset);
3577            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3578            // Verify that padding bytes are zero.
3579            // Copy from the buffer into the object.
3580            unsafe {
3581                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3582            }
3583            Ok(())
3584        }
3585    }
3586
3587    impl fidl::encoding::ValueTypeMarker for I2cEndpointTransferRequest {
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 I2cEndpointTransferRequest {
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            24
3605        }
3606    }
3607
3608    unsafe impl<D: fidl::encoding::ResourceDialect>
3609        fidl::encoding::Encode<I2cEndpointTransferRequest, D> for &I2cEndpointTransferRequest
3610    {
3611        #[inline]
3612        unsafe fn encode(
3613            self,
3614            encoder: &mut fidl::encoding::Encoder<'_, D>,
3615            offset: usize,
3616            _depth: fidl::encoding::Depth,
3617        ) -> fidl::Result<()> {
3618            encoder.debug_check_bounds::<I2cEndpointTransferRequest>(offset);
3619            // Delegate to tuple encoding.
3620            fidl::encoding::Encode::<I2cEndpointTransferRequest, D>::encode(
3621                (
3622                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
3623                        &self.write_data,
3624                    ),
3625                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.read_length),
3626                ),
3627                encoder,
3628                offset,
3629                _depth,
3630            )
3631        }
3632    }
3633    unsafe impl<
3634        D: fidl::encoding::ResourceDialect,
3635        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
3636        T1: fidl::encoding::Encode<u32, D>,
3637    > fidl::encoding::Encode<I2cEndpointTransferRequest, D> for (T0, T1)
3638    {
3639        #[inline]
3640        unsafe fn encode(
3641            self,
3642            encoder: &mut fidl::encoding::Encoder<'_, D>,
3643            offset: usize,
3644            depth: fidl::encoding::Depth,
3645        ) -> fidl::Result<()> {
3646            encoder.debug_check_bounds::<I2cEndpointTransferRequest>(offset);
3647            // Zero out padding regions. There's no need to apply masks
3648            // because the unmasked parts will be overwritten by fields.
3649            unsafe {
3650                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3651                (ptr as *mut u64).write_unaligned(0);
3652            }
3653            // Write the fields.
3654            self.0.encode(encoder, offset + 0, depth)?;
3655            self.1.encode(encoder, offset + 16, depth)?;
3656            Ok(())
3657        }
3658    }
3659
3660    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3661        for I2cEndpointTransferRequest
3662    {
3663        #[inline(always)]
3664        fn new_empty() -> Self {
3665            Self {
3666                write_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
3667                read_length: fidl::new_empty!(u32, D),
3668            }
3669        }
3670
3671        #[inline]
3672        unsafe fn decode(
3673            &mut self,
3674            decoder: &mut fidl::encoding::Decoder<'_, D>,
3675            offset: usize,
3676            _depth: fidl::encoding::Depth,
3677        ) -> fidl::Result<()> {
3678            decoder.debug_check_bounds::<Self>(offset);
3679            // Verify that padding bytes are zero.
3680            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3681            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3682            let mask = 0xffffffff00000000u64;
3683            let maskedval = padval & mask;
3684            if maskedval != 0 {
3685                return Err(fidl::Error::NonZeroPadding {
3686                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3687                });
3688            }
3689            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.write_data, decoder, offset + 0, _depth)?;
3690            fidl::decode!(u32, D, &mut self.read_length, decoder, offset + 16, _depth)?;
3691            Ok(())
3692        }
3693    }
3694
3695    impl fidl::encoding::ValueTypeMarker for I2cTransfer {
3696        type Borrowed<'a> = &'a Self;
3697        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3698            value
3699        }
3700    }
3701
3702    unsafe impl fidl::encoding::TypeMarker for I2cTransfer {
3703        type Owned = Self;
3704
3705        #[inline(always)]
3706        fn inline_align(_context: fidl::encoding::Context) -> usize {
3707            8
3708        }
3709
3710        #[inline(always)]
3711        fn inline_size(_context: fidl::encoding::Context) -> usize {
3712            32
3713        }
3714    }
3715
3716    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<I2cTransfer, D>
3717        for &I2cTransfer
3718    {
3719        #[inline]
3720        unsafe fn encode(
3721            self,
3722            encoder: &mut fidl::encoding::Encoder<'_, D>,
3723            offset: usize,
3724            _depth: fidl::encoding::Depth,
3725        ) -> fidl::Result<()> {
3726            encoder.debug_check_bounds::<I2cTransfer>(offset);
3727            // Delegate to tuple encoding.
3728            fidl::encoding::Encode::<I2cTransfer, D>::encode(
3729                (
3730                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
3731                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
3732                        &self.write_data,
3733                    ),
3734                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.read_length),
3735                ),
3736                encoder,
3737                offset,
3738                _depth,
3739            )
3740        }
3741    }
3742    unsafe impl<
3743        D: fidl::encoding::ResourceDialect,
3744        T0: fidl::encoding::Encode<u32, D>,
3745        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
3746        T2: fidl::encoding::Encode<u32, D>,
3747    > fidl::encoding::Encode<I2cTransfer, D> for (T0, T1, T2)
3748    {
3749        #[inline]
3750        unsafe fn encode(
3751            self,
3752            encoder: &mut fidl::encoding::Encoder<'_, D>,
3753            offset: usize,
3754            depth: fidl::encoding::Depth,
3755        ) -> fidl::Result<()> {
3756            encoder.debug_check_bounds::<I2cTransfer>(offset);
3757            // Zero out padding regions. There's no need to apply masks
3758            // because the unmasked parts will be overwritten by fields.
3759            unsafe {
3760                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3761                (ptr as *mut u64).write_unaligned(0);
3762            }
3763            unsafe {
3764                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
3765                (ptr as *mut u64).write_unaligned(0);
3766            }
3767            // Write the fields.
3768            self.0.encode(encoder, offset + 0, depth)?;
3769            self.1.encode(encoder, offset + 8, depth)?;
3770            self.2.encode(encoder, offset + 24, depth)?;
3771            Ok(())
3772        }
3773    }
3774
3775    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for I2cTransfer {
3776        #[inline(always)]
3777        fn new_empty() -> Self {
3778            Self {
3779                resource: fidl::new_empty!(u32, D),
3780                write_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
3781                read_length: fidl::new_empty!(u32, D),
3782            }
3783        }
3784
3785        #[inline]
3786        unsafe fn decode(
3787            &mut self,
3788            decoder: &mut fidl::encoding::Decoder<'_, D>,
3789            offset: usize,
3790            _depth: fidl::encoding::Depth,
3791        ) -> fidl::Result<()> {
3792            decoder.debug_check_bounds::<Self>(offset);
3793            // Verify that padding bytes are zero.
3794            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3795            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3796            let mask = 0xffffffff00000000u64;
3797            let maskedval = padval & mask;
3798            if maskedval != 0 {
3799                return Err(fidl::Error::NonZeroPadding {
3800                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3801                });
3802            }
3803            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
3804            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3805            let mask = 0xffffffff00000000u64;
3806            let maskedval = padval & mask;
3807            if maskedval != 0 {
3808                return Err(fidl::Error::NonZeroPadding {
3809                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
3810                });
3811            }
3812            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
3813            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.write_data, decoder, offset + 8, _depth)?;
3814            fidl::decode!(u32, D, &mut self.read_length, decoder, offset + 24, _depth)?;
3815            Ok(())
3816        }
3817    }
3818
3819    impl fidl::encoding::ValueTypeMarker for I2cTransferResult {
3820        type Borrowed<'a> = &'a Self;
3821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3822            value
3823        }
3824    }
3825
3826    unsafe impl fidl::encoding::TypeMarker for I2cTransferResult {
3827        type Owned = Self;
3828
3829        #[inline(always)]
3830        fn inline_align(_context: fidl::encoding::Context) -> usize {
3831            8
3832        }
3833
3834        #[inline(always)]
3835        fn inline_size(_context: fidl::encoding::Context) -> usize {
3836            32
3837        }
3838    }
3839
3840    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<I2cTransferResult, D>
3841        for &I2cTransferResult
3842    {
3843        #[inline]
3844        unsafe fn encode(
3845            self,
3846            encoder: &mut fidl::encoding::Encoder<'_, D>,
3847            offset: usize,
3848            _depth: fidl::encoding::Depth,
3849        ) -> fidl::Result<()> {
3850            encoder.debug_check_bounds::<I2cTransferResult>(offset);
3851            // Delegate to tuple encoding.
3852            fidl::encoding::Encode::<I2cTransferResult, D>::encode(
3853                (
3854                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
3855                        &self.read_data,
3856                    ),
3857                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
3858                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
3859                ),
3860                encoder,
3861                offset,
3862                _depth,
3863            )
3864        }
3865    }
3866    unsafe impl<
3867        D: fidl::encoding::ResourceDialect,
3868        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
3869        T1: fidl::encoding::Encode<u64, D>,
3870        T2: fidl::encoding::Encode<i64, D>,
3871    > fidl::encoding::Encode<I2cTransferResult, D> for (T0, T1, T2)
3872    {
3873        #[inline]
3874        unsafe fn encode(
3875            self,
3876            encoder: &mut fidl::encoding::Encoder<'_, D>,
3877            offset: usize,
3878            depth: fidl::encoding::Depth,
3879        ) -> fidl::Result<()> {
3880            encoder.debug_check_bounds::<I2cTransferResult>(offset);
3881            // Zero out padding regions. There's no need to apply masks
3882            // because the unmasked parts will be overwritten by fields.
3883            // Write the fields.
3884            self.0.encode(encoder, offset + 0, depth)?;
3885            self.1.encode(encoder, offset + 16, depth)?;
3886            self.2.encode(encoder, offset + 24, depth)?;
3887            Ok(())
3888        }
3889    }
3890
3891    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for I2cTransferResult {
3892        #[inline(always)]
3893        fn new_empty() -> Self {
3894            Self {
3895                read_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
3896                audit_seq: fidl::new_empty!(u64, D),
3897                timestamp_ns: fidl::new_empty!(i64, D),
3898            }
3899        }
3900
3901        #[inline]
3902        unsafe fn decode(
3903            &mut self,
3904            decoder: &mut fidl::encoding::Decoder<'_, D>,
3905            offset: usize,
3906            _depth: fidl::encoding::Depth,
3907        ) -> fidl::Result<()> {
3908            decoder.debug_check_bounds::<Self>(offset);
3909            // Verify that padding bytes are zero.
3910            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.read_data, decoder, offset + 0, _depth)?;
3911            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 16, _depth)?;
3912            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 24, _depth)?;
3913            Ok(())
3914        }
3915    }
3916
3917    impl fidl::encoding::ValueTypeMarker for InterruptResult {
3918        type Borrowed<'a> = &'a Self;
3919        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3920            value
3921        }
3922    }
3923
3924    unsafe impl fidl::encoding::TypeMarker for InterruptResult {
3925        type Owned = Self;
3926
3927        #[inline(always)]
3928        fn inline_align(_context: fidl::encoding::Context) -> usize {
3929            8
3930        }
3931
3932        #[inline(always)]
3933        fn inline_size(_context: fidl::encoding::Context) -> usize {
3934            40
3935        }
3936    }
3937
3938    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterruptResult, D>
3939        for &InterruptResult
3940    {
3941        #[inline]
3942        unsafe fn encode(
3943            self,
3944            encoder: &mut fidl::encoding::Encoder<'_, D>,
3945            offset: usize,
3946            _depth: fidl::encoding::Depth,
3947        ) -> fidl::Result<()> {
3948            encoder.debug_check_bounds::<InterruptResult>(offset);
3949            unsafe {
3950                // Copy the object into the buffer.
3951                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3952                (buf_ptr as *mut InterruptResult)
3953                    .write_unaligned((self as *const InterruptResult).read());
3954                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3955                // done second because the memcpy will write garbage to these bytes.
3956                let padding_ptr = buf_ptr.offset(0) as *mut u64;
3957                let padding_mask = 0xffffffff00000000u64;
3958                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3959            }
3960            Ok(())
3961        }
3962    }
3963    unsafe impl<
3964        D: fidl::encoding::ResourceDialect,
3965        T0: fidl::encoding::Encode<u32, D>,
3966        T1: fidl::encoding::Encode<u64, D>,
3967        T2: fidl::encoding::Encode<u64, D>,
3968        T3: fidl::encoding::Encode<i64, D>,
3969        T4: fidl::encoding::Encode<u64, D>,
3970    > fidl::encoding::Encode<InterruptResult, D> for (T0, T1, T2, T3, T4)
3971    {
3972        #[inline]
3973        unsafe fn encode(
3974            self,
3975            encoder: &mut fidl::encoding::Encoder<'_, D>,
3976            offset: usize,
3977            depth: fidl::encoding::Depth,
3978        ) -> fidl::Result<()> {
3979            encoder.debug_check_bounds::<InterruptResult>(offset);
3980            // Zero out padding regions. There's no need to apply masks
3981            // because the unmasked parts will be overwritten by fields.
3982            unsafe {
3983                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3984                (ptr as *mut u64).write_unaligned(0);
3985            }
3986            // Write the fields.
3987            self.0.encode(encoder, offset + 0, depth)?;
3988            self.1.encode(encoder, offset + 8, depth)?;
3989            self.2.encode(encoder, offset + 16, depth)?;
3990            self.3.encode(encoder, offset + 24, depth)?;
3991            self.4.encode(encoder, offset + 32, depth)?;
3992            Ok(())
3993        }
3994    }
3995
3996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterruptResult {
3997        #[inline(always)]
3998        fn new_empty() -> Self {
3999            Self {
4000                resource: fidl::new_empty!(u32, D),
4001                sequence: fidl::new_empty!(u64, D),
4002                count: fidl::new_empty!(u64, D),
4003                timestamp_ns: fidl::new_empty!(i64, D),
4004                coalesced_count: fidl::new_empty!(u64, D),
4005            }
4006        }
4007
4008        #[inline]
4009        unsafe fn decode(
4010            &mut self,
4011            decoder: &mut fidl::encoding::Decoder<'_, D>,
4012            offset: usize,
4013            _depth: fidl::encoding::Depth,
4014        ) -> fidl::Result<()> {
4015            decoder.debug_check_bounds::<Self>(offset);
4016            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4017            // Verify that padding bytes are zero.
4018            let ptr = unsafe { buf_ptr.offset(0) };
4019            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4020            let mask = 0xffffffff00000000u64;
4021            let maskedval = padval & mask;
4022            if maskedval != 0 {
4023                return Err(fidl::Error::NonZeroPadding {
4024                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4025                });
4026            }
4027            // Copy from the buffer into the object.
4028            unsafe {
4029                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
4030            }
4031            Ok(())
4032        }
4033    }
4034
4035    impl fidl::encoding::ValueTypeMarker for Poll32 {
4036        type Borrowed<'a> = &'a Self;
4037        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4038            value
4039        }
4040    }
4041
4042    unsafe impl fidl::encoding::TypeMarker for Poll32 {
4043        type Owned = Self;
4044
4045        #[inline(always)]
4046        fn inline_align(_context: fidl::encoding::Context) -> usize {
4047            8
4048        }
4049
4050        #[inline(always)]
4051        fn inline_size(_context: fidl::encoding::Context) -> usize {
4052            40
4053        }
4054    }
4055
4056    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Poll32, D> for &Poll32 {
4057        #[inline]
4058        unsafe fn encode(
4059            self,
4060            encoder: &mut fidl::encoding::Encoder<'_, D>,
4061            offset: usize,
4062            _depth: fidl::encoding::Depth,
4063        ) -> fidl::Result<()> {
4064            encoder.debug_check_bounds::<Poll32>(offset);
4065            unsafe {
4066                // Copy the object into the buffer.
4067                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4068                (buf_ptr as *mut Poll32).write_unaligned((self as *const Poll32).read());
4069                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4070                // done second because the memcpy will write garbage to these bytes.
4071                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4072                let padding_mask = 0xffffffff00000000u64;
4073                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4074            }
4075            Ok(())
4076        }
4077    }
4078    unsafe impl<
4079        D: fidl::encoding::ResourceDialect,
4080        T0: fidl::encoding::Encode<u32, D>,
4081        T1: fidl::encoding::Encode<u64, D>,
4082        T2: fidl::encoding::Encode<u32, D>,
4083        T3: fidl::encoding::Encode<u32, D>,
4084        T4: fidl::encoding::Encode<i64, D>,
4085        T5: fidl::encoding::Encode<i64, D>,
4086    > fidl::encoding::Encode<Poll32, D> for (T0, T1, T2, T3, T4, T5)
4087    {
4088        #[inline]
4089        unsafe fn encode(
4090            self,
4091            encoder: &mut fidl::encoding::Encoder<'_, D>,
4092            offset: usize,
4093            depth: fidl::encoding::Depth,
4094        ) -> fidl::Result<()> {
4095            encoder.debug_check_bounds::<Poll32>(offset);
4096            // Zero out padding regions. There's no need to apply masks
4097            // because the unmasked parts will be overwritten by fields.
4098            unsafe {
4099                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4100                (ptr as *mut u64).write_unaligned(0);
4101            }
4102            // Write the fields.
4103            self.0.encode(encoder, offset + 0, depth)?;
4104            self.1.encode(encoder, offset + 8, depth)?;
4105            self.2.encode(encoder, offset + 16, depth)?;
4106            self.3.encode(encoder, offset + 20, depth)?;
4107            self.4.encode(encoder, offset + 24, depth)?;
4108            self.5.encode(encoder, offset + 32, depth)?;
4109            Ok(())
4110        }
4111    }
4112
4113    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Poll32 {
4114        #[inline(always)]
4115        fn new_empty() -> Self {
4116            Self {
4117                resource: fidl::new_empty!(u32, D),
4118                offset: fidl::new_empty!(u64, D),
4119                expected: fidl::new_empty!(u32, D),
4120                mask: fidl::new_empty!(u32, D),
4121                interval_ns: fidl::new_empty!(i64, D),
4122                timeout_ns: fidl::new_empty!(i64, D),
4123            }
4124        }
4125
4126        #[inline]
4127        unsafe fn decode(
4128            &mut self,
4129            decoder: &mut fidl::encoding::Decoder<'_, D>,
4130            offset: usize,
4131            _depth: fidl::encoding::Depth,
4132        ) -> fidl::Result<()> {
4133            decoder.debug_check_bounds::<Self>(offset);
4134            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4135            // Verify that padding bytes are zero.
4136            let ptr = unsafe { buf_ptr.offset(0) };
4137            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4138            let mask = 0xffffffff00000000u64;
4139            let maskedval = padval & mask;
4140            if maskedval != 0 {
4141                return Err(fidl::Error::NonZeroPadding {
4142                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4143                });
4144            }
4145            // Copy from the buffer into the object.
4146            unsafe {
4147                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
4148            }
4149            Ok(())
4150        }
4151    }
4152
4153    impl fidl::encoding::ValueTypeMarker for PollResult {
4154        type Borrowed<'a> = &'a Self;
4155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4156            value
4157        }
4158    }
4159
4160    unsafe impl fidl::encoding::TypeMarker for PollResult {
4161        type Owned = Self;
4162
4163        #[inline(always)]
4164        fn inline_align(_context: fidl::encoding::Context) -> usize {
4165            8
4166        }
4167
4168        #[inline(always)]
4169        fn inline_size(_context: fidl::encoding::Context) -> usize {
4170            24
4171        }
4172    }
4173
4174    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PollResult, D>
4175        for &PollResult
4176    {
4177        #[inline]
4178        unsafe fn encode(
4179            self,
4180            encoder: &mut fidl::encoding::Encoder<'_, D>,
4181            offset: usize,
4182            _depth: fidl::encoding::Depth,
4183        ) -> fidl::Result<()> {
4184            encoder.debug_check_bounds::<PollResult>(offset);
4185            unsafe {
4186                // Copy the object into the buffer.
4187                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4188                (buf_ptr as *mut PollResult).write_unaligned((self as *const PollResult).read());
4189                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4190                // done second because the memcpy will write garbage to these bytes.
4191                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4192                let padding_mask = 0xffffffff00000000u64;
4193                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4194            }
4195            Ok(())
4196        }
4197    }
4198    unsafe impl<
4199        D: fidl::encoding::ResourceDialect,
4200        T0: fidl::encoding::Encode<u32, D>,
4201        T1: fidl::encoding::Encode<u64, D>,
4202        T2: fidl::encoding::Encode<i64, D>,
4203    > fidl::encoding::Encode<PollResult, D> for (T0, T1, T2)
4204    {
4205        #[inline]
4206        unsafe fn encode(
4207            self,
4208            encoder: &mut fidl::encoding::Encoder<'_, D>,
4209            offset: usize,
4210            depth: fidl::encoding::Depth,
4211        ) -> fidl::Result<()> {
4212            encoder.debug_check_bounds::<PollResult>(offset);
4213            // Zero out padding regions. There's no need to apply masks
4214            // because the unmasked parts will be overwritten by fields.
4215            unsafe {
4216                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4217                (ptr as *mut u64).write_unaligned(0);
4218            }
4219            // Write the fields.
4220            self.0.encode(encoder, offset + 0, depth)?;
4221            self.1.encode(encoder, offset + 8, depth)?;
4222            self.2.encode(encoder, offset + 16, depth)?;
4223            Ok(())
4224        }
4225    }
4226
4227    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PollResult {
4228        #[inline(always)]
4229        fn new_empty() -> Self {
4230            Self {
4231                value: fidl::new_empty!(u32, D),
4232                audit_seq: fidl::new_empty!(u64, D),
4233                timestamp_ns: fidl::new_empty!(i64, D),
4234            }
4235        }
4236
4237        #[inline]
4238        unsafe fn decode(
4239            &mut self,
4240            decoder: &mut fidl::encoding::Decoder<'_, D>,
4241            offset: usize,
4242            _depth: fidl::encoding::Depth,
4243        ) -> fidl::Result<()> {
4244            decoder.debug_check_bounds::<Self>(offset);
4245            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4246            // Verify that padding bytes are zero.
4247            let ptr = unsafe { buf_ptr.offset(0) };
4248            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4249            let mask = 0xffffffff00000000u64;
4250            let maskedval = padval & mask;
4251            if maskedval != 0 {
4252                return Err(fidl::Error::NonZeroPadding {
4253                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4254                });
4255            }
4256            // Copy from the buffer into the object.
4257            unsafe {
4258                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
4259            }
4260            Ok(())
4261        }
4262    }
4263
4264    impl fidl::encoding::ValueTypeMarker for ProxyOpenSessionResponse {
4265        type Borrowed<'a> = &'a Self;
4266        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4267            value
4268        }
4269    }
4270
4271    unsafe impl fidl::encoding::TypeMarker for ProxyOpenSessionResponse {
4272        type Owned = Self;
4273
4274        #[inline(always)]
4275        fn inline_align(_context: fidl::encoding::Context) -> usize {
4276            8
4277        }
4278
4279        #[inline(always)]
4280        fn inline_size(_context: fidl::encoding::Context) -> usize {
4281            8
4282        }
4283        #[inline(always)]
4284        fn encode_is_copy() -> bool {
4285            true
4286        }
4287
4288        #[inline(always)]
4289        fn decode_is_copy() -> bool {
4290            true
4291        }
4292    }
4293
4294    unsafe impl<D: fidl::encoding::ResourceDialect>
4295        fidl::encoding::Encode<ProxyOpenSessionResponse, D> for &ProxyOpenSessionResponse
4296    {
4297        #[inline]
4298        unsafe fn encode(
4299            self,
4300            encoder: &mut fidl::encoding::Encoder<'_, D>,
4301            offset: usize,
4302            _depth: fidl::encoding::Depth,
4303        ) -> fidl::Result<()> {
4304            encoder.debug_check_bounds::<ProxyOpenSessionResponse>(offset);
4305            unsafe {
4306                // Copy the object into the buffer.
4307                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4308                (buf_ptr as *mut ProxyOpenSessionResponse)
4309                    .write_unaligned((self as *const ProxyOpenSessionResponse).read());
4310                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4311                // done second because the memcpy will write garbage to these bytes.
4312            }
4313            Ok(())
4314        }
4315    }
4316    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4317        fidl::encoding::Encode<ProxyOpenSessionResponse, D> for (T0,)
4318    {
4319        #[inline]
4320        unsafe fn encode(
4321            self,
4322            encoder: &mut fidl::encoding::Encoder<'_, D>,
4323            offset: usize,
4324            depth: fidl::encoding::Depth,
4325        ) -> fidl::Result<()> {
4326            encoder.debug_check_bounds::<ProxyOpenSessionResponse>(offset);
4327            // Zero out padding regions. There's no need to apply masks
4328            // because the unmasked parts will be overwritten by fields.
4329            // Write the fields.
4330            self.0.encode(encoder, offset + 0, depth)?;
4331            Ok(())
4332        }
4333    }
4334
4335    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4336        for ProxyOpenSessionResponse
4337    {
4338        #[inline(always)]
4339        fn new_empty() -> Self {
4340            Self { session_id: fidl::new_empty!(u64, D) }
4341        }
4342
4343        #[inline]
4344        unsafe fn decode(
4345            &mut self,
4346            decoder: &mut fidl::encoding::Decoder<'_, D>,
4347            offset: usize,
4348            _depth: fidl::encoding::Depth,
4349        ) -> fidl::Result<()> {
4350            decoder.debug_check_bounds::<Self>(offset);
4351            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4352            // Verify that padding bytes are zero.
4353            // Copy from the buffer into the object.
4354            unsafe {
4355                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4356            }
4357            Ok(())
4358        }
4359    }
4360
4361    impl fidl::encoding::ValueTypeMarker for Read32 {
4362        type Borrowed<'a> = &'a Self;
4363        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4364            value
4365        }
4366    }
4367
4368    unsafe impl fidl::encoding::TypeMarker for Read32 {
4369        type Owned = Self;
4370
4371        #[inline(always)]
4372        fn inline_align(_context: fidl::encoding::Context) -> usize {
4373            8
4374        }
4375
4376        #[inline(always)]
4377        fn inline_size(_context: fidl::encoding::Context) -> usize {
4378            16
4379        }
4380    }
4381
4382    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Read32, D> for &Read32 {
4383        #[inline]
4384        unsafe fn encode(
4385            self,
4386            encoder: &mut fidl::encoding::Encoder<'_, D>,
4387            offset: usize,
4388            _depth: fidl::encoding::Depth,
4389        ) -> fidl::Result<()> {
4390            encoder.debug_check_bounds::<Read32>(offset);
4391            unsafe {
4392                // Copy the object into the buffer.
4393                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4394                (buf_ptr as *mut Read32).write_unaligned((self as *const Read32).read());
4395                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4396                // done second because the memcpy will write garbage to these bytes.
4397                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4398                let padding_mask = 0xffffffff00000000u64;
4399                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4400            }
4401            Ok(())
4402        }
4403    }
4404    unsafe impl<
4405        D: fidl::encoding::ResourceDialect,
4406        T0: fidl::encoding::Encode<u32, D>,
4407        T1: fidl::encoding::Encode<u64, D>,
4408    > fidl::encoding::Encode<Read32, D> for (T0, T1)
4409    {
4410        #[inline]
4411        unsafe fn encode(
4412            self,
4413            encoder: &mut fidl::encoding::Encoder<'_, D>,
4414            offset: usize,
4415            depth: fidl::encoding::Depth,
4416        ) -> fidl::Result<()> {
4417            encoder.debug_check_bounds::<Read32>(offset);
4418            // Zero out padding regions. There's no need to apply masks
4419            // because the unmasked parts will be overwritten by fields.
4420            unsafe {
4421                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4422                (ptr as *mut u64).write_unaligned(0);
4423            }
4424            // Write the fields.
4425            self.0.encode(encoder, offset + 0, depth)?;
4426            self.1.encode(encoder, offset + 8, depth)?;
4427            Ok(())
4428        }
4429    }
4430
4431    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Read32 {
4432        #[inline(always)]
4433        fn new_empty() -> Self {
4434            Self { resource: fidl::new_empty!(u32, D), offset: fidl::new_empty!(u64, D) }
4435        }
4436
4437        #[inline]
4438        unsafe fn decode(
4439            &mut self,
4440            decoder: &mut fidl::encoding::Decoder<'_, D>,
4441            offset: usize,
4442            _depth: fidl::encoding::Depth,
4443        ) -> fidl::Result<()> {
4444            decoder.debug_check_bounds::<Self>(offset);
4445            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4446            // Verify that padding bytes are zero.
4447            let ptr = unsafe { buf_ptr.offset(0) };
4448            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4449            let mask = 0xffffffff00000000u64;
4450            let maskedval = padval & mask;
4451            if maskedval != 0 {
4452                return Err(fidl::Error::NonZeroPadding {
4453                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4454                });
4455            }
4456            // Copy from the buffer into the object.
4457            unsafe {
4458                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4459            }
4460            Ok(())
4461        }
4462    }
4463
4464    impl fidl::encoding::ValueTypeMarker for ReadResult {
4465        type Borrowed<'a> = &'a Self;
4466        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4467            value
4468        }
4469    }
4470
4471    unsafe impl fidl::encoding::TypeMarker for ReadResult {
4472        type Owned = Self;
4473
4474        #[inline(always)]
4475        fn inline_align(_context: fidl::encoding::Context) -> usize {
4476            8
4477        }
4478
4479        #[inline(always)]
4480        fn inline_size(_context: fidl::encoding::Context) -> usize {
4481            24
4482        }
4483    }
4484
4485    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadResult, D>
4486        for &ReadResult
4487    {
4488        #[inline]
4489        unsafe fn encode(
4490            self,
4491            encoder: &mut fidl::encoding::Encoder<'_, D>,
4492            offset: usize,
4493            _depth: fidl::encoding::Depth,
4494        ) -> fidl::Result<()> {
4495            encoder.debug_check_bounds::<ReadResult>(offset);
4496            unsafe {
4497                // Copy the object into the buffer.
4498                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4499                (buf_ptr as *mut ReadResult).write_unaligned((self as *const ReadResult).read());
4500                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4501                // done second because the memcpy will write garbage to these bytes.
4502                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4503                let padding_mask = 0xffffffff00000000u64;
4504                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4505            }
4506            Ok(())
4507        }
4508    }
4509    unsafe impl<
4510        D: fidl::encoding::ResourceDialect,
4511        T0: fidl::encoding::Encode<u32, D>,
4512        T1: fidl::encoding::Encode<u64, D>,
4513        T2: fidl::encoding::Encode<i64, D>,
4514    > fidl::encoding::Encode<ReadResult, D> for (T0, T1, T2)
4515    {
4516        #[inline]
4517        unsafe fn encode(
4518            self,
4519            encoder: &mut fidl::encoding::Encoder<'_, D>,
4520            offset: usize,
4521            depth: fidl::encoding::Depth,
4522        ) -> fidl::Result<()> {
4523            encoder.debug_check_bounds::<ReadResult>(offset);
4524            // Zero out padding regions. There's no need to apply masks
4525            // because the unmasked parts will be overwritten by fields.
4526            unsafe {
4527                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4528                (ptr as *mut u64).write_unaligned(0);
4529            }
4530            // Write the fields.
4531            self.0.encode(encoder, offset + 0, depth)?;
4532            self.1.encode(encoder, offset + 8, depth)?;
4533            self.2.encode(encoder, offset + 16, depth)?;
4534            Ok(())
4535        }
4536    }
4537
4538    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadResult {
4539        #[inline(always)]
4540        fn new_empty() -> Self {
4541            Self {
4542                value: fidl::new_empty!(u32, D),
4543                audit_seq: fidl::new_empty!(u64, D),
4544                timestamp_ns: fidl::new_empty!(i64, D),
4545            }
4546        }
4547
4548        #[inline]
4549        unsafe fn decode(
4550            &mut self,
4551            decoder: &mut fidl::encoding::Decoder<'_, D>,
4552            offset: usize,
4553            _depth: fidl::encoding::Depth,
4554        ) -> fidl::Result<()> {
4555            decoder.debug_check_bounds::<Self>(offset);
4556            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4557            // Verify that padding bytes are zero.
4558            let ptr = unsafe { buf_ptr.offset(0) };
4559            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4560            let mask = 0xffffffff00000000u64;
4561            let maskedval = padval & mask;
4562            if maskedval != 0 {
4563                return Err(fidl::Error::NonZeroPadding {
4564                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4565                });
4566            }
4567            // Copy from the buffer into the object.
4568            unsafe {
4569                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
4570            }
4571            Ok(())
4572        }
4573    }
4574
4575    impl fidl::encoding::ValueTypeMarker for ResetAssertResult {
4576        type Borrowed<'a> = &'a Self;
4577        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4578            value
4579        }
4580    }
4581
4582    unsafe impl fidl::encoding::TypeMarker for ResetAssertResult {
4583        type Owned = Self;
4584
4585        #[inline(always)]
4586        fn inline_align(_context: fidl::encoding::Context) -> usize {
4587            8
4588        }
4589
4590        #[inline(always)]
4591        fn inline_size(_context: fidl::encoding::Context) -> usize {
4592            16
4593        }
4594        #[inline(always)]
4595        fn encode_is_copy() -> bool {
4596            true
4597        }
4598
4599        #[inline(always)]
4600        fn decode_is_copy() -> bool {
4601            true
4602        }
4603    }
4604
4605    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResetAssertResult, D>
4606        for &ResetAssertResult
4607    {
4608        #[inline]
4609        unsafe fn encode(
4610            self,
4611            encoder: &mut fidl::encoding::Encoder<'_, D>,
4612            offset: usize,
4613            _depth: fidl::encoding::Depth,
4614        ) -> fidl::Result<()> {
4615            encoder.debug_check_bounds::<ResetAssertResult>(offset);
4616            unsafe {
4617                // Copy the object into the buffer.
4618                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4619                (buf_ptr as *mut ResetAssertResult)
4620                    .write_unaligned((self as *const ResetAssertResult).read());
4621                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4622                // done second because the memcpy will write garbage to these bytes.
4623            }
4624            Ok(())
4625        }
4626    }
4627    unsafe impl<
4628        D: fidl::encoding::ResourceDialect,
4629        T0: fidl::encoding::Encode<u64, D>,
4630        T1: fidl::encoding::Encode<i64, D>,
4631    > fidl::encoding::Encode<ResetAssertResult, D> for (T0, T1)
4632    {
4633        #[inline]
4634        unsafe fn encode(
4635            self,
4636            encoder: &mut fidl::encoding::Encoder<'_, D>,
4637            offset: usize,
4638            depth: fidl::encoding::Depth,
4639        ) -> fidl::Result<()> {
4640            encoder.debug_check_bounds::<ResetAssertResult>(offset);
4641            // Zero out padding regions. There's no need to apply masks
4642            // because the unmasked parts will be overwritten by fields.
4643            // Write the fields.
4644            self.0.encode(encoder, offset + 0, depth)?;
4645            self.1.encode(encoder, offset + 8, depth)?;
4646            Ok(())
4647        }
4648    }
4649
4650    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResetAssertResult {
4651        #[inline(always)]
4652        fn new_empty() -> Self {
4653            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
4654        }
4655
4656        #[inline]
4657        unsafe fn decode(
4658            &mut self,
4659            decoder: &mut fidl::encoding::Decoder<'_, D>,
4660            offset: usize,
4661            _depth: fidl::encoding::Depth,
4662        ) -> fidl::Result<()> {
4663            decoder.debug_check_bounds::<Self>(offset);
4664            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4665            // Verify that padding bytes are zero.
4666            // Copy from the buffer into the object.
4667            unsafe {
4668                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4669            }
4670            Ok(())
4671        }
4672    }
4673
4674    impl fidl::encoding::ValueTypeMarker for ResetDeassertResult {
4675        type Borrowed<'a> = &'a Self;
4676        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4677            value
4678        }
4679    }
4680
4681    unsafe impl fidl::encoding::TypeMarker for ResetDeassertResult {
4682        type Owned = Self;
4683
4684        #[inline(always)]
4685        fn inline_align(_context: fidl::encoding::Context) -> usize {
4686            8
4687        }
4688
4689        #[inline(always)]
4690        fn inline_size(_context: fidl::encoding::Context) -> usize {
4691            16
4692        }
4693        #[inline(always)]
4694        fn encode_is_copy() -> bool {
4695            true
4696        }
4697
4698        #[inline(always)]
4699        fn decode_is_copy() -> bool {
4700            true
4701        }
4702    }
4703
4704    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResetDeassertResult, D>
4705        for &ResetDeassertResult
4706    {
4707        #[inline]
4708        unsafe fn encode(
4709            self,
4710            encoder: &mut fidl::encoding::Encoder<'_, D>,
4711            offset: usize,
4712            _depth: fidl::encoding::Depth,
4713        ) -> fidl::Result<()> {
4714            encoder.debug_check_bounds::<ResetDeassertResult>(offset);
4715            unsafe {
4716                // Copy the object into the buffer.
4717                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4718                (buf_ptr as *mut ResetDeassertResult)
4719                    .write_unaligned((self as *const ResetDeassertResult).read());
4720                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4721                // done second because the memcpy will write garbage to these bytes.
4722            }
4723            Ok(())
4724        }
4725    }
4726    unsafe impl<
4727        D: fidl::encoding::ResourceDialect,
4728        T0: fidl::encoding::Encode<u64, D>,
4729        T1: fidl::encoding::Encode<i64, D>,
4730    > fidl::encoding::Encode<ResetDeassertResult, D> for (T0, T1)
4731    {
4732        #[inline]
4733        unsafe fn encode(
4734            self,
4735            encoder: &mut fidl::encoding::Encoder<'_, D>,
4736            offset: usize,
4737            depth: fidl::encoding::Depth,
4738        ) -> fidl::Result<()> {
4739            encoder.debug_check_bounds::<ResetDeassertResult>(offset);
4740            // Zero out padding regions. There's no need to apply masks
4741            // because the unmasked parts will be overwritten by fields.
4742            // Write the fields.
4743            self.0.encode(encoder, offset + 0, depth)?;
4744            self.1.encode(encoder, offset + 8, depth)?;
4745            Ok(())
4746        }
4747    }
4748
4749    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResetDeassertResult {
4750        #[inline(always)]
4751        fn new_empty() -> Self {
4752            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
4753        }
4754
4755        #[inline]
4756        unsafe fn decode(
4757            &mut self,
4758            decoder: &mut fidl::encoding::Decoder<'_, D>,
4759            offset: usize,
4760            _depth: fidl::encoding::Depth,
4761        ) -> fidl::Result<()> {
4762            decoder.debug_check_bounds::<Self>(offset);
4763            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4764            // Verify that padding bytes are zero.
4765            // Copy from the buffer into the object.
4766            unsafe {
4767                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4768            }
4769            Ok(())
4770        }
4771    }
4772
4773    impl fidl::encoding::ValueTypeMarker for ResetStatusResult {
4774        type Borrowed<'a> = &'a Self;
4775        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4776            value
4777        }
4778    }
4779
4780    unsafe impl fidl::encoding::TypeMarker for ResetStatusResult {
4781        type Owned = Self;
4782
4783        #[inline(always)]
4784        fn inline_align(_context: fidl::encoding::Context) -> usize {
4785            8
4786        }
4787
4788        #[inline(always)]
4789        fn inline_size(_context: fidl::encoding::Context) -> usize {
4790            24
4791        }
4792    }
4793
4794    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResetStatusResult, D>
4795        for &ResetStatusResult
4796    {
4797        #[inline]
4798        unsafe fn encode(
4799            self,
4800            encoder: &mut fidl::encoding::Encoder<'_, D>,
4801            offset: usize,
4802            _depth: fidl::encoding::Depth,
4803        ) -> fidl::Result<()> {
4804            encoder.debug_check_bounds::<ResetStatusResult>(offset);
4805            // Delegate to tuple encoding.
4806            fidl::encoding::Encode::<ResetStatusResult, D>::encode(
4807                (
4808                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.asserted),
4809                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
4810                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
4811                ),
4812                encoder,
4813                offset,
4814                _depth,
4815            )
4816        }
4817    }
4818    unsafe impl<
4819        D: fidl::encoding::ResourceDialect,
4820        T0: fidl::encoding::Encode<bool, D>,
4821        T1: fidl::encoding::Encode<u64, D>,
4822        T2: fidl::encoding::Encode<i64, D>,
4823    > fidl::encoding::Encode<ResetStatusResult, D> for (T0, T1, T2)
4824    {
4825        #[inline]
4826        unsafe fn encode(
4827            self,
4828            encoder: &mut fidl::encoding::Encoder<'_, D>,
4829            offset: usize,
4830            depth: fidl::encoding::Depth,
4831        ) -> fidl::Result<()> {
4832            encoder.debug_check_bounds::<ResetStatusResult>(offset);
4833            // Zero out padding regions. There's no need to apply masks
4834            // because the unmasked parts will be overwritten by fields.
4835            unsafe {
4836                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4837                (ptr as *mut u64).write_unaligned(0);
4838            }
4839            // Write the fields.
4840            self.0.encode(encoder, offset + 0, depth)?;
4841            self.1.encode(encoder, offset + 8, depth)?;
4842            self.2.encode(encoder, offset + 16, depth)?;
4843            Ok(())
4844        }
4845    }
4846
4847    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResetStatusResult {
4848        #[inline(always)]
4849        fn new_empty() -> Self {
4850            Self {
4851                asserted: fidl::new_empty!(bool, D),
4852                audit_seq: fidl::new_empty!(u64, D),
4853                timestamp_ns: fidl::new_empty!(i64, D),
4854            }
4855        }
4856
4857        #[inline]
4858        unsafe fn decode(
4859            &mut self,
4860            decoder: &mut fidl::encoding::Decoder<'_, D>,
4861            offset: usize,
4862            _depth: fidl::encoding::Depth,
4863        ) -> fidl::Result<()> {
4864            decoder.debug_check_bounds::<Self>(offset);
4865            // Verify that padding bytes are zero.
4866            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4867            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4868            let mask = 0xffffffffffffff00u64;
4869            let maskedval = padval & mask;
4870            if maskedval != 0 {
4871                return Err(fidl::Error::NonZeroPadding {
4872                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4873                });
4874            }
4875            fidl::decode!(bool, D, &mut self.asserted, decoder, offset + 0, _depth)?;
4876            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 8, _depth)?;
4877            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 16, _depth)?;
4878            Ok(())
4879        }
4880    }
4881
4882    impl fidl::encoding::ValueTypeMarker for ResetToggleResult {
4883        type Borrowed<'a> = &'a Self;
4884        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4885            value
4886        }
4887    }
4888
4889    unsafe impl fidl::encoding::TypeMarker for ResetToggleResult {
4890        type Owned = Self;
4891
4892        #[inline(always)]
4893        fn inline_align(_context: fidl::encoding::Context) -> usize {
4894            8
4895        }
4896
4897        #[inline(always)]
4898        fn inline_size(_context: fidl::encoding::Context) -> usize {
4899            16
4900        }
4901        #[inline(always)]
4902        fn encode_is_copy() -> bool {
4903            true
4904        }
4905
4906        #[inline(always)]
4907        fn decode_is_copy() -> bool {
4908            true
4909        }
4910    }
4911
4912    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResetToggleResult, D>
4913        for &ResetToggleResult
4914    {
4915        #[inline]
4916        unsafe fn encode(
4917            self,
4918            encoder: &mut fidl::encoding::Encoder<'_, D>,
4919            offset: usize,
4920            _depth: fidl::encoding::Depth,
4921        ) -> fidl::Result<()> {
4922            encoder.debug_check_bounds::<ResetToggleResult>(offset);
4923            unsafe {
4924                // Copy the object into the buffer.
4925                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4926                (buf_ptr as *mut ResetToggleResult)
4927                    .write_unaligned((self as *const ResetToggleResult).read());
4928                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4929                // done second because the memcpy will write garbage to these bytes.
4930            }
4931            Ok(())
4932        }
4933    }
4934    unsafe impl<
4935        D: fidl::encoding::ResourceDialect,
4936        T0: fidl::encoding::Encode<u64, D>,
4937        T1: fidl::encoding::Encode<i64, D>,
4938    > fidl::encoding::Encode<ResetToggleResult, D> for (T0, T1)
4939    {
4940        #[inline]
4941        unsafe fn encode(
4942            self,
4943            encoder: &mut fidl::encoding::Encoder<'_, D>,
4944            offset: usize,
4945            depth: fidl::encoding::Depth,
4946        ) -> fidl::Result<()> {
4947            encoder.debug_check_bounds::<ResetToggleResult>(offset);
4948            // Zero out padding regions. There's no need to apply masks
4949            // because the unmasked parts will be overwritten by fields.
4950            // Write the fields.
4951            self.0.encode(encoder, offset + 0, depth)?;
4952            self.1.encode(encoder, offset + 8, depth)?;
4953            Ok(())
4954        }
4955    }
4956
4957    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResetToggleResult {
4958        #[inline(always)]
4959        fn new_empty() -> Self {
4960            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
4961        }
4962
4963        #[inline]
4964        unsafe fn decode(
4965            &mut self,
4966            decoder: &mut fidl::encoding::Decoder<'_, D>,
4967            offset: usize,
4968            _depth: fidl::encoding::Depth,
4969        ) -> fidl::Result<()> {
4970            decoder.debug_check_bounds::<Self>(offset);
4971            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4972            // Verify that padding bytes are zero.
4973            // Copy from the buffer into the object.
4974            unsafe {
4975                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4976            }
4977            Ok(())
4978        }
4979    }
4980
4981    impl fidl::encoding::ValueTypeMarker for SequenceItemResult {
4982        type Borrowed<'a> = &'a Self;
4983        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4984            value
4985        }
4986    }
4987
4988    unsafe impl fidl::encoding::TypeMarker for SequenceItemResult {
4989        type Owned = Self;
4990
4991        #[inline(always)]
4992        fn inline_align(_context: fidl::encoding::Context) -> usize {
4993            8
4994        }
4995
4996        #[inline(always)]
4997        fn inline_size(_context: fidl::encoding::Context) -> usize {
4998            24
4999        }
5000    }
5001
5002    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SequenceItemResult, D>
5003        for &SequenceItemResult
5004    {
5005        #[inline]
5006        unsafe fn encode(
5007            self,
5008            encoder: &mut fidl::encoding::Encoder<'_, D>,
5009            offset: usize,
5010            _depth: fidl::encoding::Depth,
5011        ) -> fidl::Result<()> {
5012            encoder.debug_check_bounds::<SequenceItemResult>(offset);
5013            // Delegate to tuple encoding.
5014            fidl::encoding::Encode::<SequenceItemResult, D>::encode(
5015                (
5016                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
5017                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.ok),
5018                    <SequenceItemOutcome as fidl::encoding::ValueTypeMarker>::borrow(&self.outcome),
5019                ),
5020                encoder,
5021                offset,
5022                _depth,
5023            )
5024        }
5025    }
5026    unsafe impl<
5027        D: fidl::encoding::ResourceDialect,
5028        T0: fidl::encoding::Encode<u32, D>,
5029        T1: fidl::encoding::Encode<bool, D>,
5030        T2: fidl::encoding::Encode<SequenceItemOutcome, D>,
5031    > fidl::encoding::Encode<SequenceItemResult, D> for (T0, T1, T2)
5032    {
5033        #[inline]
5034        unsafe fn encode(
5035            self,
5036            encoder: &mut fidl::encoding::Encoder<'_, D>,
5037            offset: usize,
5038            depth: fidl::encoding::Depth,
5039        ) -> fidl::Result<()> {
5040            encoder.debug_check_bounds::<SequenceItemResult>(offset);
5041            // Zero out padding regions. There's no need to apply masks
5042            // because the unmasked parts will be overwritten by fields.
5043            unsafe {
5044                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5045                (ptr as *mut u64).write_unaligned(0);
5046            }
5047            // Write the fields.
5048            self.0.encode(encoder, offset + 0, depth)?;
5049            self.1.encode(encoder, offset + 4, depth)?;
5050            self.2.encode(encoder, offset + 8, depth)?;
5051            Ok(())
5052        }
5053    }
5054
5055    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SequenceItemResult {
5056        #[inline(always)]
5057        fn new_empty() -> Self {
5058            Self {
5059                index: fidl::new_empty!(u32, D),
5060                ok: fidl::new_empty!(bool, D),
5061                outcome: fidl::new_empty!(SequenceItemOutcome, D),
5062            }
5063        }
5064
5065        #[inline]
5066        unsafe fn decode(
5067            &mut self,
5068            decoder: &mut fidl::encoding::Decoder<'_, D>,
5069            offset: usize,
5070            _depth: fidl::encoding::Depth,
5071        ) -> fidl::Result<()> {
5072            decoder.debug_check_bounds::<Self>(offset);
5073            // Verify that padding bytes are zero.
5074            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5075            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5076            let mask = 0xffffff0000000000u64;
5077            let maskedval = padval & mask;
5078            if maskedval != 0 {
5079                return Err(fidl::Error::NonZeroPadding {
5080                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5081                });
5082            }
5083            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
5084            fidl::decode!(bool, D, &mut self.ok, decoder, offset + 4, _depth)?;
5085            fidl::decode!(SequenceItemOutcome, D, &mut self.outcome, decoder, offset + 8, _depth)?;
5086            Ok(())
5087        }
5088    }
5089
5090    impl fidl::encoding::ValueTypeMarker for SequenceResult {
5091        type Borrowed<'a> = &'a Self;
5092        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5093            value
5094        }
5095    }
5096
5097    unsafe impl fidl::encoding::TypeMarker for SequenceResult {
5098        type Owned = Self;
5099
5100        #[inline(always)]
5101        fn inline_align(_context: fidl::encoding::Context) -> usize {
5102            8
5103        }
5104
5105        #[inline(always)]
5106        fn inline_size(_context: fidl::encoding::Context) -> usize {
5107            24
5108        }
5109    }
5110
5111    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SequenceResult, D>
5112        for &SequenceResult
5113    {
5114        #[inline]
5115        unsafe fn encode(
5116            self,
5117            encoder: &mut fidl::encoding::Encoder<'_, D>,
5118            offset: usize,
5119            _depth: fidl::encoding::Depth,
5120        ) -> fidl::Result<()> {
5121            encoder.debug_check_bounds::<SequenceResult>(offset);
5122            // Delegate to tuple encoding.
5123            fidl::encoding::Encode::<SequenceResult, D>::encode(
5124                (
5125                    <fidl::encoding::Vector<SequenceItemResult, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.results),
5126                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.complete),
5127                ),
5128                encoder, offset, _depth
5129            )
5130        }
5131    }
5132    unsafe impl<
5133        D: fidl::encoding::ResourceDialect,
5134        T0: fidl::encoding::Encode<fidl::encoding::Vector<SequenceItemResult, 64>, D>,
5135        T1: fidl::encoding::Encode<bool, D>,
5136    > fidl::encoding::Encode<SequenceResult, D> for (T0, T1)
5137    {
5138        #[inline]
5139        unsafe fn encode(
5140            self,
5141            encoder: &mut fidl::encoding::Encoder<'_, D>,
5142            offset: usize,
5143            depth: fidl::encoding::Depth,
5144        ) -> fidl::Result<()> {
5145            encoder.debug_check_bounds::<SequenceResult>(offset);
5146            // Zero out padding regions. There's no need to apply masks
5147            // because the unmasked parts will be overwritten by fields.
5148            unsafe {
5149                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5150                (ptr as *mut u64).write_unaligned(0);
5151            }
5152            // Write the fields.
5153            self.0.encode(encoder, offset + 0, depth)?;
5154            self.1.encode(encoder, offset + 16, depth)?;
5155            Ok(())
5156        }
5157    }
5158
5159    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SequenceResult {
5160        #[inline(always)]
5161        fn new_empty() -> Self {
5162            Self {
5163                results: fidl::new_empty!(fidl::encoding::Vector<SequenceItemResult, 64>, D),
5164                complete: fidl::new_empty!(bool, D),
5165            }
5166        }
5167
5168        #[inline]
5169        unsafe fn decode(
5170            &mut self,
5171            decoder: &mut fidl::encoding::Decoder<'_, D>,
5172            offset: usize,
5173            _depth: fidl::encoding::Depth,
5174        ) -> fidl::Result<()> {
5175            decoder.debug_check_bounds::<Self>(offset);
5176            // Verify that padding bytes are zero.
5177            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5178            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5179            let mask = 0xffffffffffffff00u64;
5180            let maskedval = padval & mask;
5181            if maskedval != 0 {
5182                return Err(fidl::Error::NonZeroPadding {
5183                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5184                });
5185            }
5186            fidl::decode!(fidl::encoding::Vector<SequenceItemResult, 64>, D, &mut self.results, decoder, offset + 0, _depth)?;
5187            fidl::decode!(bool, D, &mut self.complete, decoder, offset + 16, _depth)?;
5188            Ok(())
5189        }
5190    }
5191
5192    impl fidl::encoding::ValueTypeMarker for SerialReadResult {
5193        type Borrowed<'a> = &'a Self;
5194        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5195            value
5196        }
5197    }
5198
5199    unsafe impl fidl::encoding::TypeMarker for SerialReadResult {
5200        type Owned = Self;
5201
5202        #[inline(always)]
5203        fn inline_align(_context: fidl::encoding::Context) -> usize {
5204            8
5205        }
5206
5207        #[inline(always)]
5208        fn inline_size(_context: fidl::encoding::Context) -> usize {
5209            32
5210        }
5211    }
5212
5213    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SerialReadResult, D>
5214        for &SerialReadResult
5215    {
5216        #[inline]
5217        unsafe fn encode(
5218            self,
5219            encoder: &mut fidl::encoding::Encoder<'_, D>,
5220            offset: usize,
5221            _depth: fidl::encoding::Depth,
5222        ) -> fidl::Result<()> {
5223            encoder.debug_check_bounds::<SerialReadResult>(offset);
5224            // Delegate to tuple encoding.
5225            fidl::encoding::Encode::<SerialReadResult, D>::encode(
5226                (
5227                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
5228                        &self.data,
5229                    ),
5230                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
5231                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
5232                ),
5233                encoder,
5234                offset,
5235                _depth,
5236            )
5237        }
5238    }
5239    unsafe impl<
5240        D: fidl::encoding::ResourceDialect,
5241        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
5242        T1: fidl::encoding::Encode<u64, D>,
5243        T2: fidl::encoding::Encode<i64, D>,
5244    > fidl::encoding::Encode<SerialReadResult, D> for (T0, T1, T2)
5245    {
5246        #[inline]
5247        unsafe fn encode(
5248            self,
5249            encoder: &mut fidl::encoding::Encoder<'_, D>,
5250            offset: usize,
5251            depth: fidl::encoding::Depth,
5252        ) -> fidl::Result<()> {
5253            encoder.debug_check_bounds::<SerialReadResult>(offset);
5254            // Zero out padding regions. There's no need to apply masks
5255            // because the unmasked parts will be overwritten by fields.
5256            // Write the fields.
5257            self.0.encode(encoder, offset + 0, depth)?;
5258            self.1.encode(encoder, offset + 16, depth)?;
5259            self.2.encode(encoder, offset + 24, depth)?;
5260            Ok(())
5261        }
5262    }
5263
5264    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SerialReadResult {
5265        #[inline(always)]
5266        fn new_empty() -> Self {
5267            Self {
5268                data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
5269                audit_seq: fidl::new_empty!(u64, D),
5270                timestamp_ns: fidl::new_empty!(i64, D),
5271            }
5272        }
5273
5274        #[inline]
5275        unsafe fn decode(
5276            &mut self,
5277            decoder: &mut fidl::encoding::Decoder<'_, D>,
5278            offset: usize,
5279            _depth: fidl::encoding::Depth,
5280        ) -> fidl::Result<()> {
5281            decoder.debug_check_bounds::<Self>(offset);
5282            // Verify that padding bytes are zero.
5283            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
5284            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 16, _depth)?;
5285            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 24, _depth)?;
5286            Ok(())
5287        }
5288    }
5289
5290    impl fidl::encoding::ValueTypeMarker for SerialWriteResult {
5291        type Borrowed<'a> = &'a Self;
5292        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5293            value
5294        }
5295    }
5296
5297    unsafe impl fidl::encoding::TypeMarker for SerialWriteResult {
5298        type Owned = Self;
5299
5300        #[inline(always)]
5301        fn inline_align(_context: fidl::encoding::Context) -> usize {
5302            8
5303        }
5304
5305        #[inline(always)]
5306        fn inline_size(_context: fidl::encoding::Context) -> usize {
5307            16
5308        }
5309        #[inline(always)]
5310        fn encode_is_copy() -> bool {
5311            true
5312        }
5313
5314        #[inline(always)]
5315        fn decode_is_copy() -> bool {
5316            true
5317        }
5318    }
5319
5320    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SerialWriteResult, D>
5321        for &SerialWriteResult
5322    {
5323        #[inline]
5324        unsafe fn encode(
5325            self,
5326            encoder: &mut fidl::encoding::Encoder<'_, D>,
5327            offset: usize,
5328            _depth: fidl::encoding::Depth,
5329        ) -> fidl::Result<()> {
5330            encoder.debug_check_bounds::<SerialWriteResult>(offset);
5331            unsafe {
5332                // Copy the object into the buffer.
5333                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5334                (buf_ptr as *mut SerialWriteResult)
5335                    .write_unaligned((self as *const SerialWriteResult).read());
5336                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5337                // done second because the memcpy will write garbage to these bytes.
5338            }
5339            Ok(())
5340        }
5341    }
5342    unsafe impl<
5343        D: fidl::encoding::ResourceDialect,
5344        T0: fidl::encoding::Encode<u64, D>,
5345        T1: fidl::encoding::Encode<i64, D>,
5346    > fidl::encoding::Encode<SerialWriteResult, D> for (T0, T1)
5347    {
5348        #[inline]
5349        unsafe fn encode(
5350            self,
5351            encoder: &mut fidl::encoding::Encoder<'_, D>,
5352            offset: usize,
5353            depth: fidl::encoding::Depth,
5354        ) -> fidl::Result<()> {
5355            encoder.debug_check_bounds::<SerialWriteResult>(offset);
5356            // Zero out padding regions. There's no need to apply masks
5357            // because the unmasked parts will be overwritten by fields.
5358            // Write the fields.
5359            self.0.encode(encoder, offset + 0, depth)?;
5360            self.1.encode(encoder, offset + 8, depth)?;
5361            Ok(())
5362        }
5363    }
5364
5365    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SerialWriteResult {
5366        #[inline(always)]
5367        fn new_empty() -> Self {
5368            Self { audit_seq: fidl::new_empty!(u64, D), timestamp_ns: fidl::new_empty!(i64, D) }
5369        }
5370
5371        #[inline]
5372        unsafe fn decode(
5373            &mut self,
5374            decoder: &mut fidl::encoding::Decoder<'_, D>,
5375            offset: usize,
5376            _depth: fidl::encoding::Depth,
5377        ) -> fidl::Result<()> {
5378            decoder.debug_check_bounds::<Self>(offset);
5379            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5380            // Verify that padding bytes are zero.
5381            // Copy from the buffer into the object.
5382            unsafe {
5383                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5384            }
5385            Ok(())
5386        }
5387    }
5388
5389    impl fidl::encoding::ValueTypeMarker for SessionClockDisableRequest {
5390        type Borrowed<'a> = &'a Self;
5391        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5392            value
5393        }
5394    }
5395
5396    unsafe impl fidl::encoding::TypeMarker for SessionClockDisableRequest {
5397        type Owned = Self;
5398
5399        #[inline(always)]
5400        fn inline_align(_context: fidl::encoding::Context) -> usize {
5401            4
5402        }
5403
5404        #[inline(always)]
5405        fn inline_size(_context: fidl::encoding::Context) -> usize {
5406            4
5407        }
5408        #[inline(always)]
5409        fn encode_is_copy() -> bool {
5410            true
5411        }
5412
5413        #[inline(always)]
5414        fn decode_is_copy() -> bool {
5415            true
5416        }
5417    }
5418
5419    unsafe impl<D: fidl::encoding::ResourceDialect>
5420        fidl::encoding::Encode<SessionClockDisableRequest, D> for &SessionClockDisableRequest
5421    {
5422        #[inline]
5423        unsafe fn encode(
5424            self,
5425            encoder: &mut fidl::encoding::Encoder<'_, D>,
5426            offset: usize,
5427            _depth: fidl::encoding::Depth,
5428        ) -> fidl::Result<()> {
5429            encoder.debug_check_bounds::<SessionClockDisableRequest>(offset);
5430            unsafe {
5431                // Copy the object into the buffer.
5432                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5433                (buf_ptr as *mut SessionClockDisableRequest)
5434                    .write_unaligned((self as *const SessionClockDisableRequest).read());
5435                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5436                // done second because the memcpy will write garbage to these bytes.
5437            }
5438            Ok(())
5439        }
5440    }
5441    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5442        fidl::encoding::Encode<SessionClockDisableRequest, D> for (T0,)
5443    {
5444        #[inline]
5445        unsafe fn encode(
5446            self,
5447            encoder: &mut fidl::encoding::Encoder<'_, D>,
5448            offset: usize,
5449            depth: fidl::encoding::Depth,
5450        ) -> fidl::Result<()> {
5451            encoder.debug_check_bounds::<SessionClockDisableRequest>(offset);
5452            // Zero out padding regions. There's no need to apply masks
5453            // because the unmasked parts will be overwritten by fields.
5454            // Write the fields.
5455            self.0.encode(encoder, offset + 0, depth)?;
5456            Ok(())
5457        }
5458    }
5459
5460    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5461        for SessionClockDisableRequest
5462    {
5463        #[inline(always)]
5464        fn new_empty() -> Self {
5465            Self { resource: fidl::new_empty!(u32, D) }
5466        }
5467
5468        #[inline]
5469        unsafe fn decode(
5470            &mut self,
5471            decoder: &mut fidl::encoding::Decoder<'_, D>,
5472            offset: usize,
5473            _depth: fidl::encoding::Depth,
5474        ) -> fidl::Result<()> {
5475            decoder.debug_check_bounds::<Self>(offset);
5476            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5477            // Verify that padding bytes are zero.
5478            // Copy from the buffer into the object.
5479            unsafe {
5480                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5481            }
5482            Ok(())
5483        }
5484    }
5485
5486    impl fidl::encoding::ValueTypeMarker for SessionClockEnableRequest {
5487        type Borrowed<'a> = &'a Self;
5488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5489            value
5490        }
5491    }
5492
5493    unsafe impl fidl::encoding::TypeMarker for SessionClockEnableRequest {
5494        type Owned = Self;
5495
5496        #[inline(always)]
5497        fn inline_align(_context: fidl::encoding::Context) -> usize {
5498            4
5499        }
5500
5501        #[inline(always)]
5502        fn inline_size(_context: fidl::encoding::Context) -> usize {
5503            4
5504        }
5505        #[inline(always)]
5506        fn encode_is_copy() -> bool {
5507            true
5508        }
5509
5510        #[inline(always)]
5511        fn decode_is_copy() -> bool {
5512            true
5513        }
5514    }
5515
5516    unsafe impl<D: fidl::encoding::ResourceDialect>
5517        fidl::encoding::Encode<SessionClockEnableRequest, D> for &SessionClockEnableRequest
5518    {
5519        #[inline]
5520        unsafe fn encode(
5521            self,
5522            encoder: &mut fidl::encoding::Encoder<'_, D>,
5523            offset: usize,
5524            _depth: fidl::encoding::Depth,
5525        ) -> fidl::Result<()> {
5526            encoder.debug_check_bounds::<SessionClockEnableRequest>(offset);
5527            unsafe {
5528                // Copy the object into the buffer.
5529                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5530                (buf_ptr as *mut SessionClockEnableRequest)
5531                    .write_unaligned((self as *const SessionClockEnableRequest).read());
5532                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5533                // done second because the memcpy will write garbage to these bytes.
5534            }
5535            Ok(())
5536        }
5537    }
5538    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5539        fidl::encoding::Encode<SessionClockEnableRequest, D> for (T0,)
5540    {
5541        #[inline]
5542        unsafe fn encode(
5543            self,
5544            encoder: &mut fidl::encoding::Encoder<'_, D>,
5545            offset: usize,
5546            depth: fidl::encoding::Depth,
5547        ) -> fidl::Result<()> {
5548            encoder.debug_check_bounds::<SessionClockEnableRequest>(offset);
5549            // Zero out padding regions. There's no need to apply masks
5550            // because the unmasked parts will be overwritten by fields.
5551            // Write the fields.
5552            self.0.encode(encoder, offset + 0, depth)?;
5553            Ok(())
5554        }
5555    }
5556
5557    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5558        for SessionClockEnableRequest
5559    {
5560        #[inline(always)]
5561        fn new_empty() -> Self {
5562            Self { resource: fidl::new_empty!(u32, D) }
5563        }
5564
5565        #[inline]
5566        unsafe fn decode(
5567            &mut self,
5568            decoder: &mut fidl::encoding::Decoder<'_, D>,
5569            offset: usize,
5570            _depth: fidl::encoding::Depth,
5571        ) -> fidl::Result<()> {
5572            decoder.debug_check_bounds::<Self>(offset);
5573            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5574            // Verify that padding bytes are zero.
5575            // Copy from the buffer into the object.
5576            unsafe {
5577                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5578            }
5579            Ok(())
5580        }
5581    }
5582
5583    impl fidl::encoding::ValueTypeMarker for SessionClockGetRateRequest {
5584        type Borrowed<'a> = &'a Self;
5585        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5586            value
5587        }
5588    }
5589
5590    unsafe impl fidl::encoding::TypeMarker for SessionClockGetRateRequest {
5591        type Owned = Self;
5592
5593        #[inline(always)]
5594        fn inline_align(_context: fidl::encoding::Context) -> usize {
5595            4
5596        }
5597
5598        #[inline(always)]
5599        fn inline_size(_context: fidl::encoding::Context) -> usize {
5600            4
5601        }
5602        #[inline(always)]
5603        fn encode_is_copy() -> bool {
5604            true
5605        }
5606
5607        #[inline(always)]
5608        fn decode_is_copy() -> bool {
5609            true
5610        }
5611    }
5612
5613    unsafe impl<D: fidl::encoding::ResourceDialect>
5614        fidl::encoding::Encode<SessionClockGetRateRequest, D> for &SessionClockGetRateRequest
5615    {
5616        #[inline]
5617        unsafe fn encode(
5618            self,
5619            encoder: &mut fidl::encoding::Encoder<'_, D>,
5620            offset: usize,
5621            _depth: fidl::encoding::Depth,
5622        ) -> fidl::Result<()> {
5623            encoder.debug_check_bounds::<SessionClockGetRateRequest>(offset);
5624            unsafe {
5625                // Copy the object into the buffer.
5626                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5627                (buf_ptr as *mut SessionClockGetRateRequest)
5628                    .write_unaligned((self as *const SessionClockGetRateRequest).read());
5629                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5630                // done second because the memcpy will write garbage to these bytes.
5631            }
5632            Ok(())
5633        }
5634    }
5635    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5636        fidl::encoding::Encode<SessionClockGetRateRequest, D> for (T0,)
5637    {
5638        #[inline]
5639        unsafe fn encode(
5640            self,
5641            encoder: &mut fidl::encoding::Encoder<'_, D>,
5642            offset: usize,
5643            depth: fidl::encoding::Depth,
5644        ) -> fidl::Result<()> {
5645            encoder.debug_check_bounds::<SessionClockGetRateRequest>(offset);
5646            // Zero out padding regions. There's no need to apply masks
5647            // because the unmasked parts will be overwritten by fields.
5648            // Write the fields.
5649            self.0.encode(encoder, offset + 0, depth)?;
5650            Ok(())
5651        }
5652    }
5653
5654    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5655        for SessionClockGetRateRequest
5656    {
5657        #[inline(always)]
5658        fn new_empty() -> Self {
5659            Self { resource: fidl::new_empty!(u32, D) }
5660        }
5661
5662        #[inline]
5663        unsafe fn decode(
5664            &mut self,
5665            decoder: &mut fidl::encoding::Decoder<'_, D>,
5666            offset: usize,
5667            _depth: fidl::encoding::Depth,
5668        ) -> fidl::Result<()> {
5669            decoder.debug_check_bounds::<Self>(offset);
5670            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5671            // Verify that padding bytes are zero.
5672            // Copy from the buffer into the object.
5673            unsafe {
5674                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5675            }
5676            Ok(())
5677        }
5678    }
5679
5680    impl fidl::encoding::ValueTypeMarker for SessionClockIsEnabledRequest {
5681        type Borrowed<'a> = &'a Self;
5682        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5683            value
5684        }
5685    }
5686
5687    unsafe impl fidl::encoding::TypeMarker for SessionClockIsEnabledRequest {
5688        type Owned = Self;
5689
5690        #[inline(always)]
5691        fn inline_align(_context: fidl::encoding::Context) -> usize {
5692            4
5693        }
5694
5695        #[inline(always)]
5696        fn inline_size(_context: fidl::encoding::Context) -> usize {
5697            4
5698        }
5699        #[inline(always)]
5700        fn encode_is_copy() -> bool {
5701            true
5702        }
5703
5704        #[inline(always)]
5705        fn decode_is_copy() -> bool {
5706            true
5707        }
5708    }
5709
5710    unsafe impl<D: fidl::encoding::ResourceDialect>
5711        fidl::encoding::Encode<SessionClockIsEnabledRequest, D> for &SessionClockIsEnabledRequest
5712    {
5713        #[inline]
5714        unsafe fn encode(
5715            self,
5716            encoder: &mut fidl::encoding::Encoder<'_, D>,
5717            offset: usize,
5718            _depth: fidl::encoding::Depth,
5719        ) -> fidl::Result<()> {
5720            encoder.debug_check_bounds::<SessionClockIsEnabledRequest>(offset);
5721            unsafe {
5722                // Copy the object into the buffer.
5723                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5724                (buf_ptr as *mut SessionClockIsEnabledRequest)
5725                    .write_unaligned((self as *const SessionClockIsEnabledRequest).read());
5726                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5727                // done second because the memcpy will write garbage to these bytes.
5728            }
5729            Ok(())
5730        }
5731    }
5732    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5733        fidl::encoding::Encode<SessionClockIsEnabledRequest, D> for (T0,)
5734    {
5735        #[inline]
5736        unsafe fn encode(
5737            self,
5738            encoder: &mut fidl::encoding::Encoder<'_, D>,
5739            offset: usize,
5740            depth: fidl::encoding::Depth,
5741        ) -> fidl::Result<()> {
5742            encoder.debug_check_bounds::<SessionClockIsEnabledRequest>(offset);
5743            // Zero out padding regions. There's no need to apply masks
5744            // because the unmasked parts will be overwritten by fields.
5745            // Write the fields.
5746            self.0.encode(encoder, offset + 0, depth)?;
5747            Ok(())
5748        }
5749    }
5750
5751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5752        for SessionClockIsEnabledRequest
5753    {
5754        #[inline(always)]
5755        fn new_empty() -> Self {
5756            Self { resource: fidl::new_empty!(u32, D) }
5757        }
5758
5759        #[inline]
5760        unsafe fn decode(
5761            &mut self,
5762            decoder: &mut fidl::encoding::Decoder<'_, D>,
5763            offset: usize,
5764            _depth: fidl::encoding::Depth,
5765        ) -> fidl::Result<()> {
5766            decoder.debug_check_bounds::<Self>(offset);
5767            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5768            // Verify that padding bytes are zero.
5769            // Copy from the buffer into the object.
5770            unsafe {
5771                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5772            }
5773            Ok(())
5774        }
5775    }
5776
5777    impl fidl::encoding::ValueTypeMarker for SessionClockQueryRateRequest {
5778        type Borrowed<'a> = &'a Self;
5779        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5780            value
5781        }
5782    }
5783
5784    unsafe impl fidl::encoding::TypeMarker for SessionClockQueryRateRequest {
5785        type Owned = Self;
5786
5787        #[inline(always)]
5788        fn inline_align(_context: fidl::encoding::Context) -> usize {
5789            8
5790        }
5791
5792        #[inline(always)]
5793        fn inline_size(_context: fidl::encoding::Context) -> usize {
5794            16
5795        }
5796    }
5797
5798    unsafe impl<D: fidl::encoding::ResourceDialect>
5799        fidl::encoding::Encode<SessionClockQueryRateRequest, D> for &SessionClockQueryRateRequest
5800    {
5801        #[inline]
5802        unsafe fn encode(
5803            self,
5804            encoder: &mut fidl::encoding::Encoder<'_, D>,
5805            offset: usize,
5806            _depth: fidl::encoding::Depth,
5807        ) -> fidl::Result<()> {
5808            encoder.debug_check_bounds::<SessionClockQueryRateRequest>(offset);
5809            unsafe {
5810                // Copy the object into the buffer.
5811                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5812                (buf_ptr as *mut SessionClockQueryRateRequest)
5813                    .write_unaligned((self as *const SessionClockQueryRateRequest).read());
5814                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5815                // done second because the memcpy will write garbage to these bytes.
5816                let padding_ptr = buf_ptr.offset(0) as *mut u64;
5817                let padding_mask = 0xffffffff00000000u64;
5818                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5819            }
5820            Ok(())
5821        }
5822    }
5823    unsafe impl<
5824        D: fidl::encoding::ResourceDialect,
5825        T0: fidl::encoding::Encode<u32, D>,
5826        T1: fidl::encoding::Encode<u64, D>,
5827    > fidl::encoding::Encode<SessionClockQueryRateRequest, D> for (T0, T1)
5828    {
5829        #[inline]
5830        unsafe fn encode(
5831            self,
5832            encoder: &mut fidl::encoding::Encoder<'_, D>,
5833            offset: usize,
5834            depth: fidl::encoding::Depth,
5835        ) -> fidl::Result<()> {
5836            encoder.debug_check_bounds::<SessionClockQueryRateRequest>(offset);
5837            // Zero out padding regions. There's no need to apply masks
5838            // because the unmasked parts will be overwritten by fields.
5839            unsafe {
5840                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5841                (ptr as *mut u64).write_unaligned(0);
5842            }
5843            // Write the fields.
5844            self.0.encode(encoder, offset + 0, depth)?;
5845            self.1.encode(encoder, offset + 8, depth)?;
5846            Ok(())
5847        }
5848    }
5849
5850    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5851        for SessionClockQueryRateRequest
5852    {
5853        #[inline(always)]
5854        fn new_empty() -> Self {
5855            Self { resource: fidl::new_empty!(u32, D), hz_in: fidl::new_empty!(u64, D) }
5856        }
5857
5858        #[inline]
5859        unsafe fn decode(
5860            &mut self,
5861            decoder: &mut fidl::encoding::Decoder<'_, D>,
5862            offset: usize,
5863            _depth: fidl::encoding::Depth,
5864        ) -> fidl::Result<()> {
5865            decoder.debug_check_bounds::<Self>(offset);
5866            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5867            // Verify that padding bytes are zero.
5868            let ptr = unsafe { buf_ptr.offset(0) };
5869            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5870            let mask = 0xffffffff00000000u64;
5871            let maskedval = padval & mask;
5872            if maskedval != 0 {
5873                return Err(fidl::Error::NonZeroPadding {
5874                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5875                });
5876            }
5877            // Copy from the buffer into the object.
5878            unsafe {
5879                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5880            }
5881            Ok(())
5882        }
5883    }
5884
5885    impl fidl::encoding::ValueTypeMarker for SessionClockSetRateRequest {
5886        type Borrowed<'a> = &'a Self;
5887        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5888            value
5889        }
5890    }
5891
5892    unsafe impl fidl::encoding::TypeMarker for SessionClockSetRateRequest {
5893        type Owned = Self;
5894
5895        #[inline(always)]
5896        fn inline_align(_context: fidl::encoding::Context) -> usize {
5897            8
5898        }
5899
5900        #[inline(always)]
5901        fn inline_size(_context: fidl::encoding::Context) -> usize {
5902            16
5903        }
5904    }
5905
5906    unsafe impl<D: fidl::encoding::ResourceDialect>
5907        fidl::encoding::Encode<SessionClockSetRateRequest, D> for &SessionClockSetRateRequest
5908    {
5909        #[inline]
5910        unsafe fn encode(
5911            self,
5912            encoder: &mut fidl::encoding::Encoder<'_, D>,
5913            offset: usize,
5914            _depth: fidl::encoding::Depth,
5915        ) -> fidl::Result<()> {
5916            encoder.debug_check_bounds::<SessionClockSetRateRequest>(offset);
5917            unsafe {
5918                // Copy the object into the buffer.
5919                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5920                (buf_ptr as *mut SessionClockSetRateRequest)
5921                    .write_unaligned((self as *const SessionClockSetRateRequest).read());
5922                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5923                // done second because the memcpy will write garbage to these bytes.
5924                let padding_ptr = buf_ptr.offset(0) as *mut u64;
5925                let padding_mask = 0xffffffff00000000u64;
5926                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5927            }
5928            Ok(())
5929        }
5930    }
5931    unsafe impl<
5932        D: fidl::encoding::ResourceDialect,
5933        T0: fidl::encoding::Encode<u32, D>,
5934        T1: fidl::encoding::Encode<u64, D>,
5935    > fidl::encoding::Encode<SessionClockSetRateRequest, D> for (T0, T1)
5936    {
5937        #[inline]
5938        unsafe fn encode(
5939            self,
5940            encoder: &mut fidl::encoding::Encoder<'_, D>,
5941            offset: usize,
5942            depth: fidl::encoding::Depth,
5943        ) -> fidl::Result<()> {
5944            encoder.debug_check_bounds::<SessionClockSetRateRequest>(offset);
5945            // Zero out padding regions. There's no need to apply masks
5946            // because the unmasked parts will be overwritten by fields.
5947            unsafe {
5948                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5949                (ptr as *mut u64).write_unaligned(0);
5950            }
5951            // Write the fields.
5952            self.0.encode(encoder, offset + 0, depth)?;
5953            self.1.encode(encoder, offset + 8, depth)?;
5954            Ok(())
5955        }
5956    }
5957
5958    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5959        for SessionClockSetRateRequest
5960    {
5961        #[inline(always)]
5962        fn new_empty() -> Self {
5963            Self { resource: fidl::new_empty!(u32, D), hz: fidl::new_empty!(u64, D) }
5964        }
5965
5966        #[inline]
5967        unsafe fn decode(
5968            &mut self,
5969            decoder: &mut fidl::encoding::Decoder<'_, D>,
5970            offset: usize,
5971            _depth: fidl::encoding::Depth,
5972        ) -> fidl::Result<()> {
5973            decoder.debug_check_bounds::<Self>(offset);
5974            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5975            // Verify that padding bytes are zero.
5976            let ptr = unsafe { buf_ptr.offset(0) };
5977            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5978            let mask = 0xffffffff00000000u64;
5979            let maskedval = padval & mask;
5980            if maskedval != 0 {
5981                return Err(fidl::Error::NonZeroPadding {
5982                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5983                });
5984            }
5985            // Copy from the buffer into the object.
5986            unsafe {
5987                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5988            }
5989            Ok(())
5990        }
5991    }
5992
5993    impl fidl::encoding::ValueTypeMarker for SessionExecuteSequenceRequest {
5994        type Borrowed<'a> = &'a Self;
5995        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5996            value
5997        }
5998    }
5999
6000    unsafe impl fidl::encoding::TypeMarker for SessionExecuteSequenceRequest {
6001        type Owned = Self;
6002
6003        #[inline(always)]
6004        fn inline_align(_context: fidl::encoding::Context) -> usize {
6005            8
6006        }
6007
6008        #[inline(always)]
6009        fn inline_size(_context: fidl::encoding::Context) -> usize {
6010            16
6011        }
6012    }
6013
6014    unsafe impl<D: fidl::encoding::ResourceDialect>
6015        fidl::encoding::Encode<SessionExecuteSequenceRequest, D>
6016        for &SessionExecuteSequenceRequest
6017    {
6018        #[inline]
6019        unsafe fn encode(
6020            self,
6021            encoder: &mut fidl::encoding::Encoder<'_, D>,
6022            offset: usize,
6023            _depth: fidl::encoding::Depth,
6024        ) -> fidl::Result<()> {
6025            encoder.debug_check_bounds::<SessionExecuteSequenceRequest>(offset);
6026            // Delegate to tuple encoding.
6027            fidl::encoding::Encode::<SessionExecuteSequenceRequest, D>::encode(
6028                (
6029                    <fidl::encoding::Vector<SequenceItem, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
6030                ),
6031                encoder, offset, _depth
6032            )
6033        }
6034    }
6035    unsafe impl<
6036        D: fidl::encoding::ResourceDialect,
6037        T0: fidl::encoding::Encode<fidl::encoding::Vector<SequenceItem, 64>, D>,
6038    > fidl::encoding::Encode<SessionExecuteSequenceRequest, D> for (T0,)
6039    {
6040        #[inline]
6041        unsafe fn encode(
6042            self,
6043            encoder: &mut fidl::encoding::Encoder<'_, D>,
6044            offset: usize,
6045            depth: fidl::encoding::Depth,
6046        ) -> fidl::Result<()> {
6047            encoder.debug_check_bounds::<SessionExecuteSequenceRequest>(offset);
6048            // Zero out padding regions. There's no need to apply masks
6049            // because the unmasked parts will be overwritten by fields.
6050            // Write the fields.
6051            self.0.encode(encoder, offset + 0, depth)?;
6052            Ok(())
6053        }
6054    }
6055
6056    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6057        for SessionExecuteSequenceRequest
6058    {
6059        #[inline(always)]
6060        fn new_empty() -> Self {
6061            Self { items: fidl::new_empty!(fidl::encoding::Vector<SequenceItem, 64>, D) }
6062        }
6063
6064        #[inline]
6065        unsafe fn decode(
6066            &mut self,
6067            decoder: &mut fidl::encoding::Decoder<'_, D>,
6068            offset: usize,
6069            _depth: fidl::encoding::Depth,
6070        ) -> fidl::Result<()> {
6071            decoder.debug_check_bounds::<Self>(offset);
6072            // Verify that padding bytes are zero.
6073            fidl::decode!(fidl::encoding::Vector<SequenceItem, 64>, D, &mut self.items, decoder, offset + 0, _depth)?;
6074            Ok(())
6075        }
6076    }
6077
6078    impl fidl::encoding::ValueTypeMarker for SessionGpioReadRequest {
6079        type Borrowed<'a> = &'a Self;
6080        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6081            value
6082        }
6083    }
6084
6085    unsafe impl fidl::encoding::TypeMarker for SessionGpioReadRequest {
6086        type Owned = Self;
6087
6088        #[inline(always)]
6089        fn inline_align(_context: fidl::encoding::Context) -> usize {
6090            4
6091        }
6092
6093        #[inline(always)]
6094        fn inline_size(_context: fidl::encoding::Context) -> usize {
6095            4
6096        }
6097        #[inline(always)]
6098        fn encode_is_copy() -> bool {
6099            true
6100        }
6101
6102        #[inline(always)]
6103        fn decode_is_copy() -> bool {
6104            true
6105        }
6106    }
6107
6108    unsafe impl<D: fidl::encoding::ResourceDialect>
6109        fidl::encoding::Encode<SessionGpioReadRequest, D> for &SessionGpioReadRequest
6110    {
6111        #[inline]
6112        unsafe fn encode(
6113            self,
6114            encoder: &mut fidl::encoding::Encoder<'_, D>,
6115            offset: usize,
6116            _depth: fidl::encoding::Depth,
6117        ) -> fidl::Result<()> {
6118            encoder.debug_check_bounds::<SessionGpioReadRequest>(offset);
6119            unsafe {
6120                // Copy the object into the buffer.
6121                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6122                (buf_ptr as *mut SessionGpioReadRequest)
6123                    .write_unaligned((self as *const SessionGpioReadRequest).read());
6124                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6125                // done second because the memcpy will write garbage to these bytes.
6126            }
6127            Ok(())
6128        }
6129    }
6130    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6131        fidl::encoding::Encode<SessionGpioReadRequest, D> for (T0,)
6132    {
6133        #[inline]
6134        unsafe fn encode(
6135            self,
6136            encoder: &mut fidl::encoding::Encoder<'_, D>,
6137            offset: usize,
6138            depth: fidl::encoding::Depth,
6139        ) -> fidl::Result<()> {
6140            encoder.debug_check_bounds::<SessionGpioReadRequest>(offset);
6141            // Zero out padding regions. There's no need to apply masks
6142            // because the unmasked parts will be overwritten by fields.
6143            // Write the fields.
6144            self.0.encode(encoder, offset + 0, depth)?;
6145            Ok(())
6146        }
6147    }
6148
6149    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6150        for SessionGpioReadRequest
6151    {
6152        #[inline(always)]
6153        fn new_empty() -> Self {
6154            Self { resource: fidl::new_empty!(u32, D) }
6155        }
6156
6157        #[inline]
6158        unsafe fn decode(
6159            &mut self,
6160            decoder: &mut fidl::encoding::Decoder<'_, D>,
6161            offset: usize,
6162            _depth: fidl::encoding::Depth,
6163        ) -> fidl::Result<()> {
6164            decoder.debug_check_bounds::<Self>(offset);
6165            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6166            // Verify that padding bytes are zero.
6167            // Copy from the buffer into the object.
6168            unsafe {
6169                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6170            }
6171            Ok(())
6172        }
6173    }
6174
6175    impl fidl::encoding::ValueTypeMarker for SessionGpioWriteRequest {
6176        type Borrowed<'a> = &'a Self;
6177        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6178            value
6179        }
6180    }
6181
6182    unsafe impl fidl::encoding::TypeMarker for SessionGpioWriteRequest {
6183        type Owned = Self;
6184
6185        #[inline(always)]
6186        fn inline_align(_context: fidl::encoding::Context) -> usize {
6187            4
6188        }
6189
6190        #[inline(always)]
6191        fn inline_size(_context: fidl::encoding::Context) -> usize {
6192            8
6193        }
6194    }
6195
6196    unsafe impl<D: fidl::encoding::ResourceDialect>
6197        fidl::encoding::Encode<SessionGpioWriteRequest, D> for &SessionGpioWriteRequest
6198    {
6199        #[inline]
6200        unsafe fn encode(
6201            self,
6202            encoder: &mut fidl::encoding::Encoder<'_, D>,
6203            offset: usize,
6204            _depth: fidl::encoding::Depth,
6205        ) -> fidl::Result<()> {
6206            encoder.debug_check_bounds::<SessionGpioWriteRequest>(offset);
6207            // Delegate to tuple encoding.
6208            fidl::encoding::Encode::<SessionGpioWriteRequest, D>::encode(
6209                (
6210                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
6211                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6212                ),
6213                encoder,
6214                offset,
6215                _depth,
6216            )
6217        }
6218    }
6219    unsafe impl<
6220        D: fidl::encoding::ResourceDialect,
6221        T0: fidl::encoding::Encode<u32, D>,
6222        T1: fidl::encoding::Encode<bool, D>,
6223    > fidl::encoding::Encode<SessionGpioWriteRequest, D> for (T0, T1)
6224    {
6225        #[inline]
6226        unsafe fn encode(
6227            self,
6228            encoder: &mut fidl::encoding::Encoder<'_, D>,
6229            offset: usize,
6230            depth: fidl::encoding::Depth,
6231        ) -> fidl::Result<()> {
6232            encoder.debug_check_bounds::<SessionGpioWriteRequest>(offset);
6233            // Zero out padding regions. There's no need to apply masks
6234            // because the unmasked parts will be overwritten by fields.
6235            unsafe {
6236                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
6237                (ptr as *mut u32).write_unaligned(0);
6238            }
6239            // Write the fields.
6240            self.0.encode(encoder, offset + 0, depth)?;
6241            self.1.encode(encoder, offset + 4, depth)?;
6242            Ok(())
6243        }
6244    }
6245
6246    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6247        for SessionGpioWriteRequest
6248    {
6249        #[inline(always)]
6250        fn new_empty() -> Self {
6251            Self { resource: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
6252        }
6253
6254        #[inline]
6255        unsafe fn decode(
6256            &mut self,
6257            decoder: &mut fidl::encoding::Decoder<'_, D>,
6258            offset: usize,
6259            _depth: fidl::encoding::Depth,
6260        ) -> fidl::Result<()> {
6261            decoder.debug_check_bounds::<Self>(offset);
6262            // Verify that padding bytes are zero.
6263            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
6264            let padval = unsafe { (ptr as *const u32).read_unaligned() };
6265            let mask = 0xffffff00u32;
6266            let maskedval = padval & mask;
6267            if maskedval != 0 {
6268                return Err(fidl::Error::NonZeroPadding {
6269                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
6270                });
6271            }
6272            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
6273            fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
6274            Ok(())
6275        }
6276    }
6277
6278    impl fidl::encoding::ValueTypeMarker for SessionI2cTransferRequest {
6279        type Borrowed<'a> = &'a Self;
6280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6281            value
6282        }
6283    }
6284
6285    unsafe impl fidl::encoding::TypeMarker for SessionI2cTransferRequest {
6286        type Owned = Self;
6287
6288        #[inline(always)]
6289        fn inline_align(_context: fidl::encoding::Context) -> usize {
6290            8
6291        }
6292
6293        #[inline(always)]
6294        fn inline_size(_context: fidl::encoding::Context) -> usize {
6295            32
6296        }
6297    }
6298
6299    unsafe impl<D: fidl::encoding::ResourceDialect>
6300        fidl::encoding::Encode<SessionI2cTransferRequest, D> for &SessionI2cTransferRequest
6301    {
6302        #[inline]
6303        unsafe fn encode(
6304            self,
6305            encoder: &mut fidl::encoding::Encoder<'_, D>,
6306            offset: usize,
6307            _depth: fidl::encoding::Depth,
6308        ) -> fidl::Result<()> {
6309            encoder.debug_check_bounds::<SessionI2cTransferRequest>(offset);
6310            // Delegate to tuple encoding.
6311            fidl::encoding::Encode::<SessionI2cTransferRequest, D>::encode(
6312                (
6313                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
6314                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
6315                        &self.write_data,
6316                    ),
6317                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.read_length),
6318                ),
6319                encoder,
6320                offset,
6321                _depth,
6322            )
6323        }
6324    }
6325    unsafe impl<
6326        D: fidl::encoding::ResourceDialect,
6327        T0: fidl::encoding::Encode<u32, D>,
6328        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
6329        T2: fidl::encoding::Encode<u32, D>,
6330    > fidl::encoding::Encode<SessionI2cTransferRequest, D> for (T0, T1, T2)
6331    {
6332        #[inline]
6333        unsafe fn encode(
6334            self,
6335            encoder: &mut fidl::encoding::Encoder<'_, D>,
6336            offset: usize,
6337            depth: fidl::encoding::Depth,
6338        ) -> fidl::Result<()> {
6339            encoder.debug_check_bounds::<SessionI2cTransferRequest>(offset);
6340            // Zero out padding regions. There's no need to apply masks
6341            // because the unmasked parts will be overwritten by fields.
6342            unsafe {
6343                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6344                (ptr as *mut u64).write_unaligned(0);
6345            }
6346            unsafe {
6347                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
6348                (ptr as *mut u64).write_unaligned(0);
6349            }
6350            // Write the fields.
6351            self.0.encode(encoder, offset + 0, depth)?;
6352            self.1.encode(encoder, offset + 8, depth)?;
6353            self.2.encode(encoder, offset + 24, depth)?;
6354            Ok(())
6355        }
6356    }
6357
6358    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6359        for SessionI2cTransferRequest
6360    {
6361        #[inline(always)]
6362        fn new_empty() -> Self {
6363            Self {
6364                resource: fidl::new_empty!(u32, D),
6365                write_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
6366                read_length: fidl::new_empty!(u32, D),
6367            }
6368        }
6369
6370        #[inline]
6371        unsafe fn decode(
6372            &mut self,
6373            decoder: &mut fidl::encoding::Decoder<'_, D>,
6374            offset: usize,
6375            _depth: fidl::encoding::Depth,
6376        ) -> fidl::Result<()> {
6377            decoder.debug_check_bounds::<Self>(offset);
6378            // Verify that padding bytes are zero.
6379            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6380            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6381            let mask = 0xffffffff00000000u64;
6382            let maskedval = padval & mask;
6383            if maskedval != 0 {
6384                return Err(fidl::Error::NonZeroPadding {
6385                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6386                });
6387            }
6388            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
6389            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6390            let mask = 0xffffffff00000000u64;
6391            let maskedval = padval & mask;
6392            if maskedval != 0 {
6393                return Err(fidl::Error::NonZeroPadding {
6394                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
6395                });
6396            }
6397            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
6398            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.write_data, decoder, offset + 8, _depth)?;
6399            fidl::decode!(u32, D, &mut self.read_length, decoder, offset + 24, _depth)?;
6400            Ok(())
6401        }
6402    }
6403
6404    impl fidl::encoding::ValueTypeMarker for SessionPoll32Request {
6405        type Borrowed<'a> = &'a Self;
6406        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6407            value
6408        }
6409    }
6410
6411    unsafe impl fidl::encoding::TypeMarker for SessionPoll32Request {
6412        type Owned = Self;
6413
6414        #[inline(always)]
6415        fn inline_align(_context: fidl::encoding::Context) -> usize {
6416            8
6417        }
6418
6419        #[inline(always)]
6420        fn inline_size(_context: fidl::encoding::Context) -> usize {
6421            40
6422        }
6423    }
6424
6425    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SessionPoll32Request, D>
6426        for &SessionPoll32Request
6427    {
6428        #[inline]
6429        unsafe fn encode(
6430            self,
6431            encoder: &mut fidl::encoding::Encoder<'_, D>,
6432            offset: usize,
6433            _depth: fidl::encoding::Depth,
6434        ) -> fidl::Result<()> {
6435            encoder.debug_check_bounds::<SessionPoll32Request>(offset);
6436            unsafe {
6437                // Copy the object into the buffer.
6438                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6439                (buf_ptr as *mut SessionPoll32Request)
6440                    .write_unaligned((self as *const SessionPoll32Request).read());
6441                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6442                // done second because the memcpy will write garbage to these bytes.
6443                let padding_ptr = buf_ptr.offset(0) as *mut u64;
6444                let padding_mask = 0xffffffff00000000u64;
6445                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6446            }
6447            Ok(())
6448        }
6449    }
6450    unsafe impl<
6451        D: fidl::encoding::ResourceDialect,
6452        T0: fidl::encoding::Encode<u32, D>,
6453        T1: fidl::encoding::Encode<u64, D>,
6454        T2: fidl::encoding::Encode<u32, D>,
6455        T3: fidl::encoding::Encode<u32, D>,
6456        T4: fidl::encoding::Encode<i64, D>,
6457        T5: fidl::encoding::Encode<i64, D>,
6458    > fidl::encoding::Encode<SessionPoll32Request, D> for (T0, T1, T2, T3, T4, T5)
6459    {
6460        #[inline]
6461        unsafe fn encode(
6462            self,
6463            encoder: &mut fidl::encoding::Encoder<'_, D>,
6464            offset: usize,
6465            depth: fidl::encoding::Depth,
6466        ) -> fidl::Result<()> {
6467            encoder.debug_check_bounds::<SessionPoll32Request>(offset);
6468            // Zero out padding regions. There's no need to apply masks
6469            // because the unmasked parts will be overwritten by fields.
6470            unsafe {
6471                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6472                (ptr as *mut u64).write_unaligned(0);
6473            }
6474            // Write the fields.
6475            self.0.encode(encoder, offset + 0, depth)?;
6476            self.1.encode(encoder, offset + 8, depth)?;
6477            self.2.encode(encoder, offset + 16, depth)?;
6478            self.3.encode(encoder, offset + 20, depth)?;
6479            self.4.encode(encoder, offset + 24, depth)?;
6480            self.5.encode(encoder, offset + 32, depth)?;
6481            Ok(())
6482        }
6483    }
6484
6485    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionPoll32Request {
6486        #[inline(always)]
6487        fn new_empty() -> Self {
6488            Self {
6489                resource: fidl::new_empty!(u32, D),
6490                offset: fidl::new_empty!(u64, D),
6491                expected: fidl::new_empty!(u32, D),
6492                mask: fidl::new_empty!(u32, D),
6493                interval_ns: fidl::new_empty!(i64, D),
6494                timeout_ns: fidl::new_empty!(i64, D),
6495            }
6496        }
6497
6498        #[inline]
6499        unsafe fn decode(
6500            &mut self,
6501            decoder: &mut fidl::encoding::Decoder<'_, D>,
6502            offset: usize,
6503            _depth: fidl::encoding::Depth,
6504        ) -> fidl::Result<()> {
6505            decoder.debug_check_bounds::<Self>(offset);
6506            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6507            // Verify that padding bytes are zero.
6508            let ptr = unsafe { buf_ptr.offset(0) };
6509            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6510            let mask = 0xffffffff00000000u64;
6511            let maskedval = padval & mask;
6512            if maskedval != 0 {
6513                return Err(fidl::Error::NonZeroPadding {
6514                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6515                });
6516            }
6517            // Copy from the buffer into the object.
6518            unsafe {
6519                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
6520            }
6521            Ok(())
6522        }
6523    }
6524
6525    impl fidl::encoding::ValueTypeMarker for SessionRead32Request {
6526        type Borrowed<'a> = &'a Self;
6527        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6528            value
6529        }
6530    }
6531
6532    unsafe impl fidl::encoding::TypeMarker for SessionRead32Request {
6533        type Owned = Self;
6534
6535        #[inline(always)]
6536        fn inline_align(_context: fidl::encoding::Context) -> usize {
6537            8
6538        }
6539
6540        #[inline(always)]
6541        fn inline_size(_context: fidl::encoding::Context) -> usize {
6542            16
6543        }
6544    }
6545
6546    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SessionRead32Request, D>
6547        for &SessionRead32Request
6548    {
6549        #[inline]
6550        unsafe fn encode(
6551            self,
6552            encoder: &mut fidl::encoding::Encoder<'_, D>,
6553            offset: usize,
6554            _depth: fidl::encoding::Depth,
6555        ) -> fidl::Result<()> {
6556            encoder.debug_check_bounds::<SessionRead32Request>(offset);
6557            unsafe {
6558                // Copy the object into the buffer.
6559                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6560                (buf_ptr as *mut SessionRead32Request)
6561                    .write_unaligned((self as *const SessionRead32Request).read());
6562                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6563                // done second because the memcpy will write garbage to these bytes.
6564                let padding_ptr = buf_ptr.offset(0) as *mut u64;
6565                let padding_mask = 0xffffffff00000000u64;
6566                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6567            }
6568            Ok(())
6569        }
6570    }
6571    unsafe impl<
6572        D: fidl::encoding::ResourceDialect,
6573        T0: fidl::encoding::Encode<u32, D>,
6574        T1: fidl::encoding::Encode<u64, D>,
6575    > fidl::encoding::Encode<SessionRead32Request, D> for (T0, T1)
6576    {
6577        #[inline]
6578        unsafe fn encode(
6579            self,
6580            encoder: &mut fidl::encoding::Encoder<'_, D>,
6581            offset: usize,
6582            depth: fidl::encoding::Depth,
6583        ) -> fidl::Result<()> {
6584            encoder.debug_check_bounds::<SessionRead32Request>(offset);
6585            // Zero out padding regions. There's no need to apply masks
6586            // because the unmasked parts will be overwritten by fields.
6587            unsafe {
6588                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6589                (ptr as *mut u64).write_unaligned(0);
6590            }
6591            // Write the fields.
6592            self.0.encode(encoder, offset + 0, depth)?;
6593            self.1.encode(encoder, offset + 8, depth)?;
6594            Ok(())
6595        }
6596    }
6597
6598    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionRead32Request {
6599        #[inline(always)]
6600        fn new_empty() -> Self {
6601            Self { resource: fidl::new_empty!(u32, D), offset: fidl::new_empty!(u64, D) }
6602        }
6603
6604        #[inline]
6605        unsafe fn decode(
6606            &mut self,
6607            decoder: &mut fidl::encoding::Decoder<'_, D>,
6608            offset: usize,
6609            _depth: fidl::encoding::Depth,
6610        ) -> fidl::Result<()> {
6611            decoder.debug_check_bounds::<Self>(offset);
6612            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6613            // Verify that padding bytes are zero.
6614            let ptr = unsafe { buf_ptr.offset(0) };
6615            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6616            let mask = 0xffffffff00000000u64;
6617            let maskedval = padval & mask;
6618            if maskedval != 0 {
6619                return Err(fidl::Error::NonZeroPadding {
6620                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6621                });
6622            }
6623            // Copy from the buffer into the object.
6624            unsafe {
6625                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
6626            }
6627            Ok(())
6628        }
6629    }
6630
6631    impl fidl::encoding::ValueTypeMarker for SessionReadAuditRequest {
6632        type Borrowed<'a> = &'a Self;
6633        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6634            value
6635        }
6636    }
6637
6638    unsafe impl fidl::encoding::TypeMarker for SessionReadAuditRequest {
6639        type Owned = Self;
6640
6641        #[inline(always)]
6642        fn inline_align(_context: fidl::encoding::Context) -> usize {
6643            8
6644        }
6645
6646        #[inline(always)]
6647        fn inline_size(_context: fidl::encoding::Context) -> usize {
6648            16
6649        }
6650    }
6651
6652    unsafe impl<D: fidl::encoding::ResourceDialect>
6653        fidl::encoding::Encode<SessionReadAuditRequest, D> for &SessionReadAuditRequest
6654    {
6655        #[inline]
6656        unsafe fn encode(
6657            self,
6658            encoder: &mut fidl::encoding::Encoder<'_, D>,
6659            offset: usize,
6660            _depth: fidl::encoding::Depth,
6661        ) -> fidl::Result<()> {
6662            encoder.debug_check_bounds::<SessionReadAuditRequest>(offset);
6663            unsafe {
6664                // Copy the object into the buffer.
6665                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6666                (buf_ptr as *mut SessionReadAuditRequest)
6667                    .write_unaligned((self as *const SessionReadAuditRequest).read());
6668                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6669                // done second because the memcpy will write garbage to these bytes.
6670                let padding_ptr = buf_ptr.offset(8) as *mut u64;
6671                let padding_mask = 0xffffffff00000000u64;
6672                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6673            }
6674            Ok(())
6675        }
6676    }
6677    unsafe impl<
6678        D: fidl::encoding::ResourceDialect,
6679        T0: fidl::encoding::Encode<u64, D>,
6680        T1: fidl::encoding::Encode<u32, D>,
6681    > fidl::encoding::Encode<SessionReadAuditRequest, D> for (T0, T1)
6682    {
6683        #[inline]
6684        unsafe fn encode(
6685            self,
6686            encoder: &mut fidl::encoding::Encoder<'_, D>,
6687            offset: usize,
6688            depth: fidl::encoding::Depth,
6689        ) -> fidl::Result<()> {
6690            encoder.debug_check_bounds::<SessionReadAuditRequest>(offset);
6691            // Zero out padding regions. There's no need to apply masks
6692            // because the unmasked parts will be overwritten by fields.
6693            unsafe {
6694                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
6695                (ptr as *mut u64).write_unaligned(0);
6696            }
6697            // Write the fields.
6698            self.0.encode(encoder, offset + 0, depth)?;
6699            self.1.encode(encoder, offset + 8, depth)?;
6700            Ok(())
6701        }
6702    }
6703
6704    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6705        for SessionReadAuditRequest
6706    {
6707        #[inline(always)]
6708        fn new_empty() -> Self {
6709            Self { cursor: fidl::new_empty!(u64, D), limit: fidl::new_empty!(u32, D) }
6710        }
6711
6712        #[inline]
6713        unsafe fn decode(
6714            &mut self,
6715            decoder: &mut fidl::encoding::Decoder<'_, D>,
6716            offset: usize,
6717            _depth: fidl::encoding::Depth,
6718        ) -> fidl::Result<()> {
6719            decoder.debug_check_bounds::<Self>(offset);
6720            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6721            // Verify that padding bytes are zero.
6722            let ptr = unsafe { buf_ptr.offset(8) };
6723            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6724            let mask = 0xffffffff00000000u64;
6725            let maskedval = padval & mask;
6726            if maskedval != 0 {
6727                return Err(fidl::Error::NonZeroPadding {
6728                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6729                });
6730            }
6731            // Copy from the buffer into the object.
6732            unsafe {
6733                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
6734            }
6735            Ok(())
6736        }
6737    }
6738
6739    impl fidl::encoding::ValueTypeMarker for SessionResetAssertRequest {
6740        type Borrowed<'a> = &'a Self;
6741        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6742            value
6743        }
6744    }
6745
6746    unsafe impl fidl::encoding::TypeMarker for SessionResetAssertRequest {
6747        type Owned = Self;
6748
6749        #[inline(always)]
6750        fn inline_align(_context: fidl::encoding::Context) -> usize {
6751            4
6752        }
6753
6754        #[inline(always)]
6755        fn inline_size(_context: fidl::encoding::Context) -> usize {
6756            4
6757        }
6758        #[inline(always)]
6759        fn encode_is_copy() -> bool {
6760            true
6761        }
6762
6763        #[inline(always)]
6764        fn decode_is_copy() -> bool {
6765            true
6766        }
6767    }
6768
6769    unsafe impl<D: fidl::encoding::ResourceDialect>
6770        fidl::encoding::Encode<SessionResetAssertRequest, D> for &SessionResetAssertRequest
6771    {
6772        #[inline]
6773        unsafe fn encode(
6774            self,
6775            encoder: &mut fidl::encoding::Encoder<'_, D>,
6776            offset: usize,
6777            _depth: fidl::encoding::Depth,
6778        ) -> fidl::Result<()> {
6779            encoder.debug_check_bounds::<SessionResetAssertRequest>(offset);
6780            unsafe {
6781                // Copy the object into the buffer.
6782                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6783                (buf_ptr as *mut SessionResetAssertRequest)
6784                    .write_unaligned((self as *const SessionResetAssertRequest).read());
6785                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6786                // done second because the memcpy will write garbage to these bytes.
6787            }
6788            Ok(())
6789        }
6790    }
6791    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6792        fidl::encoding::Encode<SessionResetAssertRequest, D> for (T0,)
6793    {
6794        #[inline]
6795        unsafe fn encode(
6796            self,
6797            encoder: &mut fidl::encoding::Encoder<'_, D>,
6798            offset: usize,
6799            depth: fidl::encoding::Depth,
6800        ) -> fidl::Result<()> {
6801            encoder.debug_check_bounds::<SessionResetAssertRequest>(offset);
6802            // Zero out padding regions. There's no need to apply masks
6803            // because the unmasked parts will be overwritten by fields.
6804            // Write the fields.
6805            self.0.encode(encoder, offset + 0, depth)?;
6806            Ok(())
6807        }
6808    }
6809
6810    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6811        for SessionResetAssertRequest
6812    {
6813        #[inline(always)]
6814        fn new_empty() -> Self {
6815            Self { resource: fidl::new_empty!(u32, D) }
6816        }
6817
6818        #[inline]
6819        unsafe fn decode(
6820            &mut self,
6821            decoder: &mut fidl::encoding::Decoder<'_, D>,
6822            offset: usize,
6823            _depth: fidl::encoding::Depth,
6824        ) -> fidl::Result<()> {
6825            decoder.debug_check_bounds::<Self>(offset);
6826            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6827            // Verify that padding bytes are zero.
6828            // Copy from the buffer into the object.
6829            unsafe {
6830                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6831            }
6832            Ok(())
6833        }
6834    }
6835
6836    impl fidl::encoding::ValueTypeMarker for SessionResetDeassertRequest {
6837        type Borrowed<'a> = &'a Self;
6838        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6839            value
6840        }
6841    }
6842
6843    unsafe impl fidl::encoding::TypeMarker for SessionResetDeassertRequest {
6844        type Owned = Self;
6845
6846        #[inline(always)]
6847        fn inline_align(_context: fidl::encoding::Context) -> usize {
6848            4
6849        }
6850
6851        #[inline(always)]
6852        fn inline_size(_context: fidl::encoding::Context) -> usize {
6853            4
6854        }
6855        #[inline(always)]
6856        fn encode_is_copy() -> bool {
6857            true
6858        }
6859
6860        #[inline(always)]
6861        fn decode_is_copy() -> bool {
6862            true
6863        }
6864    }
6865
6866    unsafe impl<D: fidl::encoding::ResourceDialect>
6867        fidl::encoding::Encode<SessionResetDeassertRequest, D> for &SessionResetDeassertRequest
6868    {
6869        #[inline]
6870        unsafe fn encode(
6871            self,
6872            encoder: &mut fidl::encoding::Encoder<'_, D>,
6873            offset: usize,
6874            _depth: fidl::encoding::Depth,
6875        ) -> fidl::Result<()> {
6876            encoder.debug_check_bounds::<SessionResetDeassertRequest>(offset);
6877            unsafe {
6878                // Copy the object into the buffer.
6879                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6880                (buf_ptr as *mut SessionResetDeassertRequest)
6881                    .write_unaligned((self as *const SessionResetDeassertRequest).read());
6882                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6883                // done second because the memcpy will write garbage to these bytes.
6884            }
6885            Ok(())
6886        }
6887    }
6888    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6889        fidl::encoding::Encode<SessionResetDeassertRequest, D> for (T0,)
6890    {
6891        #[inline]
6892        unsafe fn encode(
6893            self,
6894            encoder: &mut fidl::encoding::Encoder<'_, D>,
6895            offset: usize,
6896            depth: fidl::encoding::Depth,
6897        ) -> fidl::Result<()> {
6898            encoder.debug_check_bounds::<SessionResetDeassertRequest>(offset);
6899            // Zero out padding regions. There's no need to apply masks
6900            // because the unmasked parts will be overwritten by fields.
6901            // Write the fields.
6902            self.0.encode(encoder, offset + 0, depth)?;
6903            Ok(())
6904        }
6905    }
6906
6907    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6908        for SessionResetDeassertRequest
6909    {
6910        #[inline(always)]
6911        fn new_empty() -> Self {
6912            Self { resource: fidl::new_empty!(u32, D) }
6913        }
6914
6915        #[inline]
6916        unsafe fn decode(
6917            &mut self,
6918            decoder: &mut fidl::encoding::Decoder<'_, D>,
6919            offset: usize,
6920            _depth: fidl::encoding::Depth,
6921        ) -> fidl::Result<()> {
6922            decoder.debug_check_bounds::<Self>(offset);
6923            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6924            // Verify that padding bytes are zero.
6925            // Copy from the buffer into the object.
6926            unsafe {
6927                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6928            }
6929            Ok(())
6930        }
6931    }
6932
6933    impl fidl::encoding::ValueTypeMarker for SessionResetStatusRequest {
6934        type Borrowed<'a> = &'a Self;
6935        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6936            value
6937        }
6938    }
6939
6940    unsafe impl fidl::encoding::TypeMarker for SessionResetStatusRequest {
6941        type Owned = Self;
6942
6943        #[inline(always)]
6944        fn inline_align(_context: fidl::encoding::Context) -> usize {
6945            4
6946        }
6947
6948        #[inline(always)]
6949        fn inline_size(_context: fidl::encoding::Context) -> usize {
6950            4
6951        }
6952        #[inline(always)]
6953        fn encode_is_copy() -> bool {
6954            true
6955        }
6956
6957        #[inline(always)]
6958        fn decode_is_copy() -> bool {
6959            true
6960        }
6961    }
6962
6963    unsafe impl<D: fidl::encoding::ResourceDialect>
6964        fidl::encoding::Encode<SessionResetStatusRequest, D> for &SessionResetStatusRequest
6965    {
6966        #[inline]
6967        unsafe fn encode(
6968            self,
6969            encoder: &mut fidl::encoding::Encoder<'_, D>,
6970            offset: usize,
6971            _depth: fidl::encoding::Depth,
6972        ) -> fidl::Result<()> {
6973            encoder.debug_check_bounds::<SessionResetStatusRequest>(offset);
6974            unsafe {
6975                // Copy the object into the buffer.
6976                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6977                (buf_ptr as *mut SessionResetStatusRequest)
6978                    .write_unaligned((self as *const SessionResetStatusRequest).read());
6979                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6980                // done second because the memcpy will write garbage to these bytes.
6981            }
6982            Ok(())
6983        }
6984    }
6985    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6986        fidl::encoding::Encode<SessionResetStatusRequest, D> for (T0,)
6987    {
6988        #[inline]
6989        unsafe fn encode(
6990            self,
6991            encoder: &mut fidl::encoding::Encoder<'_, D>,
6992            offset: usize,
6993            depth: fidl::encoding::Depth,
6994        ) -> fidl::Result<()> {
6995            encoder.debug_check_bounds::<SessionResetStatusRequest>(offset);
6996            // Zero out padding regions. There's no need to apply masks
6997            // because the unmasked parts will be overwritten by fields.
6998            // Write the fields.
6999            self.0.encode(encoder, offset + 0, depth)?;
7000            Ok(())
7001        }
7002    }
7003
7004    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7005        for SessionResetStatusRequest
7006    {
7007        #[inline(always)]
7008        fn new_empty() -> Self {
7009            Self { resource: fidl::new_empty!(u32, D) }
7010        }
7011
7012        #[inline]
7013        unsafe fn decode(
7014            &mut self,
7015            decoder: &mut fidl::encoding::Decoder<'_, D>,
7016            offset: usize,
7017            _depth: fidl::encoding::Depth,
7018        ) -> fidl::Result<()> {
7019            decoder.debug_check_bounds::<Self>(offset);
7020            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7021            // Verify that padding bytes are zero.
7022            // Copy from the buffer into the object.
7023            unsafe {
7024                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7025            }
7026            Ok(())
7027        }
7028    }
7029
7030    impl fidl::encoding::ValueTypeMarker for SessionResetToggleRequest {
7031        type Borrowed<'a> = &'a Self;
7032        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7033            value
7034        }
7035    }
7036
7037    unsafe impl fidl::encoding::TypeMarker for SessionResetToggleRequest {
7038        type Owned = Self;
7039
7040        #[inline(always)]
7041        fn inline_align(_context: fidl::encoding::Context) -> usize {
7042            4
7043        }
7044
7045        #[inline(always)]
7046        fn inline_size(_context: fidl::encoding::Context) -> usize {
7047            4
7048        }
7049        #[inline(always)]
7050        fn encode_is_copy() -> bool {
7051            true
7052        }
7053
7054        #[inline(always)]
7055        fn decode_is_copy() -> bool {
7056            true
7057        }
7058    }
7059
7060    unsafe impl<D: fidl::encoding::ResourceDialect>
7061        fidl::encoding::Encode<SessionResetToggleRequest, D> for &SessionResetToggleRequest
7062    {
7063        #[inline]
7064        unsafe fn encode(
7065            self,
7066            encoder: &mut fidl::encoding::Encoder<'_, D>,
7067            offset: usize,
7068            _depth: fidl::encoding::Depth,
7069        ) -> fidl::Result<()> {
7070            encoder.debug_check_bounds::<SessionResetToggleRequest>(offset);
7071            unsafe {
7072                // Copy the object into the buffer.
7073                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7074                (buf_ptr as *mut SessionResetToggleRequest)
7075                    .write_unaligned((self as *const SessionResetToggleRequest).read());
7076                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7077                // done second because the memcpy will write garbage to these bytes.
7078            }
7079            Ok(())
7080        }
7081    }
7082    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7083        fidl::encoding::Encode<SessionResetToggleRequest, D> for (T0,)
7084    {
7085        #[inline]
7086        unsafe fn encode(
7087            self,
7088            encoder: &mut fidl::encoding::Encoder<'_, D>,
7089            offset: usize,
7090            depth: fidl::encoding::Depth,
7091        ) -> fidl::Result<()> {
7092            encoder.debug_check_bounds::<SessionResetToggleRequest>(offset);
7093            // Zero out padding regions. There's no need to apply masks
7094            // because the unmasked parts will be overwritten by fields.
7095            // Write the fields.
7096            self.0.encode(encoder, offset + 0, depth)?;
7097            Ok(())
7098        }
7099    }
7100
7101    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7102        for SessionResetToggleRequest
7103    {
7104        #[inline(always)]
7105        fn new_empty() -> Self {
7106            Self { resource: fidl::new_empty!(u32, D) }
7107        }
7108
7109        #[inline]
7110        unsafe fn decode(
7111            &mut self,
7112            decoder: &mut fidl::encoding::Decoder<'_, D>,
7113            offset: usize,
7114            _depth: fidl::encoding::Depth,
7115        ) -> fidl::Result<()> {
7116            decoder.debug_check_bounds::<Self>(offset);
7117            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7118            // Verify that padding bytes are zero.
7119            // Copy from the buffer into the object.
7120            unsafe {
7121                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7122            }
7123            Ok(())
7124        }
7125    }
7126
7127    impl fidl::encoding::ValueTypeMarker for SessionSerialReadRequest {
7128        type Borrowed<'a> = &'a Self;
7129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7130            value
7131        }
7132    }
7133
7134    unsafe impl fidl::encoding::TypeMarker for SessionSerialReadRequest {
7135        type Owned = Self;
7136
7137        #[inline(always)]
7138        fn inline_align(_context: fidl::encoding::Context) -> usize {
7139            4
7140        }
7141
7142        #[inline(always)]
7143        fn inline_size(_context: fidl::encoding::Context) -> usize {
7144            4
7145        }
7146        #[inline(always)]
7147        fn encode_is_copy() -> bool {
7148            true
7149        }
7150
7151        #[inline(always)]
7152        fn decode_is_copy() -> bool {
7153            true
7154        }
7155    }
7156
7157    unsafe impl<D: fidl::encoding::ResourceDialect>
7158        fidl::encoding::Encode<SessionSerialReadRequest, D> for &SessionSerialReadRequest
7159    {
7160        #[inline]
7161        unsafe fn encode(
7162            self,
7163            encoder: &mut fidl::encoding::Encoder<'_, D>,
7164            offset: usize,
7165            _depth: fidl::encoding::Depth,
7166        ) -> fidl::Result<()> {
7167            encoder.debug_check_bounds::<SessionSerialReadRequest>(offset);
7168            unsafe {
7169                // Copy the object into the buffer.
7170                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7171                (buf_ptr as *mut SessionSerialReadRequest)
7172                    .write_unaligned((self as *const SessionSerialReadRequest).read());
7173                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7174                // done second because the memcpy will write garbage to these bytes.
7175            }
7176            Ok(())
7177        }
7178    }
7179    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7180        fidl::encoding::Encode<SessionSerialReadRequest, D> for (T0,)
7181    {
7182        #[inline]
7183        unsafe fn encode(
7184            self,
7185            encoder: &mut fidl::encoding::Encoder<'_, D>,
7186            offset: usize,
7187            depth: fidl::encoding::Depth,
7188        ) -> fidl::Result<()> {
7189            encoder.debug_check_bounds::<SessionSerialReadRequest>(offset);
7190            // Zero out padding regions. There's no need to apply masks
7191            // because the unmasked parts will be overwritten by fields.
7192            // Write the fields.
7193            self.0.encode(encoder, offset + 0, depth)?;
7194            Ok(())
7195        }
7196    }
7197
7198    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7199        for SessionSerialReadRequest
7200    {
7201        #[inline(always)]
7202        fn new_empty() -> Self {
7203            Self { resource: fidl::new_empty!(u32, D) }
7204        }
7205
7206        #[inline]
7207        unsafe fn decode(
7208            &mut self,
7209            decoder: &mut fidl::encoding::Decoder<'_, D>,
7210            offset: usize,
7211            _depth: fidl::encoding::Depth,
7212        ) -> fidl::Result<()> {
7213            decoder.debug_check_bounds::<Self>(offset);
7214            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7215            // Verify that padding bytes are zero.
7216            // Copy from the buffer into the object.
7217            unsafe {
7218                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7219            }
7220            Ok(())
7221        }
7222    }
7223
7224    impl fidl::encoding::ValueTypeMarker for SessionSerialWriteRequest {
7225        type Borrowed<'a> = &'a Self;
7226        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7227            value
7228        }
7229    }
7230
7231    unsafe impl fidl::encoding::TypeMarker for SessionSerialWriteRequest {
7232        type Owned = Self;
7233
7234        #[inline(always)]
7235        fn inline_align(_context: fidl::encoding::Context) -> usize {
7236            8
7237        }
7238
7239        #[inline(always)]
7240        fn inline_size(_context: fidl::encoding::Context) -> usize {
7241            24
7242        }
7243    }
7244
7245    unsafe impl<D: fidl::encoding::ResourceDialect>
7246        fidl::encoding::Encode<SessionSerialWriteRequest, D> for &SessionSerialWriteRequest
7247    {
7248        #[inline]
7249        unsafe fn encode(
7250            self,
7251            encoder: &mut fidl::encoding::Encoder<'_, D>,
7252            offset: usize,
7253            _depth: fidl::encoding::Depth,
7254        ) -> fidl::Result<()> {
7255            encoder.debug_check_bounds::<SessionSerialWriteRequest>(offset);
7256            // Delegate to tuple encoding.
7257            fidl::encoding::Encode::<SessionSerialWriteRequest, D>::encode(
7258                (
7259                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
7260                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
7261                        &self.data,
7262                    ),
7263                ),
7264                encoder,
7265                offset,
7266                _depth,
7267            )
7268        }
7269    }
7270    unsafe impl<
7271        D: fidl::encoding::ResourceDialect,
7272        T0: fidl::encoding::Encode<u32, D>,
7273        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
7274    > fidl::encoding::Encode<SessionSerialWriteRequest, D> for (T0, T1)
7275    {
7276        #[inline]
7277        unsafe fn encode(
7278            self,
7279            encoder: &mut fidl::encoding::Encoder<'_, D>,
7280            offset: usize,
7281            depth: fidl::encoding::Depth,
7282        ) -> fidl::Result<()> {
7283            encoder.debug_check_bounds::<SessionSerialWriteRequest>(offset);
7284            // Zero out padding regions. There's no need to apply masks
7285            // because the unmasked parts will be overwritten by fields.
7286            unsafe {
7287                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7288                (ptr as *mut u64).write_unaligned(0);
7289            }
7290            // Write the fields.
7291            self.0.encode(encoder, offset + 0, depth)?;
7292            self.1.encode(encoder, offset + 8, depth)?;
7293            Ok(())
7294        }
7295    }
7296
7297    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7298        for SessionSerialWriteRequest
7299    {
7300        #[inline(always)]
7301        fn new_empty() -> Self {
7302            Self {
7303                resource: fidl::new_empty!(u32, D),
7304                data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
7305            }
7306        }
7307
7308        #[inline]
7309        unsafe fn decode(
7310            &mut self,
7311            decoder: &mut fidl::encoding::Decoder<'_, D>,
7312            offset: usize,
7313            _depth: fidl::encoding::Depth,
7314        ) -> fidl::Result<()> {
7315            decoder.debug_check_bounds::<Self>(offset);
7316            // Verify that padding bytes are zero.
7317            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7318            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7319            let mask = 0xffffffff00000000u64;
7320            let maskedval = padval & mask;
7321            if maskedval != 0 {
7322                return Err(fidl::Error::NonZeroPadding {
7323                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7324                });
7325            }
7326            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
7327            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 8, _depth)?;
7328            Ok(())
7329        }
7330    }
7331
7332    impl fidl::encoding::ValueTypeMarker for SessionSnapshotRequest {
7333        type Borrowed<'a> = &'a Self;
7334        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7335            value
7336        }
7337    }
7338
7339    unsafe impl fidl::encoding::TypeMarker for SessionSnapshotRequest {
7340        type Owned = Self;
7341
7342        #[inline(always)]
7343        fn inline_align(_context: fidl::encoding::Context) -> usize {
7344            8
7345        }
7346
7347        #[inline(always)]
7348        fn inline_size(_context: fidl::encoding::Context) -> usize {
7349            16
7350        }
7351    }
7352
7353    unsafe impl<D: fidl::encoding::ResourceDialect>
7354        fidl::encoding::Encode<SessionSnapshotRequest, D> for &SessionSnapshotRequest
7355    {
7356        #[inline]
7357        unsafe fn encode(
7358            self,
7359            encoder: &mut fidl::encoding::Encoder<'_, D>,
7360            offset: usize,
7361            _depth: fidl::encoding::Depth,
7362        ) -> fidl::Result<()> {
7363            encoder.debug_check_bounds::<SessionSnapshotRequest>(offset);
7364            // Delegate to tuple encoding.
7365            fidl::encoding::Encode::<SessionSnapshotRequest, D>::encode(
7366                (
7367                    <fidl::encoding::Vector<SnapshotItem, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
7368                ),
7369                encoder, offset, _depth
7370            )
7371        }
7372    }
7373    unsafe impl<
7374        D: fidl::encoding::ResourceDialect,
7375        T0: fidl::encoding::Encode<fidl::encoding::Vector<SnapshotItem, 64>, D>,
7376    > fidl::encoding::Encode<SessionSnapshotRequest, D> for (T0,)
7377    {
7378        #[inline]
7379        unsafe fn encode(
7380            self,
7381            encoder: &mut fidl::encoding::Encoder<'_, D>,
7382            offset: usize,
7383            depth: fidl::encoding::Depth,
7384        ) -> fidl::Result<()> {
7385            encoder.debug_check_bounds::<SessionSnapshotRequest>(offset);
7386            // Zero out padding regions. There's no need to apply masks
7387            // because the unmasked parts will be overwritten by fields.
7388            // Write the fields.
7389            self.0.encode(encoder, offset + 0, depth)?;
7390            Ok(())
7391        }
7392    }
7393
7394    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7395        for SessionSnapshotRequest
7396    {
7397        #[inline(always)]
7398        fn new_empty() -> Self {
7399            Self { items: fidl::new_empty!(fidl::encoding::Vector<SnapshotItem, 64>, D) }
7400        }
7401
7402        #[inline]
7403        unsafe fn decode(
7404            &mut self,
7405            decoder: &mut fidl::encoding::Decoder<'_, D>,
7406            offset: usize,
7407            _depth: fidl::encoding::Depth,
7408        ) -> fidl::Result<()> {
7409            decoder.debug_check_bounds::<Self>(offset);
7410            // Verify that padding bytes are zero.
7411            fidl::decode!(fidl::encoding::Vector<SnapshotItem, 64>, D, &mut self.items, decoder, offset + 0, _depth)?;
7412            Ok(())
7413        }
7414    }
7415
7416    impl fidl::encoding::ValueTypeMarker for SessionSpiTransmitRequest {
7417        type Borrowed<'a> = &'a Self;
7418        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7419            value
7420        }
7421    }
7422
7423    unsafe impl fidl::encoding::TypeMarker for SessionSpiTransmitRequest {
7424        type Owned = Self;
7425
7426        #[inline(always)]
7427        fn inline_align(_context: fidl::encoding::Context) -> usize {
7428            8
7429        }
7430
7431        #[inline(always)]
7432        fn inline_size(_context: fidl::encoding::Context) -> usize {
7433            24
7434        }
7435    }
7436
7437    unsafe impl<D: fidl::encoding::ResourceDialect>
7438        fidl::encoding::Encode<SessionSpiTransmitRequest, D> for &SessionSpiTransmitRequest
7439    {
7440        #[inline]
7441        unsafe fn encode(
7442            self,
7443            encoder: &mut fidl::encoding::Encoder<'_, D>,
7444            offset: usize,
7445            _depth: fidl::encoding::Depth,
7446        ) -> fidl::Result<()> {
7447            encoder.debug_check_bounds::<SessionSpiTransmitRequest>(offset);
7448            // Delegate to tuple encoding.
7449            fidl::encoding::Encode::<SessionSpiTransmitRequest, D>::encode(
7450                (
7451                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
7452                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
7453                        &self.tx_data,
7454                    ),
7455                ),
7456                encoder,
7457                offset,
7458                _depth,
7459            )
7460        }
7461    }
7462    unsafe impl<
7463        D: fidl::encoding::ResourceDialect,
7464        T0: fidl::encoding::Encode<u32, D>,
7465        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
7466    > fidl::encoding::Encode<SessionSpiTransmitRequest, D> for (T0, T1)
7467    {
7468        #[inline]
7469        unsafe fn encode(
7470            self,
7471            encoder: &mut fidl::encoding::Encoder<'_, D>,
7472            offset: usize,
7473            depth: fidl::encoding::Depth,
7474        ) -> fidl::Result<()> {
7475            encoder.debug_check_bounds::<SessionSpiTransmitRequest>(offset);
7476            // Zero out padding regions. There's no need to apply masks
7477            // because the unmasked parts will be overwritten by fields.
7478            unsafe {
7479                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7480                (ptr as *mut u64).write_unaligned(0);
7481            }
7482            // Write the fields.
7483            self.0.encode(encoder, offset + 0, depth)?;
7484            self.1.encode(encoder, offset + 8, depth)?;
7485            Ok(())
7486        }
7487    }
7488
7489    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7490        for SessionSpiTransmitRequest
7491    {
7492        #[inline(always)]
7493        fn new_empty() -> Self {
7494            Self {
7495                resource: fidl::new_empty!(u32, D),
7496                tx_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
7497            }
7498        }
7499
7500        #[inline]
7501        unsafe fn decode(
7502            &mut self,
7503            decoder: &mut fidl::encoding::Decoder<'_, D>,
7504            offset: usize,
7505            _depth: fidl::encoding::Depth,
7506        ) -> fidl::Result<()> {
7507            decoder.debug_check_bounds::<Self>(offset);
7508            // Verify that padding bytes are zero.
7509            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7510            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7511            let mask = 0xffffffff00000000u64;
7512            let maskedval = padval & mask;
7513            if maskedval != 0 {
7514                return Err(fidl::Error::NonZeroPadding {
7515                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7516                });
7517            }
7518            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
7519            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.tx_data, decoder, offset + 8, _depth)?;
7520            Ok(())
7521        }
7522    }
7523
7524    impl fidl::encoding::ValueTypeMarker for SessionWaitForInterruptRequest {
7525        type Borrowed<'a> = &'a Self;
7526        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7527            value
7528        }
7529    }
7530
7531    unsafe impl fidl::encoding::TypeMarker for SessionWaitForInterruptRequest {
7532        type Owned = Self;
7533
7534        #[inline(always)]
7535        fn inline_align(_context: fidl::encoding::Context) -> usize {
7536            8
7537        }
7538
7539        #[inline(always)]
7540        fn inline_size(_context: fidl::encoding::Context) -> usize {
7541            24
7542        }
7543    }
7544
7545    unsafe impl<D: fidl::encoding::ResourceDialect>
7546        fidl::encoding::Encode<SessionWaitForInterruptRequest, D>
7547        for &SessionWaitForInterruptRequest
7548    {
7549        #[inline]
7550        unsafe fn encode(
7551            self,
7552            encoder: &mut fidl::encoding::Encoder<'_, D>,
7553            offset: usize,
7554            _depth: fidl::encoding::Depth,
7555        ) -> fidl::Result<()> {
7556            encoder.debug_check_bounds::<SessionWaitForInterruptRequest>(offset);
7557            unsafe {
7558                // Copy the object into the buffer.
7559                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7560                (buf_ptr as *mut SessionWaitForInterruptRequest)
7561                    .write_unaligned((self as *const SessionWaitForInterruptRequest).read());
7562                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7563                // done second because the memcpy will write garbage to these bytes.
7564                let padding_ptr = buf_ptr.offset(0) as *mut u64;
7565                let padding_mask = 0xffffffff00000000u64;
7566                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
7567            }
7568            Ok(())
7569        }
7570    }
7571    unsafe impl<
7572        D: fidl::encoding::ResourceDialect,
7573        T0: fidl::encoding::Encode<u32, D>,
7574        T1: fidl::encoding::Encode<u64, D>,
7575        T2: fidl::encoding::Encode<i64, D>,
7576    > fidl::encoding::Encode<SessionWaitForInterruptRequest, D> for (T0, T1, T2)
7577    {
7578        #[inline]
7579        unsafe fn encode(
7580            self,
7581            encoder: &mut fidl::encoding::Encoder<'_, D>,
7582            offset: usize,
7583            depth: fidl::encoding::Depth,
7584        ) -> fidl::Result<()> {
7585            encoder.debug_check_bounds::<SessionWaitForInterruptRequest>(offset);
7586            // Zero out padding regions. There's no need to apply masks
7587            // because the unmasked parts will be overwritten by fields.
7588            unsafe {
7589                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7590                (ptr as *mut u64).write_unaligned(0);
7591            }
7592            // Write the fields.
7593            self.0.encode(encoder, offset + 0, depth)?;
7594            self.1.encode(encoder, offset + 8, depth)?;
7595            self.2.encode(encoder, offset + 16, depth)?;
7596            Ok(())
7597        }
7598    }
7599
7600    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7601        for SessionWaitForInterruptRequest
7602    {
7603        #[inline(always)]
7604        fn new_empty() -> Self {
7605            Self {
7606                resource: fidl::new_empty!(u32, D),
7607                after_sequence: fidl::new_empty!(u64, D),
7608                timeout_ns: fidl::new_empty!(i64, D),
7609            }
7610        }
7611
7612        #[inline]
7613        unsafe fn decode(
7614            &mut self,
7615            decoder: &mut fidl::encoding::Decoder<'_, D>,
7616            offset: usize,
7617            _depth: fidl::encoding::Depth,
7618        ) -> fidl::Result<()> {
7619            decoder.debug_check_bounds::<Self>(offset);
7620            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7621            // Verify that padding bytes are zero.
7622            let ptr = unsafe { buf_ptr.offset(0) };
7623            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7624            let mask = 0xffffffff00000000u64;
7625            let maskedval = padval & mask;
7626            if maskedval != 0 {
7627                return Err(fidl::Error::NonZeroPadding {
7628                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7629                });
7630            }
7631            // Copy from the buffer into the object.
7632            unsafe {
7633                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
7634            }
7635            Ok(())
7636        }
7637    }
7638
7639    impl fidl::encoding::ValueTypeMarker for SessionWrite32Request {
7640        type Borrowed<'a> = &'a Self;
7641        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7642            value
7643        }
7644    }
7645
7646    unsafe impl fidl::encoding::TypeMarker for SessionWrite32Request {
7647        type Owned = Self;
7648
7649        #[inline(always)]
7650        fn inline_align(_context: fidl::encoding::Context) -> usize {
7651            8
7652        }
7653
7654        #[inline(always)]
7655        fn inline_size(_context: fidl::encoding::Context) -> usize {
7656            40
7657        }
7658    }
7659
7660    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SessionWrite32Request, D>
7661        for &SessionWrite32Request
7662    {
7663        #[inline]
7664        unsafe fn encode(
7665            self,
7666            encoder: &mut fidl::encoding::Encoder<'_, D>,
7667            offset: usize,
7668            _depth: fidl::encoding::Depth,
7669        ) -> fidl::Result<()> {
7670            encoder.debug_check_bounds::<SessionWrite32Request>(offset);
7671            // Delegate to tuple encoding.
7672            fidl::encoding::Encode::<SessionWrite32Request, D>::encode(
7673                (
7674                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
7675                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
7676                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7677                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.write_mask),
7678                    <fidl::encoding::Boxed<WritePrecondition> as fidl::encoding::ValueTypeMarker>::borrow(&self.precondition),
7679                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.readback),
7680                ),
7681                encoder, offset, _depth
7682            )
7683        }
7684    }
7685    unsafe impl<
7686        D: fidl::encoding::ResourceDialect,
7687        T0: fidl::encoding::Encode<u32, D>,
7688        T1: fidl::encoding::Encode<u64, D>,
7689        T2: fidl::encoding::Encode<u32, D>,
7690        T3: fidl::encoding::Encode<u32, D>,
7691        T4: fidl::encoding::Encode<fidl::encoding::Boxed<WritePrecondition>, D>,
7692        T5: fidl::encoding::Encode<bool, D>,
7693    > fidl::encoding::Encode<SessionWrite32Request, D> for (T0, T1, T2, T3, T4, T5)
7694    {
7695        #[inline]
7696        unsafe fn encode(
7697            self,
7698            encoder: &mut fidl::encoding::Encoder<'_, D>,
7699            offset: usize,
7700            depth: fidl::encoding::Depth,
7701        ) -> fidl::Result<()> {
7702            encoder.debug_check_bounds::<SessionWrite32Request>(offset);
7703            // Zero out padding regions. There's no need to apply masks
7704            // because the unmasked parts will be overwritten by fields.
7705            unsafe {
7706                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7707                (ptr as *mut u64).write_unaligned(0);
7708            }
7709            unsafe {
7710                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7711                (ptr as *mut u64).write_unaligned(0);
7712            }
7713            // Write the fields.
7714            self.0.encode(encoder, offset + 0, depth)?;
7715            self.1.encode(encoder, offset + 8, depth)?;
7716            self.2.encode(encoder, offset + 16, depth)?;
7717            self.3.encode(encoder, offset + 20, depth)?;
7718            self.4.encode(encoder, offset + 24, depth)?;
7719            self.5.encode(encoder, offset + 32, depth)?;
7720            Ok(())
7721        }
7722    }
7723
7724    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SessionWrite32Request {
7725        #[inline(always)]
7726        fn new_empty() -> Self {
7727            Self {
7728                resource: fidl::new_empty!(u32, D),
7729                offset: fidl::new_empty!(u64, D),
7730                value: fidl::new_empty!(u32, D),
7731                write_mask: fidl::new_empty!(u32, D),
7732                precondition: fidl::new_empty!(fidl::encoding::Boxed<WritePrecondition>, D),
7733                readback: fidl::new_empty!(bool, D),
7734            }
7735        }
7736
7737        #[inline]
7738        unsafe fn decode(
7739            &mut self,
7740            decoder: &mut fidl::encoding::Decoder<'_, D>,
7741            offset: usize,
7742            _depth: fidl::encoding::Depth,
7743        ) -> fidl::Result<()> {
7744            decoder.debug_check_bounds::<Self>(offset);
7745            // Verify that padding bytes are zero.
7746            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7747            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7748            let mask = 0xffffffff00000000u64;
7749            let maskedval = padval & mask;
7750            if maskedval != 0 {
7751                return Err(fidl::Error::NonZeroPadding {
7752                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7753                });
7754            }
7755            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7756            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7757            let mask = 0xffffffffffffff00u64;
7758            let maskedval = padval & mask;
7759            if maskedval != 0 {
7760                return Err(fidl::Error::NonZeroPadding {
7761                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7762                });
7763            }
7764            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
7765            fidl::decode!(u64, D, &mut self.offset, decoder, offset + 8, _depth)?;
7766            fidl::decode!(u32, D, &mut self.value, decoder, offset + 16, _depth)?;
7767            fidl::decode!(u32, D, &mut self.write_mask, decoder, offset + 20, _depth)?;
7768            fidl::decode!(
7769                fidl::encoding::Boxed<WritePrecondition>,
7770                D,
7771                &mut self.precondition,
7772                decoder,
7773                offset + 24,
7774                _depth
7775            )?;
7776            fidl::decode!(bool, D, &mut self.readback, decoder, offset + 32, _depth)?;
7777            Ok(())
7778        }
7779    }
7780
7781    impl fidl::encoding::ValueTypeMarker for SnapshotItem {
7782        type Borrowed<'a> = &'a Self;
7783        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7784            value
7785        }
7786    }
7787
7788    unsafe impl fidl::encoding::TypeMarker for SnapshotItem {
7789        type Owned = Self;
7790
7791        #[inline(always)]
7792        fn inline_align(_context: fidl::encoding::Context) -> usize {
7793            8
7794        }
7795
7796        #[inline(always)]
7797        fn inline_size(_context: fidl::encoding::Context) -> usize {
7798            16
7799        }
7800    }
7801
7802    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SnapshotItem, D>
7803        for &SnapshotItem
7804    {
7805        #[inline]
7806        unsafe fn encode(
7807            self,
7808            encoder: &mut fidl::encoding::Encoder<'_, D>,
7809            offset: usize,
7810            _depth: fidl::encoding::Depth,
7811        ) -> fidl::Result<()> {
7812            encoder.debug_check_bounds::<SnapshotItem>(offset);
7813            unsafe {
7814                // Copy the object into the buffer.
7815                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7816                (buf_ptr as *mut SnapshotItem)
7817                    .write_unaligned((self as *const SnapshotItem).read());
7818                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7819                // done second because the memcpy will write garbage to these bytes.
7820                let padding_ptr = buf_ptr.offset(0) as *mut u64;
7821                let padding_mask = 0xffffffff00000000u64;
7822                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
7823            }
7824            Ok(())
7825        }
7826    }
7827    unsafe impl<
7828        D: fidl::encoding::ResourceDialect,
7829        T0: fidl::encoding::Encode<u32, D>,
7830        T1: fidl::encoding::Encode<u64, D>,
7831    > fidl::encoding::Encode<SnapshotItem, D> for (T0, T1)
7832    {
7833        #[inline]
7834        unsafe fn encode(
7835            self,
7836            encoder: &mut fidl::encoding::Encoder<'_, D>,
7837            offset: usize,
7838            depth: fidl::encoding::Depth,
7839        ) -> fidl::Result<()> {
7840            encoder.debug_check_bounds::<SnapshotItem>(offset);
7841            // Zero out padding regions. There's no need to apply masks
7842            // because the unmasked parts will be overwritten by fields.
7843            unsafe {
7844                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7845                (ptr as *mut u64).write_unaligned(0);
7846            }
7847            // Write the fields.
7848            self.0.encode(encoder, offset + 0, depth)?;
7849            self.1.encode(encoder, offset + 8, depth)?;
7850            Ok(())
7851        }
7852    }
7853
7854    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SnapshotItem {
7855        #[inline(always)]
7856        fn new_empty() -> Self {
7857            Self { resource: fidl::new_empty!(u32, D), offset: fidl::new_empty!(u64, D) }
7858        }
7859
7860        #[inline]
7861        unsafe fn decode(
7862            &mut self,
7863            decoder: &mut fidl::encoding::Decoder<'_, D>,
7864            offset: usize,
7865            _depth: fidl::encoding::Depth,
7866        ) -> fidl::Result<()> {
7867            decoder.debug_check_bounds::<Self>(offset);
7868            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7869            // Verify that padding bytes are zero.
7870            let ptr = unsafe { buf_ptr.offset(0) };
7871            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7872            let mask = 0xffffffff00000000u64;
7873            let maskedval = padval & mask;
7874            if maskedval != 0 {
7875                return Err(fidl::Error::NonZeroPadding {
7876                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7877                });
7878            }
7879            // Copy from the buffer into the object.
7880            unsafe {
7881                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
7882            }
7883            Ok(())
7884        }
7885    }
7886
7887    impl fidl::encoding::ValueTypeMarker for SnapshotItemResult {
7888        type Borrowed<'a> = &'a Self;
7889        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7890            value
7891        }
7892    }
7893
7894    unsafe impl fidl::encoding::TypeMarker for SnapshotItemResult {
7895        type Owned = Self;
7896
7897        #[inline(always)]
7898        fn inline_align(_context: fidl::encoding::Context) -> usize {
7899            8
7900        }
7901
7902        #[inline(always)]
7903        fn inline_size(_context: fidl::encoding::Context) -> usize {
7904            40
7905        }
7906    }
7907
7908    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SnapshotItemResult, D>
7909        for &SnapshotItemResult
7910    {
7911        #[inline]
7912        unsafe fn encode(
7913            self,
7914            encoder: &mut fidl::encoding::Encoder<'_, D>,
7915            offset: usize,
7916            _depth: fidl::encoding::Depth,
7917        ) -> fidl::Result<()> {
7918            encoder.debug_check_bounds::<SnapshotItemResult>(offset);
7919            // Delegate to tuple encoding.
7920            fidl::encoding::Encode::<SnapshotItemResult, D>::encode(
7921                (
7922                    <SnapshotItem as fidl::encoding::ValueTypeMarker>::borrow(&self.item),
7923                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.ok),
7924                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
7925                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
7926                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
7927                ),
7928                encoder,
7929                offset,
7930                _depth,
7931            )
7932        }
7933    }
7934    unsafe impl<
7935        D: fidl::encoding::ResourceDialect,
7936        T0: fidl::encoding::Encode<SnapshotItem, D>,
7937        T1: fidl::encoding::Encode<bool, D>,
7938        T2: fidl::encoding::Encode<u32, D>,
7939        T3: fidl::encoding::Encode<u64, D>,
7940        T4: fidl::encoding::Encode<i64, D>,
7941    > fidl::encoding::Encode<SnapshotItemResult, D> for (T0, T1, T2, T3, T4)
7942    {
7943        #[inline]
7944        unsafe fn encode(
7945            self,
7946            encoder: &mut fidl::encoding::Encoder<'_, D>,
7947            offset: usize,
7948            depth: fidl::encoding::Depth,
7949        ) -> fidl::Result<()> {
7950            encoder.debug_check_bounds::<SnapshotItemResult>(offset);
7951            // Zero out padding regions. There's no need to apply masks
7952            // because the unmasked parts will be overwritten by fields.
7953            unsafe {
7954                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7955                (ptr as *mut u64).write_unaligned(0);
7956            }
7957            // Write the fields.
7958            self.0.encode(encoder, offset + 0, depth)?;
7959            self.1.encode(encoder, offset + 16, depth)?;
7960            self.2.encode(encoder, offset + 20, depth)?;
7961            self.3.encode(encoder, offset + 24, depth)?;
7962            self.4.encode(encoder, offset + 32, depth)?;
7963            Ok(())
7964        }
7965    }
7966
7967    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SnapshotItemResult {
7968        #[inline(always)]
7969        fn new_empty() -> Self {
7970            Self {
7971                item: fidl::new_empty!(SnapshotItem, D),
7972                ok: fidl::new_empty!(bool, D),
7973                value: fidl::new_empty!(u32, D),
7974                audit_seq: fidl::new_empty!(u64, D),
7975                timestamp_ns: fidl::new_empty!(i64, D),
7976            }
7977        }
7978
7979        #[inline]
7980        unsafe fn decode(
7981            &mut self,
7982            decoder: &mut fidl::encoding::Decoder<'_, D>,
7983            offset: usize,
7984            _depth: fidl::encoding::Depth,
7985        ) -> fidl::Result<()> {
7986            decoder.debug_check_bounds::<Self>(offset);
7987            // Verify that padding bytes are zero.
7988            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7989            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7990            let mask = 0xffffff00u64;
7991            let maskedval = padval & mask;
7992            if maskedval != 0 {
7993                return Err(fidl::Error::NonZeroPadding {
7994                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7995                });
7996            }
7997            fidl::decode!(SnapshotItem, D, &mut self.item, decoder, offset + 0, _depth)?;
7998            fidl::decode!(bool, D, &mut self.ok, decoder, offset + 16, _depth)?;
7999            fidl::decode!(u32, D, &mut self.value, decoder, offset + 20, _depth)?;
8000            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 24, _depth)?;
8001            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 32, _depth)?;
8002            Ok(())
8003        }
8004    }
8005
8006    impl fidl::encoding::ValueTypeMarker for SnapshotResult {
8007        type Borrowed<'a> = &'a Self;
8008        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8009            value
8010        }
8011    }
8012
8013    unsafe impl fidl::encoding::TypeMarker for SnapshotResult {
8014        type Owned = Self;
8015
8016        #[inline(always)]
8017        fn inline_align(_context: fidl::encoding::Context) -> usize {
8018            8
8019        }
8020
8021        #[inline(always)]
8022        fn inline_size(_context: fidl::encoding::Context) -> usize {
8023            24
8024        }
8025    }
8026
8027    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SnapshotResult, D>
8028        for &SnapshotResult
8029    {
8030        #[inline]
8031        unsafe fn encode(
8032            self,
8033            encoder: &mut fidl::encoding::Encoder<'_, D>,
8034            offset: usize,
8035            _depth: fidl::encoding::Depth,
8036        ) -> fidl::Result<()> {
8037            encoder.debug_check_bounds::<SnapshotResult>(offset);
8038            // Delegate to tuple encoding.
8039            fidl::encoding::Encode::<SnapshotResult, D>::encode(
8040                (
8041                    <fidl::encoding::Vector<SnapshotItemResult, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.results),
8042                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.complete),
8043                ),
8044                encoder, offset, _depth
8045            )
8046        }
8047    }
8048    unsafe impl<
8049        D: fidl::encoding::ResourceDialect,
8050        T0: fidl::encoding::Encode<fidl::encoding::Vector<SnapshotItemResult, 64>, D>,
8051        T1: fidl::encoding::Encode<bool, D>,
8052    > fidl::encoding::Encode<SnapshotResult, D> for (T0, T1)
8053    {
8054        #[inline]
8055        unsafe fn encode(
8056            self,
8057            encoder: &mut fidl::encoding::Encoder<'_, D>,
8058            offset: usize,
8059            depth: fidl::encoding::Depth,
8060        ) -> fidl::Result<()> {
8061            encoder.debug_check_bounds::<SnapshotResult>(offset);
8062            // Zero out padding regions. There's no need to apply masks
8063            // because the unmasked parts will be overwritten by fields.
8064            unsafe {
8065                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8066                (ptr as *mut u64).write_unaligned(0);
8067            }
8068            // Write the fields.
8069            self.0.encode(encoder, offset + 0, depth)?;
8070            self.1.encode(encoder, offset + 16, depth)?;
8071            Ok(())
8072        }
8073    }
8074
8075    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SnapshotResult {
8076        #[inline(always)]
8077        fn new_empty() -> Self {
8078            Self {
8079                results: fidl::new_empty!(fidl::encoding::Vector<SnapshotItemResult, 64>, D),
8080                complete: fidl::new_empty!(bool, D),
8081            }
8082        }
8083
8084        #[inline]
8085        unsafe fn decode(
8086            &mut self,
8087            decoder: &mut fidl::encoding::Decoder<'_, D>,
8088            offset: usize,
8089            _depth: fidl::encoding::Depth,
8090        ) -> fidl::Result<()> {
8091            decoder.debug_check_bounds::<Self>(offset);
8092            // Verify that padding bytes are zero.
8093            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8094            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8095            let mask = 0xffffffffffffff00u64;
8096            let maskedval = padval & mask;
8097            if maskedval != 0 {
8098                return Err(fidl::Error::NonZeroPadding {
8099                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8100                });
8101            }
8102            fidl::decode!(fidl::encoding::Vector<SnapshotItemResult, 64>, D, &mut self.results, decoder, offset + 0, _depth)?;
8103            fidl::decode!(bool, D, &mut self.complete, decoder, offset + 16, _depth)?;
8104            Ok(())
8105        }
8106    }
8107
8108    impl fidl::encoding::ValueTypeMarker for SpiEndpointTransmitRequest {
8109        type Borrowed<'a> = &'a Self;
8110        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8111            value
8112        }
8113    }
8114
8115    unsafe impl fidl::encoding::TypeMarker for SpiEndpointTransmitRequest {
8116        type Owned = Self;
8117
8118        #[inline(always)]
8119        fn inline_align(_context: fidl::encoding::Context) -> usize {
8120            8
8121        }
8122
8123        #[inline(always)]
8124        fn inline_size(_context: fidl::encoding::Context) -> usize {
8125            16
8126        }
8127    }
8128
8129    unsafe impl<D: fidl::encoding::ResourceDialect>
8130        fidl::encoding::Encode<SpiEndpointTransmitRequest, D> for &SpiEndpointTransmitRequest
8131    {
8132        #[inline]
8133        unsafe fn encode(
8134            self,
8135            encoder: &mut fidl::encoding::Encoder<'_, D>,
8136            offset: usize,
8137            _depth: fidl::encoding::Depth,
8138        ) -> fidl::Result<()> {
8139            encoder.debug_check_bounds::<SpiEndpointTransmitRequest>(offset);
8140            // Delegate to tuple encoding.
8141            fidl::encoding::Encode::<SpiEndpointTransmitRequest, D>::encode(
8142                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
8143                    &self.tx_data,
8144                ),),
8145                encoder,
8146                offset,
8147                _depth,
8148            )
8149        }
8150    }
8151    unsafe impl<
8152        D: fidl::encoding::ResourceDialect,
8153        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
8154    > fidl::encoding::Encode<SpiEndpointTransmitRequest, D> for (T0,)
8155    {
8156        #[inline]
8157        unsafe fn encode(
8158            self,
8159            encoder: &mut fidl::encoding::Encoder<'_, D>,
8160            offset: usize,
8161            depth: fidl::encoding::Depth,
8162        ) -> fidl::Result<()> {
8163            encoder.debug_check_bounds::<SpiEndpointTransmitRequest>(offset);
8164            // Zero out padding regions. There's no need to apply masks
8165            // because the unmasked parts will be overwritten by fields.
8166            // Write the fields.
8167            self.0.encode(encoder, offset + 0, depth)?;
8168            Ok(())
8169        }
8170    }
8171
8172    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8173        for SpiEndpointTransmitRequest
8174    {
8175        #[inline(always)]
8176        fn new_empty() -> Self {
8177            Self { tx_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
8178        }
8179
8180        #[inline]
8181        unsafe fn decode(
8182            &mut self,
8183            decoder: &mut fidl::encoding::Decoder<'_, D>,
8184            offset: usize,
8185            _depth: fidl::encoding::Depth,
8186        ) -> fidl::Result<()> {
8187            decoder.debug_check_bounds::<Self>(offset);
8188            // Verify that padding bytes are zero.
8189            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.tx_data, decoder, offset + 0, _depth)?;
8190            Ok(())
8191        }
8192    }
8193
8194    impl fidl::encoding::ValueTypeMarker for SpiTransmit {
8195        type Borrowed<'a> = &'a Self;
8196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8197            value
8198        }
8199    }
8200
8201    unsafe impl fidl::encoding::TypeMarker for SpiTransmit {
8202        type Owned = Self;
8203
8204        #[inline(always)]
8205        fn inline_align(_context: fidl::encoding::Context) -> usize {
8206            8
8207        }
8208
8209        #[inline(always)]
8210        fn inline_size(_context: fidl::encoding::Context) -> usize {
8211            24
8212        }
8213    }
8214
8215    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SpiTransmit, D>
8216        for &SpiTransmit
8217    {
8218        #[inline]
8219        unsafe fn encode(
8220            self,
8221            encoder: &mut fidl::encoding::Encoder<'_, D>,
8222            offset: usize,
8223            _depth: fidl::encoding::Depth,
8224        ) -> fidl::Result<()> {
8225            encoder.debug_check_bounds::<SpiTransmit>(offset);
8226            // Delegate to tuple encoding.
8227            fidl::encoding::Encode::<SpiTransmit, D>::encode(
8228                (
8229                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
8230                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
8231                        &self.tx_data,
8232                    ),
8233                ),
8234                encoder,
8235                offset,
8236                _depth,
8237            )
8238        }
8239    }
8240    unsafe impl<
8241        D: fidl::encoding::ResourceDialect,
8242        T0: fidl::encoding::Encode<u32, D>,
8243        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
8244    > fidl::encoding::Encode<SpiTransmit, D> for (T0, T1)
8245    {
8246        #[inline]
8247        unsafe fn encode(
8248            self,
8249            encoder: &mut fidl::encoding::Encoder<'_, D>,
8250            offset: usize,
8251            depth: fidl::encoding::Depth,
8252        ) -> fidl::Result<()> {
8253            encoder.debug_check_bounds::<SpiTransmit>(offset);
8254            // Zero out padding regions. There's no need to apply masks
8255            // because the unmasked parts will be overwritten by fields.
8256            unsafe {
8257                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8258                (ptr as *mut u64).write_unaligned(0);
8259            }
8260            // Write the fields.
8261            self.0.encode(encoder, offset + 0, depth)?;
8262            self.1.encode(encoder, offset + 8, depth)?;
8263            Ok(())
8264        }
8265    }
8266
8267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SpiTransmit {
8268        #[inline(always)]
8269        fn new_empty() -> Self {
8270            Self {
8271                resource: fidl::new_empty!(u32, D),
8272                tx_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
8273            }
8274        }
8275
8276        #[inline]
8277        unsafe fn decode(
8278            &mut self,
8279            decoder: &mut fidl::encoding::Decoder<'_, D>,
8280            offset: usize,
8281            _depth: fidl::encoding::Depth,
8282        ) -> fidl::Result<()> {
8283            decoder.debug_check_bounds::<Self>(offset);
8284            // Verify that padding bytes are zero.
8285            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8286            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8287            let mask = 0xffffffff00000000u64;
8288            let maskedval = padval & mask;
8289            if maskedval != 0 {
8290                return Err(fidl::Error::NonZeroPadding {
8291                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8292                });
8293            }
8294            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
8295            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.tx_data, decoder, offset + 8, _depth)?;
8296            Ok(())
8297        }
8298    }
8299
8300    impl fidl::encoding::ValueTypeMarker for SpiTransmitResult {
8301        type Borrowed<'a> = &'a Self;
8302        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8303            value
8304        }
8305    }
8306
8307    unsafe impl fidl::encoding::TypeMarker for SpiTransmitResult {
8308        type Owned = Self;
8309
8310        #[inline(always)]
8311        fn inline_align(_context: fidl::encoding::Context) -> usize {
8312            8
8313        }
8314
8315        #[inline(always)]
8316        fn inline_size(_context: fidl::encoding::Context) -> usize {
8317            32
8318        }
8319    }
8320
8321    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SpiTransmitResult, D>
8322        for &SpiTransmitResult
8323    {
8324        #[inline]
8325        unsafe fn encode(
8326            self,
8327            encoder: &mut fidl::encoding::Encoder<'_, D>,
8328            offset: usize,
8329            _depth: fidl::encoding::Depth,
8330        ) -> fidl::Result<()> {
8331            encoder.debug_check_bounds::<SpiTransmitResult>(offset);
8332            // Delegate to tuple encoding.
8333            fidl::encoding::Encode::<SpiTransmitResult, D>::encode(
8334                (
8335                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
8336                        &self.rx_data,
8337                    ),
8338                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.audit_seq),
8339                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp_ns),
8340                ),
8341                encoder,
8342                offset,
8343                _depth,
8344            )
8345        }
8346    }
8347    unsafe impl<
8348        D: fidl::encoding::ResourceDialect,
8349        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
8350        T1: fidl::encoding::Encode<u64, D>,
8351        T2: fidl::encoding::Encode<i64, D>,
8352    > fidl::encoding::Encode<SpiTransmitResult, D> for (T0, T1, T2)
8353    {
8354        #[inline]
8355        unsafe fn encode(
8356            self,
8357            encoder: &mut fidl::encoding::Encoder<'_, D>,
8358            offset: usize,
8359            depth: fidl::encoding::Depth,
8360        ) -> fidl::Result<()> {
8361            encoder.debug_check_bounds::<SpiTransmitResult>(offset);
8362            // Zero out padding regions. There's no need to apply masks
8363            // because the unmasked parts will be overwritten by fields.
8364            // Write the fields.
8365            self.0.encode(encoder, offset + 0, depth)?;
8366            self.1.encode(encoder, offset + 16, depth)?;
8367            self.2.encode(encoder, offset + 24, depth)?;
8368            Ok(())
8369        }
8370    }
8371
8372    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SpiTransmitResult {
8373        #[inline(always)]
8374        fn new_empty() -> Self {
8375            Self {
8376                rx_data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
8377                audit_seq: fidl::new_empty!(u64, D),
8378                timestamp_ns: fidl::new_empty!(i64, D),
8379            }
8380        }
8381
8382        #[inline]
8383        unsafe fn decode(
8384            &mut self,
8385            decoder: &mut fidl::encoding::Decoder<'_, D>,
8386            offset: usize,
8387            _depth: fidl::encoding::Depth,
8388        ) -> fidl::Result<()> {
8389            decoder.debug_check_bounds::<Self>(offset);
8390            // Verify that padding bytes are zero.
8391            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.rx_data, decoder, offset + 0, _depth)?;
8392            fidl::decode!(u64, D, &mut self.audit_seq, decoder, offset + 16, _depth)?;
8393            fidl::decode!(i64, D, &mut self.timestamp_ns, decoder, offset + 24, _depth)?;
8394            Ok(())
8395        }
8396    }
8397
8398    impl fidl::encoding::ValueTypeMarker for Write32 {
8399        type Borrowed<'a> = &'a Self;
8400        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8401            value
8402        }
8403    }
8404
8405    unsafe impl fidl::encoding::TypeMarker for Write32 {
8406        type Owned = Self;
8407
8408        #[inline(always)]
8409        fn inline_align(_context: fidl::encoding::Context) -> usize {
8410            8
8411        }
8412
8413        #[inline(always)]
8414        fn inline_size(_context: fidl::encoding::Context) -> usize {
8415            40
8416        }
8417    }
8418
8419    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Write32, D> for &Write32 {
8420        #[inline]
8421        unsafe fn encode(
8422            self,
8423            encoder: &mut fidl::encoding::Encoder<'_, D>,
8424            offset: usize,
8425            _depth: fidl::encoding::Depth,
8426        ) -> fidl::Result<()> {
8427            encoder.debug_check_bounds::<Write32>(offset);
8428            // Delegate to tuple encoding.
8429            fidl::encoding::Encode::<Write32, D>::encode(
8430                (
8431                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.resource),
8432                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
8433                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
8434                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.write_mask),
8435                    <fidl::encoding::Boxed<WritePrecondition> as fidl::encoding::ValueTypeMarker>::borrow(&self.precondition),
8436                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.readback),
8437                ),
8438                encoder, offset, _depth
8439            )
8440        }
8441    }
8442    unsafe impl<
8443        D: fidl::encoding::ResourceDialect,
8444        T0: fidl::encoding::Encode<u32, D>,
8445        T1: fidl::encoding::Encode<u64, D>,
8446        T2: fidl::encoding::Encode<u32, D>,
8447        T3: fidl::encoding::Encode<u32, D>,
8448        T4: fidl::encoding::Encode<fidl::encoding::Boxed<WritePrecondition>, D>,
8449        T5: fidl::encoding::Encode<bool, D>,
8450    > fidl::encoding::Encode<Write32, D> for (T0, T1, T2, T3, T4, T5)
8451    {
8452        #[inline]
8453        unsafe fn encode(
8454            self,
8455            encoder: &mut fidl::encoding::Encoder<'_, D>,
8456            offset: usize,
8457            depth: fidl::encoding::Depth,
8458        ) -> fidl::Result<()> {
8459            encoder.debug_check_bounds::<Write32>(offset);
8460            // Zero out padding regions. There's no need to apply masks
8461            // because the unmasked parts will be overwritten by fields.
8462            unsafe {
8463                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8464                (ptr as *mut u64).write_unaligned(0);
8465            }
8466            unsafe {
8467                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8468                (ptr as *mut u64).write_unaligned(0);
8469            }
8470            // Write the fields.
8471            self.0.encode(encoder, offset + 0, depth)?;
8472            self.1.encode(encoder, offset + 8, depth)?;
8473            self.2.encode(encoder, offset + 16, depth)?;
8474            self.3.encode(encoder, offset + 20, depth)?;
8475            self.4.encode(encoder, offset + 24, depth)?;
8476            self.5.encode(encoder, offset + 32, depth)?;
8477            Ok(())
8478        }
8479    }
8480
8481    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Write32 {
8482        #[inline(always)]
8483        fn new_empty() -> Self {
8484            Self {
8485                resource: fidl::new_empty!(u32, D),
8486                offset: fidl::new_empty!(u64, D),
8487                value: fidl::new_empty!(u32, D),
8488                write_mask: fidl::new_empty!(u32, D),
8489                precondition: fidl::new_empty!(fidl::encoding::Boxed<WritePrecondition>, D),
8490                readback: fidl::new_empty!(bool, D),
8491            }
8492        }
8493
8494        #[inline]
8495        unsafe fn decode(
8496            &mut self,
8497            decoder: &mut fidl::encoding::Decoder<'_, D>,
8498            offset: usize,
8499            _depth: fidl::encoding::Depth,
8500        ) -> fidl::Result<()> {
8501            decoder.debug_check_bounds::<Self>(offset);
8502            // Verify that padding bytes are zero.
8503            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
8504            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8505            let mask = 0xffffffff00000000u64;
8506            let maskedval = padval & mask;
8507            if maskedval != 0 {
8508                return Err(fidl::Error::NonZeroPadding {
8509                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8510                });
8511            }
8512            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8513            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8514            let mask = 0xffffffffffffff00u64;
8515            let maskedval = padval & mask;
8516            if maskedval != 0 {
8517                return Err(fidl::Error::NonZeroPadding {
8518                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8519                });
8520            }
8521            fidl::decode!(u32, D, &mut self.resource, decoder, offset + 0, _depth)?;
8522            fidl::decode!(u64, D, &mut self.offset, decoder, offset + 8, _depth)?;
8523            fidl::decode!(u32, D, &mut self.value, decoder, offset + 16, _depth)?;
8524            fidl::decode!(u32, D, &mut self.write_mask, decoder, offset + 20, _depth)?;
8525            fidl::decode!(
8526                fidl::encoding::Boxed<WritePrecondition>,
8527                D,
8528                &mut self.precondition,
8529                decoder,
8530                offset + 24,
8531                _depth
8532            )?;
8533            fidl::decode!(bool, D, &mut self.readback, decoder, offset + 32, _depth)?;
8534            Ok(())
8535        }
8536    }
8537
8538    impl fidl::encoding::ValueTypeMarker for WritePrecondition {
8539        type Borrowed<'a> = &'a Self;
8540        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8541            value
8542        }
8543    }
8544
8545    unsafe impl fidl::encoding::TypeMarker for WritePrecondition {
8546        type Owned = Self;
8547
8548        #[inline(always)]
8549        fn inline_align(_context: fidl::encoding::Context) -> usize {
8550            4
8551        }
8552
8553        #[inline(always)]
8554        fn inline_size(_context: fidl::encoding::Context) -> usize {
8555            8
8556        }
8557        #[inline(always)]
8558        fn encode_is_copy() -> bool {
8559            true
8560        }
8561
8562        #[inline(always)]
8563        fn decode_is_copy() -> bool {
8564            true
8565        }
8566    }
8567
8568    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritePrecondition, D>
8569        for &WritePrecondition
8570    {
8571        #[inline]
8572        unsafe fn encode(
8573            self,
8574            encoder: &mut fidl::encoding::Encoder<'_, D>,
8575            offset: usize,
8576            _depth: fidl::encoding::Depth,
8577        ) -> fidl::Result<()> {
8578            encoder.debug_check_bounds::<WritePrecondition>(offset);
8579            unsafe {
8580                // Copy the object into the buffer.
8581                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8582                (buf_ptr as *mut WritePrecondition)
8583                    .write_unaligned((self as *const WritePrecondition).read());
8584                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8585                // done second because the memcpy will write garbage to these bytes.
8586            }
8587            Ok(())
8588        }
8589    }
8590    unsafe impl<
8591        D: fidl::encoding::ResourceDialect,
8592        T0: fidl::encoding::Encode<u32, D>,
8593        T1: fidl::encoding::Encode<u32, D>,
8594    > fidl::encoding::Encode<WritePrecondition, D> for (T0, T1)
8595    {
8596        #[inline]
8597        unsafe fn encode(
8598            self,
8599            encoder: &mut fidl::encoding::Encoder<'_, D>,
8600            offset: usize,
8601            depth: fidl::encoding::Depth,
8602        ) -> fidl::Result<()> {
8603            encoder.debug_check_bounds::<WritePrecondition>(offset);
8604            // Zero out padding regions. There's no need to apply masks
8605            // because the unmasked parts will be overwritten by fields.
8606            // Write the fields.
8607            self.0.encode(encoder, offset + 0, depth)?;
8608            self.1.encode(encoder, offset + 4, depth)?;
8609            Ok(())
8610        }
8611    }
8612
8613    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritePrecondition {
8614        #[inline(always)]
8615        fn new_empty() -> Self {
8616            Self { expected: fidl::new_empty!(u32, D), mask: fidl::new_empty!(u32, D) }
8617        }
8618
8619        #[inline]
8620        unsafe fn decode(
8621            &mut self,
8622            decoder: &mut fidl::encoding::Decoder<'_, D>,
8623            offset: usize,
8624            _depth: fidl::encoding::Depth,
8625        ) -> fidl::Result<()> {
8626            decoder.debug_check_bounds::<Self>(offset);
8627            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8628            // Verify that padding bytes are zero.
8629            // Copy from the buffer into the object.
8630            unsafe {
8631                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8632            }
8633            Ok(())
8634        }
8635    }
8636
8637    impl fidl::encoding::ValueTypeMarker for WriteResult {
8638        type Borrowed<'a> = &'a Self;
8639        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8640            value
8641        }
8642    }
8643
8644    unsafe impl fidl::encoding::TypeMarker for WriteResult {
8645        type Owned = Self;
8646
8647        #[inline(always)]
8648        fn inline_align(_context: fidl::encoding::Context) -> usize {
8649            8
8650        }
8651
8652        #[inline(always)]
8653        fn inline_size(_context: fidl::encoding::Context) -> usize {
8654            24
8655        }
8656    }
8657
8658    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteResult, D>
8659        for &WriteResult
8660    {
8661        #[inline]
8662        unsafe fn encode(
8663            self,
8664            encoder: &mut fidl::encoding::Encoder<'_, D>,
8665            offset: usize,
8666            _depth: fidl::encoding::Depth,
8667        ) -> fidl::Result<()> {
8668            encoder.debug_check_bounds::<WriteResult>(offset);
8669            unsafe {
8670                // Copy the object into the buffer.
8671                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8672                (buf_ptr as *mut WriteResult).write_unaligned((self as *const WriteResult).read());
8673                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8674                // done second because the memcpy will write garbage to these bytes.
8675                let padding_ptr = buf_ptr.offset(0) as *mut u64;
8676                let padding_mask = 0xffffffff00000000u64;
8677                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
8678            }
8679            Ok(())
8680        }
8681    }
8682    unsafe impl<
8683        D: fidl::encoding::ResourceDialect,
8684        T0: fidl::encoding::Encode<u32, D>,
8685        T1: fidl::encoding::Encode<u64, D>,
8686        T2: fidl::encoding::Encode<i64, D>,
8687    > fidl::encoding::Encode<WriteResult, D> for (T0, T1, T2)
8688    {
8689        #[inline]
8690        unsafe fn encode(
8691            self,
8692            encoder: &mut fidl::encoding::Encoder<'_, D>,
8693            offset: usize,
8694            depth: fidl::encoding::Depth,
8695        ) -> fidl::Result<()> {
8696            encoder.debug_check_bounds::<WriteResult>(offset);
8697            // Zero out padding regions. There's no need to apply masks
8698            // because the unmasked parts will be overwritten by fields.
8699            unsafe {
8700                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
8701                (ptr as *mut u64).write_unaligned(0);
8702            }
8703            // Write the fields.
8704            self.0.encode(encoder, offset + 0, depth)?;
8705            self.1.encode(encoder, offset + 8, depth)?;
8706            self.2.encode(encoder, offset + 16, depth)?;
8707            Ok(())
8708        }
8709    }
8710
8711    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteResult {
8712        #[inline(always)]
8713        fn new_empty() -> Self {
8714            Self {
8715                readback_value: fidl::new_empty!(u32, D),
8716                audit_seq: fidl::new_empty!(u64, D),
8717                timestamp_ns: fidl::new_empty!(i64, D),
8718            }
8719        }
8720
8721        #[inline]
8722        unsafe fn decode(
8723            &mut self,
8724            decoder: &mut fidl::encoding::Decoder<'_, D>,
8725            offset: usize,
8726            _depth: fidl::encoding::Depth,
8727        ) -> fidl::Result<()> {
8728            decoder.debug_check_bounds::<Self>(offset);
8729            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8730            // Verify that padding bytes are zero.
8731            let ptr = unsafe { buf_ptr.offset(0) };
8732            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8733            let mask = 0xffffffff00000000u64;
8734            let maskedval = padval & mask;
8735            if maskedval != 0 {
8736                return Err(fidl::Error::NonZeroPadding {
8737                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
8738                });
8739            }
8740            // Copy from the buffer into the object.
8741            unsafe {
8742                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
8743            }
8744            Ok(())
8745        }
8746    }
8747
8748    impl AuditEntry {
8749        #[inline(always)]
8750        fn max_ordinal_present(&self) -> u64 {
8751            if let Some(_) = self.boot_id {
8752                return 14;
8753            }
8754            if let Some(_) = self.proxy_generation {
8755                return 13;
8756            }
8757            if let Some(_) = self.item_index {
8758                return 12;
8759            }
8760            if let Some(_) = self.run_id {
8761                return 11;
8762            }
8763            if let Some(_) = self.timestamp_ns {
8764                return 10;
8765            }
8766            if let Some(_) = self.value {
8767                return 9;
8768            }
8769            if let Some(_) = self.status {
8770                return 8;
8771            }
8772            if let Some(_) = self.denial {
8773                return 7;
8774            }
8775            if let Some(_) = self.decision {
8776                return 6;
8777            }
8778            if let Some(_) = self.offset {
8779                return 5;
8780            }
8781            if let Some(_) = self.operation {
8782                return 4;
8783            }
8784            if let Some(_) = self.resource {
8785                return 3;
8786            }
8787            if let Some(_) = self.session {
8788                return 2;
8789            }
8790            if let Some(_) = self.seq {
8791                return 1;
8792            }
8793            0
8794        }
8795    }
8796
8797    impl fidl::encoding::ValueTypeMarker for AuditEntry {
8798        type Borrowed<'a> = &'a Self;
8799        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8800            value
8801        }
8802    }
8803
8804    unsafe impl fidl::encoding::TypeMarker for AuditEntry {
8805        type Owned = Self;
8806
8807        #[inline(always)]
8808        fn inline_align(_context: fidl::encoding::Context) -> usize {
8809            8
8810        }
8811
8812        #[inline(always)]
8813        fn inline_size(_context: fidl::encoding::Context) -> usize {
8814            16
8815        }
8816    }
8817
8818    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AuditEntry, D>
8819        for &AuditEntry
8820    {
8821        unsafe fn encode(
8822            self,
8823            encoder: &mut fidl::encoding::Encoder<'_, D>,
8824            offset: usize,
8825            mut depth: fidl::encoding::Depth,
8826        ) -> fidl::Result<()> {
8827            encoder.debug_check_bounds::<AuditEntry>(offset);
8828            // Vector header
8829            let max_ordinal: u64 = self.max_ordinal_present();
8830            encoder.write_num(max_ordinal, offset);
8831            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8832            // Calling encoder.out_of_line_offset(0) is not allowed.
8833            if max_ordinal == 0 {
8834                return Ok(());
8835            }
8836            depth.increment()?;
8837            let envelope_size = 8;
8838            let bytes_len = max_ordinal as usize * envelope_size;
8839            #[allow(unused_variables)]
8840            let offset = encoder.out_of_line_offset(bytes_len);
8841            let mut _prev_end_offset: usize = 0;
8842            if 1 > max_ordinal {
8843                return Ok(());
8844            }
8845
8846            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8847            // are envelope_size bytes.
8848            let cur_offset: usize = (1 - 1) * envelope_size;
8849
8850            // Zero reserved fields.
8851            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8852
8853            // Safety:
8854            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8855            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8856            //   envelope_size bytes, there is always sufficient room.
8857            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8858                self.seq.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8859                encoder,
8860                offset + cur_offset,
8861                depth,
8862            )?;
8863
8864            _prev_end_offset = cur_offset + envelope_size;
8865            if 2 > max_ordinal {
8866                return Ok(());
8867            }
8868
8869            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8870            // are envelope_size bytes.
8871            let cur_offset: usize = (2 - 1) * envelope_size;
8872
8873            // Zero reserved fields.
8874            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8875
8876            // Safety:
8877            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8878            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8879            //   envelope_size bytes, there is always sufficient room.
8880            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8881                self.session.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8882                encoder,
8883                offset + cur_offset,
8884                depth,
8885            )?;
8886
8887            _prev_end_offset = cur_offset + envelope_size;
8888            if 3 > max_ordinal {
8889                return Ok(());
8890            }
8891
8892            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8893            // are envelope_size bytes.
8894            let cur_offset: usize = (3 - 1) * envelope_size;
8895
8896            // Zero reserved fields.
8897            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8898
8899            // Safety:
8900            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8901            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8902            //   envelope_size bytes, there is always sufficient room.
8903            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8904                self.resource.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8905                encoder,
8906                offset + cur_offset,
8907                depth,
8908            )?;
8909
8910            _prev_end_offset = cur_offset + envelope_size;
8911            if 4 > max_ordinal {
8912                return Ok(());
8913            }
8914
8915            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8916            // are envelope_size bytes.
8917            let cur_offset: usize = (4 - 1) * envelope_size;
8918
8919            // Zero reserved fields.
8920            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8921
8922            // Safety:
8923            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8924            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8925            //   envelope_size bytes, there is always sufficient room.
8926            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
8927                self.operation.as_ref().map(
8928                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
8929                ),
8930                encoder,
8931                offset + cur_offset,
8932                depth,
8933            )?;
8934
8935            _prev_end_offset = cur_offset + envelope_size;
8936            if 5 > max_ordinal {
8937                return Ok(());
8938            }
8939
8940            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8941            // are envelope_size bytes.
8942            let cur_offset: usize = (5 - 1) * envelope_size;
8943
8944            // Zero reserved fields.
8945            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8946
8947            // Safety:
8948            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8949            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8950            //   envelope_size bytes, there is always sufficient room.
8951            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8952                self.offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8953                encoder,
8954                offset + cur_offset,
8955                depth,
8956            )?;
8957
8958            _prev_end_offset = cur_offset + envelope_size;
8959            if 6 > max_ordinal {
8960                return Ok(());
8961            }
8962
8963            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8964            // are envelope_size bytes.
8965            let cur_offset: usize = (6 - 1) * envelope_size;
8966
8967            // Zero reserved fields.
8968            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8969
8970            // Safety:
8971            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8972            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8973            //   envelope_size bytes, there is always sufficient room.
8974            fidl::encoding::encode_in_envelope_optional::<AuditDecision, D>(
8975                self.decision
8976                    .as_ref()
8977                    .map(<AuditDecision as fidl::encoding::ValueTypeMarker>::borrow),
8978                encoder,
8979                offset + cur_offset,
8980                depth,
8981            )?;
8982
8983            _prev_end_offset = cur_offset + envelope_size;
8984            if 7 > max_ordinal {
8985                return Ok(());
8986            }
8987
8988            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8989            // are envelope_size bytes.
8990            let cur_offset: usize = (7 - 1) * envelope_size;
8991
8992            // Zero reserved fields.
8993            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8994
8995            // Safety:
8996            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8997            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8998            //   envelope_size bytes, there is always sufficient room.
8999            fidl::encoding::encode_in_envelope_optional::<OperationError, D>(
9000                self.denial
9001                    .as_ref()
9002                    .map(<OperationError as fidl::encoding::ValueTypeMarker>::borrow),
9003                encoder,
9004                offset + cur_offset,
9005                depth,
9006            )?;
9007
9008            _prev_end_offset = cur_offset + envelope_size;
9009            if 8 > max_ordinal {
9010                return Ok(());
9011            }
9012
9013            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9014            // are envelope_size bytes.
9015            let cur_offset: usize = (8 - 1) * envelope_size;
9016
9017            // Zero reserved fields.
9018            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9019
9020            // Safety:
9021            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9022            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9023            //   envelope_size bytes, there is always sufficient room.
9024            fidl::encoding::encode_in_envelope_optional::<AuditStatus, D>(
9025                self.status.as_ref().map(<AuditStatus as fidl::encoding::ValueTypeMarker>::borrow),
9026                encoder,
9027                offset + cur_offset,
9028                depth,
9029            )?;
9030
9031            _prev_end_offset = cur_offset + envelope_size;
9032            if 9 > max_ordinal {
9033                return Ok(());
9034            }
9035
9036            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9037            // are envelope_size bytes.
9038            let cur_offset: usize = (9 - 1) * envelope_size;
9039
9040            // Zero reserved fields.
9041            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9042
9043            // Safety:
9044            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9045            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9046            //   envelope_size bytes, there is always sufficient room.
9047            fidl::encoding::encode_in_envelope_optional::<u32, D>(
9048                self.value.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9049                encoder,
9050                offset + cur_offset,
9051                depth,
9052            )?;
9053
9054            _prev_end_offset = cur_offset + envelope_size;
9055            if 10 > max_ordinal {
9056                return Ok(());
9057            }
9058
9059            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9060            // are envelope_size bytes.
9061            let cur_offset: usize = (10 - 1) * envelope_size;
9062
9063            // Zero reserved fields.
9064            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9065
9066            // Safety:
9067            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9068            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9069            //   envelope_size bytes, there is always sufficient room.
9070            fidl::encoding::encode_in_envelope_optional::<i64, D>(
9071                self.timestamp_ns.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9072                encoder,
9073                offset + cur_offset,
9074                depth,
9075            )?;
9076
9077            _prev_end_offset = cur_offset + envelope_size;
9078            if 11 > max_ordinal {
9079                return Ok(());
9080            }
9081
9082            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9083            // are envelope_size bytes.
9084            let cur_offset: usize = (11 - 1) * envelope_size;
9085
9086            // Zero reserved fields.
9087            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9088
9089            // Safety:
9090            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9091            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9092            //   envelope_size bytes, there is always sufficient room.
9093            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
9094                self.run_id.as_ref().map(
9095                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
9096                ),
9097                encoder,
9098                offset + cur_offset,
9099                depth,
9100            )?;
9101
9102            _prev_end_offset = cur_offset + envelope_size;
9103            if 12 > max_ordinal {
9104                return Ok(());
9105            }
9106
9107            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9108            // are envelope_size bytes.
9109            let cur_offset: usize = (12 - 1) * envelope_size;
9110
9111            // Zero reserved fields.
9112            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9113
9114            // Safety:
9115            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9116            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9117            //   envelope_size bytes, there is always sufficient room.
9118            fidl::encoding::encode_in_envelope_optional::<u32, D>(
9119                self.item_index.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9120                encoder,
9121                offset + cur_offset,
9122                depth,
9123            )?;
9124
9125            _prev_end_offset = cur_offset + envelope_size;
9126            if 13 > max_ordinal {
9127                return Ok(());
9128            }
9129
9130            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9131            // are envelope_size bytes.
9132            let cur_offset: usize = (13 - 1) * envelope_size;
9133
9134            // Zero reserved fields.
9135            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9136
9137            // Safety:
9138            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9139            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9140            //   envelope_size bytes, there is always sufficient room.
9141            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9142                self.proxy_generation
9143                    .as_ref()
9144                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9145                encoder,
9146                offset + cur_offset,
9147                depth,
9148            )?;
9149
9150            _prev_end_offset = cur_offset + envelope_size;
9151            if 14 > max_ordinal {
9152                return Ok(());
9153            }
9154
9155            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9156            // are envelope_size bytes.
9157            let cur_offset: usize = (14 - 1) * envelope_size;
9158
9159            // Zero reserved fields.
9160            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9161
9162            // Safety:
9163            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9164            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9165            //   envelope_size bytes, there is always sufficient room.
9166            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
9167                self.boot_id.as_ref().map(
9168                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
9169                ),
9170                encoder,
9171                offset + cur_offset,
9172                depth,
9173            )?;
9174
9175            _prev_end_offset = cur_offset + envelope_size;
9176
9177            Ok(())
9178        }
9179    }
9180
9181    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AuditEntry {
9182        #[inline(always)]
9183        fn new_empty() -> Self {
9184            Self::default()
9185        }
9186
9187        unsafe fn decode(
9188            &mut self,
9189            decoder: &mut fidl::encoding::Decoder<'_, D>,
9190            offset: usize,
9191            mut depth: fidl::encoding::Depth,
9192        ) -> fidl::Result<()> {
9193            decoder.debug_check_bounds::<Self>(offset);
9194            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9195                None => return Err(fidl::Error::NotNullable),
9196                Some(len) => len,
9197            };
9198            // Calling decoder.out_of_line_offset(0) is not allowed.
9199            if len == 0 {
9200                return Ok(());
9201            };
9202            depth.increment()?;
9203            let envelope_size = 8;
9204            let bytes_len = len * envelope_size;
9205            let offset = decoder.out_of_line_offset(bytes_len)?;
9206            // Decode the envelope for each type.
9207            let mut _next_ordinal_to_read = 0;
9208            let mut next_offset = offset;
9209            let end_offset = offset + bytes_len;
9210            _next_ordinal_to_read += 1;
9211            if next_offset >= end_offset {
9212                return Ok(());
9213            }
9214
9215            // Decode unknown envelopes for gaps in ordinals.
9216            while _next_ordinal_to_read < 1 {
9217                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9218                _next_ordinal_to_read += 1;
9219                next_offset += envelope_size;
9220            }
9221
9222            let next_out_of_line = decoder.next_out_of_line();
9223            let handles_before = decoder.remaining_handles();
9224            if let Some((inlined, num_bytes, num_handles)) =
9225                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9226            {
9227                let member_inline_size =
9228                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9229                if inlined != (member_inline_size <= 4) {
9230                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9231                }
9232                let inner_offset;
9233                let mut inner_depth = depth.clone();
9234                if inlined {
9235                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9236                    inner_offset = next_offset;
9237                } else {
9238                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9239                    inner_depth.increment()?;
9240                }
9241                let val_ref = self.seq.get_or_insert_with(|| fidl::new_empty!(u64, D));
9242                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9243                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9244                {
9245                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9246                }
9247                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9248                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9249                }
9250            }
9251
9252            next_offset += envelope_size;
9253            _next_ordinal_to_read += 1;
9254            if next_offset >= end_offset {
9255                return Ok(());
9256            }
9257
9258            // Decode unknown envelopes for gaps in ordinals.
9259            while _next_ordinal_to_read < 2 {
9260                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9261                _next_ordinal_to_read += 1;
9262                next_offset += envelope_size;
9263            }
9264
9265            let next_out_of_line = decoder.next_out_of_line();
9266            let handles_before = decoder.remaining_handles();
9267            if let Some((inlined, num_bytes, num_handles)) =
9268                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9269            {
9270                let member_inline_size =
9271                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9272                if inlined != (member_inline_size <= 4) {
9273                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9274                }
9275                let inner_offset;
9276                let mut inner_depth = depth.clone();
9277                if inlined {
9278                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9279                    inner_offset = next_offset;
9280                } else {
9281                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9282                    inner_depth.increment()?;
9283                }
9284                let val_ref = self.session.get_or_insert_with(|| fidl::new_empty!(u64, D));
9285                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9286                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9287                {
9288                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9289                }
9290                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9291                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9292                }
9293            }
9294
9295            next_offset += envelope_size;
9296            _next_ordinal_to_read += 1;
9297            if next_offset >= end_offset {
9298                return Ok(());
9299            }
9300
9301            // Decode unknown envelopes for gaps in ordinals.
9302            while _next_ordinal_to_read < 3 {
9303                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9304                _next_ordinal_to_read += 1;
9305                next_offset += envelope_size;
9306            }
9307
9308            let next_out_of_line = decoder.next_out_of_line();
9309            let handles_before = decoder.remaining_handles();
9310            if let Some((inlined, num_bytes, num_handles)) =
9311                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9312            {
9313                let member_inline_size =
9314                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9315                if inlined != (member_inline_size <= 4) {
9316                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9317                }
9318                let inner_offset;
9319                let mut inner_depth = depth.clone();
9320                if inlined {
9321                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9322                    inner_offset = next_offset;
9323                } else {
9324                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9325                    inner_depth.increment()?;
9326                }
9327                let val_ref = self.resource.get_or_insert_with(|| fidl::new_empty!(u32, D));
9328                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9329                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9330                {
9331                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9332                }
9333                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9334                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9335                }
9336            }
9337
9338            next_offset += envelope_size;
9339            _next_ordinal_to_read += 1;
9340            if next_offset >= end_offset {
9341                return Ok(());
9342            }
9343
9344            // Decode unknown envelopes for gaps in ordinals.
9345            while _next_ordinal_to_read < 4 {
9346                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9347                _next_ordinal_to_read += 1;
9348                next_offset += envelope_size;
9349            }
9350
9351            let next_out_of_line = decoder.next_out_of_line();
9352            let handles_before = decoder.remaining_handles();
9353            if let Some((inlined, num_bytes, num_handles)) =
9354                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9355            {
9356                let member_inline_size =
9357                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
9358                        decoder.context,
9359                    );
9360                if inlined != (member_inline_size <= 4) {
9361                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9362                }
9363                let inner_offset;
9364                let mut inner_depth = depth.clone();
9365                if inlined {
9366                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9367                    inner_offset = next_offset;
9368                } else {
9369                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9370                    inner_depth.increment()?;
9371                }
9372                let val_ref = self
9373                    .operation
9374                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
9375                fidl::decode!(
9376                    fidl::encoding::BoundedString<32>,
9377                    D,
9378                    val_ref,
9379                    decoder,
9380                    inner_offset,
9381                    inner_depth
9382                )?;
9383                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9384                {
9385                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9386                }
9387                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9388                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9389                }
9390            }
9391
9392            next_offset += envelope_size;
9393            _next_ordinal_to_read += 1;
9394            if next_offset >= end_offset {
9395                return Ok(());
9396            }
9397
9398            // Decode unknown envelopes for gaps in ordinals.
9399            while _next_ordinal_to_read < 5 {
9400                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9401                _next_ordinal_to_read += 1;
9402                next_offset += envelope_size;
9403            }
9404
9405            let next_out_of_line = decoder.next_out_of_line();
9406            let handles_before = decoder.remaining_handles();
9407            if let Some((inlined, num_bytes, num_handles)) =
9408                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9409            {
9410                let member_inline_size =
9411                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9412                if inlined != (member_inline_size <= 4) {
9413                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9414                }
9415                let inner_offset;
9416                let mut inner_depth = depth.clone();
9417                if inlined {
9418                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9419                    inner_offset = next_offset;
9420                } else {
9421                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9422                    inner_depth.increment()?;
9423                }
9424                let val_ref = self.offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
9425                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9426                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9427                {
9428                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9429                }
9430                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9431                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9432                }
9433            }
9434
9435            next_offset += envelope_size;
9436            _next_ordinal_to_read += 1;
9437            if next_offset >= end_offset {
9438                return Ok(());
9439            }
9440
9441            // Decode unknown envelopes for gaps in ordinals.
9442            while _next_ordinal_to_read < 6 {
9443                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9444                _next_ordinal_to_read += 1;
9445                next_offset += envelope_size;
9446            }
9447
9448            let next_out_of_line = decoder.next_out_of_line();
9449            let handles_before = decoder.remaining_handles();
9450            if let Some((inlined, num_bytes, num_handles)) =
9451                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9452            {
9453                let member_inline_size =
9454                    <AuditDecision as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9455                if inlined != (member_inline_size <= 4) {
9456                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9457                }
9458                let inner_offset;
9459                let mut inner_depth = depth.clone();
9460                if inlined {
9461                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9462                    inner_offset = next_offset;
9463                } else {
9464                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9465                    inner_depth.increment()?;
9466                }
9467                let val_ref =
9468                    self.decision.get_or_insert_with(|| fidl::new_empty!(AuditDecision, D));
9469                fidl::decode!(AuditDecision, D, val_ref, decoder, inner_offset, inner_depth)?;
9470                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9471                {
9472                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9473                }
9474                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9475                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9476                }
9477            }
9478
9479            next_offset += envelope_size;
9480            _next_ordinal_to_read += 1;
9481            if next_offset >= end_offset {
9482                return Ok(());
9483            }
9484
9485            // Decode unknown envelopes for gaps in ordinals.
9486            while _next_ordinal_to_read < 7 {
9487                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9488                _next_ordinal_to_read += 1;
9489                next_offset += envelope_size;
9490            }
9491
9492            let next_out_of_line = decoder.next_out_of_line();
9493            let handles_before = decoder.remaining_handles();
9494            if let Some((inlined, num_bytes, num_handles)) =
9495                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9496            {
9497                let member_inline_size =
9498                    <OperationError as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9499                if inlined != (member_inline_size <= 4) {
9500                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9501                }
9502                let inner_offset;
9503                let mut inner_depth = depth.clone();
9504                if inlined {
9505                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9506                    inner_offset = next_offset;
9507                } else {
9508                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9509                    inner_depth.increment()?;
9510                }
9511                let val_ref =
9512                    self.denial.get_or_insert_with(|| fidl::new_empty!(OperationError, D));
9513                fidl::decode!(OperationError, D, val_ref, decoder, inner_offset, inner_depth)?;
9514                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9515                {
9516                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9517                }
9518                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9519                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9520                }
9521            }
9522
9523            next_offset += envelope_size;
9524            _next_ordinal_to_read += 1;
9525            if next_offset >= end_offset {
9526                return Ok(());
9527            }
9528
9529            // Decode unknown envelopes for gaps in ordinals.
9530            while _next_ordinal_to_read < 8 {
9531                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9532                _next_ordinal_to_read += 1;
9533                next_offset += envelope_size;
9534            }
9535
9536            let next_out_of_line = decoder.next_out_of_line();
9537            let handles_before = decoder.remaining_handles();
9538            if let Some((inlined, num_bytes, num_handles)) =
9539                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9540            {
9541                let member_inline_size =
9542                    <AuditStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9543                if inlined != (member_inline_size <= 4) {
9544                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9545                }
9546                let inner_offset;
9547                let mut inner_depth = depth.clone();
9548                if inlined {
9549                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9550                    inner_offset = next_offset;
9551                } else {
9552                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9553                    inner_depth.increment()?;
9554                }
9555                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(AuditStatus, D));
9556                fidl::decode!(AuditStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
9557                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9558                {
9559                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9560                }
9561                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9562                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9563                }
9564            }
9565
9566            next_offset += envelope_size;
9567            _next_ordinal_to_read += 1;
9568            if next_offset >= end_offset {
9569                return Ok(());
9570            }
9571
9572            // Decode unknown envelopes for gaps in ordinals.
9573            while _next_ordinal_to_read < 9 {
9574                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9575                _next_ordinal_to_read += 1;
9576                next_offset += envelope_size;
9577            }
9578
9579            let next_out_of_line = decoder.next_out_of_line();
9580            let handles_before = decoder.remaining_handles();
9581            if let Some((inlined, num_bytes, num_handles)) =
9582                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9583            {
9584                let member_inline_size =
9585                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9586                if inlined != (member_inline_size <= 4) {
9587                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9588                }
9589                let inner_offset;
9590                let mut inner_depth = depth.clone();
9591                if inlined {
9592                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9593                    inner_offset = next_offset;
9594                } else {
9595                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9596                    inner_depth.increment()?;
9597                }
9598                let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(u32, D));
9599                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9600                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9601                {
9602                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9603                }
9604                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9605                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9606                }
9607            }
9608
9609            next_offset += envelope_size;
9610            _next_ordinal_to_read += 1;
9611            if next_offset >= end_offset {
9612                return Ok(());
9613            }
9614
9615            // Decode unknown envelopes for gaps in ordinals.
9616            while _next_ordinal_to_read < 10 {
9617                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9618                _next_ordinal_to_read += 1;
9619                next_offset += envelope_size;
9620            }
9621
9622            let next_out_of_line = decoder.next_out_of_line();
9623            let handles_before = decoder.remaining_handles();
9624            if let Some((inlined, num_bytes, num_handles)) =
9625                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9626            {
9627                let member_inline_size =
9628                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9629                if inlined != (member_inline_size <= 4) {
9630                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9631                }
9632                let inner_offset;
9633                let mut inner_depth = depth.clone();
9634                if inlined {
9635                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9636                    inner_offset = next_offset;
9637                } else {
9638                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9639                    inner_depth.increment()?;
9640                }
9641                let val_ref = self.timestamp_ns.get_or_insert_with(|| fidl::new_empty!(i64, D));
9642                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9643                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9644                {
9645                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9646                }
9647                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9648                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9649                }
9650            }
9651
9652            next_offset += envelope_size;
9653            _next_ordinal_to_read += 1;
9654            if next_offset >= end_offset {
9655                return Ok(());
9656            }
9657
9658            // Decode unknown envelopes for gaps in ordinals.
9659            while _next_ordinal_to_read < 11 {
9660                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9661                _next_ordinal_to_read += 1;
9662                next_offset += envelope_size;
9663            }
9664
9665            let next_out_of_line = decoder.next_out_of_line();
9666            let handles_before = decoder.remaining_handles();
9667            if let Some((inlined, num_bytes, num_handles)) =
9668                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9669            {
9670                let member_inline_size =
9671                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
9672                        decoder.context,
9673                    );
9674                if inlined != (member_inline_size <= 4) {
9675                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9676                }
9677                let inner_offset;
9678                let mut inner_depth = depth.clone();
9679                if inlined {
9680                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9681                    inner_offset = next_offset;
9682                } else {
9683                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9684                    inner_depth.increment()?;
9685                }
9686                let val_ref = self
9687                    .run_id
9688                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
9689                fidl::decode!(
9690                    fidl::encoding::BoundedString<128>,
9691                    D,
9692                    val_ref,
9693                    decoder,
9694                    inner_offset,
9695                    inner_depth
9696                )?;
9697                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9698                {
9699                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9700                }
9701                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9702                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9703                }
9704            }
9705
9706            next_offset += envelope_size;
9707            _next_ordinal_to_read += 1;
9708            if next_offset >= end_offset {
9709                return Ok(());
9710            }
9711
9712            // Decode unknown envelopes for gaps in ordinals.
9713            while _next_ordinal_to_read < 12 {
9714                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9715                _next_ordinal_to_read += 1;
9716                next_offset += envelope_size;
9717            }
9718
9719            let next_out_of_line = decoder.next_out_of_line();
9720            let handles_before = decoder.remaining_handles();
9721            if let Some((inlined, num_bytes, num_handles)) =
9722                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9723            {
9724                let member_inline_size =
9725                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9726                if inlined != (member_inline_size <= 4) {
9727                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9728                }
9729                let inner_offset;
9730                let mut inner_depth = depth.clone();
9731                if inlined {
9732                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9733                    inner_offset = next_offset;
9734                } else {
9735                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9736                    inner_depth.increment()?;
9737                }
9738                let val_ref = self.item_index.get_or_insert_with(|| fidl::new_empty!(u32, D));
9739                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9740                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9741                {
9742                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9743                }
9744                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9745                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9746                }
9747            }
9748
9749            next_offset += envelope_size;
9750            _next_ordinal_to_read += 1;
9751            if next_offset >= end_offset {
9752                return Ok(());
9753            }
9754
9755            // Decode unknown envelopes for gaps in ordinals.
9756            while _next_ordinal_to_read < 13 {
9757                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9758                _next_ordinal_to_read += 1;
9759                next_offset += envelope_size;
9760            }
9761
9762            let next_out_of_line = decoder.next_out_of_line();
9763            let handles_before = decoder.remaining_handles();
9764            if let Some((inlined, num_bytes, num_handles)) =
9765                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9766            {
9767                let member_inline_size =
9768                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9769                if inlined != (member_inline_size <= 4) {
9770                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9771                }
9772                let inner_offset;
9773                let mut inner_depth = depth.clone();
9774                if inlined {
9775                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9776                    inner_offset = next_offset;
9777                } else {
9778                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9779                    inner_depth.increment()?;
9780                }
9781                let val_ref = self.proxy_generation.get_or_insert_with(|| fidl::new_empty!(u64, D));
9782                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9783                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9784                {
9785                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9786                }
9787                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9788                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9789                }
9790            }
9791
9792            next_offset += envelope_size;
9793            _next_ordinal_to_read += 1;
9794            if next_offset >= end_offset {
9795                return Ok(());
9796            }
9797
9798            // Decode unknown envelopes for gaps in ordinals.
9799            while _next_ordinal_to_read < 14 {
9800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9801                _next_ordinal_to_read += 1;
9802                next_offset += envelope_size;
9803            }
9804
9805            let next_out_of_line = decoder.next_out_of_line();
9806            let handles_before = decoder.remaining_handles();
9807            if let Some((inlined, num_bytes, num_handles)) =
9808                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9809            {
9810                let member_inline_size =
9811                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
9812                        decoder.context,
9813                    );
9814                if inlined != (member_inline_size <= 4) {
9815                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9816                }
9817                let inner_offset;
9818                let mut inner_depth = depth.clone();
9819                if inlined {
9820                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9821                    inner_offset = next_offset;
9822                } else {
9823                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9824                    inner_depth.increment()?;
9825                }
9826                let val_ref = self
9827                    .boot_id
9828                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
9829                fidl::decode!(
9830                    fidl::encoding::BoundedString<128>,
9831                    D,
9832                    val_ref,
9833                    decoder,
9834                    inner_offset,
9835                    inner_depth
9836                )?;
9837                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9838                {
9839                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9840                }
9841                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9842                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9843                }
9844            }
9845
9846            next_offset += envelope_size;
9847
9848            // Decode the remaining unknown envelopes.
9849            while next_offset < end_offset {
9850                _next_ordinal_to_read += 1;
9851                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9852                next_offset += envelope_size;
9853            }
9854
9855            Ok(())
9856        }
9857    }
9858
9859    impl Expectations {
9860        #[inline(always)]
9861        fn max_ordinal_present(&self) -> u64 {
9862            if let Some(_) = self.bound_driver_url {
9863                return 6;
9864            }
9865            if let Some(_) = self.topology_generation {
9866                return 5;
9867            }
9868            if let Some(_) = self.policy_digest {
9869                return 4;
9870            }
9871            if let Some(_) = self.resource_digest {
9872                return 3;
9873            }
9874            if let Some(_) = self.proxy_generation {
9875                return 2;
9876            }
9877            if let Some(_) = self.boot_id {
9878                return 1;
9879            }
9880            0
9881        }
9882    }
9883
9884    impl fidl::encoding::ValueTypeMarker for Expectations {
9885        type Borrowed<'a> = &'a Self;
9886        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9887            value
9888        }
9889    }
9890
9891    unsafe impl fidl::encoding::TypeMarker for Expectations {
9892        type Owned = Self;
9893
9894        #[inline(always)]
9895        fn inline_align(_context: fidl::encoding::Context) -> usize {
9896            8
9897        }
9898
9899        #[inline(always)]
9900        fn inline_size(_context: fidl::encoding::Context) -> usize {
9901            16
9902        }
9903    }
9904
9905    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Expectations, D>
9906        for &Expectations
9907    {
9908        unsafe fn encode(
9909            self,
9910            encoder: &mut fidl::encoding::Encoder<'_, D>,
9911            offset: usize,
9912            mut depth: fidl::encoding::Depth,
9913        ) -> fidl::Result<()> {
9914            encoder.debug_check_bounds::<Expectations>(offset);
9915            // Vector header
9916            let max_ordinal: u64 = self.max_ordinal_present();
9917            encoder.write_num(max_ordinal, offset);
9918            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9919            // Calling encoder.out_of_line_offset(0) is not allowed.
9920            if max_ordinal == 0 {
9921                return Ok(());
9922            }
9923            depth.increment()?;
9924            let envelope_size = 8;
9925            let bytes_len = max_ordinal as usize * envelope_size;
9926            #[allow(unused_variables)]
9927            let offset = encoder.out_of_line_offset(bytes_len);
9928            let mut _prev_end_offset: usize = 0;
9929            if 1 > max_ordinal {
9930                return Ok(());
9931            }
9932
9933            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9934            // are envelope_size bytes.
9935            let cur_offset: usize = (1 - 1) * envelope_size;
9936
9937            // Zero reserved fields.
9938            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9939
9940            // Safety:
9941            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9942            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9943            //   envelope_size bytes, there is always sufficient room.
9944            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
9945                self.boot_id.as_ref().map(
9946                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
9947                ),
9948                encoder,
9949                offset + cur_offset,
9950                depth,
9951            )?;
9952
9953            _prev_end_offset = cur_offset + envelope_size;
9954            if 2 > max_ordinal {
9955                return Ok(());
9956            }
9957
9958            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9959            // are envelope_size bytes.
9960            let cur_offset: usize = (2 - 1) * envelope_size;
9961
9962            // Zero reserved fields.
9963            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9964
9965            // Safety:
9966            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9967            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9968            //   envelope_size bytes, there is always sufficient room.
9969            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9970                self.proxy_generation
9971                    .as_ref()
9972                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9973                encoder,
9974                offset + cur_offset,
9975                depth,
9976            )?;
9977
9978            _prev_end_offset = cur_offset + envelope_size;
9979            if 3 > max_ordinal {
9980                return Ok(());
9981            }
9982
9983            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9984            // are envelope_size bytes.
9985            let cur_offset: usize = (3 - 1) * envelope_size;
9986
9987            // Zero reserved fields.
9988            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9989
9990            // Safety:
9991            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9992            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9993            //   envelope_size bytes, there is always sufficient room.
9994            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
9995                self.resource_digest.as_ref().map(
9996                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
9997                ),
9998                encoder,
9999                offset + cur_offset,
10000                depth,
10001            )?;
10002
10003            _prev_end_offset = cur_offset + envelope_size;
10004            if 4 > max_ordinal {
10005                return Ok(());
10006            }
10007
10008            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10009            // are envelope_size bytes.
10010            let cur_offset: usize = (4 - 1) * envelope_size;
10011
10012            // Zero reserved fields.
10013            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10014
10015            // Safety:
10016            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10017            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10018            //   envelope_size bytes, there is always sufficient room.
10019            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
10020                self.policy_digest.as_ref().map(
10021                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
10022                ),
10023                encoder,
10024                offset + cur_offset,
10025                depth,
10026            )?;
10027
10028            _prev_end_offset = cur_offset + envelope_size;
10029            if 5 > max_ordinal {
10030                return Ok(());
10031            }
10032
10033            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10034            // are envelope_size bytes.
10035            let cur_offset: usize = (5 - 1) * envelope_size;
10036
10037            // Zero reserved fields.
10038            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10039
10040            // Safety:
10041            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10042            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10043            //   envelope_size bytes, there is always sufficient room.
10044            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10045                self.topology_generation
10046                    .as_ref()
10047                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10048                encoder,
10049                offset + cur_offset,
10050                depth,
10051            )?;
10052
10053            _prev_end_offset = cur_offset + envelope_size;
10054            if 6 > max_ordinal {
10055                return Ok(());
10056            }
10057
10058            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10059            // are envelope_size bytes.
10060            let cur_offset: usize = (6 - 1) * envelope_size;
10061
10062            // Zero reserved fields.
10063            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10064
10065            // Safety:
10066            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10067            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10068            //   envelope_size bytes, there is always sufficient room.
10069            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
10070                self.bound_driver_url.as_ref().map(
10071                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
10072                ),
10073                encoder,
10074                offset + cur_offset,
10075                depth,
10076            )?;
10077
10078            _prev_end_offset = cur_offset + envelope_size;
10079
10080            Ok(())
10081        }
10082    }
10083
10084    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Expectations {
10085        #[inline(always)]
10086        fn new_empty() -> Self {
10087            Self::default()
10088        }
10089
10090        unsafe fn decode(
10091            &mut self,
10092            decoder: &mut fidl::encoding::Decoder<'_, D>,
10093            offset: usize,
10094            mut depth: fidl::encoding::Depth,
10095        ) -> fidl::Result<()> {
10096            decoder.debug_check_bounds::<Self>(offset);
10097            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10098                None => return Err(fidl::Error::NotNullable),
10099                Some(len) => len,
10100            };
10101            // Calling decoder.out_of_line_offset(0) is not allowed.
10102            if len == 0 {
10103                return Ok(());
10104            };
10105            depth.increment()?;
10106            let envelope_size = 8;
10107            let bytes_len = len * envelope_size;
10108            let offset = decoder.out_of_line_offset(bytes_len)?;
10109            // Decode the envelope for each type.
10110            let mut _next_ordinal_to_read = 0;
10111            let mut next_offset = offset;
10112            let end_offset = offset + bytes_len;
10113            _next_ordinal_to_read += 1;
10114            if next_offset >= end_offset {
10115                return Ok(());
10116            }
10117
10118            // Decode unknown envelopes for gaps in ordinals.
10119            while _next_ordinal_to_read < 1 {
10120                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10121                _next_ordinal_to_read += 1;
10122                next_offset += envelope_size;
10123            }
10124
10125            let next_out_of_line = decoder.next_out_of_line();
10126            let handles_before = decoder.remaining_handles();
10127            if let Some((inlined, num_bytes, num_handles)) =
10128                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10129            {
10130                let member_inline_size =
10131                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
10132                        decoder.context,
10133                    );
10134                if inlined != (member_inline_size <= 4) {
10135                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10136                }
10137                let inner_offset;
10138                let mut inner_depth = depth.clone();
10139                if inlined {
10140                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10141                    inner_offset = next_offset;
10142                } else {
10143                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10144                    inner_depth.increment()?;
10145                }
10146                let val_ref = self
10147                    .boot_id
10148                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
10149                fidl::decode!(
10150                    fidl::encoding::BoundedString<128>,
10151                    D,
10152                    val_ref,
10153                    decoder,
10154                    inner_offset,
10155                    inner_depth
10156                )?;
10157                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10158                {
10159                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10160                }
10161                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10162                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10163                }
10164            }
10165
10166            next_offset += envelope_size;
10167            _next_ordinal_to_read += 1;
10168            if next_offset >= end_offset {
10169                return Ok(());
10170            }
10171
10172            // Decode unknown envelopes for gaps in ordinals.
10173            while _next_ordinal_to_read < 2 {
10174                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10175                _next_ordinal_to_read += 1;
10176                next_offset += envelope_size;
10177            }
10178
10179            let next_out_of_line = decoder.next_out_of_line();
10180            let handles_before = decoder.remaining_handles();
10181            if let Some((inlined, num_bytes, num_handles)) =
10182                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10183            {
10184                let member_inline_size =
10185                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10186                if inlined != (member_inline_size <= 4) {
10187                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10188                }
10189                let inner_offset;
10190                let mut inner_depth = depth.clone();
10191                if inlined {
10192                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10193                    inner_offset = next_offset;
10194                } else {
10195                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10196                    inner_depth.increment()?;
10197                }
10198                let val_ref = self.proxy_generation.get_or_insert_with(|| fidl::new_empty!(u64, D));
10199                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10200                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10201                {
10202                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10203                }
10204                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10205                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10206                }
10207            }
10208
10209            next_offset += envelope_size;
10210            _next_ordinal_to_read += 1;
10211            if next_offset >= end_offset {
10212                return Ok(());
10213            }
10214
10215            // Decode unknown envelopes for gaps in ordinals.
10216            while _next_ordinal_to_read < 3 {
10217                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10218                _next_ordinal_to_read += 1;
10219                next_offset += envelope_size;
10220            }
10221
10222            let next_out_of_line = decoder.next_out_of_line();
10223            let handles_before = decoder.remaining_handles();
10224            if let Some((inlined, num_bytes, num_handles)) =
10225                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10226            {
10227                let member_inline_size =
10228                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
10229                        decoder.context,
10230                    );
10231                if inlined != (member_inline_size <= 4) {
10232                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10233                }
10234                let inner_offset;
10235                let mut inner_depth = depth.clone();
10236                if inlined {
10237                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10238                    inner_offset = next_offset;
10239                } else {
10240                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10241                    inner_depth.increment()?;
10242                }
10243                let val_ref = self
10244                    .resource_digest
10245                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
10246                fidl::decode!(
10247                    fidl::encoding::BoundedString<128>,
10248                    D,
10249                    val_ref,
10250                    decoder,
10251                    inner_offset,
10252                    inner_depth
10253                )?;
10254                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10255                {
10256                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10257                }
10258                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10259                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10260                }
10261            }
10262
10263            next_offset += envelope_size;
10264            _next_ordinal_to_read += 1;
10265            if next_offset >= end_offset {
10266                return Ok(());
10267            }
10268
10269            // Decode unknown envelopes for gaps in ordinals.
10270            while _next_ordinal_to_read < 4 {
10271                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10272                _next_ordinal_to_read += 1;
10273                next_offset += envelope_size;
10274            }
10275
10276            let next_out_of_line = decoder.next_out_of_line();
10277            let handles_before = decoder.remaining_handles();
10278            if let Some((inlined, num_bytes, num_handles)) =
10279                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10280            {
10281                let member_inline_size =
10282                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
10283                        decoder.context,
10284                    );
10285                if inlined != (member_inline_size <= 4) {
10286                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10287                }
10288                let inner_offset;
10289                let mut inner_depth = depth.clone();
10290                if inlined {
10291                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10292                    inner_offset = next_offset;
10293                } else {
10294                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10295                    inner_depth.increment()?;
10296                }
10297                let val_ref = self
10298                    .policy_digest
10299                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
10300                fidl::decode!(
10301                    fidl::encoding::BoundedString<128>,
10302                    D,
10303                    val_ref,
10304                    decoder,
10305                    inner_offset,
10306                    inner_depth
10307                )?;
10308                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10309                {
10310                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10311                }
10312                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10313                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10314                }
10315            }
10316
10317            next_offset += envelope_size;
10318            _next_ordinal_to_read += 1;
10319            if next_offset >= end_offset {
10320                return Ok(());
10321            }
10322
10323            // Decode unknown envelopes for gaps in ordinals.
10324            while _next_ordinal_to_read < 5 {
10325                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10326                _next_ordinal_to_read += 1;
10327                next_offset += envelope_size;
10328            }
10329
10330            let next_out_of_line = decoder.next_out_of_line();
10331            let handles_before = decoder.remaining_handles();
10332            if let Some((inlined, num_bytes, num_handles)) =
10333                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10334            {
10335                let member_inline_size =
10336                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10337                if inlined != (member_inline_size <= 4) {
10338                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10339                }
10340                let inner_offset;
10341                let mut inner_depth = depth.clone();
10342                if inlined {
10343                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10344                    inner_offset = next_offset;
10345                } else {
10346                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10347                    inner_depth.increment()?;
10348                }
10349                let val_ref =
10350                    self.topology_generation.get_or_insert_with(|| fidl::new_empty!(u64, D));
10351                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10352                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10353                {
10354                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10355                }
10356                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10357                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10358                }
10359            }
10360
10361            next_offset += envelope_size;
10362            _next_ordinal_to_read += 1;
10363            if next_offset >= end_offset {
10364                return Ok(());
10365            }
10366
10367            // Decode unknown envelopes for gaps in ordinals.
10368            while _next_ordinal_to_read < 6 {
10369                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10370                _next_ordinal_to_read += 1;
10371                next_offset += envelope_size;
10372            }
10373
10374            let next_out_of_line = decoder.next_out_of_line();
10375            let handles_before = decoder.remaining_handles();
10376            if let Some((inlined, num_bytes, num_handles)) =
10377                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10378            {
10379                let member_inline_size =
10380                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
10381                        decoder.context,
10382                    );
10383                if inlined != (member_inline_size <= 4) {
10384                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10385                }
10386                let inner_offset;
10387                let mut inner_depth = depth.clone();
10388                if inlined {
10389                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10390                    inner_offset = next_offset;
10391                } else {
10392                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10393                    inner_depth.increment()?;
10394                }
10395                let val_ref = self
10396                    .bound_driver_url
10397                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
10398                fidl::decode!(
10399                    fidl::encoding::BoundedString<128>,
10400                    D,
10401                    val_ref,
10402                    decoder,
10403                    inner_offset,
10404                    inner_depth
10405                )?;
10406                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10407                {
10408                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10409                }
10410                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10411                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10412                }
10413            }
10414
10415            next_offset += envelope_size;
10416
10417            // Decode the remaining unknown envelopes.
10418            while next_offset < end_offset {
10419                _next_ordinal_to_read += 1;
10420                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10421                next_offset += envelope_size;
10422            }
10423
10424            Ok(())
10425        }
10426    }
10427
10428    impl ProxyDescription {
10429        #[inline(always)]
10430        fn max_ordinal_present(&self) -> u64 {
10431            if let Some(_) = self.takeover {
10432                return 12;
10433            }
10434            if let Some(_) = self.topology_generation {
10435                return 11;
10436            }
10437            if let Some(_) = self.node_moniker {
10438                return 10;
10439            }
10440            if let Some(_) = self.audit_capacity {
10441                return 9;
10442            }
10443            if let Some(_) = self.max_snapshot_items {
10444                return 8;
10445            }
10446            if let Some(_) = self.resources {
10447                return 7;
10448            }
10449            if let Some(_) = self.policy_digest {
10450                return 6;
10451            }
10452            if let Some(_) = self.resource_digest {
10453                return 5;
10454            }
10455            if let Some(_) = self.boot_id {
10456                return 4;
10457            }
10458            if let Some(_) = self.proxy_generation {
10459                return 3;
10460            }
10461            if let Some(_) = self.protocol_minor {
10462                return 2;
10463            }
10464            if let Some(_) = self.protocol_major {
10465                return 1;
10466            }
10467            0
10468        }
10469    }
10470
10471    impl fidl::encoding::ValueTypeMarker for ProxyDescription {
10472        type Borrowed<'a> = &'a Self;
10473        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10474            value
10475        }
10476    }
10477
10478    unsafe impl fidl::encoding::TypeMarker for ProxyDescription {
10479        type Owned = Self;
10480
10481        #[inline(always)]
10482        fn inline_align(_context: fidl::encoding::Context) -> usize {
10483            8
10484        }
10485
10486        #[inline(always)]
10487        fn inline_size(_context: fidl::encoding::Context) -> usize {
10488            16
10489        }
10490    }
10491
10492    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProxyDescription, D>
10493        for &ProxyDescription
10494    {
10495        unsafe fn encode(
10496            self,
10497            encoder: &mut fidl::encoding::Encoder<'_, D>,
10498            offset: usize,
10499            mut depth: fidl::encoding::Depth,
10500        ) -> fidl::Result<()> {
10501            encoder.debug_check_bounds::<ProxyDescription>(offset);
10502            // Vector header
10503            let max_ordinal: u64 = self.max_ordinal_present();
10504            encoder.write_num(max_ordinal, offset);
10505            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10506            // Calling encoder.out_of_line_offset(0) is not allowed.
10507            if max_ordinal == 0 {
10508                return Ok(());
10509            }
10510            depth.increment()?;
10511            let envelope_size = 8;
10512            let bytes_len = max_ordinal as usize * envelope_size;
10513            #[allow(unused_variables)]
10514            let offset = encoder.out_of_line_offset(bytes_len);
10515            let mut _prev_end_offset: usize = 0;
10516            if 1 > max_ordinal {
10517                return Ok(());
10518            }
10519
10520            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10521            // are envelope_size bytes.
10522            let cur_offset: usize = (1 - 1) * envelope_size;
10523
10524            // Zero reserved fields.
10525            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10526
10527            // Safety:
10528            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10529            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10530            //   envelope_size bytes, there is always sufficient room.
10531            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10532                self.protocol_major.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10533                encoder,
10534                offset + cur_offset,
10535                depth,
10536            )?;
10537
10538            _prev_end_offset = cur_offset + envelope_size;
10539            if 2 > max_ordinal {
10540                return Ok(());
10541            }
10542
10543            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10544            // are envelope_size bytes.
10545            let cur_offset: usize = (2 - 1) * envelope_size;
10546
10547            // Zero reserved fields.
10548            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10549
10550            // Safety:
10551            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10552            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10553            //   envelope_size bytes, there is always sufficient room.
10554            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10555                self.protocol_minor.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10556                encoder,
10557                offset + cur_offset,
10558                depth,
10559            )?;
10560
10561            _prev_end_offset = cur_offset + envelope_size;
10562            if 3 > max_ordinal {
10563                return Ok(());
10564            }
10565
10566            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10567            // are envelope_size bytes.
10568            let cur_offset: usize = (3 - 1) * envelope_size;
10569
10570            // Zero reserved fields.
10571            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10572
10573            // Safety:
10574            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10575            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10576            //   envelope_size bytes, there is always sufficient room.
10577            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10578                self.proxy_generation
10579                    .as_ref()
10580                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10581                encoder,
10582                offset + cur_offset,
10583                depth,
10584            )?;
10585
10586            _prev_end_offset = cur_offset + envelope_size;
10587            if 4 > max_ordinal {
10588                return Ok(());
10589            }
10590
10591            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10592            // are envelope_size bytes.
10593            let cur_offset: usize = (4 - 1) * envelope_size;
10594
10595            // Zero reserved fields.
10596            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10597
10598            // Safety:
10599            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10600            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10601            //   envelope_size bytes, there is always sufficient room.
10602            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
10603                self.boot_id.as_ref().map(
10604                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
10605                ),
10606                encoder,
10607                offset + cur_offset,
10608                depth,
10609            )?;
10610
10611            _prev_end_offset = cur_offset + envelope_size;
10612            if 5 > max_ordinal {
10613                return Ok(());
10614            }
10615
10616            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10617            // are envelope_size bytes.
10618            let cur_offset: usize = (5 - 1) * envelope_size;
10619
10620            // Zero reserved fields.
10621            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10622
10623            // Safety:
10624            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10625            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10626            //   envelope_size bytes, there is always sufficient room.
10627            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
10628                self.resource_digest.as_ref().map(
10629                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
10630                ),
10631                encoder,
10632                offset + cur_offset,
10633                depth,
10634            )?;
10635
10636            _prev_end_offset = cur_offset + envelope_size;
10637            if 6 > max_ordinal {
10638                return Ok(());
10639            }
10640
10641            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10642            // are envelope_size bytes.
10643            let cur_offset: usize = (6 - 1) * envelope_size;
10644
10645            // Zero reserved fields.
10646            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10647
10648            // Safety:
10649            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10650            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10651            //   envelope_size bytes, there is always sufficient room.
10652            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
10653                self.policy_digest.as_ref().map(
10654                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
10655                ),
10656                encoder,
10657                offset + cur_offset,
10658                depth,
10659            )?;
10660
10661            _prev_end_offset = cur_offset + envelope_size;
10662            if 7 > max_ordinal {
10663                return Ok(());
10664            }
10665
10666            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10667            // are envelope_size bytes.
10668            let cur_offset: usize = (7 - 1) * envelope_size;
10669
10670            // Zero reserved fields.
10671            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10672
10673            // Safety:
10674            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10675            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10676            //   envelope_size bytes, there is always sufficient room.
10677            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ResourceDescription, 64>, D>(
10678            self.resources.as_ref().map(<fidl::encoding::Vector<ResourceDescription, 64> as fidl::encoding::ValueTypeMarker>::borrow),
10679            encoder, offset + cur_offset, depth
10680        )?;
10681
10682            _prev_end_offset = cur_offset + envelope_size;
10683            if 8 > max_ordinal {
10684                return Ok(());
10685            }
10686
10687            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10688            // are envelope_size bytes.
10689            let cur_offset: usize = (8 - 1) * envelope_size;
10690
10691            // Zero reserved fields.
10692            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10693
10694            // Safety:
10695            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10696            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10697            //   envelope_size bytes, there is always sufficient room.
10698            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10699                self.max_snapshot_items
10700                    .as_ref()
10701                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10702                encoder,
10703                offset + cur_offset,
10704                depth,
10705            )?;
10706
10707            _prev_end_offset = cur_offset + envelope_size;
10708            if 9 > max_ordinal {
10709                return Ok(());
10710            }
10711
10712            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10713            // are envelope_size bytes.
10714            let cur_offset: usize = (9 - 1) * envelope_size;
10715
10716            // Zero reserved fields.
10717            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10718
10719            // Safety:
10720            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10721            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10722            //   envelope_size bytes, there is always sufficient room.
10723            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10724                self.audit_capacity.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10725                encoder,
10726                offset + cur_offset,
10727                depth,
10728            )?;
10729
10730            _prev_end_offset = cur_offset + envelope_size;
10731            if 10 > max_ordinal {
10732                return Ok(());
10733            }
10734
10735            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10736            // are envelope_size bytes.
10737            let cur_offset: usize = (10 - 1) * envelope_size;
10738
10739            // Zero reserved fields.
10740            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10741
10742            // Safety:
10743            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10744            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10745            //   envelope_size bytes, there is always sufficient room.
10746            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
10747                self.node_moniker.as_ref().map(
10748                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
10749                ),
10750                encoder,
10751                offset + cur_offset,
10752                depth,
10753            )?;
10754
10755            _prev_end_offset = cur_offset + envelope_size;
10756            if 11 > max_ordinal {
10757                return Ok(());
10758            }
10759
10760            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10761            // are envelope_size bytes.
10762            let cur_offset: usize = (11 - 1) * envelope_size;
10763
10764            // Zero reserved fields.
10765            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10766
10767            // Safety:
10768            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10769            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10770            //   envelope_size bytes, there is always sufficient room.
10771            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10772                self.topology_generation
10773                    .as_ref()
10774                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10775                encoder,
10776                offset + cur_offset,
10777                depth,
10778            )?;
10779
10780            _prev_end_offset = cur_offset + envelope_size;
10781            if 12 > max_ordinal {
10782                return Ok(());
10783            }
10784
10785            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10786            // are envelope_size bytes.
10787            let cur_offset: usize = (12 - 1) * envelope_size;
10788
10789            // Zero reserved fields.
10790            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10791
10792            // Safety:
10793            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10794            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10795            //   envelope_size bytes, there is always sufficient room.
10796            fidl::encoding::encode_in_envelope_optional::<TakeoverState, D>(
10797                self.takeover
10798                    .as_ref()
10799                    .map(<TakeoverState as fidl::encoding::ValueTypeMarker>::borrow),
10800                encoder,
10801                offset + cur_offset,
10802                depth,
10803            )?;
10804
10805            _prev_end_offset = cur_offset + envelope_size;
10806
10807            Ok(())
10808        }
10809    }
10810
10811    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProxyDescription {
10812        #[inline(always)]
10813        fn new_empty() -> Self {
10814            Self::default()
10815        }
10816
10817        unsafe fn decode(
10818            &mut self,
10819            decoder: &mut fidl::encoding::Decoder<'_, D>,
10820            offset: usize,
10821            mut depth: fidl::encoding::Depth,
10822        ) -> fidl::Result<()> {
10823            decoder.debug_check_bounds::<Self>(offset);
10824            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10825                None => return Err(fidl::Error::NotNullable),
10826                Some(len) => len,
10827            };
10828            // Calling decoder.out_of_line_offset(0) is not allowed.
10829            if len == 0 {
10830                return Ok(());
10831            };
10832            depth.increment()?;
10833            let envelope_size = 8;
10834            let bytes_len = len * envelope_size;
10835            let offset = decoder.out_of_line_offset(bytes_len)?;
10836            // Decode the envelope for each type.
10837            let mut _next_ordinal_to_read = 0;
10838            let mut next_offset = offset;
10839            let end_offset = offset + bytes_len;
10840            _next_ordinal_to_read += 1;
10841            if next_offset >= end_offset {
10842                return Ok(());
10843            }
10844
10845            // Decode unknown envelopes for gaps in ordinals.
10846            while _next_ordinal_to_read < 1 {
10847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10848                _next_ordinal_to_read += 1;
10849                next_offset += envelope_size;
10850            }
10851
10852            let next_out_of_line = decoder.next_out_of_line();
10853            let handles_before = decoder.remaining_handles();
10854            if let Some((inlined, num_bytes, num_handles)) =
10855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10856            {
10857                let member_inline_size =
10858                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10859                if inlined != (member_inline_size <= 4) {
10860                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10861                }
10862                let inner_offset;
10863                let mut inner_depth = depth.clone();
10864                if inlined {
10865                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10866                    inner_offset = next_offset;
10867                } else {
10868                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10869                    inner_depth.increment()?;
10870                }
10871                let val_ref = self.protocol_major.get_or_insert_with(|| fidl::new_empty!(u32, D));
10872                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10873                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10874                {
10875                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10876                }
10877                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10878                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10879                }
10880            }
10881
10882            next_offset += envelope_size;
10883            _next_ordinal_to_read += 1;
10884            if next_offset >= end_offset {
10885                return Ok(());
10886            }
10887
10888            // Decode unknown envelopes for gaps in ordinals.
10889            while _next_ordinal_to_read < 2 {
10890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10891                _next_ordinal_to_read += 1;
10892                next_offset += envelope_size;
10893            }
10894
10895            let next_out_of_line = decoder.next_out_of_line();
10896            let handles_before = decoder.remaining_handles();
10897            if let Some((inlined, num_bytes, num_handles)) =
10898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10899            {
10900                let member_inline_size =
10901                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10902                if inlined != (member_inline_size <= 4) {
10903                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10904                }
10905                let inner_offset;
10906                let mut inner_depth = depth.clone();
10907                if inlined {
10908                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10909                    inner_offset = next_offset;
10910                } else {
10911                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10912                    inner_depth.increment()?;
10913                }
10914                let val_ref = self.protocol_minor.get_or_insert_with(|| fidl::new_empty!(u32, D));
10915                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10916                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10917                {
10918                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10919                }
10920                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10921                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10922                }
10923            }
10924
10925            next_offset += envelope_size;
10926            _next_ordinal_to_read += 1;
10927            if next_offset >= end_offset {
10928                return Ok(());
10929            }
10930
10931            // Decode unknown envelopes for gaps in ordinals.
10932            while _next_ordinal_to_read < 3 {
10933                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10934                _next_ordinal_to_read += 1;
10935                next_offset += envelope_size;
10936            }
10937
10938            let next_out_of_line = decoder.next_out_of_line();
10939            let handles_before = decoder.remaining_handles();
10940            if let Some((inlined, num_bytes, num_handles)) =
10941                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10942            {
10943                let member_inline_size =
10944                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10945                if inlined != (member_inline_size <= 4) {
10946                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10947                }
10948                let inner_offset;
10949                let mut inner_depth = depth.clone();
10950                if inlined {
10951                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10952                    inner_offset = next_offset;
10953                } else {
10954                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10955                    inner_depth.increment()?;
10956                }
10957                let val_ref = self.proxy_generation.get_or_insert_with(|| fidl::new_empty!(u64, D));
10958                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10959                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10960                {
10961                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10962                }
10963                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10964                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10965                }
10966            }
10967
10968            next_offset += envelope_size;
10969            _next_ordinal_to_read += 1;
10970            if next_offset >= end_offset {
10971                return Ok(());
10972            }
10973
10974            // Decode unknown envelopes for gaps in ordinals.
10975            while _next_ordinal_to_read < 4 {
10976                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10977                _next_ordinal_to_read += 1;
10978                next_offset += envelope_size;
10979            }
10980
10981            let next_out_of_line = decoder.next_out_of_line();
10982            let handles_before = decoder.remaining_handles();
10983            if let Some((inlined, num_bytes, num_handles)) =
10984                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10985            {
10986                let member_inline_size =
10987                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
10988                        decoder.context,
10989                    );
10990                if inlined != (member_inline_size <= 4) {
10991                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10992                }
10993                let inner_offset;
10994                let mut inner_depth = depth.clone();
10995                if inlined {
10996                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10997                    inner_offset = next_offset;
10998                } else {
10999                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11000                    inner_depth.increment()?;
11001                }
11002                let val_ref = self
11003                    .boot_id
11004                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
11005                fidl::decode!(
11006                    fidl::encoding::BoundedString<128>,
11007                    D,
11008                    val_ref,
11009                    decoder,
11010                    inner_offset,
11011                    inner_depth
11012                )?;
11013                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11014                {
11015                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11016                }
11017                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11018                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11019                }
11020            }
11021
11022            next_offset += envelope_size;
11023            _next_ordinal_to_read += 1;
11024            if next_offset >= end_offset {
11025                return Ok(());
11026            }
11027
11028            // Decode unknown envelopes for gaps in ordinals.
11029            while _next_ordinal_to_read < 5 {
11030                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11031                _next_ordinal_to_read += 1;
11032                next_offset += envelope_size;
11033            }
11034
11035            let next_out_of_line = decoder.next_out_of_line();
11036            let handles_before = decoder.remaining_handles();
11037            if let Some((inlined, num_bytes, num_handles)) =
11038                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11039            {
11040                let member_inline_size =
11041                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
11042                        decoder.context,
11043                    );
11044                if inlined != (member_inline_size <= 4) {
11045                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11046                }
11047                let inner_offset;
11048                let mut inner_depth = depth.clone();
11049                if inlined {
11050                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11051                    inner_offset = next_offset;
11052                } else {
11053                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11054                    inner_depth.increment()?;
11055                }
11056                let val_ref = self
11057                    .resource_digest
11058                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
11059                fidl::decode!(
11060                    fidl::encoding::BoundedString<128>,
11061                    D,
11062                    val_ref,
11063                    decoder,
11064                    inner_offset,
11065                    inner_depth
11066                )?;
11067                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11068                {
11069                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11070                }
11071                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11072                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11073                }
11074            }
11075
11076            next_offset += envelope_size;
11077            _next_ordinal_to_read += 1;
11078            if next_offset >= end_offset {
11079                return Ok(());
11080            }
11081
11082            // Decode unknown envelopes for gaps in ordinals.
11083            while _next_ordinal_to_read < 6 {
11084                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11085                _next_ordinal_to_read += 1;
11086                next_offset += envelope_size;
11087            }
11088
11089            let next_out_of_line = decoder.next_out_of_line();
11090            let handles_before = decoder.remaining_handles();
11091            if let Some((inlined, num_bytes, num_handles)) =
11092                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11093            {
11094                let member_inline_size =
11095                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
11096                        decoder.context,
11097                    );
11098                if inlined != (member_inline_size <= 4) {
11099                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11100                }
11101                let inner_offset;
11102                let mut inner_depth = depth.clone();
11103                if inlined {
11104                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11105                    inner_offset = next_offset;
11106                } else {
11107                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11108                    inner_depth.increment()?;
11109                }
11110                let val_ref = self
11111                    .policy_digest
11112                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
11113                fidl::decode!(
11114                    fidl::encoding::BoundedString<128>,
11115                    D,
11116                    val_ref,
11117                    decoder,
11118                    inner_offset,
11119                    inner_depth
11120                )?;
11121                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11122                {
11123                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11124                }
11125                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11126                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11127                }
11128            }
11129
11130            next_offset += envelope_size;
11131            _next_ordinal_to_read += 1;
11132            if next_offset >= end_offset {
11133                return Ok(());
11134            }
11135
11136            // Decode unknown envelopes for gaps in ordinals.
11137            while _next_ordinal_to_read < 7 {
11138                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11139                _next_ordinal_to_read += 1;
11140                next_offset += envelope_size;
11141            }
11142
11143            let next_out_of_line = decoder.next_out_of_line();
11144            let handles_before = decoder.remaining_handles();
11145            if let Some((inlined, num_bytes, num_handles)) =
11146                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11147            {
11148                let member_inline_size = <fidl::encoding::Vector<ResourceDescription, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11149                if inlined != (member_inline_size <= 4) {
11150                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11151                }
11152                let inner_offset;
11153                let mut inner_depth = depth.clone();
11154                if inlined {
11155                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11156                    inner_offset = next_offset;
11157                } else {
11158                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11159                    inner_depth.increment()?;
11160                }
11161                let val_ref = self.resources.get_or_insert_with(
11162                    || fidl::new_empty!(fidl::encoding::Vector<ResourceDescription, 64>, D),
11163                );
11164                fidl::decode!(fidl::encoding::Vector<ResourceDescription, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
11165                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11166                {
11167                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11168                }
11169                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11170                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11171                }
11172            }
11173
11174            next_offset += envelope_size;
11175            _next_ordinal_to_read += 1;
11176            if next_offset >= end_offset {
11177                return Ok(());
11178            }
11179
11180            // Decode unknown envelopes for gaps in ordinals.
11181            while _next_ordinal_to_read < 8 {
11182                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11183                _next_ordinal_to_read += 1;
11184                next_offset += envelope_size;
11185            }
11186
11187            let next_out_of_line = decoder.next_out_of_line();
11188            let handles_before = decoder.remaining_handles();
11189            if let Some((inlined, num_bytes, num_handles)) =
11190                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11191            {
11192                let member_inline_size =
11193                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11194                if inlined != (member_inline_size <= 4) {
11195                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11196                }
11197                let inner_offset;
11198                let mut inner_depth = depth.clone();
11199                if inlined {
11200                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11201                    inner_offset = next_offset;
11202                } else {
11203                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11204                    inner_depth.increment()?;
11205                }
11206                let val_ref =
11207                    self.max_snapshot_items.get_or_insert_with(|| fidl::new_empty!(u32, D));
11208                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
11209                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11210                {
11211                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11212                }
11213                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11214                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11215                }
11216            }
11217
11218            next_offset += envelope_size;
11219            _next_ordinal_to_read += 1;
11220            if next_offset >= end_offset {
11221                return Ok(());
11222            }
11223
11224            // Decode unknown envelopes for gaps in ordinals.
11225            while _next_ordinal_to_read < 9 {
11226                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11227                _next_ordinal_to_read += 1;
11228                next_offset += envelope_size;
11229            }
11230
11231            let next_out_of_line = decoder.next_out_of_line();
11232            let handles_before = decoder.remaining_handles();
11233            if let Some((inlined, num_bytes, num_handles)) =
11234                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11235            {
11236                let member_inline_size =
11237                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11238                if inlined != (member_inline_size <= 4) {
11239                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11240                }
11241                let inner_offset;
11242                let mut inner_depth = depth.clone();
11243                if inlined {
11244                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11245                    inner_offset = next_offset;
11246                } else {
11247                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11248                    inner_depth.increment()?;
11249                }
11250                let val_ref = self.audit_capacity.get_or_insert_with(|| fidl::new_empty!(u64, D));
11251                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
11252                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11253                {
11254                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11255                }
11256                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11257                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11258                }
11259            }
11260
11261            next_offset += envelope_size;
11262            _next_ordinal_to_read += 1;
11263            if next_offset >= end_offset {
11264                return Ok(());
11265            }
11266
11267            // Decode unknown envelopes for gaps in ordinals.
11268            while _next_ordinal_to_read < 10 {
11269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11270                _next_ordinal_to_read += 1;
11271                next_offset += envelope_size;
11272            }
11273
11274            let next_out_of_line = decoder.next_out_of_line();
11275            let handles_before = decoder.remaining_handles();
11276            if let Some((inlined, num_bytes, num_handles)) =
11277                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11278            {
11279                let member_inline_size =
11280                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
11281                        decoder.context,
11282                    );
11283                if inlined != (member_inline_size <= 4) {
11284                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11285                }
11286                let inner_offset;
11287                let mut inner_depth = depth.clone();
11288                if inlined {
11289                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11290                    inner_offset = next_offset;
11291                } else {
11292                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11293                    inner_depth.increment()?;
11294                }
11295                let val_ref = self
11296                    .node_moniker
11297                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
11298                fidl::decode!(
11299                    fidl::encoding::BoundedString<128>,
11300                    D,
11301                    val_ref,
11302                    decoder,
11303                    inner_offset,
11304                    inner_depth
11305                )?;
11306                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11307                {
11308                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11309                }
11310                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11311                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11312                }
11313            }
11314
11315            next_offset += envelope_size;
11316            _next_ordinal_to_read += 1;
11317            if next_offset >= end_offset {
11318                return Ok(());
11319            }
11320
11321            // Decode unknown envelopes for gaps in ordinals.
11322            while _next_ordinal_to_read < 11 {
11323                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11324                _next_ordinal_to_read += 1;
11325                next_offset += envelope_size;
11326            }
11327
11328            let next_out_of_line = decoder.next_out_of_line();
11329            let handles_before = decoder.remaining_handles();
11330            if let Some((inlined, num_bytes, num_handles)) =
11331                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11332            {
11333                let member_inline_size =
11334                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11335                if inlined != (member_inline_size <= 4) {
11336                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11337                }
11338                let inner_offset;
11339                let mut inner_depth = depth.clone();
11340                if inlined {
11341                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11342                    inner_offset = next_offset;
11343                } else {
11344                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11345                    inner_depth.increment()?;
11346                }
11347                let val_ref =
11348                    self.topology_generation.get_or_insert_with(|| fidl::new_empty!(u64, D));
11349                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
11350                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11351                {
11352                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11353                }
11354                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11355                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11356                }
11357            }
11358
11359            next_offset += envelope_size;
11360            _next_ordinal_to_read += 1;
11361            if next_offset >= end_offset {
11362                return Ok(());
11363            }
11364
11365            // Decode unknown envelopes for gaps in ordinals.
11366            while _next_ordinal_to_read < 12 {
11367                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11368                _next_ordinal_to_read += 1;
11369                next_offset += envelope_size;
11370            }
11371
11372            let next_out_of_line = decoder.next_out_of_line();
11373            let handles_before = decoder.remaining_handles();
11374            if let Some((inlined, num_bytes, num_handles)) =
11375                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11376            {
11377                let member_inline_size =
11378                    <TakeoverState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11379                if inlined != (member_inline_size <= 4) {
11380                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11381                }
11382                let inner_offset;
11383                let mut inner_depth = depth.clone();
11384                if inlined {
11385                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11386                    inner_offset = next_offset;
11387                } else {
11388                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11389                    inner_depth.increment()?;
11390                }
11391                let val_ref =
11392                    self.takeover.get_or_insert_with(|| fidl::new_empty!(TakeoverState, D));
11393                fidl::decode!(TakeoverState, D, val_ref, decoder, inner_offset, inner_depth)?;
11394                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11395                {
11396                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11397                }
11398                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11399                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11400                }
11401            }
11402
11403            next_offset += envelope_size;
11404
11405            // Decode the remaining unknown envelopes.
11406            while next_offset < end_offset {
11407                _next_ordinal_to_read += 1;
11408                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11409                next_offset += envelope_size;
11410            }
11411
11412            Ok(())
11413        }
11414    }
11415
11416    impl ResourceDescription {
11417        #[inline(always)]
11418        fn max_ordinal_present(&self) -> u64 {
11419            if let Some(_) = self.digest {
11420                return 5;
11421            }
11422            if let Some(_) = self.logical_size {
11423                return 4;
11424            }
11425            if let Some(_) = self.kind {
11426                return 3;
11427            }
11428            if let Some(_) = self.name {
11429                return 2;
11430            }
11431            if let Some(_) = self.id {
11432                return 1;
11433            }
11434            0
11435        }
11436    }
11437
11438    impl fidl::encoding::ValueTypeMarker for ResourceDescription {
11439        type Borrowed<'a> = &'a Self;
11440        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11441            value
11442        }
11443    }
11444
11445    unsafe impl fidl::encoding::TypeMarker for ResourceDescription {
11446        type Owned = Self;
11447
11448        #[inline(always)]
11449        fn inline_align(_context: fidl::encoding::Context) -> usize {
11450            8
11451        }
11452
11453        #[inline(always)]
11454        fn inline_size(_context: fidl::encoding::Context) -> usize {
11455            16
11456        }
11457    }
11458
11459    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResourceDescription, D>
11460        for &ResourceDescription
11461    {
11462        unsafe fn encode(
11463            self,
11464            encoder: &mut fidl::encoding::Encoder<'_, D>,
11465            offset: usize,
11466            mut depth: fidl::encoding::Depth,
11467        ) -> fidl::Result<()> {
11468            encoder.debug_check_bounds::<ResourceDescription>(offset);
11469            // Vector header
11470            let max_ordinal: u64 = self.max_ordinal_present();
11471            encoder.write_num(max_ordinal, offset);
11472            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11473            // Calling encoder.out_of_line_offset(0) is not allowed.
11474            if max_ordinal == 0 {
11475                return Ok(());
11476            }
11477            depth.increment()?;
11478            let envelope_size = 8;
11479            let bytes_len = max_ordinal as usize * envelope_size;
11480            #[allow(unused_variables)]
11481            let offset = encoder.out_of_line_offset(bytes_len);
11482            let mut _prev_end_offset: usize = 0;
11483            if 1 > max_ordinal {
11484                return Ok(());
11485            }
11486
11487            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11488            // are envelope_size bytes.
11489            let cur_offset: usize = (1 - 1) * envelope_size;
11490
11491            // Zero reserved fields.
11492            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11493
11494            // Safety:
11495            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11496            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11497            //   envelope_size bytes, there is always sufficient room.
11498            fidl::encoding::encode_in_envelope_optional::<u32, D>(
11499                self.id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
11500                encoder,
11501                offset + cur_offset,
11502                depth,
11503            )?;
11504
11505            _prev_end_offset = cur_offset + envelope_size;
11506            if 2 > max_ordinal {
11507                return Ok(());
11508            }
11509
11510            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11511            // are envelope_size bytes.
11512            let cur_offset: usize = (2 - 1) * envelope_size;
11513
11514            // Zero reserved fields.
11515            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11516
11517            // Safety:
11518            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11519            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11520            //   envelope_size bytes, there is always sufficient room.
11521            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
11522                self.name.as_ref().map(
11523                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
11524                ),
11525                encoder,
11526                offset + cur_offset,
11527                depth,
11528            )?;
11529
11530            _prev_end_offset = cur_offset + envelope_size;
11531            if 3 > max_ordinal {
11532                return Ok(());
11533            }
11534
11535            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11536            // are envelope_size bytes.
11537            let cur_offset: usize = (3 - 1) * envelope_size;
11538
11539            // Zero reserved fields.
11540            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11541
11542            // Safety:
11543            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11544            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11545            //   envelope_size bytes, there is always sufficient room.
11546            fidl::encoding::encode_in_envelope_optional::<ResourceKind, D>(
11547                self.kind.as_ref().map(<ResourceKind as fidl::encoding::ValueTypeMarker>::borrow),
11548                encoder,
11549                offset + cur_offset,
11550                depth,
11551            )?;
11552
11553            _prev_end_offset = cur_offset + envelope_size;
11554            if 4 > max_ordinal {
11555                return Ok(());
11556            }
11557
11558            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11559            // are envelope_size bytes.
11560            let cur_offset: usize = (4 - 1) * envelope_size;
11561
11562            // Zero reserved fields.
11563            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11564
11565            // Safety:
11566            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11567            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11568            //   envelope_size bytes, there is always sufficient room.
11569            fidl::encoding::encode_in_envelope_optional::<u64, D>(
11570                self.logical_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
11571                encoder,
11572                offset + cur_offset,
11573                depth,
11574            )?;
11575
11576            _prev_end_offset = cur_offset + envelope_size;
11577            if 5 > max_ordinal {
11578                return Ok(());
11579            }
11580
11581            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11582            // are envelope_size bytes.
11583            let cur_offset: usize = (5 - 1) * envelope_size;
11584
11585            // Zero reserved fields.
11586            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11587
11588            // Safety:
11589            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11590            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11591            //   envelope_size bytes, there is always sufficient room.
11592            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
11593                self.digest.as_ref().map(
11594                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
11595                ),
11596                encoder,
11597                offset + cur_offset,
11598                depth,
11599            )?;
11600
11601            _prev_end_offset = cur_offset + envelope_size;
11602
11603            Ok(())
11604        }
11605    }
11606
11607    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResourceDescription {
11608        #[inline(always)]
11609        fn new_empty() -> Self {
11610            Self::default()
11611        }
11612
11613        unsafe fn decode(
11614            &mut self,
11615            decoder: &mut fidl::encoding::Decoder<'_, D>,
11616            offset: usize,
11617            mut depth: fidl::encoding::Depth,
11618        ) -> fidl::Result<()> {
11619            decoder.debug_check_bounds::<Self>(offset);
11620            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11621                None => return Err(fidl::Error::NotNullable),
11622                Some(len) => len,
11623            };
11624            // Calling decoder.out_of_line_offset(0) is not allowed.
11625            if len == 0 {
11626                return Ok(());
11627            };
11628            depth.increment()?;
11629            let envelope_size = 8;
11630            let bytes_len = len * envelope_size;
11631            let offset = decoder.out_of_line_offset(bytes_len)?;
11632            // Decode the envelope for each type.
11633            let mut _next_ordinal_to_read = 0;
11634            let mut next_offset = offset;
11635            let end_offset = offset + bytes_len;
11636            _next_ordinal_to_read += 1;
11637            if next_offset >= end_offset {
11638                return Ok(());
11639            }
11640
11641            // Decode unknown envelopes for gaps in ordinals.
11642            while _next_ordinal_to_read < 1 {
11643                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11644                _next_ordinal_to_read += 1;
11645                next_offset += envelope_size;
11646            }
11647
11648            let next_out_of_line = decoder.next_out_of_line();
11649            let handles_before = decoder.remaining_handles();
11650            if let Some((inlined, num_bytes, num_handles)) =
11651                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11652            {
11653                let member_inline_size =
11654                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11655                if inlined != (member_inline_size <= 4) {
11656                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11657                }
11658                let inner_offset;
11659                let mut inner_depth = depth.clone();
11660                if inlined {
11661                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11662                    inner_offset = next_offset;
11663                } else {
11664                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11665                    inner_depth.increment()?;
11666                }
11667                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u32, D));
11668                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
11669                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11670                {
11671                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11672                }
11673                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11674                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11675                }
11676            }
11677
11678            next_offset += envelope_size;
11679            _next_ordinal_to_read += 1;
11680            if next_offset >= end_offset {
11681                return Ok(());
11682            }
11683
11684            // Decode unknown envelopes for gaps in ordinals.
11685            while _next_ordinal_to_read < 2 {
11686                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11687                _next_ordinal_to_read += 1;
11688                next_offset += envelope_size;
11689            }
11690
11691            let next_out_of_line = decoder.next_out_of_line();
11692            let handles_before = decoder.remaining_handles();
11693            if let Some((inlined, num_bytes, num_handles)) =
11694                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11695            {
11696                let member_inline_size =
11697                    <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
11698                        decoder.context,
11699                    );
11700                if inlined != (member_inline_size <= 4) {
11701                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11702                }
11703                let inner_offset;
11704                let mut inner_depth = depth.clone();
11705                if inlined {
11706                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11707                    inner_offset = next_offset;
11708                } else {
11709                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11710                    inner_depth.increment()?;
11711                }
11712                let val_ref = self
11713                    .name
11714                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
11715                fidl::decode!(
11716                    fidl::encoding::BoundedString<64>,
11717                    D,
11718                    val_ref,
11719                    decoder,
11720                    inner_offset,
11721                    inner_depth
11722                )?;
11723                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11724                {
11725                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11726                }
11727                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11728                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11729                }
11730            }
11731
11732            next_offset += envelope_size;
11733            _next_ordinal_to_read += 1;
11734            if next_offset >= end_offset {
11735                return Ok(());
11736            }
11737
11738            // Decode unknown envelopes for gaps in ordinals.
11739            while _next_ordinal_to_read < 3 {
11740                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11741                _next_ordinal_to_read += 1;
11742                next_offset += envelope_size;
11743            }
11744
11745            let next_out_of_line = decoder.next_out_of_line();
11746            let handles_before = decoder.remaining_handles();
11747            if let Some((inlined, num_bytes, num_handles)) =
11748                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11749            {
11750                let member_inline_size =
11751                    <ResourceKind as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11752                if inlined != (member_inline_size <= 4) {
11753                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11754                }
11755                let inner_offset;
11756                let mut inner_depth = depth.clone();
11757                if inlined {
11758                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11759                    inner_offset = next_offset;
11760                } else {
11761                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11762                    inner_depth.increment()?;
11763                }
11764                let val_ref = self.kind.get_or_insert_with(|| fidl::new_empty!(ResourceKind, D));
11765                fidl::decode!(ResourceKind, D, val_ref, decoder, inner_offset, inner_depth)?;
11766                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11767                {
11768                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11769                }
11770                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11771                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11772                }
11773            }
11774
11775            next_offset += envelope_size;
11776            _next_ordinal_to_read += 1;
11777            if next_offset >= end_offset {
11778                return Ok(());
11779            }
11780
11781            // Decode unknown envelopes for gaps in ordinals.
11782            while _next_ordinal_to_read < 4 {
11783                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11784                _next_ordinal_to_read += 1;
11785                next_offset += envelope_size;
11786            }
11787
11788            let next_out_of_line = decoder.next_out_of_line();
11789            let handles_before = decoder.remaining_handles();
11790            if let Some((inlined, num_bytes, num_handles)) =
11791                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11792            {
11793                let member_inline_size =
11794                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11795                if inlined != (member_inline_size <= 4) {
11796                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11797                }
11798                let inner_offset;
11799                let mut inner_depth = depth.clone();
11800                if inlined {
11801                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11802                    inner_offset = next_offset;
11803                } else {
11804                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11805                    inner_depth.increment()?;
11806                }
11807                let val_ref = self.logical_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
11808                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
11809                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11810                {
11811                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11812                }
11813                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11814                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11815                }
11816            }
11817
11818            next_offset += envelope_size;
11819            _next_ordinal_to_read += 1;
11820            if next_offset >= end_offset {
11821                return Ok(());
11822            }
11823
11824            // Decode unknown envelopes for gaps in ordinals.
11825            while _next_ordinal_to_read < 5 {
11826                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11827                _next_ordinal_to_read += 1;
11828                next_offset += envelope_size;
11829            }
11830
11831            let next_out_of_line = decoder.next_out_of_line();
11832            let handles_before = decoder.remaining_handles();
11833            if let Some((inlined, num_bytes, num_handles)) =
11834                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11835            {
11836                let member_inline_size =
11837                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
11838                        decoder.context,
11839                    );
11840                if inlined != (member_inline_size <= 4) {
11841                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11842                }
11843                let inner_offset;
11844                let mut inner_depth = depth.clone();
11845                if inlined {
11846                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11847                    inner_offset = next_offset;
11848                } else {
11849                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11850                    inner_depth.increment()?;
11851                }
11852                let val_ref = self
11853                    .digest
11854                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
11855                fidl::decode!(
11856                    fidl::encoding::BoundedString<128>,
11857                    D,
11858                    val_ref,
11859                    decoder,
11860                    inner_offset,
11861                    inner_depth
11862                )?;
11863                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11864                {
11865                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11866                }
11867                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11868                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11869                }
11870            }
11871
11872            next_offset += envelope_size;
11873
11874            // Decode the remaining unknown envelopes.
11875            while next_offset < end_offset {
11876                _next_ordinal_to_read += 1;
11877                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11878                next_offset += envelope_size;
11879            }
11880
11881            Ok(())
11882        }
11883    }
11884
11885    impl RunContext {
11886        #[inline(always)]
11887        fn max_ordinal_present(&self) -> u64 {
11888            if let Some(_) = self.host_tool_version {
11889                return 4;
11890            }
11891            if let Some(_) = self.plan_digest {
11892                return 3;
11893            }
11894            if let Some(_) = self.case_id {
11895                return 2;
11896            }
11897            if let Some(_) = self.run_id {
11898                return 1;
11899            }
11900            0
11901        }
11902    }
11903
11904    impl fidl::encoding::ValueTypeMarker for RunContext {
11905        type Borrowed<'a> = &'a Self;
11906        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11907            value
11908        }
11909    }
11910
11911    unsafe impl fidl::encoding::TypeMarker for RunContext {
11912        type Owned = Self;
11913
11914        #[inline(always)]
11915        fn inline_align(_context: fidl::encoding::Context) -> usize {
11916            8
11917        }
11918
11919        #[inline(always)]
11920        fn inline_size(_context: fidl::encoding::Context) -> usize {
11921            16
11922        }
11923    }
11924
11925    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RunContext, D>
11926        for &RunContext
11927    {
11928        unsafe fn encode(
11929            self,
11930            encoder: &mut fidl::encoding::Encoder<'_, D>,
11931            offset: usize,
11932            mut depth: fidl::encoding::Depth,
11933        ) -> fidl::Result<()> {
11934            encoder.debug_check_bounds::<RunContext>(offset);
11935            // Vector header
11936            let max_ordinal: u64 = self.max_ordinal_present();
11937            encoder.write_num(max_ordinal, offset);
11938            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11939            // Calling encoder.out_of_line_offset(0) is not allowed.
11940            if max_ordinal == 0 {
11941                return Ok(());
11942            }
11943            depth.increment()?;
11944            let envelope_size = 8;
11945            let bytes_len = max_ordinal as usize * envelope_size;
11946            #[allow(unused_variables)]
11947            let offset = encoder.out_of_line_offset(bytes_len);
11948            let mut _prev_end_offset: usize = 0;
11949            if 1 > max_ordinal {
11950                return Ok(());
11951            }
11952
11953            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11954            // are envelope_size bytes.
11955            let cur_offset: usize = (1 - 1) * envelope_size;
11956
11957            // Zero reserved fields.
11958            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11959
11960            // Safety:
11961            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11962            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11963            //   envelope_size bytes, there is always sufficient room.
11964            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
11965                self.run_id.as_ref().map(
11966                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
11967                ),
11968                encoder,
11969                offset + cur_offset,
11970                depth,
11971            )?;
11972
11973            _prev_end_offset = cur_offset + envelope_size;
11974            if 2 > max_ordinal {
11975                return Ok(());
11976            }
11977
11978            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11979            // are envelope_size bytes.
11980            let cur_offset: usize = (2 - 1) * envelope_size;
11981
11982            // Zero reserved fields.
11983            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11984
11985            // Safety:
11986            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11987            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11988            //   envelope_size bytes, there is always sufficient room.
11989            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
11990                self.case_id.as_ref().map(
11991                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
11992                ),
11993                encoder,
11994                offset + cur_offset,
11995                depth,
11996            )?;
11997
11998            _prev_end_offset = cur_offset + envelope_size;
11999            if 3 > max_ordinal {
12000                return Ok(());
12001            }
12002
12003            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12004            // are envelope_size bytes.
12005            let cur_offset: usize = (3 - 1) * envelope_size;
12006
12007            // Zero reserved fields.
12008            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12009
12010            // Safety:
12011            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12012            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12013            //   envelope_size bytes, there is always sufficient room.
12014            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
12015                self.plan_digest.as_ref().map(
12016                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
12017                ),
12018                encoder,
12019                offset + cur_offset,
12020                depth,
12021            )?;
12022
12023            _prev_end_offset = cur_offset + envelope_size;
12024            if 4 > max_ordinal {
12025                return Ok(());
12026            }
12027
12028            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12029            // are envelope_size bytes.
12030            let cur_offset: usize = (4 - 1) * envelope_size;
12031
12032            // Zero reserved fields.
12033            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12034
12035            // Safety:
12036            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12037            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12038            //   envelope_size bytes, there is always sufficient room.
12039            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<128>, D>(
12040                self.host_tool_version.as_ref().map(
12041                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow,
12042                ),
12043                encoder,
12044                offset + cur_offset,
12045                depth,
12046            )?;
12047
12048            _prev_end_offset = cur_offset + envelope_size;
12049
12050            Ok(())
12051        }
12052    }
12053
12054    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RunContext {
12055        #[inline(always)]
12056        fn new_empty() -> Self {
12057            Self::default()
12058        }
12059
12060        unsafe fn decode(
12061            &mut self,
12062            decoder: &mut fidl::encoding::Decoder<'_, D>,
12063            offset: usize,
12064            mut depth: fidl::encoding::Depth,
12065        ) -> fidl::Result<()> {
12066            decoder.debug_check_bounds::<Self>(offset);
12067            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12068                None => return Err(fidl::Error::NotNullable),
12069                Some(len) => len,
12070            };
12071            // Calling decoder.out_of_line_offset(0) is not allowed.
12072            if len == 0 {
12073                return Ok(());
12074            };
12075            depth.increment()?;
12076            let envelope_size = 8;
12077            let bytes_len = len * envelope_size;
12078            let offset = decoder.out_of_line_offset(bytes_len)?;
12079            // Decode the envelope for each type.
12080            let mut _next_ordinal_to_read = 0;
12081            let mut next_offset = offset;
12082            let end_offset = offset + bytes_len;
12083            _next_ordinal_to_read += 1;
12084            if next_offset >= end_offset {
12085                return Ok(());
12086            }
12087
12088            // Decode unknown envelopes for gaps in ordinals.
12089            while _next_ordinal_to_read < 1 {
12090                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12091                _next_ordinal_to_read += 1;
12092                next_offset += envelope_size;
12093            }
12094
12095            let next_out_of_line = decoder.next_out_of_line();
12096            let handles_before = decoder.remaining_handles();
12097            if let Some((inlined, num_bytes, num_handles)) =
12098                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12099            {
12100                let member_inline_size =
12101                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
12102                        decoder.context,
12103                    );
12104                if inlined != (member_inline_size <= 4) {
12105                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12106                }
12107                let inner_offset;
12108                let mut inner_depth = depth.clone();
12109                if inlined {
12110                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12111                    inner_offset = next_offset;
12112                } else {
12113                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12114                    inner_depth.increment()?;
12115                }
12116                let val_ref = self
12117                    .run_id
12118                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
12119                fidl::decode!(
12120                    fidl::encoding::BoundedString<128>,
12121                    D,
12122                    val_ref,
12123                    decoder,
12124                    inner_offset,
12125                    inner_depth
12126                )?;
12127                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12128                {
12129                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12130                }
12131                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12132                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12133                }
12134            }
12135
12136            next_offset += envelope_size;
12137            _next_ordinal_to_read += 1;
12138            if next_offset >= end_offset {
12139                return Ok(());
12140            }
12141
12142            // Decode unknown envelopes for gaps in ordinals.
12143            while _next_ordinal_to_read < 2 {
12144                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12145                _next_ordinal_to_read += 1;
12146                next_offset += envelope_size;
12147            }
12148
12149            let next_out_of_line = decoder.next_out_of_line();
12150            let handles_before = decoder.remaining_handles();
12151            if let Some((inlined, num_bytes, num_handles)) =
12152                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12153            {
12154                let member_inline_size =
12155                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
12156                        decoder.context,
12157                    );
12158                if inlined != (member_inline_size <= 4) {
12159                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12160                }
12161                let inner_offset;
12162                let mut inner_depth = depth.clone();
12163                if inlined {
12164                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12165                    inner_offset = next_offset;
12166                } else {
12167                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12168                    inner_depth.increment()?;
12169                }
12170                let val_ref = self
12171                    .case_id
12172                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
12173                fidl::decode!(
12174                    fidl::encoding::BoundedString<128>,
12175                    D,
12176                    val_ref,
12177                    decoder,
12178                    inner_offset,
12179                    inner_depth
12180                )?;
12181                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12182                {
12183                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12184                }
12185                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12186                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12187                }
12188            }
12189
12190            next_offset += envelope_size;
12191            _next_ordinal_to_read += 1;
12192            if next_offset >= end_offset {
12193                return Ok(());
12194            }
12195
12196            // Decode unknown envelopes for gaps in ordinals.
12197            while _next_ordinal_to_read < 3 {
12198                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12199                _next_ordinal_to_read += 1;
12200                next_offset += envelope_size;
12201            }
12202
12203            let next_out_of_line = decoder.next_out_of_line();
12204            let handles_before = decoder.remaining_handles();
12205            if let Some((inlined, num_bytes, num_handles)) =
12206                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12207            {
12208                let member_inline_size =
12209                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
12210                        decoder.context,
12211                    );
12212                if inlined != (member_inline_size <= 4) {
12213                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12214                }
12215                let inner_offset;
12216                let mut inner_depth = depth.clone();
12217                if inlined {
12218                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12219                    inner_offset = next_offset;
12220                } else {
12221                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12222                    inner_depth.increment()?;
12223                }
12224                let val_ref = self
12225                    .plan_digest
12226                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
12227                fidl::decode!(
12228                    fidl::encoding::BoundedString<128>,
12229                    D,
12230                    val_ref,
12231                    decoder,
12232                    inner_offset,
12233                    inner_depth
12234                )?;
12235                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12236                {
12237                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12238                }
12239                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12240                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12241                }
12242            }
12243
12244            next_offset += envelope_size;
12245            _next_ordinal_to_read += 1;
12246            if next_offset >= end_offset {
12247                return Ok(());
12248            }
12249
12250            // Decode unknown envelopes for gaps in ordinals.
12251            while _next_ordinal_to_read < 4 {
12252                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12253                _next_ordinal_to_read += 1;
12254                next_offset += envelope_size;
12255            }
12256
12257            let next_out_of_line = decoder.next_out_of_line();
12258            let handles_before = decoder.remaining_handles();
12259            if let Some((inlined, num_bytes, num_handles)) =
12260                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12261            {
12262                let member_inline_size =
12263                    <fidl::encoding::BoundedString<128> as fidl::encoding::TypeMarker>::inline_size(
12264                        decoder.context,
12265                    );
12266                if inlined != (member_inline_size <= 4) {
12267                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12268                }
12269                let inner_offset;
12270                let mut inner_depth = depth.clone();
12271                if inlined {
12272                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12273                    inner_offset = next_offset;
12274                } else {
12275                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12276                    inner_depth.increment()?;
12277                }
12278                let val_ref = self
12279                    .host_tool_version
12280                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<128>, D));
12281                fidl::decode!(
12282                    fidl::encoding::BoundedString<128>,
12283                    D,
12284                    val_ref,
12285                    decoder,
12286                    inner_offset,
12287                    inner_depth
12288                )?;
12289                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12290                {
12291                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12292                }
12293                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12294                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12295                }
12296            }
12297
12298            next_offset += envelope_size;
12299
12300            // Decode the remaining unknown envelopes.
12301            while next_offset < end_offset {
12302                _next_ordinal_to_read += 1;
12303                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12304                next_offset += envelope_size;
12305            }
12306
12307            Ok(())
12308        }
12309    }
12310
12311    impl fidl::encoding::ValueTypeMarker for SequenceItem {
12312        type Borrowed<'a> = &'a Self;
12313        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12314            value
12315        }
12316    }
12317
12318    unsafe impl fidl::encoding::TypeMarker for SequenceItem {
12319        type Owned = Self;
12320
12321        #[inline(always)]
12322        fn inline_align(_context: fidl::encoding::Context) -> usize {
12323            8
12324        }
12325
12326        #[inline(always)]
12327        fn inline_size(_context: fidl::encoding::Context) -> usize {
12328            16
12329        }
12330    }
12331
12332    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SequenceItem, D>
12333        for &SequenceItem
12334    {
12335        #[inline]
12336        unsafe fn encode(
12337            self,
12338            encoder: &mut fidl::encoding::Encoder<'_, D>,
12339            offset: usize,
12340            _depth: fidl::encoding::Depth,
12341        ) -> fidl::Result<()> {
12342            encoder.debug_check_bounds::<SequenceItem>(offset);
12343            encoder.write_num::<u64>(self.ordinal(), offset);
12344            match self {
12345                SequenceItem::Read32(ref val) => fidl::encoding::encode_in_envelope::<Read32, D>(
12346                    <Read32 as fidl::encoding::ValueTypeMarker>::borrow(val),
12347                    encoder,
12348                    offset + 8,
12349                    _depth,
12350                ),
12351                SequenceItem::Write32(ref val) => fidl::encoding::encode_in_envelope::<Write32, D>(
12352                    <Write32 as fidl::encoding::ValueTypeMarker>::borrow(val),
12353                    encoder,
12354                    offset + 8,
12355                    _depth,
12356                ),
12357                SequenceItem::Poll32(ref val) => fidl::encoding::encode_in_envelope::<Poll32, D>(
12358                    <Poll32 as fidl::encoding::ValueTypeMarker>::borrow(val),
12359                    encoder,
12360                    offset + 8,
12361                    _depth,
12362                ),
12363                SequenceItem::DelayNs(ref val) => fidl::encoding::encode_in_envelope::<i64, D>(
12364                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
12365                    encoder,
12366                    offset + 8,
12367                    _depth,
12368                ),
12369                SequenceItem::Barrier(ref val) => {
12370                    fidl::encoding::encode_in_envelope::<BarrierVariant, D>(
12371                        <BarrierVariant as fidl::encoding::ValueTypeMarker>::borrow(val),
12372                        encoder,
12373                        offset + 8,
12374                        _depth,
12375                    )
12376                }
12377                SequenceItem::GpioRead(ref val) => {
12378                    fidl::encoding::encode_in_envelope::<GpioRead, D>(
12379                        <GpioRead as fidl::encoding::ValueTypeMarker>::borrow(val),
12380                        encoder,
12381                        offset + 8,
12382                        _depth,
12383                    )
12384                }
12385                SequenceItem::GpioWrite(ref val) => {
12386                    fidl::encoding::encode_in_envelope::<GpioWrite, D>(
12387                        <GpioWrite as fidl::encoding::ValueTypeMarker>::borrow(val),
12388                        encoder,
12389                        offset + 8,
12390                        _depth,
12391                    )
12392                }
12393                SequenceItem::I2cTransfer(ref val) => {
12394                    fidl::encoding::encode_in_envelope::<I2cTransfer, D>(
12395                        <I2cTransfer as fidl::encoding::ValueTypeMarker>::borrow(val),
12396                        encoder,
12397                        offset + 8,
12398                        _depth,
12399                    )
12400                }
12401                SequenceItem::SpiTransmit(ref val) => {
12402                    fidl::encoding::encode_in_envelope::<SpiTransmit, D>(
12403                        <SpiTransmit as fidl::encoding::ValueTypeMarker>::borrow(val),
12404                        encoder,
12405                        offset + 8,
12406                        _depth,
12407                    )
12408                }
12409                SequenceItem::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12410            }
12411        }
12412    }
12413
12414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SequenceItem {
12415        #[inline(always)]
12416        fn new_empty() -> Self {
12417            Self::__SourceBreaking { unknown_ordinal: 0 }
12418        }
12419
12420        #[inline]
12421        unsafe fn decode(
12422            &mut self,
12423            decoder: &mut fidl::encoding::Decoder<'_, D>,
12424            offset: usize,
12425            mut depth: fidl::encoding::Depth,
12426        ) -> fidl::Result<()> {
12427            decoder.debug_check_bounds::<Self>(offset);
12428            #[allow(unused_variables)]
12429            let next_out_of_line = decoder.next_out_of_line();
12430            let handles_before = decoder.remaining_handles();
12431            let (ordinal, inlined, num_bytes, num_handles) =
12432                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12433
12434            let member_inline_size = match ordinal {
12435                1 => <Read32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12436                2 => <Write32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12437                3 => <Poll32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12438                4 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12439                5 => <BarrierVariant as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12440                6 => <GpioRead as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12441                7 => <GpioWrite as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12442                8 => <I2cTransfer as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12443                9 => <SpiTransmit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12444                0 => return Err(fidl::Error::UnknownUnionTag),
12445                _ => num_bytes as usize,
12446            };
12447
12448            if inlined != (member_inline_size <= 4) {
12449                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12450            }
12451            let _inner_offset;
12452            if inlined {
12453                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12454                _inner_offset = offset + 8;
12455            } else {
12456                depth.increment()?;
12457                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12458            }
12459            match ordinal {
12460                1 => {
12461                    #[allow(irrefutable_let_patterns)]
12462                    if let SequenceItem::Read32(_) = self {
12463                        // Do nothing, read the value into the object
12464                    } else {
12465                        // Initialize `self` to the right variant
12466                        *self = SequenceItem::Read32(fidl::new_empty!(Read32, D));
12467                    }
12468                    #[allow(irrefutable_let_patterns)]
12469                    if let SequenceItem::Read32(ref mut val) = self {
12470                        fidl::decode!(Read32, D, val, decoder, _inner_offset, depth)?;
12471                    } else {
12472                        unreachable!()
12473                    }
12474                }
12475                2 => {
12476                    #[allow(irrefutable_let_patterns)]
12477                    if let SequenceItem::Write32(_) = self {
12478                        // Do nothing, read the value into the object
12479                    } else {
12480                        // Initialize `self` to the right variant
12481                        *self = SequenceItem::Write32(fidl::new_empty!(Write32, D));
12482                    }
12483                    #[allow(irrefutable_let_patterns)]
12484                    if let SequenceItem::Write32(ref mut val) = self {
12485                        fidl::decode!(Write32, D, val, decoder, _inner_offset, depth)?;
12486                    } else {
12487                        unreachable!()
12488                    }
12489                }
12490                3 => {
12491                    #[allow(irrefutable_let_patterns)]
12492                    if let SequenceItem::Poll32(_) = self {
12493                        // Do nothing, read the value into the object
12494                    } else {
12495                        // Initialize `self` to the right variant
12496                        *self = SequenceItem::Poll32(fidl::new_empty!(Poll32, D));
12497                    }
12498                    #[allow(irrefutable_let_patterns)]
12499                    if let SequenceItem::Poll32(ref mut val) = self {
12500                        fidl::decode!(Poll32, D, val, decoder, _inner_offset, depth)?;
12501                    } else {
12502                        unreachable!()
12503                    }
12504                }
12505                4 => {
12506                    #[allow(irrefutable_let_patterns)]
12507                    if let SequenceItem::DelayNs(_) = self {
12508                        // Do nothing, read the value into the object
12509                    } else {
12510                        // Initialize `self` to the right variant
12511                        *self = SequenceItem::DelayNs(fidl::new_empty!(i64, D));
12512                    }
12513                    #[allow(irrefutable_let_patterns)]
12514                    if let SequenceItem::DelayNs(ref mut val) = self {
12515                        fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
12516                    } else {
12517                        unreachable!()
12518                    }
12519                }
12520                5 => {
12521                    #[allow(irrefutable_let_patterns)]
12522                    if let SequenceItem::Barrier(_) = self {
12523                        // Do nothing, read the value into the object
12524                    } else {
12525                        // Initialize `self` to the right variant
12526                        *self = SequenceItem::Barrier(fidl::new_empty!(BarrierVariant, D));
12527                    }
12528                    #[allow(irrefutable_let_patterns)]
12529                    if let SequenceItem::Barrier(ref mut val) = self {
12530                        fidl::decode!(BarrierVariant, D, val, decoder, _inner_offset, depth)?;
12531                    } else {
12532                        unreachable!()
12533                    }
12534                }
12535                6 => {
12536                    #[allow(irrefutable_let_patterns)]
12537                    if let SequenceItem::GpioRead(_) = self {
12538                        // Do nothing, read the value into the object
12539                    } else {
12540                        // Initialize `self` to the right variant
12541                        *self = SequenceItem::GpioRead(fidl::new_empty!(GpioRead, D));
12542                    }
12543                    #[allow(irrefutable_let_patterns)]
12544                    if let SequenceItem::GpioRead(ref mut val) = self {
12545                        fidl::decode!(GpioRead, D, val, decoder, _inner_offset, depth)?;
12546                    } else {
12547                        unreachable!()
12548                    }
12549                }
12550                7 => {
12551                    #[allow(irrefutable_let_patterns)]
12552                    if let SequenceItem::GpioWrite(_) = self {
12553                        // Do nothing, read the value into the object
12554                    } else {
12555                        // Initialize `self` to the right variant
12556                        *self = SequenceItem::GpioWrite(fidl::new_empty!(GpioWrite, D));
12557                    }
12558                    #[allow(irrefutable_let_patterns)]
12559                    if let SequenceItem::GpioWrite(ref mut val) = self {
12560                        fidl::decode!(GpioWrite, D, val, decoder, _inner_offset, depth)?;
12561                    } else {
12562                        unreachable!()
12563                    }
12564                }
12565                8 => {
12566                    #[allow(irrefutable_let_patterns)]
12567                    if let SequenceItem::I2cTransfer(_) = self {
12568                        // Do nothing, read the value into the object
12569                    } else {
12570                        // Initialize `self` to the right variant
12571                        *self = SequenceItem::I2cTransfer(fidl::new_empty!(I2cTransfer, D));
12572                    }
12573                    #[allow(irrefutable_let_patterns)]
12574                    if let SequenceItem::I2cTransfer(ref mut val) = self {
12575                        fidl::decode!(I2cTransfer, D, val, decoder, _inner_offset, depth)?;
12576                    } else {
12577                        unreachable!()
12578                    }
12579                }
12580                9 => {
12581                    #[allow(irrefutable_let_patterns)]
12582                    if let SequenceItem::SpiTransmit(_) = self {
12583                        // Do nothing, read the value into the object
12584                    } else {
12585                        // Initialize `self` to the right variant
12586                        *self = SequenceItem::SpiTransmit(fidl::new_empty!(SpiTransmit, D));
12587                    }
12588                    #[allow(irrefutable_let_patterns)]
12589                    if let SequenceItem::SpiTransmit(ref mut val) = self {
12590                        fidl::decode!(SpiTransmit, D, val, decoder, _inner_offset, depth)?;
12591                    } else {
12592                        unreachable!()
12593                    }
12594                }
12595                #[allow(deprecated)]
12596                ordinal => {
12597                    for _ in 0..num_handles {
12598                        decoder.drop_next_handle()?;
12599                    }
12600                    *self = SequenceItem::__SourceBreaking { unknown_ordinal: ordinal };
12601                }
12602            }
12603            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12604                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12605            }
12606            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12607                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12608            }
12609            Ok(())
12610        }
12611    }
12612
12613    impl fidl::encoding::ValueTypeMarker for SequenceItemOutcome {
12614        type Borrowed<'a> = &'a Self;
12615        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12616            value
12617        }
12618    }
12619
12620    unsafe impl fidl::encoding::TypeMarker for SequenceItemOutcome {
12621        type Owned = Self;
12622
12623        #[inline(always)]
12624        fn inline_align(_context: fidl::encoding::Context) -> usize {
12625            8
12626        }
12627
12628        #[inline(always)]
12629        fn inline_size(_context: fidl::encoding::Context) -> usize {
12630            16
12631        }
12632    }
12633
12634    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SequenceItemOutcome, D>
12635        for &SequenceItemOutcome
12636    {
12637        #[inline]
12638        unsafe fn encode(
12639            self,
12640            encoder: &mut fidl::encoding::Encoder<'_, D>,
12641            offset: usize,
12642            _depth: fidl::encoding::Depth,
12643        ) -> fidl::Result<()> {
12644            encoder.debug_check_bounds::<SequenceItemOutcome>(offset);
12645            encoder.write_num::<u64>(self.ordinal(), offset);
12646            match self {
12647                SequenceItemOutcome::Read32(ref val) => {
12648                    fidl::encoding::encode_in_envelope::<ReadResult, D>(
12649                        <ReadResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12650                        encoder,
12651                        offset + 8,
12652                        _depth,
12653                    )
12654                }
12655                SequenceItemOutcome::Write32(ref val) => {
12656                    fidl::encoding::encode_in_envelope::<WriteResult, D>(
12657                        <WriteResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12658                        encoder,
12659                        offset + 8,
12660                        _depth,
12661                    )
12662                }
12663                SequenceItemOutcome::Poll32(ref val) => {
12664                    fidl::encoding::encode_in_envelope::<PollResult, D>(
12665                        <PollResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12666                        encoder,
12667                        offset + 8,
12668                        _depth,
12669                    )
12670                }
12671                SequenceItemOutcome::DelayNs(ref val) => {
12672                    fidl::encoding::encode_in_envelope::<DelayNs, D>(
12673                        <DelayNs as fidl::encoding::ValueTypeMarker>::borrow(val),
12674                        encoder,
12675                        offset + 8,
12676                        _depth,
12677                    )
12678                }
12679                SequenceItemOutcome::Barrier(ref val) => {
12680                    fidl::encoding::encode_in_envelope::<Barrier, D>(
12681                        <Barrier as fidl::encoding::ValueTypeMarker>::borrow(val),
12682                        encoder,
12683                        offset + 8,
12684                        _depth,
12685                    )
12686                }
12687                SequenceItemOutcome::Error(ref val) => {
12688                    fidl::encoding::encode_in_envelope::<OperationError, D>(
12689                        <OperationError as fidl::encoding::ValueTypeMarker>::borrow(val),
12690                        encoder,
12691                        offset + 8,
12692                        _depth,
12693                    )
12694                }
12695                SequenceItemOutcome::GpioRead(ref val) => {
12696                    fidl::encoding::encode_in_envelope::<GpioReadResult, D>(
12697                        <GpioReadResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12698                        encoder,
12699                        offset + 8,
12700                        _depth,
12701                    )
12702                }
12703                SequenceItemOutcome::GpioWrite(ref val) => {
12704                    fidl::encoding::encode_in_envelope::<GpioWriteResult, D>(
12705                        <GpioWriteResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12706                        encoder,
12707                        offset + 8,
12708                        _depth,
12709                    )
12710                }
12711                SequenceItemOutcome::I2cTransfer(ref val) => {
12712                    fidl::encoding::encode_in_envelope::<I2cTransferResult, D>(
12713                        <I2cTransferResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12714                        encoder,
12715                        offset + 8,
12716                        _depth,
12717                    )
12718                }
12719                SequenceItemOutcome::SpiTransmit(ref val) => {
12720                    fidl::encoding::encode_in_envelope::<SpiTransmitResult, D>(
12721                        <SpiTransmitResult as fidl::encoding::ValueTypeMarker>::borrow(val),
12722                        encoder,
12723                        offset + 8,
12724                        _depth,
12725                    )
12726                }
12727                SequenceItemOutcome::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12728            }
12729        }
12730    }
12731
12732    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SequenceItemOutcome {
12733        #[inline(always)]
12734        fn new_empty() -> Self {
12735            Self::__SourceBreaking { unknown_ordinal: 0 }
12736        }
12737
12738        #[inline]
12739        unsafe fn decode(
12740            &mut self,
12741            decoder: &mut fidl::encoding::Decoder<'_, D>,
12742            offset: usize,
12743            mut depth: fidl::encoding::Depth,
12744        ) -> fidl::Result<()> {
12745            decoder.debug_check_bounds::<Self>(offset);
12746            #[allow(unused_variables)]
12747            let next_out_of_line = decoder.next_out_of_line();
12748            let handles_before = decoder.remaining_handles();
12749            let (ordinal, inlined, num_bytes, num_handles) =
12750                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12751
12752            let member_inline_size = match ordinal {
12753                1 => <ReadResult as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12754                2 => <WriteResult as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12755                3 => <PollResult as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12756                4 => <DelayNs as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12757                5 => <Barrier as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12758                6 => <OperationError as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12759                7 => <GpioReadResult as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12760                8 => <GpioWriteResult as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12761                9 => {
12762                    <I2cTransferResult as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12763                }
12764                10 => {
12765                    <SpiTransmitResult as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12766                }
12767                0 => return Err(fidl::Error::UnknownUnionTag),
12768                _ => num_bytes as usize,
12769            };
12770
12771            if inlined != (member_inline_size <= 4) {
12772                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12773            }
12774            let _inner_offset;
12775            if inlined {
12776                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12777                _inner_offset = offset + 8;
12778            } else {
12779                depth.increment()?;
12780                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12781            }
12782            match ordinal {
12783                1 => {
12784                    #[allow(irrefutable_let_patterns)]
12785                    if let SequenceItemOutcome::Read32(_) = self {
12786                        // Do nothing, read the value into the object
12787                    } else {
12788                        // Initialize `self` to the right variant
12789                        *self = SequenceItemOutcome::Read32(fidl::new_empty!(ReadResult, D));
12790                    }
12791                    #[allow(irrefutable_let_patterns)]
12792                    if let SequenceItemOutcome::Read32(ref mut val) = self {
12793                        fidl::decode!(ReadResult, D, val, decoder, _inner_offset, depth)?;
12794                    } else {
12795                        unreachable!()
12796                    }
12797                }
12798                2 => {
12799                    #[allow(irrefutable_let_patterns)]
12800                    if let SequenceItemOutcome::Write32(_) = self {
12801                        // Do nothing, read the value into the object
12802                    } else {
12803                        // Initialize `self` to the right variant
12804                        *self = SequenceItemOutcome::Write32(fidl::new_empty!(WriteResult, D));
12805                    }
12806                    #[allow(irrefutable_let_patterns)]
12807                    if let SequenceItemOutcome::Write32(ref mut val) = self {
12808                        fidl::decode!(WriteResult, D, val, decoder, _inner_offset, depth)?;
12809                    } else {
12810                        unreachable!()
12811                    }
12812                }
12813                3 => {
12814                    #[allow(irrefutable_let_patterns)]
12815                    if let SequenceItemOutcome::Poll32(_) = self {
12816                        // Do nothing, read the value into the object
12817                    } else {
12818                        // Initialize `self` to the right variant
12819                        *self = SequenceItemOutcome::Poll32(fidl::new_empty!(PollResult, D));
12820                    }
12821                    #[allow(irrefutable_let_patterns)]
12822                    if let SequenceItemOutcome::Poll32(ref mut val) = self {
12823                        fidl::decode!(PollResult, D, val, decoder, _inner_offset, depth)?;
12824                    } else {
12825                        unreachable!()
12826                    }
12827                }
12828                4 => {
12829                    #[allow(irrefutable_let_patterns)]
12830                    if let SequenceItemOutcome::DelayNs(_) = self {
12831                        // Do nothing, read the value into the object
12832                    } else {
12833                        // Initialize `self` to the right variant
12834                        *self = SequenceItemOutcome::DelayNs(fidl::new_empty!(DelayNs, D));
12835                    }
12836                    #[allow(irrefutable_let_patterns)]
12837                    if let SequenceItemOutcome::DelayNs(ref mut val) = self {
12838                        fidl::decode!(DelayNs, D, val, decoder, _inner_offset, depth)?;
12839                    } else {
12840                        unreachable!()
12841                    }
12842                }
12843                5 => {
12844                    #[allow(irrefutable_let_patterns)]
12845                    if let SequenceItemOutcome::Barrier(_) = self {
12846                        // Do nothing, read the value into the object
12847                    } else {
12848                        // Initialize `self` to the right variant
12849                        *self = SequenceItemOutcome::Barrier(fidl::new_empty!(Barrier, D));
12850                    }
12851                    #[allow(irrefutable_let_patterns)]
12852                    if let SequenceItemOutcome::Barrier(ref mut val) = self {
12853                        fidl::decode!(Barrier, D, val, decoder, _inner_offset, depth)?;
12854                    } else {
12855                        unreachable!()
12856                    }
12857                }
12858                6 => {
12859                    #[allow(irrefutable_let_patterns)]
12860                    if let SequenceItemOutcome::Error(_) = self {
12861                        // Do nothing, read the value into the object
12862                    } else {
12863                        // Initialize `self` to the right variant
12864                        *self = SequenceItemOutcome::Error(fidl::new_empty!(OperationError, D));
12865                    }
12866                    #[allow(irrefutable_let_patterns)]
12867                    if let SequenceItemOutcome::Error(ref mut val) = self {
12868                        fidl::decode!(OperationError, D, val, decoder, _inner_offset, depth)?;
12869                    } else {
12870                        unreachable!()
12871                    }
12872                }
12873                7 => {
12874                    #[allow(irrefutable_let_patterns)]
12875                    if let SequenceItemOutcome::GpioRead(_) = self {
12876                        // Do nothing, read the value into the object
12877                    } else {
12878                        // Initialize `self` to the right variant
12879                        *self = SequenceItemOutcome::GpioRead(fidl::new_empty!(GpioReadResult, D));
12880                    }
12881                    #[allow(irrefutable_let_patterns)]
12882                    if let SequenceItemOutcome::GpioRead(ref mut val) = self {
12883                        fidl::decode!(GpioReadResult, D, val, decoder, _inner_offset, depth)?;
12884                    } else {
12885                        unreachable!()
12886                    }
12887                }
12888                8 => {
12889                    #[allow(irrefutable_let_patterns)]
12890                    if let SequenceItemOutcome::GpioWrite(_) = self {
12891                        // Do nothing, read the value into the object
12892                    } else {
12893                        // Initialize `self` to the right variant
12894                        *self =
12895                            SequenceItemOutcome::GpioWrite(fidl::new_empty!(GpioWriteResult, D));
12896                    }
12897                    #[allow(irrefutable_let_patterns)]
12898                    if let SequenceItemOutcome::GpioWrite(ref mut val) = self {
12899                        fidl::decode!(GpioWriteResult, D, val, decoder, _inner_offset, depth)?;
12900                    } else {
12901                        unreachable!()
12902                    }
12903                }
12904                9 => {
12905                    #[allow(irrefutable_let_patterns)]
12906                    if let SequenceItemOutcome::I2cTransfer(_) = self {
12907                        // Do nothing, read the value into the object
12908                    } else {
12909                        // Initialize `self` to the right variant
12910                        *self = SequenceItemOutcome::I2cTransfer(fidl::new_empty!(
12911                            I2cTransferResult,
12912                            D
12913                        ));
12914                    }
12915                    #[allow(irrefutable_let_patterns)]
12916                    if let SequenceItemOutcome::I2cTransfer(ref mut val) = self {
12917                        fidl::decode!(I2cTransferResult, D, val, decoder, _inner_offset, depth)?;
12918                    } else {
12919                        unreachable!()
12920                    }
12921                }
12922                10 => {
12923                    #[allow(irrefutable_let_patterns)]
12924                    if let SequenceItemOutcome::SpiTransmit(_) = self {
12925                        // Do nothing, read the value into the object
12926                    } else {
12927                        // Initialize `self` to the right variant
12928                        *self = SequenceItemOutcome::SpiTransmit(fidl::new_empty!(
12929                            SpiTransmitResult,
12930                            D
12931                        ));
12932                    }
12933                    #[allow(irrefutable_let_patterns)]
12934                    if let SequenceItemOutcome::SpiTransmit(ref mut val) = self {
12935                        fidl::decode!(SpiTransmitResult, D, val, decoder, _inner_offset, depth)?;
12936                    } else {
12937                        unreachable!()
12938                    }
12939                }
12940                #[allow(deprecated)]
12941                ordinal => {
12942                    for _ in 0..num_handles {
12943                        decoder.drop_next_handle()?;
12944                    }
12945                    *self = SequenceItemOutcome::__SourceBreaking { unknown_ordinal: ordinal };
12946                }
12947            }
12948            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12949                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12950            }
12951            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12952                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12953            }
12954            Ok(())
12955        }
12956    }
12957}