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