fidl_fuchsia_io__common/
fidl_fuchsia_io__common.rs

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