Skip to main content

fidl_fuchsia_io_common/
fidl_fuchsia_io_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// Abilities are properties intrinsic to a node. They specify which operations are supported by it.
12///
13/// Invoking an operation on a node that does not support it results in `ZX_ERR_NOT_SUPPORTED`.
14/// Note `ZX_ERR_ACCESS_DENIED` takes precedence over `ZX_ERR_NOT_SUPPORTED` when both apply.
15pub type Abilities = Operations;
16
17/// The name of an extended attribute. It can not contain any null bytes. Other
18/// than that and the maximum size, no particular structure is imposed on the
19/// name.
20pub type ExtendedAttributeName = Vec<u8>;
21
22/// The type to identify a node, if the implementation supports some notion of
23/// unique node ID.
24///
25/// ## Uniqueness Guarantees
26///
27/// A client is usually presented with a directory tree that is the result
28/// of composing together multiple backing implementation instances. An ID
29/// would be unique within the corresponding instance only.
30/// Their boundaries are rather implicit on Fuchsia, as a result of
31/// transparently-forwarding directory proxies. It could be common for a client
32/// to observe identical `Id`s when traversing a directory tree, when it
33/// encounters nodes from different backing instances. Therefore, the ID is best
34/// used for debugging and informational purposes.
35///
36/// The [`fuchsia.fs/FilesystemInfo.fs_id`] field may be used to disambiguate
37/// IDs from different backing instances.
38pub type Id = u64;
39
40/// The type for the name of a node, i.e. a single path component.
41/// E.g. `foo`
42///
43/// ## Invariants
44///
45/// A valid node name must meet the following criteria:
46///
47/// * It cannot be longer than [`MAX_NAME_LENGTH`].
48/// * It cannot be empty.
49/// * It cannot be ".." (dot-dot).
50/// * It cannot be "." (single dot).
51/// * It cannot contain "/".
52/// * It cannot contain embedded NUL.
53pub type Name = String;
54
55/// A path is a string of one or more components, separated by "/".
56/// E.g. `foo/bar/baz`
57///
58/// ## Invariants
59///
60/// A valid path must meet the following criteria:
61///
62/// * It cannot be empty.
63/// * It cannot be longer than [`MAX_PATH_LENGTH`].
64/// * It cannot have a leading "/".
65/// * It cannot have a trailing "/".
66/// * It must be exactly "." OR each of its components must be a valid [`Name`].
67///
68/// Paths should be transformed into their canonical forms at client side.
69/// For example, a client should convert `"foo/bar/.././baz/"` to `"foo/baz"`
70/// before using it as a path.
71pub type Path = String;
72
73/// Rights are properties specific to a connection. They limit which operations are allowed on a
74/// connection, including those which may be granted to new connections.
75///
76/// Invoking an operation without the corresponding right results in `ZX_ERR_ACCESS_DENIED`
77/// even if the node does not have support for the operation.
78pub type Rights = Operations;
79
80pub type SymlinkTarget = Vec<u8>;
81
82/// The byte vector type used for read/write operations.
83pub type Transfer = Vec<u8>;
84
85pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
86
87pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
88
89/// Specifies that this object is not linkable. This is only intended to be used in the context of
90/// creating a temporary unnamed objects. When that is not the case, the node protocol defines if it
91/// is linkable (i.e. if it composes the `Linkable` protocol). When this flag is set along with
92/// `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY`, an unnamed temporary object will be created that
93/// cannot be linked into the filesystem. This would be similar to Linux `O_TMPFILE | O_EXCL`.
94///
95/// CAUTION: if `Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY` is not specified,  then this is treated as
96/// a "must create" flag.
97///
98/// The reason for overloading `Flags.FLAG_MUST_CREATE` to mean "not linkable" in this context and
99/// "must create" in other contexts is due to the assumption that some POSIX flags are compatible
100/// with the members in `Flags`. In particular the POSIX `O_EXCL` has the same value as
101/// `Flags.FLAG_MUST_CREATE`. We are not able to define different bit members of the same value,
102/// hence it is defined separately outside of `Flags`.
103pub const FLAG_TEMPORARY_AS_NOT_LINKABLE: Flags = Flags::FLAG_MUST_CREATE;
104
105/// Set of rights that [`Flags.PERM_INHERIT_WRITE`] will inherit from the parent connection if
106/// specified. Note that if any of these permissions are missing from the connection, none of these
107/// permissions will be inherited.
108pub const INHERITED_WRITE_PERMISSIONS: Operations = Operations::from_bits_truncate(356);
109
110/// Nodes which do not have ino values should return this value
111/// from Readdir and GetAttr.
112pub const INO_UNKNOWN: u64 = 18446744073709551615;
113
114pub const MASK_KNOWN_PERMISSIONS: Flags = Flags::from_bits_truncate(25087);
115
116pub const MASK_KNOWN_PROTOCOLS: Flags = Flags::from_bits_truncate(30069489664);
117
118pub const MASK_PERMISSION_FLAGS: u64 = 65535;
119
120pub const MASK_POSIX_FLAGS: u64 = 4294967295;
121
122/// The maximum size for an extended attribute name.
123pub const MAX_ATTRIBUTE_NAME: u64 = 255;
124
125/// The maximal buffer size which can be transmitted for buffered operations.
126/// This capacity is currently set somewhat arbitrarily.
127pub const MAX_BUF: u64 = 8192;
128
129/// The maximum length, in bytes, of a single filesystem component.
130pub const MAX_FILENAME: u64 = 255;
131
132pub const MAX_FS_NAME_BUFFER: u64 = 32;
133
134/// The maximum size for an extended attribute value to be included inline.
135/// Values larger than this size are passed in a vmo.
136pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768;
137
138/// The maximum size of a chunk in the ListExtendedAttributes iterator.
139pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128;
140
141/// The maximum length, in bytes, of a single filesystem component.
142pub const MAX_NAME_LENGTH: u64 = 255;
143
144/// The maximum length, in bytes, of a filesystem path.
145pub const MAX_PATH_LENGTH: u64 = 4095;
146
147/// The maximum size for passing the SELinux context as an attribute.
148pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256;
149
150/// The maximum I/O size that is allowed for read/write operations using
151/// byte vectors.
152pub const MAX_TRANSFER_SIZE: u64 = 8192;
153
154pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
155
156/// Flags used when opening a node reference must fall within this mask.
157pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: OpenFlags =
158    OpenFlags::from_bits_truncate(46661632);
159
160/// All known rights.
161pub const OPEN_RIGHTS: OpenFlags = OpenFlags::from_bits_truncate(11);
162
163/// Set of permissions that are expected when opening a node as executable.
164pub const PERM_EXECUTABLE: Flags = Flags::from_bits_truncate(201);
165
166/// Set of permissions that are expected when opening a node as readable.
167pub const PERM_READABLE: Flags = Flags::from_bits_truncate(211);
168
169/// Set of permissions that are expected when opening a node as writable.
170pub const PERM_WRITABLE: Flags = Flags::from_bits_truncate(485);
171
172/// Alias for directory permission alias rw*
173pub const RW_STAR_DIR: Operations = Operations::from_bits_truncate(503);
174
175/// Alias for directory permission alias rx*
176pub const RX_STAR_DIR: Operations = Operations::from_bits_truncate(219);
177
178/// Alias for directory permission alias r*
179pub const R_STAR_DIR: Operations = Operations::from_bits_truncate(211);
180
181/// The name of the extended attribute accessible via the SELinux context attribute.
182pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
183
184pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
185
186/// Alias for directory permission alias w*
187pub const W_STAR_DIR: Operations = Operations::from_bits_truncate(485);
188
189/// Alias for directory permission alias x*
190pub const X_STAR_DIR: Operations = Operations::from_bits_truncate(201);
191
192bitflags! {
193    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
194    pub struct AllocateMode: u32 {
195        const KEEP_SIZE = 1;
196        const UNSHARE_RANGE = 2;
197        const PUNCH_HOLE = 4;
198        const COLLAPSE_RANGE = 8;
199        const ZERO_RANGE = 16;
200        const INSERT_RANGE = 32;
201    }
202}
203
204impl AllocateMode {
205    #[inline(always)]
206    pub fn from_bits_allow_unknown(bits: u32) -> Self {
207        Self::from_bits_retain(bits)
208    }
209
210    #[inline(always)]
211    pub fn has_unknown_bits(&self) -> bool {
212        self.get_unknown_bits() != 0
213    }
214
215    #[inline(always)]
216    pub fn get_unknown_bits(&self) -> u32 {
217        self.bits() & !Self::all().bits()
218    }
219}
220
221bitflags! {
222    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
223    pub struct FileSignal: u32 {
224        /// Indicates the file is ready for reading.
225        const READABLE = 16777216;
226        /// Indicates the file is ready for writing.
227        const WRITABLE = 33554432;
228    }
229}
230
231impl FileSignal {}
232
233bitflags! {
234    /// Flags used to specify how a node should be opened. Note that ranges of bits are reserved
235    /// for specific use cases:
236    ///  * Bits  1-16: Permission flags `PERM_*` (e.g. [`Flags.PERM_READ_BYTES`]).
237    ///  * Bits 17-32: POSIX compatibile `O_*` flags (e.g. [`Flags.FILE_TRUNCATE`] or `O_TRUNC`).
238    ///  * Bits 33-64: Fuchsia-specific flags.
239    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
240    pub struct Flags: u64 {
241        /// Allows opening child nodes with [`PROTOCOL_SERVICE`].
242        const PERM_CONNECT = 1;
243        /// Read byte contents of a file.
244        const PERM_READ_BYTES = 2;
245        /// Write byte contents to a file.
246        const PERM_WRITE_BYTES = 4;
247        /// Execute byte contents of a file.
248        const PERM_EXECUTE = 8;
249        /// Get/query attributes of a node.
250        const PERM_GET_ATTRIBUTES = 16;
251        /// Set/update attributes of a node.
252        const PERM_UPDATE_ATTRIBUTES = 32;
253        /// Enumerate (list) directory entries.
254        const PERM_ENUMERATE = 64;
255        /// Allow opening a child node with a node protocol. Must be specified with PERM_ENUMERATE
256        /// otherwise requests will fail with `ZX_ERR_INVALID_ARGS`.
257        const PERM_TRAVERSE = 128;
258        /// Modify directory entries (create/rename/link/unlink). Must be specified with
259        /// PERM_ENUMERATE otherwise requests will fail with `ZX_ERR_INVALID_ARGS`.
260        const PERM_MODIFY_DIRECTORY = 256;
261        /// Inherit write permissions when available (PERM_WRITE_BYTES, PERM_UPDATE_ATTRIBUTES,
262        /// PERM_MODIFY_DIRECTORY, /// PERM_ENUMERATE). Servers must ensure this flag is removed
263        /// if the parent connection lacks any of these rights. See [`INHERITED_WRITE_PERMISSIONS`]
264        /// for the exact set of permissions that will be inherited.
265        const PERM_INHERIT_WRITE = 8192;
266        /// Inherit execute permission when available (PERM_EXECUTE).
267        /// Servers must ensure this flag is removed if the parent connection lacks PERM_EXECUTE.
268        const PERM_INHERIT_EXECUTE = 16384;
269        /// Connect to the underlying protocol if this is a service node. The caller must determine the
270        /// correct protocol to use (e.g. based on path). Unless used with [`PROTOCOL_NODE`], specifying
271        /// other flags with the request will fail with `ZX_ERR_INVALID_ARGS`.
272        const PROTOCOL_SERVICE = 4294967296;
273        /// Connect to the underlying node. Takes precedence over other protocols. If other `PROTOCOL_*`
274        /// are specified, they will be used to validate the target node type. Requests will fail with
275        /// `ZX_ERR_INVALID_ARGS` if flags other than `PROTOCOL_*` and [`FLAG_SEND_REPRESENTATION`] are
276        /// specified. Equivalent to POSIX `O_PATH`.
277        const PROTOCOL_NODE = 4194304;
278        /// Caller accepts [`fuchsia.io/Directory`] protocol. Equivalent to POSIX `O_DIRECTORY`.
279        const PROTOCOL_DIRECTORY = 524288;
280        /// Caller accepts [`fuchsia.io/File`] protocol.
281        const PROTOCOL_FILE = 8589934592;
282        /// Caller accepts [`fuchsia.io/Symlink`] protocol.
283        const PROTOCOL_SYMLINK = 17179869184;
284        /// Caller requests a [`fuchsia.io/Node.OnRepresentation`] event on success.
285        const FLAG_SEND_REPRESENTATION = 1099511627776;
286        /// Create a new object if one doesn't exist, otherwise open an existing object. If set, a
287        /// single `PROTOCOL_*` flag must be set indicating the type of object to create. Equivalent
288        /// to POSIX `O_CREAT`.
289        const FLAG_MAYBE_CREATE = 65536;
290        /// Create a new object if one doesn't exist, otherwise fail the request with
291        /// `ZX_ERR_ALREADY_EXISTS`. If set, a single `PROTOCOL_*` flag must be set indicating the type
292        /// of object to create. Takes precedence over [`FLAG_MAYBE_CREATE`]. Equivalent to POSIX
293        /// `O_EXCL`.
294        const FLAG_MUST_CREATE = 131072;
295        /// Create a new unnamed temporary object. The object is temporary until it is linked to the
296        /// filesystem. If specified with `FLAG_TEMPORARY_AS_NOT_LINKABLE`, then the created object is
297        /// not linkable. If this flag is set:
298        ///  * `path` specified in [`fuchsia.io/Directory.Open`] refers to the path of the directory
299        ///    which the new object will be created in,
300        ///  * A `PROTOCOL_*` flag is set to indicate the type of object to be created. Currently, this
301        ///    is only supported when specified with `PROTOCOL_FILE`, in which case, it is equivalent
302        ///    to Linux `O_TMPFILE`.
303        ///  * `FLAG_MAYBE_CREATE` will be ignored.
304        const FLAG_CREATE_AS_UNNAMED_TEMPORARY = 34359738368;
305        /// Open the file in append mode. The seek pointer will be moved to end-of-file (EOF)
306        /// before all writes. Equivalent to POSIX `O_APPEND`.
307        const FILE_APPEND = 1048576;
308        /// Truncate the file to zero length upon opening it. Equivalent to POSIX `O_TRUNC`.
309        const FILE_TRUNCATE = 262144;
310    }
311}
312
313impl Flags {
314    #[inline(always)]
315    pub fn from_bits_allow_unknown(bits: u64) -> Self {
316        Self::from_bits_retain(bits)
317    }
318
319    #[inline(always)]
320    pub fn has_unknown_bits(&self) -> bool {
321        self.get_unknown_bits() != 0
322    }
323
324    #[inline(always)]
325    pub fn get_unknown_bits(&self) -> u64 {
326        self.bits() & !Self::all().bits()
327    }
328}
329
330bitflags! {
331    /// Flags configuring an fscrypt encryption policy.
332    ///
333    /// These flags are byte-compatible with the Linux fscrypt UAPI: each member has the same value as
334    /// the corresponding `FSCRYPT_POLICY_FLAG*` constant in `<linux/fscrypt.h>`, so the `flags` field
335    /// of a Linux `fscrypt_policy_v2` can be converted to and from this type without translation.
336    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
337    pub struct FscryptPolicyFlags: u8 {
338        /// Pad encrypted filenames to 8-byte boundaries (when neither PAD_8 nor PAD_16 is set,
339        /// filenames are padded to 4-byte boundaries; when both PAD_8 and PAD_16 are set, filenames
340        /// are padded to 32-byte boundaries).
341        const PAD_8 = 1;
342        /// Pad encrypted filenames to 16-byte boundaries.
343        const PAD_16 = 2;
344        /// Use direct key mode.
345        const DIRECT_KEY = 4;
346        /// Derive IVs/DUNs by hashing the inode number and combining with the 64-bit logical block
347        /// number (`FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64`).
348        const IV_INO_LBLK_64 = 8;
349        /// Derive IVs/DUNs by hashing the main key and inode number and adding the 32-bit logical
350        /// block number (`FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32`).
351        const IV_INO_LBLK_32 = 16;
352    }
353}
354
355impl FscryptPolicyFlags {
356    #[inline(always)]
357    pub fn from_bits_allow_unknown(bits: u8) -> Self {
358        Self::from_bits_retain(bits)
359    }
360
361    #[inline(always)]
362    pub fn has_unknown_bits(&self) -> bool {
363        self.get_unknown_bits() != 0
364    }
365
366    #[inline(always)]
367    pub fn get_unknown_bits(&self) -> u8 {
368        self.bits() & !Self::all().bits()
369    }
370}
371
372bitflags! {
373    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
374    pub struct ModeType: u32 {
375        const DO_NOT_USE = 2147483648;
376    }
377}
378
379impl ModeType {}
380
381bitflags! {
382    /// The fields of 'attributes' which are used to update the Node are indicated
383    /// by the 'flags' argument.
384    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
385    pub struct NodeAttributeFlags: u32 {
386        const CREATION_TIME = 1;
387        const MODIFICATION_TIME = 2;
388    }
389}
390
391impl NodeAttributeFlags {}
392
393bitflags! {
394    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
395    pub struct NodeAttributesQuery: u64 {
396        /// Requests [`NodeAttributes.protocols`].
397        const PROTOCOLS = 1;
398        /// Requests [`NodeAttributes.abilities`].
399        const ABILITIES = 2;
400        /// Requests [`NodeAttributes.content_size`].
401        const CONTENT_SIZE = 4;
402        /// Requests [`NodeAttributes.storage_size`].
403        const STORAGE_SIZE = 8;
404        /// Requests [`NodeAttributes.link_count`].
405        const LINK_COUNT = 16;
406        /// Requests [`NodeAttributes.id`].
407        const ID = 32;
408        /// Requests [`NodeAttributes.creation_time`].
409        const CREATION_TIME = 64;
410        /// Requests [`NodeAttributes.modification_time`].
411        const MODIFICATION_TIME = 128;
412        /// Posix attributes.
413        const MODE = 256;
414        const UID = 512;
415        const GID = 1024;
416        const RDEV = 2048;
417        const ACCESS_TIME = 4096;
418        const CHANGE_TIME = 8192;
419        /// Verity attributes.
420        const OPTIONS = 16384;
421        const ROOT_HASH = 32768;
422        const VERITY_ENABLED = 65536;
423        /// Casefold (case-insensitive filename) support.
424        /// When true, file lookups will be case-insensitive but case-preserving. i.e. "Foo" will
425        /// be stored verbatim but can be opened as "foo", "fOO", etc. Casefolding is done in
426        /// accordance to the Unicode 12 NFD normalization and casefolding standard.
427        const CASEFOLD = 131072;
428        /// Requests [`MutableNodeAttributes.selinux_context`]. See that field for more detail.
429        const SELINUX_CONTEXT = 262144;
430        /// Requests [`MutableNodeAttributes.encryption_policy`].
431        const ENCRYPTION_POLICY = 524288;
432        /// When this is queried in [`fuchsia.io/Node.GetAttributes`], it indicates to the filesystem
433        /// that this node has been accessed and is pending an access time update given that any one of
434        /// the following conditions are met:
435        ///   * current_access_time <= current_modification_time
436        ///   * current_access_time <= current_change_time
437        ///   * current_access_time < current_time - duration(1 day)
438        ///
439        /// If any of the above conditions are met, `access_time` is updated to the current time before
440        /// any queried node attributes are returned.
441        ///
442        /// This is compatible with Linux relatime mount.
443        ///
444        /// The rationale behind adding this `NodeAttributesQuery` is that some filesystems, e.g. Fxfs,
445        /// are unable to identify when a file access has occured and thus update the access time. We
446        /// allow for clients to communicate to the underlying filesystem that a file access has
447        /// occurred and that it awaits for an update to access time.
448        ///
449        /// WARNING: If this is queried without a prior file access, as long as the above conditions
450        /// are met, the node's access time will be updated. Not all filesystems will support this. The
451        /// query will be ignored if the filesystem does not support this.
452        const PENDING_ACCESS_TIME_UPDATE = 1048576;
453    }
454}
455
456impl NodeAttributesQuery {
457    #[inline(always)]
458    pub fn from_bits_allow_unknown(bits: u64) -> Self {
459        Self::from_bits_retain(bits)
460    }
461
462    #[inline(always)]
463    pub fn has_unknown_bits(&self) -> bool {
464        self.get_unknown_bits() != 0
465    }
466
467    #[inline(always)]
468    pub fn get_unknown_bits(&self) -> u64 {
469        self.bits() & !Self::all().bits()
470    }
471}
472
473bitflags! {
474    /// A node may have multiple supported representations when opening, even though
475    /// it may have a fixed underlying identity.
476    ///
477    /// Today, a file is accessed via the [`File`] protocol, and sends a
478    /// [`Representation.FileInfo`] when opened with `GET_REPRESENTATION`. However,
479    /// in the future we might introduce a more sophisticated `FileV2` protocol, or
480    /// a more efficient `SuperFastFile` backed by a specialized kernel object. New
481    /// clients can request the more advanced representations by specifying the
482    /// corresponding bits in [`NodeProtocolKinds`], whereas existing clients would
483    /// continue to talk to the node via the old representation.
484    ///
485    /// [`NodeProtocolKinds`] enables forward-compatibility through a form of protocol
486    /// negotiation.
487    ///
488    /// The elements have one-to-one correspondence with the members of
489    /// [`Representation`].
490    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
491    pub struct NodeProtocolKinds: u64 {
492        /// The connector representation of a node.
493        ///
494        /// The connection will speak either [`Node`] or the target protocol,
495        /// depending on the flags used during opening.
496        const CONNECTOR = 1;
497        /// The directory representation of a node.
498        ///
499        /// The connection will speak the [`Directory`] protocol.
500        const DIRECTORY = 2;
501        /// The file representation of a node.
502        ///
503        /// The connection will speak the [`File`] protocol.
504        const FILE = 4;
505        /// The symlink representation of a node.
506        ///
507        /// The connection will speak the [`Symlink`] protocol.
508        const SYMLINK = 8;
509    }
510}
511
512impl NodeProtocolKinds {
513    #[inline(always)]
514    pub fn from_bits_allow_unknown(bits: u64) -> Self {
515        Self::from_bits_retain(bits)
516    }
517
518    #[inline(always)]
519    pub fn has_unknown_bits(&self) -> bool {
520        self.get_unknown_bits() != 0
521    }
522
523    #[inline(always)]
524    pub fn get_unknown_bits(&self) -> u64 {
525        self.bits() & !Self::all().bits()
526    }
527}
528
529bitflags! {
530    /// DEPRECATED - Use Flags instead.
531    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
532    pub struct OpenFlags: u32 {
533        /// Can read from target object.
534        const RIGHT_READABLE = 1;
535        /// Can write to target object.
536        const RIGHT_WRITABLE = 2;
537        /// Connection can map target object executable.
538        const RIGHT_EXECUTABLE = 8;
539        /// Create the object if it doesn't exist.
540        const CREATE = 65536;
541        /// (with Create) Fail if the object already exists.
542        const CREATE_IF_ABSENT = 131072;
543        /// Truncate the object before usage.
544        const TRUNCATE = 262144;
545        /// Assert that the object to be opened is a directory.
546        /// Return an error if the target object is not a directory.
547        const DIRECTORY = 524288;
548        /// Seek to the end of the object before all writes.
549        const APPEND = 1048576;
550        /// Open a reference to the object, not the object itself.
551        /// It is ONLY valid to pass the following flags together with `NODE_REFERENCE`:
552        /// - `DIRECTORY`
553        /// - `NOT_DIRECTORY`
554        /// - `DESCRIBE`
555        /// otherwise an error is returned.
556        /// If an object is opened or cloned using this method, the resulting connection does not carry
557        /// any permission flags.
558        /// The resulting connection allows a limited set of operations: `GetAttr`, `Clone`, `Close`,
559        /// `Describe`, and `GetFlags`. The connection will speak the `Node` protocol. Calling `SetAttr`
560        /// or `SetFlags` will result in `ZX_ERR_BAD_HANDLE`.
561        const NODE_REFERENCE = 4194304;
562        /// Requests that an "OnOpen" event is sent to the interface request.
563        ///
564        /// The event will contain a non-null `NodeInfoDeprecated` if the open/clone is successful. This
565        /// can be used to open a protocol that does not compose fuchsia.io/Node; the event is sent as
566        /// if the protocol is fuchsia.io/Node and then the target protocol is used exclusively.
567        const DESCRIBE = 8388608;
568        /// Specify this flag to request POSIX-compatibility with respect to write permission handling.
569        /// Currently, it affects permission handling specifically during Open:
570        /// - If the target path is a directory, the rights on the new connection expand to include
571        ///   `WRITABLE` if and only if the current connection and all intermediate mount points
572        ///   are writable.
573        /// - Otherwise, this flag is ignored. It is an access denied error to request more rights
574        ///   than those on the current connection, or any intermediate mount points.
575        ///
576        /// If this flag is omitted, opening always uses the requested rights, failing the operation with
577        /// access denied error if requested rights exceeds the rights attached to the current connection.
578        ///
579        /// If the requesting connection is read-only and the requested rights are read-only, the flag
580        /// may be ignored by the server, and is not forwarded downstream. This is an implementation detail,
581        /// necessary to enforce hierarchical permissions across mount points, and should have no effect
582        /// on the expected behavior for clients.
583        const POSIX_WRITABLE = 134217728;
584        /// Specify this flag to request POSIX-compatibility with respect to execute permission handling.
585        /// Currently, it affects permission handling specifically during Open:
586        /// - If the target path is a directory, the rights on the new connection expand to include
587        ///   `EXECUTABLE` if and only if the current connection and all intermediate mount
588        ///   points are executable.
589        /// - Otherwise, this flag is ignored. It is an access denied error to request more rights
590        ///   than those on the current connection, or any intermediate mount points.
591        ///
592        /// If this flag is omitted, opening always uses the requested rights, failing the operation with
593        /// access denied error if requested rights exceeds the rights attached to the current connection.
594        ///
595        /// If the requesting connection is read-only and the requested rights are read-only, the flag
596        /// may be ignored by the server, and is not forwarded downstream. This is an implementation detail,
597        /// necessary to enforce hierarchical permissions across mount points, and should have no effect
598        /// on the expected behavior for clients.
599        const POSIX_EXECUTABLE = 268435456;
600        /// Assert that the object to be opened is not a directory.
601        /// Return an error if the target object is a directory.
602        const NOT_DIRECTORY = 33554432;
603        /// When used during clone, the new connection inherits the rights on the source connection,
604        /// regardless if it is a file or directory. Otherwise, clone attempts to use the requested rights.
605        /// It is invalid to pass any of the `RIGHT_*` flags together with `OpenFlags.CLONE_SAME_RIGHTS`.
606        const CLONE_SAME_RIGHTS = 67108864;
607        /// Open the target object as a block device.
608        const BLOCK_DEVICE = 16777216;
609    }
610}
611
612impl OpenFlags {}
613
614bitflags! {
615    /// The common members definition behind [`Rights`] and [`Abilities`]. Some operations may apply
616    /// only to certain node types (e.g. [`Operations.MODIFY_DIRECTORY`] only applies to directories).
617    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
618    pub struct Operations: u64 {
619        /// Connecting to a service in a directory.
620        const CONNECT = 1;
621        /// Read byte contents of a node or its children.
622        const READ_BYTES = 2;
623        /// Writing to the byte contents of a node or its children.
624        const WRITE_BYTES = 4;
625        /// Execute the byte contents of a node or its children.
626        const EXECUTE = 8;
627        /// Reading the attributes of a node and/or its children.
628        const GET_ATTRIBUTES = 16;
629        /// Updating the attributes of a node and/or its children.
630        const UPDATE_ATTRIBUTES = 32;
631        /// Reading the list of nodes in a directory.
632        const ENUMERATE = 64;
633        /// Opening a node from a directory.
634        ///
635        /// Note: It is recommended to pair this with [`Rights.ENUMERATE`] (directory contents can be
636        /// probed by opening children), e.g. by using [`PERM_READABLE`]. If strict isolation
637        /// is required, consider routing discrete capabilities instead.
638        const TRAVERSE = 128;
639        /// Modifying the list of nodes in a directory, e.g. creating, renaming, link/unlink, etc...
640        ///
641        /// Note: It is recommended to pair this with [`Rights.ENUMERATE`] (directory contents can be
642        /// probed via name conflicts during node creation), e.g. by using [`PERM_WRITABLE`]. If
643        /// strict isolation is required, consider routing discrete capabilities instead.
644        const MODIFY_DIRECTORY = 256;
645    }
646}
647
648impl Operations {
649    #[inline(always)]
650    pub fn from_bits_allow_unknown(bits: u64) -> Self {
651        Self::from_bits_retain(bits)
652    }
653
654    #[inline(always)]
655    pub fn has_unknown_bits(&self) -> bool {
656        self.get_unknown_bits() != 0
657    }
658
659    #[inline(always)]
660    pub fn get_unknown_bits(&self) -> u64 {
661        self.bits() & !Self::all().bits()
662    }
663}
664
665bitflags! {
666    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
667    pub struct UnlinkFlags: u64 {
668        /// If set, the unlink will fail (with ZX_ERR_NOT_DIR) if the
669        /// object is not a directory.
670        const MUST_BE_DIRECTORY = 1;
671    }
672}
673
674impl UnlinkFlags {
675    #[inline(always)]
676    pub fn from_bits_allow_unknown(bits: u64) -> Self {
677        Self::from_bits_retain(bits)
678    }
679
680    #[inline(always)]
681    pub fn has_unknown_bits(&self) -> bool {
682        self.get_unknown_bits() != 0
683    }
684
685    #[inline(always)]
686    pub fn get_unknown_bits(&self) -> u64 {
687        self.bits() & !Self::all().bits()
688    }
689}
690
691bitflags! {
692    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
693    pub struct VmoFlags: u32 {
694        /// Requests that the VMO be readable.
695        const READ = 1;
696        /// Requests that the VMO be writable.
697        const WRITE = 2;
698        /// Request that the VMO be executable.
699        const EXECUTE = 4;
700        /// Require a copy-on-write clone of the underlying VMO. The request
701        /// should fail if the VMO cannot be cloned. May not be supplied
702        /// with `SHARED_BUFFER`.
703        ///
704        /// A private clone uses at least the guarantees of the
705        /// `ZX_VMO_CHILD_SNAPSHOT_AT_LEAST_ON_WRITE` flag to
706        /// `zx_vmo_create_child()`. This means that the returned VMO will
707        /// be copy-on-write (if `WRITE` is requested) but that it may or
708        /// may not reflect subsequent content changes to the underlying
709        /// file. The returned VMO will not reflect size changes to the
710        /// file. These semantics match those of the POSIX `mmap()`
711        /// `MAP_PRIVATE` flag.
712        ///
713        /// In some cases, clients requiring a guaranteed snapshot of the
714        /// file can use `SHARED_BUFFER` and then use
715        /// `zx_vmo_create_child()` with `ZX_VMO_CHILD_SNAPSHOT`. However,
716        /// in addition to cases where the implementation can't return a
717        /// `SHARED_BUFFER`, creating a full snapshot will fail if the VMO
718        /// is attached to the pager. Since most filesystems will use the
719        /// paging system, the full snapshot approach should only be used in
720        /// specific cases where the client is talking to a known server.
721        const PRIVATE_CLONE = 65536;
722        /// Require a VMO that provides direct access to the contents of the
723        /// file's underlying VMO. The request should fail if such a VMO
724        /// cannot be provided. May not be supplied with `PRIVATE_CLONE`.
725        ///
726        /// The returned VMO may not be resizable even when `WRITE` access is
727        /// requested. In this case, [`File.Resize`] should be used to resize
728        /// the file.
729        const SHARED_BUFFER = 131072;
730    }
731}
732
733impl VmoFlags {}
734
735bitflags! {
736    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
737    pub struct WatchMask: u32 {
738        /// Used by `Directory.Watch`. Requests transmission of `WatchEvent.DELETED`.
739        const DELETED = 1;
740        /// Used by `Directory.Watch`. Requests transmission of `WatchEvent.ADDED`.
741        const ADDED = 2;
742        /// Used by `Directory.Watch`. Requests transmission of `WatchEvent.REMOVED`.
743        const REMOVED = 4;
744        /// Used by `Directory.Watch`. Requests transmission of `WatchEvent.EXISTING`.
745        const EXISTING = 8;
746        /// Used by `Directory.Watch`. Requests transmission of `WatchEvent.IDLE`.
747        const IDLE = 16;
748    }
749}
750
751impl WatchMask {}
752
753#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
754#[repr(u32)]
755pub enum AdvisoryLockType {
756    /// Zero or more connections can hold read locks on a file simultaneously.
757    Read = 1,
758    /// At most one connection can hold a write lock on a file simultaneously.
759    /// When a write lock is held on a file, no other types of locks can be held
760    /// on that file.
761    Write = 2,
762    /// The region specifies a region to be unlocked.
763    Unlock = 3,
764}
765
766impl AdvisoryLockType {
767    #[inline]
768    pub fn from_primitive(prim: u32) -> Option<Self> {
769        match prim {
770            1 => Some(Self::Read),
771            2 => Some(Self::Write),
772            3 => Some(Self::Unlock),
773            _ => None,
774        }
775    }
776
777    #[inline]
778    pub const fn into_primitive(self) -> u32 {
779        self as u32
780    }
781}
782
783#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
784pub enum DirentType {
785    /// A dirent with an unknown type.
786    Unknown,
787    /// A dirent representing a directory object.
788    Directory,
789    /// A dirent representing a block device object.
790    BlockDevice,
791    /// A dirent representing a file object.
792    File,
793    /// A symbolic link.
794    Symlink,
795    /// A dirent representing a service object.
796    Service,
797    #[doc(hidden)]
798    __SourceBreaking { unknown_ordinal: u8 },
799}
800
801/// Pattern that matches an unknown `DirentType` member.
802#[macro_export]
803macro_rules! DirentTypeUnknown {
804    () => {
805        _
806    };
807}
808
809impl DirentType {
810    #[inline]
811    pub fn from_primitive(prim: u8) -> Option<Self> {
812        match prim {
813            0 => Some(Self::Unknown),
814            4 => Some(Self::Directory),
815            6 => Some(Self::BlockDevice),
816            8 => Some(Self::File),
817            10 => Some(Self::Symlink),
818            16 => Some(Self::Service),
819            _ => None,
820        }
821    }
822
823    #[inline]
824    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
825        match prim {
826            0 => Self::Unknown,
827            4 => Self::Directory,
828            6 => Self::BlockDevice,
829            8 => Self::File,
830            10 => Self::Symlink,
831            16 => Self::Service,
832            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
833        }
834    }
835
836    #[inline]
837    pub fn unknown() -> Self {
838        Self::__SourceBreaking { unknown_ordinal: 0xff }
839    }
840
841    #[inline]
842    pub const fn into_primitive(self) -> u8 {
843        match self {
844            Self::Unknown => 0,
845            Self::Directory => 4,
846            Self::BlockDevice => 6,
847            Self::File => 8,
848            Self::Symlink => 10,
849            Self::Service => 16,
850            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
851        }
852    }
853
854    #[inline]
855    pub fn is_unknown(&self) -> bool {
856        match self {
857            Self::__SourceBreaking { unknown_ordinal: _ } => true,
858            _ => false,
859        }
860    }
861}
862
863/// Denotes which hash algorithm is used to build the merkle tree for
864/// fsverity-enabled files.
865#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
866pub enum HashAlgorithm {
867    Sha256,
868    Sha512,
869    #[doc(hidden)]
870    __SourceBreaking {
871        unknown_ordinal: u8,
872    },
873}
874
875/// Pattern that matches an unknown `HashAlgorithm` member.
876#[macro_export]
877macro_rules! HashAlgorithmUnknown {
878    () => {
879        _
880    };
881}
882
883impl HashAlgorithm {
884    #[inline]
885    pub fn from_primitive(prim: u8) -> Option<Self> {
886        match prim {
887            1 => Some(Self::Sha256),
888            2 => Some(Self::Sha512),
889            _ => None,
890        }
891    }
892
893    #[inline]
894    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
895        match prim {
896            1 => Self::Sha256,
897            2 => Self::Sha512,
898            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
899        }
900    }
901
902    #[inline]
903    pub fn unknown() -> Self {
904        Self::__SourceBreaking { unknown_ordinal: 0xff }
905    }
906
907    #[inline]
908    pub const fn into_primitive(self) -> u8 {
909        match self {
910            Self::Sha256 => 1,
911            Self::Sha512 => 2,
912            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
913        }
914    }
915
916    #[inline]
917    pub fn is_unknown(&self) -> bool {
918        match self {
919            Self::__SourceBreaking { unknown_ordinal: _ } => true,
920            _ => false,
921        }
922    }
923}
924
925/// The reference point for updating the seek offset. See [`File.Seek`].
926///
927/// This enum matches the `zx_stream_seek_origin_t` enum.
928#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
929#[repr(u32)]
930pub enum SeekOrigin {
931    /// Seek from the start of the file.
932    /// The seek offset will be set to `offset` bytes.
933    /// The seek offset cannot be negative in this case.
934    Start = 0,
935    /// Seek from the current position in the file.
936    /// The seek offset will be the current seek offset plus `offset` bytes.
937    Current = 1,
938    /// Seek from the end of the file.
939    /// The seek offset will be the file size plus `offset` bytes.
940    End = 2,
941}
942
943impl SeekOrigin {
944    #[inline]
945    pub fn from_primitive(prim: u32) -> Option<Self> {
946        match prim {
947            0 => Some(Self::Start),
948            1 => Some(Self::Current),
949            2 => Some(Self::End),
950            _ => None,
951        }
952    }
953
954    #[inline]
955    pub const fn into_primitive(self) -> u32 {
956        self as u32
957    }
958}
959
960#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
961#[repr(u32)]
962pub enum SetExtendedAttributeMode {
963    /// Set the value of the extended attribute regardless of whether it
964    /// already exists.
965    Set = 1,
966    /// Create a new extended attribute. Fail if it already exists.
967    Create = 2,
968    /// Replace the value of an existing extended attribute. Fail if it
969    /// doesn't already exist.
970    Replace = 3,
971}
972
973impl SetExtendedAttributeMode {
974    #[inline]
975    pub fn from_primitive(prim: u32) -> Option<Self> {
976        match prim {
977            1 => Some(Self::Set),
978            2 => Some(Self::Create),
979            3 => Some(Self::Replace),
980            _ => None,
981        }
982    }
983
984    #[inline]
985    pub const fn into_primitive(self) -> u32 {
986        self as u32
987    }
988}
989
990#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
991#[repr(u8)]
992pub enum WatchEvent {
993    /// Indicates the directory being watched has been deleted. The name returned for this event
994    /// will be `.` (dot), as it is refering to the directory itself.
995    Deleted = 0,
996    /// Indicates a node has been created (either new or moved) into a directory.
997    Added = 1,
998    /// Identifies a node has been removed (either deleted or moved) from the directory.
999    Removed = 2,
1000    /// Identifies a node already existed in the directory when watching started.
1001    Existing = 3,
1002    /// Identifies that no more `EXISTING` events will be sent. The name returned for this event
1003    /// will be empty, as it is not refering to a specific entry.
1004    Idle = 4,
1005}
1006
1007impl WatchEvent {
1008    #[inline]
1009    pub fn from_primitive(prim: u8) -> Option<Self> {
1010        match prim {
1011            0 => Some(Self::Deleted),
1012            1 => Some(Self::Added),
1013            2 => Some(Self::Removed),
1014            3 => Some(Self::Existing),
1015            4 => Some(Self::Idle),
1016            _ => None,
1017        }
1018    }
1019
1020    #[inline]
1021    pub const fn into_primitive(self) -> u8 {
1022        self as u8
1023    }
1024}
1025
1026#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1027pub struct AdvisoryLockRange {
1028    /// The location in the file from which [`offset`] is computed.
1029    pub origin: SeekOrigin,
1030    /// The start of the byte range, expressed as an offset from [`origin`].
1031    /// Cannot be negative if [`origin`] is [`SeekOrigin.START`].
1032    pub offset: i64,
1033    /// The length of the byte range in bytes.
1034    ///
1035    /// If the length is zero, then the byte range extends until the end of the
1036    /// file, regardless of how large the file becomes.
1037    ///
1038    /// If the length is negative, the byte range includes the bytes `offset` +
1039    /// `length` up to, and including, `offset` - 1, provided this range does
1040    /// not extend beyond the beginning of the file.
1041    pub length: i64,
1042}
1043
1044impl fidl::Persistable for AdvisoryLockRange {}
1045
1046#[derive(Clone, Debug, PartialEq)]
1047pub struct AdvisoryLockingAdvisoryLockRequest {
1048    pub request: AdvisoryLockRequest,
1049}
1050
1051impl fidl::Persistable for AdvisoryLockingAdvisoryLockRequest {}
1052
1053#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1054#[repr(C)]
1055pub struct DirectoryLinkResponse {
1056    pub s: i32,
1057}
1058
1059impl fidl::Persistable for DirectoryLinkResponse {}
1060
1061#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1062pub struct DirectoryObject;
1063
1064impl fidl::Persistable for DirectoryObject {}
1065
1066#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1067#[repr(C)]
1068pub struct DirectoryReadDirentsRequest {
1069    pub max_bytes: u64,
1070}
1071
1072impl fidl::Persistable for DirectoryReadDirentsRequest {}
1073
1074#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1075pub struct DirectoryReadDirentsResponse {
1076    pub s: i32,
1077    pub dirents: Vec<u8>,
1078}
1079
1080impl fidl::Persistable for DirectoryReadDirentsResponse {}
1081
1082#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1083#[repr(C)]
1084pub struct DirectoryRewindResponse {
1085    pub s: i32,
1086}
1087
1088impl fidl::Persistable for DirectoryRewindResponse {}
1089
1090#[derive(Clone, Debug, PartialEq)]
1091pub struct DirectoryUnlinkRequest {
1092    pub name: String,
1093    pub options: UnlinkOptions,
1094}
1095
1096impl fidl::Persistable for DirectoryUnlinkRequest {}
1097
1098#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1099#[repr(C)]
1100pub struct DirectoryWatchResponse {
1101    pub s: i32,
1102}
1103
1104impl fidl::Persistable for DirectoryWatchResponse {}
1105
1106/// Used in places where empty structs are needed, such as empty union members, to avoid creating
1107/// new struct types.
1108#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1109pub struct EmptyStruct;
1110
1111impl fidl::Persistable for EmptyStruct {}
1112
1113#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1114pub struct ExtendedAttributeIteratorGetNextResponse {
1115    pub attributes: Vec<Vec<u8>>,
1116    pub last: bool,
1117}
1118
1119impl fidl::Persistable for ExtendedAttributeIteratorGetNextResponse {}
1120
1121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1122pub struct FileGetBackingMemoryRequest {
1123    pub flags: VmoFlags,
1124}
1125
1126impl fidl::Persistable for FileGetBackingMemoryRequest {}
1127
1128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1129#[repr(C)]
1130pub struct FileReadAtRequest {
1131    pub count: u64,
1132    pub offset: u64,
1133}
1134
1135impl fidl::Persistable for FileReadAtRequest {}
1136
1137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1138#[repr(C)]
1139pub struct FileResizeRequest {
1140    pub length: u64,
1141}
1142
1143impl fidl::Persistable for FileResizeRequest {}
1144
1145#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1146pub struct FileSeekRequest {
1147    pub origin: SeekOrigin,
1148    pub offset: i64,
1149}
1150
1151impl fidl::Persistable for FileSeekRequest {}
1152
1153#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1154pub struct FileWriteAtRequest {
1155    pub data: Vec<u8>,
1156    pub offset: u64,
1157}
1158
1159impl fidl::Persistable for FileWriteAtRequest {}
1160
1161#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1162pub struct FileReadAtResponse {
1163    pub data: Vec<u8>,
1164}
1165
1166impl fidl::Persistable for FileReadAtResponse {}
1167
1168#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1169#[repr(C)]
1170pub struct FileSeekResponse {
1171    pub offset_from_start: u64,
1172}
1173
1174impl fidl::Persistable for FileSeekResponse {}
1175
1176#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1177#[repr(C)]
1178pub struct FileWriteAtResponse {
1179    pub actual_count: u64,
1180}
1181
1182impl fidl::Persistable for FileWriteAtResponse {}
1183
1184#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1185#[repr(C)]
1186pub struct FilesystemInfo {
1187    /// The number of data bytes which may be stored in a filesystem. This does not count
1188    /// metadata or other filesystem overhead like block rounding.
1189    pub total_bytes: u64,
1190    /// The number of data bytes which are in use by the filesystem. This does not count
1191    /// metadata or other filesystem overhead like block rounding.
1192    pub used_bytes: u64,
1193    /// The number of nodes which may be stored in the filesystem.
1194    pub total_nodes: u64,
1195    /// The number of nodes used by the filesystem.
1196    pub used_nodes: u64,
1197    /// The amount of additional space which may be allocated from the underlying volume
1198    /// manager. If unsupported or there is no space for the filesystem to grow, this will
1199    /// be zero.
1200    pub free_shared_pool_bytes: u64,
1201    /// A unique identifier for this filesystem instance. Will not be preserved across
1202    /// reboots.
1203    ///
1204    /// Implementors should create a kernel object (normally an event) and use its koid for
1205    /// the filesystem ID. This koid guarantees uniqueness in the system.
1206    pub fs_id: u64,
1207    /// The size in bytes of a single filesystem block.
1208    pub block_size: u32,
1209    /// The maximum length of a filesystem name.
1210    pub max_filename_size: u32,
1211    /// A unique identifier for the type of the underlying filesystem.
1212    pub fs_type: u32,
1213    pub padding: u32,
1214    pub name: [i8; 32],
1215}
1216
1217impl fidl::Persistable for FilesystemInfo {}
1218
1219/// Fscrypt encryption policy associated with an encrypted directory or file.
1220#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1221pub struct FscryptPolicy {
1222    /// The 16-byte main key identifier (corresponding to
1223    /// `fscrypt_policy_v2.master_key_identifier`).
1224    pub key_identifier: [u8; 16],
1225    /// The policy flags (corresponding to `fscrypt_policy_v2.flags`).
1226    pub flags: FscryptPolicyFlags,
1227}
1228
1229impl fidl::Persistable for FscryptPolicy {}
1230
1231/// NodeAttributes defines generic information about a filesystem node.
1232#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1233#[repr(C)]
1234pub struct NodeAttributes {
1235    /// Protection bits and node type information describe in 'mode'.
1236    pub mode: u32,
1237    /// A filesystem-unique ID.
1238    pub id: u64,
1239    /// Node size, in bytes.
1240    pub content_size: u64,
1241    /// Space needed to store node (possibly larger than size), in bytes.
1242    pub storage_size: u64,
1243    /// Hard link count.
1244    pub link_count: u64,
1245    /// Time of creation (may be updated manually after creation) in ns since Unix epoch, UTC.
1246    pub creation_time: u64,
1247    /// Time of last modification in ns since Unix epoch, UTC.
1248    pub modification_time: u64,
1249}
1250
1251impl fidl::Persistable for NodeAttributes {}
1252
1253#[derive(Clone, Debug, PartialEq)]
1254pub struct NodeAttributes2 {
1255    pub mutable_attributes: MutableNodeAttributes,
1256    pub immutable_attributes: ImmutableNodeAttributes,
1257}
1258
1259impl fidl::Persistable for NodeAttributes2 {}
1260
1261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1262#[repr(C)]
1263pub struct NodeDeprecatedGetAttrResponse {
1264    pub s: i32,
1265    pub attributes: NodeAttributes,
1266}
1267
1268impl fidl::Persistable for NodeDeprecatedGetAttrResponse {}
1269
1270#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1271pub struct NodeDeprecatedGetFlagsResponse {
1272    pub s: i32,
1273    pub flags: OpenFlags,
1274}
1275
1276impl fidl::Persistable for NodeDeprecatedGetFlagsResponse {}
1277
1278#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1279pub struct NodeDeprecatedSetAttrRequest {
1280    pub flags: NodeAttributeFlags,
1281    pub attributes: NodeAttributes,
1282}
1283
1284impl fidl::Persistable for NodeDeprecatedSetAttrRequest {}
1285
1286#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1287#[repr(C)]
1288pub struct NodeDeprecatedSetAttrResponse {
1289    pub s: i32,
1290}
1291
1292impl fidl::Persistable for NodeDeprecatedSetAttrResponse {}
1293
1294#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1295pub struct NodeDeprecatedSetFlagsRequest {
1296    pub flags: OpenFlags,
1297}
1298
1299impl fidl::Persistable for NodeDeprecatedSetFlagsRequest {}
1300
1301#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1302#[repr(C)]
1303pub struct NodeDeprecatedSetFlagsResponse {
1304    pub s: i32,
1305}
1306
1307impl fidl::Persistable for NodeDeprecatedSetFlagsResponse {}
1308
1309#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1310pub struct NodeGetAttributesRequest {
1311    /// Set the corresponding bit to one to query that particular attribute.
1312    ///
1313    /// The elements here correspond one-to-one with [`NodeAttributes`].
1314    pub query: NodeAttributesQuery,
1315}
1316
1317impl fidl::Persistable for NodeGetAttributesRequest {}
1318
1319#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1320pub struct NodeGetExtendedAttributeRequest {
1321    pub name: Vec<u8>,
1322}
1323
1324impl fidl::Persistable for NodeGetExtendedAttributeRequest {}
1325
1326#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1327pub struct NodeQueryFilesystemResponse {
1328    pub s: i32,
1329    pub info: Option<Box<FilesystemInfo>>,
1330}
1331
1332impl fidl::Persistable for NodeQueryFilesystemResponse {}
1333
1334#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1335pub struct NodeRemoveExtendedAttributeRequest {
1336    pub name: Vec<u8>,
1337}
1338
1339impl fidl::Persistable for NodeRemoveExtendedAttributeRequest {}
1340
1341#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1342pub struct NodeSetFlagsRequest {
1343    pub flags: Flags,
1344}
1345
1346impl fidl::Persistable for NodeSetFlagsRequest {}
1347
1348#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1349pub struct NodeGetFlagsResponse {
1350    pub flags: Flags,
1351}
1352
1353impl fidl::Persistable for NodeGetFlagsResponse {}
1354
1355#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1356#[repr(C)]
1357pub struct ReadableReadRequest {
1358    pub count: u64,
1359}
1360
1361impl fidl::Persistable for ReadableReadRequest {}
1362
1363#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1364pub struct ReadableReadResponse {
1365    pub data: Vec<u8>,
1366}
1367
1368impl fidl::Persistable for ReadableReadResponse {}
1369
1370#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1371pub struct Service;
1372
1373impl fidl::Persistable for Service {}
1374
1375#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1376pub struct SymlinkObject {
1377    pub target: Vec<u8>,
1378}
1379
1380impl fidl::Persistable for SymlinkObject {}
1381
1382#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1383pub struct WritableWriteRequest {
1384    pub data: Vec<u8>,
1385}
1386
1387impl fidl::Persistable for WritableWriteRequest {}
1388
1389#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1390#[repr(C)]
1391pub struct WritableWriteResponse {
1392    pub actual_count: u64,
1393}
1394
1395impl fidl::Persistable for WritableWriteResponse {}
1396
1397#[derive(Clone, Debug, Default, PartialEq)]
1398pub struct AdvisoryLockRequest {
1399    /// The type of lock to be acquired.
1400    ///
1401    /// If this field is absent, the [`AdvisoryLock`] method will fail
1402    /// with ZX_ERR_INVALID_ARGS.
1403    pub type_: Option<AdvisoryLockType>,
1404    /// The byte range within the file to be locked.
1405    ///
1406    /// The range can extend beyond the end of the file but cannot extend beyond
1407    /// the beginning of the file.
1408    ///
1409    /// If this field is absent, the range defaults to the entire file.
1410    pub range: Option<AdvisoryLockRange>,
1411    /// Whether the file should wait reply to the [`AdvisoryLock`]
1412    /// method until the requested lock can be acquired.
1413    ///
1414    /// If this field is absent, the file will not wait.
1415    pub wait: Option<bool>,
1416    #[doc(hidden)]
1417    pub __source_breaking: fidl::marker::SourceBreaking,
1418}
1419
1420impl fidl::Persistable for AdvisoryLockRequest {}
1421
1422#[derive(Clone, Debug, Default, PartialEq)]
1423pub struct DirectoryInfo {
1424    /// Requested attributes for the directory. This is only populated if requested.
1425    pub attributes: Option<NodeAttributes2>,
1426    #[doc(hidden)]
1427    pub __source_breaking: fidl::marker::SourceBreaking,
1428}
1429
1430impl fidl::Persistable for DirectoryInfo {}
1431
1432#[derive(Clone, Debug, Default, PartialEq)]
1433pub struct ImmutableNodeAttributes {
1434    /// Describes the kinds of representations supported by the node.
1435    /// Note: This is not the result of the connection-time negotiation,
1436    /// which is conveyed via `representation`.
1437    pub protocols: Option<NodeProtocolKinds>,
1438    /// Describes the kinds of operations supported by the node.
1439    /// Note: This is distinct from the rights used at connection time.
1440    pub abilities: Option<Operations>,
1441    /// Node size, in bytes.
1442    pub content_size: Option<u64>,
1443    /// Space needed to store the node (possibly larger than size), in bytes.
1444    pub storage_size: Option<u64>,
1445    /// Number of hard links to the node. It must be at least one.
1446    pub link_count: Option<u64>,
1447    /// An ID for the node. See [`Id`].
1448    /// This `id` should be unique among all entries of a directory.
1449    pub id: Option<u64>,
1450    /// Time of last change to the metadata in nanoseconds since the Unix epoch, UTC.
1451    pub change_time: Option<u64>,
1452    /// Contains the verification options for verity-enabled files.
1453    pub options: Option<VerificationOptions>,
1454    /// The root hash for the file. Not all filesystems support this across all files.
1455    pub root_hash: Option<Vec<u8>>,
1456    /// True if this file is verity-enabled.
1457    pub verity_enabled: Option<bool>,
1458    #[doc(hidden)]
1459    pub __source_breaking: fidl::marker::SourceBreaking,
1460}
1461
1462impl fidl::Persistable for ImmutableNodeAttributes {}
1463
1464#[derive(Clone, Debug, Default, PartialEq)]
1465pub struct MutableNodeAttributes {
1466    /// Time of creation in nanoseconds since the Unix epoch, UTC.
1467    pub creation_time: Option<u64>,
1468    /// Time of last modification in nanoseconds since the Unix epoch, UTC.
1469    pub modification_time: Option<u64>,
1470    /// POSIX compatibility attributes. Most filesystems will not support
1471    /// these. Those that do must simply store and retrieve them (e.g. as
1472    /// extended attributes) and not attempt to interpret them (e.g. by doing
1473    /// permission checks or handling device opens specially).
1474    pub mode: Option<u32>,
1475    pub uid: Option<u32>,
1476    pub gid: Option<u32>,
1477    pub rdev: Option<u64>,
1478    /// Time of last access in nanoseconds since the Unix epoch, UTC. Note that servers might not
1479    /// always update this if this is the only attribute being updated.
1480    pub access_time: Option<u64>,
1481    /// Casefold (case-insensitive filename) support
1482    /// This attribute can only be changed on empty directories and will be inherited by any
1483    /// child directories that are subsequently created.
1484    /// The only filesystem to support this at the time of writing is Fxfs.
1485    pub casefold: Option<bool>,
1486    /// The value of the extended attribute "security.selinux" to be used in the context of SELinux
1487    /// implementations. The value can only be set or returned if it is
1488    /// [`MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN`] characters or less to constrain the size of the
1489    /// response. If the value is not currently found on the node the response the field will not
1490    /// be included in the response. If the value is found on the node but the server is not
1491    /// returning it here due to size or implementation, then it will return
1492    /// `use_extended_attributes` to indicate using the ['fuchsia.io/Node.GetExtendedAttribute`]
1493    /// to retrieve it.
1494    ///
1495    /// ZX_ERR_INVALID_ARGS will be returned if there is an attempt set this attribute with the
1496    /// `use_extended_attributes` member.
1497    pub selinux_context: Option<SelinuxContext>,
1498    /// Fscrypt encryption policy support.
1499    /// This attribute can only be changed on empty directories and will be inherited by any
1500    /// child directories that are subsequently created. This attribute can only be set once per
1501    /// directory. The policy set will be used to encrypt file contents and filenames for
1502    /// this directory and its children.
1503    /// The only filesystem to support this at the time of writing is Fxfs.
1504    pub encryption_policy: Option<FscryptPolicy>,
1505    #[doc(hidden)]
1506    pub __source_breaking: fidl::marker::SourceBreaking,
1507}
1508
1509impl fidl::Persistable for MutableNodeAttributes {}
1510
1511/// Information that describes the target node.
1512#[derive(Clone, Debug, Default, PartialEq)]
1513pub struct NodeInfo {
1514    pub attributes: Option<NodeAttributes2>,
1515    #[doc(hidden)]
1516    pub __source_breaking: fidl::marker::SourceBreaking,
1517}
1518
1519impl fidl::Persistable for NodeInfo {}
1520
1521/// Options which can be used when opening nodes. Unlike [`Flags`], these options are designed for
1522/// specific use cases (e.g. to reduce round-trip latency when requesting attributes).
1523#[derive(Clone, Debug, Default, PartialEq)]
1524pub struct Options {
1525    /// Request a set of attributes to be sent with the OnRepresentation response. Has no effect
1526    /// if `Flags.FLAG_SEND_REPRESENTATION` is not set.
1527    pub attributes: Option<NodeAttributesQuery>,
1528    /// Request a set of attributes to be set atomically when creating a new object. Requests will
1529    /// fail with `ZX_ERR_INVALID_ARGS` if neither `Flags.FLAG_MAYBE_CREATE` nor
1530    /// `Flags.FLAG_MUST_CREATE` are set (i.e. the creation is mode is Never).
1531    pub create_attributes: Option<MutableNodeAttributes>,
1532    #[doc(hidden)]
1533    pub __source_breaking: fidl::marker::SourceBreaking,
1534}
1535
1536impl fidl::Persistable for Options {}
1537
1538#[derive(Clone, Debug, Default, PartialEq)]
1539pub struct SymlinkInfo {
1540    /// The symbolic link has no meaning on the server; the client is free to interpret the
1541    /// target however it chooses.
1542    pub target: Option<Vec<u8>>,
1543    /// Requested attributes for the symbolic link. This is only populated if requested.
1544    pub attributes: Option<NodeAttributes2>,
1545    #[doc(hidden)]
1546    pub __source_breaking: fidl::marker::SourceBreaking,
1547}
1548
1549impl fidl::Persistable for SymlinkInfo {}
1550
1551#[derive(Clone, Debug, Default, PartialEq)]
1552pub struct UnlinkOptions {
1553    pub flags: Option<UnlinkFlags>,
1554    #[doc(hidden)]
1555    pub __source_breaking: fidl::marker::SourceBreaking,
1556}
1557
1558impl fidl::Persistable for UnlinkOptions {}
1559
1560/// Set of options used to enable verity on a file.
1561#[derive(Clone, Debug, Default, PartialEq)]
1562pub struct VerificationOptions {
1563    pub hash_algorithm: Option<HashAlgorithm>,
1564    /// `salt` is prepended to each block before it is hashed.
1565    pub salt: Option<Vec<u8>>,
1566    #[doc(hidden)]
1567    pub __source_breaking: fidl::marker::SourceBreaking,
1568}
1569
1570impl fidl::Persistable for VerificationOptions {}
1571
1572#[derive(Clone, Debug)]
1573pub enum SelinuxContext {
1574    Data(Vec<u8>),
1575    UseExtendedAttributes(EmptyStruct),
1576    #[doc(hidden)]
1577    __SourceBreaking {
1578        unknown_ordinal: u64,
1579    },
1580}
1581
1582/// Pattern that matches an unknown `SelinuxContext` member.
1583#[macro_export]
1584macro_rules! SelinuxContextUnknown {
1585    () => {
1586        _
1587    };
1588}
1589
1590// Custom PartialEq so that unknown variants are not equal to themselves.
1591impl PartialEq for SelinuxContext {
1592    fn eq(&self, other: &Self) -> bool {
1593        match (self, other) {
1594            (Self::Data(x), Self::Data(y)) => *x == *y,
1595            (Self::UseExtendedAttributes(x), Self::UseExtendedAttributes(y)) => *x == *y,
1596            _ => false,
1597        }
1598    }
1599}
1600
1601impl SelinuxContext {
1602    #[inline]
1603    pub fn ordinal(&self) -> u64 {
1604        match *self {
1605            Self::Data(_) => 1,
1606            Self::UseExtendedAttributes(_) => 2,
1607            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1608        }
1609    }
1610
1611    #[inline]
1612    pub fn unknown_variant_for_testing() -> Self {
1613        Self::__SourceBreaking { unknown_ordinal: 0 }
1614    }
1615
1616    #[inline]
1617    pub fn is_unknown(&self) -> bool {
1618        match self {
1619            Self::__SourceBreaking { .. } => true,
1620            _ => false,
1621        }
1622    }
1623}
1624
1625impl fidl::Persistable for SelinuxContext {}
1626
1627pub mod advisory_locking_ordinals {
1628    pub const ADVISORY_LOCK: u64 = 0x6ee9c0ad53ec87aa;
1629}
1630
1631pub mod directory_ordinals {
1632    pub const ADVISORY_LOCK: u64 = 0x6ee9c0ad53ec87aa;
1633    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1634    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1635    pub const QUERY: u64 = 0x2658edee9decfc06;
1636    pub const DEPRECATED_CLONE: u64 = 0x5a61678f293ce16f;
1637    pub const ON_OPEN_: u64 = 0x7fc7bbb1dbfd1972;
1638    pub const DEPRECATED_GET_ATTR: u64 = 0x78985e216314dafd;
1639    pub const DEPRECATED_SET_ATTR: u64 = 0x4186c0f40d938f46;
1640    pub const DEPRECATED_GET_FLAGS: u64 = 0x5b88fffb8eda3aa1;
1641    pub const DEPRECATED_SET_FLAGS: u64 = 0x5295b76c71fde733;
1642    pub const GET_FLAGS: u64 = 0x176eb318f64ec23;
1643    pub const SET_FLAGS: u64 = 0x55a8028685791ea8;
1644    pub const QUERY_FILESYSTEM: u64 = 0x6f344a1c6b0a0610;
1645    pub const ON_REPRESENTATION: u64 = 0x5cb40567d80a510c;
1646    pub const GET_ATTRIBUTES: u64 = 0x3d4396a638ea053b;
1647    pub const UPDATE_ATTRIBUTES: u64 = 0x3308c1da5a89bf08;
1648    pub const SYNC: u64 = 0x2c5c27ca0ab5dc49;
1649    pub const LIST_EXTENDED_ATTRIBUTES: u64 = 0x4b61033de007fcd0;
1650    pub const GET_EXTENDED_ATTRIBUTE: u64 = 0x45ffa3ccfdeb76db;
1651    pub const SET_EXTENDED_ATTRIBUTE: u64 = 0x4a951362f681f23c;
1652    pub const REMOVE_EXTENDED_ATTRIBUTE: u64 = 0x7a0b9f3a9bf9032d;
1653    pub const OPEN: u64 = 0x568ddcb9a9cbb6d9;
1654    pub const DEPRECATED_OPEN: u64 = 0x2c5044561d685ec0;
1655    pub const READ_DIRENTS: u64 = 0x3582806bf27faa0a;
1656    pub const REWIND: u64 = 0x16b1202af0f34c71;
1657    pub const GET_TOKEN: u64 = 0x26ae9d18763c8655;
1658    pub const LINK: u64 = 0x740604c0c7c930e7;
1659    pub const UNLINK: u64 = 0x750a0326a78d7bed;
1660    pub const RENAME: u64 = 0x7060e7723b9928de;
1661    pub const CREATE_SYMLINK: u64 = 0x21ce0f19ec043889;
1662    pub const WATCH: u64 = 0x5717193a59d66d91;
1663}
1664
1665pub mod directory_watcher_ordinals {}
1666
1667pub mod extended_attribute_iterator_ordinals {
1668    pub const GET_NEXT: u64 = 0x3ba664a1c2e45a7;
1669}
1670
1671pub mod file_ordinals {
1672    pub const ADVISORY_LOCK: u64 = 0x6ee9c0ad53ec87aa;
1673    pub const LINK_INTO: u64 = 0x54f3949246a03e74;
1674    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1675    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1676    pub const QUERY: u64 = 0x2658edee9decfc06;
1677    pub const DEPRECATED_CLONE: u64 = 0x5a61678f293ce16f;
1678    pub const ON_OPEN_: u64 = 0x7fc7bbb1dbfd1972;
1679    pub const DEPRECATED_GET_ATTR: u64 = 0x78985e216314dafd;
1680    pub const DEPRECATED_SET_ATTR: u64 = 0x4186c0f40d938f46;
1681    pub const DEPRECATED_GET_FLAGS: u64 = 0x5b88fffb8eda3aa1;
1682    pub const DEPRECATED_SET_FLAGS: u64 = 0x5295b76c71fde733;
1683    pub const GET_FLAGS: u64 = 0x176eb318f64ec23;
1684    pub const SET_FLAGS: u64 = 0x55a8028685791ea8;
1685    pub const QUERY_FILESYSTEM: u64 = 0x6f344a1c6b0a0610;
1686    pub const ON_REPRESENTATION: u64 = 0x5cb40567d80a510c;
1687    pub const GET_ATTRIBUTES: u64 = 0x3d4396a638ea053b;
1688    pub const UPDATE_ATTRIBUTES: u64 = 0x3308c1da5a89bf08;
1689    pub const SYNC: u64 = 0x2c5c27ca0ab5dc49;
1690    pub const LIST_EXTENDED_ATTRIBUTES: u64 = 0x4b61033de007fcd0;
1691    pub const GET_EXTENDED_ATTRIBUTE: u64 = 0x45ffa3ccfdeb76db;
1692    pub const SET_EXTENDED_ATTRIBUTE: u64 = 0x4a951362f681f23c;
1693    pub const REMOVE_EXTENDED_ATTRIBUTE: u64 = 0x7a0b9f3a9bf9032d;
1694    pub const READ: u64 = 0x57e419a298c8ede;
1695    pub const WRITE: u64 = 0x6a31437832469f82;
1696    pub const DESCRIBE: u64 = 0x68b5ac00c62906bc;
1697    pub const SEEK: u64 = 0x78079168162c5207;
1698    pub const READ_AT: u64 = 0x1607a293a60d723e;
1699    pub const WRITE_AT: u64 = 0x793eefc0045e792b;
1700    pub const RESIZE: u64 = 0x2b80825f0535743a;
1701    pub const GET_BACKING_MEMORY: u64 = 0xa6a9e654cbf62b;
1702    pub const ALLOCATE: u64 = 0x77fa0c330b57fd2e;
1703    pub const ENABLE_VERITY: u64 = 0x2c421ec3faaeb8bb;
1704}
1705
1706pub mod linkable_ordinals {
1707    pub const LINK_INTO: u64 = 0x54f3949246a03e74;
1708}
1709
1710pub mod node_ordinals {
1711    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1712    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1713    pub const QUERY: u64 = 0x2658edee9decfc06;
1714    pub const DEPRECATED_CLONE: u64 = 0x5a61678f293ce16f;
1715    pub const ON_OPEN_: u64 = 0x7fc7bbb1dbfd1972;
1716    pub const DEPRECATED_GET_ATTR: u64 = 0x78985e216314dafd;
1717    pub const DEPRECATED_SET_ATTR: u64 = 0x4186c0f40d938f46;
1718    pub const DEPRECATED_GET_FLAGS: u64 = 0x5b88fffb8eda3aa1;
1719    pub const DEPRECATED_SET_FLAGS: u64 = 0x5295b76c71fde733;
1720    pub const GET_FLAGS: u64 = 0x176eb318f64ec23;
1721    pub const SET_FLAGS: u64 = 0x55a8028685791ea8;
1722    pub const QUERY_FILESYSTEM: u64 = 0x6f344a1c6b0a0610;
1723    pub const ON_REPRESENTATION: u64 = 0x5cb40567d80a510c;
1724    pub const GET_ATTRIBUTES: u64 = 0x3d4396a638ea053b;
1725    pub const UPDATE_ATTRIBUTES: u64 = 0x3308c1da5a89bf08;
1726    pub const SYNC: u64 = 0x2c5c27ca0ab5dc49;
1727    pub const LIST_EXTENDED_ATTRIBUTES: u64 = 0x4b61033de007fcd0;
1728    pub const GET_EXTENDED_ATTRIBUTE: u64 = 0x45ffa3ccfdeb76db;
1729    pub const SET_EXTENDED_ATTRIBUTE: u64 = 0x4a951362f681f23c;
1730    pub const REMOVE_EXTENDED_ATTRIBUTE: u64 = 0x7a0b9f3a9bf9032d;
1731}
1732
1733pub mod openable_ordinals {
1734    pub const OPEN: u64 = 0x568ddcb9a9cbb6d9;
1735}
1736
1737pub mod readable_ordinals {
1738    pub const READ: u64 = 0x57e419a298c8ede;
1739}
1740
1741pub mod symlink_ordinals {
1742    pub const LINK_INTO: u64 = 0x54f3949246a03e74;
1743    pub const CLONE: u64 = 0x20d8a7aba2168a79;
1744    pub const CLOSE: u64 = 0x5ac5d459ad7f657e;
1745    pub const QUERY: u64 = 0x2658edee9decfc06;
1746    pub const DEPRECATED_CLONE: u64 = 0x5a61678f293ce16f;
1747    pub const ON_OPEN_: u64 = 0x7fc7bbb1dbfd1972;
1748    pub const DEPRECATED_GET_ATTR: u64 = 0x78985e216314dafd;
1749    pub const DEPRECATED_SET_ATTR: u64 = 0x4186c0f40d938f46;
1750    pub const DEPRECATED_GET_FLAGS: u64 = 0x5b88fffb8eda3aa1;
1751    pub const DEPRECATED_SET_FLAGS: u64 = 0x5295b76c71fde733;
1752    pub const GET_FLAGS: u64 = 0x176eb318f64ec23;
1753    pub const SET_FLAGS: u64 = 0x55a8028685791ea8;
1754    pub const QUERY_FILESYSTEM: u64 = 0x6f344a1c6b0a0610;
1755    pub const ON_REPRESENTATION: u64 = 0x5cb40567d80a510c;
1756    pub const GET_ATTRIBUTES: u64 = 0x3d4396a638ea053b;
1757    pub const UPDATE_ATTRIBUTES: u64 = 0x3308c1da5a89bf08;
1758    pub const SYNC: u64 = 0x2c5c27ca0ab5dc49;
1759    pub const LIST_EXTENDED_ATTRIBUTES: u64 = 0x4b61033de007fcd0;
1760    pub const GET_EXTENDED_ATTRIBUTE: u64 = 0x45ffa3ccfdeb76db;
1761    pub const SET_EXTENDED_ATTRIBUTE: u64 = 0x4a951362f681f23c;
1762    pub const REMOVE_EXTENDED_ATTRIBUTE: u64 = 0x7a0b9f3a9bf9032d;
1763    pub const OPEN: u64 = 0x568ddcb9a9cbb6d9;
1764    pub const DESCRIBE: u64 = 0x742c2ea5e89831f3;
1765}
1766
1767pub mod writable_ordinals {
1768    pub const WRITE: u64 = 0x6a31437832469f82;
1769}
1770
1771mod internal {
1772    use super::*;
1773    unsafe impl fidl::encoding::TypeMarker for AllocateMode {
1774        type Owned = Self;
1775
1776        #[inline(always)]
1777        fn inline_align(_context: fidl::encoding::Context) -> usize {
1778            4
1779        }
1780
1781        #[inline(always)]
1782        fn inline_size(_context: fidl::encoding::Context) -> usize {
1783            4
1784        }
1785    }
1786
1787    impl fidl::encoding::ValueTypeMarker for AllocateMode {
1788        type Borrowed<'a> = Self;
1789        #[inline(always)]
1790        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1791            *value
1792        }
1793    }
1794
1795    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AllocateMode {
1796        #[inline]
1797        unsafe fn encode(
1798            self,
1799            encoder: &mut fidl::encoding::Encoder<'_, D>,
1800            offset: usize,
1801            _depth: fidl::encoding::Depth,
1802        ) -> fidl::Result<()> {
1803            encoder.debug_check_bounds::<Self>(offset);
1804            encoder.write_num(self.bits(), offset);
1805            Ok(())
1806        }
1807    }
1808
1809    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllocateMode {
1810        #[inline(always)]
1811        fn new_empty() -> Self {
1812            Self::empty()
1813        }
1814
1815        #[inline]
1816        unsafe fn decode(
1817            &mut self,
1818            decoder: &mut fidl::encoding::Decoder<'_, D>,
1819            offset: usize,
1820            _depth: fidl::encoding::Depth,
1821        ) -> fidl::Result<()> {
1822            decoder.debug_check_bounds::<Self>(offset);
1823            let prim = decoder.read_num::<u32>(offset);
1824            *self = Self::from_bits_allow_unknown(prim);
1825            Ok(())
1826        }
1827    }
1828    unsafe impl fidl::encoding::TypeMarker for FileSignal {
1829        type Owned = Self;
1830
1831        #[inline(always)]
1832        fn inline_align(_context: fidl::encoding::Context) -> usize {
1833            4
1834        }
1835
1836        #[inline(always)]
1837        fn inline_size(_context: fidl::encoding::Context) -> usize {
1838            4
1839        }
1840    }
1841
1842    impl fidl::encoding::ValueTypeMarker for FileSignal {
1843        type Borrowed<'a> = Self;
1844        #[inline(always)]
1845        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1846            *value
1847        }
1848    }
1849
1850    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FileSignal {
1851        #[inline]
1852        unsafe fn encode(
1853            self,
1854            encoder: &mut fidl::encoding::Encoder<'_, D>,
1855            offset: usize,
1856            _depth: fidl::encoding::Depth,
1857        ) -> fidl::Result<()> {
1858            encoder.debug_check_bounds::<Self>(offset);
1859            if self.bits() & Self::all().bits() != self.bits() {
1860                return Err(fidl::Error::InvalidBitsValue);
1861            }
1862            encoder.write_num(self.bits(), offset);
1863            Ok(())
1864        }
1865    }
1866
1867    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSignal {
1868        #[inline(always)]
1869        fn new_empty() -> Self {
1870            Self::empty()
1871        }
1872
1873        #[inline]
1874        unsafe fn decode(
1875            &mut self,
1876            decoder: &mut fidl::encoding::Decoder<'_, D>,
1877            offset: usize,
1878            _depth: fidl::encoding::Depth,
1879        ) -> fidl::Result<()> {
1880            decoder.debug_check_bounds::<Self>(offset);
1881            let prim = decoder.read_num::<u32>(offset);
1882            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1883            Ok(())
1884        }
1885    }
1886    unsafe impl fidl::encoding::TypeMarker for Flags {
1887        type Owned = Self;
1888
1889        #[inline(always)]
1890        fn inline_align(_context: fidl::encoding::Context) -> usize {
1891            8
1892        }
1893
1894        #[inline(always)]
1895        fn inline_size(_context: fidl::encoding::Context) -> usize {
1896            8
1897        }
1898    }
1899
1900    impl fidl::encoding::ValueTypeMarker for Flags {
1901        type Borrowed<'a> = Self;
1902        #[inline(always)]
1903        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1904            *value
1905        }
1906    }
1907
1908    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Flags {
1909        #[inline]
1910        unsafe fn encode(
1911            self,
1912            encoder: &mut fidl::encoding::Encoder<'_, D>,
1913            offset: usize,
1914            _depth: fidl::encoding::Depth,
1915        ) -> fidl::Result<()> {
1916            encoder.debug_check_bounds::<Self>(offset);
1917            encoder.write_num(self.bits(), offset);
1918            Ok(())
1919        }
1920    }
1921
1922    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Flags {
1923        #[inline(always)]
1924        fn new_empty() -> Self {
1925            Self::empty()
1926        }
1927
1928        #[inline]
1929        unsafe fn decode(
1930            &mut self,
1931            decoder: &mut fidl::encoding::Decoder<'_, D>,
1932            offset: usize,
1933            _depth: fidl::encoding::Depth,
1934        ) -> fidl::Result<()> {
1935            decoder.debug_check_bounds::<Self>(offset);
1936            let prim = decoder.read_num::<u64>(offset);
1937            *self = Self::from_bits_allow_unknown(prim);
1938            Ok(())
1939        }
1940    }
1941    unsafe impl fidl::encoding::TypeMarker for FscryptPolicyFlags {
1942        type Owned = Self;
1943
1944        #[inline(always)]
1945        fn inline_align(_context: fidl::encoding::Context) -> usize {
1946            1
1947        }
1948
1949        #[inline(always)]
1950        fn inline_size(_context: fidl::encoding::Context) -> usize {
1951            1
1952        }
1953    }
1954
1955    impl fidl::encoding::ValueTypeMarker for FscryptPolicyFlags {
1956        type Borrowed<'a> = Self;
1957        #[inline(always)]
1958        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1959            *value
1960        }
1961    }
1962
1963    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1964        for FscryptPolicyFlags
1965    {
1966        #[inline]
1967        unsafe fn encode(
1968            self,
1969            encoder: &mut fidl::encoding::Encoder<'_, D>,
1970            offset: usize,
1971            _depth: fidl::encoding::Depth,
1972        ) -> fidl::Result<()> {
1973            encoder.debug_check_bounds::<Self>(offset);
1974            encoder.write_num(self.bits(), offset);
1975            Ok(())
1976        }
1977    }
1978
1979    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FscryptPolicyFlags {
1980        #[inline(always)]
1981        fn new_empty() -> Self {
1982            Self::empty()
1983        }
1984
1985        #[inline]
1986        unsafe fn decode(
1987            &mut self,
1988            decoder: &mut fidl::encoding::Decoder<'_, D>,
1989            offset: usize,
1990            _depth: fidl::encoding::Depth,
1991        ) -> fidl::Result<()> {
1992            decoder.debug_check_bounds::<Self>(offset);
1993            let prim = decoder.read_num::<u8>(offset);
1994            *self = Self::from_bits_allow_unknown(prim);
1995            Ok(())
1996        }
1997    }
1998    unsafe impl fidl::encoding::TypeMarker for ModeType {
1999        type Owned = Self;
2000
2001        #[inline(always)]
2002        fn inline_align(_context: fidl::encoding::Context) -> usize {
2003            4
2004        }
2005
2006        #[inline(always)]
2007        fn inline_size(_context: fidl::encoding::Context) -> usize {
2008            4
2009        }
2010    }
2011
2012    impl fidl::encoding::ValueTypeMarker for ModeType {
2013        type Borrowed<'a> = Self;
2014        #[inline(always)]
2015        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2016            *value
2017        }
2018    }
2019
2020    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ModeType {
2021        #[inline]
2022        unsafe fn encode(
2023            self,
2024            encoder: &mut fidl::encoding::Encoder<'_, D>,
2025            offset: usize,
2026            _depth: fidl::encoding::Depth,
2027        ) -> fidl::Result<()> {
2028            encoder.debug_check_bounds::<Self>(offset);
2029            if self.bits() & Self::all().bits() != self.bits() {
2030                return Err(fidl::Error::InvalidBitsValue);
2031            }
2032            encoder.write_num(self.bits(), offset);
2033            Ok(())
2034        }
2035    }
2036
2037    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ModeType {
2038        #[inline(always)]
2039        fn new_empty() -> Self {
2040            Self::empty()
2041        }
2042
2043        #[inline]
2044        unsafe fn decode(
2045            &mut self,
2046            decoder: &mut fidl::encoding::Decoder<'_, D>,
2047            offset: usize,
2048            _depth: fidl::encoding::Depth,
2049        ) -> fidl::Result<()> {
2050            decoder.debug_check_bounds::<Self>(offset);
2051            let prim = decoder.read_num::<u32>(offset);
2052            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2053            Ok(())
2054        }
2055    }
2056    unsafe impl fidl::encoding::TypeMarker for NodeAttributeFlags {
2057        type Owned = Self;
2058
2059        #[inline(always)]
2060        fn inline_align(_context: fidl::encoding::Context) -> usize {
2061            4
2062        }
2063
2064        #[inline(always)]
2065        fn inline_size(_context: fidl::encoding::Context) -> usize {
2066            4
2067        }
2068    }
2069
2070    impl fidl::encoding::ValueTypeMarker for NodeAttributeFlags {
2071        type Borrowed<'a> = Self;
2072        #[inline(always)]
2073        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2074            *value
2075        }
2076    }
2077
2078    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2079        for NodeAttributeFlags
2080    {
2081        #[inline]
2082        unsafe fn encode(
2083            self,
2084            encoder: &mut fidl::encoding::Encoder<'_, D>,
2085            offset: usize,
2086            _depth: fidl::encoding::Depth,
2087        ) -> fidl::Result<()> {
2088            encoder.debug_check_bounds::<Self>(offset);
2089            if self.bits() & Self::all().bits() != self.bits() {
2090                return Err(fidl::Error::InvalidBitsValue);
2091            }
2092            encoder.write_num(self.bits(), offset);
2093            Ok(())
2094        }
2095    }
2096
2097    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributeFlags {
2098        #[inline(always)]
2099        fn new_empty() -> Self {
2100            Self::empty()
2101        }
2102
2103        #[inline]
2104        unsafe fn decode(
2105            &mut self,
2106            decoder: &mut fidl::encoding::Decoder<'_, D>,
2107            offset: usize,
2108            _depth: fidl::encoding::Depth,
2109        ) -> fidl::Result<()> {
2110            decoder.debug_check_bounds::<Self>(offset);
2111            let prim = decoder.read_num::<u32>(offset);
2112            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2113            Ok(())
2114        }
2115    }
2116    unsafe impl fidl::encoding::TypeMarker for NodeAttributesQuery {
2117        type Owned = Self;
2118
2119        #[inline(always)]
2120        fn inline_align(_context: fidl::encoding::Context) -> usize {
2121            8
2122        }
2123
2124        #[inline(always)]
2125        fn inline_size(_context: fidl::encoding::Context) -> usize {
2126            8
2127        }
2128    }
2129
2130    impl fidl::encoding::ValueTypeMarker for NodeAttributesQuery {
2131        type Borrowed<'a> = Self;
2132        #[inline(always)]
2133        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2134            *value
2135        }
2136    }
2137
2138    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2139        for NodeAttributesQuery
2140    {
2141        #[inline]
2142        unsafe fn encode(
2143            self,
2144            encoder: &mut fidl::encoding::Encoder<'_, D>,
2145            offset: usize,
2146            _depth: fidl::encoding::Depth,
2147        ) -> fidl::Result<()> {
2148            encoder.debug_check_bounds::<Self>(offset);
2149            encoder.write_num(self.bits(), offset);
2150            Ok(())
2151        }
2152    }
2153
2154    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributesQuery {
2155        #[inline(always)]
2156        fn new_empty() -> Self {
2157            Self::empty()
2158        }
2159
2160        #[inline]
2161        unsafe fn decode(
2162            &mut self,
2163            decoder: &mut fidl::encoding::Decoder<'_, D>,
2164            offset: usize,
2165            _depth: fidl::encoding::Depth,
2166        ) -> fidl::Result<()> {
2167            decoder.debug_check_bounds::<Self>(offset);
2168            let prim = decoder.read_num::<u64>(offset);
2169            *self = Self::from_bits_allow_unknown(prim);
2170            Ok(())
2171        }
2172    }
2173    unsafe impl fidl::encoding::TypeMarker for NodeProtocolKinds {
2174        type Owned = Self;
2175
2176        #[inline(always)]
2177        fn inline_align(_context: fidl::encoding::Context) -> usize {
2178            8
2179        }
2180
2181        #[inline(always)]
2182        fn inline_size(_context: fidl::encoding::Context) -> usize {
2183            8
2184        }
2185    }
2186
2187    impl fidl::encoding::ValueTypeMarker for NodeProtocolKinds {
2188        type Borrowed<'a> = Self;
2189        #[inline(always)]
2190        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2191            *value
2192        }
2193    }
2194
2195    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2196        for NodeProtocolKinds
2197    {
2198        #[inline]
2199        unsafe fn encode(
2200            self,
2201            encoder: &mut fidl::encoding::Encoder<'_, D>,
2202            offset: usize,
2203            _depth: fidl::encoding::Depth,
2204        ) -> fidl::Result<()> {
2205            encoder.debug_check_bounds::<Self>(offset);
2206            encoder.write_num(self.bits(), offset);
2207            Ok(())
2208        }
2209    }
2210
2211    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeProtocolKinds {
2212        #[inline(always)]
2213        fn new_empty() -> Self {
2214            Self::empty()
2215        }
2216
2217        #[inline]
2218        unsafe fn decode(
2219            &mut self,
2220            decoder: &mut fidl::encoding::Decoder<'_, D>,
2221            offset: usize,
2222            _depth: fidl::encoding::Depth,
2223        ) -> fidl::Result<()> {
2224            decoder.debug_check_bounds::<Self>(offset);
2225            let prim = decoder.read_num::<u64>(offset);
2226            *self = Self::from_bits_allow_unknown(prim);
2227            Ok(())
2228        }
2229    }
2230    unsafe impl fidl::encoding::TypeMarker for OpenFlags {
2231        type Owned = Self;
2232
2233        #[inline(always)]
2234        fn inline_align(_context: fidl::encoding::Context) -> usize {
2235            4
2236        }
2237
2238        #[inline(always)]
2239        fn inline_size(_context: fidl::encoding::Context) -> usize {
2240            4
2241        }
2242    }
2243
2244    impl fidl::encoding::ValueTypeMarker for OpenFlags {
2245        type Borrowed<'a> = Self;
2246        #[inline(always)]
2247        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2248            *value
2249        }
2250    }
2251
2252    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OpenFlags {
2253        #[inline]
2254        unsafe fn encode(
2255            self,
2256            encoder: &mut fidl::encoding::Encoder<'_, D>,
2257            offset: usize,
2258            _depth: fidl::encoding::Depth,
2259        ) -> fidl::Result<()> {
2260            encoder.debug_check_bounds::<Self>(offset);
2261            if self.bits() & Self::all().bits() != self.bits() {
2262                return Err(fidl::Error::InvalidBitsValue);
2263            }
2264            encoder.write_num(self.bits(), offset);
2265            Ok(())
2266        }
2267    }
2268
2269    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenFlags {
2270        #[inline(always)]
2271        fn new_empty() -> Self {
2272            Self::empty()
2273        }
2274
2275        #[inline]
2276        unsafe fn decode(
2277            &mut self,
2278            decoder: &mut fidl::encoding::Decoder<'_, D>,
2279            offset: usize,
2280            _depth: fidl::encoding::Depth,
2281        ) -> fidl::Result<()> {
2282            decoder.debug_check_bounds::<Self>(offset);
2283            let prim = decoder.read_num::<u32>(offset);
2284            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2285            Ok(())
2286        }
2287    }
2288    unsafe impl fidl::encoding::TypeMarker for Operations {
2289        type Owned = Self;
2290
2291        #[inline(always)]
2292        fn inline_align(_context: fidl::encoding::Context) -> usize {
2293            8
2294        }
2295
2296        #[inline(always)]
2297        fn inline_size(_context: fidl::encoding::Context) -> usize {
2298            8
2299        }
2300    }
2301
2302    impl fidl::encoding::ValueTypeMarker for Operations {
2303        type Borrowed<'a> = Self;
2304        #[inline(always)]
2305        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2306            *value
2307        }
2308    }
2309
2310    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Operations {
2311        #[inline]
2312        unsafe fn encode(
2313            self,
2314            encoder: &mut fidl::encoding::Encoder<'_, D>,
2315            offset: usize,
2316            _depth: fidl::encoding::Depth,
2317        ) -> fidl::Result<()> {
2318            encoder.debug_check_bounds::<Self>(offset);
2319            encoder.write_num(self.bits(), offset);
2320            Ok(())
2321        }
2322    }
2323
2324    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Operations {
2325        #[inline(always)]
2326        fn new_empty() -> Self {
2327            Self::empty()
2328        }
2329
2330        #[inline]
2331        unsafe fn decode(
2332            &mut self,
2333            decoder: &mut fidl::encoding::Decoder<'_, D>,
2334            offset: usize,
2335            _depth: fidl::encoding::Depth,
2336        ) -> fidl::Result<()> {
2337            decoder.debug_check_bounds::<Self>(offset);
2338            let prim = decoder.read_num::<u64>(offset);
2339            *self = Self::from_bits_allow_unknown(prim);
2340            Ok(())
2341        }
2342    }
2343    unsafe impl fidl::encoding::TypeMarker for UnlinkFlags {
2344        type Owned = Self;
2345
2346        #[inline(always)]
2347        fn inline_align(_context: fidl::encoding::Context) -> usize {
2348            8
2349        }
2350
2351        #[inline(always)]
2352        fn inline_size(_context: fidl::encoding::Context) -> usize {
2353            8
2354        }
2355    }
2356
2357    impl fidl::encoding::ValueTypeMarker for UnlinkFlags {
2358        type Borrowed<'a> = Self;
2359        #[inline(always)]
2360        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2361            *value
2362        }
2363    }
2364
2365    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for UnlinkFlags {
2366        #[inline]
2367        unsafe fn encode(
2368            self,
2369            encoder: &mut fidl::encoding::Encoder<'_, D>,
2370            offset: usize,
2371            _depth: fidl::encoding::Depth,
2372        ) -> fidl::Result<()> {
2373            encoder.debug_check_bounds::<Self>(offset);
2374            encoder.write_num(self.bits(), offset);
2375            Ok(())
2376        }
2377    }
2378
2379    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnlinkFlags {
2380        #[inline(always)]
2381        fn new_empty() -> Self {
2382            Self::empty()
2383        }
2384
2385        #[inline]
2386        unsafe fn decode(
2387            &mut self,
2388            decoder: &mut fidl::encoding::Decoder<'_, D>,
2389            offset: usize,
2390            _depth: fidl::encoding::Depth,
2391        ) -> fidl::Result<()> {
2392            decoder.debug_check_bounds::<Self>(offset);
2393            let prim = decoder.read_num::<u64>(offset);
2394            *self = Self::from_bits_allow_unknown(prim);
2395            Ok(())
2396        }
2397    }
2398    unsafe impl fidl::encoding::TypeMarker for VmoFlags {
2399        type Owned = Self;
2400
2401        #[inline(always)]
2402        fn inline_align(_context: fidl::encoding::Context) -> usize {
2403            4
2404        }
2405
2406        #[inline(always)]
2407        fn inline_size(_context: fidl::encoding::Context) -> usize {
2408            4
2409        }
2410    }
2411
2412    impl fidl::encoding::ValueTypeMarker for VmoFlags {
2413        type Borrowed<'a> = Self;
2414        #[inline(always)]
2415        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2416            *value
2417        }
2418    }
2419
2420    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VmoFlags {
2421        #[inline]
2422        unsafe fn encode(
2423            self,
2424            encoder: &mut fidl::encoding::Encoder<'_, D>,
2425            offset: usize,
2426            _depth: fidl::encoding::Depth,
2427        ) -> fidl::Result<()> {
2428            encoder.debug_check_bounds::<Self>(offset);
2429            if self.bits() & Self::all().bits() != self.bits() {
2430                return Err(fidl::Error::InvalidBitsValue);
2431            }
2432            encoder.write_num(self.bits(), offset);
2433            Ok(())
2434        }
2435    }
2436
2437    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoFlags {
2438        #[inline(always)]
2439        fn new_empty() -> Self {
2440            Self::empty()
2441        }
2442
2443        #[inline]
2444        unsafe fn decode(
2445            &mut self,
2446            decoder: &mut fidl::encoding::Decoder<'_, D>,
2447            offset: usize,
2448            _depth: fidl::encoding::Depth,
2449        ) -> fidl::Result<()> {
2450            decoder.debug_check_bounds::<Self>(offset);
2451            let prim = decoder.read_num::<u32>(offset);
2452            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2453            Ok(())
2454        }
2455    }
2456    unsafe impl fidl::encoding::TypeMarker for WatchMask {
2457        type Owned = Self;
2458
2459        #[inline(always)]
2460        fn inline_align(_context: fidl::encoding::Context) -> usize {
2461            4
2462        }
2463
2464        #[inline(always)]
2465        fn inline_size(_context: fidl::encoding::Context) -> usize {
2466            4
2467        }
2468    }
2469
2470    impl fidl::encoding::ValueTypeMarker for WatchMask {
2471        type Borrowed<'a> = Self;
2472        #[inline(always)]
2473        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2474            *value
2475        }
2476    }
2477
2478    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WatchMask {
2479        #[inline]
2480        unsafe fn encode(
2481            self,
2482            encoder: &mut fidl::encoding::Encoder<'_, D>,
2483            offset: usize,
2484            _depth: fidl::encoding::Depth,
2485        ) -> fidl::Result<()> {
2486            encoder.debug_check_bounds::<Self>(offset);
2487            if self.bits() & Self::all().bits() != self.bits() {
2488                return Err(fidl::Error::InvalidBitsValue);
2489            }
2490            encoder.write_num(self.bits(), offset);
2491            Ok(())
2492        }
2493    }
2494
2495    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchMask {
2496        #[inline(always)]
2497        fn new_empty() -> Self {
2498            Self::empty()
2499        }
2500
2501        #[inline]
2502        unsafe fn decode(
2503            &mut self,
2504            decoder: &mut fidl::encoding::Decoder<'_, D>,
2505            offset: usize,
2506            _depth: fidl::encoding::Depth,
2507        ) -> fidl::Result<()> {
2508            decoder.debug_check_bounds::<Self>(offset);
2509            let prim = decoder.read_num::<u32>(offset);
2510            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
2511            Ok(())
2512        }
2513    }
2514    unsafe impl fidl::encoding::TypeMarker for AdvisoryLockType {
2515        type Owned = Self;
2516
2517        #[inline(always)]
2518        fn inline_align(_context: fidl::encoding::Context) -> usize {
2519            std::mem::align_of::<u32>()
2520        }
2521
2522        #[inline(always)]
2523        fn inline_size(_context: fidl::encoding::Context) -> usize {
2524            std::mem::size_of::<u32>()
2525        }
2526
2527        #[inline(always)]
2528        fn encode_is_copy() -> bool {
2529            true
2530        }
2531
2532        #[inline(always)]
2533        fn decode_is_copy() -> bool {
2534            false
2535        }
2536    }
2537
2538    impl fidl::encoding::ValueTypeMarker for AdvisoryLockType {
2539        type Borrowed<'a> = Self;
2540        #[inline(always)]
2541        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2542            *value
2543        }
2544    }
2545
2546    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2547        for AdvisoryLockType
2548    {
2549        #[inline]
2550        unsafe fn encode(
2551            self,
2552            encoder: &mut fidl::encoding::Encoder<'_, D>,
2553            offset: usize,
2554            _depth: fidl::encoding::Depth,
2555        ) -> fidl::Result<()> {
2556            encoder.debug_check_bounds::<Self>(offset);
2557            encoder.write_num(self.into_primitive(), offset);
2558            Ok(())
2559        }
2560    }
2561
2562    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockType {
2563        #[inline(always)]
2564        fn new_empty() -> Self {
2565            Self::Read
2566        }
2567
2568        #[inline]
2569        unsafe fn decode(
2570            &mut self,
2571            decoder: &mut fidl::encoding::Decoder<'_, D>,
2572            offset: usize,
2573            _depth: fidl::encoding::Depth,
2574        ) -> fidl::Result<()> {
2575            decoder.debug_check_bounds::<Self>(offset);
2576            let prim = decoder.read_num::<u32>(offset);
2577
2578            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2579            Ok(())
2580        }
2581    }
2582    unsafe impl fidl::encoding::TypeMarker for DirentType {
2583        type Owned = Self;
2584
2585        #[inline(always)]
2586        fn inline_align(_context: fidl::encoding::Context) -> usize {
2587            std::mem::align_of::<u8>()
2588        }
2589
2590        #[inline(always)]
2591        fn inline_size(_context: fidl::encoding::Context) -> usize {
2592            std::mem::size_of::<u8>()
2593        }
2594
2595        #[inline(always)]
2596        fn encode_is_copy() -> bool {
2597            false
2598        }
2599
2600        #[inline(always)]
2601        fn decode_is_copy() -> bool {
2602            false
2603        }
2604    }
2605
2606    impl fidl::encoding::ValueTypeMarker for DirentType {
2607        type Borrowed<'a> = Self;
2608        #[inline(always)]
2609        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2610            *value
2611        }
2612    }
2613
2614    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DirentType {
2615        #[inline]
2616        unsafe fn encode(
2617            self,
2618            encoder: &mut fidl::encoding::Encoder<'_, D>,
2619            offset: usize,
2620            _depth: fidl::encoding::Depth,
2621        ) -> fidl::Result<()> {
2622            encoder.debug_check_bounds::<Self>(offset);
2623            encoder.write_num(self.into_primitive(), offset);
2624            Ok(())
2625        }
2626    }
2627
2628    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirentType {
2629        #[inline(always)]
2630        fn new_empty() -> Self {
2631            Self::unknown()
2632        }
2633
2634        #[inline]
2635        unsafe fn decode(
2636            &mut self,
2637            decoder: &mut fidl::encoding::Decoder<'_, D>,
2638            offset: usize,
2639            _depth: fidl::encoding::Depth,
2640        ) -> fidl::Result<()> {
2641            decoder.debug_check_bounds::<Self>(offset);
2642            let prim = decoder.read_num::<u8>(offset);
2643
2644            *self = Self::from_primitive_allow_unknown(prim);
2645            Ok(())
2646        }
2647    }
2648    unsafe impl fidl::encoding::TypeMarker for HashAlgorithm {
2649        type Owned = Self;
2650
2651        #[inline(always)]
2652        fn inline_align(_context: fidl::encoding::Context) -> usize {
2653            std::mem::align_of::<u8>()
2654        }
2655
2656        #[inline(always)]
2657        fn inline_size(_context: fidl::encoding::Context) -> usize {
2658            std::mem::size_of::<u8>()
2659        }
2660
2661        #[inline(always)]
2662        fn encode_is_copy() -> bool {
2663            false
2664        }
2665
2666        #[inline(always)]
2667        fn decode_is_copy() -> bool {
2668            false
2669        }
2670    }
2671
2672    impl fidl::encoding::ValueTypeMarker for HashAlgorithm {
2673        type Borrowed<'a> = Self;
2674        #[inline(always)]
2675        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2676            *value
2677        }
2678    }
2679
2680    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for HashAlgorithm {
2681        #[inline]
2682        unsafe fn encode(
2683            self,
2684            encoder: &mut fidl::encoding::Encoder<'_, D>,
2685            offset: usize,
2686            _depth: fidl::encoding::Depth,
2687        ) -> fidl::Result<()> {
2688            encoder.debug_check_bounds::<Self>(offset);
2689            encoder.write_num(self.into_primitive(), offset);
2690            Ok(())
2691        }
2692    }
2693
2694    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HashAlgorithm {
2695        #[inline(always)]
2696        fn new_empty() -> Self {
2697            Self::unknown()
2698        }
2699
2700        #[inline]
2701        unsafe fn decode(
2702            &mut self,
2703            decoder: &mut fidl::encoding::Decoder<'_, D>,
2704            offset: usize,
2705            _depth: fidl::encoding::Depth,
2706        ) -> fidl::Result<()> {
2707            decoder.debug_check_bounds::<Self>(offset);
2708            let prim = decoder.read_num::<u8>(offset);
2709
2710            *self = Self::from_primitive_allow_unknown(prim);
2711            Ok(())
2712        }
2713    }
2714    unsafe impl fidl::encoding::TypeMarker for SeekOrigin {
2715        type Owned = Self;
2716
2717        #[inline(always)]
2718        fn inline_align(_context: fidl::encoding::Context) -> usize {
2719            std::mem::align_of::<u32>()
2720        }
2721
2722        #[inline(always)]
2723        fn inline_size(_context: fidl::encoding::Context) -> usize {
2724            std::mem::size_of::<u32>()
2725        }
2726
2727        #[inline(always)]
2728        fn encode_is_copy() -> bool {
2729            true
2730        }
2731
2732        #[inline(always)]
2733        fn decode_is_copy() -> bool {
2734            false
2735        }
2736    }
2737
2738    impl fidl::encoding::ValueTypeMarker for SeekOrigin {
2739        type Borrowed<'a> = Self;
2740        #[inline(always)]
2741        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2742            *value
2743        }
2744    }
2745
2746    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SeekOrigin {
2747        #[inline]
2748        unsafe fn encode(
2749            self,
2750            encoder: &mut fidl::encoding::Encoder<'_, D>,
2751            offset: usize,
2752            _depth: fidl::encoding::Depth,
2753        ) -> fidl::Result<()> {
2754            encoder.debug_check_bounds::<Self>(offset);
2755            encoder.write_num(self.into_primitive(), offset);
2756            Ok(())
2757        }
2758    }
2759
2760    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SeekOrigin {
2761        #[inline(always)]
2762        fn new_empty() -> Self {
2763            Self::Start
2764        }
2765
2766        #[inline]
2767        unsafe fn decode(
2768            &mut self,
2769            decoder: &mut fidl::encoding::Decoder<'_, D>,
2770            offset: usize,
2771            _depth: fidl::encoding::Depth,
2772        ) -> fidl::Result<()> {
2773            decoder.debug_check_bounds::<Self>(offset);
2774            let prim = decoder.read_num::<u32>(offset);
2775
2776            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2777            Ok(())
2778        }
2779    }
2780    unsafe impl fidl::encoding::TypeMarker for SetExtendedAttributeMode {
2781        type Owned = Self;
2782
2783        #[inline(always)]
2784        fn inline_align(_context: fidl::encoding::Context) -> usize {
2785            std::mem::align_of::<u32>()
2786        }
2787
2788        #[inline(always)]
2789        fn inline_size(_context: fidl::encoding::Context) -> usize {
2790            std::mem::size_of::<u32>()
2791        }
2792
2793        #[inline(always)]
2794        fn encode_is_copy() -> bool {
2795            true
2796        }
2797
2798        #[inline(always)]
2799        fn decode_is_copy() -> bool {
2800            false
2801        }
2802    }
2803
2804    impl fidl::encoding::ValueTypeMarker for SetExtendedAttributeMode {
2805        type Borrowed<'a> = Self;
2806        #[inline(always)]
2807        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2808            *value
2809        }
2810    }
2811
2812    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2813        for SetExtendedAttributeMode
2814    {
2815        #[inline]
2816        unsafe fn encode(
2817            self,
2818            encoder: &mut fidl::encoding::Encoder<'_, D>,
2819            offset: usize,
2820            _depth: fidl::encoding::Depth,
2821        ) -> fidl::Result<()> {
2822            encoder.debug_check_bounds::<Self>(offset);
2823            encoder.write_num(self.into_primitive(), offset);
2824            Ok(())
2825        }
2826    }
2827
2828    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2829        for SetExtendedAttributeMode
2830    {
2831        #[inline(always)]
2832        fn new_empty() -> Self {
2833            Self::Set
2834        }
2835
2836        #[inline]
2837        unsafe fn decode(
2838            &mut self,
2839            decoder: &mut fidl::encoding::Decoder<'_, D>,
2840            offset: usize,
2841            _depth: fidl::encoding::Depth,
2842        ) -> fidl::Result<()> {
2843            decoder.debug_check_bounds::<Self>(offset);
2844            let prim = decoder.read_num::<u32>(offset);
2845
2846            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2847            Ok(())
2848        }
2849    }
2850    unsafe impl fidl::encoding::TypeMarker for WatchEvent {
2851        type Owned = Self;
2852
2853        #[inline(always)]
2854        fn inline_align(_context: fidl::encoding::Context) -> usize {
2855            std::mem::align_of::<u8>()
2856        }
2857
2858        #[inline(always)]
2859        fn inline_size(_context: fidl::encoding::Context) -> usize {
2860            std::mem::size_of::<u8>()
2861        }
2862
2863        #[inline(always)]
2864        fn encode_is_copy() -> bool {
2865            true
2866        }
2867
2868        #[inline(always)]
2869        fn decode_is_copy() -> bool {
2870            false
2871        }
2872    }
2873
2874    impl fidl::encoding::ValueTypeMarker for WatchEvent {
2875        type Borrowed<'a> = Self;
2876        #[inline(always)]
2877        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2878            *value
2879        }
2880    }
2881
2882    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WatchEvent {
2883        #[inline]
2884        unsafe fn encode(
2885            self,
2886            encoder: &mut fidl::encoding::Encoder<'_, D>,
2887            offset: usize,
2888            _depth: fidl::encoding::Depth,
2889        ) -> fidl::Result<()> {
2890            encoder.debug_check_bounds::<Self>(offset);
2891            encoder.write_num(self.into_primitive(), offset);
2892            Ok(())
2893        }
2894    }
2895
2896    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchEvent {
2897        #[inline(always)]
2898        fn new_empty() -> Self {
2899            Self::Deleted
2900        }
2901
2902        #[inline]
2903        unsafe fn decode(
2904            &mut self,
2905            decoder: &mut fidl::encoding::Decoder<'_, D>,
2906            offset: usize,
2907            _depth: fidl::encoding::Depth,
2908        ) -> fidl::Result<()> {
2909            decoder.debug_check_bounds::<Self>(offset);
2910            let prim = decoder.read_num::<u8>(offset);
2911
2912            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2913            Ok(())
2914        }
2915    }
2916
2917    impl fidl::encoding::ValueTypeMarker for AdvisoryLockRange {
2918        type Borrowed<'a> = &'a Self;
2919        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2920            value
2921        }
2922    }
2923
2924    unsafe impl fidl::encoding::TypeMarker for AdvisoryLockRange {
2925        type Owned = Self;
2926
2927        #[inline(always)]
2928        fn inline_align(_context: fidl::encoding::Context) -> usize {
2929            8
2930        }
2931
2932        #[inline(always)]
2933        fn inline_size(_context: fidl::encoding::Context) -> usize {
2934            24
2935        }
2936    }
2937
2938    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdvisoryLockRange, D>
2939        for &AdvisoryLockRange
2940    {
2941        #[inline]
2942        unsafe fn encode(
2943            self,
2944            encoder: &mut fidl::encoding::Encoder<'_, D>,
2945            offset: usize,
2946            _depth: fidl::encoding::Depth,
2947        ) -> fidl::Result<()> {
2948            encoder.debug_check_bounds::<AdvisoryLockRange>(offset);
2949            // Delegate to tuple encoding.
2950            fidl::encoding::Encode::<AdvisoryLockRange, D>::encode(
2951                (
2952                    <SeekOrigin as fidl::encoding::ValueTypeMarker>::borrow(&self.origin),
2953                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
2954                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
2955                ),
2956                encoder,
2957                offset,
2958                _depth,
2959            )
2960        }
2961    }
2962    unsafe impl<
2963        D: fidl::encoding::ResourceDialect,
2964        T0: fidl::encoding::Encode<SeekOrigin, D>,
2965        T1: fidl::encoding::Encode<i64, D>,
2966        T2: fidl::encoding::Encode<i64, D>,
2967    > fidl::encoding::Encode<AdvisoryLockRange, D> for (T0, T1, T2)
2968    {
2969        #[inline]
2970        unsafe fn encode(
2971            self,
2972            encoder: &mut fidl::encoding::Encoder<'_, D>,
2973            offset: usize,
2974            depth: fidl::encoding::Depth,
2975        ) -> fidl::Result<()> {
2976            encoder.debug_check_bounds::<AdvisoryLockRange>(offset);
2977            // Zero out padding regions. There's no need to apply masks
2978            // because the unmasked parts will be overwritten by fields.
2979            unsafe {
2980                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2981                (ptr as *mut u64).write_unaligned(0);
2982            }
2983            // Write the fields.
2984            self.0.encode(encoder, offset + 0, depth)?;
2985            self.1.encode(encoder, offset + 8, depth)?;
2986            self.2.encode(encoder, offset + 16, depth)?;
2987            Ok(())
2988        }
2989    }
2990
2991    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockRange {
2992        #[inline(always)]
2993        fn new_empty() -> Self {
2994            Self {
2995                origin: fidl::new_empty!(SeekOrigin, D),
2996                offset: fidl::new_empty!(i64, D),
2997                length: fidl::new_empty!(i64, D),
2998            }
2999        }
3000
3001        #[inline]
3002        unsafe fn decode(
3003            &mut self,
3004            decoder: &mut fidl::encoding::Decoder<'_, D>,
3005            offset: usize,
3006            _depth: fidl::encoding::Depth,
3007        ) -> fidl::Result<()> {
3008            decoder.debug_check_bounds::<Self>(offset);
3009            // Verify that padding bytes are zero.
3010            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3011            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3012            let mask = 0xffffffff00000000u64;
3013            let maskedval = padval & mask;
3014            if maskedval != 0 {
3015                return Err(fidl::Error::NonZeroPadding {
3016                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3017                });
3018            }
3019            fidl::decode!(SeekOrigin, D, &mut self.origin, decoder, offset + 0, _depth)?;
3020            fidl::decode!(i64, D, &mut self.offset, decoder, offset + 8, _depth)?;
3021            fidl::decode!(i64, D, &mut self.length, decoder, offset + 16, _depth)?;
3022            Ok(())
3023        }
3024    }
3025
3026    impl fidl::encoding::ValueTypeMarker for AdvisoryLockingAdvisoryLockRequest {
3027        type Borrowed<'a> = &'a Self;
3028        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3029            value
3030        }
3031    }
3032
3033    unsafe impl fidl::encoding::TypeMarker for AdvisoryLockingAdvisoryLockRequest {
3034        type Owned = Self;
3035
3036        #[inline(always)]
3037        fn inline_align(_context: fidl::encoding::Context) -> usize {
3038            8
3039        }
3040
3041        #[inline(always)]
3042        fn inline_size(_context: fidl::encoding::Context) -> usize {
3043            16
3044        }
3045    }
3046
3047    unsafe impl<D: fidl::encoding::ResourceDialect>
3048        fidl::encoding::Encode<AdvisoryLockingAdvisoryLockRequest, D>
3049        for &AdvisoryLockingAdvisoryLockRequest
3050    {
3051        #[inline]
3052        unsafe fn encode(
3053            self,
3054            encoder: &mut fidl::encoding::Encoder<'_, D>,
3055            offset: usize,
3056            _depth: fidl::encoding::Depth,
3057        ) -> fidl::Result<()> {
3058            encoder.debug_check_bounds::<AdvisoryLockingAdvisoryLockRequest>(offset);
3059            // Delegate to tuple encoding.
3060            fidl::encoding::Encode::<AdvisoryLockingAdvisoryLockRequest, D>::encode(
3061                (<AdvisoryLockRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),),
3062                encoder,
3063                offset,
3064                _depth,
3065            )
3066        }
3067    }
3068    unsafe impl<
3069        D: fidl::encoding::ResourceDialect,
3070        T0: fidl::encoding::Encode<AdvisoryLockRequest, D>,
3071    > fidl::encoding::Encode<AdvisoryLockingAdvisoryLockRequest, D> for (T0,)
3072    {
3073        #[inline]
3074        unsafe fn encode(
3075            self,
3076            encoder: &mut fidl::encoding::Encoder<'_, D>,
3077            offset: usize,
3078            depth: fidl::encoding::Depth,
3079        ) -> fidl::Result<()> {
3080            encoder.debug_check_bounds::<AdvisoryLockingAdvisoryLockRequest>(offset);
3081            // Zero out padding regions. There's no need to apply masks
3082            // because the unmasked parts will be overwritten by fields.
3083            // Write the fields.
3084            self.0.encode(encoder, offset + 0, depth)?;
3085            Ok(())
3086        }
3087    }
3088
3089    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3090        for AdvisoryLockingAdvisoryLockRequest
3091    {
3092        #[inline(always)]
3093        fn new_empty() -> Self {
3094            Self { request: fidl::new_empty!(AdvisoryLockRequest, D) }
3095        }
3096
3097        #[inline]
3098        unsafe fn decode(
3099            &mut self,
3100            decoder: &mut fidl::encoding::Decoder<'_, D>,
3101            offset: usize,
3102            _depth: fidl::encoding::Depth,
3103        ) -> fidl::Result<()> {
3104            decoder.debug_check_bounds::<Self>(offset);
3105            // Verify that padding bytes are zero.
3106            fidl::decode!(AdvisoryLockRequest, D, &mut self.request, decoder, offset + 0, _depth)?;
3107            Ok(())
3108        }
3109    }
3110
3111    impl fidl::encoding::ValueTypeMarker for DirectoryLinkResponse {
3112        type Borrowed<'a> = &'a Self;
3113        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3114            value
3115        }
3116    }
3117
3118    unsafe impl fidl::encoding::TypeMarker for DirectoryLinkResponse {
3119        type Owned = Self;
3120
3121        #[inline(always)]
3122        fn inline_align(_context: fidl::encoding::Context) -> usize {
3123            4
3124        }
3125
3126        #[inline(always)]
3127        fn inline_size(_context: fidl::encoding::Context) -> usize {
3128            4
3129        }
3130        #[inline(always)]
3131        fn encode_is_copy() -> bool {
3132            true
3133        }
3134
3135        #[inline(always)]
3136        fn decode_is_copy() -> bool {
3137            true
3138        }
3139    }
3140
3141    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryLinkResponse, D>
3142        for &DirectoryLinkResponse
3143    {
3144        #[inline]
3145        unsafe fn encode(
3146            self,
3147            encoder: &mut fidl::encoding::Encoder<'_, D>,
3148            offset: usize,
3149            _depth: fidl::encoding::Depth,
3150        ) -> fidl::Result<()> {
3151            encoder.debug_check_bounds::<DirectoryLinkResponse>(offset);
3152            unsafe {
3153                // Copy the object into the buffer.
3154                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3155                (buf_ptr as *mut DirectoryLinkResponse)
3156                    .write_unaligned((self as *const DirectoryLinkResponse).read());
3157                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3158                // done second because the memcpy will write garbage to these bytes.
3159            }
3160            Ok(())
3161        }
3162    }
3163    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3164        fidl::encoding::Encode<DirectoryLinkResponse, D> for (T0,)
3165    {
3166        #[inline]
3167        unsafe fn encode(
3168            self,
3169            encoder: &mut fidl::encoding::Encoder<'_, D>,
3170            offset: usize,
3171            depth: fidl::encoding::Depth,
3172        ) -> fidl::Result<()> {
3173            encoder.debug_check_bounds::<DirectoryLinkResponse>(offset);
3174            // Zero out padding regions. There's no need to apply masks
3175            // because the unmasked parts will be overwritten by fields.
3176            // Write the fields.
3177            self.0.encode(encoder, offset + 0, depth)?;
3178            Ok(())
3179        }
3180    }
3181
3182    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryLinkResponse {
3183        #[inline(always)]
3184        fn new_empty() -> Self {
3185            Self { s: fidl::new_empty!(i32, D) }
3186        }
3187
3188        #[inline]
3189        unsafe fn decode(
3190            &mut self,
3191            decoder: &mut fidl::encoding::Decoder<'_, D>,
3192            offset: usize,
3193            _depth: fidl::encoding::Depth,
3194        ) -> fidl::Result<()> {
3195            decoder.debug_check_bounds::<Self>(offset);
3196            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3197            // Verify that padding bytes are zero.
3198            // Copy from the buffer into the object.
3199            unsafe {
3200                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3201            }
3202            Ok(())
3203        }
3204    }
3205
3206    impl fidl::encoding::ValueTypeMarker for DirectoryObject {
3207        type Borrowed<'a> = &'a Self;
3208        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3209            value
3210        }
3211    }
3212
3213    unsafe impl fidl::encoding::TypeMarker for DirectoryObject {
3214        type Owned = Self;
3215
3216        #[inline(always)]
3217        fn inline_align(_context: fidl::encoding::Context) -> usize {
3218            1
3219        }
3220
3221        #[inline(always)]
3222        fn inline_size(_context: fidl::encoding::Context) -> usize {
3223            1
3224        }
3225    }
3226
3227    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryObject, D>
3228        for &DirectoryObject
3229    {
3230        #[inline]
3231        unsafe fn encode(
3232            self,
3233            encoder: &mut fidl::encoding::Encoder<'_, D>,
3234            offset: usize,
3235            _depth: fidl::encoding::Depth,
3236        ) -> fidl::Result<()> {
3237            encoder.debug_check_bounds::<DirectoryObject>(offset);
3238            encoder.write_num(0u8, offset);
3239            Ok(())
3240        }
3241    }
3242
3243    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryObject {
3244        #[inline(always)]
3245        fn new_empty() -> Self {
3246            Self
3247        }
3248
3249        #[inline]
3250        unsafe fn decode(
3251            &mut self,
3252            decoder: &mut fidl::encoding::Decoder<'_, D>,
3253            offset: usize,
3254            _depth: fidl::encoding::Depth,
3255        ) -> fidl::Result<()> {
3256            decoder.debug_check_bounds::<Self>(offset);
3257            match decoder.read_num::<u8>(offset) {
3258                0 => Ok(()),
3259                _ => Err(fidl::Error::Invalid),
3260            }
3261        }
3262    }
3263
3264    impl fidl::encoding::ValueTypeMarker for DirectoryReadDirentsRequest {
3265        type Borrowed<'a> = &'a Self;
3266        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3267            value
3268        }
3269    }
3270
3271    unsafe impl fidl::encoding::TypeMarker for DirectoryReadDirentsRequest {
3272        type Owned = Self;
3273
3274        #[inline(always)]
3275        fn inline_align(_context: fidl::encoding::Context) -> usize {
3276            8
3277        }
3278
3279        #[inline(always)]
3280        fn inline_size(_context: fidl::encoding::Context) -> usize {
3281            8
3282        }
3283        #[inline(always)]
3284        fn encode_is_copy() -> bool {
3285            true
3286        }
3287
3288        #[inline(always)]
3289        fn decode_is_copy() -> bool {
3290            true
3291        }
3292    }
3293
3294    unsafe impl<D: fidl::encoding::ResourceDialect>
3295        fidl::encoding::Encode<DirectoryReadDirentsRequest, D> for &DirectoryReadDirentsRequest
3296    {
3297        #[inline]
3298        unsafe fn encode(
3299            self,
3300            encoder: &mut fidl::encoding::Encoder<'_, D>,
3301            offset: usize,
3302            _depth: fidl::encoding::Depth,
3303        ) -> fidl::Result<()> {
3304            encoder.debug_check_bounds::<DirectoryReadDirentsRequest>(offset);
3305            unsafe {
3306                // Copy the object into the buffer.
3307                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3308                (buf_ptr as *mut DirectoryReadDirentsRequest)
3309                    .write_unaligned((self as *const DirectoryReadDirentsRequest).read());
3310                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3311                // done second because the memcpy will write garbage to these bytes.
3312            }
3313            Ok(())
3314        }
3315    }
3316    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3317        fidl::encoding::Encode<DirectoryReadDirentsRequest, D> for (T0,)
3318    {
3319        #[inline]
3320        unsafe fn encode(
3321            self,
3322            encoder: &mut fidl::encoding::Encoder<'_, D>,
3323            offset: usize,
3324            depth: fidl::encoding::Depth,
3325        ) -> fidl::Result<()> {
3326            encoder.debug_check_bounds::<DirectoryReadDirentsRequest>(offset);
3327            // Zero out padding regions. There's no need to apply masks
3328            // because the unmasked parts will be overwritten by fields.
3329            // Write the fields.
3330            self.0.encode(encoder, offset + 0, depth)?;
3331            Ok(())
3332        }
3333    }
3334
3335    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3336        for DirectoryReadDirentsRequest
3337    {
3338        #[inline(always)]
3339        fn new_empty() -> Self {
3340            Self { max_bytes: fidl::new_empty!(u64, D) }
3341        }
3342
3343        #[inline]
3344        unsafe fn decode(
3345            &mut self,
3346            decoder: &mut fidl::encoding::Decoder<'_, D>,
3347            offset: usize,
3348            _depth: fidl::encoding::Depth,
3349        ) -> fidl::Result<()> {
3350            decoder.debug_check_bounds::<Self>(offset);
3351            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3352            // Verify that padding bytes are zero.
3353            // Copy from the buffer into the object.
3354            unsafe {
3355                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3356            }
3357            Ok(())
3358        }
3359    }
3360
3361    impl fidl::encoding::ValueTypeMarker for DirectoryReadDirentsResponse {
3362        type Borrowed<'a> = &'a Self;
3363        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3364            value
3365        }
3366    }
3367
3368    unsafe impl fidl::encoding::TypeMarker for DirectoryReadDirentsResponse {
3369        type Owned = Self;
3370
3371        #[inline(always)]
3372        fn inline_align(_context: fidl::encoding::Context) -> usize {
3373            8
3374        }
3375
3376        #[inline(always)]
3377        fn inline_size(_context: fidl::encoding::Context) -> usize {
3378            24
3379        }
3380    }
3381
3382    unsafe impl<D: fidl::encoding::ResourceDialect>
3383        fidl::encoding::Encode<DirectoryReadDirentsResponse, D> for &DirectoryReadDirentsResponse
3384    {
3385        #[inline]
3386        unsafe fn encode(
3387            self,
3388            encoder: &mut fidl::encoding::Encoder<'_, D>,
3389            offset: usize,
3390            _depth: fidl::encoding::Depth,
3391        ) -> fidl::Result<()> {
3392            encoder.debug_check_bounds::<DirectoryReadDirentsResponse>(offset);
3393            // Delegate to tuple encoding.
3394            fidl::encoding::Encode::<DirectoryReadDirentsResponse, D>::encode(
3395                (
3396                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
3397                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
3398                        &self.dirents,
3399                    ),
3400                ),
3401                encoder,
3402                offset,
3403                _depth,
3404            )
3405        }
3406    }
3407    unsafe impl<
3408        D: fidl::encoding::ResourceDialect,
3409        T0: fidl::encoding::Encode<i32, D>,
3410        T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
3411    > fidl::encoding::Encode<DirectoryReadDirentsResponse, D> for (T0, T1)
3412    {
3413        #[inline]
3414        unsafe fn encode(
3415            self,
3416            encoder: &mut fidl::encoding::Encoder<'_, D>,
3417            offset: usize,
3418            depth: fidl::encoding::Depth,
3419        ) -> fidl::Result<()> {
3420            encoder.debug_check_bounds::<DirectoryReadDirentsResponse>(offset);
3421            // Zero out padding regions. There's no need to apply masks
3422            // because the unmasked parts will be overwritten by fields.
3423            unsafe {
3424                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3425                (ptr as *mut u64).write_unaligned(0);
3426            }
3427            // Write the fields.
3428            self.0.encode(encoder, offset + 0, depth)?;
3429            self.1.encode(encoder, offset + 8, depth)?;
3430            Ok(())
3431        }
3432    }
3433
3434    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3435        for DirectoryReadDirentsResponse
3436    {
3437        #[inline(always)]
3438        fn new_empty() -> Self {
3439            Self {
3440                s: fidl::new_empty!(i32, D),
3441                dirents: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
3442            }
3443        }
3444
3445        #[inline]
3446        unsafe fn decode(
3447            &mut self,
3448            decoder: &mut fidl::encoding::Decoder<'_, D>,
3449            offset: usize,
3450            _depth: fidl::encoding::Depth,
3451        ) -> fidl::Result<()> {
3452            decoder.debug_check_bounds::<Self>(offset);
3453            // Verify that padding bytes are zero.
3454            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3455            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3456            let mask = 0xffffffff00000000u64;
3457            let maskedval = padval & mask;
3458            if maskedval != 0 {
3459                return Err(fidl::Error::NonZeroPadding {
3460                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3461                });
3462            }
3463            fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
3464            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.dirents, decoder, offset + 8, _depth)?;
3465            Ok(())
3466        }
3467    }
3468
3469    impl fidl::encoding::ValueTypeMarker for DirectoryRewindResponse {
3470        type Borrowed<'a> = &'a Self;
3471        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3472            value
3473        }
3474    }
3475
3476    unsafe impl fidl::encoding::TypeMarker for DirectoryRewindResponse {
3477        type Owned = Self;
3478
3479        #[inline(always)]
3480        fn inline_align(_context: fidl::encoding::Context) -> usize {
3481            4
3482        }
3483
3484        #[inline(always)]
3485        fn inline_size(_context: fidl::encoding::Context) -> usize {
3486            4
3487        }
3488        #[inline(always)]
3489        fn encode_is_copy() -> bool {
3490            true
3491        }
3492
3493        #[inline(always)]
3494        fn decode_is_copy() -> bool {
3495            true
3496        }
3497    }
3498
3499    unsafe impl<D: fidl::encoding::ResourceDialect>
3500        fidl::encoding::Encode<DirectoryRewindResponse, D> for &DirectoryRewindResponse
3501    {
3502        #[inline]
3503        unsafe fn encode(
3504            self,
3505            encoder: &mut fidl::encoding::Encoder<'_, D>,
3506            offset: usize,
3507            _depth: fidl::encoding::Depth,
3508        ) -> fidl::Result<()> {
3509            encoder.debug_check_bounds::<DirectoryRewindResponse>(offset);
3510            unsafe {
3511                // Copy the object into the buffer.
3512                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3513                (buf_ptr as *mut DirectoryRewindResponse)
3514                    .write_unaligned((self as *const DirectoryRewindResponse).read());
3515                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3516                // done second because the memcpy will write garbage to these bytes.
3517            }
3518            Ok(())
3519        }
3520    }
3521    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3522        fidl::encoding::Encode<DirectoryRewindResponse, D> for (T0,)
3523    {
3524        #[inline]
3525        unsafe fn encode(
3526            self,
3527            encoder: &mut fidl::encoding::Encoder<'_, D>,
3528            offset: usize,
3529            depth: fidl::encoding::Depth,
3530        ) -> fidl::Result<()> {
3531            encoder.debug_check_bounds::<DirectoryRewindResponse>(offset);
3532            // Zero out padding regions. There's no need to apply masks
3533            // because the unmasked parts will be overwritten by fields.
3534            // Write the fields.
3535            self.0.encode(encoder, offset + 0, depth)?;
3536            Ok(())
3537        }
3538    }
3539
3540    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3541        for DirectoryRewindResponse
3542    {
3543        #[inline(always)]
3544        fn new_empty() -> Self {
3545            Self { s: fidl::new_empty!(i32, D) }
3546        }
3547
3548        #[inline]
3549        unsafe fn decode(
3550            &mut self,
3551            decoder: &mut fidl::encoding::Decoder<'_, D>,
3552            offset: usize,
3553            _depth: fidl::encoding::Depth,
3554        ) -> fidl::Result<()> {
3555            decoder.debug_check_bounds::<Self>(offset);
3556            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3557            // Verify that padding bytes are zero.
3558            // Copy from the buffer into the object.
3559            unsafe {
3560                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3561            }
3562            Ok(())
3563        }
3564    }
3565
3566    impl fidl::encoding::ValueTypeMarker for DirectoryUnlinkRequest {
3567        type Borrowed<'a> = &'a Self;
3568        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3569            value
3570        }
3571    }
3572
3573    unsafe impl fidl::encoding::TypeMarker for DirectoryUnlinkRequest {
3574        type Owned = Self;
3575
3576        #[inline(always)]
3577        fn inline_align(_context: fidl::encoding::Context) -> usize {
3578            8
3579        }
3580
3581        #[inline(always)]
3582        fn inline_size(_context: fidl::encoding::Context) -> usize {
3583            32
3584        }
3585    }
3586
3587    unsafe impl<D: fidl::encoding::ResourceDialect>
3588        fidl::encoding::Encode<DirectoryUnlinkRequest, D> for &DirectoryUnlinkRequest
3589    {
3590        #[inline]
3591        unsafe fn encode(
3592            self,
3593            encoder: &mut fidl::encoding::Encoder<'_, D>,
3594            offset: usize,
3595            _depth: fidl::encoding::Depth,
3596        ) -> fidl::Result<()> {
3597            encoder.debug_check_bounds::<DirectoryUnlinkRequest>(offset);
3598            // Delegate to tuple encoding.
3599            fidl::encoding::Encode::<DirectoryUnlinkRequest, D>::encode(
3600                (
3601                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
3602                        &self.name,
3603                    ),
3604                    <UnlinkOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3605                ),
3606                encoder,
3607                offset,
3608                _depth,
3609            )
3610        }
3611    }
3612    unsafe impl<
3613        D: fidl::encoding::ResourceDialect,
3614        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
3615        T1: fidl::encoding::Encode<UnlinkOptions, D>,
3616    > fidl::encoding::Encode<DirectoryUnlinkRequest, D> for (T0, T1)
3617    {
3618        #[inline]
3619        unsafe fn encode(
3620            self,
3621            encoder: &mut fidl::encoding::Encoder<'_, D>,
3622            offset: usize,
3623            depth: fidl::encoding::Depth,
3624        ) -> fidl::Result<()> {
3625            encoder.debug_check_bounds::<DirectoryUnlinkRequest>(offset);
3626            // Zero out padding regions. There's no need to apply masks
3627            // because the unmasked parts will be overwritten by fields.
3628            // Write the fields.
3629            self.0.encode(encoder, offset + 0, depth)?;
3630            self.1.encode(encoder, offset + 16, depth)?;
3631            Ok(())
3632        }
3633    }
3634
3635    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3636        for DirectoryUnlinkRequest
3637    {
3638        #[inline(always)]
3639        fn new_empty() -> Self {
3640            Self {
3641                name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
3642                options: fidl::new_empty!(UnlinkOptions, D),
3643            }
3644        }
3645
3646        #[inline]
3647        unsafe fn decode(
3648            &mut self,
3649            decoder: &mut fidl::encoding::Decoder<'_, D>,
3650            offset: usize,
3651            _depth: fidl::encoding::Depth,
3652        ) -> fidl::Result<()> {
3653            decoder.debug_check_bounds::<Self>(offset);
3654            // Verify that padding bytes are zero.
3655            fidl::decode!(
3656                fidl::encoding::BoundedString<255>,
3657                D,
3658                &mut self.name,
3659                decoder,
3660                offset + 0,
3661                _depth
3662            )?;
3663            fidl::decode!(UnlinkOptions, D, &mut self.options, decoder, offset + 16, _depth)?;
3664            Ok(())
3665        }
3666    }
3667
3668    impl fidl::encoding::ValueTypeMarker for DirectoryWatchResponse {
3669        type Borrowed<'a> = &'a Self;
3670        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3671            value
3672        }
3673    }
3674
3675    unsafe impl fidl::encoding::TypeMarker for DirectoryWatchResponse {
3676        type Owned = Self;
3677
3678        #[inline(always)]
3679        fn inline_align(_context: fidl::encoding::Context) -> usize {
3680            4
3681        }
3682
3683        #[inline(always)]
3684        fn inline_size(_context: fidl::encoding::Context) -> usize {
3685            4
3686        }
3687        #[inline(always)]
3688        fn encode_is_copy() -> bool {
3689            true
3690        }
3691
3692        #[inline(always)]
3693        fn decode_is_copy() -> bool {
3694            true
3695        }
3696    }
3697
3698    unsafe impl<D: fidl::encoding::ResourceDialect>
3699        fidl::encoding::Encode<DirectoryWatchResponse, D> for &DirectoryWatchResponse
3700    {
3701        #[inline]
3702        unsafe fn encode(
3703            self,
3704            encoder: &mut fidl::encoding::Encoder<'_, D>,
3705            offset: usize,
3706            _depth: fidl::encoding::Depth,
3707        ) -> fidl::Result<()> {
3708            encoder.debug_check_bounds::<DirectoryWatchResponse>(offset);
3709            unsafe {
3710                // Copy the object into the buffer.
3711                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3712                (buf_ptr as *mut DirectoryWatchResponse)
3713                    .write_unaligned((self as *const DirectoryWatchResponse).read());
3714                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3715                // done second because the memcpy will write garbage to these bytes.
3716            }
3717            Ok(())
3718        }
3719    }
3720    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
3721        fidl::encoding::Encode<DirectoryWatchResponse, D> for (T0,)
3722    {
3723        #[inline]
3724        unsafe fn encode(
3725            self,
3726            encoder: &mut fidl::encoding::Encoder<'_, D>,
3727            offset: usize,
3728            depth: fidl::encoding::Depth,
3729        ) -> fidl::Result<()> {
3730            encoder.debug_check_bounds::<DirectoryWatchResponse>(offset);
3731            // Zero out padding regions. There's no need to apply masks
3732            // because the unmasked parts will be overwritten by fields.
3733            // Write the fields.
3734            self.0.encode(encoder, offset + 0, depth)?;
3735            Ok(())
3736        }
3737    }
3738
3739    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3740        for DirectoryWatchResponse
3741    {
3742        #[inline(always)]
3743        fn new_empty() -> Self {
3744            Self { s: fidl::new_empty!(i32, D) }
3745        }
3746
3747        #[inline]
3748        unsafe fn decode(
3749            &mut self,
3750            decoder: &mut fidl::encoding::Decoder<'_, D>,
3751            offset: usize,
3752            _depth: fidl::encoding::Depth,
3753        ) -> fidl::Result<()> {
3754            decoder.debug_check_bounds::<Self>(offset);
3755            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3756            // Verify that padding bytes are zero.
3757            // Copy from the buffer into the object.
3758            unsafe {
3759                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3760            }
3761            Ok(())
3762        }
3763    }
3764
3765    impl fidl::encoding::ValueTypeMarker for EmptyStruct {
3766        type Borrowed<'a> = &'a Self;
3767        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3768            value
3769        }
3770    }
3771
3772    unsafe impl fidl::encoding::TypeMarker for EmptyStruct {
3773        type Owned = Self;
3774
3775        #[inline(always)]
3776        fn inline_align(_context: fidl::encoding::Context) -> usize {
3777            1
3778        }
3779
3780        #[inline(always)]
3781        fn inline_size(_context: fidl::encoding::Context) -> usize {
3782            1
3783        }
3784    }
3785
3786    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EmptyStruct, D>
3787        for &EmptyStruct
3788    {
3789        #[inline]
3790        unsafe fn encode(
3791            self,
3792            encoder: &mut fidl::encoding::Encoder<'_, D>,
3793            offset: usize,
3794            _depth: fidl::encoding::Depth,
3795        ) -> fidl::Result<()> {
3796            encoder.debug_check_bounds::<EmptyStruct>(offset);
3797            encoder.write_num(0u8, offset);
3798            Ok(())
3799        }
3800    }
3801
3802    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EmptyStruct {
3803        #[inline(always)]
3804        fn new_empty() -> Self {
3805            Self
3806        }
3807
3808        #[inline]
3809        unsafe fn decode(
3810            &mut self,
3811            decoder: &mut fidl::encoding::Decoder<'_, D>,
3812            offset: usize,
3813            _depth: fidl::encoding::Depth,
3814        ) -> fidl::Result<()> {
3815            decoder.debug_check_bounds::<Self>(offset);
3816            match decoder.read_num::<u8>(offset) {
3817                0 => Ok(()),
3818                _ => Err(fidl::Error::Invalid),
3819            }
3820        }
3821    }
3822
3823    impl fidl::encoding::ValueTypeMarker for ExtendedAttributeIteratorGetNextResponse {
3824        type Borrowed<'a> = &'a Self;
3825        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3826            value
3827        }
3828    }
3829
3830    unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeIteratorGetNextResponse {
3831        type Owned = Self;
3832
3833        #[inline(always)]
3834        fn inline_align(_context: fidl::encoding::Context) -> usize {
3835            8
3836        }
3837
3838        #[inline(always)]
3839        fn inline_size(_context: fidl::encoding::Context) -> usize {
3840            24
3841        }
3842    }
3843
3844    unsafe impl<D: fidl::encoding::ResourceDialect>
3845        fidl::encoding::Encode<ExtendedAttributeIteratorGetNextResponse, D>
3846        for &ExtendedAttributeIteratorGetNextResponse
3847    {
3848        #[inline]
3849        unsafe fn encode(
3850            self,
3851            encoder: &mut fidl::encoding::Encoder<'_, D>,
3852            offset: usize,
3853            _depth: fidl::encoding::Depth,
3854        ) -> fidl::Result<()> {
3855            encoder.debug_check_bounds::<ExtendedAttributeIteratorGetNextResponse>(offset);
3856            // Delegate to tuple encoding.
3857            fidl::encoding::Encode::<ExtendedAttributeIteratorGetNextResponse, D>::encode(
3858                (
3859                    <fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
3860                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.last),
3861                ),
3862                encoder, offset, _depth
3863            )
3864        }
3865    }
3866    unsafe impl<
3867        D: fidl::encoding::ResourceDialect,
3868        T0: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128>, D>,
3869        T1: fidl::encoding::Encode<bool, D>,
3870    > fidl::encoding::Encode<ExtendedAttributeIteratorGetNextResponse, D> for (T0, T1)
3871    {
3872        #[inline]
3873        unsafe fn encode(
3874            self,
3875            encoder: &mut fidl::encoding::Encoder<'_, D>,
3876            offset: usize,
3877            depth: fidl::encoding::Depth,
3878        ) -> fidl::Result<()> {
3879            encoder.debug_check_bounds::<ExtendedAttributeIteratorGetNextResponse>(offset);
3880            // Zero out padding regions. There's no need to apply masks
3881            // because the unmasked parts will be overwritten by fields.
3882            unsafe {
3883                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3884                (ptr as *mut u64).write_unaligned(0);
3885            }
3886            // Write the fields.
3887            self.0.encode(encoder, offset + 0, depth)?;
3888            self.1.encode(encoder, offset + 16, depth)?;
3889            Ok(())
3890        }
3891    }
3892
3893    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3894        for ExtendedAttributeIteratorGetNextResponse
3895    {
3896        #[inline(always)]
3897        fn new_empty() -> Self {
3898            Self {
3899                attributes: fidl::new_empty!(
3900                    fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128>,
3901                    D
3902                ),
3903                last: fidl::new_empty!(bool, D),
3904            }
3905        }
3906
3907        #[inline]
3908        unsafe fn decode(
3909            &mut self,
3910            decoder: &mut fidl::encoding::Decoder<'_, D>,
3911            offset: usize,
3912            _depth: fidl::encoding::Depth,
3913        ) -> fidl::Result<()> {
3914            decoder.debug_check_bounds::<Self>(offset);
3915            // Verify that padding bytes are zero.
3916            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3917            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3918            let mask = 0xffffffffffffff00u64;
3919            let maskedval = padval & mask;
3920            if maskedval != 0 {
3921                return Err(fidl::Error::NonZeroPadding {
3922                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3923                });
3924            }
3925            fidl::decode!(
3926                fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128>,
3927                D,
3928                &mut self.attributes,
3929                decoder,
3930                offset + 0,
3931                _depth
3932            )?;
3933            fidl::decode!(bool, D, &mut self.last, decoder, offset + 16, _depth)?;
3934            Ok(())
3935        }
3936    }
3937
3938    impl fidl::encoding::ValueTypeMarker for FileGetBackingMemoryRequest {
3939        type Borrowed<'a> = &'a Self;
3940        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3941            value
3942        }
3943    }
3944
3945    unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryRequest {
3946        type Owned = Self;
3947
3948        #[inline(always)]
3949        fn inline_align(_context: fidl::encoding::Context) -> usize {
3950            4
3951        }
3952
3953        #[inline(always)]
3954        fn inline_size(_context: fidl::encoding::Context) -> usize {
3955            4
3956        }
3957    }
3958
3959    unsafe impl<D: fidl::encoding::ResourceDialect>
3960        fidl::encoding::Encode<FileGetBackingMemoryRequest, D> for &FileGetBackingMemoryRequest
3961    {
3962        #[inline]
3963        unsafe fn encode(
3964            self,
3965            encoder: &mut fidl::encoding::Encoder<'_, D>,
3966            offset: usize,
3967            _depth: fidl::encoding::Depth,
3968        ) -> fidl::Result<()> {
3969            encoder.debug_check_bounds::<FileGetBackingMemoryRequest>(offset);
3970            // Delegate to tuple encoding.
3971            fidl::encoding::Encode::<FileGetBackingMemoryRequest, D>::encode(
3972                (<VmoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
3973                encoder,
3974                offset,
3975                _depth,
3976            )
3977        }
3978    }
3979    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VmoFlags, D>>
3980        fidl::encoding::Encode<FileGetBackingMemoryRequest, D> for (T0,)
3981    {
3982        #[inline]
3983        unsafe fn encode(
3984            self,
3985            encoder: &mut fidl::encoding::Encoder<'_, D>,
3986            offset: usize,
3987            depth: fidl::encoding::Depth,
3988        ) -> fidl::Result<()> {
3989            encoder.debug_check_bounds::<FileGetBackingMemoryRequest>(offset);
3990            // Zero out padding regions. There's no need to apply masks
3991            // because the unmasked parts will be overwritten by fields.
3992            // Write the fields.
3993            self.0.encode(encoder, offset + 0, depth)?;
3994            Ok(())
3995        }
3996    }
3997
3998    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3999        for FileGetBackingMemoryRequest
4000    {
4001        #[inline(always)]
4002        fn new_empty() -> Self {
4003            Self { flags: fidl::new_empty!(VmoFlags, D) }
4004        }
4005
4006        #[inline]
4007        unsafe fn decode(
4008            &mut self,
4009            decoder: &mut fidl::encoding::Decoder<'_, D>,
4010            offset: usize,
4011            _depth: fidl::encoding::Depth,
4012        ) -> fidl::Result<()> {
4013            decoder.debug_check_bounds::<Self>(offset);
4014            // Verify that padding bytes are zero.
4015            fidl::decode!(VmoFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
4016            Ok(())
4017        }
4018    }
4019
4020    impl fidl::encoding::ValueTypeMarker for FileReadAtRequest {
4021        type Borrowed<'a> = &'a Self;
4022        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4023            value
4024        }
4025    }
4026
4027    unsafe impl fidl::encoding::TypeMarker for FileReadAtRequest {
4028        type Owned = Self;
4029
4030        #[inline(always)]
4031        fn inline_align(_context: fidl::encoding::Context) -> usize {
4032            8
4033        }
4034
4035        #[inline(always)]
4036        fn inline_size(_context: fidl::encoding::Context) -> usize {
4037            16
4038        }
4039        #[inline(always)]
4040        fn encode_is_copy() -> bool {
4041            true
4042        }
4043
4044        #[inline(always)]
4045        fn decode_is_copy() -> bool {
4046            true
4047        }
4048    }
4049
4050    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReadAtRequest, D>
4051        for &FileReadAtRequest
4052    {
4053        #[inline]
4054        unsafe fn encode(
4055            self,
4056            encoder: &mut fidl::encoding::Encoder<'_, D>,
4057            offset: usize,
4058            _depth: fidl::encoding::Depth,
4059        ) -> fidl::Result<()> {
4060            encoder.debug_check_bounds::<FileReadAtRequest>(offset);
4061            unsafe {
4062                // Copy the object into the buffer.
4063                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4064                (buf_ptr as *mut FileReadAtRequest)
4065                    .write_unaligned((self as *const FileReadAtRequest).read());
4066                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4067                // done second because the memcpy will write garbage to these bytes.
4068            }
4069            Ok(())
4070        }
4071    }
4072    unsafe impl<
4073        D: fidl::encoding::ResourceDialect,
4074        T0: fidl::encoding::Encode<u64, D>,
4075        T1: fidl::encoding::Encode<u64, D>,
4076    > fidl::encoding::Encode<FileReadAtRequest, D> for (T0, T1)
4077    {
4078        #[inline]
4079        unsafe fn encode(
4080            self,
4081            encoder: &mut fidl::encoding::Encoder<'_, D>,
4082            offset: usize,
4083            depth: fidl::encoding::Depth,
4084        ) -> fidl::Result<()> {
4085            encoder.debug_check_bounds::<FileReadAtRequest>(offset);
4086            // Zero out padding regions. There's no need to apply masks
4087            // because the unmasked parts will be overwritten by fields.
4088            // Write the fields.
4089            self.0.encode(encoder, offset + 0, depth)?;
4090            self.1.encode(encoder, offset + 8, depth)?;
4091            Ok(())
4092        }
4093    }
4094
4095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReadAtRequest {
4096        #[inline(always)]
4097        fn new_empty() -> Self {
4098            Self { count: fidl::new_empty!(u64, D), offset: fidl::new_empty!(u64, D) }
4099        }
4100
4101        #[inline]
4102        unsafe fn decode(
4103            &mut self,
4104            decoder: &mut fidl::encoding::Decoder<'_, D>,
4105            offset: usize,
4106            _depth: fidl::encoding::Depth,
4107        ) -> fidl::Result<()> {
4108            decoder.debug_check_bounds::<Self>(offset);
4109            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4110            // Verify that padding bytes are zero.
4111            // Copy from the buffer into the object.
4112            unsafe {
4113                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4114            }
4115            Ok(())
4116        }
4117    }
4118
4119    impl fidl::encoding::ValueTypeMarker for FileResizeRequest {
4120        type Borrowed<'a> = &'a Self;
4121        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4122            value
4123        }
4124    }
4125
4126    unsafe impl fidl::encoding::TypeMarker for FileResizeRequest {
4127        type Owned = Self;
4128
4129        #[inline(always)]
4130        fn inline_align(_context: fidl::encoding::Context) -> usize {
4131            8
4132        }
4133
4134        #[inline(always)]
4135        fn inline_size(_context: fidl::encoding::Context) -> usize {
4136            8
4137        }
4138        #[inline(always)]
4139        fn encode_is_copy() -> bool {
4140            true
4141        }
4142
4143        #[inline(always)]
4144        fn decode_is_copy() -> bool {
4145            true
4146        }
4147    }
4148
4149    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileResizeRequest, D>
4150        for &FileResizeRequest
4151    {
4152        #[inline]
4153        unsafe fn encode(
4154            self,
4155            encoder: &mut fidl::encoding::Encoder<'_, D>,
4156            offset: usize,
4157            _depth: fidl::encoding::Depth,
4158        ) -> fidl::Result<()> {
4159            encoder.debug_check_bounds::<FileResizeRequest>(offset);
4160            unsafe {
4161                // Copy the object into the buffer.
4162                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4163                (buf_ptr as *mut FileResizeRequest)
4164                    .write_unaligned((self as *const FileResizeRequest).read());
4165                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4166                // done second because the memcpy will write garbage to these bytes.
4167            }
4168            Ok(())
4169        }
4170    }
4171    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4172        fidl::encoding::Encode<FileResizeRequest, D> for (T0,)
4173    {
4174        #[inline]
4175        unsafe fn encode(
4176            self,
4177            encoder: &mut fidl::encoding::Encoder<'_, D>,
4178            offset: usize,
4179            depth: fidl::encoding::Depth,
4180        ) -> fidl::Result<()> {
4181            encoder.debug_check_bounds::<FileResizeRequest>(offset);
4182            // Zero out padding regions. There's no need to apply masks
4183            // because the unmasked parts will be overwritten by fields.
4184            // Write the fields.
4185            self.0.encode(encoder, offset + 0, depth)?;
4186            Ok(())
4187        }
4188    }
4189
4190    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileResizeRequest {
4191        #[inline(always)]
4192        fn new_empty() -> Self {
4193            Self { length: fidl::new_empty!(u64, D) }
4194        }
4195
4196        #[inline]
4197        unsafe fn decode(
4198            &mut self,
4199            decoder: &mut fidl::encoding::Decoder<'_, D>,
4200            offset: usize,
4201            _depth: fidl::encoding::Depth,
4202        ) -> fidl::Result<()> {
4203            decoder.debug_check_bounds::<Self>(offset);
4204            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4205            // Verify that padding bytes are zero.
4206            // Copy from the buffer into the object.
4207            unsafe {
4208                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4209            }
4210            Ok(())
4211        }
4212    }
4213
4214    impl fidl::encoding::ValueTypeMarker for FileSeekRequest {
4215        type Borrowed<'a> = &'a Self;
4216        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4217            value
4218        }
4219    }
4220
4221    unsafe impl fidl::encoding::TypeMarker for FileSeekRequest {
4222        type Owned = Self;
4223
4224        #[inline(always)]
4225        fn inline_align(_context: fidl::encoding::Context) -> usize {
4226            8
4227        }
4228
4229        #[inline(always)]
4230        fn inline_size(_context: fidl::encoding::Context) -> usize {
4231            16
4232        }
4233    }
4234
4235    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSeekRequest, D>
4236        for &FileSeekRequest
4237    {
4238        #[inline]
4239        unsafe fn encode(
4240            self,
4241            encoder: &mut fidl::encoding::Encoder<'_, D>,
4242            offset: usize,
4243            _depth: fidl::encoding::Depth,
4244        ) -> fidl::Result<()> {
4245            encoder.debug_check_bounds::<FileSeekRequest>(offset);
4246            // Delegate to tuple encoding.
4247            fidl::encoding::Encode::<FileSeekRequest, D>::encode(
4248                (
4249                    <SeekOrigin as fidl::encoding::ValueTypeMarker>::borrow(&self.origin),
4250                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
4251                ),
4252                encoder,
4253                offset,
4254                _depth,
4255            )
4256        }
4257    }
4258    unsafe impl<
4259        D: fidl::encoding::ResourceDialect,
4260        T0: fidl::encoding::Encode<SeekOrigin, D>,
4261        T1: fidl::encoding::Encode<i64, D>,
4262    > fidl::encoding::Encode<FileSeekRequest, D> for (T0, T1)
4263    {
4264        #[inline]
4265        unsafe fn encode(
4266            self,
4267            encoder: &mut fidl::encoding::Encoder<'_, D>,
4268            offset: usize,
4269            depth: fidl::encoding::Depth,
4270        ) -> fidl::Result<()> {
4271            encoder.debug_check_bounds::<FileSeekRequest>(offset);
4272            // Zero out padding regions. There's no need to apply masks
4273            // because the unmasked parts will be overwritten by fields.
4274            unsafe {
4275                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4276                (ptr as *mut u64).write_unaligned(0);
4277            }
4278            // Write the fields.
4279            self.0.encode(encoder, offset + 0, depth)?;
4280            self.1.encode(encoder, offset + 8, depth)?;
4281            Ok(())
4282        }
4283    }
4284
4285    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSeekRequest {
4286        #[inline(always)]
4287        fn new_empty() -> Self {
4288            Self { origin: fidl::new_empty!(SeekOrigin, D), offset: fidl::new_empty!(i64, D) }
4289        }
4290
4291        #[inline]
4292        unsafe fn decode(
4293            &mut self,
4294            decoder: &mut fidl::encoding::Decoder<'_, D>,
4295            offset: usize,
4296            _depth: fidl::encoding::Depth,
4297        ) -> fidl::Result<()> {
4298            decoder.debug_check_bounds::<Self>(offset);
4299            // Verify that padding bytes are zero.
4300            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4301            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4302            let mask = 0xffffffff00000000u64;
4303            let maskedval = padval & mask;
4304            if maskedval != 0 {
4305                return Err(fidl::Error::NonZeroPadding {
4306                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4307                });
4308            }
4309            fidl::decode!(SeekOrigin, D, &mut self.origin, decoder, offset + 0, _depth)?;
4310            fidl::decode!(i64, D, &mut self.offset, decoder, offset + 8, _depth)?;
4311            Ok(())
4312        }
4313    }
4314
4315    impl fidl::encoding::ValueTypeMarker for FileWriteAtRequest {
4316        type Borrowed<'a> = &'a Self;
4317        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4318            value
4319        }
4320    }
4321
4322    unsafe impl fidl::encoding::TypeMarker for FileWriteAtRequest {
4323        type Owned = Self;
4324
4325        #[inline(always)]
4326        fn inline_align(_context: fidl::encoding::Context) -> usize {
4327            8
4328        }
4329
4330        #[inline(always)]
4331        fn inline_size(_context: fidl::encoding::Context) -> usize {
4332            24
4333        }
4334    }
4335
4336    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileWriteAtRequest, D>
4337        for &FileWriteAtRequest
4338    {
4339        #[inline]
4340        unsafe fn encode(
4341            self,
4342            encoder: &mut fidl::encoding::Encoder<'_, D>,
4343            offset: usize,
4344            _depth: fidl::encoding::Depth,
4345        ) -> fidl::Result<()> {
4346            encoder.debug_check_bounds::<FileWriteAtRequest>(offset);
4347            // Delegate to tuple encoding.
4348            fidl::encoding::Encode::<FileWriteAtRequest, D>::encode(
4349                (
4350                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
4351                        &self.data,
4352                    ),
4353                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
4354                ),
4355                encoder,
4356                offset,
4357                _depth,
4358            )
4359        }
4360    }
4361    unsafe impl<
4362        D: fidl::encoding::ResourceDialect,
4363        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
4364        T1: fidl::encoding::Encode<u64, D>,
4365    > fidl::encoding::Encode<FileWriteAtRequest, D> for (T0, T1)
4366    {
4367        #[inline]
4368        unsafe fn encode(
4369            self,
4370            encoder: &mut fidl::encoding::Encoder<'_, D>,
4371            offset: usize,
4372            depth: fidl::encoding::Depth,
4373        ) -> fidl::Result<()> {
4374            encoder.debug_check_bounds::<FileWriteAtRequest>(offset);
4375            // Zero out padding regions. There's no need to apply masks
4376            // because the unmasked parts will be overwritten by fields.
4377            // Write the fields.
4378            self.0.encode(encoder, offset + 0, depth)?;
4379            self.1.encode(encoder, offset + 16, depth)?;
4380            Ok(())
4381        }
4382    }
4383
4384    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileWriteAtRequest {
4385        #[inline(always)]
4386        fn new_empty() -> Self {
4387            Self {
4388                data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
4389                offset: fidl::new_empty!(u64, D),
4390            }
4391        }
4392
4393        #[inline]
4394        unsafe fn decode(
4395            &mut self,
4396            decoder: &mut fidl::encoding::Decoder<'_, D>,
4397            offset: usize,
4398            _depth: fidl::encoding::Depth,
4399        ) -> fidl::Result<()> {
4400            decoder.debug_check_bounds::<Self>(offset);
4401            // Verify that padding bytes are zero.
4402            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
4403            fidl::decode!(u64, D, &mut self.offset, decoder, offset + 16, _depth)?;
4404            Ok(())
4405        }
4406    }
4407
4408    impl fidl::encoding::ValueTypeMarker for FileReadAtResponse {
4409        type Borrowed<'a> = &'a Self;
4410        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4411            value
4412        }
4413    }
4414
4415    unsafe impl fidl::encoding::TypeMarker for FileReadAtResponse {
4416        type Owned = Self;
4417
4418        #[inline(always)]
4419        fn inline_align(_context: fidl::encoding::Context) -> usize {
4420            8
4421        }
4422
4423        #[inline(always)]
4424        fn inline_size(_context: fidl::encoding::Context) -> usize {
4425            16
4426        }
4427    }
4428
4429    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReadAtResponse, D>
4430        for &FileReadAtResponse
4431    {
4432        #[inline]
4433        unsafe fn encode(
4434            self,
4435            encoder: &mut fidl::encoding::Encoder<'_, D>,
4436            offset: usize,
4437            _depth: fidl::encoding::Depth,
4438        ) -> fidl::Result<()> {
4439            encoder.debug_check_bounds::<FileReadAtResponse>(offset);
4440            // Delegate to tuple encoding.
4441            fidl::encoding::Encode::<FileReadAtResponse, D>::encode(
4442                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
4443                    &self.data,
4444                ),),
4445                encoder,
4446                offset,
4447                _depth,
4448            )
4449        }
4450    }
4451    unsafe impl<
4452        D: fidl::encoding::ResourceDialect,
4453        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
4454    > fidl::encoding::Encode<FileReadAtResponse, D> for (T0,)
4455    {
4456        #[inline]
4457        unsafe fn encode(
4458            self,
4459            encoder: &mut fidl::encoding::Encoder<'_, D>,
4460            offset: usize,
4461            depth: fidl::encoding::Depth,
4462        ) -> fidl::Result<()> {
4463            encoder.debug_check_bounds::<FileReadAtResponse>(offset);
4464            // Zero out padding regions. There's no need to apply masks
4465            // because the unmasked parts will be overwritten by fields.
4466            // Write the fields.
4467            self.0.encode(encoder, offset + 0, depth)?;
4468            Ok(())
4469        }
4470    }
4471
4472    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReadAtResponse {
4473        #[inline(always)]
4474        fn new_empty() -> Self {
4475            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
4476        }
4477
4478        #[inline]
4479        unsafe fn decode(
4480            &mut self,
4481            decoder: &mut fidl::encoding::Decoder<'_, D>,
4482            offset: usize,
4483            _depth: fidl::encoding::Depth,
4484        ) -> fidl::Result<()> {
4485            decoder.debug_check_bounds::<Self>(offset);
4486            // Verify that padding bytes are zero.
4487            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
4488            Ok(())
4489        }
4490    }
4491
4492    impl fidl::encoding::ValueTypeMarker for FileSeekResponse {
4493        type Borrowed<'a> = &'a Self;
4494        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4495            value
4496        }
4497    }
4498
4499    unsafe impl fidl::encoding::TypeMarker for FileSeekResponse {
4500        type Owned = Self;
4501
4502        #[inline(always)]
4503        fn inline_align(_context: fidl::encoding::Context) -> usize {
4504            8
4505        }
4506
4507        #[inline(always)]
4508        fn inline_size(_context: fidl::encoding::Context) -> usize {
4509            8
4510        }
4511        #[inline(always)]
4512        fn encode_is_copy() -> bool {
4513            true
4514        }
4515
4516        #[inline(always)]
4517        fn decode_is_copy() -> bool {
4518            true
4519        }
4520    }
4521
4522    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSeekResponse, D>
4523        for &FileSeekResponse
4524    {
4525        #[inline]
4526        unsafe fn encode(
4527            self,
4528            encoder: &mut fidl::encoding::Encoder<'_, D>,
4529            offset: usize,
4530            _depth: fidl::encoding::Depth,
4531        ) -> fidl::Result<()> {
4532            encoder.debug_check_bounds::<FileSeekResponse>(offset);
4533            unsafe {
4534                // Copy the object into the buffer.
4535                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4536                (buf_ptr as *mut FileSeekResponse)
4537                    .write_unaligned((self as *const FileSeekResponse).read());
4538                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4539                // done second because the memcpy will write garbage to these bytes.
4540            }
4541            Ok(())
4542        }
4543    }
4544    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4545        fidl::encoding::Encode<FileSeekResponse, D> for (T0,)
4546    {
4547        #[inline]
4548        unsafe fn encode(
4549            self,
4550            encoder: &mut fidl::encoding::Encoder<'_, D>,
4551            offset: usize,
4552            depth: fidl::encoding::Depth,
4553        ) -> fidl::Result<()> {
4554            encoder.debug_check_bounds::<FileSeekResponse>(offset);
4555            // Zero out padding regions. There's no need to apply masks
4556            // because the unmasked parts will be overwritten by fields.
4557            // Write the fields.
4558            self.0.encode(encoder, offset + 0, depth)?;
4559            Ok(())
4560        }
4561    }
4562
4563    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSeekResponse {
4564        #[inline(always)]
4565        fn new_empty() -> Self {
4566            Self { offset_from_start: fidl::new_empty!(u64, D) }
4567        }
4568
4569        #[inline]
4570        unsafe fn decode(
4571            &mut self,
4572            decoder: &mut fidl::encoding::Decoder<'_, D>,
4573            offset: usize,
4574            _depth: fidl::encoding::Depth,
4575        ) -> fidl::Result<()> {
4576            decoder.debug_check_bounds::<Self>(offset);
4577            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4578            // Verify that padding bytes are zero.
4579            // Copy from the buffer into the object.
4580            unsafe {
4581                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4582            }
4583            Ok(())
4584        }
4585    }
4586
4587    impl fidl::encoding::ValueTypeMarker for FileWriteAtResponse {
4588        type Borrowed<'a> = &'a Self;
4589        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4590            value
4591        }
4592    }
4593
4594    unsafe impl fidl::encoding::TypeMarker for FileWriteAtResponse {
4595        type Owned = Self;
4596
4597        #[inline(always)]
4598        fn inline_align(_context: fidl::encoding::Context) -> usize {
4599            8
4600        }
4601
4602        #[inline(always)]
4603        fn inline_size(_context: fidl::encoding::Context) -> usize {
4604            8
4605        }
4606        #[inline(always)]
4607        fn encode_is_copy() -> bool {
4608            true
4609        }
4610
4611        #[inline(always)]
4612        fn decode_is_copy() -> bool {
4613            true
4614        }
4615    }
4616
4617    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileWriteAtResponse, D>
4618        for &FileWriteAtResponse
4619    {
4620        #[inline]
4621        unsafe fn encode(
4622            self,
4623            encoder: &mut fidl::encoding::Encoder<'_, D>,
4624            offset: usize,
4625            _depth: fidl::encoding::Depth,
4626        ) -> fidl::Result<()> {
4627            encoder.debug_check_bounds::<FileWriteAtResponse>(offset);
4628            unsafe {
4629                // Copy the object into the buffer.
4630                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4631                (buf_ptr as *mut FileWriteAtResponse)
4632                    .write_unaligned((self as *const FileWriteAtResponse).read());
4633                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4634                // done second because the memcpy will write garbage to these bytes.
4635            }
4636            Ok(())
4637        }
4638    }
4639    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4640        fidl::encoding::Encode<FileWriteAtResponse, D> for (T0,)
4641    {
4642        #[inline]
4643        unsafe fn encode(
4644            self,
4645            encoder: &mut fidl::encoding::Encoder<'_, D>,
4646            offset: usize,
4647            depth: fidl::encoding::Depth,
4648        ) -> fidl::Result<()> {
4649            encoder.debug_check_bounds::<FileWriteAtResponse>(offset);
4650            // Zero out padding regions. There's no need to apply masks
4651            // because the unmasked parts will be overwritten by fields.
4652            // Write the fields.
4653            self.0.encode(encoder, offset + 0, depth)?;
4654            Ok(())
4655        }
4656    }
4657
4658    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileWriteAtResponse {
4659        #[inline(always)]
4660        fn new_empty() -> Self {
4661            Self { actual_count: fidl::new_empty!(u64, D) }
4662        }
4663
4664        #[inline]
4665        unsafe fn decode(
4666            &mut self,
4667            decoder: &mut fidl::encoding::Decoder<'_, D>,
4668            offset: usize,
4669            _depth: fidl::encoding::Depth,
4670        ) -> fidl::Result<()> {
4671            decoder.debug_check_bounds::<Self>(offset);
4672            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4673            // Verify that padding bytes are zero.
4674            // Copy from the buffer into the object.
4675            unsafe {
4676                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4677            }
4678            Ok(())
4679        }
4680    }
4681
4682    impl fidl::encoding::ValueTypeMarker for FilesystemInfo {
4683        type Borrowed<'a> = &'a Self;
4684        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4685            value
4686        }
4687    }
4688
4689    unsafe impl fidl::encoding::TypeMarker for FilesystemInfo {
4690        type Owned = Self;
4691
4692        #[inline(always)]
4693        fn inline_align(_context: fidl::encoding::Context) -> usize {
4694            8
4695        }
4696
4697        #[inline(always)]
4698        fn inline_size(_context: fidl::encoding::Context) -> usize {
4699            96
4700        }
4701        #[inline(always)]
4702        fn encode_is_copy() -> bool {
4703            true
4704        }
4705
4706        #[inline(always)]
4707        fn decode_is_copy() -> bool {
4708            true
4709        }
4710    }
4711
4712    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilesystemInfo, D>
4713        for &FilesystemInfo
4714    {
4715        #[inline]
4716        unsafe fn encode(
4717            self,
4718            encoder: &mut fidl::encoding::Encoder<'_, D>,
4719            offset: usize,
4720            _depth: fidl::encoding::Depth,
4721        ) -> fidl::Result<()> {
4722            encoder.debug_check_bounds::<FilesystemInfo>(offset);
4723            unsafe {
4724                // Copy the object into the buffer.
4725                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4726                (buf_ptr as *mut FilesystemInfo)
4727                    .write_unaligned((self as *const FilesystemInfo).read());
4728                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4729                // done second because the memcpy will write garbage to these bytes.
4730            }
4731            Ok(())
4732        }
4733    }
4734    unsafe impl<
4735        D: fidl::encoding::ResourceDialect,
4736        T0: fidl::encoding::Encode<u64, D>,
4737        T1: fidl::encoding::Encode<u64, D>,
4738        T2: fidl::encoding::Encode<u64, D>,
4739        T3: fidl::encoding::Encode<u64, D>,
4740        T4: fidl::encoding::Encode<u64, D>,
4741        T5: fidl::encoding::Encode<u64, D>,
4742        T6: fidl::encoding::Encode<u32, D>,
4743        T7: fidl::encoding::Encode<u32, D>,
4744        T8: fidl::encoding::Encode<u32, D>,
4745        T9: fidl::encoding::Encode<u32, D>,
4746        T10: fidl::encoding::Encode<fidl::encoding::Array<i8, 32>, D>,
4747    > fidl::encoding::Encode<FilesystemInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
4748    {
4749        #[inline]
4750        unsafe fn encode(
4751            self,
4752            encoder: &mut fidl::encoding::Encoder<'_, D>,
4753            offset: usize,
4754            depth: fidl::encoding::Depth,
4755        ) -> fidl::Result<()> {
4756            encoder.debug_check_bounds::<FilesystemInfo>(offset);
4757            // Zero out padding regions. There's no need to apply masks
4758            // because the unmasked parts will be overwritten by fields.
4759            // Write the fields.
4760            self.0.encode(encoder, offset + 0, depth)?;
4761            self.1.encode(encoder, offset + 8, depth)?;
4762            self.2.encode(encoder, offset + 16, depth)?;
4763            self.3.encode(encoder, offset + 24, depth)?;
4764            self.4.encode(encoder, offset + 32, depth)?;
4765            self.5.encode(encoder, offset + 40, depth)?;
4766            self.6.encode(encoder, offset + 48, depth)?;
4767            self.7.encode(encoder, offset + 52, depth)?;
4768            self.8.encode(encoder, offset + 56, depth)?;
4769            self.9.encode(encoder, offset + 60, depth)?;
4770            self.10.encode(encoder, offset + 64, depth)?;
4771            Ok(())
4772        }
4773    }
4774
4775    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilesystemInfo {
4776        #[inline(always)]
4777        fn new_empty() -> Self {
4778            Self {
4779                total_bytes: fidl::new_empty!(u64, D),
4780                used_bytes: fidl::new_empty!(u64, D),
4781                total_nodes: fidl::new_empty!(u64, D),
4782                used_nodes: fidl::new_empty!(u64, D),
4783                free_shared_pool_bytes: fidl::new_empty!(u64, D),
4784                fs_id: fidl::new_empty!(u64, D),
4785                block_size: fidl::new_empty!(u32, D),
4786                max_filename_size: fidl::new_empty!(u32, D),
4787                fs_type: fidl::new_empty!(u32, D),
4788                padding: fidl::new_empty!(u32, D),
4789                name: fidl::new_empty!(fidl::encoding::Array<i8, 32>, D),
4790            }
4791        }
4792
4793        #[inline]
4794        unsafe fn decode(
4795            &mut self,
4796            decoder: &mut fidl::encoding::Decoder<'_, D>,
4797            offset: usize,
4798            _depth: fidl::encoding::Depth,
4799        ) -> fidl::Result<()> {
4800            decoder.debug_check_bounds::<Self>(offset);
4801            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4802            // Verify that padding bytes are zero.
4803            // Copy from the buffer into the object.
4804            unsafe {
4805                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 96);
4806            }
4807            Ok(())
4808        }
4809    }
4810
4811    impl fidl::encoding::ValueTypeMarker for FscryptPolicy {
4812        type Borrowed<'a> = &'a Self;
4813        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4814            value
4815        }
4816    }
4817
4818    unsafe impl fidl::encoding::TypeMarker for FscryptPolicy {
4819        type Owned = Self;
4820
4821        #[inline(always)]
4822        fn inline_align(_context: fidl::encoding::Context) -> usize {
4823            1
4824        }
4825
4826        #[inline(always)]
4827        fn inline_size(_context: fidl::encoding::Context) -> usize {
4828            17
4829        }
4830    }
4831
4832    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FscryptPolicy, D>
4833        for &FscryptPolicy
4834    {
4835        #[inline]
4836        unsafe fn encode(
4837            self,
4838            encoder: &mut fidl::encoding::Encoder<'_, D>,
4839            offset: usize,
4840            _depth: fidl::encoding::Depth,
4841        ) -> fidl::Result<()> {
4842            encoder.debug_check_bounds::<FscryptPolicy>(offset);
4843            // Delegate to tuple encoding.
4844            fidl::encoding::Encode::<FscryptPolicy, D>::encode(
4845                (
4846                    <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(
4847                        &self.key_identifier,
4848                    ),
4849                    <FscryptPolicyFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
4850                ),
4851                encoder,
4852                offset,
4853                _depth,
4854            )
4855        }
4856    }
4857    unsafe impl<
4858        D: fidl::encoding::ResourceDialect,
4859        T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
4860        T1: fidl::encoding::Encode<FscryptPolicyFlags, D>,
4861    > fidl::encoding::Encode<FscryptPolicy, D> for (T0, T1)
4862    {
4863        #[inline]
4864        unsafe fn encode(
4865            self,
4866            encoder: &mut fidl::encoding::Encoder<'_, D>,
4867            offset: usize,
4868            depth: fidl::encoding::Depth,
4869        ) -> fidl::Result<()> {
4870            encoder.debug_check_bounds::<FscryptPolicy>(offset);
4871            // Zero out padding regions. There's no need to apply masks
4872            // because the unmasked parts will be overwritten by fields.
4873            // Write the fields.
4874            self.0.encode(encoder, offset + 0, depth)?;
4875            self.1.encode(encoder, offset + 16, depth)?;
4876            Ok(())
4877        }
4878    }
4879
4880    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FscryptPolicy {
4881        #[inline(always)]
4882        fn new_empty() -> Self {
4883            Self {
4884                key_identifier: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D),
4885                flags: fidl::new_empty!(FscryptPolicyFlags, D),
4886            }
4887        }
4888
4889        #[inline]
4890        unsafe fn decode(
4891            &mut self,
4892            decoder: &mut fidl::encoding::Decoder<'_, D>,
4893            offset: usize,
4894            _depth: fidl::encoding::Depth,
4895        ) -> fidl::Result<()> {
4896            decoder.debug_check_bounds::<Self>(offset);
4897            // Verify that padding bytes are zero.
4898            fidl::decode!(fidl::encoding::Array<u8, 16>, D, &mut self.key_identifier, decoder, offset + 0, _depth)?;
4899            fidl::decode!(FscryptPolicyFlags, D, &mut self.flags, decoder, offset + 16, _depth)?;
4900            Ok(())
4901        }
4902    }
4903
4904    impl fidl::encoding::ValueTypeMarker for NodeAttributes {
4905        type Borrowed<'a> = &'a Self;
4906        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4907            value
4908        }
4909    }
4910
4911    unsafe impl fidl::encoding::TypeMarker for NodeAttributes {
4912        type Owned = Self;
4913
4914        #[inline(always)]
4915        fn inline_align(_context: fidl::encoding::Context) -> usize {
4916            8
4917        }
4918
4919        #[inline(always)]
4920        fn inline_size(_context: fidl::encoding::Context) -> usize {
4921            56
4922        }
4923    }
4924
4925    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeAttributes, D>
4926        for &NodeAttributes
4927    {
4928        #[inline]
4929        unsafe fn encode(
4930            self,
4931            encoder: &mut fidl::encoding::Encoder<'_, D>,
4932            offset: usize,
4933            _depth: fidl::encoding::Depth,
4934        ) -> fidl::Result<()> {
4935            encoder.debug_check_bounds::<NodeAttributes>(offset);
4936            unsafe {
4937                // Copy the object into the buffer.
4938                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4939                (buf_ptr as *mut NodeAttributes)
4940                    .write_unaligned((self as *const NodeAttributes).read());
4941                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4942                // done second because the memcpy will write garbage to these bytes.
4943                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4944                let padding_mask = 0xffffffff00000000u64;
4945                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4946            }
4947            Ok(())
4948        }
4949    }
4950    unsafe impl<
4951        D: fidl::encoding::ResourceDialect,
4952        T0: fidl::encoding::Encode<u32, D>,
4953        T1: fidl::encoding::Encode<u64, D>,
4954        T2: fidl::encoding::Encode<u64, D>,
4955        T3: fidl::encoding::Encode<u64, D>,
4956        T4: fidl::encoding::Encode<u64, D>,
4957        T5: fidl::encoding::Encode<u64, D>,
4958        T6: fidl::encoding::Encode<u64, D>,
4959    > fidl::encoding::Encode<NodeAttributes, D> for (T0, T1, T2, T3, T4, T5, T6)
4960    {
4961        #[inline]
4962        unsafe fn encode(
4963            self,
4964            encoder: &mut fidl::encoding::Encoder<'_, D>,
4965            offset: usize,
4966            depth: fidl::encoding::Depth,
4967        ) -> fidl::Result<()> {
4968            encoder.debug_check_bounds::<NodeAttributes>(offset);
4969            // Zero out padding regions. There's no need to apply masks
4970            // because the unmasked parts will be overwritten by fields.
4971            unsafe {
4972                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4973                (ptr as *mut u64).write_unaligned(0);
4974            }
4975            // Write the fields.
4976            self.0.encode(encoder, offset + 0, depth)?;
4977            self.1.encode(encoder, offset + 8, depth)?;
4978            self.2.encode(encoder, offset + 16, depth)?;
4979            self.3.encode(encoder, offset + 24, depth)?;
4980            self.4.encode(encoder, offset + 32, depth)?;
4981            self.5.encode(encoder, offset + 40, depth)?;
4982            self.6.encode(encoder, offset + 48, depth)?;
4983            Ok(())
4984        }
4985    }
4986
4987    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributes {
4988        #[inline(always)]
4989        fn new_empty() -> Self {
4990            Self {
4991                mode: fidl::new_empty!(u32, D),
4992                id: fidl::new_empty!(u64, D),
4993                content_size: fidl::new_empty!(u64, D),
4994                storage_size: fidl::new_empty!(u64, D),
4995                link_count: fidl::new_empty!(u64, D),
4996                creation_time: fidl::new_empty!(u64, D),
4997                modification_time: fidl::new_empty!(u64, D),
4998            }
4999        }
5000
5001        #[inline]
5002        unsafe fn decode(
5003            &mut self,
5004            decoder: &mut fidl::encoding::Decoder<'_, D>,
5005            offset: usize,
5006            _depth: fidl::encoding::Depth,
5007        ) -> fidl::Result<()> {
5008            decoder.debug_check_bounds::<Self>(offset);
5009            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5010            // Verify that padding bytes are zero.
5011            let ptr = unsafe { buf_ptr.offset(0) };
5012            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5013            let mask = 0xffffffff00000000u64;
5014            let maskedval = padval & mask;
5015            if maskedval != 0 {
5016                return Err(fidl::Error::NonZeroPadding {
5017                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5018                });
5019            }
5020            // Copy from the buffer into the object.
5021            unsafe {
5022                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
5023            }
5024            Ok(())
5025        }
5026    }
5027
5028    impl fidl::encoding::ValueTypeMarker for NodeAttributes2 {
5029        type Borrowed<'a> = &'a Self;
5030        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5031            value
5032        }
5033    }
5034
5035    unsafe impl fidl::encoding::TypeMarker for NodeAttributes2 {
5036        type Owned = Self;
5037
5038        #[inline(always)]
5039        fn inline_align(_context: fidl::encoding::Context) -> usize {
5040            8
5041        }
5042
5043        #[inline(always)]
5044        fn inline_size(_context: fidl::encoding::Context) -> usize {
5045            32
5046        }
5047    }
5048
5049    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeAttributes2, D>
5050        for &NodeAttributes2
5051    {
5052        #[inline]
5053        unsafe fn encode(
5054            self,
5055            encoder: &mut fidl::encoding::Encoder<'_, D>,
5056            offset: usize,
5057            _depth: fidl::encoding::Depth,
5058        ) -> fidl::Result<()> {
5059            encoder.debug_check_bounds::<NodeAttributes2>(offset);
5060            // Delegate to tuple encoding.
5061            fidl::encoding::Encode::<NodeAttributes2, D>::encode(
5062                (
5063                    <MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(
5064                        &self.mutable_attributes,
5065                    ),
5066                    <ImmutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(
5067                        &self.immutable_attributes,
5068                    ),
5069                ),
5070                encoder,
5071                offset,
5072                _depth,
5073            )
5074        }
5075    }
5076    unsafe impl<
5077        D: fidl::encoding::ResourceDialect,
5078        T0: fidl::encoding::Encode<MutableNodeAttributes, D>,
5079        T1: fidl::encoding::Encode<ImmutableNodeAttributes, D>,
5080    > fidl::encoding::Encode<NodeAttributes2, D> for (T0, T1)
5081    {
5082        #[inline]
5083        unsafe fn encode(
5084            self,
5085            encoder: &mut fidl::encoding::Encoder<'_, D>,
5086            offset: usize,
5087            depth: fidl::encoding::Depth,
5088        ) -> fidl::Result<()> {
5089            encoder.debug_check_bounds::<NodeAttributes2>(offset);
5090            // Zero out padding regions. There's no need to apply masks
5091            // because the unmasked parts will be overwritten by fields.
5092            // Write the fields.
5093            self.0.encode(encoder, offset + 0, depth)?;
5094            self.1.encode(encoder, offset + 16, depth)?;
5095            Ok(())
5096        }
5097    }
5098
5099    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributes2 {
5100        #[inline(always)]
5101        fn new_empty() -> Self {
5102            Self {
5103                mutable_attributes: fidl::new_empty!(MutableNodeAttributes, D),
5104                immutable_attributes: fidl::new_empty!(ImmutableNodeAttributes, D),
5105            }
5106        }
5107
5108        #[inline]
5109        unsafe fn decode(
5110            &mut self,
5111            decoder: &mut fidl::encoding::Decoder<'_, D>,
5112            offset: usize,
5113            _depth: fidl::encoding::Depth,
5114        ) -> fidl::Result<()> {
5115            decoder.debug_check_bounds::<Self>(offset);
5116            // Verify that padding bytes are zero.
5117            fidl::decode!(
5118                MutableNodeAttributes,
5119                D,
5120                &mut self.mutable_attributes,
5121                decoder,
5122                offset + 0,
5123                _depth
5124            )?;
5125            fidl::decode!(
5126                ImmutableNodeAttributes,
5127                D,
5128                &mut self.immutable_attributes,
5129                decoder,
5130                offset + 16,
5131                _depth
5132            )?;
5133            Ok(())
5134        }
5135    }
5136
5137    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedGetAttrResponse {
5138        type Borrowed<'a> = &'a Self;
5139        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5140            value
5141        }
5142    }
5143
5144    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedGetAttrResponse {
5145        type Owned = Self;
5146
5147        #[inline(always)]
5148        fn inline_align(_context: fidl::encoding::Context) -> usize {
5149            8
5150        }
5151
5152        #[inline(always)]
5153        fn inline_size(_context: fidl::encoding::Context) -> usize {
5154            64
5155        }
5156    }
5157
5158    unsafe impl<D: fidl::encoding::ResourceDialect>
5159        fidl::encoding::Encode<NodeDeprecatedGetAttrResponse, D>
5160        for &NodeDeprecatedGetAttrResponse
5161    {
5162        #[inline]
5163        unsafe fn encode(
5164            self,
5165            encoder: &mut fidl::encoding::Encoder<'_, D>,
5166            offset: usize,
5167            _depth: fidl::encoding::Depth,
5168        ) -> fidl::Result<()> {
5169            encoder.debug_check_bounds::<NodeDeprecatedGetAttrResponse>(offset);
5170            unsafe {
5171                // Copy the object into the buffer.
5172                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5173                (buf_ptr as *mut NodeDeprecatedGetAttrResponse)
5174                    .write_unaligned((self as *const NodeDeprecatedGetAttrResponse).read());
5175                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5176                // done second because the memcpy will write garbage to these bytes.
5177                let padding_ptr = buf_ptr.offset(0) as *mut u64;
5178                let padding_mask = 0xffffffff00000000u64;
5179                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5180                let padding_ptr = buf_ptr.offset(8) as *mut u64;
5181                let padding_mask = 0xffffffff00000000u64;
5182                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
5183            }
5184            Ok(())
5185        }
5186    }
5187    unsafe impl<
5188        D: fidl::encoding::ResourceDialect,
5189        T0: fidl::encoding::Encode<i32, D>,
5190        T1: fidl::encoding::Encode<NodeAttributes, D>,
5191    > fidl::encoding::Encode<NodeDeprecatedGetAttrResponse, D> for (T0, T1)
5192    {
5193        #[inline]
5194        unsafe fn encode(
5195            self,
5196            encoder: &mut fidl::encoding::Encoder<'_, D>,
5197            offset: usize,
5198            depth: fidl::encoding::Depth,
5199        ) -> fidl::Result<()> {
5200            encoder.debug_check_bounds::<NodeDeprecatedGetAttrResponse>(offset);
5201            // Zero out padding regions. There's no need to apply masks
5202            // because the unmasked parts will be overwritten by fields.
5203            unsafe {
5204                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5205                (ptr as *mut u64).write_unaligned(0);
5206            }
5207            // Write the fields.
5208            self.0.encode(encoder, offset + 0, depth)?;
5209            self.1.encode(encoder, offset + 8, depth)?;
5210            Ok(())
5211        }
5212    }
5213
5214    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5215        for NodeDeprecatedGetAttrResponse
5216    {
5217        #[inline(always)]
5218        fn new_empty() -> Self {
5219            Self { s: fidl::new_empty!(i32, D), attributes: fidl::new_empty!(NodeAttributes, D) }
5220        }
5221
5222        #[inline]
5223        unsafe fn decode(
5224            &mut self,
5225            decoder: &mut fidl::encoding::Decoder<'_, D>,
5226            offset: usize,
5227            _depth: fidl::encoding::Depth,
5228        ) -> fidl::Result<()> {
5229            decoder.debug_check_bounds::<Self>(offset);
5230            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5231            // Verify that padding bytes are zero.
5232            let ptr = unsafe { buf_ptr.offset(0) };
5233            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5234            let mask = 0xffffffff00000000u64;
5235            let maskedval = padval & mask;
5236            if maskedval != 0 {
5237                return Err(fidl::Error::NonZeroPadding {
5238                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5239                });
5240            }
5241            let ptr = unsafe { buf_ptr.offset(8) };
5242            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5243            let mask = 0xffffffff00000000u64;
5244            let maskedval = padval & mask;
5245            if maskedval != 0 {
5246                return Err(fidl::Error::NonZeroPadding {
5247                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5248                });
5249            }
5250            // Copy from the buffer into the object.
5251            unsafe {
5252                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 64);
5253            }
5254            Ok(())
5255        }
5256    }
5257
5258    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedGetFlagsResponse {
5259        type Borrowed<'a> = &'a Self;
5260        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5261            value
5262        }
5263    }
5264
5265    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedGetFlagsResponse {
5266        type Owned = Self;
5267
5268        #[inline(always)]
5269        fn inline_align(_context: fidl::encoding::Context) -> usize {
5270            4
5271        }
5272
5273        #[inline(always)]
5274        fn inline_size(_context: fidl::encoding::Context) -> usize {
5275            8
5276        }
5277    }
5278
5279    unsafe impl<D: fidl::encoding::ResourceDialect>
5280        fidl::encoding::Encode<NodeDeprecatedGetFlagsResponse, D>
5281        for &NodeDeprecatedGetFlagsResponse
5282    {
5283        #[inline]
5284        unsafe fn encode(
5285            self,
5286            encoder: &mut fidl::encoding::Encoder<'_, D>,
5287            offset: usize,
5288            _depth: fidl::encoding::Depth,
5289        ) -> fidl::Result<()> {
5290            encoder.debug_check_bounds::<NodeDeprecatedGetFlagsResponse>(offset);
5291            // Delegate to tuple encoding.
5292            fidl::encoding::Encode::<NodeDeprecatedGetFlagsResponse, D>::encode(
5293                (
5294                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
5295                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
5296                ),
5297                encoder,
5298                offset,
5299                _depth,
5300            )
5301        }
5302    }
5303    unsafe impl<
5304        D: fidl::encoding::ResourceDialect,
5305        T0: fidl::encoding::Encode<i32, D>,
5306        T1: fidl::encoding::Encode<OpenFlags, D>,
5307    > fidl::encoding::Encode<NodeDeprecatedGetFlagsResponse, D> for (T0, T1)
5308    {
5309        #[inline]
5310        unsafe fn encode(
5311            self,
5312            encoder: &mut fidl::encoding::Encoder<'_, D>,
5313            offset: usize,
5314            depth: fidl::encoding::Depth,
5315        ) -> fidl::Result<()> {
5316            encoder.debug_check_bounds::<NodeDeprecatedGetFlagsResponse>(offset);
5317            // Zero out padding regions. There's no need to apply masks
5318            // because the unmasked parts will be overwritten by fields.
5319            // Write the fields.
5320            self.0.encode(encoder, offset + 0, depth)?;
5321            self.1.encode(encoder, offset + 4, depth)?;
5322            Ok(())
5323        }
5324    }
5325
5326    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5327        for NodeDeprecatedGetFlagsResponse
5328    {
5329        #[inline(always)]
5330        fn new_empty() -> Self {
5331            Self { s: fidl::new_empty!(i32, D), flags: fidl::new_empty!(OpenFlags, D) }
5332        }
5333
5334        #[inline]
5335        unsafe fn decode(
5336            &mut self,
5337            decoder: &mut fidl::encoding::Decoder<'_, D>,
5338            offset: usize,
5339            _depth: fidl::encoding::Depth,
5340        ) -> fidl::Result<()> {
5341            decoder.debug_check_bounds::<Self>(offset);
5342            // Verify that padding bytes are zero.
5343            fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
5344            fidl::decode!(OpenFlags, D, &mut self.flags, decoder, offset + 4, _depth)?;
5345            Ok(())
5346        }
5347    }
5348
5349    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetAttrRequest {
5350        type Borrowed<'a> = &'a Self;
5351        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5352            value
5353        }
5354    }
5355
5356    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetAttrRequest {
5357        type Owned = Self;
5358
5359        #[inline(always)]
5360        fn inline_align(_context: fidl::encoding::Context) -> usize {
5361            8
5362        }
5363
5364        #[inline(always)]
5365        fn inline_size(_context: fidl::encoding::Context) -> usize {
5366            64
5367        }
5368    }
5369
5370    unsafe impl<D: fidl::encoding::ResourceDialect>
5371        fidl::encoding::Encode<NodeDeprecatedSetAttrRequest, D> for &NodeDeprecatedSetAttrRequest
5372    {
5373        #[inline]
5374        unsafe fn encode(
5375            self,
5376            encoder: &mut fidl::encoding::Encoder<'_, D>,
5377            offset: usize,
5378            _depth: fidl::encoding::Depth,
5379        ) -> fidl::Result<()> {
5380            encoder.debug_check_bounds::<NodeDeprecatedSetAttrRequest>(offset);
5381            // Delegate to tuple encoding.
5382            fidl::encoding::Encode::<NodeDeprecatedSetAttrRequest, D>::encode(
5383                (
5384                    <NodeAttributeFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
5385                    <NodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
5386                ),
5387                encoder,
5388                offset,
5389                _depth,
5390            )
5391        }
5392    }
5393    unsafe impl<
5394        D: fidl::encoding::ResourceDialect,
5395        T0: fidl::encoding::Encode<NodeAttributeFlags, D>,
5396        T1: fidl::encoding::Encode<NodeAttributes, D>,
5397    > fidl::encoding::Encode<NodeDeprecatedSetAttrRequest, D> for (T0, T1)
5398    {
5399        #[inline]
5400        unsafe fn encode(
5401            self,
5402            encoder: &mut fidl::encoding::Encoder<'_, D>,
5403            offset: usize,
5404            depth: fidl::encoding::Depth,
5405        ) -> fidl::Result<()> {
5406            encoder.debug_check_bounds::<NodeDeprecatedSetAttrRequest>(offset);
5407            // Zero out padding regions. There's no need to apply masks
5408            // because the unmasked parts will be overwritten by fields.
5409            unsafe {
5410                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5411                (ptr as *mut u64).write_unaligned(0);
5412            }
5413            // Write the fields.
5414            self.0.encode(encoder, offset + 0, depth)?;
5415            self.1.encode(encoder, offset + 8, depth)?;
5416            Ok(())
5417        }
5418    }
5419
5420    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5421        for NodeDeprecatedSetAttrRequest
5422    {
5423        #[inline(always)]
5424        fn new_empty() -> Self {
5425            Self {
5426                flags: fidl::new_empty!(NodeAttributeFlags, D),
5427                attributes: fidl::new_empty!(NodeAttributes, D),
5428            }
5429        }
5430
5431        #[inline]
5432        unsafe fn decode(
5433            &mut self,
5434            decoder: &mut fidl::encoding::Decoder<'_, D>,
5435            offset: usize,
5436            _depth: fidl::encoding::Depth,
5437        ) -> fidl::Result<()> {
5438            decoder.debug_check_bounds::<Self>(offset);
5439            // Verify that padding bytes are zero.
5440            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5441            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5442            let mask = 0xffffffff00000000u64;
5443            let maskedval = padval & mask;
5444            if maskedval != 0 {
5445                return Err(fidl::Error::NonZeroPadding {
5446                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5447                });
5448            }
5449            fidl::decode!(NodeAttributeFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
5450            fidl::decode!(NodeAttributes, D, &mut self.attributes, decoder, offset + 8, _depth)?;
5451            Ok(())
5452        }
5453    }
5454
5455    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetAttrResponse {
5456        type Borrowed<'a> = &'a Self;
5457        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5458            value
5459        }
5460    }
5461
5462    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetAttrResponse {
5463        type Owned = Self;
5464
5465        #[inline(always)]
5466        fn inline_align(_context: fidl::encoding::Context) -> usize {
5467            4
5468        }
5469
5470        #[inline(always)]
5471        fn inline_size(_context: fidl::encoding::Context) -> usize {
5472            4
5473        }
5474        #[inline(always)]
5475        fn encode_is_copy() -> bool {
5476            true
5477        }
5478
5479        #[inline(always)]
5480        fn decode_is_copy() -> bool {
5481            true
5482        }
5483    }
5484
5485    unsafe impl<D: fidl::encoding::ResourceDialect>
5486        fidl::encoding::Encode<NodeDeprecatedSetAttrResponse, D>
5487        for &NodeDeprecatedSetAttrResponse
5488    {
5489        #[inline]
5490        unsafe fn encode(
5491            self,
5492            encoder: &mut fidl::encoding::Encoder<'_, D>,
5493            offset: usize,
5494            _depth: fidl::encoding::Depth,
5495        ) -> fidl::Result<()> {
5496            encoder.debug_check_bounds::<NodeDeprecatedSetAttrResponse>(offset);
5497            unsafe {
5498                // Copy the object into the buffer.
5499                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5500                (buf_ptr as *mut NodeDeprecatedSetAttrResponse)
5501                    .write_unaligned((self as *const NodeDeprecatedSetAttrResponse).read());
5502                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5503                // done second because the memcpy will write garbage to these bytes.
5504            }
5505            Ok(())
5506        }
5507    }
5508    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
5509        fidl::encoding::Encode<NodeDeprecatedSetAttrResponse, D> for (T0,)
5510    {
5511        #[inline]
5512        unsafe fn encode(
5513            self,
5514            encoder: &mut fidl::encoding::Encoder<'_, D>,
5515            offset: usize,
5516            depth: fidl::encoding::Depth,
5517        ) -> fidl::Result<()> {
5518            encoder.debug_check_bounds::<NodeDeprecatedSetAttrResponse>(offset);
5519            // Zero out padding regions. There's no need to apply masks
5520            // because the unmasked parts will be overwritten by fields.
5521            // Write the fields.
5522            self.0.encode(encoder, offset + 0, depth)?;
5523            Ok(())
5524        }
5525    }
5526
5527    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5528        for NodeDeprecatedSetAttrResponse
5529    {
5530        #[inline(always)]
5531        fn new_empty() -> Self {
5532            Self { s: fidl::new_empty!(i32, D) }
5533        }
5534
5535        #[inline]
5536        unsafe fn decode(
5537            &mut self,
5538            decoder: &mut fidl::encoding::Decoder<'_, D>,
5539            offset: usize,
5540            _depth: fidl::encoding::Depth,
5541        ) -> fidl::Result<()> {
5542            decoder.debug_check_bounds::<Self>(offset);
5543            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5544            // Verify that padding bytes are zero.
5545            // Copy from the buffer into the object.
5546            unsafe {
5547                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5548            }
5549            Ok(())
5550        }
5551    }
5552
5553    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetFlagsRequest {
5554        type Borrowed<'a> = &'a Self;
5555        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5556            value
5557        }
5558    }
5559
5560    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetFlagsRequest {
5561        type Owned = Self;
5562
5563        #[inline(always)]
5564        fn inline_align(_context: fidl::encoding::Context) -> usize {
5565            4
5566        }
5567
5568        #[inline(always)]
5569        fn inline_size(_context: fidl::encoding::Context) -> usize {
5570            4
5571        }
5572    }
5573
5574    unsafe impl<D: fidl::encoding::ResourceDialect>
5575        fidl::encoding::Encode<NodeDeprecatedSetFlagsRequest, D>
5576        for &NodeDeprecatedSetFlagsRequest
5577    {
5578        #[inline]
5579        unsafe fn encode(
5580            self,
5581            encoder: &mut fidl::encoding::Encoder<'_, D>,
5582            offset: usize,
5583            _depth: fidl::encoding::Depth,
5584        ) -> fidl::Result<()> {
5585            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsRequest>(offset);
5586            // Delegate to tuple encoding.
5587            fidl::encoding::Encode::<NodeDeprecatedSetFlagsRequest, D>::encode(
5588                (<OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
5589                encoder,
5590                offset,
5591                _depth,
5592            )
5593        }
5594    }
5595    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OpenFlags, D>>
5596        fidl::encoding::Encode<NodeDeprecatedSetFlagsRequest, D> for (T0,)
5597    {
5598        #[inline]
5599        unsafe fn encode(
5600            self,
5601            encoder: &mut fidl::encoding::Encoder<'_, D>,
5602            offset: usize,
5603            depth: fidl::encoding::Depth,
5604        ) -> fidl::Result<()> {
5605            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsRequest>(offset);
5606            // Zero out padding regions. There's no need to apply masks
5607            // because the unmasked parts will be overwritten by fields.
5608            // Write the fields.
5609            self.0.encode(encoder, offset + 0, depth)?;
5610            Ok(())
5611        }
5612    }
5613
5614    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5615        for NodeDeprecatedSetFlagsRequest
5616    {
5617        #[inline(always)]
5618        fn new_empty() -> Self {
5619            Self { flags: fidl::new_empty!(OpenFlags, D) }
5620        }
5621
5622        #[inline]
5623        unsafe fn decode(
5624            &mut self,
5625            decoder: &mut fidl::encoding::Decoder<'_, D>,
5626            offset: usize,
5627            _depth: fidl::encoding::Depth,
5628        ) -> fidl::Result<()> {
5629            decoder.debug_check_bounds::<Self>(offset);
5630            // Verify that padding bytes are zero.
5631            fidl::decode!(OpenFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
5632            Ok(())
5633        }
5634    }
5635
5636    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetFlagsResponse {
5637        type Borrowed<'a> = &'a Self;
5638        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5639            value
5640        }
5641    }
5642
5643    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetFlagsResponse {
5644        type Owned = Self;
5645
5646        #[inline(always)]
5647        fn inline_align(_context: fidl::encoding::Context) -> usize {
5648            4
5649        }
5650
5651        #[inline(always)]
5652        fn inline_size(_context: fidl::encoding::Context) -> usize {
5653            4
5654        }
5655        #[inline(always)]
5656        fn encode_is_copy() -> bool {
5657            true
5658        }
5659
5660        #[inline(always)]
5661        fn decode_is_copy() -> bool {
5662            true
5663        }
5664    }
5665
5666    unsafe impl<D: fidl::encoding::ResourceDialect>
5667        fidl::encoding::Encode<NodeDeprecatedSetFlagsResponse, D>
5668        for &NodeDeprecatedSetFlagsResponse
5669    {
5670        #[inline]
5671        unsafe fn encode(
5672            self,
5673            encoder: &mut fidl::encoding::Encoder<'_, D>,
5674            offset: usize,
5675            _depth: fidl::encoding::Depth,
5676        ) -> fidl::Result<()> {
5677            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsResponse>(offset);
5678            unsafe {
5679                // Copy the object into the buffer.
5680                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5681                (buf_ptr as *mut NodeDeprecatedSetFlagsResponse)
5682                    .write_unaligned((self as *const NodeDeprecatedSetFlagsResponse).read());
5683                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5684                // done second because the memcpy will write garbage to these bytes.
5685            }
5686            Ok(())
5687        }
5688    }
5689    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
5690        fidl::encoding::Encode<NodeDeprecatedSetFlagsResponse, D> for (T0,)
5691    {
5692        #[inline]
5693        unsafe fn encode(
5694            self,
5695            encoder: &mut fidl::encoding::Encoder<'_, D>,
5696            offset: usize,
5697            depth: fidl::encoding::Depth,
5698        ) -> fidl::Result<()> {
5699            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsResponse>(offset);
5700            // Zero out padding regions. There's no need to apply masks
5701            // because the unmasked parts will be overwritten by fields.
5702            // Write the fields.
5703            self.0.encode(encoder, offset + 0, depth)?;
5704            Ok(())
5705        }
5706    }
5707
5708    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5709        for NodeDeprecatedSetFlagsResponse
5710    {
5711        #[inline(always)]
5712        fn new_empty() -> Self {
5713            Self { s: fidl::new_empty!(i32, D) }
5714        }
5715
5716        #[inline]
5717        unsafe fn decode(
5718            &mut self,
5719            decoder: &mut fidl::encoding::Decoder<'_, D>,
5720            offset: usize,
5721            _depth: fidl::encoding::Depth,
5722        ) -> fidl::Result<()> {
5723            decoder.debug_check_bounds::<Self>(offset);
5724            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5725            // Verify that padding bytes are zero.
5726            // Copy from the buffer into the object.
5727            unsafe {
5728                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5729            }
5730            Ok(())
5731        }
5732    }
5733
5734    impl fidl::encoding::ValueTypeMarker for NodeGetAttributesRequest {
5735        type Borrowed<'a> = &'a Self;
5736        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5737            value
5738        }
5739    }
5740
5741    unsafe impl fidl::encoding::TypeMarker for NodeGetAttributesRequest {
5742        type Owned = Self;
5743
5744        #[inline(always)]
5745        fn inline_align(_context: fidl::encoding::Context) -> usize {
5746            8
5747        }
5748
5749        #[inline(always)]
5750        fn inline_size(_context: fidl::encoding::Context) -> usize {
5751            8
5752        }
5753    }
5754
5755    unsafe impl<D: fidl::encoding::ResourceDialect>
5756        fidl::encoding::Encode<NodeGetAttributesRequest, D> for &NodeGetAttributesRequest
5757    {
5758        #[inline]
5759        unsafe fn encode(
5760            self,
5761            encoder: &mut fidl::encoding::Encoder<'_, D>,
5762            offset: usize,
5763            _depth: fidl::encoding::Depth,
5764        ) -> fidl::Result<()> {
5765            encoder.debug_check_bounds::<NodeGetAttributesRequest>(offset);
5766            // Delegate to tuple encoding.
5767            fidl::encoding::Encode::<NodeGetAttributesRequest, D>::encode(
5768                (<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow(&self.query),),
5769                encoder,
5770                offset,
5771                _depth,
5772            )
5773        }
5774    }
5775    unsafe impl<
5776        D: fidl::encoding::ResourceDialect,
5777        T0: fidl::encoding::Encode<NodeAttributesQuery, D>,
5778    > fidl::encoding::Encode<NodeGetAttributesRequest, D> for (T0,)
5779    {
5780        #[inline]
5781        unsafe fn encode(
5782            self,
5783            encoder: &mut fidl::encoding::Encoder<'_, D>,
5784            offset: usize,
5785            depth: fidl::encoding::Depth,
5786        ) -> fidl::Result<()> {
5787            encoder.debug_check_bounds::<NodeGetAttributesRequest>(offset);
5788            // Zero out padding regions. There's no need to apply masks
5789            // because the unmasked parts will be overwritten by fields.
5790            // Write the fields.
5791            self.0.encode(encoder, offset + 0, depth)?;
5792            Ok(())
5793        }
5794    }
5795
5796    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5797        for NodeGetAttributesRequest
5798    {
5799        #[inline(always)]
5800        fn new_empty() -> Self {
5801            Self { query: fidl::new_empty!(NodeAttributesQuery, D) }
5802        }
5803
5804        #[inline]
5805        unsafe fn decode(
5806            &mut self,
5807            decoder: &mut fidl::encoding::Decoder<'_, D>,
5808            offset: usize,
5809            _depth: fidl::encoding::Depth,
5810        ) -> fidl::Result<()> {
5811            decoder.debug_check_bounds::<Self>(offset);
5812            // Verify that padding bytes are zero.
5813            fidl::decode!(NodeAttributesQuery, D, &mut self.query, decoder, offset + 0, _depth)?;
5814            Ok(())
5815        }
5816    }
5817
5818    impl fidl::encoding::ValueTypeMarker for NodeGetExtendedAttributeRequest {
5819        type Borrowed<'a> = &'a Self;
5820        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5821            value
5822        }
5823    }
5824
5825    unsafe impl fidl::encoding::TypeMarker for NodeGetExtendedAttributeRequest {
5826        type Owned = Self;
5827
5828        #[inline(always)]
5829        fn inline_align(_context: fidl::encoding::Context) -> usize {
5830            8
5831        }
5832
5833        #[inline(always)]
5834        fn inline_size(_context: fidl::encoding::Context) -> usize {
5835            16
5836        }
5837    }
5838
5839    unsafe impl<D: fidl::encoding::ResourceDialect>
5840        fidl::encoding::Encode<NodeGetExtendedAttributeRequest, D>
5841        for &NodeGetExtendedAttributeRequest
5842    {
5843        #[inline]
5844        unsafe fn encode(
5845            self,
5846            encoder: &mut fidl::encoding::Encoder<'_, D>,
5847            offset: usize,
5848            _depth: fidl::encoding::Depth,
5849        ) -> fidl::Result<()> {
5850            encoder.debug_check_bounds::<NodeGetExtendedAttributeRequest>(offset);
5851            // Delegate to tuple encoding.
5852            fidl::encoding::Encode::<NodeGetExtendedAttributeRequest, D>::encode(
5853                (<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
5854                    &self.name,
5855                ),),
5856                encoder,
5857                offset,
5858                _depth,
5859            )
5860        }
5861    }
5862    unsafe impl<
5863        D: fidl::encoding::ResourceDialect,
5864        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>, D>,
5865    > fidl::encoding::Encode<NodeGetExtendedAttributeRequest, D> for (T0,)
5866    {
5867        #[inline]
5868        unsafe fn encode(
5869            self,
5870            encoder: &mut fidl::encoding::Encoder<'_, D>,
5871            offset: usize,
5872            depth: fidl::encoding::Depth,
5873        ) -> fidl::Result<()> {
5874            encoder.debug_check_bounds::<NodeGetExtendedAttributeRequest>(offset);
5875            // Zero out padding regions. There's no need to apply masks
5876            // because the unmasked parts will be overwritten by fields.
5877            // Write the fields.
5878            self.0.encode(encoder, offset + 0, depth)?;
5879            Ok(())
5880        }
5881    }
5882
5883    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5884        for NodeGetExtendedAttributeRequest
5885    {
5886        #[inline(always)]
5887        fn new_empty() -> Self {
5888            Self { name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D) }
5889        }
5890
5891        #[inline]
5892        unsafe fn decode(
5893            &mut self,
5894            decoder: &mut fidl::encoding::Decoder<'_, D>,
5895            offset: usize,
5896            _depth: fidl::encoding::Depth,
5897        ) -> fidl::Result<()> {
5898            decoder.debug_check_bounds::<Self>(offset);
5899            // Verify that padding bytes are zero.
5900            fidl::decode!(fidl::encoding::Vector<u8, 255>, D, &mut self.name, decoder, offset + 0, _depth)?;
5901            Ok(())
5902        }
5903    }
5904
5905    impl fidl::encoding::ValueTypeMarker for NodeQueryFilesystemResponse {
5906        type Borrowed<'a> = &'a Self;
5907        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5908            value
5909        }
5910    }
5911
5912    unsafe impl fidl::encoding::TypeMarker for NodeQueryFilesystemResponse {
5913        type Owned = Self;
5914
5915        #[inline(always)]
5916        fn inline_align(_context: fidl::encoding::Context) -> usize {
5917            8
5918        }
5919
5920        #[inline(always)]
5921        fn inline_size(_context: fidl::encoding::Context) -> usize {
5922            16
5923        }
5924    }
5925
5926    unsafe impl<D: fidl::encoding::ResourceDialect>
5927        fidl::encoding::Encode<NodeQueryFilesystemResponse, D> for &NodeQueryFilesystemResponse
5928    {
5929        #[inline]
5930        unsafe fn encode(
5931            self,
5932            encoder: &mut fidl::encoding::Encoder<'_, D>,
5933            offset: usize,
5934            _depth: fidl::encoding::Depth,
5935        ) -> fidl::Result<()> {
5936            encoder.debug_check_bounds::<NodeQueryFilesystemResponse>(offset);
5937            // Delegate to tuple encoding.
5938            fidl::encoding::Encode::<NodeQueryFilesystemResponse, D>::encode(
5939                (
5940                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
5941                    <fidl::encoding::Boxed<FilesystemInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
5942                ),
5943                encoder, offset, _depth
5944            )
5945        }
5946    }
5947    unsafe impl<
5948        D: fidl::encoding::ResourceDialect,
5949        T0: fidl::encoding::Encode<i32, D>,
5950        T1: fidl::encoding::Encode<fidl::encoding::Boxed<FilesystemInfo>, D>,
5951    > fidl::encoding::Encode<NodeQueryFilesystemResponse, D> for (T0, T1)
5952    {
5953        #[inline]
5954        unsafe fn encode(
5955            self,
5956            encoder: &mut fidl::encoding::Encoder<'_, D>,
5957            offset: usize,
5958            depth: fidl::encoding::Depth,
5959        ) -> fidl::Result<()> {
5960            encoder.debug_check_bounds::<NodeQueryFilesystemResponse>(offset);
5961            // Zero out padding regions. There's no need to apply masks
5962            // because the unmasked parts will be overwritten by fields.
5963            unsafe {
5964                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5965                (ptr as *mut u64).write_unaligned(0);
5966            }
5967            // Write the fields.
5968            self.0.encode(encoder, offset + 0, depth)?;
5969            self.1.encode(encoder, offset + 8, depth)?;
5970            Ok(())
5971        }
5972    }
5973
5974    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5975        for NodeQueryFilesystemResponse
5976    {
5977        #[inline(always)]
5978        fn new_empty() -> Self {
5979            Self {
5980                s: fidl::new_empty!(i32, D),
5981                info: fidl::new_empty!(fidl::encoding::Boxed<FilesystemInfo>, D),
5982            }
5983        }
5984
5985        #[inline]
5986        unsafe fn decode(
5987            &mut self,
5988            decoder: &mut fidl::encoding::Decoder<'_, D>,
5989            offset: usize,
5990            _depth: fidl::encoding::Depth,
5991        ) -> fidl::Result<()> {
5992            decoder.debug_check_bounds::<Self>(offset);
5993            // Verify that padding bytes are zero.
5994            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5995            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5996            let mask = 0xffffffff00000000u64;
5997            let maskedval = padval & mask;
5998            if maskedval != 0 {
5999                return Err(fidl::Error::NonZeroPadding {
6000                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6001                });
6002            }
6003            fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
6004            fidl::decode!(
6005                fidl::encoding::Boxed<FilesystemInfo>,
6006                D,
6007                &mut self.info,
6008                decoder,
6009                offset + 8,
6010                _depth
6011            )?;
6012            Ok(())
6013        }
6014    }
6015
6016    impl fidl::encoding::ValueTypeMarker for NodeRemoveExtendedAttributeRequest {
6017        type Borrowed<'a> = &'a Self;
6018        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6019            value
6020        }
6021    }
6022
6023    unsafe impl fidl::encoding::TypeMarker for NodeRemoveExtendedAttributeRequest {
6024        type Owned = Self;
6025
6026        #[inline(always)]
6027        fn inline_align(_context: fidl::encoding::Context) -> usize {
6028            8
6029        }
6030
6031        #[inline(always)]
6032        fn inline_size(_context: fidl::encoding::Context) -> usize {
6033            16
6034        }
6035    }
6036
6037    unsafe impl<D: fidl::encoding::ResourceDialect>
6038        fidl::encoding::Encode<NodeRemoveExtendedAttributeRequest, D>
6039        for &NodeRemoveExtendedAttributeRequest
6040    {
6041        #[inline]
6042        unsafe fn encode(
6043            self,
6044            encoder: &mut fidl::encoding::Encoder<'_, D>,
6045            offset: usize,
6046            _depth: fidl::encoding::Depth,
6047        ) -> fidl::Result<()> {
6048            encoder.debug_check_bounds::<NodeRemoveExtendedAttributeRequest>(offset);
6049            // Delegate to tuple encoding.
6050            fidl::encoding::Encode::<NodeRemoveExtendedAttributeRequest, D>::encode(
6051                (<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
6052                    &self.name,
6053                ),),
6054                encoder,
6055                offset,
6056                _depth,
6057            )
6058        }
6059    }
6060    unsafe impl<
6061        D: fidl::encoding::ResourceDialect,
6062        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>, D>,
6063    > fidl::encoding::Encode<NodeRemoveExtendedAttributeRequest, D> for (T0,)
6064    {
6065        #[inline]
6066        unsafe fn encode(
6067            self,
6068            encoder: &mut fidl::encoding::Encoder<'_, D>,
6069            offset: usize,
6070            depth: fidl::encoding::Depth,
6071        ) -> fidl::Result<()> {
6072            encoder.debug_check_bounds::<NodeRemoveExtendedAttributeRequest>(offset);
6073            // Zero out padding regions. There's no need to apply masks
6074            // because the unmasked parts will be overwritten by fields.
6075            // Write the fields.
6076            self.0.encode(encoder, offset + 0, depth)?;
6077            Ok(())
6078        }
6079    }
6080
6081    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6082        for NodeRemoveExtendedAttributeRequest
6083    {
6084        #[inline(always)]
6085        fn new_empty() -> Self {
6086            Self { name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D) }
6087        }
6088
6089        #[inline]
6090        unsafe fn decode(
6091            &mut self,
6092            decoder: &mut fidl::encoding::Decoder<'_, D>,
6093            offset: usize,
6094            _depth: fidl::encoding::Depth,
6095        ) -> fidl::Result<()> {
6096            decoder.debug_check_bounds::<Self>(offset);
6097            // Verify that padding bytes are zero.
6098            fidl::decode!(fidl::encoding::Vector<u8, 255>, D, &mut self.name, decoder, offset + 0, _depth)?;
6099            Ok(())
6100        }
6101    }
6102
6103    impl fidl::encoding::ValueTypeMarker for NodeSetFlagsRequest {
6104        type Borrowed<'a> = &'a Self;
6105        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6106            value
6107        }
6108    }
6109
6110    unsafe impl fidl::encoding::TypeMarker for NodeSetFlagsRequest {
6111        type Owned = Self;
6112
6113        #[inline(always)]
6114        fn inline_align(_context: fidl::encoding::Context) -> usize {
6115            8
6116        }
6117
6118        #[inline(always)]
6119        fn inline_size(_context: fidl::encoding::Context) -> usize {
6120            8
6121        }
6122    }
6123
6124    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetFlagsRequest, D>
6125        for &NodeSetFlagsRequest
6126    {
6127        #[inline]
6128        unsafe fn encode(
6129            self,
6130            encoder: &mut fidl::encoding::Encoder<'_, D>,
6131            offset: usize,
6132            _depth: fidl::encoding::Depth,
6133        ) -> fidl::Result<()> {
6134            encoder.debug_check_bounds::<NodeSetFlagsRequest>(offset);
6135            // Delegate to tuple encoding.
6136            fidl::encoding::Encode::<NodeSetFlagsRequest, D>::encode(
6137                (<Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
6138                encoder,
6139                offset,
6140                _depth,
6141            )
6142        }
6143    }
6144    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Flags, D>>
6145        fidl::encoding::Encode<NodeSetFlagsRequest, D> for (T0,)
6146    {
6147        #[inline]
6148        unsafe fn encode(
6149            self,
6150            encoder: &mut fidl::encoding::Encoder<'_, D>,
6151            offset: usize,
6152            depth: fidl::encoding::Depth,
6153        ) -> fidl::Result<()> {
6154            encoder.debug_check_bounds::<NodeSetFlagsRequest>(offset);
6155            // Zero out padding regions. There's no need to apply masks
6156            // because the unmasked parts will be overwritten by fields.
6157            // Write the fields.
6158            self.0.encode(encoder, offset + 0, depth)?;
6159            Ok(())
6160        }
6161    }
6162
6163    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetFlagsRequest {
6164        #[inline(always)]
6165        fn new_empty() -> Self {
6166            Self { flags: fidl::new_empty!(Flags, D) }
6167        }
6168
6169        #[inline]
6170        unsafe fn decode(
6171            &mut self,
6172            decoder: &mut fidl::encoding::Decoder<'_, D>,
6173            offset: usize,
6174            _depth: fidl::encoding::Depth,
6175        ) -> fidl::Result<()> {
6176            decoder.debug_check_bounds::<Self>(offset);
6177            // Verify that padding bytes are zero.
6178            fidl::decode!(Flags, D, &mut self.flags, decoder, offset + 0, _depth)?;
6179            Ok(())
6180        }
6181    }
6182
6183    impl fidl::encoding::ValueTypeMarker for NodeGetFlagsResponse {
6184        type Borrowed<'a> = &'a Self;
6185        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6186            value
6187        }
6188    }
6189
6190    unsafe impl fidl::encoding::TypeMarker for NodeGetFlagsResponse {
6191        type Owned = Self;
6192
6193        #[inline(always)]
6194        fn inline_align(_context: fidl::encoding::Context) -> usize {
6195            8
6196        }
6197
6198        #[inline(always)]
6199        fn inline_size(_context: fidl::encoding::Context) -> usize {
6200            8
6201        }
6202    }
6203
6204    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeGetFlagsResponse, D>
6205        for &NodeGetFlagsResponse
6206    {
6207        #[inline]
6208        unsafe fn encode(
6209            self,
6210            encoder: &mut fidl::encoding::Encoder<'_, D>,
6211            offset: usize,
6212            _depth: fidl::encoding::Depth,
6213        ) -> fidl::Result<()> {
6214            encoder.debug_check_bounds::<NodeGetFlagsResponse>(offset);
6215            // Delegate to tuple encoding.
6216            fidl::encoding::Encode::<NodeGetFlagsResponse, D>::encode(
6217                (<Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
6218                encoder,
6219                offset,
6220                _depth,
6221            )
6222        }
6223    }
6224    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Flags, D>>
6225        fidl::encoding::Encode<NodeGetFlagsResponse, D> for (T0,)
6226    {
6227        #[inline]
6228        unsafe fn encode(
6229            self,
6230            encoder: &mut fidl::encoding::Encoder<'_, D>,
6231            offset: usize,
6232            depth: fidl::encoding::Depth,
6233        ) -> fidl::Result<()> {
6234            encoder.debug_check_bounds::<NodeGetFlagsResponse>(offset);
6235            // Zero out padding regions. There's no need to apply masks
6236            // because the unmasked parts will be overwritten by fields.
6237            // Write the fields.
6238            self.0.encode(encoder, offset + 0, depth)?;
6239            Ok(())
6240        }
6241    }
6242
6243    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeGetFlagsResponse {
6244        #[inline(always)]
6245        fn new_empty() -> Self {
6246            Self { flags: fidl::new_empty!(Flags, D) }
6247        }
6248
6249        #[inline]
6250        unsafe fn decode(
6251            &mut self,
6252            decoder: &mut fidl::encoding::Decoder<'_, D>,
6253            offset: usize,
6254            _depth: fidl::encoding::Depth,
6255        ) -> fidl::Result<()> {
6256            decoder.debug_check_bounds::<Self>(offset);
6257            // Verify that padding bytes are zero.
6258            fidl::decode!(Flags, D, &mut self.flags, decoder, offset + 0, _depth)?;
6259            Ok(())
6260        }
6261    }
6262
6263    impl fidl::encoding::ValueTypeMarker for ReadableReadRequest {
6264        type Borrowed<'a> = &'a Self;
6265        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6266            value
6267        }
6268    }
6269
6270    unsafe impl fidl::encoding::TypeMarker for ReadableReadRequest {
6271        type Owned = Self;
6272
6273        #[inline(always)]
6274        fn inline_align(_context: fidl::encoding::Context) -> usize {
6275            8
6276        }
6277
6278        #[inline(always)]
6279        fn inline_size(_context: fidl::encoding::Context) -> usize {
6280            8
6281        }
6282        #[inline(always)]
6283        fn encode_is_copy() -> bool {
6284            true
6285        }
6286
6287        #[inline(always)]
6288        fn decode_is_copy() -> bool {
6289            true
6290        }
6291    }
6292
6293    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadableReadRequest, D>
6294        for &ReadableReadRequest
6295    {
6296        #[inline]
6297        unsafe fn encode(
6298            self,
6299            encoder: &mut fidl::encoding::Encoder<'_, D>,
6300            offset: usize,
6301            _depth: fidl::encoding::Depth,
6302        ) -> fidl::Result<()> {
6303            encoder.debug_check_bounds::<ReadableReadRequest>(offset);
6304            unsafe {
6305                // Copy the object into the buffer.
6306                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6307                (buf_ptr as *mut ReadableReadRequest)
6308                    .write_unaligned((self as *const ReadableReadRequest).read());
6309                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6310                // done second because the memcpy will write garbage to these bytes.
6311            }
6312            Ok(())
6313        }
6314    }
6315    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6316        fidl::encoding::Encode<ReadableReadRequest, D> for (T0,)
6317    {
6318        #[inline]
6319        unsafe fn encode(
6320            self,
6321            encoder: &mut fidl::encoding::Encoder<'_, D>,
6322            offset: usize,
6323            depth: fidl::encoding::Depth,
6324        ) -> fidl::Result<()> {
6325            encoder.debug_check_bounds::<ReadableReadRequest>(offset);
6326            // Zero out padding regions. There's no need to apply masks
6327            // because the unmasked parts will be overwritten by fields.
6328            // Write the fields.
6329            self.0.encode(encoder, offset + 0, depth)?;
6330            Ok(())
6331        }
6332    }
6333
6334    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadableReadRequest {
6335        #[inline(always)]
6336        fn new_empty() -> Self {
6337            Self { count: fidl::new_empty!(u64, D) }
6338        }
6339
6340        #[inline]
6341        unsafe fn decode(
6342            &mut self,
6343            decoder: &mut fidl::encoding::Decoder<'_, D>,
6344            offset: usize,
6345            _depth: fidl::encoding::Depth,
6346        ) -> fidl::Result<()> {
6347            decoder.debug_check_bounds::<Self>(offset);
6348            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6349            // Verify that padding bytes are zero.
6350            // Copy from the buffer into the object.
6351            unsafe {
6352                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6353            }
6354            Ok(())
6355        }
6356    }
6357
6358    impl fidl::encoding::ValueTypeMarker for ReadableReadResponse {
6359        type Borrowed<'a> = &'a Self;
6360        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6361            value
6362        }
6363    }
6364
6365    unsafe impl fidl::encoding::TypeMarker for ReadableReadResponse {
6366        type Owned = Self;
6367
6368        #[inline(always)]
6369        fn inline_align(_context: fidl::encoding::Context) -> usize {
6370            8
6371        }
6372
6373        #[inline(always)]
6374        fn inline_size(_context: fidl::encoding::Context) -> usize {
6375            16
6376        }
6377    }
6378
6379    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadableReadResponse, D>
6380        for &ReadableReadResponse
6381    {
6382        #[inline]
6383        unsafe fn encode(
6384            self,
6385            encoder: &mut fidl::encoding::Encoder<'_, D>,
6386            offset: usize,
6387            _depth: fidl::encoding::Depth,
6388        ) -> fidl::Result<()> {
6389            encoder.debug_check_bounds::<ReadableReadResponse>(offset);
6390            // Delegate to tuple encoding.
6391            fidl::encoding::Encode::<ReadableReadResponse, D>::encode(
6392                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
6393                    &self.data,
6394                ),),
6395                encoder,
6396                offset,
6397                _depth,
6398            )
6399        }
6400    }
6401    unsafe impl<
6402        D: fidl::encoding::ResourceDialect,
6403        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
6404    > fidl::encoding::Encode<ReadableReadResponse, D> for (T0,)
6405    {
6406        #[inline]
6407        unsafe fn encode(
6408            self,
6409            encoder: &mut fidl::encoding::Encoder<'_, D>,
6410            offset: usize,
6411            depth: fidl::encoding::Depth,
6412        ) -> fidl::Result<()> {
6413            encoder.debug_check_bounds::<ReadableReadResponse>(offset);
6414            // Zero out padding regions. There's no need to apply masks
6415            // because the unmasked parts will be overwritten by fields.
6416            // Write the fields.
6417            self.0.encode(encoder, offset + 0, depth)?;
6418            Ok(())
6419        }
6420    }
6421
6422    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadableReadResponse {
6423        #[inline(always)]
6424        fn new_empty() -> Self {
6425            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
6426        }
6427
6428        #[inline]
6429        unsafe fn decode(
6430            &mut self,
6431            decoder: &mut fidl::encoding::Decoder<'_, D>,
6432            offset: usize,
6433            _depth: fidl::encoding::Depth,
6434        ) -> fidl::Result<()> {
6435            decoder.debug_check_bounds::<Self>(offset);
6436            // Verify that padding bytes are zero.
6437            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
6438            Ok(())
6439        }
6440    }
6441
6442    impl fidl::encoding::ValueTypeMarker for Service {
6443        type Borrowed<'a> = &'a Self;
6444        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6445            value
6446        }
6447    }
6448
6449    unsafe impl fidl::encoding::TypeMarker for Service {
6450        type Owned = Self;
6451
6452        #[inline(always)]
6453        fn inline_align(_context: fidl::encoding::Context) -> usize {
6454            1
6455        }
6456
6457        #[inline(always)]
6458        fn inline_size(_context: fidl::encoding::Context) -> usize {
6459            1
6460        }
6461    }
6462
6463    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Service, D> for &Service {
6464        #[inline]
6465        unsafe fn encode(
6466            self,
6467            encoder: &mut fidl::encoding::Encoder<'_, D>,
6468            offset: usize,
6469            _depth: fidl::encoding::Depth,
6470        ) -> fidl::Result<()> {
6471            encoder.debug_check_bounds::<Service>(offset);
6472            encoder.write_num(0u8, offset);
6473            Ok(())
6474        }
6475    }
6476
6477    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Service {
6478        #[inline(always)]
6479        fn new_empty() -> Self {
6480            Self
6481        }
6482
6483        #[inline]
6484        unsafe fn decode(
6485            &mut self,
6486            decoder: &mut fidl::encoding::Decoder<'_, D>,
6487            offset: usize,
6488            _depth: fidl::encoding::Depth,
6489        ) -> fidl::Result<()> {
6490            decoder.debug_check_bounds::<Self>(offset);
6491            match decoder.read_num::<u8>(offset) {
6492                0 => Ok(()),
6493                _ => Err(fidl::Error::Invalid),
6494            }
6495        }
6496    }
6497
6498    impl fidl::encoding::ValueTypeMarker for SymlinkObject {
6499        type Borrowed<'a> = &'a Self;
6500        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6501            value
6502        }
6503    }
6504
6505    unsafe impl fidl::encoding::TypeMarker for SymlinkObject {
6506        type Owned = Self;
6507
6508        #[inline(always)]
6509        fn inline_align(_context: fidl::encoding::Context) -> usize {
6510            8
6511        }
6512
6513        #[inline(always)]
6514        fn inline_size(_context: fidl::encoding::Context) -> usize {
6515            16
6516        }
6517    }
6518
6519    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SymlinkObject, D>
6520        for &SymlinkObject
6521    {
6522        #[inline]
6523        unsafe fn encode(
6524            self,
6525            encoder: &mut fidl::encoding::Encoder<'_, D>,
6526            offset: usize,
6527            _depth: fidl::encoding::Depth,
6528        ) -> fidl::Result<()> {
6529            encoder.debug_check_bounds::<SymlinkObject>(offset);
6530            // Delegate to tuple encoding.
6531            fidl::encoding::Encode::<SymlinkObject, D>::encode(
6532                (<fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
6533                    &self.target,
6534                ),),
6535                encoder,
6536                offset,
6537                _depth,
6538            )
6539        }
6540    }
6541    unsafe impl<
6542        D: fidl::encoding::ResourceDialect,
6543        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 4095>, D>,
6544    > fidl::encoding::Encode<SymlinkObject, D> for (T0,)
6545    {
6546        #[inline]
6547        unsafe fn encode(
6548            self,
6549            encoder: &mut fidl::encoding::Encoder<'_, D>,
6550            offset: usize,
6551            depth: fidl::encoding::Depth,
6552        ) -> fidl::Result<()> {
6553            encoder.debug_check_bounds::<SymlinkObject>(offset);
6554            // Zero out padding regions. There's no need to apply masks
6555            // because the unmasked parts will be overwritten by fields.
6556            // Write the fields.
6557            self.0.encode(encoder, offset + 0, depth)?;
6558            Ok(())
6559        }
6560    }
6561
6562    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkObject {
6563        #[inline(always)]
6564        fn new_empty() -> Self {
6565            Self { target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, D) }
6566        }
6567
6568        #[inline]
6569        unsafe fn decode(
6570            &mut self,
6571            decoder: &mut fidl::encoding::Decoder<'_, D>,
6572            offset: usize,
6573            _depth: fidl::encoding::Depth,
6574        ) -> fidl::Result<()> {
6575            decoder.debug_check_bounds::<Self>(offset);
6576            // Verify that padding bytes are zero.
6577            fidl::decode!(fidl::encoding::Vector<u8, 4095>, D, &mut self.target, decoder, offset + 0, _depth)?;
6578            Ok(())
6579        }
6580    }
6581
6582    impl fidl::encoding::ValueTypeMarker for WritableWriteRequest {
6583        type Borrowed<'a> = &'a Self;
6584        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6585            value
6586        }
6587    }
6588
6589    unsafe impl fidl::encoding::TypeMarker for WritableWriteRequest {
6590        type Owned = Self;
6591
6592        #[inline(always)]
6593        fn inline_align(_context: fidl::encoding::Context) -> usize {
6594            8
6595        }
6596
6597        #[inline(always)]
6598        fn inline_size(_context: fidl::encoding::Context) -> usize {
6599            16
6600        }
6601    }
6602
6603    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritableWriteRequest, D>
6604        for &WritableWriteRequest
6605    {
6606        #[inline]
6607        unsafe fn encode(
6608            self,
6609            encoder: &mut fidl::encoding::Encoder<'_, D>,
6610            offset: usize,
6611            _depth: fidl::encoding::Depth,
6612        ) -> fidl::Result<()> {
6613            encoder.debug_check_bounds::<WritableWriteRequest>(offset);
6614            // Delegate to tuple encoding.
6615            fidl::encoding::Encode::<WritableWriteRequest, D>::encode(
6616                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
6617                    &self.data,
6618                ),),
6619                encoder,
6620                offset,
6621                _depth,
6622            )
6623        }
6624    }
6625    unsafe impl<
6626        D: fidl::encoding::ResourceDialect,
6627        T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
6628    > fidl::encoding::Encode<WritableWriteRequest, D> for (T0,)
6629    {
6630        #[inline]
6631        unsafe fn encode(
6632            self,
6633            encoder: &mut fidl::encoding::Encoder<'_, D>,
6634            offset: usize,
6635            depth: fidl::encoding::Depth,
6636        ) -> fidl::Result<()> {
6637            encoder.debug_check_bounds::<WritableWriteRequest>(offset);
6638            // Zero out padding regions. There's no need to apply masks
6639            // because the unmasked parts will be overwritten by fields.
6640            // Write the fields.
6641            self.0.encode(encoder, offset + 0, depth)?;
6642            Ok(())
6643        }
6644    }
6645
6646    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritableWriteRequest {
6647        #[inline(always)]
6648        fn new_empty() -> Self {
6649            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
6650        }
6651
6652        #[inline]
6653        unsafe fn decode(
6654            &mut self,
6655            decoder: &mut fidl::encoding::Decoder<'_, D>,
6656            offset: usize,
6657            _depth: fidl::encoding::Depth,
6658        ) -> fidl::Result<()> {
6659            decoder.debug_check_bounds::<Self>(offset);
6660            // Verify that padding bytes are zero.
6661            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
6662            Ok(())
6663        }
6664    }
6665
6666    impl fidl::encoding::ValueTypeMarker for WritableWriteResponse {
6667        type Borrowed<'a> = &'a Self;
6668        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6669            value
6670        }
6671    }
6672
6673    unsafe impl fidl::encoding::TypeMarker for WritableWriteResponse {
6674        type Owned = Self;
6675
6676        #[inline(always)]
6677        fn inline_align(_context: fidl::encoding::Context) -> usize {
6678            8
6679        }
6680
6681        #[inline(always)]
6682        fn inline_size(_context: fidl::encoding::Context) -> usize {
6683            8
6684        }
6685        #[inline(always)]
6686        fn encode_is_copy() -> bool {
6687            true
6688        }
6689
6690        #[inline(always)]
6691        fn decode_is_copy() -> bool {
6692            true
6693        }
6694    }
6695
6696    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritableWriteResponse, D>
6697        for &WritableWriteResponse
6698    {
6699        #[inline]
6700        unsafe fn encode(
6701            self,
6702            encoder: &mut fidl::encoding::Encoder<'_, D>,
6703            offset: usize,
6704            _depth: fidl::encoding::Depth,
6705        ) -> fidl::Result<()> {
6706            encoder.debug_check_bounds::<WritableWriteResponse>(offset);
6707            unsafe {
6708                // Copy the object into the buffer.
6709                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6710                (buf_ptr as *mut WritableWriteResponse)
6711                    .write_unaligned((self as *const WritableWriteResponse).read());
6712                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6713                // done second because the memcpy will write garbage to these bytes.
6714            }
6715            Ok(())
6716        }
6717    }
6718    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6719        fidl::encoding::Encode<WritableWriteResponse, D> for (T0,)
6720    {
6721        #[inline]
6722        unsafe fn encode(
6723            self,
6724            encoder: &mut fidl::encoding::Encoder<'_, D>,
6725            offset: usize,
6726            depth: fidl::encoding::Depth,
6727        ) -> fidl::Result<()> {
6728            encoder.debug_check_bounds::<WritableWriteResponse>(offset);
6729            // Zero out padding regions. There's no need to apply masks
6730            // because the unmasked parts will be overwritten by fields.
6731            // Write the fields.
6732            self.0.encode(encoder, offset + 0, depth)?;
6733            Ok(())
6734        }
6735    }
6736
6737    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritableWriteResponse {
6738        #[inline(always)]
6739        fn new_empty() -> Self {
6740            Self { actual_count: fidl::new_empty!(u64, D) }
6741        }
6742
6743        #[inline]
6744        unsafe fn decode(
6745            &mut self,
6746            decoder: &mut fidl::encoding::Decoder<'_, D>,
6747            offset: usize,
6748            _depth: fidl::encoding::Depth,
6749        ) -> fidl::Result<()> {
6750            decoder.debug_check_bounds::<Self>(offset);
6751            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6752            // Verify that padding bytes are zero.
6753            // Copy from the buffer into the object.
6754            unsafe {
6755                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6756            }
6757            Ok(())
6758        }
6759    }
6760
6761    impl AdvisoryLockRequest {
6762        #[inline(always)]
6763        fn max_ordinal_present(&self) -> u64 {
6764            if let Some(_) = self.wait {
6765                return 3;
6766            }
6767            if let Some(_) = self.range {
6768                return 2;
6769            }
6770            if let Some(_) = self.type_ {
6771                return 1;
6772            }
6773            0
6774        }
6775    }
6776
6777    impl fidl::encoding::ValueTypeMarker for AdvisoryLockRequest {
6778        type Borrowed<'a> = &'a Self;
6779        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6780            value
6781        }
6782    }
6783
6784    unsafe impl fidl::encoding::TypeMarker for AdvisoryLockRequest {
6785        type Owned = Self;
6786
6787        #[inline(always)]
6788        fn inline_align(_context: fidl::encoding::Context) -> usize {
6789            8
6790        }
6791
6792        #[inline(always)]
6793        fn inline_size(_context: fidl::encoding::Context) -> usize {
6794            16
6795        }
6796    }
6797
6798    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdvisoryLockRequest, D>
6799        for &AdvisoryLockRequest
6800    {
6801        unsafe fn encode(
6802            self,
6803            encoder: &mut fidl::encoding::Encoder<'_, D>,
6804            offset: usize,
6805            mut depth: fidl::encoding::Depth,
6806        ) -> fidl::Result<()> {
6807            encoder.debug_check_bounds::<AdvisoryLockRequest>(offset);
6808            // Vector header
6809            let max_ordinal: u64 = self.max_ordinal_present();
6810            encoder.write_num(max_ordinal, offset);
6811            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6812            // Calling encoder.out_of_line_offset(0) is not allowed.
6813            if max_ordinal == 0 {
6814                return Ok(());
6815            }
6816            depth.increment()?;
6817            let envelope_size = 8;
6818            let bytes_len = max_ordinal as usize * envelope_size;
6819            #[allow(unused_variables)]
6820            let offset = encoder.out_of_line_offset(bytes_len);
6821            let mut _prev_end_offset: usize = 0;
6822            if 1 > max_ordinal {
6823                return Ok(());
6824            }
6825
6826            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6827            // are envelope_size bytes.
6828            let cur_offset: usize = (1 - 1) * envelope_size;
6829
6830            // Zero reserved fields.
6831            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6832
6833            // Safety:
6834            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6835            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6836            //   envelope_size bytes, there is always sufficient room.
6837            fidl::encoding::encode_in_envelope_optional::<AdvisoryLockType, D>(
6838                self.type_
6839                    .as_ref()
6840                    .map(<AdvisoryLockType as fidl::encoding::ValueTypeMarker>::borrow),
6841                encoder,
6842                offset + cur_offset,
6843                depth,
6844            )?;
6845
6846            _prev_end_offset = cur_offset + envelope_size;
6847            if 2 > max_ordinal {
6848                return Ok(());
6849            }
6850
6851            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6852            // are envelope_size bytes.
6853            let cur_offset: usize = (2 - 1) * envelope_size;
6854
6855            // Zero reserved fields.
6856            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6857
6858            // Safety:
6859            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6860            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6861            //   envelope_size bytes, there is always sufficient room.
6862            fidl::encoding::encode_in_envelope_optional::<AdvisoryLockRange, D>(
6863                self.range
6864                    .as_ref()
6865                    .map(<AdvisoryLockRange as fidl::encoding::ValueTypeMarker>::borrow),
6866                encoder,
6867                offset + cur_offset,
6868                depth,
6869            )?;
6870
6871            _prev_end_offset = cur_offset + envelope_size;
6872            if 3 > max_ordinal {
6873                return Ok(());
6874            }
6875
6876            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6877            // are envelope_size bytes.
6878            let cur_offset: usize = (3 - 1) * envelope_size;
6879
6880            // Zero reserved fields.
6881            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6882
6883            // Safety:
6884            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6885            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6886            //   envelope_size bytes, there is always sufficient room.
6887            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6888                self.wait.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6889                encoder,
6890                offset + cur_offset,
6891                depth,
6892            )?;
6893
6894            _prev_end_offset = cur_offset + envelope_size;
6895
6896            Ok(())
6897        }
6898    }
6899
6900    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockRequest {
6901        #[inline(always)]
6902        fn new_empty() -> Self {
6903            Self::default()
6904        }
6905
6906        unsafe fn decode(
6907            &mut self,
6908            decoder: &mut fidl::encoding::Decoder<'_, D>,
6909            offset: usize,
6910            mut depth: fidl::encoding::Depth,
6911        ) -> fidl::Result<()> {
6912            decoder.debug_check_bounds::<Self>(offset);
6913            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6914                None => return Err(fidl::Error::NotNullable),
6915                Some(len) => len,
6916            };
6917            // Calling decoder.out_of_line_offset(0) is not allowed.
6918            if len == 0 {
6919                return Ok(());
6920            };
6921            depth.increment()?;
6922            let envelope_size = 8;
6923            let bytes_len = len * envelope_size;
6924            let offset = decoder.out_of_line_offset(bytes_len)?;
6925            // Decode the envelope for each type.
6926            let mut _next_ordinal_to_read = 0;
6927            let mut next_offset = offset;
6928            let end_offset = offset + bytes_len;
6929            _next_ordinal_to_read += 1;
6930            if next_offset >= end_offset {
6931                return Ok(());
6932            }
6933
6934            // Decode unknown envelopes for gaps in ordinals.
6935            while _next_ordinal_to_read < 1 {
6936                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6937                _next_ordinal_to_read += 1;
6938                next_offset += envelope_size;
6939            }
6940
6941            let next_out_of_line = decoder.next_out_of_line();
6942            let handles_before = decoder.remaining_handles();
6943            if let Some((inlined, num_bytes, num_handles)) =
6944                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6945            {
6946                let member_inline_size =
6947                    <AdvisoryLockType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6948                if inlined != (member_inline_size <= 4) {
6949                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6950                }
6951                let inner_offset;
6952                let mut inner_depth = depth.clone();
6953                if inlined {
6954                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6955                    inner_offset = next_offset;
6956                } else {
6957                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6958                    inner_depth.increment()?;
6959                }
6960                let val_ref =
6961                    self.type_.get_or_insert_with(|| fidl::new_empty!(AdvisoryLockType, D));
6962                fidl::decode!(AdvisoryLockType, D, val_ref, decoder, inner_offset, inner_depth)?;
6963                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6964                {
6965                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6966                }
6967                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6968                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6969                }
6970            }
6971
6972            next_offset += envelope_size;
6973            _next_ordinal_to_read += 1;
6974            if next_offset >= end_offset {
6975                return Ok(());
6976            }
6977
6978            // Decode unknown envelopes for gaps in ordinals.
6979            while _next_ordinal_to_read < 2 {
6980                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6981                _next_ordinal_to_read += 1;
6982                next_offset += envelope_size;
6983            }
6984
6985            let next_out_of_line = decoder.next_out_of_line();
6986            let handles_before = decoder.remaining_handles();
6987            if let Some((inlined, num_bytes, num_handles)) =
6988                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6989            {
6990                let member_inline_size =
6991                    <AdvisoryLockRange as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6992                if inlined != (member_inline_size <= 4) {
6993                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6994                }
6995                let inner_offset;
6996                let mut inner_depth = depth.clone();
6997                if inlined {
6998                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6999                    inner_offset = next_offset;
7000                } else {
7001                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7002                    inner_depth.increment()?;
7003                }
7004                let val_ref =
7005                    self.range.get_or_insert_with(|| fidl::new_empty!(AdvisoryLockRange, D));
7006                fidl::decode!(AdvisoryLockRange, D, val_ref, decoder, inner_offset, inner_depth)?;
7007                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7008                {
7009                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7010                }
7011                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7012                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7013                }
7014            }
7015
7016            next_offset += envelope_size;
7017            _next_ordinal_to_read += 1;
7018            if next_offset >= end_offset {
7019                return Ok(());
7020            }
7021
7022            // Decode unknown envelopes for gaps in ordinals.
7023            while _next_ordinal_to_read < 3 {
7024                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7025                _next_ordinal_to_read += 1;
7026                next_offset += envelope_size;
7027            }
7028
7029            let next_out_of_line = decoder.next_out_of_line();
7030            let handles_before = decoder.remaining_handles();
7031            if let Some((inlined, num_bytes, num_handles)) =
7032                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7033            {
7034                let member_inline_size =
7035                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7036                if inlined != (member_inline_size <= 4) {
7037                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7038                }
7039                let inner_offset;
7040                let mut inner_depth = depth.clone();
7041                if inlined {
7042                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7043                    inner_offset = next_offset;
7044                } else {
7045                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7046                    inner_depth.increment()?;
7047                }
7048                let val_ref = self.wait.get_or_insert_with(|| fidl::new_empty!(bool, D));
7049                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7050                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7051                {
7052                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7053                }
7054                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7055                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7056                }
7057            }
7058
7059            next_offset += envelope_size;
7060
7061            // Decode the remaining unknown envelopes.
7062            while next_offset < end_offset {
7063                _next_ordinal_to_read += 1;
7064                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7065                next_offset += envelope_size;
7066            }
7067
7068            Ok(())
7069        }
7070    }
7071
7072    impl DirectoryInfo {
7073        #[inline(always)]
7074        fn max_ordinal_present(&self) -> u64 {
7075            if let Some(_) = self.attributes {
7076                return 1;
7077            }
7078            0
7079        }
7080    }
7081
7082    impl fidl::encoding::ValueTypeMarker for DirectoryInfo {
7083        type Borrowed<'a> = &'a Self;
7084        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7085            value
7086        }
7087    }
7088
7089    unsafe impl fidl::encoding::TypeMarker for DirectoryInfo {
7090        type Owned = Self;
7091
7092        #[inline(always)]
7093        fn inline_align(_context: fidl::encoding::Context) -> usize {
7094            8
7095        }
7096
7097        #[inline(always)]
7098        fn inline_size(_context: fidl::encoding::Context) -> usize {
7099            16
7100        }
7101    }
7102
7103    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryInfo, D>
7104        for &DirectoryInfo
7105    {
7106        unsafe fn encode(
7107            self,
7108            encoder: &mut fidl::encoding::Encoder<'_, D>,
7109            offset: usize,
7110            mut depth: fidl::encoding::Depth,
7111        ) -> fidl::Result<()> {
7112            encoder.debug_check_bounds::<DirectoryInfo>(offset);
7113            // Vector header
7114            let max_ordinal: u64 = self.max_ordinal_present();
7115            encoder.write_num(max_ordinal, offset);
7116            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7117            // Calling encoder.out_of_line_offset(0) is not allowed.
7118            if max_ordinal == 0 {
7119                return Ok(());
7120            }
7121            depth.increment()?;
7122            let envelope_size = 8;
7123            let bytes_len = max_ordinal as usize * envelope_size;
7124            #[allow(unused_variables)]
7125            let offset = encoder.out_of_line_offset(bytes_len);
7126            let mut _prev_end_offset: usize = 0;
7127            if 1 > max_ordinal {
7128                return Ok(());
7129            }
7130
7131            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7132            // are envelope_size bytes.
7133            let cur_offset: usize = (1 - 1) * envelope_size;
7134
7135            // Zero reserved fields.
7136            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7137
7138            // Safety:
7139            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7140            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7141            //   envelope_size bytes, there is always sufficient room.
7142            fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
7143                self.attributes
7144                    .as_ref()
7145                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
7146                encoder,
7147                offset + cur_offset,
7148                depth,
7149            )?;
7150
7151            _prev_end_offset = cur_offset + envelope_size;
7152
7153            Ok(())
7154        }
7155    }
7156
7157    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryInfo {
7158        #[inline(always)]
7159        fn new_empty() -> Self {
7160            Self::default()
7161        }
7162
7163        unsafe fn decode(
7164            &mut self,
7165            decoder: &mut fidl::encoding::Decoder<'_, D>,
7166            offset: usize,
7167            mut depth: fidl::encoding::Depth,
7168        ) -> fidl::Result<()> {
7169            decoder.debug_check_bounds::<Self>(offset);
7170            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7171                None => return Err(fidl::Error::NotNullable),
7172                Some(len) => len,
7173            };
7174            // Calling decoder.out_of_line_offset(0) is not allowed.
7175            if len == 0 {
7176                return Ok(());
7177            };
7178            depth.increment()?;
7179            let envelope_size = 8;
7180            let bytes_len = len * envelope_size;
7181            let offset = decoder.out_of_line_offset(bytes_len)?;
7182            // Decode the envelope for each type.
7183            let mut _next_ordinal_to_read = 0;
7184            let mut next_offset = offset;
7185            let end_offset = offset + bytes_len;
7186            _next_ordinal_to_read += 1;
7187            if next_offset >= end_offset {
7188                return Ok(());
7189            }
7190
7191            // Decode unknown envelopes for gaps in ordinals.
7192            while _next_ordinal_to_read < 1 {
7193                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7194                _next_ordinal_to_read += 1;
7195                next_offset += envelope_size;
7196            }
7197
7198            let next_out_of_line = decoder.next_out_of_line();
7199            let handles_before = decoder.remaining_handles();
7200            if let Some((inlined, num_bytes, num_handles)) =
7201                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7202            {
7203                let member_inline_size =
7204                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7205                if inlined != (member_inline_size <= 4) {
7206                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7207                }
7208                let inner_offset;
7209                let mut inner_depth = depth.clone();
7210                if inlined {
7211                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7212                    inner_offset = next_offset;
7213                } else {
7214                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7215                    inner_depth.increment()?;
7216                }
7217                let val_ref =
7218                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
7219                fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
7220                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7221                {
7222                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7223                }
7224                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7225                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7226                }
7227            }
7228
7229            next_offset += envelope_size;
7230
7231            // Decode the remaining unknown envelopes.
7232            while next_offset < end_offset {
7233                _next_ordinal_to_read += 1;
7234                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7235                next_offset += envelope_size;
7236            }
7237
7238            Ok(())
7239        }
7240    }
7241
7242    impl ImmutableNodeAttributes {
7243        #[inline(always)]
7244        fn max_ordinal_present(&self) -> u64 {
7245            if let Some(_) = self.verity_enabled {
7246                return 10;
7247            }
7248            if let Some(_) = self.root_hash {
7249                return 9;
7250            }
7251            if let Some(_) = self.options {
7252                return 8;
7253            }
7254            if let Some(_) = self.change_time {
7255                return 7;
7256            }
7257            if let Some(_) = self.id {
7258                return 6;
7259            }
7260            if let Some(_) = self.link_count {
7261                return 5;
7262            }
7263            if let Some(_) = self.storage_size {
7264                return 4;
7265            }
7266            if let Some(_) = self.content_size {
7267                return 3;
7268            }
7269            if let Some(_) = self.abilities {
7270                return 2;
7271            }
7272            if let Some(_) = self.protocols {
7273                return 1;
7274            }
7275            0
7276        }
7277    }
7278
7279    impl fidl::encoding::ValueTypeMarker for ImmutableNodeAttributes {
7280        type Borrowed<'a> = &'a Self;
7281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7282            value
7283        }
7284    }
7285
7286    unsafe impl fidl::encoding::TypeMarker for ImmutableNodeAttributes {
7287        type Owned = Self;
7288
7289        #[inline(always)]
7290        fn inline_align(_context: fidl::encoding::Context) -> usize {
7291            8
7292        }
7293
7294        #[inline(always)]
7295        fn inline_size(_context: fidl::encoding::Context) -> usize {
7296            16
7297        }
7298    }
7299
7300    unsafe impl<D: fidl::encoding::ResourceDialect>
7301        fidl::encoding::Encode<ImmutableNodeAttributes, D> for &ImmutableNodeAttributes
7302    {
7303        unsafe fn encode(
7304            self,
7305            encoder: &mut fidl::encoding::Encoder<'_, D>,
7306            offset: usize,
7307            mut depth: fidl::encoding::Depth,
7308        ) -> fidl::Result<()> {
7309            encoder.debug_check_bounds::<ImmutableNodeAttributes>(offset);
7310            // Vector header
7311            let max_ordinal: u64 = self.max_ordinal_present();
7312            encoder.write_num(max_ordinal, offset);
7313            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7314            // Calling encoder.out_of_line_offset(0) is not allowed.
7315            if max_ordinal == 0 {
7316                return Ok(());
7317            }
7318            depth.increment()?;
7319            let envelope_size = 8;
7320            let bytes_len = max_ordinal as usize * envelope_size;
7321            #[allow(unused_variables)]
7322            let offset = encoder.out_of_line_offset(bytes_len);
7323            let mut _prev_end_offset: usize = 0;
7324            if 1 > max_ordinal {
7325                return Ok(());
7326            }
7327
7328            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7329            // are envelope_size bytes.
7330            let cur_offset: usize = (1 - 1) * envelope_size;
7331
7332            // Zero reserved fields.
7333            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7334
7335            // Safety:
7336            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7337            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7338            //   envelope_size bytes, there is always sufficient room.
7339            fidl::encoding::encode_in_envelope_optional::<NodeProtocolKinds, D>(
7340                self.protocols
7341                    .as_ref()
7342                    .map(<NodeProtocolKinds as fidl::encoding::ValueTypeMarker>::borrow),
7343                encoder,
7344                offset + cur_offset,
7345                depth,
7346            )?;
7347
7348            _prev_end_offset = cur_offset + envelope_size;
7349            if 2 > max_ordinal {
7350                return Ok(());
7351            }
7352
7353            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7354            // are envelope_size bytes.
7355            let cur_offset: usize = (2 - 1) * envelope_size;
7356
7357            // Zero reserved fields.
7358            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7359
7360            // Safety:
7361            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7362            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7363            //   envelope_size bytes, there is always sufficient room.
7364            fidl::encoding::encode_in_envelope_optional::<Operations, D>(
7365                self.abilities
7366                    .as_ref()
7367                    .map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
7368                encoder,
7369                offset + cur_offset,
7370                depth,
7371            )?;
7372
7373            _prev_end_offset = cur_offset + envelope_size;
7374            if 3 > max_ordinal {
7375                return Ok(());
7376            }
7377
7378            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7379            // are envelope_size bytes.
7380            let cur_offset: usize = (3 - 1) * envelope_size;
7381
7382            // Zero reserved fields.
7383            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7384
7385            // Safety:
7386            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7387            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7388            //   envelope_size bytes, there is always sufficient room.
7389            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7390                self.content_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7391                encoder,
7392                offset + cur_offset,
7393                depth,
7394            )?;
7395
7396            _prev_end_offset = cur_offset + envelope_size;
7397            if 4 > max_ordinal {
7398                return Ok(());
7399            }
7400
7401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7402            // are envelope_size bytes.
7403            let cur_offset: usize = (4 - 1) * envelope_size;
7404
7405            // Zero reserved fields.
7406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7407
7408            // Safety:
7409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7411            //   envelope_size bytes, there is always sufficient room.
7412            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7413                self.storage_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7414                encoder,
7415                offset + cur_offset,
7416                depth,
7417            )?;
7418
7419            _prev_end_offset = cur_offset + envelope_size;
7420            if 5 > max_ordinal {
7421                return Ok(());
7422            }
7423
7424            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7425            // are envelope_size bytes.
7426            let cur_offset: usize = (5 - 1) * envelope_size;
7427
7428            // Zero reserved fields.
7429            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7430
7431            // Safety:
7432            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7433            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7434            //   envelope_size bytes, there is always sufficient room.
7435            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7436                self.link_count.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7437                encoder,
7438                offset + cur_offset,
7439                depth,
7440            )?;
7441
7442            _prev_end_offset = cur_offset + envelope_size;
7443            if 6 > max_ordinal {
7444                return Ok(());
7445            }
7446
7447            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7448            // are envelope_size bytes.
7449            let cur_offset: usize = (6 - 1) * envelope_size;
7450
7451            // Zero reserved fields.
7452            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7453
7454            // Safety:
7455            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7456            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7457            //   envelope_size bytes, there is always sufficient room.
7458            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7459                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7460                encoder,
7461                offset + cur_offset,
7462                depth,
7463            )?;
7464
7465            _prev_end_offset = cur_offset + envelope_size;
7466            if 7 > max_ordinal {
7467                return Ok(());
7468            }
7469
7470            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7471            // are envelope_size bytes.
7472            let cur_offset: usize = (7 - 1) * envelope_size;
7473
7474            // Zero reserved fields.
7475            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7476
7477            // Safety:
7478            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7479            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7480            //   envelope_size bytes, there is always sufficient room.
7481            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7482                self.change_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7483                encoder,
7484                offset + cur_offset,
7485                depth,
7486            )?;
7487
7488            _prev_end_offset = cur_offset + envelope_size;
7489            if 8 > max_ordinal {
7490                return Ok(());
7491            }
7492
7493            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7494            // are envelope_size bytes.
7495            let cur_offset: usize = (8 - 1) * envelope_size;
7496
7497            // Zero reserved fields.
7498            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7499
7500            // Safety:
7501            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7502            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7503            //   envelope_size bytes, there is always sufficient room.
7504            fidl::encoding::encode_in_envelope_optional::<VerificationOptions, D>(
7505                self.options
7506                    .as_ref()
7507                    .map(<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow),
7508                encoder,
7509                offset + cur_offset,
7510                depth,
7511            )?;
7512
7513            _prev_end_offset = cur_offset + envelope_size;
7514            if 9 > max_ordinal {
7515                return Ok(());
7516            }
7517
7518            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7519            // are envelope_size bytes.
7520            let cur_offset: usize = (9 - 1) * envelope_size;
7521
7522            // Zero reserved fields.
7523            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7524
7525            // Safety:
7526            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7527            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7528            //   envelope_size bytes, there is always sufficient room.
7529            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 64>, D>(
7530                self.root_hash.as_ref().map(
7531                    <fidl::encoding::Vector<u8, 64> as fidl::encoding::ValueTypeMarker>::borrow,
7532                ),
7533                encoder,
7534                offset + cur_offset,
7535                depth,
7536            )?;
7537
7538            _prev_end_offset = cur_offset + envelope_size;
7539            if 10 > max_ordinal {
7540                return Ok(());
7541            }
7542
7543            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7544            // are envelope_size bytes.
7545            let cur_offset: usize = (10 - 1) * envelope_size;
7546
7547            // Zero reserved fields.
7548            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7549
7550            // Safety:
7551            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7552            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7553            //   envelope_size bytes, there is always sufficient room.
7554            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7555                self.verity_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7556                encoder,
7557                offset + cur_offset,
7558                depth,
7559            )?;
7560
7561            _prev_end_offset = cur_offset + envelope_size;
7562
7563            Ok(())
7564        }
7565    }
7566
7567    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7568        for ImmutableNodeAttributes
7569    {
7570        #[inline(always)]
7571        fn new_empty() -> Self {
7572            Self::default()
7573        }
7574
7575        unsafe fn decode(
7576            &mut self,
7577            decoder: &mut fidl::encoding::Decoder<'_, D>,
7578            offset: usize,
7579            mut depth: fidl::encoding::Depth,
7580        ) -> fidl::Result<()> {
7581            decoder.debug_check_bounds::<Self>(offset);
7582            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7583                None => return Err(fidl::Error::NotNullable),
7584                Some(len) => len,
7585            };
7586            // Calling decoder.out_of_line_offset(0) is not allowed.
7587            if len == 0 {
7588                return Ok(());
7589            };
7590            depth.increment()?;
7591            let envelope_size = 8;
7592            let bytes_len = len * envelope_size;
7593            let offset = decoder.out_of_line_offset(bytes_len)?;
7594            // Decode the envelope for each type.
7595            let mut _next_ordinal_to_read = 0;
7596            let mut next_offset = offset;
7597            let end_offset = offset + bytes_len;
7598            _next_ordinal_to_read += 1;
7599            if next_offset >= end_offset {
7600                return Ok(());
7601            }
7602
7603            // Decode unknown envelopes for gaps in ordinals.
7604            while _next_ordinal_to_read < 1 {
7605                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7606                _next_ordinal_to_read += 1;
7607                next_offset += envelope_size;
7608            }
7609
7610            let next_out_of_line = decoder.next_out_of_line();
7611            let handles_before = decoder.remaining_handles();
7612            if let Some((inlined, num_bytes, num_handles)) =
7613                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7614            {
7615                let member_inline_size =
7616                    <NodeProtocolKinds as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7617                if inlined != (member_inline_size <= 4) {
7618                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7619                }
7620                let inner_offset;
7621                let mut inner_depth = depth.clone();
7622                if inlined {
7623                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7624                    inner_offset = next_offset;
7625                } else {
7626                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7627                    inner_depth.increment()?;
7628                }
7629                let val_ref =
7630                    self.protocols.get_or_insert_with(|| fidl::new_empty!(NodeProtocolKinds, D));
7631                fidl::decode!(NodeProtocolKinds, D, val_ref, decoder, inner_offset, inner_depth)?;
7632                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7633                {
7634                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7635                }
7636                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7637                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7638                }
7639            }
7640
7641            next_offset += envelope_size;
7642            _next_ordinal_to_read += 1;
7643            if next_offset >= end_offset {
7644                return Ok(());
7645            }
7646
7647            // Decode unknown envelopes for gaps in ordinals.
7648            while _next_ordinal_to_read < 2 {
7649                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7650                _next_ordinal_to_read += 1;
7651                next_offset += envelope_size;
7652            }
7653
7654            let next_out_of_line = decoder.next_out_of_line();
7655            let handles_before = decoder.remaining_handles();
7656            if let Some((inlined, num_bytes, num_handles)) =
7657                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7658            {
7659                let member_inline_size =
7660                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7661                if inlined != (member_inline_size <= 4) {
7662                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7663                }
7664                let inner_offset;
7665                let mut inner_depth = depth.clone();
7666                if inlined {
7667                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7668                    inner_offset = next_offset;
7669                } else {
7670                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7671                    inner_depth.increment()?;
7672                }
7673                let val_ref = self.abilities.get_or_insert_with(|| fidl::new_empty!(Operations, D));
7674                fidl::decode!(Operations, D, val_ref, decoder, inner_offset, inner_depth)?;
7675                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7676                {
7677                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7678                }
7679                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7680                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7681                }
7682            }
7683
7684            next_offset += envelope_size;
7685            _next_ordinal_to_read += 1;
7686            if next_offset >= end_offset {
7687                return Ok(());
7688            }
7689
7690            // Decode unknown envelopes for gaps in ordinals.
7691            while _next_ordinal_to_read < 3 {
7692                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7693                _next_ordinal_to_read += 1;
7694                next_offset += envelope_size;
7695            }
7696
7697            let next_out_of_line = decoder.next_out_of_line();
7698            let handles_before = decoder.remaining_handles();
7699            if let Some((inlined, num_bytes, num_handles)) =
7700                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7701            {
7702                let member_inline_size =
7703                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7704                if inlined != (member_inline_size <= 4) {
7705                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7706                }
7707                let inner_offset;
7708                let mut inner_depth = depth.clone();
7709                if inlined {
7710                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7711                    inner_offset = next_offset;
7712                } else {
7713                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7714                    inner_depth.increment()?;
7715                }
7716                let val_ref = self.content_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
7717                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7718                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7719                {
7720                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7721                }
7722                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7723                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7724                }
7725            }
7726
7727            next_offset += envelope_size;
7728            _next_ordinal_to_read += 1;
7729            if next_offset >= end_offset {
7730                return Ok(());
7731            }
7732
7733            // Decode unknown envelopes for gaps in ordinals.
7734            while _next_ordinal_to_read < 4 {
7735                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7736                _next_ordinal_to_read += 1;
7737                next_offset += envelope_size;
7738            }
7739
7740            let next_out_of_line = decoder.next_out_of_line();
7741            let handles_before = decoder.remaining_handles();
7742            if let Some((inlined, num_bytes, num_handles)) =
7743                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7744            {
7745                let member_inline_size =
7746                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7747                if inlined != (member_inline_size <= 4) {
7748                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7749                }
7750                let inner_offset;
7751                let mut inner_depth = depth.clone();
7752                if inlined {
7753                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7754                    inner_offset = next_offset;
7755                } else {
7756                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7757                    inner_depth.increment()?;
7758                }
7759                let val_ref = self.storage_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
7760                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7761                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7762                {
7763                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7764                }
7765                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7766                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7767                }
7768            }
7769
7770            next_offset += envelope_size;
7771            _next_ordinal_to_read += 1;
7772            if next_offset >= end_offset {
7773                return Ok(());
7774            }
7775
7776            // Decode unknown envelopes for gaps in ordinals.
7777            while _next_ordinal_to_read < 5 {
7778                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7779                _next_ordinal_to_read += 1;
7780                next_offset += envelope_size;
7781            }
7782
7783            let next_out_of_line = decoder.next_out_of_line();
7784            let handles_before = decoder.remaining_handles();
7785            if let Some((inlined, num_bytes, num_handles)) =
7786                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7787            {
7788                let member_inline_size =
7789                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7790                if inlined != (member_inline_size <= 4) {
7791                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7792                }
7793                let inner_offset;
7794                let mut inner_depth = depth.clone();
7795                if inlined {
7796                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7797                    inner_offset = next_offset;
7798                } else {
7799                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7800                    inner_depth.increment()?;
7801                }
7802                let val_ref = self.link_count.get_or_insert_with(|| fidl::new_empty!(u64, D));
7803                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7804                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7805                {
7806                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7807                }
7808                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7809                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7810                }
7811            }
7812
7813            next_offset += envelope_size;
7814            _next_ordinal_to_read += 1;
7815            if next_offset >= end_offset {
7816                return Ok(());
7817            }
7818
7819            // Decode unknown envelopes for gaps in ordinals.
7820            while _next_ordinal_to_read < 6 {
7821                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7822                _next_ordinal_to_read += 1;
7823                next_offset += envelope_size;
7824            }
7825
7826            let next_out_of_line = decoder.next_out_of_line();
7827            let handles_before = decoder.remaining_handles();
7828            if let Some((inlined, num_bytes, num_handles)) =
7829                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7830            {
7831                let member_inline_size =
7832                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7833                if inlined != (member_inline_size <= 4) {
7834                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7835                }
7836                let inner_offset;
7837                let mut inner_depth = depth.clone();
7838                if inlined {
7839                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7840                    inner_offset = next_offset;
7841                } else {
7842                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7843                    inner_depth.increment()?;
7844                }
7845                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
7846                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7847                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7848                {
7849                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7850                }
7851                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7852                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7853                }
7854            }
7855
7856            next_offset += envelope_size;
7857            _next_ordinal_to_read += 1;
7858            if next_offset >= end_offset {
7859                return Ok(());
7860            }
7861
7862            // Decode unknown envelopes for gaps in ordinals.
7863            while _next_ordinal_to_read < 7 {
7864                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7865                _next_ordinal_to_read += 1;
7866                next_offset += envelope_size;
7867            }
7868
7869            let next_out_of_line = decoder.next_out_of_line();
7870            let handles_before = decoder.remaining_handles();
7871            if let Some((inlined, num_bytes, num_handles)) =
7872                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7873            {
7874                let member_inline_size =
7875                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7876                if inlined != (member_inline_size <= 4) {
7877                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7878                }
7879                let inner_offset;
7880                let mut inner_depth = depth.clone();
7881                if inlined {
7882                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7883                    inner_offset = next_offset;
7884                } else {
7885                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7886                    inner_depth.increment()?;
7887                }
7888                let val_ref = self.change_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
7889                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7890                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7891                {
7892                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7893                }
7894                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7895                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7896                }
7897            }
7898
7899            next_offset += envelope_size;
7900            _next_ordinal_to_read += 1;
7901            if next_offset >= end_offset {
7902                return Ok(());
7903            }
7904
7905            // Decode unknown envelopes for gaps in ordinals.
7906            while _next_ordinal_to_read < 8 {
7907                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7908                _next_ordinal_to_read += 1;
7909                next_offset += envelope_size;
7910            }
7911
7912            let next_out_of_line = decoder.next_out_of_line();
7913            let handles_before = decoder.remaining_handles();
7914            if let Some((inlined, num_bytes, num_handles)) =
7915                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7916            {
7917                let member_inline_size =
7918                    <VerificationOptions as fidl::encoding::TypeMarker>::inline_size(
7919                        decoder.context,
7920                    );
7921                if inlined != (member_inline_size <= 4) {
7922                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7923                }
7924                let inner_offset;
7925                let mut inner_depth = depth.clone();
7926                if inlined {
7927                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7928                    inner_offset = next_offset;
7929                } else {
7930                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7931                    inner_depth.increment()?;
7932                }
7933                let val_ref =
7934                    self.options.get_or_insert_with(|| fidl::new_empty!(VerificationOptions, D));
7935                fidl::decode!(VerificationOptions, D, val_ref, decoder, inner_offset, inner_depth)?;
7936                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7937                {
7938                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7939                }
7940                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7941                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7942                }
7943            }
7944
7945            next_offset += envelope_size;
7946            _next_ordinal_to_read += 1;
7947            if next_offset >= end_offset {
7948                return Ok(());
7949            }
7950
7951            // Decode unknown envelopes for gaps in ordinals.
7952            while _next_ordinal_to_read < 9 {
7953                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7954                _next_ordinal_to_read += 1;
7955                next_offset += envelope_size;
7956            }
7957
7958            let next_out_of_line = decoder.next_out_of_line();
7959            let handles_before = decoder.remaining_handles();
7960            if let Some((inlined, num_bytes, num_handles)) =
7961                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7962            {
7963                let member_inline_size =
7964                    <fidl::encoding::Vector<u8, 64> as fidl::encoding::TypeMarker>::inline_size(
7965                        decoder.context,
7966                    );
7967                if inlined != (member_inline_size <= 4) {
7968                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7969                }
7970                let inner_offset;
7971                let mut inner_depth = depth.clone();
7972                if inlined {
7973                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7974                    inner_offset = next_offset;
7975                } else {
7976                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7977                    inner_depth.increment()?;
7978                }
7979                let val_ref = self
7980                    .root_hash
7981                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 64>, D));
7982                fidl::decode!(fidl::encoding::Vector<u8, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
7983                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7984                {
7985                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7986                }
7987                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7988                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7989                }
7990            }
7991
7992            next_offset += envelope_size;
7993            _next_ordinal_to_read += 1;
7994            if next_offset >= end_offset {
7995                return Ok(());
7996            }
7997
7998            // Decode unknown envelopes for gaps in ordinals.
7999            while _next_ordinal_to_read < 10 {
8000                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8001                _next_ordinal_to_read += 1;
8002                next_offset += envelope_size;
8003            }
8004
8005            let next_out_of_line = decoder.next_out_of_line();
8006            let handles_before = decoder.remaining_handles();
8007            if let Some((inlined, num_bytes, num_handles)) =
8008                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8009            {
8010                let member_inline_size =
8011                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8012                if inlined != (member_inline_size <= 4) {
8013                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8014                }
8015                let inner_offset;
8016                let mut inner_depth = depth.clone();
8017                if inlined {
8018                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8019                    inner_offset = next_offset;
8020                } else {
8021                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8022                    inner_depth.increment()?;
8023                }
8024                let val_ref = self.verity_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
8025                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8026                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8027                {
8028                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8029                }
8030                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8031                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8032                }
8033            }
8034
8035            next_offset += envelope_size;
8036
8037            // Decode the remaining unknown envelopes.
8038            while next_offset < end_offset {
8039                _next_ordinal_to_read += 1;
8040                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8041                next_offset += envelope_size;
8042            }
8043
8044            Ok(())
8045        }
8046    }
8047
8048    impl MutableNodeAttributes {
8049        #[inline(always)]
8050        fn max_ordinal_present(&self) -> u64 {
8051            if let Some(_) = self.encryption_policy {
8052                return 10;
8053            }
8054            if let Some(_) = self.selinux_context {
8055                return 9;
8056            }
8057            if let Some(_) = self.casefold {
8058                return 8;
8059            }
8060            if let Some(_) = self.access_time {
8061                return 7;
8062            }
8063            if let Some(_) = self.rdev {
8064                return 6;
8065            }
8066            if let Some(_) = self.gid {
8067                return 5;
8068            }
8069            if let Some(_) = self.uid {
8070                return 4;
8071            }
8072            if let Some(_) = self.mode {
8073                return 3;
8074            }
8075            if let Some(_) = self.modification_time {
8076                return 2;
8077            }
8078            if let Some(_) = self.creation_time {
8079                return 1;
8080            }
8081            0
8082        }
8083    }
8084
8085    impl fidl::encoding::ValueTypeMarker for MutableNodeAttributes {
8086        type Borrowed<'a> = &'a Self;
8087        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8088            value
8089        }
8090    }
8091
8092    unsafe impl fidl::encoding::TypeMarker for MutableNodeAttributes {
8093        type Owned = Self;
8094
8095        #[inline(always)]
8096        fn inline_align(_context: fidl::encoding::Context) -> usize {
8097            8
8098        }
8099
8100        #[inline(always)]
8101        fn inline_size(_context: fidl::encoding::Context) -> usize {
8102            16
8103        }
8104    }
8105
8106    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MutableNodeAttributes, D>
8107        for &MutableNodeAttributes
8108    {
8109        unsafe fn encode(
8110            self,
8111            encoder: &mut fidl::encoding::Encoder<'_, D>,
8112            offset: usize,
8113            mut depth: fidl::encoding::Depth,
8114        ) -> fidl::Result<()> {
8115            encoder.debug_check_bounds::<MutableNodeAttributes>(offset);
8116            // Vector header
8117            let max_ordinal: u64 = self.max_ordinal_present();
8118            encoder.write_num(max_ordinal, offset);
8119            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8120            // Calling encoder.out_of_line_offset(0) is not allowed.
8121            if max_ordinal == 0 {
8122                return Ok(());
8123            }
8124            depth.increment()?;
8125            let envelope_size = 8;
8126            let bytes_len = max_ordinal as usize * envelope_size;
8127            #[allow(unused_variables)]
8128            let offset = encoder.out_of_line_offset(bytes_len);
8129            let mut _prev_end_offset: usize = 0;
8130            if 1 > max_ordinal {
8131                return Ok(());
8132            }
8133
8134            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8135            // are envelope_size bytes.
8136            let cur_offset: usize = (1 - 1) * envelope_size;
8137
8138            // Zero reserved fields.
8139            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8140
8141            // Safety:
8142            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8143            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8144            //   envelope_size bytes, there is always sufficient room.
8145            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8146                self.creation_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8147                encoder,
8148                offset + cur_offset,
8149                depth,
8150            )?;
8151
8152            _prev_end_offset = cur_offset + envelope_size;
8153            if 2 > max_ordinal {
8154                return Ok(());
8155            }
8156
8157            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8158            // are envelope_size bytes.
8159            let cur_offset: usize = (2 - 1) * envelope_size;
8160
8161            // Zero reserved fields.
8162            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8163
8164            // Safety:
8165            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8166            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8167            //   envelope_size bytes, there is always sufficient room.
8168            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8169                self.modification_time
8170                    .as_ref()
8171                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8172                encoder,
8173                offset + cur_offset,
8174                depth,
8175            )?;
8176
8177            _prev_end_offset = cur_offset + envelope_size;
8178            if 3 > max_ordinal {
8179                return Ok(());
8180            }
8181
8182            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8183            // are envelope_size bytes.
8184            let cur_offset: usize = (3 - 1) * envelope_size;
8185
8186            // Zero reserved fields.
8187            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8188
8189            // Safety:
8190            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8191            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8192            //   envelope_size bytes, there is always sufficient room.
8193            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8194                self.mode.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8195                encoder,
8196                offset + cur_offset,
8197                depth,
8198            )?;
8199
8200            _prev_end_offset = cur_offset + envelope_size;
8201            if 4 > max_ordinal {
8202                return Ok(());
8203            }
8204
8205            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8206            // are envelope_size bytes.
8207            let cur_offset: usize = (4 - 1) * envelope_size;
8208
8209            // Zero reserved fields.
8210            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8211
8212            // Safety:
8213            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8214            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8215            //   envelope_size bytes, there is always sufficient room.
8216            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8217                self.uid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8218                encoder,
8219                offset + cur_offset,
8220                depth,
8221            )?;
8222
8223            _prev_end_offset = cur_offset + envelope_size;
8224            if 5 > max_ordinal {
8225                return Ok(());
8226            }
8227
8228            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8229            // are envelope_size bytes.
8230            let cur_offset: usize = (5 - 1) * envelope_size;
8231
8232            // Zero reserved fields.
8233            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8234
8235            // Safety:
8236            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8237            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8238            //   envelope_size bytes, there is always sufficient room.
8239            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8240                self.gid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8241                encoder,
8242                offset + cur_offset,
8243                depth,
8244            )?;
8245
8246            _prev_end_offset = cur_offset + envelope_size;
8247            if 6 > max_ordinal {
8248                return Ok(());
8249            }
8250
8251            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8252            // are envelope_size bytes.
8253            let cur_offset: usize = (6 - 1) * envelope_size;
8254
8255            // Zero reserved fields.
8256            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8257
8258            // Safety:
8259            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8260            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8261            //   envelope_size bytes, there is always sufficient room.
8262            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8263                self.rdev.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8264                encoder,
8265                offset + cur_offset,
8266                depth,
8267            )?;
8268
8269            _prev_end_offset = cur_offset + envelope_size;
8270            if 7 > max_ordinal {
8271                return Ok(());
8272            }
8273
8274            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8275            // are envelope_size bytes.
8276            let cur_offset: usize = (7 - 1) * envelope_size;
8277
8278            // Zero reserved fields.
8279            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8280
8281            // Safety:
8282            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8283            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8284            //   envelope_size bytes, there is always sufficient room.
8285            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8286                self.access_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8287                encoder,
8288                offset + cur_offset,
8289                depth,
8290            )?;
8291
8292            _prev_end_offset = cur_offset + envelope_size;
8293            if 8 > max_ordinal {
8294                return Ok(());
8295            }
8296
8297            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8298            // are envelope_size bytes.
8299            let cur_offset: usize = (8 - 1) * envelope_size;
8300
8301            // Zero reserved fields.
8302            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8303
8304            // Safety:
8305            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8306            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8307            //   envelope_size bytes, there is always sufficient room.
8308            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8309                self.casefold.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8310                encoder,
8311                offset + cur_offset,
8312                depth,
8313            )?;
8314
8315            _prev_end_offset = cur_offset + envelope_size;
8316            if 9 > max_ordinal {
8317                return Ok(());
8318            }
8319
8320            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8321            // are envelope_size bytes.
8322            let cur_offset: usize = (9 - 1) * envelope_size;
8323
8324            // Zero reserved fields.
8325            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8326
8327            // Safety:
8328            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8329            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8330            //   envelope_size bytes, there is always sufficient room.
8331            fidl::encoding::encode_in_envelope_optional::<SelinuxContext, D>(
8332                self.selinux_context
8333                    .as_ref()
8334                    .map(<SelinuxContext as fidl::encoding::ValueTypeMarker>::borrow),
8335                encoder,
8336                offset + cur_offset,
8337                depth,
8338            )?;
8339
8340            _prev_end_offset = cur_offset + envelope_size;
8341            if 10 > max_ordinal {
8342                return Ok(());
8343            }
8344
8345            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8346            // are envelope_size bytes.
8347            let cur_offset: usize = (10 - 1) * envelope_size;
8348
8349            // Zero reserved fields.
8350            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8351
8352            // Safety:
8353            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8354            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8355            //   envelope_size bytes, there is always sufficient room.
8356            fidl::encoding::encode_in_envelope_optional::<FscryptPolicy, D>(
8357                self.encryption_policy
8358                    .as_ref()
8359                    .map(<FscryptPolicy as fidl::encoding::ValueTypeMarker>::borrow),
8360                encoder,
8361                offset + cur_offset,
8362                depth,
8363            )?;
8364
8365            _prev_end_offset = cur_offset + envelope_size;
8366
8367            Ok(())
8368        }
8369    }
8370
8371    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MutableNodeAttributes {
8372        #[inline(always)]
8373        fn new_empty() -> Self {
8374            Self::default()
8375        }
8376
8377        unsafe fn decode(
8378            &mut self,
8379            decoder: &mut fidl::encoding::Decoder<'_, D>,
8380            offset: usize,
8381            mut depth: fidl::encoding::Depth,
8382        ) -> fidl::Result<()> {
8383            decoder.debug_check_bounds::<Self>(offset);
8384            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8385                None => return Err(fidl::Error::NotNullable),
8386                Some(len) => len,
8387            };
8388            // Calling decoder.out_of_line_offset(0) is not allowed.
8389            if len == 0 {
8390                return Ok(());
8391            };
8392            depth.increment()?;
8393            let envelope_size = 8;
8394            let bytes_len = len * envelope_size;
8395            let offset = decoder.out_of_line_offset(bytes_len)?;
8396            // Decode the envelope for each type.
8397            let mut _next_ordinal_to_read = 0;
8398            let mut next_offset = offset;
8399            let end_offset = offset + bytes_len;
8400            _next_ordinal_to_read += 1;
8401            if next_offset >= end_offset {
8402                return Ok(());
8403            }
8404
8405            // Decode unknown envelopes for gaps in ordinals.
8406            while _next_ordinal_to_read < 1 {
8407                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8408                _next_ordinal_to_read += 1;
8409                next_offset += envelope_size;
8410            }
8411
8412            let next_out_of_line = decoder.next_out_of_line();
8413            let handles_before = decoder.remaining_handles();
8414            if let Some((inlined, num_bytes, num_handles)) =
8415                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8416            {
8417                let member_inline_size =
8418                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8419                if inlined != (member_inline_size <= 4) {
8420                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8421                }
8422                let inner_offset;
8423                let mut inner_depth = depth.clone();
8424                if inlined {
8425                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8426                    inner_offset = next_offset;
8427                } else {
8428                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8429                    inner_depth.increment()?;
8430                }
8431                let val_ref = self.creation_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
8432                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8433                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8434                {
8435                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8436                }
8437                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8438                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8439                }
8440            }
8441
8442            next_offset += envelope_size;
8443            _next_ordinal_to_read += 1;
8444            if next_offset >= end_offset {
8445                return Ok(());
8446            }
8447
8448            // Decode unknown envelopes for gaps in ordinals.
8449            while _next_ordinal_to_read < 2 {
8450                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8451                _next_ordinal_to_read += 1;
8452                next_offset += envelope_size;
8453            }
8454
8455            let next_out_of_line = decoder.next_out_of_line();
8456            let handles_before = decoder.remaining_handles();
8457            if let Some((inlined, num_bytes, num_handles)) =
8458                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8459            {
8460                let member_inline_size =
8461                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8462                if inlined != (member_inline_size <= 4) {
8463                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8464                }
8465                let inner_offset;
8466                let mut inner_depth = depth.clone();
8467                if inlined {
8468                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8469                    inner_offset = next_offset;
8470                } else {
8471                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8472                    inner_depth.increment()?;
8473                }
8474                let val_ref =
8475                    self.modification_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
8476                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8477                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8478                {
8479                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8480                }
8481                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8482                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8483                }
8484            }
8485
8486            next_offset += envelope_size;
8487            _next_ordinal_to_read += 1;
8488            if next_offset >= end_offset {
8489                return Ok(());
8490            }
8491
8492            // Decode unknown envelopes for gaps in ordinals.
8493            while _next_ordinal_to_read < 3 {
8494                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8495                _next_ordinal_to_read += 1;
8496                next_offset += envelope_size;
8497            }
8498
8499            let next_out_of_line = decoder.next_out_of_line();
8500            let handles_before = decoder.remaining_handles();
8501            if let Some((inlined, num_bytes, num_handles)) =
8502                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8503            {
8504                let member_inline_size =
8505                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8506                if inlined != (member_inline_size <= 4) {
8507                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8508                }
8509                let inner_offset;
8510                let mut inner_depth = depth.clone();
8511                if inlined {
8512                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8513                    inner_offset = next_offset;
8514                } else {
8515                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8516                    inner_depth.increment()?;
8517                }
8518                let val_ref = self.mode.get_or_insert_with(|| fidl::new_empty!(u32, D));
8519                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8520                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8521                {
8522                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8523                }
8524                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8525                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8526                }
8527            }
8528
8529            next_offset += envelope_size;
8530            _next_ordinal_to_read += 1;
8531            if next_offset >= end_offset {
8532                return Ok(());
8533            }
8534
8535            // Decode unknown envelopes for gaps in ordinals.
8536            while _next_ordinal_to_read < 4 {
8537                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8538                _next_ordinal_to_read += 1;
8539                next_offset += envelope_size;
8540            }
8541
8542            let next_out_of_line = decoder.next_out_of_line();
8543            let handles_before = decoder.remaining_handles();
8544            if let Some((inlined, num_bytes, num_handles)) =
8545                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8546            {
8547                let member_inline_size =
8548                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8549                if inlined != (member_inline_size <= 4) {
8550                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8551                }
8552                let inner_offset;
8553                let mut inner_depth = depth.clone();
8554                if inlined {
8555                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8556                    inner_offset = next_offset;
8557                } else {
8558                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8559                    inner_depth.increment()?;
8560                }
8561                let val_ref = self.uid.get_or_insert_with(|| fidl::new_empty!(u32, D));
8562                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8563                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8564                {
8565                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8566                }
8567                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8568                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8569                }
8570            }
8571
8572            next_offset += envelope_size;
8573            _next_ordinal_to_read += 1;
8574            if next_offset >= end_offset {
8575                return Ok(());
8576            }
8577
8578            // Decode unknown envelopes for gaps in ordinals.
8579            while _next_ordinal_to_read < 5 {
8580                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8581                _next_ordinal_to_read += 1;
8582                next_offset += envelope_size;
8583            }
8584
8585            let next_out_of_line = decoder.next_out_of_line();
8586            let handles_before = decoder.remaining_handles();
8587            if let Some((inlined, num_bytes, num_handles)) =
8588                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8589            {
8590                let member_inline_size =
8591                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8592                if inlined != (member_inline_size <= 4) {
8593                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8594                }
8595                let inner_offset;
8596                let mut inner_depth = depth.clone();
8597                if inlined {
8598                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8599                    inner_offset = next_offset;
8600                } else {
8601                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8602                    inner_depth.increment()?;
8603                }
8604                let val_ref = self.gid.get_or_insert_with(|| fidl::new_empty!(u32, D));
8605                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8606                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8607                {
8608                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8609                }
8610                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8611                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8612                }
8613            }
8614
8615            next_offset += envelope_size;
8616            _next_ordinal_to_read += 1;
8617            if next_offset >= end_offset {
8618                return Ok(());
8619            }
8620
8621            // Decode unknown envelopes for gaps in ordinals.
8622            while _next_ordinal_to_read < 6 {
8623                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8624                _next_ordinal_to_read += 1;
8625                next_offset += envelope_size;
8626            }
8627
8628            let next_out_of_line = decoder.next_out_of_line();
8629            let handles_before = decoder.remaining_handles();
8630            if let Some((inlined, num_bytes, num_handles)) =
8631                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8632            {
8633                let member_inline_size =
8634                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8635                if inlined != (member_inline_size <= 4) {
8636                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8637                }
8638                let inner_offset;
8639                let mut inner_depth = depth.clone();
8640                if inlined {
8641                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8642                    inner_offset = next_offset;
8643                } else {
8644                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8645                    inner_depth.increment()?;
8646                }
8647                let val_ref = self.rdev.get_or_insert_with(|| fidl::new_empty!(u64, D));
8648                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8649                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8650                {
8651                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8652                }
8653                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8654                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8655                }
8656            }
8657
8658            next_offset += envelope_size;
8659            _next_ordinal_to_read += 1;
8660            if next_offset >= end_offset {
8661                return Ok(());
8662            }
8663
8664            // Decode unknown envelopes for gaps in ordinals.
8665            while _next_ordinal_to_read < 7 {
8666                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8667                _next_ordinal_to_read += 1;
8668                next_offset += envelope_size;
8669            }
8670
8671            let next_out_of_line = decoder.next_out_of_line();
8672            let handles_before = decoder.remaining_handles();
8673            if let Some((inlined, num_bytes, num_handles)) =
8674                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8675            {
8676                let member_inline_size =
8677                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8678                if inlined != (member_inline_size <= 4) {
8679                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8680                }
8681                let inner_offset;
8682                let mut inner_depth = depth.clone();
8683                if inlined {
8684                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8685                    inner_offset = next_offset;
8686                } else {
8687                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8688                    inner_depth.increment()?;
8689                }
8690                let val_ref = self.access_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
8691                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8692                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8693                {
8694                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8695                }
8696                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8697                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8698                }
8699            }
8700
8701            next_offset += envelope_size;
8702            _next_ordinal_to_read += 1;
8703            if next_offset >= end_offset {
8704                return Ok(());
8705            }
8706
8707            // Decode unknown envelopes for gaps in ordinals.
8708            while _next_ordinal_to_read < 8 {
8709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8710                _next_ordinal_to_read += 1;
8711                next_offset += envelope_size;
8712            }
8713
8714            let next_out_of_line = decoder.next_out_of_line();
8715            let handles_before = decoder.remaining_handles();
8716            if let Some((inlined, num_bytes, num_handles)) =
8717                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8718            {
8719                let member_inline_size =
8720                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8721                if inlined != (member_inline_size <= 4) {
8722                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8723                }
8724                let inner_offset;
8725                let mut inner_depth = depth.clone();
8726                if inlined {
8727                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8728                    inner_offset = next_offset;
8729                } else {
8730                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8731                    inner_depth.increment()?;
8732                }
8733                let val_ref = self.casefold.get_or_insert_with(|| fidl::new_empty!(bool, D));
8734                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8735                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8736                {
8737                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8738                }
8739                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8740                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8741                }
8742            }
8743
8744            next_offset += envelope_size;
8745            _next_ordinal_to_read += 1;
8746            if next_offset >= end_offset {
8747                return Ok(());
8748            }
8749
8750            // Decode unknown envelopes for gaps in ordinals.
8751            while _next_ordinal_to_read < 9 {
8752                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8753                _next_ordinal_to_read += 1;
8754                next_offset += envelope_size;
8755            }
8756
8757            let next_out_of_line = decoder.next_out_of_line();
8758            let handles_before = decoder.remaining_handles();
8759            if let Some((inlined, num_bytes, num_handles)) =
8760                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8761            {
8762                let member_inline_size =
8763                    <SelinuxContext as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8764                if inlined != (member_inline_size <= 4) {
8765                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8766                }
8767                let inner_offset;
8768                let mut inner_depth = depth.clone();
8769                if inlined {
8770                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8771                    inner_offset = next_offset;
8772                } else {
8773                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8774                    inner_depth.increment()?;
8775                }
8776                let val_ref =
8777                    self.selinux_context.get_or_insert_with(|| fidl::new_empty!(SelinuxContext, D));
8778                fidl::decode!(SelinuxContext, D, val_ref, decoder, inner_offset, inner_depth)?;
8779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8780                {
8781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8782                }
8783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8785                }
8786            }
8787
8788            next_offset += envelope_size;
8789            _next_ordinal_to_read += 1;
8790            if next_offset >= end_offset {
8791                return Ok(());
8792            }
8793
8794            // Decode unknown envelopes for gaps in ordinals.
8795            while _next_ordinal_to_read < 10 {
8796                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8797                _next_ordinal_to_read += 1;
8798                next_offset += envelope_size;
8799            }
8800
8801            let next_out_of_line = decoder.next_out_of_line();
8802            let handles_before = decoder.remaining_handles();
8803            if let Some((inlined, num_bytes, num_handles)) =
8804                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8805            {
8806                let member_inline_size =
8807                    <FscryptPolicy as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8808                if inlined != (member_inline_size <= 4) {
8809                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8810                }
8811                let inner_offset;
8812                let mut inner_depth = depth.clone();
8813                if inlined {
8814                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8815                    inner_offset = next_offset;
8816                } else {
8817                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8818                    inner_depth.increment()?;
8819                }
8820                let val_ref = self
8821                    .encryption_policy
8822                    .get_or_insert_with(|| fidl::new_empty!(FscryptPolicy, D));
8823                fidl::decode!(FscryptPolicy, D, val_ref, decoder, inner_offset, inner_depth)?;
8824                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8825                {
8826                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8827                }
8828                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8829                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8830                }
8831            }
8832
8833            next_offset += envelope_size;
8834
8835            // Decode the remaining unknown envelopes.
8836            while next_offset < end_offset {
8837                _next_ordinal_to_read += 1;
8838                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8839                next_offset += envelope_size;
8840            }
8841
8842            Ok(())
8843        }
8844    }
8845
8846    impl NodeInfo {
8847        #[inline(always)]
8848        fn max_ordinal_present(&self) -> u64 {
8849            if let Some(_) = self.attributes {
8850                return 1;
8851            }
8852            0
8853        }
8854    }
8855
8856    impl fidl::encoding::ValueTypeMarker for NodeInfo {
8857        type Borrowed<'a> = &'a Self;
8858        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8859            value
8860        }
8861    }
8862
8863    unsafe impl fidl::encoding::TypeMarker for NodeInfo {
8864        type Owned = Self;
8865
8866        #[inline(always)]
8867        fn inline_align(_context: fidl::encoding::Context) -> usize {
8868            8
8869        }
8870
8871        #[inline(always)]
8872        fn inline_size(_context: fidl::encoding::Context) -> usize {
8873            16
8874        }
8875    }
8876
8877    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeInfo, D> for &NodeInfo {
8878        unsafe fn encode(
8879            self,
8880            encoder: &mut fidl::encoding::Encoder<'_, D>,
8881            offset: usize,
8882            mut depth: fidl::encoding::Depth,
8883        ) -> fidl::Result<()> {
8884            encoder.debug_check_bounds::<NodeInfo>(offset);
8885            // Vector header
8886            let max_ordinal: u64 = self.max_ordinal_present();
8887            encoder.write_num(max_ordinal, offset);
8888            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8889            // Calling encoder.out_of_line_offset(0) is not allowed.
8890            if max_ordinal == 0 {
8891                return Ok(());
8892            }
8893            depth.increment()?;
8894            let envelope_size = 8;
8895            let bytes_len = max_ordinal as usize * envelope_size;
8896            #[allow(unused_variables)]
8897            let offset = encoder.out_of_line_offset(bytes_len);
8898            let mut _prev_end_offset: usize = 0;
8899            if 1 > max_ordinal {
8900                return Ok(());
8901            }
8902
8903            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8904            // are envelope_size bytes.
8905            let cur_offset: usize = (1 - 1) * envelope_size;
8906
8907            // Zero reserved fields.
8908            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8909
8910            // Safety:
8911            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8912            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8913            //   envelope_size bytes, there is always sufficient room.
8914            fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
8915                self.attributes
8916                    .as_ref()
8917                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
8918                encoder,
8919                offset + cur_offset,
8920                depth,
8921            )?;
8922
8923            _prev_end_offset = cur_offset + envelope_size;
8924
8925            Ok(())
8926        }
8927    }
8928
8929    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeInfo {
8930        #[inline(always)]
8931        fn new_empty() -> Self {
8932            Self::default()
8933        }
8934
8935        unsafe fn decode(
8936            &mut self,
8937            decoder: &mut fidl::encoding::Decoder<'_, D>,
8938            offset: usize,
8939            mut depth: fidl::encoding::Depth,
8940        ) -> fidl::Result<()> {
8941            decoder.debug_check_bounds::<Self>(offset);
8942            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8943                None => return Err(fidl::Error::NotNullable),
8944                Some(len) => len,
8945            };
8946            // Calling decoder.out_of_line_offset(0) is not allowed.
8947            if len == 0 {
8948                return Ok(());
8949            };
8950            depth.increment()?;
8951            let envelope_size = 8;
8952            let bytes_len = len * envelope_size;
8953            let offset = decoder.out_of_line_offset(bytes_len)?;
8954            // Decode the envelope for each type.
8955            let mut _next_ordinal_to_read = 0;
8956            let mut next_offset = offset;
8957            let end_offset = offset + bytes_len;
8958            _next_ordinal_to_read += 1;
8959            if next_offset >= end_offset {
8960                return Ok(());
8961            }
8962
8963            // Decode unknown envelopes for gaps in ordinals.
8964            while _next_ordinal_to_read < 1 {
8965                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8966                _next_ordinal_to_read += 1;
8967                next_offset += envelope_size;
8968            }
8969
8970            let next_out_of_line = decoder.next_out_of_line();
8971            let handles_before = decoder.remaining_handles();
8972            if let Some((inlined, num_bytes, num_handles)) =
8973                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8974            {
8975                let member_inline_size =
8976                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8977                if inlined != (member_inline_size <= 4) {
8978                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8979                }
8980                let inner_offset;
8981                let mut inner_depth = depth.clone();
8982                if inlined {
8983                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8984                    inner_offset = next_offset;
8985                } else {
8986                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8987                    inner_depth.increment()?;
8988                }
8989                let val_ref =
8990                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
8991                fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
8992                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8993                {
8994                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8995                }
8996                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8997                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8998                }
8999            }
9000
9001            next_offset += envelope_size;
9002
9003            // Decode the remaining unknown envelopes.
9004            while next_offset < end_offset {
9005                _next_ordinal_to_read += 1;
9006                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9007                next_offset += envelope_size;
9008            }
9009
9010            Ok(())
9011        }
9012    }
9013
9014    impl Options {
9015        #[inline(always)]
9016        fn max_ordinal_present(&self) -> u64 {
9017            if let Some(_) = self.create_attributes {
9018                return 2;
9019            }
9020            if let Some(_) = self.attributes {
9021                return 1;
9022            }
9023            0
9024        }
9025    }
9026
9027    impl fidl::encoding::ValueTypeMarker for Options {
9028        type Borrowed<'a> = &'a Self;
9029        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9030            value
9031        }
9032    }
9033
9034    unsafe impl fidl::encoding::TypeMarker for Options {
9035        type Owned = Self;
9036
9037        #[inline(always)]
9038        fn inline_align(_context: fidl::encoding::Context) -> usize {
9039            8
9040        }
9041
9042        #[inline(always)]
9043        fn inline_size(_context: fidl::encoding::Context) -> usize {
9044            16
9045        }
9046    }
9047
9048    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
9049        unsafe fn encode(
9050            self,
9051            encoder: &mut fidl::encoding::Encoder<'_, D>,
9052            offset: usize,
9053            mut depth: fidl::encoding::Depth,
9054        ) -> fidl::Result<()> {
9055            encoder.debug_check_bounds::<Options>(offset);
9056            // Vector header
9057            let max_ordinal: u64 = self.max_ordinal_present();
9058            encoder.write_num(max_ordinal, offset);
9059            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9060            // Calling encoder.out_of_line_offset(0) is not allowed.
9061            if max_ordinal == 0 {
9062                return Ok(());
9063            }
9064            depth.increment()?;
9065            let envelope_size = 8;
9066            let bytes_len = max_ordinal as usize * envelope_size;
9067            #[allow(unused_variables)]
9068            let offset = encoder.out_of_line_offset(bytes_len);
9069            let mut _prev_end_offset: usize = 0;
9070            if 1 > max_ordinal {
9071                return Ok(());
9072            }
9073
9074            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9075            // are envelope_size bytes.
9076            let cur_offset: usize = (1 - 1) * envelope_size;
9077
9078            // Zero reserved fields.
9079            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9080
9081            // Safety:
9082            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9083            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9084            //   envelope_size bytes, there is always sufficient room.
9085            fidl::encoding::encode_in_envelope_optional::<NodeAttributesQuery, D>(
9086                self.attributes
9087                    .as_ref()
9088                    .map(<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow),
9089                encoder,
9090                offset + cur_offset,
9091                depth,
9092            )?;
9093
9094            _prev_end_offset = cur_offset + envelope_size;
9095            if 2 > max_ordinal {
9096                return Ok(());
9097            }
9098
9099            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9100            // are envelope_size bytes.
9101            let cur_offset: usize = (2 - 1) * envelope_size;
9102
9103            // Zero reserved fields.
9104            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9105
9106            // Safety:
9107            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9108            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9109            //   envelope_size bytes, there is always sufficient room.
9110            fidl::encoding::encode_in_envelope_optional::<MutableNodeAttributes, D>(
9111                self.create_attributes
9112                    .as_ref()
9113                    .map(<MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow),
9114                encoder,
9115                offset + cur_offset,
9116                depth,
9117            )?;
9118
9119            _prev_end_offset = cur_offset + envelope_size;
9120
9121            Ok(())
9122        }
9123    }
9124
9125    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
9126        #[inline(always)]
9127        fn new_empty() -> Self {
9128            Self::default()
9129        }
9130
9131        unsafe fn decode(
9132            &mut self,
9133            decoder: &mut fidl::encoding::Decoder<'_, D>,
9134            offset: usize,
9135            mut depth: fidl::encoding::Depth,
9136        ) -> fidl::Result<()> {
9137            decoder.debug_check_bounds::<Self>(offset);
9138            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9139                None => return Err(fidl::Error::NotNullable),
9140                Some(len) => len,
9141            };
9142            // Calling decoder.out_of_line_offset(0) is not allowed.
9143            if len == 0 {
9144                return Ok(());
9145            };
9146            depth.increment()?;
9147            let envelope_size = 8;
9148            let bytes_len = len * envelope_size;
9149            let offset = decoder.out_of_line_offset(bytes_len)?;
9150            // Decode the envelope for each type.
9151            let mut _next_ordinal_to_read = 0;
9152            let mut next_offset = offset;
9153            let end_offset = offset + bytes_len;
9154            _next_ordinal_to_read += 1;
9155            if next_offset >= end_offset {
9156                return Ok(());
9157            }
9158
9159            // Decode unknown envelopes for gaps in ordinals.
9160            while _next_ordinal_to_read < 1 {
9161                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9162                _next_ordinal_to_read += 1;
9163                next_offset += envelope_size;
9164            }
9165
9166            let next_out_of_line = decoder.next_out_of_line();
9167            let handles_before = decoder.remaining_handles();
9168            if let Some((inlined, num_bytes, num_handles)) =
9169                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9170            {
9171                let member_inline_size =
9172                    <NodeAttributesQuery as fidl::encoding::TypeMarker>::inline_size(
9173                        decoder.context,
9174                    );
9175                if inlined != (member_inline_size <= 4) {
9176                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9177                }
9178                let inner_offset;
9179                let mut inner_depth = depth.clone();
9180                if inlined {
9181                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9182                    inner_offset = next_offset;
9183                } else {
9184                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9185                    inner_depth.increment()?;
9186                }
9187                let val_ref =
9188                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributesQuery, D));
9189                fidl::decode!(NodeAttributesQuery, D, val_ref, decoder, inner_offset, inner_depth)?;
9190                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9191                {
9192                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9193                }
9194                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9195                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9196                }
9197            }
9198
9199            next_offset += envelope_size;
9200            _next_ordinal_to_read += 1;
9201            if next_offset >= end_offset {
9202                return Ok(());
9203            }
9204
9205            // Decode unknown envelopes for gaps in ordinals.
9206            while _next_ordinal_to_read < 2 {
9207                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9208                _next_ordinal_to_read += 1;
9209                next_offset += envelope_size;
9210            }
9211
9212            let next_out_of_line = decoder.next_out_of_line();
9213            let handles_before = decoder.remaining_handles();
9214            if let Some((inlined, num_bytes, num_handles)) =
9215                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9216            {
9217                let member_inline_size =
9218                    <MutableNodeAttributes as fidl::encoding::TypeMarker>::inline_size(
9219                        decoder.context,
9220                    );
9221                if inlined != (member_inline_size <= 4) {
9222                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9223                }
9224                let inner_offset;
9225                let mut inner_depth = depth.clone();
9226                if inlined {
9227                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9228                    inner_offset = next_offset;
9229                } else {
9230                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9231                    inner_depth.increment()?;
9232                }
9233                let val_ref = self
9234                    .create_attributes
9235                    .get_or_insert_with(|| fidl::new_empty!(MutableNodeAttributes, D));
9236                fidl::decode!(
9237                    MutableNodeAttributes,
9238                    D,
9239                    val_ref,
9240                    decoder,
9241                    inner_offset,
9242                    inner_depth
9243                )?;
9244                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9245                {
9246                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9247                }
9248                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9249                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9250                }
9251            }
9252
9253            next_offset += envelope_size;
9254
9255            // Decode the remaining unknown envelopes.
9256            while next_offset < end_offset {
9257                _next_ordinal_to_read += 1;
9258                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9259                next_offset += envelope_size;
9260            }
9261
9262            Ok(())
9263        }
9264    }
9265
9266    impl SymlinkInfo {
9267        #[inline(always)]
9268        fn max_ordinal_present(&self) -> u64 {
9269            if let Some(_) = self.attributes {
9270                return 2;
9271            }
9272            if let Some(_) = self.target {
9273                return 1;
9274            }
9275            0
9276        }
9277    }
9278
9279    impl fidl::encoding::ValueTypeMarker for SymlinkInfo {
9280        type Borrowed<'a> = &'a Self;
9281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9282            value
9283        }
9284    }
9285
9286    unsafe impl fidl::encoding::TypeMarker for SymlinkInfo {
9287        type Owned = Self;
9288
9289        #[inline(always)]
9290        fn inline_align(_context: fidl::encoding::Context) -> usize {
9291            8
9292        }
9293
9294        #[inline(always)]
9295        fn inline_size(_context: fidl::encoding::Context) -> usize {
9296            16
9297        }
9298    }
9299
9300    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SymlinkInfo, D>
9301        for &SymlinkInfo
9302    {
9303        unsafe fn encode(
9304            self,
9305            encoder: &mut fidl::encoding::Encoder<'_, D>,
9306            offset: usize,
9307            mut depth: fidl::encoding::Depth,
9308        ) -> fidl::Result<()> {
9309            encoder.debug_check_bounds::<SymlinkInfo>(offset);
9310            // Vector header
9311            let max_ordinal: u64 = self.max_ordinal_present();
9312            encoder.write_num(max_ordinal, offset);
9313            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9314            // Calling encoder.out_of_line_offset(0) is not allowed.
9315            if max_ordinal == 0 {
9316                return Ok(());
9317            }
9318            depth.increment()?;
9319            let envelope_size = 8;
9320            let bytes_len = max_ordinal as usize * envelope_size;
9321            #[allow(unused_variables)]
9322            let offset = encoder.out_of_line_offset(bytes_len);
9323            let mut _prev_end_offset: usize = 0;
9324            if 1 > max_ordinal {
9325                return Ok(());
9326            }
9327
9328            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9329            // are envelope_size bytes.
9330            let cur_offset: usize = (1 - 1) * envelope_size;
9331
9332            // Zero reserved fields.
9333            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9334
9335            // Safety:
9336            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9337            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9338            //   envelope_size bytes, there is always sufficient room.
9339            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 4095>, D>(
9340                self.target.as_ref().map(
9341                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow,
9342                ),
9343                encoder,
9344                offset + cur_offset,
9345                depth,
9346            )?;
9347
9348            _prev_end_offset = cur_offset + envelope_size;
9349            if 2 > max_ordinal {
9350                return Ok(());
9351            }
9352
9353            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9354            // are envelope_size bytes.
9355            let cur_offset: usize = (2 - 1) * envelope_size;
9356
9357            // Zero reserved fields.
9358            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9359
9360            // Safety:
9361            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9362            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9363            //   envelope_size bytes, there is always sufficient room.
9364            fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
9365                self.attributes
9366                    .as_ref()
9367                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
9368                encoder,
9369                offset + cur_offset,
9370                depth,
9371            )?;
9372
9373            _prev_end_offset = cur_offset + envelope_size;
9374
9375            Ok(())
9376        }
9377    }
9378
9379    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkInfo {
9380        #[inline(always)]
9381        fn new_empty() -> Self {
9382            Self::default()
9383        }
9384
9385        unsafe fn decode(
9386            &mut self,
9387            decoder: &mut fidl::encoding::Decoder<'_, D>,
9388            offset: usize,
9389            mut depth: fidl::encoding::Depth,
9390        ) -> fidl::Result<()> {
9391            decoder.debug_check_bounds::<Self>(offset);
9392            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9393                None => return Err(fidl::Error::NotNullable),
9394                Some(len) => len,
9395            };
9396            // Calling decoder.out_of_line_offset(0) is not allowed.
9397            if len == 0 {
9398                return Ok(());
9399            };
9400            depth.increment()?;
9401            let envelope_size = 8;
9402            let bytes_len = len * envelope_size;
9403            let offset = decoder.out_of_line_offset(bytes_len)?;
9404            // Decode the envelope for each type.
9405            let mut _next_ordinal_to_read = 0;
9406            let mut next_offset = offset;
9407            let end_offset = offset + bytes_len;
9408            _next_ordinal_to_read += 1;
9409            if next_offset >= end_offset {
9410                return Ok(());
9411            }
9412
9413            // Decode unknown envelopes for gaps in ordinals.
9414            while _next_ordinal_to_read < 1 {
9415                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9416                _next_ordinal_to_read += 1;
9417                next_offset += envelope_size;
9418            }
9419
9420            let next_out_of_line = decoder.next_out_of_line();
9421            let handles_before = decoder.remaining_handles();
9422            if let Some((inlined, num_bytes, num_handles)) =
9423                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9424            {
9425                let member_inline_size =
9426                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::TypeMarker>::inline_size(
9427                        decoder.context,
9428                    );
9429                if inlined != (member_inline_size <= 4) {
9430                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9431                }
9432                let inner_offset;
9433                let mut inner_depth = depth.clone();
9434                if inlined {
9435                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9436                    inner_offset = next_offset;
9437                } else {
9438                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9439                    inner_depth.increment()?;
9440                }
9441                let val_ref = self
9442                    .target
9443                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, D));
9444                fidl::decode!(fidl::encoding::Vector<u8, 4095>, D, val_ref, decoder, inner_offset, inner_depth)?;
9445                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9446                {
9447                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9448                }
9449                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9450                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9451                }
9452            }
9453
9454            next_offset += envelope_size;
9455            _next_ordinal_to_read += 1;
9456            if next_offset >= end_offset {
9457                return Ok(());
9458            }
9459
9460            // Decode unknown envelopes for gaps in ordinals.
9461            while _next_ordinal_to_read < 2 {
9462                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9463                _next_ordinal_to_read += 1;
9464                next_offset += envelope_size;
9465            }
9466
9467            let next_out_of_line = decoder.next_out_of_line();
9468            let handles_before = decoder.remaining_handles();
9469            if let Some((inlined, num_bytes, num_handles)) =
9470                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9471            {
9472                let member_inline_size =
9473                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9474                if inlined != (member_inline_size <= 4) {
9475                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9476                }
9477                let inner_offset;
9478                let mut inner_depth = depth.clone();
9479                if inlined {
9480                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9481                    inner_offset = next_offset;
9482                } else {
9483                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9484                    inner_depth.increment()?;
9485                }
9486                let val_ref =
9487                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
9488                fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
9489                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9490                {
9491                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9492                }
9493                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9494                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9495                }
9496            }
9497
9498            next_offset += envelope_size;
9499
9500            // Decode the remaining unknown envelopes.
9501            while next_offset < end_offset {
9502                _next_ordinal_to_read += 1;
9503                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9504                next_offset += envelope_size;
9505            }
9506
9507            Ok(())
9508        }
9509    }
9510
9511    impl UnlinkOptions {
9512        #[inline(always)]
9513        fn max_ordinal_present(&self) -> u64 {
9514            if let Some(_) = self.flags {
9515                return 1;
9516            }
9517            0
9518        }
9519    }
9520
9521    impl fidl::encoding::ValueTypeMarker for UnlinkOptions {
9522        type Borrowed<'a> = &'a Self;
9523        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9524            value
9525        }
9526    }
9527
9528    unsafe impl fidl::encoding::TypeMarker for UnlinkOptions {
9529        type Owned = Self;
9530
9531        #[inline(always)]
9532        fn inline_align(_context: fidl::encoding::Context) -> usize {
9533            8
9534        }
9535
9536        #[inline(always)]
9537        fn inline_size(_context: fidl::encoding::Context) -> usize {
9538            16
9539        }
9540    }
9541
9542    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnlinkOptions, D>
9543        for &UnlinkOptions
9544    {
9545        unsafe fn encode(
9546            self,
9547            encoder: &mut fidl::encoding::Encoder<'_, D>,
9548            offset: usize,
9549            mut depth: fidl::encoding::Depth,
9550        ) -> fidl::Result<()> {
9551            encoder.debug_check_bounds::<UnlinkOptions>(offset);
9552            // Vector header
9553            let max_ordinal: u64 = self.max_ordinal_present();
9554            encoder.write_num(max_ordinal, offset);
9555            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9556            // Calling encoder.out_of_line_offset(0) is not allowed.
9557            if max_ordinal == 0 {
9558                return Ok(());
9559            }
9560            depth.increment()?;
9561            let envelope_size = 8;
9562            let bytes_len = max_ordinal as usize * envelope_size;
9563            #[allow(unused_variables)]
9564            let offset = encoder.out_of_line_offset(bytes_len);
9565            let mut _prev_end_offset: usize = 0;
9566            if 1 > max_ordinal {
9567                return Ok(());
9568            }
9569
9570            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9571            // are envelope_size bytes.
9572            let cur_offset: usize = (1 - 1) * envelope_size;
9573
9574            // Zero reserved fields.
9575            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9576
9577            // Safety:
9578            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9579            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9580            //   envelope_size bytes, there is always sufficient room.
9581            fidl::encoding::encode_in_envelope_optional::<UnlinkFlags, D>(
9582                self.flags.as_ref().map(<UnlinkFlags as fidl::encoding::ValueTypeMarker>::borrow),
9583                encoder,
9584                offset + cur_offset,
9585                depth,
9586            )?;
9587
9588            _prev_end_offset = cur_offset + envelope_size;
9589
9590            Ok(())
9591        }
9592    }
9593
9594    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnlinkOptions {
9595        #[inline(always)]
9596        fn new_empty() -> Self {
9597            Self::default()
9598        }
9599
9600        unsafe fn decode(
9601            &mut self,
9602            decoder: &mut fidl::encoding::Decoder<'_, D>,
9603            offset: usize,
9604            mut depth: fidl::encoding::Depth,
9605        ) -> fidl::Result<()> {
9606            decoder.debug_check_bounds::<Self>(offset);
9607            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9608                None => return Err(fidl::Error::NotNullable),
9609                Some(len) => len,
9610            };
9611            // Calling decoder.out_of_line_offset(0) is not allowed.
9612            if len == 0 {
9613                return Ok(());
9614            };
9615            depth.increment()?;
9616            let envelope_size = 8;
9617            let bytes_len = len * envelope_size;
9618            let offset = decoder.out_of_line_offset(bytes_len)?;
9619            // Decode the envelope for each type.
9620            let mut _next_ordinal_to_read = 0;
9621            let mut next_offset = offset;
9622            let end_offset = offset + bytes_len;
9623            _next_ordinal_to_read += 1;
9624            if next_offset >= end_offset {
9625                return Ok(());
9626            }
9627
9628            // Decode unknown envelopes for gaps in ordinals.
9629            while _next_ordinal_to_read < 1 {
9630                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9631                _next_ordinal_to_read += 1;
9632                next_offset += envelope_size;
9633            }
9634
9635            let next_out_of_line = decoder.next_out_of_line();
9636            let handles_before = decoder.remaining_handles();
9637            if let Some((inlined, num_bytes, num_handles)) =
9638                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9639            {
9640                let member_inline_size =
9641                    <UnlinkFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9642                if inlined != (member_inline_size <= 4) {
9643                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9644                }
9645                let inner_offset;
9646                let mut inner_depth = depth.clone();
9647                if inlined {
9648                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9649                    inner_offset = next_offset;
9650                } else {
9651                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9652                    inner_depth.increment()?;
9653                }
9654                let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(UnlinkFlags, D));
9655                fidl::decode!(UnlinkFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
9656                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9657                {
9658                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9659                }
9660                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9661                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9662                }
9663            }
9664
9665            next_offset += envelope_size;
9666
9667            // Decode the remaining unknown envelopes.
9668            while next_offset < end_offset {
9669                _next_ordinal_to_read += 1;
9670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9671                next_offset += envelope_size;
9672            }
9673
9674            Ok(())
9675        }
9676    }
9677
9678    impl VerificationOptions {
9679        #[inline(always)]
9680        fn max_ordinal_present(&self) -> u64 {
9681            if let Some(_) = self.salt {
9682                return 2;
9683            }
9684            if let Some(_) = self.hash_algorithm {
9685                return 1;
9686            }
9687            0
9688        }
9689    }
9690
9691    impl fidl::encoding::ValueTypeMarker for VerificationOptions {
9692        type Borrowed<'a> = &'a Self;
9693        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9694            value
9695        }
9696    }
9697
9698    unsafe impl fidl::encoding::TypeMarker for VerificationOptions {
9699        type Owned = Self;
9700
9701        #[inline(always)]
9702        fn inline_align(_context: fidl::encoding::Context) -> usize {
9703            8
9704        }
9705
9706        #[inline(always)]
9707        fn inline_size(_context: fidl::encoding::Context) -> usize {
9708            16
9709        }
9710    }
9711
9712    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VerificationOptions, D>
9713        for &VerificationOptions
9714    {
9715        unsafe fn encode(
9716            self,
9717            encoder: &mut fidl::encoding::Encoder<'_, D>,
9718            offset: usize,
9719            mut depth: fidl::encoding::Depth,
9720        ) -> fidl::Result<()> {
9721            encoder.debug_check_bounds::<VerificationOptions>(offset);
9722            // Vector header
9723            let max_ordinal: u64 = self.max_ordinal_present();
9724            encoder.write_num(max_ordinal, offset);
9725            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9726            // Calling encoder.out_of_line_offset(0) is not allowed.
9727            if max_ordinal == 0 {
9728                return Ok(());
9729            }
9730            depth.increment()?;
9731            let envelope_size = 8;
9732            let bytes_len = max_ordinal as usize * envelope_size;
9733            #[allow(unused_variables)]
9734            let offset = encoder.out_of_line_offset(bytes_len);
9735            let mut _prev_end_offset: usize = 0;
9736            if 1 > max_ordinal {
9737                return Ok(());
9738            }
9739
9740            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9741            // are envelope_size bytes.
9742            let cur_offset: usize = (1 - 1) * envelope_size;
9743
9744            // Zero reserved fields.
9745            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9746
9747            // Safety:
9748            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9749            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9750            //   envelope_size bytes, there is always sufficient room.
9751            fidl::encoding::encode_in_envelope_optional::<HashAlgorithm, D>(
9752                self.hash_algorithm
9753                    .as_ref()
9754                    .map(<HashAlgorithm as fidl::encoding::ValueTypeMarker>::borrow),
9755                encoder,
9756                offset + cur_offset,
9757                depth,
9758            )?;
9759
9760            _prev_end_offset = cur_offset + envelope_size;
9761            if 2 > max_ordinal {
9762                return Ok(());
9763            }
9764
9765            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9766            // are envelope_size bytes.
9767            let cur_offset: usize = (2 - 1) * envelope_size;
9768
9769            // Zero reserved fields.
9770            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9771
9772            // Safety:
9773            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9774            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9775            //   envelope_size bytes, there is always sufficient room.
9776            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
9777                self.salt.as_ref().map(
9778                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
9779                ),
9780                encoder,
9781                offset + cur_offset,
9782                depth,
9783            )?;
9784
9785            _prev_end_offset = cur_offset + envelope_size;
9786
9787            Ok(())
9788        }
9789    }
9790
9791    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VerificationOptions {
9792        #[inline(always)]
9793        fn new_empty() -> Self {
9794            Self::default()
9795        }
9796
9797        unsafe fn decode(
9798            &mut self,
9799            decoder: &mut fidl::encoding::Decoder<'_, D>,
9800            offset: usize,
9801            mut depth: fidl::encoding::Depth,
9802        ) -> fidl::Result<()> {
9803            decoder.debug_check_bounds::<Self>(offset);
9804            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9805                None => return Err(fidl::Error::NotNullable),
9806                Some(len) => len,
9807            };
9808            // Calling decoder.out_of_line_offset(0) is not allowed.
9809            if len == 0 {
9810                return Ok(());
9811            };
9812            depth.increment()?;
9813            let envelope_size = 8;
9814            let bytes_len = len * envelope_size;
9815            let offset = decoder.out_of_line_offset(bytes_len)?;
9816            // Decode the envelope for each type.
9817            let mut _next_ordinal_to_read = 0;
9818            let mut next_offset = offset;
9819            let end_offset = offset + bytes_len;
9820            _next_ordinal_to_read += 1;
9821            if next_offset >= end_offset {
9822                return Ok(());
9823            }
9824
9825            // Decode unknown envelopes for gaps in ordinals.
9826            while _next_ordinal_to_read < 1 {
9827                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9828                _next_ordinal_to_read += 1;
9829                next_offset += envelope_size;
9830            }
9831
9832            let next_out_of_line = decoder.next_out_of_line();
9833            let handles_before = decoder.remaining_handles();
9834            if let Some((inlined, num_bytes, num_handles)) =
9835                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9836            {
9837                let member_inline_size =
9838                    <HashAlgorithm as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9839                if inlined != (member_inline_size <= 4) {
9840                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9841                }
9842                let inner_offset;
9843                let mut inner_depth = depth.clone();
9844                if inlined {
9845                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9846                    inner_offset = next_offset;
9847                } else {
9848                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9849                    inner_depth.increment()?;
9850                }
9851                let val_ref =
9852                    self.hash_algorithm.get_or_insert_with(|| fidl::new_empty!(HashAlgorithm, D));
9853                fidl::decode!(HashAlgorithm, D, val_ref, decoder, inner_offset, inner_depth)?;
9854                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9855                {
9856                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9857                }
9858                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9859                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9860                }
9861            }
9862
9863            next_offset += envelope_size;
9864            _next_ordinal_to_read += 1;
9865            if next_offset >= end_offset {
9866                return Ok(());
9867            }
9868
9869            // Decode unknown envelopes for gaps in ordinals.
9870            while _next_ordinal_to_read < 2 {
9871                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9872                _next_ordinal_to_read += 1;
9873                next_offset += envelope_size;
9874            }
9875
9876            let next_out_of_line = decoder.next_out_of_line();
9877            let handles_before = decoder.remaining_handles();
9878            if let Some((inlined, num_bytes, num_handles)) =
9879                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9880            {
9881                let member_inline_size =
9882                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
9883                        decoder.context,
9884                    );
9885                if inlined != (member_inline_size <= 4) {
9886                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9887                }
9888                let inner_offset;
9889                let mut inner_depth = depth.clone();
9890                if inlined {
9891                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9892                    inner_offset = next_offset;
9893                } else {
9894                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9895                    inner_depth.increment()?;
9896                }
9897                let val_ref = self
9898                    .salt
9899                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
9900                fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
9901                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9902                {
9903                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9904                }
9905                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9906                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9907                }
9908            }
9909
9910            next_offset += envelope_size;
9911
9912            // Decode the remaining unknown envelopes.
9913            while next_offset < end_offset {
9914                _next_ordinal_to_read += 1;
9915                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9916                next_offset += envelope_size;
9917            }
9918
9919            Ok(())
9920        }
9921    }
9922
9923    impl fidl::encoding::ValueTypeMarker for SelinuxContext {
9924        type Borrowed<'a> = &'a Self;
9925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9926            value
9927        }
9928    }
9929
9930    unsafe impl fidl::encoding::TypeMarker for SelinuxContext {
9931        type Owned = Self;
9932
9933        #[inline(always)]
9934        fn inline_align(_context: fidl::encoding::Context) -> usize {
9935            8
9936        }
9937
9938        #[inline(always)]
9939        fn inline_size(_context: fidl::encoding::Context) -> usize {
9940            16
9941        }
9942    }
9943
9944    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SelinuxContext, D>
9945        for &SelinuxContext
9946    {
9947        #[inline]
9948        unsafe fn encode(
9949            self,
9950            encoder: &mut fidl::encoding::Encoder<'_, D>,
9951            offset: usize,
9952            _depth: fidl::encoding::Depth,
9953        ) -> fidl::Result<()> {
9954            encoder.debug_check_bounds::<SelinuxContext>(offset);
9955            encoder.write_num::<u64>(self.ordinal(), offset);
9956            match self {
9957                SelinuxContext::Data(ref val) => fidl::encoding::encode_in_envelope::<
9958                    fidl::encoding::Vector<u8, 256>,
9959                    D,
9960                >(
9961                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(
9962                        val,
9963                    ),
9964                    encoder,
9965                    offset + 8,
9966                    _depth,
9967                ),
9968                SelinuxContext::UseExtendedAttributes(ref val) => {
9969                    fidl::encoding::encode_in_envelope::<EmptyStruct, D>(
9970                        <EmptyStruct as fidl::encoding::ValueTypeMarker>::borrow(val),
9971                        encoder,
9972                        offset + 8,
9973                        _depth,
9974                    )
9975                }
9976                SelinuxContext::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
9977            }
9978        }
9979    }
9980
9981    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SelinuxContext {
9982        #[inline(always)]
9983        fn new_empty() -> Self {
9984            Self::__SourceBreaking { unknown_ordinal: 0 }
9985        }
9986
9987        #[inline]
9988        unsafe fn decode(
9989            &mut self,
9990            decoder: &mut fidl::encoding::Decoder<'_, D>,
9991            offset: usize,
9992            mut depth: fidl::encoding::Depth,
9993        ) -> fidl::Result<()> {
9994            decoder.debug_check_bounds::<Self>(offset);
9995            #[allow(unused_variables)]
9996            let next_out_of_line = decoder.next_out_of_line();
9997            let handles_before = decoder.remaining_handles();
9998            let (ordinal, inlined, num_bytes, num_handles) =
9999                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10000
10001            let member_inline_size = match ordinal {
10002                1 => <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
10003                    decoder.context,
10004                ),
10005                2 => <EmptyStruct as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10006                0 => return Err(fidl::Error::UnknownUnionTag),
10007                _ => num_bytes as usize,
10008            };
10009
10010            if inlined != (member_inline_size <= 4) {
10011                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10012            }
10013            let _inner_offset;
10014            if inlined {
10015                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10016                _inner_offset = offset + 8;
10017            } else {
10018                depth.increment()?;
10019                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10020            }
10021            match ordinal {
10022                1 => {
10023                    #[allow(irrefutable_let_patterns)]
10024                    if let SelinuxContext::Data(_) = self {
10025                        // Do nothing, read the value into the object
10026                    } else {
10027                        // Initialize `self` to the right variant
10028                        *self = SelinuxContext::Data(
10029                            fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D),
10030                        );
10031                    }
10032                    #[allow(irrefutable_let_patterns)]
10033                    if let SelinuxContext::Data(ref mut val) = self {
10034                        fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val, decoder, _inner_offset, depth)?;
10035                    } else {
10036                        unreachable!()
10037                    }
10038                }
10039                2 => {
10040                    #[allow(irrefutable_let_patterns)]
10041                    if let SelinuxContext::UseExtendedAttributes(_) = self {
10042                        // Do nothing, read the value into the object
10043                    } else {
10044                        // Initialize `self` to the right variant
10045                        *self =
10046                            SelinuxContext::UseExtendedAttributes(fidl::new_empty!(EmptyStruct, D));
10047                    }
10048                    #[allow(irrefutable_let_patterns)]
10049                    if let SelinuxContext::UseExtendedAttributes(ref mut val) = self {
10050                        fidl::decode!(EmptyStruct, D, val, decoder, _inner_offset, depth)?;
10051                    } else {
10052                        unreachable!()
10053                    }
10054                }
10055                #[allow(deprecated)]
10056                ordinal => {
10057                    for _ in 0..num_handles {
10058                        decoder.drop_next_handle()?;
10059                    }
10060                    *self = SelinuxContext::__SourceBreaking { unknown_ordinal: ordinal };
10061                }
10062            }
10063            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10064                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10065            }
10066            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10067                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10068            }
10069            Ok(())
10070        }
10071    }
10072}