Skip to main content

fidl_fuchsia_io_common/
fidl_fuchsia_io_common.rs

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