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