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>
4615        for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
4616    {
4617        #[inline]
4618        unsafe fn encode(
4619            self,
4620            encoder: &mut fidl::encoding::Encoder<'_, D>,
4621            offset: usize,
4622            depth: fidl::encoding::Depth,
4623        ) -> fidl::Result<()> {
4624            encoder.debug_check_bounds::<FilesystemInfo>(offset);
4625            // Zero out padding regions. There's no need to apply masks
4626            // because the unmasked parts will be overwritten by fields.
4627            // Write the fields.
4628            self.0.encode(encoder, offset + 0, depth)?;
4629            self.1.encode(encoder, offset + 8, depth)?;
4630            self.2.encode(encoder, offset + 16, depth)?;
4631            self.3.encode(encoder, offset + 24, depth)?;
4632            self.4.encode(encoder, offset + 32, depth)?;
4633            self.5.encode(encoder, offset + 40, depth)?;
4634            self.6.encode(encoder, offset + 48, depth)?;
4635            self.7.encode(encoder, offset + 52, depth)?;
4636            self.8.encode(encoder, offset + 56, depth)?;
4637            self.9.encode(encoder, offset + 60, depth)?;
4638            self.10.encode(encoder, offset + 64, depth)?;
4639            Ok(())
4640        }
4641    }
4642
4643    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilesystemInfo {
4644        #[inline(always)]
4645        fn new_empty() -> Self {
4646            Self {
4647                total_bytes: fidl::new_empty!(u64, D),
4648                used_bytes: fidl::new_empty!(u64, D),
4649                total_nodes: fidl::new_empty!(u64, D),
4650                used_nodes: fidl::new_empty!(u64, D),
4651                free_shared_pool_bytes: fidl::new_empty!(u64, D),
4652                fs_id: fidl::new_empty!(u64, D),
4653                block_size: fidl::new_empty!(u32, D),
4654                max_filename_size: fidl::new_empty!(u32, D),
4655                fs_type: fidl::new_empty!(u32, D),
4656                padding: fidl::new_empty!(u32, D),
4657                name: fidl::new_empty!(fidl::encoding::Array<i8, 32>, D),
4658            }
4659        }
4660
4661        #[inline]
4662        unsafe fn decode(
4663            &mut self,
4664            decoder: &mut fidl::encoding::Decoder<'_, D>,
4665            offset: usize,
4666            _depth: fidl::encoding::Depth,
4667        ) -> fidl::Result<()> {
4668            decoder.debug_check_bounds::<Self>(offset);
4669            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4670            // Verify that padding bytes are zero.
4671            // Copy from the buffer into the object.
4672            unsafe {
4673                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 96);
4674            }
4675            Ok(())
4676        }
4677    }
4678
4679    impl fidl::encoding::ValueTypeMarker for NodeAttributes {
4680        type Borrowed<'a> = &'a Self;
4681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4682            value
4683        }
4684    }
4685
4686    unsafe impl fidl::encoding::TypeMarker for NodeAttributes {
4687        type Owned = Self;
4688
4689        #[inline(always)]
4690        fn inline_align(_context: fidl::encoding::Context) -> usize {
4691            8
4692        }
4693
4694        #[inline(always)]
4695        fn inline_size(_context: fidl::encoding::Context) -> usize {
4696            56
4697        }
4698    }
4699
4700    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeAttributes, D>
4701        for &NodeAttributes
4702    {
4703        #[inline]
4704        unsafe fn encode(
4705            self,
4706            encoder: &mut fidl::encoding::Encoder<'_, D>,
4707            offset: usize,
4708            _depth: fidl::encoding::Depth,
4709        ) -> fidl::Result<()> {
4710            encoder.debug_check_bounds::<NodeAttributes>(offset);
4711            unsafe {
4712                // Copy the object into the buffer.
4713                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4714                (buf_ptr as *mut NodeAttributes)
4715                    .write_unaligned((self as *const NodeAttributes).read());
4716                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4717                // done second because the memcpy will write garbage to these bytes.
4718                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4719                let padding_mask = 0xffffffff00000000u64;
4720                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4721            }
4722            Ok(())
4723        }
4724    }
4725    unsafe impl<
4726            D: fidl::encoding::ResourceDialect,
4727            T0: fidl::encoding::Encode<u32, D>,
4728            T1: fidl::encoding::Encode<u64, D>,
4729            T2: fidl::encoding::Encode<u64, D>,
4730            T3: fidl::encoding::Encode<u64, D>,
4731            T4: fidl::encoding::Encode<u64, D>,
4732            T5: fidl::encoding::Encode<u64, D>,
4733            T6: fidl::encoding::Encode<u64, D>,
4734        > fidl::encoding::Encode<NodeAttributes, D> for (T0, T1, T2, T3, T4, T5, T6)
4735    {
4736        #[inline]
4737        unsafe fn encode(
4738            self,
4739            encoder: &mut fidl::encoding::Encoder<'_, D>,
4740            offset: usize,
4741            depth: fidl::encoding::Depth,
4742        ) -> fidl::Result<()> {
4743            encoder.debug_check_bounds::<NodeAttributes>(offset);
4744            // Zero out padding regions. There's no need to apply masks
4745            // because the unmasked parts will be overwritten by fields.
4746            unsafe {
4747                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4748                (ptr as *mut u64).write_unaligned(0);
4749            }
4750            // Write the fields.
4751            self.0.encode(encoder, offset + 0, depth)?;
4752            self.1.encode(encoder, offset + 8, depth)?;
4753            self.2.encode(encoder, offset + 16, depth)?;
4754            self.3.encode(encoder, offset + 24, depth)?;
4755            self.4.encode(encoder, offset + 32, depth)?;
4756            self.5.encode(encoder, offset + 40, depth)?;
4757            self.6.encode(encoder, offset + 48, depth)?;
4758            Ok(())
4759        }
4760    }
4761
4762    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributes {
4763        #[inline(always)]
4764        fn new_empty() -> Self {
4765            Self {
4766                mode: fidl::new_empty!(u32, D),
4767                id: fidl::new_empty!(u64, D),
4768                content_size: fidl::new_empty!(u64, D),
4769                storage_size: fidl::new_empty!(u64, D),
4770                link_count: fidl::new_empty!(u64, D),
4771                creation_time: fidl::new_empty!(u64, D),
4772                modification_time: fidl::new_empty!(u64, D),
4773            }
4774        }
4775
4776        #[inline]
4777        unsafe fn decode(
4778            &mut self,
4779            decoder: &mut fidl::encoding::Decoder<'_, D>,
4780            offset: usize,
4781            _depth: fidl::encoding::Depth,
4782        ) -> fidl::Result<()> {
4783            decoder.debug_check_bounds::<Self>(offset);
4784            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4785            // Verify that padding bytes are zero.
4786            let ptr = unsafe { buf_ptr.offset(0) };
4787            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4788            let mask = 0xffffffff00000000u64;
4789            let maskedval = padval & mask;
4790            if maskedval != 0 {
4791                return Err(fidl::Error::NonZeroPadding {
4792                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4793                });
4794            }
4795            // Copy from the buffer into the object.
4796            unsafe {
4797                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
4798            }
4799            Ok(())
4800        }
4801    }
4802
4803    impl fidl::encoding::ValueTypeMarker for NodeAttributes2 {
4804        type Borrowed<'a> = &'a Self;
4805        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4806            value
4807        }
4808    }
4809
4810    unsafe impl fidl::encoding::TypeMarker for NodeAttributes2 {
4811        type Owned = Self;
4812
4813        #[inline(always)]
4814        fn inline_align(_context: fidl::encoding::Context) -> usize {
4815            8
4816        }
4817
4818        #[inline(always)]
4819        fn inline_size(_context: fidl::encoding::Context) -> usize {
4820            32
4821        }
4822    }
4823
4824    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeAttributes2, D>
4825        for &NodeAttributes2
4826    {
4827        #[inline]
4828        unsafe fn encode(
4829            self,
4830            encoder: &mut fidl::encoding::Encoder<'_, D>,
4831            offset: usize,
4832            _depth: fidl::encoding::Depth,
4833        ) -> fidl::Result<()> {
4834            encoder.debug_check_bounds::<NodeAttributes2>(offset);
4835            // Delegate to tuple encoding.
4836            fidl::encoding::Encode::<NodeAttributes2, D>::encode(
4837                (
4838                    <MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(
4839                        &self.mutable_attributes,
4840                    ),
4841                    <ImmutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(
4842                        &self.immutable_attributes,
4843                    ),
4844                ),
4845                encoder,
4846                offset,
4847                _depth,
4848            )
4849        }
4850    }
4851    unsafe impl<
4852            D: fidl::encoding::ResourceDialect,
4853            T0: fidl::encoding::Encode<MutableNodeAttributes, D>,
4854            T1: fidl::encoding::Encode<ImmutableNodeAttributes, D>,
4855        > fidl::encoding::Encode<NodeAttributes2, D> for (T0, T1)
4856    {
4857        #[inline]
4858        unsafe fn encode(
4859            self,
4860            encoder: &mut fidl::encoding::Encoder<'_, D>,
4861            offset: usize,
4862            depth: fidl::encoding::Depth,
4863        ) -> fidl::Result<()> {
4864            encoder.debug_check_bounds::<NodeAttributes2>(offset);
4865            // Zero out padding regions. There's no need to apply masks
4866            // because the unmasked parts will be overwritten by fields.
4867            // Write the fields.
4868            self.0.encode(encoder, offset + 0, depth)?;
4869            self.1.encode(encoder, offset + 16, depth)?;
4870            Ok(())
4871        }
4872    }
4873
4874    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributes2 {
4875        #[inline(always)]
4876        fn new_empty() -> Self {
4877            Self {
4878                mutable_attributes: fidl::new_empty!(MutableNodeAttributes, D),
4879                immutable_attributes: fidl::new_empty!(ImmutableNodeAttributes, D),
4880            }
4881        }
4882
4883        #[inline]
4884        unsafe fn decode(
4885            &mut self,
4886            decoder: &mut fidl::encoding::Decoder<'_, D>,
4887            offset: usize,
4888            _depth: fidl::encoding::Depth,
4889        ) -> fidl::Result<()> {
4890            decoder.debug_check_bounds::<Self>(offset);
4891            // Verify that padding bytes are zero.
4892            fidl::decode!(
4893                MutableNodeAttributes,
4894                D,
4895                &mut self.mutable_attributes,
4896                decoder,
4897                offset + 0,
4898                _depth
4899            )?;
4900            fidl::decode!(
4901                ImmutableNodeAttributes,
4902                D,
4903                &mut self.immutable_attributes,
4904                decoder,
4905                offset + 16,
4906                _depth
4907            )?;
4908            Ok(())
4909        }
4910    }
4911
4912    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedGetAttrResponse {
4913        type Borrowed<'a> = &'a Self;
4914        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4915            value
4916        }
4917    }
4918
4919    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedGetAttrResponse {
4920        type Owned = Self;
4921
4922        #[inline(always)]
4923        fn inline_align(_context: fidl::encoding::Context) -> usize {
4924            8
4925        }
4926
4927        #[inline(always)]
4928        fn inline_size(_context: fidl::encoding::Context) -> usize {
4929            64
4930        }
4931    }
4932
4933    unsafe impl<D: fidl::encoding::ResourceDialect>
4934        fidl::encoding::Encode<NodeDeprecatedGetAttrResponse, D>
4935        for &NodeDeprecatedGetAttrResponse
4936    {
4937        #[inline]
4938        unsafe fn encode(
4939            self,
4940            encoder: &mut fidl::encoding::Encoder<'_, D>,
4941            offset: usize,
4942            _depth: fidl::encoding::Depth,
4943        ) -> fidl::Result<()> {
4944            encoder.debug_check_bounds::<NodeDeprecatedGetAttrResponse>(offset);
4945            unsafe {
4946                // Copy the object into the buffer.
4947                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4948                (buf_ptr as *mut NodeDeprecatedGetAttrResponse)
4949                    .write_unaligned((self as *const NodeDeprecatedGetAttrResponse).read());
4950                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4951                // done second because the memcpy will write garbage to these bytes.
4952                let padding_ptr = buf_ptr.offset(0) as *mut u64;
4953                let padding_mask = 0xffffffff00000000u64;
4954                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4955                let padding_ptr = buf_ptr.offset(8) as *mut u64;
4956                let padding_mask = 0xffffffff00000000u64;
4957                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4958            }
4959            Ok(())
4960        }
4961    }
4962    unsafe impl<
4963            D: fidl::encoding::ResourceDialect,
4964            T0: fidl::encoding::Encode<i32, D>,
4965            T1: fidl::encoding::Encode<NodeAttributes, D>,
4966        > fidl::encoding::Encode<NodeDeprecatedGetAttrResponse, D> for (T0, T1)
4967    {
4968        #[inline]
4969        unsafe fn encode(
4970            self,
4971            encoder: &mut fidl::encoding::Encoder<'_, D>,
4972            offset: usize,
4973            depth: fidl::encoding::Depth,
4974        ) -> fidl::Result<()> {
4975            encoder.debug_check_bounds::<NodeDeprecatedGetAttrResponse>(offset);
4976            // Zero out padding regions. There's no need to apply masks
4977            // because the unmasked parts will be overwritten by fields.
4978            unsafe {
4979                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4980                (ptr as *mut u64).write_unaligned(0);
4981            }
4982            // Write the fields.
4983            self.0.encode(encoder, offset + 0, depth)?;
4984            self.1.encode(encoder, offset + 8, depth)?;
4985            Ok(())
4986        }
4987    }
4988
4989    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4990        for NodeDeprecatedGetAttrResponse
4991    {
4992        #[inline(always)]
4993        fn new_empty() -> Self {
4994            Self { s: fidl::new_empty!(i32, D), attributes: fidl::new_empty!(NodeAttributes, D) }
4995        }
4996
4997        #[inline]
4998        unsafe fn decode(
4999            &mut self,
5000            decoder: &mut fidl::encoding::Decoder<'_, D>,
5001            offset: usize,
5002            _depth: fidl::encoding::Depth,
5003        ) -> fidl::Result<()> {
5004            decoder.debug_check_bounds::<Self>(offset);
5005            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5006            // Verify that padding bytes are zero.
5007            let ptr = unsafe { buf_ptr.offset(0) };
5008            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5009            let mask = 0xffffffff00000000u64;
5010            let maskedval = padval & mask;
5011            if maskedval != 0 {
5012                return Err(fidl::Error::NonZeroPadding {
5013                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5014                });
5015            }
5016            let ptr = unsafe { buf_ptr.offset(8) };
5017            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5018            let mask = 0xffffffff00000000u64;
5019            let maskedval = padval & mask;
5020            if maskedval != 0 {
5021                return Err(fidl::Error::NonZeroPadding {
5022                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5023                });
5024            }
5025            // Copy from the buffer into the object.
5026            unsafe {
5027                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 64);
5028            }
5029            Ok(())
5030        }
5031    }
5032
5033    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedGetFlagsResponse {
5034        type Borrowed<'a> = &'a Self;
5035        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5036            value
5037        }
5038    }
5039
5040    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedGetFlagsResponse {
5041        type Owned = Self;
5042
5043        #[inline(always)]
5044        fn inline_align(_context: fidl::encoding::Context) -> usize {
5045            4
5046        }
5047
5048        #[inline(always)]
5049        fn inline_size(_context: fidl::encoding::Context) -> usize {
5050            8
5051        }
5052    }
5053
5054    unsafe impl<D: fidl::encoding::ResourceDialect>
5055        fidl::encoding::Encode<NodeDeprecatedGetFlagsResponse, D>
5056        for &NodeDeprecatedGetFlagsResponse
5057    {
5058        #[inline]
5059        unsafe fn encode(
5060            self,
5061            encoder: &mut fidl::encoding::Encoder<'_, D>,
5062            offset: usize,
5063            _depth: fidl::encoding::Depth,
5064        ) -> fidl::Result<()> {
5065            encoder.debug_check_bounds::<NodeDeprecatedGetFlagsResponse>(offset);
5066            // Delegate to tuple encoding.
5067            fidl::encoding::Encode::<NodeDeprecatedGetFlagsResponse, D>::encode(
5068                (
5069                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
5070                    <OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
5071                ),
5072                encoder,
5073                offset,
5074                _depth,
5075            )
5076        }
5077    }
5078    unsafe impl<
5079            D: fidl::encoding::ResourceDialect,
5080            T0: fidl::encoding::Encode<i32, D>,
5081            T1: fidl::encoding::Encode<OpenFlags, D>,
5082        > fidl::encoding::Encode<NodeDeprecatedGetFlagsResponse, D> for (T0, T1)
5083    {
5084        #[inline]
5085        unsafe fn encode(
5086            self,
5087            encoder: &mut fidl::encoding::Encoder<'_, D>,
5088            offset: usize,
5089            depth: fidl::encoding::Depth,
5090        ) -> fidl::Result<()> {
5091            encoder.debug_check_bounds::<NodeDeprecatedGetFlagsResponse>(offset);
5092            // Zero out padding regions. There's no need to apply masks
5093            // because the unmasked parts will be overwritten by fields.
5094            // Write the fields.
5095            self.0.encode(encoder, offset + 0, depth)?;
5096            self.1.encode(encoder, offset + 4, depth)?;
5097            Ok(())
5098        }
5099    }
5100
5101    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5102        for NodeDeprecatedGetFlagsResponse
5103    {
5104        #[inline(always)]
5105        fn new_empty() -> Self {
5106            Self { s: fidl::new_empty!(i32, D), flags: fidl::new_empty!(OpenFlags, D) }
5107        }
5108
5109        #[inline]
5110        unsafe fn decode(
5111            &mut self,
5112            decoder: &mut fidl::encoding::Decoder<'_, D>,
5113            offset: usize,
5114            _depth: fidl::encoding::Depth,
5115        ) -> fidl::Result<()> {
5116            decoder.debug_check_bounds::<Self>(offset);
5117            // Verify that padding bytes are zero.
5118            fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
5119            fidl::decode!(OpenFlags, D, &mut self.flags, decoder, offset + 4, _depth)?;
5120            Ok(())
5121        }
5122    }
5123
5124    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetAttrRequest {
5125        type Borrowed<'a> = &'a Self;
5126        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5127            value
5128        }
5129    }
5130
5131    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetAttrRequest {
5132        type Owned = Self;
5133
5134        #[inline(always)]
5135        fn inline_align(_context: fidl::encoding::Context) -> usize {
5136            8
5137        }
5138
5139        #[inline(always)]
5140        fn inline_size(_context: fidl::encoding::Context) -> usize {
5141            64
5142        }
5143    }
5144
5145    unsafe impl<D: fidl::encoding::ResourceDialect>
5146        fidl::encoding::Encode<NodeDeprecatedSetAttrRequest, D> for &NodeDeprecatedSetAttrRequest
5147    {
5148        #[inline]
5149        unsafe fn encode(
5150            self,
5151            encoder: &mut fidl::encoding::Encoder<'_, D>,
5152            offset: usize,
5153            _depth: fidl::encoding::Depth,
5154        ) -> fidl::Result<()> {
5155            encoder.debug_check_bounds::<NodeDeprecatedSetAttrRequest>(offset);
5156            // Delegate to tuple encoding.
5157            fidl::encoding::Encode::<NodeDeprecatedSetAttrRequest, D>::encode(
5158                (
5159                    <NodeAttributeFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
5160                    <NodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
5161                ),
5162                encoder,
5163                offset,
5164                _depth,
5165            )
5166        }
5167    }
5168    unsafe impl<
5169            D: fidl::encoding::ResourceDialect,
5170            T0: fidl::encoding::Encode<NodeAttributeFlags, D>,
5171            T1: fidl::encoding::Encode<NodeAttributes, D>,
5172        > fidl::encoding::Encode<NodeDeprecatedSetAttrRequest, D> for (T0, T1)
5173    {
5174        #[inline]
5175        unsafe fn encode(
5176            self,
5177            encoder: &mut fidl::encoding::Encoder<'_, D>,
5178            offset: usize,
5179            depth: fidl::encoding::Depth,
5180        ) -> fidl::Result<()> {
5181            encoder.debug_check_bounds::<NodeDeprecatedSetAttrRequest>(offset);
5182            // Zero out padding regions. There's no need to apply masks
5183            // because the unmasked parts will be overwritten by fields.
5184            unsafe {
5185                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5186                (ptr as *mut u64).write_unaligned(0);
5187            }
5188            // Write the fields.
5189            self.0.encode(encoder, offset + 0, depth)?;
5190            self.1.encode(encoder, offset + 8, depth)?;
5191            Ok(())
5192        }
5193    }
5194
5195    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5196        for NodeDeprecatedSetAttrRequest
5197    {
5198        #[inline(always)]
5199        fn new_empty() -> Self {
5200            Self {
5201                flags: fidl::new_empty!(NodeAttributeFlags, D),
5202                attributes: fidl::new_empty!(NodeAttributes, D),
5203            }
5204        }
5205
5206        #[inline]
5207        unsafe fn decode(
5208            &mut self,
5209            decoder: &mut fidl::encoding::Decoder<'_, D>,
5210            offset: usize,
5211            _depth: fidl::encoding::Depth,
5212        ) -> fidl::Result<()> {
5213            decoder.debug_check_bounds::<Self>(offset);
5214            // Verify that padding bytes are zero.
5215            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5216            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5217            let mask = 0xffffffff00000000u64;
5218            let maskedval = padval & mask;
5219            if maskedval != 0 {
5220                return Err(fidl::Error::NonZeroPadding {
5221                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5222                });
5223            }
5224            fidl::decode!(NodeAttributeFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
5225            fidl::decode!(NodeAttributes, D, &mut self.attributes, decoder, offset + 8, _depth)?;
5226            Ok(())
5227        }
5228    }
5229
5230    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetAttrResponse {
5231        type Borrowed<'a> = &'a Self;
5232        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5233            value
5234        }
5235    }
5236
5237    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetAttrResponse {
5238        type Owned = Self;
5239
5240        #[inline(always)]
5241        fn inline_align(_context: fidl::encoding::Context) -> usize {
5242            4
5243        }
5244
5245        #[inline(always)]
5246        fn inline_size(_context: fidl::encoding::Context) -> usize {
5247            4
5248        }
5249        #[inline(always)]
5250        fn encode_is_copy() -> bool {
5251            true
5252        }
5253
5254        #[inline(always)]
5255        fn decode_is_copy() -> bool {
5256            true
5257        }
5258    }
5259
5260    unsafe impl<D: fidl::encoding::ResourceDialect>
5261        fidl::encoding::Encode<NodeDeprecatedSetAttrResponse, D>
5262        for &NodeDeprecatedSetAttrResponse
5263    {
5264        #[inline]
5265        unsafe fn encode(
5266            self,
5267            encoder: &mut fidl::encoding::Encoder<'_, D>,
5268            offset: usize,
5269            _depth: fidl::encoding::Depth,
5270        ) -> fidl::Result<()> {
5271            encoder.debug_check_bounds::<NodeDeprecatedSetAttrResponse>(offset);
5272            unsafe {
5273                // Copy the object into the buffer.
5274                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5275                (buf_ptr as *mut NodeDeprecatedSetAttrResponse)
5276                    .write_unaligned((self as *const NodeDeprecatedSetAttrResponse).read());
5277                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5278                // done second because the memcpy will write garbage to these bytes.
5279            }
5280            Ok(())
5281        }
5282    }
5283    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
5284        fidl::encoding::Encode<NodeDeprecatedSetAttrResponse, D> for (T0,)
5285    {
5286        #[inline]
5287        unsafe fn encode(
5288            self,
5289            encoder: &mut fidl::encoding::Encoder<'_, D>,
5290            offset: usize,
5291            depth: fidl::encoding::Depth,
5292        ) -> fidl::Result<()> {
5293            encoder.debug_check_bounds::<NodeDeprecatedSetAttrResponse>(offset);
5294            // Zero out padding regions. There's no need to apply masks
5295            // because the unmasked parts will be overwritten by fields.
5296            // Write the fields.
5297            self.0.encode(encoder, offset + 0, depth)?;
5298            Ok(())
5299        }
5300    }
5301
5302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5303        for NodeDeprecatedSetAttrResponse
5304    {
5305        #[inline(always)]
5306        fn new_empty() -> Self {
5307            Self { s: fidl::new_empty!(i32, D) }
5308        }
5309
5310        #[inline]
5311        unsafe fn decode(
5312            &mut self,
5313            decoder: &mut fidl::encoding::Decoder<'_, D>,
5314            offset: usize,
5315            _depth: fidl::encoding::Depth,
5316        ) -> fidl::Result<()> {
5317            decoder.debug_check_bounds::<Self>(offset);
5318            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5319            // Verify that padding bytes are zero.
5320            // Copy from the buffer into the object.
5321            unsafe {
5322                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5323            }
5324            Ok(())
5325        }
5326    }
5327
5328    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetFlagsRequest {
5329        type Borrowed<'a> = &'a Self;
5330        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5331            value
5332        }
5333    }
5334
5335    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetFlagsRequest {
5336        type Owned = Self;
5337
5338        #[inline(always)]
5339        fn inline_align(_context: fidl::encoding::Context) -> usize {
5340            4
5341        }
5342
5343        #[inline(always)]
5344        fn inline_size(_context: fidl::encoding::Context) -> usize {
5345            4
5346        }
5347    }
5348
5349    unsafe impl<D: fidl::encoding::ResourceDialect>
5350        fidl::encoding::Encode<NodeDeprecatedSetFlagsRequest, D>
5351        for &NodeDeprecatedSetFlagsRequest
5352    {
5353        #[inline]
5354        unsafe fn encode(
5355            self,
5356            encoder: &mut fidl::encoding::Encoder<'_, D>,
5357            offset: usize,
5358            _depth: fidl::encoding::Depth,
5359        ) -> fidl::Result<()> {
5360            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsRequest>(offset);
5361            // Delegate to tuple encoding.
5362            fidl::encoding::Encode::<NodeDeprecatedSetFlagsRequest, D>::encode(
5363                (<OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
5364                encoder,
5365                offset,
5366                _depth,
5367            )
5368        }
5369    }
5370    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OpenFlags, D>>
5371        fidl::encoding::Encode<NodeDeprecatedSetFlagsRequest, D> for (T0,)
5372    {
5373        #[inline]
5374        unsafe fn encode(
5375            self,
5376            encoder: &mut fidl::encoding::Encoder<'_, D>,
5377            offset: usize,
5378            depth: fidl::encoding::Depth,
5379        ) -> fidl::Result<()> {
5380            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsRequest>(offset);
5381            // Zero out padding regions. There's no need to apply masks
5382            // because the unmasked parts will be overwritten by fields.
5383            // Write the fields.
5384            self.0.encode(encoder, offset + 0, depth)?;
5385            Ok(())
5386        }
5387    }
5388
5389    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5390        for NodeDeprecatedSetFlagsRequest
5391    {
5392        #[inline(always)]
5393        fn new_empty() -> Self {
5394            Self { flags: fidl::new_empty!(OpenFlags, D) }
5395        }
5396
5397        #[inline]
5398        unsafe fn decode(
5399            &mut self,
5400            decoder: &mut fidl::encoding::Decoder<'_, D>,
5401            offset: usize,
5402            _depth: fidl::encoding::Depth,
5403        ) -> fidl::Result<()> {
5404            decoder.debug_check_bounds::<Self>(offset);
5405            // Verify that padding bytes are zero.
5406            fidl::decode!(OpenFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
5407            Ok(())
5408        }
5409    }
5410
5411    impl fidl::encoding::ValueTypeMarker for NodeDeprecatedSetFlagsResponse {
5412        type Borrowed<'a> = &'a Self;
5413        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5414            value
5415        }
5416    }
5417
5418    unsafe impl fidl::encoding::TypeMarker for NodeDeprecatedSetFlagsResponse {
5419        type Owned = Self;
5420
5421        #[inline(always)]
5422        fn inline_align(_context: fidl::encoding::Context) -> usize {
5423            4
5424        }
5425
5426        #[inline(always)]
5427        fn inline_size(_context: fidl::encoding::Context) -> usize {
5428            4
5429        }
5430        #[inline(always)]
5431        fn encode_is_copy() -> bool {
5432            true
5433        }
5434
5435        #[inline(always)]
5436        fn decode_is_copy() -> bool {
5437            true
5438        }
5439    }
5440
5441    unsafe impl<D: fidl::encoding::ResourceDialect>
5442        fidl::encoding::Encode<NodeDeprecatedSetFlagsResponse, D>
5443        for &NodeDeprecatedSetFlagsResponse
5444    {
5445        #[inline]
5446        unsafe fn encode(
5447            self,
5448            encoder: &mut fidl::encoding::Encoder<'_, D>,
5449            offset: usize,
5450            _depth: fidl::encoding::Depth,
5451        ) -> fidl::Result<()> {
5452            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsResponse>(offset);
5453            unsafe {
5454                // Copy the object into the buffer.
5455                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5456                (buf_ptr as *mut NodeDeprecatedSetFlagsResponse)
5457                    .write_unaligned((self as *const NodeDeprecatedSetFlagsResponse).read());
5458                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5459                // done second because the memcpy will write garbage to these bytes.
5460            }
5461            Ok(())
5462        }
5463    }
5464    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
5465        fidl::encoding::Encode<NodeDeprecatedSetFlagsResponse, D> for (T0,)
5466    {
5467        #[inline]
5468        unsafe fn encode(
5469            self,
5470            encoder: &mut fidl::encoding::Encoder<'_, D>,
5471            offset: usize,
5472            depth: fidl::encoding::Depth,
5473        ) -> fidl::Result<()> {
5474            encoder.debug_check_bounds::<NodeDeprecatedSetFlagsResponse>(offset);
5475            // Zero out padding regions. There's no need to apply masks
5476            // because the unmasked parts will be overwritten by fields.
5477            // Write the fields.
5478            self.0.encode(encoder, offset + 0, depth)?;
5479            Ok(())
5480        }
5481    }
5482
5483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5484        for NodeDeprecatedSetFlagsResponse
5485    {
5486        #[inline(always)]
5487        fn new_empty() -> Self {
5488            Self { s: fidl::new_empty!(i32, D) }
5489        }
5490
5491        #[inline]
5492        unsafe fn decode(
5493            &mut self,
5494            decoder: &mut fidl::encoding::Decoder<'_, D>,
5495            offset: usize,
5496            _depth: fidl::encoding::Depth,
5497        ) -> fidl::Result<()> {
5498            decoder.debug_check_bounds::<Self>(offset);
5499            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5500            // Verify that padding bytes are zero.
5501            // Copy from the buffer into the object.
5502            unsafe {
5503                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5504            }
5505            Ok(())
5506        }
5507    }
5508
5509    impl fidl::encoding::ValueTypeMarker for NodeGetAttributesRequest {
5510        type Borrowed<'a> = &'a Self;
5511        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5512            value
5513        }
5514    }
5515
5516    unsafe impl fidl::encoding::TypeMarker for NodeGetAttributesRequest {
5517        type Owned = Self;
5518
5519        #[inline(always)]
5520        fn inline_align(_context: fidl::encoding::Context) -> usize {
5521            8
5522        }
5523
5524        #[inline(always)]
5525        fn inline_size(_context: fidl::encoding::Context) -> usize {
5526            8
5527        }
5528    }
5529
5530    unsafe impl<D: fidl::encoding::ResourceDialect>
5531        fidl::encoding::Encode<NodeGetAttributesRequest, D> for &NodeGetAttributesRequest
5532    {
5533        #[inline]
5534        unsafe fn encode(
5535            self,
5536            encoder: &mut fidl::encoding::Encoder<'_, D>,
5537            offset: usize,
5538            _depth: fidl::encoding::Depth,
5539        ) -> fidl::Result<()> {
5540            encoder.debug_check_bounds::<NodeGetAttributesRequest>(offset);
5541            // Delegate to tuple encoding.
5542            fidl::encoding::Encode::<NodeGetAttributesRequest, D>::encode(
5543                (<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow(&self.query),),
5544                encoder,
5545                offset,
5546                _depth,
5547            )
5548        }
5549    }
5550    unsafe impl<
5551            D: fidl::encoding::ResourceDialect,
5552            T0: fidl::encoding::Encode<NodeAttributesQuery, D>,
5553        > fidl::encoding::Encode<NodeGetAttributesRequest, D> for (T0,)
5554    {
5555        #[inline]
5556        unsafe fn encode(
5557            self,
5558            encoder: &mut fidl::encoding::Encoder<'_, D>,
5559            offset: usize,
5560            depth: fidl::encoding::Depth,
5561        ) -> fidl::Result<()> {
5562            encoder.debug_check_bounds::<NodeGetAttributesRequest>(offset);
5563            // Zero out padding regions. There's no need to apply masks
5564            // because the unmasked parts will be overwritten by fields.
5565            // Write the fields.
5566            self.0.encode(encoder, offset + 0, depth)?;
5567            Ok(())
5568        }
5569    }
5570
5571    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5572        for NodeGetAttributesRequest
5573    {
5574        #[inline(always)]
5575        fn new_empty() -> Self {
5576            Self { query: fidl::new_empty!(NodeAttributesQuery, D) }
5577        }
5578
5579        #[inline]
5580        unsafe fn decode(
5581            &mut self,
5582            decoder: &mut fidl::encoding::Decoder<'_, D>,
5583            offset: usize,
5584            _depth: fidl::encoding::Depth,
5585        ) -> fidl::Result<()> {
5586            decoder.debug_check_bounds::<Self>(offset);
5587            // Verify that padding bytes are zero.
5588            fidl::decode!(NodeAttributesQuery, D, &mut self.query, decoder, offset + 0, _depth)?;
5589            Ok(())
5590        }
5591    }
5592
5593    impl fidl::encoding::ValueTypeMarker for NodeGetExtendedAttributeRequest {
5594        type Borrowed<'a> = &'a Self;
5595        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5596            value
5597        }
5598    }
5599
5600    unsafe impl fidl::encoding::TypeMarker for NodeGetExtendedAttributeRequest {
5601        type Owned = Self;
5602
5603        #[inline(always)]
5604        fn inline_align(_context: fidl::encoding::Context) -> usize {
5605            8
5606        }
5607
5608        #[inline(always)]
5609        fn inline_size(_context: fidl::encoding::Context) -> usize {
5610            16
5611        }
5612    }
5613
5614    unsafe impl<D: fidl::encoding::ResourceDialect>
5615        fidl::encoding::Encode<NodeGetExtendedAttributeRequest, D>
5616        for &NodeGetExtendedAttributeRequest
5617    {
5618        #[inline]
5619        unsafe fn encode(
5620            self,
5621            encoder: &mut fidl::encoding::Encoder<'_, D>,
5622            offset: usize,
5623            _depth: fidl::encoding::Depth,
5624        ) -> fidl::Result<()> {
5625            encoder.debug_check_bounds::<NodeGetExtendedAttributeRequest>(offset);
5626            // Delegate to tuple encoding.
5627            fidl::encoding::Encode::<NodeGetExtendedAttributeRequest, D>::encode(
5628                (<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
5629                    &self.name,
5630                ),),
5631                encoder,
5632                offset,
5633                _depth,
5634            )
5635        }
5636    }
5637    unsafe impl<
5638            D: fidl::encoding::ResourceDialect,
5639            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>, D>,
5640        > fidl::encoding::Encode<NodeGetExtendedAttributeRequest, D> for (T0,)
5641    {
5642        #[inline]
5643        unsafe fn encode(
5644            self,
5645            encoder: &mut fidl::encoding::Encoder<'_, D>,
5646            offset: usize,
5647            depth: fidl::encoding::Depth,
5648        ) -> fidl::Result<()> {
5649            encoder.debug_check_bounds::<NodeGetExtendedAttributeRequest>(offset);
5650            // Zero out padding regions. There's no need to apply masks
5651            // because the unmasked parts will be overwritten by fields.
5652            // Write the fields.
5653            self.0.encode(encoder, offset + 0, depth)?;
5654            Ok(())
5655        }
5656    }
5657
5658    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5659        for NodeGetExtendedAttributeRequest
5660    {
5661        #[inline(always)]
5662        fn new_empty() -> Self {
5663            Self { name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D) }
5664        }
5665
5666        #[inline]
5667        unsafe fn decode(
5668            &mut self,
5669            decoder: &mut fidl::encoding::Decoder<'_, D>,
5670            offset: usize,
5671            _depth: fidl::encoding::Depth,
5672        ) -> fidl::Result<()> {
5673            decoder.debug_check_bounds::<Self>(offset);
5674            // Verify that padding bytes are zero.
5675            fidl::decode!(fidl::encoding::Vector<u8, 255>, D, &mut self.name, decoder, offset + 0, _depth)?;
5676            Ok(())
5677        }
5678    }
5679
5680    impl fidl::encoding::ValueTypeMarker for NodeQueryFilesystemResponse {
5681        type Borrowed<'a> = &'a Self;
5682        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5683            value
5684        }
5685    }
5686
5687    unsafe impl fidl::encoding::TypeMarker for NodeQueryFilesystemResponse {
5688        type Owned = Self;
5689
5690        #[inline(always)]
5691        fn inline_align(_context: fidl::encoding::Context) -> usize {
5692            8
5693        }
5694
5695        #[inline(always)]
5696        fn inline_size(_context: fidl::encoding::Context) -> usize {
5697            16
5698        }
5699    }
5700
5701    unsafe impl<D: fidl::encoding::ResourceDialect>
5702        fidl::encoding::Encode<NodeQueryFilesystemResponse, D> for &NodeQueryFilesystemResponse
5703    {
5704        #[inline]
5705        unsafe fn encode(
5706            self,
5707            encoder: &mut fidl::encoding::Encoder<'_, D>,
5708            offset: usize,
5709            _depth: fidl::encoding::Depth,
5710        ) -> fidl::Result<()> {
5711            encoder.debug_check_bounds::<NodeQueryFilesystemResponse>(offset);
5712            // Delegate to tuple encoding.
5713            fidl::encoding::Encode::<NodeQueryFilesystemResponse, D>::encode(
5714                (
5715                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
5716                    <fidl::encoding::Boxed<FilesystemInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
5717                ),
5718                encoder, offset, _depth
5719            )
5720        }
5721    }
5722    unsafe impl<
5723            D: fidl::encoding::ResourceDialect,
5724            T0: fidl::encoding::Encode<i32, D>,
5725            T1: fidl::encoding::Encode<fidl::encoding::Boxed<FilesystemInfo>, D>,
5726        > fidl::encoding::Encode<NodeQueryFilesystemResponse, D> for (T0, T1)
5727    {
5728        #[inline]
5729        unsafe fn encode(
5730            self,
5731            encoder: &mut fidl::encoding::Encoder<'_, D>,
5732            offset: usize,
5733            depth: fidl::encoding::Depth,
5734        ) -> fidl::Result<()> {
5735            encoder.debug_check_bounds::<NodeQueryFilesystemResponse>(offset);
5736            // Zero out padding regions. There's no need to apply masks
5737            // because the unmasked parts will be overwritten by fields.
5738            unsafe {
5739                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5740                (ptr as *mut u64).write_unaligned(0);
5741            }
5742            // Write the fields.
5743            self.0.encode(encoder, offset + 0, depth)?;
5744            self.1.encode(encoder, offset + 8, depth)?;
5745            Ok(())
5746        }
5747    }
5748
5749    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5750        for NodeQueryFilesystemResponse
5751    {
5752        #[inline(always)]
5753        fn new_empty() -> Self {
5754            Self {
5755                s: fidl::new_empty!(i32, D),
5756                info: fidl::new_empty!(fidl::encoding::Boxed<FilesystemInfo>, D),
5757            }
5758        }
5759
5760        #[inline]
5761        unsafe fn decode(
5762            &mut self,
5763            decoder: &mut fidl::encoding::Decoder<'_, D>,
5764            offset: usize,
5765            _depth: fidl::encoding::Depth,
5766        ) -> fidl::Result<()> {
5767            decoder.debug_check_bounds::<Self>(offset);
5768            // Verify that padding bytes are zero.
5769            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5770            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5771            let mask = 0xffffffff00000000u64;
5772            let maskedval = padval & mask;
5773            if maskedval != 0 {
5774                return Err(fidl::Error::NonZeroPadding {
5775                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5776                });
5777            }
5778            fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
5779            fidl::decode!(
5780                fidl::encoding::Boxed<FilesystemInfo>,
5781                D,
5782                &mut self.info,
5783                decoder,
5784                offset + 8,
5785                _depth
5786            )?;
5787            Ok(())
5788        }
5789    }
5790
5791    impl fidl::encoding::ValueTypeMarker for NodeRemoveExtendedAttributeRequest {
5792        type Borrowed<'a> = &'a Self;
5793        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5794            value
5795        }
5796    }
5797
5798    unsafe impl fidl::encoding::TypeMarker for NodeRemoveExtendedAttributeRequest {
5799        type Owned = Self;
5800
5801        #[inline(always)]
5802        fn inline_align(_context: fidl::encoding::Context) -> usize {
5803            8
5804        }
5805
5806        #[inline(always)]
5807        fn inline_size(_context: fidl::encoding::Context) -> usize {
5808            16
5809        }
5810    }
5811
5812    unsafe impl<D: fidl::encoding::ResourceDialect>
5813        fidl::encoding::Encode<NodeRemoveExtendedAttributeRequest, D>
5814        for &NodeRemoveExtendedAttributeRequest
5815    {
5816        #[inline]
5817        unsafe fn encode(
5818            self,
5819            encoder: &mut fidl::encoding::Encoder<'_, D>,
5820            offset: usize,
5821            _depth: fidl::encoding::Depth,
5822        ) -> fidl::Result<()> {
5823            encoder.debug_check_bounds::<NodeRemoveExtendedAttributeRequest>(offset);
5824            // Delegate to tuple encoding.
5825            fidl::encoding::Encode::<NodeRemoveExtendedAttributeRequest, D>::encode(
5826                (<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
5827                    &self.name,
5828                ),),
5829                encoder,
5830                offset,
5831                _depth,
5832            )
5833        }
5834    }
5835    unsafe impl<
5836            D: fidl::encoding::ResourceDialect,
5837            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>, D>,
5838        > fidl::encoding::Encode<NodeRemoveExtendedAttributeRequest, D> for (T0,)
5839    {
5840        #[inline]
5841        unsafe fn encode(
5842            self,
5843            encoder: &mut fidl::encoding::Encoder<'_, D>,
5844            offset: usize,
5845            depth: fidl::encoding::Depth,
5846        ) -> fidl::Result<()> {
5847            encoder.debug_check_bounds::<NodeRemoveExtendedAttributeRequest>(offset);
5848            // Zero out padding regions. There's no need to apply masks
5849            // because the unmasked parts will be overwritten by fields.
5850            // Write the fields.
5851            self.0.encode(encoder, offset + 0, depth)?;
5852            Ok(())
5853        }
5854    }
5855
5856    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5857        for NodeRemoveExtendedAttributeRequest
5858    {
5859        #[inline(always)]
5860        fn new_empty() -> Self {
5861            Self { name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D) }
5862        }
5863
5864        #[inline]
5865        unsafe fn decode(
5866            &mut self,
5867            decoder: &mut fidl::encoding::Decoder<'_, D>,
5868            offset: usize,
5869            _depth: fidl::encoding::Depth,
5870        ) -> fidl::Result<()> {
5871            decoder.debug_check_bounds::<Self>(offset);
5872            // Verify that padding bytes are zero.
5873            fidl::decode!(fidl::encoding::Vector<u8, 255>, D, &mut self.name, decoder, offset + 0, _depth)?;
5874            Ok(())
5875        }
5876    }
5877
5878    impl fidl::encoding::ValueTypeMarker for NodeSetFlagsRequest {
5879        type Borrowed<'a> = &'a Self;
5880        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5881            value
5882        }
5883    }
5884
5885    unsafe impl fidl::encoding::TypeMarker for NodeSetFlagsRequest {
5886        type Owned = Self;
5887
5888        #[inline(always)]
5889        fn inline_align(_context: fidl::encoding::Context) -> usize {
5890            8
5891        }
5892
5893        #[inline(always)]
5894        fn inline_size(_context: fidl::encoding::Context) -> usize {
5895            8
5896        }
5897    }
5898
5899    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetFlagsRequest, D>
5900        for &NodeSetFlagsRequest
5901    {
5902        #[inline]
5903        unsafe fn encode(
5904            self,
5905            encoder: &mut fidl::encoding::Encoder<'_, D>,
5906            offset: usize,
5907            _depth: fidl::encoding::Depth,
5908        ) -> fidl::Result<()> {
5909            encoder.debug_check_bounds::<NodeSetFlagsRequest>(offset);
5910            // Delegate to tuple encoding.
5911            fidl::encoding::Encode::<NodeSetFlagsRequest, D>::encode(
5912                (<Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
5913                encoder,
5914                offset,
5915                _depth,
5916            )
5917        }
5918    }
5919    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Flags, D>>
5920        fidl::encoding::Encode<NodeSetFlagsRequest, D> for (T0,)
5921    {
5922        #[inline]
5923        unsafe fn encode(
5924            self,
5925            encoder: &mut fidl::encoding::Encoder<'_, D>,
5926            offset: usize,
5927            depth: fidl::encoding::Depth,
5928        ) -> fidl::Result<()> {
5929            encoder.debug_check_bounds::<NodeSetFlagsRequest>(offset);
5930            // Zero out padding regions. There's no need to apply masks
5931            // because the unmasked parts will be overwritten by fields.
5932            // Write the fields.
5933            self.0.encode(encoder, offset + 0, depth)?;
5934            Ok(())
5935        }
5936    }
5937
5938    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetFlagsRequest {
5939        #[inline(always)]
5940        fn new_empty() -> Self {
5941            Self { flags: fidl::new_empty!(Flags, D) }
5942        }
5943
5944        #[inline]
5945        unsafe fn decode(
5946            &mut self,
5947            decoder: &mut fidl::encoding::Decoder<'_, D>,
5948            offset: usize,
5949            _depth: fidl::encoding::Depth,
5950        ) -> fidl::Result<()> {
5951            decoder.debug_check_bounds::<Self>(offset);
5952            // Verify that padding bytes are zero.
5953            fidl::decode!(Flags, D, &mut self.flags, decoder, offset + 0, _depth)?;
5954            Ok(())
5955        }
5956    }
5957
5958    impl fidl::encoding::ValueTypeMarker for NodeGetFlagsResponse {
5959        type Borrowed<'a> = &'a Self;
5960        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5961            value
5962        }
5963    }
5964
5965    unsafe impl fidl::encoding::TypeMarker for NodeGetFlagsResponse {
5966        type Owned = Self;
5967
5968        #[inline(always)]
5969        fn inline_align(_context: fidl::encoding::Context) -> usize {
5970            8
5971        }
5972
5973        #[inline(always)]
5974        fn inline_size(_context: fidl::encoding::Context) -> usize {
5975            8
5976        }
5977    }
5978
5979    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeGetFlagsResponse, D>
5980        for &NodeGetFlagsResponse
5981    {
5982        #[inline]
5983        unsafe fn encode(
5984            self,
5985            encoder: &mut fidl::encoding::Encoder<'_, D>,
5986            offset: usize,
5987            _depth: fidl::encoding::Depth,
5988        ) -> fidl::Result<()> {
5989            encoder.debug_check_bounds::<NodeGetFlagsResponse>(offset);
5990            // Delegate to tuple encoding.
5991            fidl::encoding::Encode::<NodeGetFlagsResponse, D>::encode(
5992                (<Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
5993                encoder,
5994                offset,
5995                _depth,
5996            )
5997        }
5998    }
5999    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Flags, D>>
6000        fidl::encoding::Encode<NodeGetFlagsResponse, D> for (T0,)
6001    {
6002        #[inline]
6003        unsafe fn encode(
6004            self,
6005            encoder: &mut fidl::encoding::Encoder<'_, D>,
6006            offset: usize,
6007            depth: fidl::encoding::Depth,
6008        ) -> fidl::Result<()> {
6009            encoder.debug_check_bounds::<NodeGetFlagsResponse>(offset);
6010            // Zero out padding regions. There's no need to apply masks
6011            // because the unmasked parts will be overwritten by fields.
6012            // Write the fields.
6013            self.0.encode(encoder, offset + 0, depth)?;
6014            Ok(())
6015        }
6016    }
6017
6018    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeGetFlagsResponse {
6019        #[inline(always)]
6020        fn new_empty() -> Self {
6021            Self { flags: fidl::new_empty!(Flags, D) }
6022        }
6023
6024        #[inline]
6025        unsafe fn decode(
6026            &mut self,
6027            decoder: &mut fidl::encoding::Decoder<'_, D>,
6028            offset: usize,
6029            _depth: fidl::encoding::Depth,
6030        ) -> fidl::Result<()> {
6031            decoder.debug_check_bounds::<Self>(offset);
6032            // Verify that padding bytes are zero.
6033            fidl::decode!(Flags, D, &mut self.flags, decoder, offset + 0, _depth)?;
6034            Ok(())
6035        }
6036    }
6037
6038    impl fidl::encoding::ValueTypeMarker for ReadableReadRequest {
6039        type Borrowed<'a> = &'a Self;
6040        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6041            value
6042        }
6043    }
6044
6045    unsafe impl fidl::encoding::TypeMarker for ReadableReadRequest {
6046        type Owned = Self;
6047
6048        #[inline(always)]
6049        fn inline_align(_context: fidl::encoding::Context) -> usize {
6050            8
6051        }
6052
6053        #[inline(always)]
6054        fn inline_size(_context: fidl::encoding::Context) -> usize {
6055            8
6056        }
6057        #[inline(always)]
6058        fn encode_is_copy() -> bool {
6059            true
6060        }
6061
6062        #[inline(always)]
6063        fn decode_is_copy() -> bool {
6064            true
6065        }
6066    }
6067
6068    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadableReadRequest, D>
6069        for &ReadableReadRequest
6070    {
6071        #[inline]
6072        unsafe fn encode(
6073            self,
6074            encoder: &mut fidl::encoding::Encoder<'_, D>,
6075            offset: usize,
6076            _depth: fidl::encoding::Depth,
6077        ) -> fidl::Result<()> {
6078            encoder.debug_check_bounds::<ReadableReadRequest>(offset);
6079            unsafe {
6080                // Copy the object into the buffer.
6081                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6082                (buf_ptr as *mut ReadableReadRequest)
6083                    .write_unaligned((self as *const ReadableReadRequest).read());
6084                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6085                // done second because the memcpy will write garbage to these bytes.
6086            }
6087            Ok(())
6088        }
6089    }
6090    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6091        fidl::encoding::Encode<ReadableReadRequest, D> for (T0,)
6092    {
6093        #[inline]
6094        unsafe fn encode(
6095            self,
6096            encoder: &mut fidl::encoding::Encoder<'_, D>,
6097            offset: usize,
6098            depth: fidl::encoding::Depth,
6099        ) -> fidl::Result<()> {
6100            encoder.debug_check_bounds::<ReadableReadRequest>(offset);
6101            // Zero out padding regions. There's no need to apply masks
6102            // because the unmasked parts will be overwritten by fields.
6103            // Write the fields.
6104            self.0.encode(encoder, offset + 0, depth)?;
6105            Ok(())
6106        }
6107    }
6108
6109    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadableReadRequest {
6110        #[inline(always)]
6111        fn new_empty() -> Self {
6112            Self { count: fidl::new_empty!(u64, D) }
6113        }
6114
6115        #[inline]
6116        unsafe fn decode(
6117            &mut self,
6118            decoder: &mut fidl::encoding::Decoder<'_, D>,
6119            offset: usize,
6120            _depth: fidl::encoding::Depth,
6121        ) -> fidl::Result<()> {
6122            decoder.debug_check_bounds::<Self>(offset);
6123            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6124            // Verify that padding bytes are zero.
6125            // Copy from the buffer into the object.
6126            unsafe {
6127                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6128            }
6129            Ok(())
6130        }
6131    }
6132
6133    impl fidl::encoding::ValueTypeMarker for ReadableReadResponse {
6134        type Borrowed<'a> = &'a Self;
6135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6136            value
6137        }
6138    }
6139
6140    unsafe impl fidl::encoding::TypeMarker for ReadableReadResponse {
6141        type Owned = Self;
6142
6143        #[inline(always)]
6144        fn inline_align(_context: fidl::encoding::Context) -> usize {
6145            8
6146        }
6147
6148        #[inline(always)]
6149        fn inline_size(_context: fidl::encoding::Context) -> usize {
6150            16
6151        }
6152    }
6153
6154    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadableReadResponse, D>
6155        for &ReadableReadResponse
6156    {
6157        #[inline]
6158        unsafe fn encode(
6159            self,
6160            encoder: &mut fidl::encoding::Encoder<'_, D>,
6161            offset: usize,
6162            _depth: fidl::encoding::Depth,
6163        ) -> fidl::Result<()> {
6164            encoder.debug_check_bounds::<ReadableReadResponse>(offset);
6165            // Delegate to tuple encoding.
6166            fidl::encoding::Encode::<ReadableReadResponse, D>::encode(
6167                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
6168                    &self.data,
6169                ),),
6170                encoder,
6171                offset,
6172                _depth,
6173            )
6174        }
6175    }
6176    unsafe impl<
6177            D: fidl::encoding::ResourceDialect,
6178            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
6179        > fidl::encoding::Encode<ReadableReadResponse, D> for (T0,)
6180    {
6181        #[inline]
6182        unsafe fn encode(
6183            self,
6184            encoder: &mut fidl::encoding::Encoder<'_, D>,
6185            offset: usize,
6186            depth: fidl::encoding::Depth,
6187        ) -> fidl::Result<()> {
6188            encoder.debug_check_bounds::<ReadableReadResponse>(offset);
6189            // Zero out padding regions. There's no need to apply masks
6190            // because the unmasked parts will be overwritten by fields.
6191            // Write the fields.
6192            self.0.encode(encoder, offset + 0, depth)?;
6193            Ok(())
6194        }
6195    }
6196
6197    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadableReadResponse {
6198        #[inline(always)]
6199        fn new_empty() -> Self {
6200            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
6201        }
6202
6203        #[inline]
6204        unsafe fn decode(
6205            &mut self,
6206            decoder: &mut fidl::encoding::Decoder<'_, D>,
6207            offset: usize,
6208            _depth: fidl::encoding::Depth,
6209        ) -> fidl::Result<()> {
6210            decoder.debug_check_bounds::<Self>(offset);
6211            // Verify that padding bytes are zero.
6212            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
6213            Ok(())
6214        }
6215    }
6216
6217    impl fidl::encoding::ValueTypeMarker for Service {
6218        type Borrowed<'a> = &'a Self;
6219        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6220            value
6221        }
6222    }
6223
6224    unsafe impl fidl::encoding::TypeMarker for Service {
6225        type Owned = Self;
6226
6227        #[inline(always)]
6228        fn inline_align(_context: fidl::encoding::Context) -> usize {
6229            1
6230        }
6231
6232        #[inline(always)]
6233        fn inline_size(_context: fidl::encoding::Context) -> usize {
6234            1
6235        }
6236    }
6237
6238    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Service, D> for &Service {
6239        #[inline]
6240        unsafe fn encode(
6241            self,
6242            encoder: &mut fidl::encoding::Encoder<'_, D>,
6243            offset: usize,
6244            _depth: fidl::encoding::Depth,
6245        ) -> fidl::Result<()> {
6246            encoder.debug_check_bounds::<Service>(offset);
6247            encoder.write_num(0u8, offset);
6248            Ok(())
6249        }
6250    }
6251
6252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Service {
6253        #[inline(always)]
6254        fn new_empty() -> Self {
6255            Self
6256        }
6257
6258        #[inline]
6259        unsafe fn decode(
6260            &mut self,
6261            decoder: &mut fidl::encoding::Decoder<'_, D>,
6262            offset: usize,
6263            _depth: fidl::encoding::Depth,
6264        ) -> fidl::Result<()> {
6265            decoder.debug_check_bounds::<Self>(offset);
6266            match decoder.read_num::<u8>(offset) {
6267                0 => Ok(()),
6268                _ => Err(fidl::Error::Invalid),
6269            }
6270        }
6271    }
6272
6273    impl fidl::encoding::ValueTypeMarker for SymlinkObject {
6274        type Borrowed<'a> = &'a Self;
6275        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6276            value
6277        }
6278    }
6279
6280    unsafe impl fidl::encoding::TypeMarker for SymlinkObject {
6281        type Owned = Self;
6282
6283        #[inline(always)]
6284        fn inline_align(_context: fidl::encoding::Context) -> usize {
6285            8
6286        }
6287
6288        #[inline(always)]
6289        fn inline_size(_context: fidl::encoding::Context) -> usize {
6290            16
6291        }
6292    }
6293
6294    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SymlinkObject, D>
6295        for &SymlinkObject
6296    {
6297        #[inline]
6298        unsafe fn encode(
6299            self,
6300            encoder: &mut fidl::encoding::Encoder<'_, D>,
6301            offset: usize,
6302            _depth: fidl::encoding::Depth,
6303        ) -> fidl::Result<()> {
6304            encoder.debug_check_bounds::<SymlinkObject>(offset);
6305            // Delegate to tuple encoding.
6306            fidl::encoding::Encode::<SymlinkObject, D>::encode(
6307                (<fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
6308                    &self.target,
6309                ),),
6310                encoder,
6311                offset,
6312                _depth,
6313            )
6314        }
6315    }
6316    unsafe impl<
6317            D: fidl::encoding::ResourceDialect,
6318            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 4095>, D>,
6319        > fidl::encoding::Encode<SymlinkObject, D> for (T0,)
6320    {
6321        #[inline]
6322        unsafe fn encode(
6323            self,
6324            encoder: &mut fidl::encoding::Encoder<'_, D>,
6325            offset: usize,
6326            depth: fidl::encoding::Depth,
6327        ) -> fidl::Result<()> {
6328            encoder.debug_check_bounds::<SymlinkObject>(offset);
6329            // Zero out padding regions. There's no need to apply masks
6330            // because the unmasked parts will be overwritten by fields.
6331            // Write the fields.
6332            self.0.encode(encoder, offset + 0, depth)?;
6333            Ok(())
6334        }
6335    }
6336
6337    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkObject {
6338        #[inline(always)]
6339        fn new_empty() -> Self {
6340            Self { target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, D) }
6341        }
6342
6343        #[inline]
6344        unsafe fn decode(
6345            &mut self,
6346            decoder: &mut fidl::encoding::Decoder<'_, D>,
6347            offset: usize,
6348            _depth: fidl::encoding::Depth,
6349        ) -> fidl::Result<()> {
6350            decoder.debug_check_bounds::<Self>(offset);
6351            // Verify that padding bytes are zero.
6352            fidl::decode!(fidl::encoding::Vector<u8, 4095>, D, &mut self.target, decoder, offset + 0, _depth)?;
6353            Ok(())
6354        }
6355    }
6356
6357    impl fidl::encoding::ValueTypeMarker for WritableWriteRequest {
6358        type Borrowed<'a> = &'a Self;
6359        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6360            value
6361        }
6362    }
6363
6364    unsafe impl fidl::encoding::TypeMarker for WritableWriteRequest {
6365        type Owned = Self;
6366
6367        #[inline(always)]
6368        fn inline_align(_context: fidl::encoding::Context) -> usize {
6369            8
6370        }
6371
6372        #[inline(always)]
6373        fn inline_size(_context: fidl::encoding::Context) -> usize {
6374            16
6375        }
6376    }
6377
6378    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritableWriteRequest, D>
6379        for &WritableWriteRequest
6380    {
6381        #[inline]
6382        unsafe fn encode(
6383            self,
6384            encoder: &mut fidl::encoding::Encoder<'_, D>,
6385            offset: usize,
6386            _depth: fidl::encoding::Depth,
6387        ) -> fidl::Result<()> {
6388            encoder.debug_check_bounds::<WritableWriteRequest>(offset);
6389            // Delegate to tuple encoding.
6390            fidl::encoding::Encode::<WritableWriteRequest, D>::encode(
6391                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
6392                    &self.data,
6393                ),),
6394                encoder,
6395                offset,
6396                _depth,
6397            )
6398        }
6399    }
6400    unsafe impl<
6401            D: fidl::encoding::ResourceDialect,
6402            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
6403        > fidl::encoding::Encode<WritableWriteRequest, D> for (T0,)
6404    {
6405        #[inline]
6406        unsafe fn encode(
6407            self,
6408            encoder: &mut fidl::encoding::Encoder<'_, D>,
6409            offset: usize,
6410            depth: fidl::encoding::Depth,
6411        ) -> fidl::Result<()> {
6412            encoder.debug_check_bounds::<WritableWriteRequest>(offset);
6413            // Zero out padding regions. There's no need to apply masks
6414            // because the unmasked parts will be overwritten by fields.
6415            // Write the fields.
6416            self.0.encode(encoder, offset + 0, depth)?;
6417            Ok(())
6418        }
6419    }
6420
6421    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritableWriteRequest {
6422        #[inline(always)]
6423        fn new_empty() -> Self {
6424            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
6425        }
6426
6427        #[inline]
6428        unsafe fn decode(
6429            &mut self,
6430            decoder: &mut fidl::encoding::Decoder<'_, D>,
6431            offset: usize,
6432            _depth: fidl::encoding::Depth,
6433        ) -> fidl::Result<()> {
6434            decoder.debug_check_bounds::<Self>(offset);
6435            // Verify that padding bytes are zero.
6436            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
6437            Ok(())
6438        }
6439    }
6440
6441    impl fidl::encoding::ValueTypeMarker for WritableWriteResponse {
6442        type Borrowed<'a> = &'a Self;
6443        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6444            value
6445        }
6446    }
6447
6448    unsafe impl fidl::encoding::TypeMarker for WritableWriteResponse {
6449        type Owned = Self;
6450
6451        #[inline(always)]
6452        fn inline_align(_context: fidl::encoding::Context) -> usize {
6453            8
6454        }
6455
6456        #[inline(always)]
6457        fn inline_size(_context: fidl::encoding::Context) -> usize {
6458            8
6459        }
6460        #[inline(always)]
6461        fn encode_is_copy() -> bool {
6462            true
6463        }
6464
6465        #[inline(always)]
6466        fn decode_is_copy() -> bool {
6467            true
6468        }
6469    }
6470
6471    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritableWriteResponse, D>
6472        for &WritableWriteResponse
6473    {
6474        #[inline]
6475        unsafe fn encode(
6476            self,
6477            encoder: &mut fidl::encoding::Encoder<'_, D>,
6478            offset: usize,
6479            _depth: fidl::encoding::Depth,
6480        ) -> fidl::Result<()> {
6481            encoder.debug_check_bounds::<WritableWriteResponse>(offset);
6482            unsafe {
6483                // Copy the object into the buffer.
6484                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6485                (buf_ptr as *mut WritableWriteResponse)
6486                    .write_unaligned((self as *const WritableWriteResponse).read());
6487                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6488                // done second because the memcpy will write garbage to these bytes.
6489            }
6490            Ok(())
6491        }
6492    }
6493    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
6494        fidl::encoding::Encode<WritableWriteResponse, D> for (T0,)
6495    {
6496        #[inline]
6497        unsafe fn encode(
6498            self,
6499            encoder: &mut fidl::encoding::Encoder<'_, D>,
6500            offset: usize,
6501            depth: fidl::encoding::Depth,
6502        ) -> fidl::Result<()> {
6503            encoder.debug_check_bounds::<WritableWriteResponse>(offset);
6504            // Zero out padding regions. There's no need to apply masks
6505            // because the unmasked parts will be overwritten by fields.
6506            // Write the fields.
6507            self.0.encode(encoder, offset + 0, depth)?;
6508            Ok(())
6509        }
6510    }
6511
6512    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritableWriteResponse {
6513        #[inline(always)]
6514        fn new_empty() -> Self {
6515            Self { actual_count: fidl::new_empty!(u64, D) }
6516        }
6517
6518        #[inline]
6519        unsafe fn decode(
6520            &mut self,
6521            decoder: &mut fidl::encoding::Decoder<'_, D>,
6522            offset: usize,
6523            _depth: fidl::encoding::Depth,
6524        ) -> fidl::Result<()> {
6525            decoder.debug_check_bounds::<Self>(offset);
6526            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6527            // Verify that padding bytes are zero.
6528            // Copy from the buffer into the object.
6529            unsafe {
6530                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6531            }
6532            Ok(())
6533        }
6534    }
6535
6536    impl AdvisoryLockRequest {
6537        #[inline(always)]
6538        fn max_ordinal_present(&self) -> u64 {
6539            if let Some(_) = self.wait {
6540                return 3;
6541            }
6542            if let Some(_) = self.range {
6543                return 2;
6544            }
6545            if let Some(_) = self.type_ {
6546                return 1;
6547            }
6548            0
6549        }
6550    }
6551
6552    impl fidl::encoding::ValueTypeMarker for AdvisoryLockRequest {
6553        type Borrowed<'a> = &'a Self;
6554        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6555            value
6556        }
6557    }
6558
6559    unsafe impl fidl::encoding::TypeMarker for AdvisoryLockRequest {
6560        type Owned = Self;
6561
6562        #[inline(always)]
6563        fn inline_align(_context: fidl::encoding::Context) -> usize {
6564            8
6565        }
6566
6567        #[inline(always)]
6568        fn inline_size(_context: fidl::encoding::Context) -> usize {
6569            16
6570        }
6571    }
6572
6573    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdvisoryLockRequest, D>
6574        for &AdvisoryLockRequest
6575    {
6576        unsafe fn encode(
6577            self,
6578            encoder: &mut fidl::encoding::Encoder<'_, D>,
6579            offset: usize,
6580            mut depth: fidl::encoding::Depth,
6581        ) -> fidl::Result<()> {
6582            encoder.debug_check_bounds::<AdvisoryLockRequest>(offset);
6583            // Vector header
6584            let max_ordinal: u64 = self.max_ordinal_present();
6585            encoder.write_num(max_ordinal, offset);
6586            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6587            // Calling encoder.out_of_line_offset(0) is not allowed.
6588            if max_ordinal == 0 {
6589                return Ok(());
6590            }
6591            depth.increment()?;
6592            let envelope_size = 8;
6593            let bytes_len = max_ordinal as usize * envelope_size;
6594            #[allow(unused_variables)]
6595            let offset = encoder.out_of_line_offset(bytes_len);
6596            let mut _prev_end_offset: usize = 0;
6597            if 1 > max_ordinal {
6598                return Ok(());
6599            }
6600
6601            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6602            // are envelope_size bytes.
6603            let cur_offset: usize = (1 - 1) * envelope_size;
6604
6605            // Zero reserved fields.
6606            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6607
6608            // Safety:
6609            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6610            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6611            //   envelope_size bytes, there is always sufficient room.
6612            fidl::encoding::encode_in_envelope_optional::<AdvisoryLockType, D>(
6613                self.type_
6614                    .as_ref()
6615                    .map(<AdvisoryLockType as fidl::encoding::ValueTypeMarker>::borrow),
6616                encoder,
6617                offset + cur_offset,
6618                depth,
6619            )?;
6620
6621            _prev_end_offset = cur_offset + envelope_size;
6622            if 2 > max_ordinal {
6623                return Ok(());
6624            }
6625
6626            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6627            // are envelope_size bytes.
6628            let cur_offset: usize = (2 - 1) * envelope_size;
6629
6630            // Zero reserved fields.
6631            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6632
6633            // Safety:
6634            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6635            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6636            //   envelope_size bytes, there is always sufficient room.
6637            fidl::encoding::encode_in_envelope_optional::<AdvisoryLockRange, D>(
6638                self.range
6639                    .as_ref()
6640                    .map(<AdvisoryLockRange as fidl::encoding::ValueTypeMarker>::borrow),
6641                encoder,
6642                offset + cur_offset,
6643                depth,
6644            )?;
6645
6646            _prev_end_offset = cur_offset + envelope_size;
6647            if 3 > max_ordinal {
6648                return Ok(());
6649            }
6650
6651            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6652            // are envelope_size bytes.
6653            let cur_offset: usize = (3 - 1) * envelope_size;
6654
6655            // Zero reserved fields.
6656            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6657
6658            // Safety:
6659            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6660            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6661            //   envelope_size bytes, there is always sufficient room.
6662            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6663                self.wait.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6664                encoder,
6665                offset + cur_offset,
6666                depth,
6667            )?;
6668
6669            _prev_end_offset = cur_offset + envelope_size;
6670
6671            Ok(())
6672        }
6673    }
6674
6675    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockRequest {
6676        #[inline(always)]
6677        fn new_empty() -> Self {
6678            Self::default()
6679        }
6680
6681        unsafe fn decode(
6682            &mut self,
6683            decoder: &mut fidl::encoding::Decoder<'_, D>,
6684            offset: usize,
6685            mut depth: fidl::encoding::Depth,
6686        ) -> fidl::Result<()> {
6687            decoder.debug_check_bounds::<Self>(offset);
6688            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6689                None => return Err(fidl::Error::NotNullable),
6690                Some(len) => len,
6691            };
6692            // Calling decoder.out_of_line_offset(0) is not allowed.
6693            if len == 0 {
6694                return Ok(());
6695            };
6696            depth.increment()?;
6697            let envelope_size = 8;
6698            let bytes_len = len * envelope_size;
6699            let offset = decoder.out_of_line_offset(bytes_len)?;
6700            // Decode the envelope for each type.
6701            let mut _next_ordinal_to_read = 0;
6702            let mut next_offset = offset;
6703            let end_offset = offset + bytes_len;
6704            _next_ordinal_to_read += 1;
6705            if next_offset >= end_offset {
6706                return Ok(());
6707            }
6708
6709            // Decode unknown envelopes for gaps in ordinals.
6710            while _next_ordinal_to_read < 1 {
6711                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6712                _next_ordinal_to_read += 1;
6713                next_offset += envelope_size;
6714            }
6715
6716            let next_out_of_line = decoder.next_out_of_line();
6717            let handles_before = decoder.remaining_handles();
6718            if let Some((inlined, num_bytes, num_handles)) =
6719                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6720            {
6721                let member_inline_size =
6722                    <AdvisoryLockType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6723                if inlined != (member_inline_size <= 4) {
6724                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6725                }
6726                let inner_offset;
6727                let mut inner_depth = depth.clone();
6728                if inlined {
6729                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6730                    inner_offset = next_offset;
6731                } else {
6732                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6733                    inner_depth.increment()?;
6734                }
6735                let val_ref =
6736                    self.type_.get_or_insert_with(|| fidl::new_empty!(AdvisoryLockType, D));
6737                fidl::decode!(AdvisoryLockType, D, val_ref, decoder, inner_offset, inner_depth)?;
6738                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6739                {
6740                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6741                }
6742                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6743                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6744                }
6745            }
6746
6747            next_offset += envelope_size;
6748            _next_ordinal_to_read += 1;
6749            if next_offset >= end_offset {
6750                return Ok(());
6751            }
6752
6753            // Decode unknown envelopes for gaps in ordinals.
6754            while _next_ordinal_to_read < 2 {
6755                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6756                _next_ordinal_to_read += 1;
6757                next_offset += envelope_size;
6758            }
6759
6760            let next_out_of_line = decoder.next_out_of_line();
6761            let handles_before = decoder.remaining_handles();
6762            if let Some((inlined, num_bytes, num_handles)) =
6763                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6764            {
6765                let member_inline_size =
6766                    <AdvisoryLockRange as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6767                if inlined != (member_inline_size <= 4) {
6768                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6769                }
6770                let inner_offset;
6771                let mut inner_depth = depth.clone();
6772                if inlined {
6773                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6774                    inner_offset = next_offset;
6775                } else {
6776                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6777                    inner_depth.increment()?;
6778                }
6779                let val_ref =
6780                    self.range.get_or_insert_with(|| fidl::new_empty!(AdvisoryLockRange, D));
6781                fidl::decode!(AdvisoryLockRange, D, val_ref, decoder, inner_offset, inner_depth)?;
6782                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6783                {
6784                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6785                }
6786                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6787                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6788                }
6789            }
6790
6791            next_offset += envelope_size;
6792            _next_ordinal_to_read += 1;
6793            if next_offset >= end_offset {
6794                return Ok(());
6795            }
6796
6797            // Decode unknown envelopes for gaps in ordinals.
6798            while _next_ordinal_to_read < 3 {
6799                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6800                _next_ordinal_to_read += 1;
6801                next_offset += envelope_size;
6802            }
6803
6804            let next_out_of_line = decoder.next_out_of_line();
6805            let handles_before = decoder.remaining_handles();
6806            if let Some((inlined, num_bytes, num_handles)) =
6807                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6808            {
6809                let member_inline_size =
6810                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6811                if inlined != (member_inline_size <= 4) {
6812                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6813                }
6814                let inner_offset;
6815                let mut inner_depth = depth.clone();
6816                if inlined {
6817                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6818                    inner_offset = next_offset;
6819                } else {
6820                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6821                    inner_depth.increment()?;
6822                }
6823                let val_ref = self.wait.get_or_insert_with(|| fidl::new_empty!(bool, D));
6824                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6825                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6826                {
6827                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6828                }
6829                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6830                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6831                }
6832            }
6833
6834            next_offset += envelope_size;
6835
6836            // Decode the remaining unknown envelopes.
6837            while next_offset < end_offset {
6838                _next_ordinal_to_read += 1;
6839                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6840                next_offset += envelope_size;
6841            }
6842
6843            Ok(())
6844        }
6845    }
6846
6847    impl DirectoryInfo {
6848        #[inline(always)]
6849        fn max_ordinal_present(&self) -> u64 {
6850            if let Some(_) = self.attributes {
6851                return 1;
6852            }
6853            0
6854        }
6855    }
6856
6857    impl fidl::encoding::ValueTypeMarker for DirectoryInfo {
6858        type Borrowed<'a> = &'a Self;
6859        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6860            value
6861        }
6862    }
6863
6864    unsafe impl fidl::encoding::TypeMarker for DirectoryInfo {
6865        type Owned = Self;
6866
6867        #[inline(always)]
6868        fn inline_align(_context: fidl::encoding::Context) -> usize {
6869            8
6870        }
6871
6872        #[inline(always)]
6873        fn inline_size(_context: fidl::encoding::Context) -> usize {
6874            16
6875        }
6876    }
6877
6878    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryInfo, D>
6879        for &DirectoryInfo
6880    {
6881        unsafe fn encode(
6882            self,
6883            encoder: &mut fidl::encoding::Encoder<'_, D>,
6884            offset: usize,
6885            mut depth: fidl::encoding::Depth,
6886        ) -> fidl::Result<()> {
6887            encoder.debug_check_bounds::<DirectoryInfo>(offset);
6888            // Vector header
6889            let max_ordinal: u64 = self.max_ordinal_present();
6890            encoder.write_num(max_ordinal, offset);
6891            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6892            // Calling encoder.out_of_line_offset(0) is not allowed.
6893            if max_ordinal == 0 {
6894                return Ok(());
6895            }
6896            depth.increment()?;
6897            let envelope_size = 8;
6898            let bytes_len = max_ordinal as usize * envelope_size;
6899            #[allow(unused_variables)]
6900            let offset = encoder.out_of_line_offset(bytes_len);
6901            let mut _prev_end_offset: usize = 0;
6902            if 1 > max_ordinal {
6903                return Ok(());
6904            }
6905
6906            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6907            // are envelope_size bytes.
6908            let cur_offset: usize = (1 - 1) * envelope_size;
6909
6910            // Zero reserved fields.
6911            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6912
6913            // Safety:
6914            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6915            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6916            //   envelope_size bytes, there is always sufficient room.
6917            fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
6918                self.attributes
6919                    .as_ref()
6920                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
6921                encoder,
6922                offset + cur_offset,
6923                depth,
6924            )?;
6925
6926            _prev_end_offset = cur_offset + envelope_size;
6927
6928            Ok(())
6929        }
6930    }
6931
6932    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryInfo {
6933        #[inline(always)]
6934        fn new_empty() -> Self {
6935            Self::default()
6936        }
6937
6938        unsafe fn decode(
6939            &mut self,
6940            decoder: &mut fidl::encoding::Decoder<'_, D>,
6941            offset: usize,
6942            mut depth: fidl::encoding::Depth,
6943        ) -> fidl::Result<()> {
6944            decoder.debug_check_bounds::<Self>(offset);
6945            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6946                None => return Err(fidl::Error::NotNullable),
6947                Some(len) => len,
6948            };
6949            // Calling decoder.out_of_line_offset(0) is not allowed.
6950            if len == 0 {
6951                return Ok(());
6952            };
6953            depth.increment()?;
6954            let envelope_size = 8;
6955            let bytes_len = len * envelope_size;
6956            let offset = decoder.out_of_line_offset(bytes_len)?;
6957            // Decode the envelope for each type.
6958            let mut _next_ordinal_to_read = 0;
6959            let mut next_offset = offset;
6960            let end_offset = offset + bytes_len;
6961            _next_ordinal_to_read += 1;
6962            if next_offset >= end_offset {
6963                return Ok(());
6964            }
6965
6966            // Decode unknown envelopes for gaps in ordinals.
6967            while _next_ordinal_to_read < 1 {
6968                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6969                _next_ordinal_to_read += 1;
6970                next_offset += envelope_size;
6971            }
6972
6973            let next_out_of_line = decoder.next_out_of_line();
6974            let handles_before = decoder.remaining_handles();
6975            if let Some((inlined, num_bytes, num_handles)) =
6976                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6977            {
6978                let member_inline_size =
6979                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6980                if inlined != (member_inline_size <= 4) {
6981                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6982                }
6983                let inner_offset;
6984                let mut inner_depth = depth.clone();
6985                if inlined {
6986                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6987                    inner_offset = next_offset;
6988                } else {
6989                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6990                    inner_depth.increment()?;
6991                }
6992                let val_ref =
6993                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
6994                fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
6995                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6996                {
6997                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6998                }
6999                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7000                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7001                }
7002            }
7003
7004            next_offset += envelope_size;
7005
7006            // Decode the remaining unknown envelopes.
7007            while next_offset < end_offset {
7008                _next_ordinal_to_read += 1;
7009                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7010                next_offset += envelope_size;
7011            }
7012
7013            Ok(())
7014        }
7015    }
7016
7017    impl ImmutableNodeAttributes {
7018        #[inline(always)]
7019        fn max_ordinal_present(&self) -> u64 {
7020            if let Some(_) = self.verity_enabled {
7021                return 10;
7022            }
7023            if let Some(_) = self.root_hash {
7024                return 9;
7025            }
7026            if let Some(_) = self.options {
7027                return 8;
7028            }
7029            if let Some(_) = self.change_time {
7030                return 7;
7031            }
7032            if let Some(_) = self.id {
7033                return 6;
7034            }
7035            if let Some(_) = self.link_count {
7036                return 5;
7037            }
7038            if let Some(_) = self.storage_size {
7039                return 4;
7040            }
7041            if let Some(_) = self.content_size {
7042                return 3;
7043            }
7044            if let Some(_) = self.abilities {
7045                return 2;
7046            }
7047            if let Some(_) = self.protocols {
7048                return 1;
7049            }
7050            0
7051        }
7052    }
7053
7054    impl fidl::encoding::ValueTypeMarker for ImmutableNodeAttributes {
7055        type Borrowed<'a> = &'a Self;
7056        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7057            value
7058        }
7059    }
7060
7061    unsafe impl fidl::encoding::TypeMarker for ImmutableNodeAttributes {
7062        type Owned = Self;
7063
7064        #[inline(always)]
7065        fn inline_align(_context: fidl::encoding::Context) -> usize {
7066            8
7067        }
7068
7069        #[inline(always)]
7070        fn inline_size(_context: fidl::encoding::Context) -> usize {
7071            16
7072        }
7073    }
7074
7075    unsafe impl<D: fidl::encoding::ResourceDialect>
7076        fidl::encoding::Encode<ImmutableNodeAttributes, D> for &ImmutableNodeAttributes
7077    {
7078        unsafe fn encode(
7079            self,
7080            encoder: &mut fidl::encoding::Encoder<'_, D>,
7081            offset: usize,
7082            mut depth: fidl::encoding::Depth,
7083        ) -> fidl::Result<()> {
7084            encoder.debug_check_bounds::<ImmutableNodeAttributes>(offset);
7085            // Vector header
7086            let max_ordinal: u64 = self.max_ordinal_present();
7087            encoder.write_num(max_ordinal, offset);
7088            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7089            // Calling encoder.out_of_line_offset(0) is not allowed.
7090            if max_ordinal == 0 {
7091                return Ok(());
7092            }
7093            depth.increment()?;
7094            let envelope_size = 8;
7095            let bytes_len = max_ordinal as usize * envelope_size;
7096            #[allow(unused_variables)]
7097            let offset = encoder.out_of_line_offset(bytes_len);
7098            let mut _prev_end_offset: usize = 0;
7099            if 1 > max_ordinal {
7100                return Ok(());
7101            }
7102
7103            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7104            // are envelope_size bytes.
7105            let cur_offset: usize = (1 - 1) * envelope_size;
7106
7107            // Zero reserved fields.
7108            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7109
7110            // Safety:
7111            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7112            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7113            //   envelope_size bytes, there is always sufficient room.
7114            fidl::encoding::encode_in_envelope_optional::<NodeProtocolKinds, D>(
7115                self.protocols
7116                    .as_ref()
7117                    .map(<NodeProtocolKinds as fidl::encoding::ValueTypeMarker>::borrow),
7118                encoder,
7119                offset + cur_offset,
7120                depth,
7121            )?;
7122
7123            _prev_end_offset = cur_offset + envelope_size;
7124            if 2 > max_ordinal {
7125                return Ok(());
7126            }
7127
7128            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7129            // are envelope_size bytes.
7130            let cur_offset: usize = (2 - 1) * envelope_size;
7131
7132            // Zero reserved fields.
7133            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7134
7135            // Safety:
7136            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7137            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7138            //   envelope_size bytes, there is always sufficient room.
7139            fidl::encoding::encode_in_envelope_optional::<Operations, D>(
7140                self.abilities
7141                    .as_ref()
7142                    .map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
7143                encoder,
7144                offset + cur_offset,
7145                depth,
7146            )?;
7147
7148            _prev_end_offset = cur_offset + envelope_size;
7149            if 3 > max_ordinal {
7150                return Ok(());
7151            }
7152
7153            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7154            // are envelope_size bytes.
7155            let cur_offset: usize = (3 - 1) * envelope_size;
7156
7157            // Zero reserved fields.
7158            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7159
7160            // Safety:
7161            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7162            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7163            //   envelope_size bytes, there is always sufficient room.
7164            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7165                self.content_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7166                encoder,
7167                offset + cur_offset,
7168                depth,
7169            )?;
7170
7171            _prev_end_offset = cur_offset + envelope_size;
7172            if 4 > max_ordinal {
7173                return Ok(());
7174            }
7175
7176            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7177            // are envelope_size bytes.
7178            let cur_offset: usize = (4 - 1) * envelope_size;
7179
7180            // Zero reserved fields.
7181            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7182
7183            // Safety:
7184            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7185            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7186            //   envelope_size bytes, there is always sufficient room.
7187            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7188                self.storage_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7189                encoder,
7190                offset + cur_offset,
7191                depth,
7192            )?;
7193
7194            _prev_end_offset = cur_offset + envelope_size;
7195            if 5 > max_ordinal {
7196                return Ok(());
7197            }
7198
7199            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7200            // are envelope_size bytes.
7201            let cur_offset: usize = (5 - 1) * envelope_size;
7202
7203            // Zero reserved fields.
7204            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7205
7206            // Safety:
7207            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7208            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7209            //   envelope_size bytes, there is always sufficient room.
7210            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7211                self.link_count.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7212                encoder,
7213                offset + cur_offset,
7214                depth,
7215            )?;
7216
7217            _prev_end_offset = cur_offset + envelope_size;
7218            if 6 > max_ordinal {
7219                return Ok(());
7220            }
7221
7222            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7223            // are envelope_size bytes.
7224            let cur_offset: usize = (6 - 1) * envelope_size;
7225
7226            // Zero reserved fields.
7227            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7228
7229            // Safety:
7230            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7231            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7232            //   envelope_size bytes, there is always sufficient room.
7233            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7234                self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7235                encoder,
7236                offset + cur_offset,
7237                depth,
7238            )?;
7239
7240            _prev_end_offset = cur_offset + envelope_size;
7241            if 7 > max_ordinal {
7242                return Ok(());
7243            }
7244
7245            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7246            // are envelope_size bytes.
7247            let cur_offset: usize = (7 - 1) * envelope_size;
7248
7249            // Zero reserved fields.
7250            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7251
7252            // Safety:
7253            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7254            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7255            //   envelope_size bytes, there is always sufficient room.
7256            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7257                self.change_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7258                encoder,
7259                offset + cur_offset,
7260                depth,
7261            )?;
7262
7263            _prev_end_offset = cur_offset + envelope_size;
7264            if 8 > max_ordinal {
7265                return Ok(());
7266            }
7267
7268            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7269            // are envelope_size bytes.
7270            let cur_offset: usize = (8 - 1) * envelope_size;
7271
7272            // Zero reserved fields.
7273            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7274
7275            // Safety:
7276            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7277            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7278            //   envelope_size bytes, there is always sufficient room.
7279            fidl::encoding::encode_in_envelope_optional::<VerificationOptions, D>(
7280                self.options
7281                    .as_ref()
7282                    .map(<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow),
7283                encoder,
7284                offset + cur_offset,
7285                depth,
7286            )?;
7287
7288            _prev_end_offset = cur_offset + envelope_size;
7289            if 9 > max_ordinal {
7290                return Ok(());
7291            }
7292
7293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7294            // are envelope_size bytes.
7295            let cur_offset: usize = (9 - 1) * envelope_size;
7296
7297            // Zero reserved fields.
7298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7299
7300            // Safety:
7301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7303            //   envelope_size bytes, there is always sufficient room.
7304            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 64>, D>(
7305                self.root_hash.as_ref().map(
7306                    <fidl::encoding::Vector<u8, 64> as fidl::encoding::ValueTypeMarker>::borrow,
7307                ),
7308                encoder,
7309                offset + cur_offset,
7310                depth,
7311            )?;
7312
7313            _prev_end_offset = cur_offset + envelope_size;
7314            if 10 > max_ordinal {
7315                return Ok(());
7316            }
7317
7318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7319            // are envelope_size bytes.
7320            let cur_offset: usize = (10 - 1) * envelope_size;
7321
7322            // Zero reserved fields.
7323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7324
7325            // Safety:
7326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7328            //   envelope_size bytes, there is always sufficient room.
7329            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7330                self.verity_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7331                encoder,
7332                offset + cur_offset,
7333                depth,
7334            )?;
7335
7336            _prev_end_offset = cur_offset + envelope_size;
7337
7338            Ok(())
7339        }
7340    }
7341
7342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7343        for ImmutableNodeAttributes
7344    {
7345        #[inline(always)]
7346        fn new_empty() -> Self {
7347            Self::default()
7348        }
7349
7350        unsafe fn decode(
7351            &mut self,
7352            decoder: &mut fidl::encoding::Decoder<'_, D>,
7353            offset: usize,
7354            mut depth: fidl::encoding::Depth,
7355        ) -> fidl::Result<()> {
7356            decoder.debug_check_bounds::<Self>(offset);
7357            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7358                None => return Err(fidl::Error::NotNullable),
7359                Some(len) => len,
7360            };
7361            // Calling decoder.out_of_line_offset(0) is not allowed.
7362            if len == 0 {
7363                return Ok(());
7364            };
7365            depth.increment()?;
7366            let envelope_size = 8;
7367            let bytes_len = len * envelope_size;
7368            let offset = decoder.out_of_line_offset(bytes_len)?;
7369            // Decode the envelope for each type.
7370            let mut _next_ordinal_to_read = 0;
7371            let mut next_offset = offset;
7372            let end_offset = offset + bytes_len;
7373            _next_ordinal_to_read += 1;
7374            if next_offset >= end_offset {
7375                return Ok(());
7376            }
7377
7378            // Decode unknown envelopes for gaps in ordinals.
7379            while _next_ordinal_to_read < 1 {
7380                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7381                _next_ordinal_to_read += 1;
7382                next_offset += envelope_size;
7383            }
7384
7385            let next_out_of_line = decoder.next_out_of_line();
7386            let handles_before = decoder.remaining_handles();
7387            if let Some((inlined, num_bytes, num_handles)) =
7388                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7389            {
7390                let member_inline_size =
7391                    <NodeProtocolKinds as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7392                if inlined != (member_inline_size <= 4) {
7393                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7394                }
7395                let inner_offset;
7396                let mut inner_depth = depth.clone();
7397                if inlined {
7398                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7399                    inner_offset = next_offset;
7400                } else {
7401                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7402                    inner_depth.increment()?;
7403                }
7404                let val_ref =
7405                    self.protocols.get_or_insert_with(|| fidl::new_empty!(NodeProtocolKinds, D));
7406                fidl::decode!(NodeProtocolKinds, D, val_ref, decoder, inner_offset, inner_depth)?;
7407                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7408                {
7409                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7410                }
7411                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7412                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7413                }
7414            }
7415
7416            next_offset += envelope_size;
7417            _next_ordinal_to_read += 1;
7418            if next_offset >= end_offset {
7419                return Ok(());
7420            }
7421
7422            // Decode unknown envelopes for gaps in ordinals.
7423            while _next_ordinal_to_read < 2 {
7424                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7425                _next_ordinal_to_read += 1;
7426                next_offset += envelope_size;
7427            }
7428
7429            let next_out_of_line = decoder.next_out_of_line();
7430            let handles_before = decoder.remaining_handles();
7431            if let Some((inlined, num_bytes, num_handles)) =
7432                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7433            {
7434                let member_inline_size =
7435                    <Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7436                if inlined != (member_inline_size <= 4) {
7437                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7438                }
7439                let inner_offset;
7440                let mut inner_depth = depth.clone();
7441                if inlined {
7442                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7443                    inner_offset = next_offset;
7444                } else {
7445                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7446                    inner_depth.increment()?;
7447                }
7448                let val_ref = self.abilities.get_or_insert_with(|| fidl::new_empty!(Operations, D));
7449                fidl::decode!(Operations, D, val_ref, decoder, inner_offset, inner_depth)?;
7450                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7451                {
7452                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7453                }
7454                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7455                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7456                }
7457            }
7458
7459            next_offset += envelope_size;
7460            _next_ordinal_to_read += 1;
7461            if next_offset >= end_offset {
7462                return Ok(());
7463            }
7464
7465            // Decode unknown envelopes for gaps in ordinals.
7466            while _next_ordinal_to_read < 3 {
7467                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7468                _next_ordinal_to_read += 1;
7469                next_offset += envelope_size;
7470            }
7471
7472            let next_out_of_line = decoder.next_out_of_line();
7473            let handles_before = decoder.remaining_handles();
7474            if let Some((inlined, num_bytes, num_handles)) =
7475                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7476            {
7477                let member_inline_size =
7478                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7479                if inlined != (member_inline_size <= 4) {
7480                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7481                }
7482                let inner_offset;
7483                let mut inner_depth = depth.clone();
7484                if inlined {
7485                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7486                    inner_offset = next_offset;
7487                } else {
7488                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7489                    inner_depth.increment()?;
7490                }
7491                let val_ref = self.content_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
7492                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7493                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7494                {
7495                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7496                }
7497                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7498                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7499                }
7500            }
7501
7502            next_offset += envelope_size;
7503            _next_ordinal_to_read += 1;
7504            if next_offset >= end_offset {
7505                return Ok(());
7506            }
7507
7508            // Decode unknown envelopes for gaps in ordinals.
7509            while _next_ordinal_to_read < 4 {
7510                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7511                _next_ordinal_to_read += 1;
7512                next_offset += envelope_size;
7513            }
7514
7515            let next_out_of_line = decoder.next_out_of_line();
7516            let handles_before = decoder.remaining_handles();
7517            if let Some((inlined, num_bytes, num_handles)) =
7518                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7519            {
7520                let member_inline_size =
7521                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7522                if inlined != (member_inline_size <= 4) {
7523                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7524                }
7525                let inner_offset;
7526                let mut inner_depth = depth.clone();
7527                if inlined {
7528                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7529                    inner_offset = next_offset;
7530                } else {
7531                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7532                    inner_depth.increment()?;
7533                }
7534                let val_ref = self.storage_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
7535                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7536                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7537                {
7538                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7539                }
7540                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7541                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7542                }
7543            }
7544
7545            next_offset += envelope_size;
7546            _next_ordinal_to_read += 1;
7547            if next_offset >= end_offset {
7548                return Ok(());
7549            }
7550
7551            // Decode unknown envelopes for gaps in ordinals.
7552            while _next_ordinal_to_read < 5 {
7553                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7554                _next_ordinal_to_read += 1;
7555                next_offset += envelope_size;
7556            }
7557
7558            let next_out_of_line = decoder.next_out_of_line();
7559            let handles_before = decoder.remaining_handles();
7560            if let Some((inlined, num_bytes, num_handles)) =
7561                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7562            {
7563                let member_inline_size =
7564                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7565                if inlined != (member_inline_size <= 4) {
7566                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7567                }
7568                let inner_offset;
7569                let mut inner_depth = depth.clone();
7570                if inlined {
7571                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7572                    inner_offset = next_offset;
7573                } else {
7574                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7575                    inner_depth.increment()?;
7576                }
7577                let val_ref = self.link_count.get_or_insert_with(|| fidl::new_empty!(u64, D));
7578                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7579                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7580                {
7581                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7582                }
7583                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7584                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7585                }
7586            }
7587
7588            next_offset += envelope_size;
7589            _next_ordinal_to_read += 1;
7590            if next_offset >= end_offset {
7591                return Ok(());
7592            }
7593
7594            // Decode unknown envelopes for gaps in ordinals.
7595            while _next_ordinal_to_read < 6 {
7596                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7597                _next_ordinal_to_read += 1;
7598                next_offset += envelope_size;
7599            }
7600
7601            let next_out_of_line = decoder.next_out_of_line();
7602            let handles_before = decoder.remaining_handles();
7603            if let Some((inlined, num_bytes, num_handles)) =
7604                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7605            {
7606                let member_inline_size =
7607                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7608                if inlined != (member_inline_size <= 4) {
7609                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7610                }
7611                let inner_offset;
7612                let mut inner_depth = depth.clone();
7613                if inlined {
7614                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7615                    inner_offset = next_offset;
7616                } else {
7617                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7618                    inner_depth.increment()?;
7619                }
7620                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
7621                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7622                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7623                {
7624                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7625                }
7626                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7627                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7628                }
7629            }
7630
7631            next_offset += envelope_size;
7632            _next_ordinal_to_read += 1;
7633            if next_offset >= end_offset {
7634                return Ok(());
7635            }
7636
7637            // Decode unknown envelopes for gaps in ordinals.
7638            while _next_ordinal_to_read < 7 {
7639                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7640                _next_ordinal_to_read += 1;
7641                next_offset += envelope_size;
7642            }
7643
7644            let next_out_of_line = decoder.next_out_of_line();
7645            let handles_before = decoder.remaining_handles();
7646            if let Some((inlined, num_bytes, num_handles)) =
7647                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7648            {
7649                let member_inline_size =
7650                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7651                if inlined != (member_inline_size <= 4) {
7652                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7653                }
7654                let inner_offset;
7655                let mut inner_depth = depth.clone();
7656                if inlined {
7657                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7658                    inner_offset = next_offset;
7659                } else {
7660                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7661                    inner_depth.increment()?;
7662                }
7663                let val_ref = self.change_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
7664                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7665                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7666                {
7667                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7668                }
7669                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7670                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7671                }
7672            }
7673
7674            next_offset += envelope_size;
7675            _next_ordinal_to_read += 1;
7676            if next_offset >= end_offset {
7677                return Ok(());
7678            }
7679
7680            // Decode unknown envelopes for gaps in ordinals.
7681            while _next_ordinal_to_read < 8 {
7682                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7683                _next_ordinal_to_read += 1;
7684                next_offset += envelope_size;
7685            }
7686
7687            let next_out_of_line = decoder.next_out_of_line();
7688            let handles_before = decoder.remaining_handles();
7689            if let Some((inlined, num_bytes, num_handles)) =
7690                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7691            {
7692                let member_inline_size =
7693                    <VerificationOptions as fidl::encoding::TypeMarker>::inline_size(
7694                        decoder.context,
7695                    );
7696                if inlined != (member_inline_size <= 4) {
7697                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7698                }
7699                let inner_offset;
7700                let mut inner_depth = depth.clone();
7701                if inlined {
7702                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7703                    inner_offset = next_offset;
7704                } else {
7705                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7706                    inner_depth.increment()?;
7707                }
7708                let val_ref =
7709                    self.options.get_or_insert_with(|| fidl::new_empty!(VerificationOptions, D));
7710                fidl::decode!(VerificationOptions, D, val_ref, decoder, inner_offset, inner_depth)?;
7711                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7712                {
7713                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7714                }
7715                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7716                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7717                }
7718            }
7719
7720            next_offset += envelope_size;
7721            _next_ordinal_to_read += 1;
7722            if next_offset >= end_offset {
7723                return Ok(());
7724            }
7725
7726            // Decode unknown envelopes for gaps in ordinals.
7727            while _next_ordinal_to_read < 9 {
7728                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7729                _next_ordinal_to_read += 1;
7730                next_offset += envelope_size;
7731            }
7732
7733            let next_out_of_line = decoder.next_out_of_line();
7734            let handles_before = decoder.remaining_handles();
7735            if let Some((inlined, num_bytes, num_handles)) =
7736                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7737            {
7738                let member_inline_size =
7739                    <fidl::encoding::Vector<u8, 64> as fidl::encoding::TypeMarker>::inline_size(
7740                        decoder.context,
7741                    );
7742                if inlined != (member_inline_size <= 4) {
7743                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7744                }
7745                let inner_offset;
7746                let mut inner_depth = depth.clone();
7747                if inlined {
7748                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7749                    inner_offset = next_offset;
7750                } else {
7751                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7752                    inner_depth.increment()?;
7753                }
7754                let val_ref = self
7755                    .root_hash
7756                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 64>, D));
7757                fidl::decode!(fidl::encoding::Vector<u8, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
7758                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7759                {
7760                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7761                }
7762                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7763                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7764                }
7765            }
7766
7767            next_offset += envelope_size;
7768            _next_ordinal_to_read += 1;
7769            if next_offset >= end_offset {
7770                return Ok(());
7771            }
7772
7773            // Decode unknown envelopes for gaps in ordinals.
7774            while _next_ordinal_to_read < 10 {
7775                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7776                _next_ordinal_to_read += 1;
7777                next_offset += envelope_size;
7778            }
7779
7780            let next_out_of_line = decoder.next_out_of_line();
7781            let handles_before = decoder.remaining_handles();
7782            if let Some((inlined, num_bytes, num_handles)) =
7783                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7784            {
7785                let member_inline_size =
7786                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7787                if inlined != (member_inline_size <= 4) {
7788                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7789                }
7790                let inner_offset;
7791                let mut inner_depth = depth.clone();
7792                if inlined {
7793                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7794                    inner_offset = next_offset;
7795                } else {
7796                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7797                    inner_depth.increment()?;
7798                }
7799                let val_ref = self.verity_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
7800                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7801                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7802                {
7803                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7804                }
7805                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7806                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7807                }
7808            }
7809
7810            next_offset += envelope_size;
7811
7812            // Decode the remaining unknown envelopes.
7813            while next_offset < end_offset {
7814                _next_ordinal_to_read += 1;
7815                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7816                next_offset += envelope_size;
7817            }
7818
7819            Ok(())
7820        }
7821    }
7822
7823    impl MutableNodeAttributes {
7824        #[inline(always)]
7825        fn max_ordinal_present(&self) -> u64 {
7826            if let Some(_) = self.wrapping_key_id {
7827                return 10;
7828            }
7829            if let Some(_) = self.selinux_context {
7830                return 9;
7831            }
7832            if let Some(_) = self.casefold {
7833                return 8;
7834            }
7835            if let Some(_) = self.access_time {
7836                return 7;
7837            }
7838            if let Some(_) = self.rdev {
7839                return 6;
7840            }
7841            if let Some(_) = self.gid {
7842                return 5;
7843            }
7844            if let Some(_) = self.uid {
7845                return 4;
7846            }
7847            if let Some(_) = self.mode {
7848                return 3;
7849            }
7850            if let Some(_) = self.modification_time {
7851                return 2;
7852            }
7853            if let Some(_) = self.creation_time {
7854                return 1;
7855            }
7856            0
7857        }
7858    }
7859
7860    impl fidl::encoding::ValueTypeMarker for MutableNodeAttributes {
7861        type Borrowed<'a> = &'a Self;
7862        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7863            value
7864        }
7865    }
7866
7867    unsafe impl fidl::encoding::TypeMarker for MutableNodeAttributes {
7868        type Owned = Self;
7869
7870        #[inline(always)]
7871        fn inline_align(_context: fidl::encoding::Context) -> usize {
7872            8
7873        }
7874
7875        #[inline(always)]
7876        fn inline_size(_context: fidl::encoding::Context) -> usize {
7877            16
7878        }
7879    }
7880
7881    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MutableNodeAttributes, D>
7882        for &MutableNodeAttributes
7883    {
7884        unsafe fn encode(
7885            self,
7886            encoder: &mut fidl::encoding::Encoder<'_, D>,
7887            offset: usize,
7888            mut depth: fidl::encoding::Depth,
7889        ) -> fidl::Result<()> {
7890            encoder.debug_check_bounds::<MutableNodeAttributes>(offset);
7891            // Vector header
7892            let max_ordinal: u64 = self.max_ordinal_present();
7893            encoder.write_num(max_ordinal, offset);
7894            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7895            // Calling encoder.out_of_line_offset(0) is not allowed.
7896            if max_ordinal == 0 {
7897                return Ok(());
7898            }
7899            depth.increment()?;
7900            let envelope_size = 8;
7901            let bytes_len = max_ordinal as usize * envelope_size;
7902            #[allow(unused_variables)]
7903            let offset = encoder.out_of_line_offset(bytes_len);
7904            let mut _prev_end_offset: usize = 0;
7905            if 1 > max_ordinal {
7906                return Ok(());
7907            }
7908
7909            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7910            // are envelope_size bytes.
7911            let cur_offset: usize = (1 - 1) * envelope_size;
7912
7913            // Zero reserved fields.
7914            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7915
7916            // Safety:
7917            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7918            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7919            //   envelope_size bytes, there is always sufficient room.
7920            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7921                self.creation_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7922                encoder,
7923                offset + cur_offset,
7924                depth,
7925            )?;
7926
7927            _prev_end_offset = cur_offset + envelope_size;
7928            if 2 > max_ordinal {
7929                return Ok(());
7930            }
7931
7932            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7933            // are envelope_size bytes.
7934            let cur_offset: usize = (2 - 1) * envelope_size;
7935
7936            // Zero reserved fields.
7937            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7938
7939            // Safety:
7940            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7941            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7942            //   envelope_size bytes, there is always sufficient room.
7943            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7944                self.modification_time
7945                    .as_ref()
7946                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7947                encoder,
7948                offset + cur_offset,
7949                depth,
7950            )?;
7951
7952            _prev_end_offset = cur_offset + envelope_size;
7953            if 3 > max_ordinal {
7954                return Ok(());
7955            }
7956
7957            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7958            // are envelope_size bytes.
7959            let cur_offset: usize = (3 - 1) * envelope_size;
7960
7961            // Zero reserved fields.
7962            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7963
7964            // Safety:
7965            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7966            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7967            //   envelope_size bytes, there is always sufficient room.
7968            fidl::encoding::encode_in_envelope_optional::<u32, D>(
7969                self.mode.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
7970                encoder,
7971                offset + cur_offset,
7972                depth,
7973            )?;
7974
7975            _prev_end_offset = cur_offset + envelope_size;
7976            if 4 > max_ordinal {
7977                return Ok(());
7978            }
7979
7980            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7981            // are envelope_size bytes.
7982            let cur_offset: usize = (4 - 1) * envelope_size;
7983
7984            // Zero reserved fields.
7985            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7986
7987            // Safety:
7988            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7989            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7990            //   envelope_size bytes, there is always sufficient room.
7991            fidl::encoding::encode_in_envelope_optional::<u32, D>(
7992                self.uid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
7993                encoder,
7994                offset + cur_offset,
7995                depth,
7996            )?;
7997
7998            _prev_end_offset = cur_offset + envelope_size;
7999            if 5 > max_ordinal {
8000                return Ok(());
8001            }
8002
8003            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8004            // are envelope_size bytes.
8005            let cur_offset: usize = (5 - 1) * envelope_size;
8006
8007            // Zero reserved fields.
8008            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8009
8010            // Safety:
8011            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8012            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8013            //   envelope_size bytes, there is always sufficient room.
8014            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8015                self.gid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8016                encoder,
8017                offset + cur_offset,
8018                depth,
8019            )?;
8020
8021            _prev_end_offset = cur_offset + envelope_size;
8022            if 6 > max_ordinal {
8023                return Ok(());
8024            }
8025
8026            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8027            // are envelope_size bytes.
8028            let cur_offset: usize = (6 - 1) * envelope_size;
8029
8030            // Zero reserved fields.
8031            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8032
8033            // Safety:
8034            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8035            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8036            //   envelope_size bytes, there is always sufficient room.
8037            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8038                self.rdev.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8039                encoder,
8040                offset + cur_offset,
8041                depth,
8042            )?;
8043
8044            _prev_end_offset = cur_offset + envelope_size;
8045            if 7 > max_ordinal {
8046                return Ok(());
8047            }
8048
8049            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8050            // are envelope_size bytes.
8051            let cur_offset: usize = (7 - 1) * envelope_size;
8052
8053            // Zero reserved fields.
8054            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8055
8056            // Safety:
8057            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8058            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8059            //   envelope_size bytes, there is always sufficient room.
8060            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8061                self.access_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8062                encoder,
8063                offset + cur_offset,
8064                depth,
8065            )?;
8066
8067            _prev_end_offset = cur_offset + envelope_size;
8068            if 8 > max_ordinal {
8069                return Ok(());
8070            }
8071
8072            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8073            // are envelope_size bytes.
8074            let cur_offset: usize = (8 - 1) * envelope_size;
8075
8076            // Zero reserved fields.
8077            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8078
8079            // Safety:
8080            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8081            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8082            //   envelope_size bytes, there is always sufficient room.
8083            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8084                self.casefold.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8085                encoder,
8086                offset + cur_offset,
8087                depth,
8088            )?;
8089
8090            _prev_end_offset = cur_offset + envelope_size;
8091            if 9 > max_ordinal {
8092                return Ok(());
8093            }
8094
8095            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8096            // are envelope_size bytes.
8097            let cur_offset: usize = (9 - 1) * envelope_size;
8098
8099            // Zero reserved fields.
8100            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8101
8102            // Safety:
8103            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8104            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8105            //   envelope_size bytes, there is always sufficient room.
8106            fidl::encoding::encode_in_envelope_optional::<SelinuxContext, D>(
8107                self.selinux_context
8108                    .as_ref()
8109                    .map(<SelinuxContext as fidl::encoding::ValueTypeMarker>::borrow),
8110                encoder,
8111                offset + cur_offset,
8112                depth,
8113            )?;
8114
8115            _prev_end_offset = cur_offset + envelope_size;
8116            if 10 > max_ordinal {
8117                return Ok(());
8118            }
8119
8120            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8121            // are envelope_size bytes.
8122            let cur_offset: usize = (10 - 1) * envelope_size;
8123
8124            // Zero reserved fields.
8125            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8126
8127            // Safety:
8128            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8129            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8130            //   envelope_size bytes, there is always sufficient room.
8131            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
8132                self.wrapping_key_id.as_ref().map(
8133                    <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
8134                ),
8135                encoder,
8136                offset + cur_offset,
8137                depth,
8138            )?;
8139
8140            _prev_end_offset = cur_offset + envelope_size;
8141
8142            Ok(())
8143        }
8144    }
8145
8146    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MutableNodeAttributes {
8147        #[inline(always)]
8148        fn new_empty() -> Self {
8149            Self::default()
8150        }
8151
8152        unsafe fn decode(
8153            &mut self,
8154            decoder: &mut fidl::encoding::Decoder<'_, D>,
8155            offset: usize,
8156            mut depth: fidl::encoding::Depth,
8157        ) -> fidl::Result<()> {
8158            decoder.debug_check_bounds::<Self>(offset);
8159            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8160                None => return Err(fidl::Error::NotNullable),
8161                Some(len) => len,
8162            };
8163            // Calling decoder.out_of_line_offset(0) is not allowed.
8164            if len == 0 {
8165                return Ok(());
8166            };
8167            depth.increment()?;
8168            let envelope_size = 8;
8169            let bytes_len = len * envelope_size;
8170            let offset = decoder.out_of_line_offset(bytes_len)?;
8171            // Decode the envelope for each type.
8172            let mut _next_ordinal_to_read = 0;
8173            let mut next_offset = offset;
8174            let end_offset = offset + bytes_len;
8175            _next_ordinal_to_read += 1;
8176            if next_offset >= end_offset {
8177                return Ok(());
8178            }
8179
8180            // Decode unknown envelopes for gaps in ordinals.
8181            while _next_ordinal_to_read < 1 {
8182                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8183                _next_ordinal_to_read += 1;
8184                next_offset += envelope_size;
8185            }
8186
8187            let next_out_of_line = decoder.next_out_of_line();
8188            let handles_before = decoder.remaining_handles();
8189            if let Some((inlined, num_bytes, num_handles)) =
8190                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8191            {
8192                let member_inline_size =
8193                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8194                if inlined != (member_inline_size <= 4) {
8195                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8196                }
8197                let inner_offset;
8198                let mut inner_depth = depth.clone();
8199                if inlined {
8200                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8201                    inner_offset = next_offset;
8202                } else {
8203                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8204                    inner_depth.increment()?;
8205                }
8206                let val_ref = self.creation_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
8207                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8208                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8209                {
8210                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8211                }
8212                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8213                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8214                }
8215            }
8216
8217            next_offset += envelope_size;
8218            _next_ordinal_to_read += 1;
8219            if next_offset >= end_offset {
8220                return Ok(());
8221            }
8222
8223            // Decode unknown envelopes for gaps in ordinals.
8224            while _next_ordinal_to_read < 2 {
8225                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8226                _next_ordinal_to_read += 1;
8227                next_offset += envelope_size;
8228            }
8229
8230            let next_out_of_line = decoder.next_out_of_line();
8231            let handles_before = decoder.remaining_handles();
8232            if let Some((inlined, num_bytes, num_handles)) =
8233                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8234            {
8235                let member_inline_size =
8236                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8237                if inlined != (member_inline_size <= 4) {
8238                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8239                }
8240                let inner_offset;
8241                let mut inner_depth = depth.clone();
8242                if inlined {
8243                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8244                    inner_offset = next_offset;
8245                } else {
8246                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8247                    inner_depth.increment()?;
8248                }
8249                let val_ref =
8250                    self.modification_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
8251                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8252                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8253                {
8254                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8255                }
8256                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8257                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8258                }
8259            }
8260
8261            next_offset += envelope_size;
8262            _next_ordinal_to_read += 1;
8263            if next_offset >= end_offset {
8264                return Ok(());
8265            }
8266
8267            // Decode unknown envelopes for gaps in ordinals.
8268            while _next_ordinal_to_read < 3 {
8269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8270                _next_ordinal_to_read += 1;
8271                next_offset += envelope_size;
8272            }
8273
8274            let next_out_of_line = decoder.next_out_of_line();
8275            let handles_before = decoder.remaining_handles();
8276            if let Some((inlined, num_bytes, num_handles)) =
8277                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8278            {
8279                let member_inline_size =
8280                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8281                if inlined != (member_inline_size <= 4) {
8282                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8283                }
8284                let inner_offset;
8285                let mut inner_depth = depth.clone();
8286                if inlined {
8287                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8288                    inner_offset = next_offset;
8289                } else {
8290                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8291                    inner_depth.increment()?;
8292                }
8293                let val_ref = self.mode.get_or_insert_with(|| fidl::new_empty!(u32, D));
8294                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8295                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8296                {
8297                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8298                }
8299                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8300                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8301                }
8302            }
8303
8304            next_offset += envelope_size;
8305            _next_ordinal_to_read += 1;
8306            if next_offset >= end_offset {
8307                return Ok(());
8308            }
8309
8310            // Decode unknown envelopes for gaps in ordinals.
8311            while _next_ordinal_to_read < 4 {
8312                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8313                _next_ordinal_to_read += 1;
8314                next_offset += envelope_size;
8315            }
8316
8317            let next_out_of_line = decoder.next_out_of_line();
8318            let handles_before = decoder.remaining_handles();
8319            if let Some((inlined, num_bytes, num_handles)) =
8320                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8321            {
8322                let member_inline_size =
8323                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8324                if inlined != (member_inline_size <= 4) {
8325                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8326                }
8327                let inner_offset;
8328                let mut inner_depth = depth.clone();
8329                if inlined {
8330                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8331                    inner_offset = next_offset;
8332                } else {
8333                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8334                    inner_depth.increment()?;
8335                }
8336                let val_ref = self.uid.get_or_insert_with(|| fidl::new_empty!(u32, D));
8337                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8338                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8339                {
8340                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8341                }
8342                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8343                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8344                }
8345            }
8346
8347            next_offset += envelope_size;
8348            _next_ordinal_to_read += 1;
8349            if next_offset >= end_offset {
8350                return Ok(());
8351            }
8352
8353            // Decode unknown envelopes for gaps in ordinals.
8354            while _next_ordinal_to_read < 5 {
8355                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8356                _next_ordinal_to_read += 1;
8357                next_offset += envelope_size;
8358            }
8359
8360            let next_out_of_line = decoder.next_out_of_line();
8361            let handles_before = decoder.remaining_handles();
8362            if let Some((inlined, num_bytes, num_handles)) =
8363                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8364            {
8365                let member_inline_size =
8366                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8367                if inlined != (member_inline_size <= 4) {
8368                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8369                }
8370                let inner_offset;
8371                let mut inner_depth = depth.clone();
8372                if inlined {
8373                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8374                    inner_offset = next_offset;
8375                } else {
8376                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8377                    inner_depth.increment()?;
8378                }
8379                let val_ref = self.gid.get_or_insert_with(|| fidl::new_empty!(u32, D));
8380                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8381                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8382                {
8383                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8384                }
8385                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8386                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8387                }
8388            }
8389
8390            next_offset += envelope_size;
8391            _next_ordinal_to_read += 1;
8392            if next_offset >= end_offset {
8393                return Ok(());
8394            }
8395
8396            // Decode unknown envelopes for gaps in ordinals.
8397            while _next_ordinal_to_read < 6 {
8398                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8399                _next_ordinal_to_read += 1;
8400                next_offset += envelope_size;
8401            }
8402
8403            let next_out_of_line = decoder.next_out_of_line();
8404            let handles_before = decoder.remaining_handles();
8405            if let Some((inlined, num_bytes, num_handles)) =
8406                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8407            {
8408                let member_inline_size =
8409                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8410                if inlined != (member_inline_size <= 4) {
8411                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8412                }
8413                let inner_offset;
8414                let mut inner_depth = depth.clone();
8415                if inlined {
8416                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8417                    inner_offset = next_offset;
8418                } else {
8419                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8420                    inner_depth.increment()?;
8421                }
8422                let val_ref = self.rdev.get_or_insert_with(|| fidl::new_empty!(u64, D));
8423                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8424                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8425                {
8426                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8427                }
8428                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8429                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8430                }
8431            }
8432
8433            next_offset += envelope_size;
8434            _next_ordinal_to_read += 1;
8435            if next_offset >= end_offset {
8436                return Ok(());
8437            }
8438
8439            // Decode unknown envelopes for gaps in ordinals.
8440            while _next_ordinal_to_read < 7 {
8441                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8442                _next_ordinal_to_read += 1;
8443                next_offset += envelope_size;
8444            }
8445
8446            let next_out_of_line = decoder.next_out_of_line();
8447            let handles_before = decoder.remaining_handles();
8448            if let Some((inlined, num_bytes, num_handles)) =
8449                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8450            {
8451                let member_inline_size =
8452                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8453                if inlined != (member_inline_size <= 4) {
8454                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8455                }
8456                let inner_offset;
8457                let mut inner_depth = depth.clone();
8458                if inlined {
8459                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8460                    inner_offset = next_offset;
8461                } else {
8462                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8463                    inner_depth.increment()?;
8464                }
8465                let val_ref = self.access_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
8466                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8467                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8468                {
8469                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8470                }
8471                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8472                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8473                }
8474            }
8475
8476            next_offset += envelope_size;
8477            _next_ordinal_to_read += 1;
8478            if next_offset >= end_offset {
8479                return Ok(());
8480            }
8481
8482            // Decode unknown envelopes for gaps in ordinals.
8483            while _next_ordinal_to_read < 8 {
8484                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8485                _next_ordinal_to_read += 1;
8486                next_offset += envelope_size;
8487            }
8488
8489            let next_out_of_line = decoder.next_out_of_line();
8490            let handles_before = decoder.remaining_handles();
8491            if let Some((inlined, num_bytes, num_handles)) =
8492                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8493            {
8494                let member_inline_size =
8495                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8496                if inlined != (member_inline_size <= 4) {
8497                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8498                }
8499                let inner_offset;
8500                let mut inner_depth = depth.clone();
8501                if inlined {
8502                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8503                    inner_offset = next_offset;
8504                } else {
8505                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8506                    inner_depth.increment()?;
8507                }
8508                let val_ref = self.casefold.get_or_insert_with(|| fidl::new_empty!(bool, D));
8509                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8510                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8511                {
8512                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8513                }
8514                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8515                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8516                }
8517            }
8518
8519            next_offset += envelope_size;
8520            _next_ordinal_to_read += 1;
8521            if next_offset >= end_offset {
8522                return Ok(());
8523            }
8524
8525            // Decode unknown envelopes for gaps in ordinals.
8526            while _next_ordinal_to_read < 9 {
8527                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8528                _next_ordinal_to_read += 1;
8529                next_offset += envelope_size;
8530            }
8531
8532            let next_out_of_line = decoder.next_out_of_line();
8533            let handles_before = decoder.remaining_handles();
8534            if let Some((inlined, num_bytes, num_handles)) =
8535                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8536            {
8537                let member_inline_size =
8538                    <SelinuxContext as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8539                if inlined != (member_inline_size <= 4) {
8540                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8541                }
8542                let inner_offset;
8543                let mut inner_depth = depth.clone();
8544                if inlined {
8545                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8546                    inner_offset = next_offset;
8547                } else {
8548                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8549                    inner_depth.increment()?;
8550                }
8551                let val_ref =
8552                    self.selinux_context.get_or_insert_with(|| fidl::new_empty!(SelinuxContext, D));
8553                fidl::decode!(SelinuxContext, D, val_ref, decoder, inner_offset, inner_depth)?;
8554                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8555                {
8556                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8557                }
8558                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8559                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8560                }
8561            }
8562
8563            next_offset += envelope_size;
8564            _next_ordinal_to_read += 1;
8565            if next_offset >= end_offset {
8566                return Ok(());
8567            }
8568
8569            // Decode unknown envelopes for gaps in ordinals.
8570            while _next_ordinal_to_read < 10 {
8571                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8572                _next_ordinal_to_read += 1;
8573                next_offset += envelope_size;
8574            }
8575
8576            let next_out_of_line = decoder.next_out_of_line();
8577            let handles_before = decoder.remaining_handles();
8578            if let Some((inlined, num_bytes, num_handles)) =
8579                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8580            {
8581                let member_inline_size =
8582                    <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
8583                        decoder.context,
8584                    );
8585                if inlined != (member_inline_size <= 4) {
8586                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8587                }
8588                let inner_offset;
8589                let mut inner_depth = depth.clone();
8590                if inlined {
8591                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8592                    inner_offset = next_offset;
8593                } else {
8594                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8595                    inner_depth.increment()?;
8596                }
8597                let val_ref = self
8598                    .wrapping_key_id
8599                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
8600                fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
8601                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8602                {
8603                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8604                }
8605                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8606                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8607                }
8608            }
8609
8610            next_offset += envelope_size;
8611
8612            // Decode the remaining unknown envelopes.
8613            while next_offset < end_offset {
8614                _next_ordinal_to_read += 1;
8615                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8616                next_offset += envelope_size;
8617            }
8618
8619            Ok(())
8620        }
8621    }
8622
8623    impl NodeInfo {
8624        #[inline(always)]
8625        fn max_ordinal_present(&self) -> u64 {
8626            if let Some(_) = self.attributes {
8627                return 1;
8628            }
8629            0
8630        }
8631    }
8632
8633    impl fidl::encoding::ValueTypeMarker for NodeInfo {
8634        type Borrowed<'a> = &'a Self;
8635        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8636            value
8637        }
8638    }
8639
8640    unsafe impl fidl::encoding::TypeMarker for NodeInfo {
8641        type Owned = Self;
8642
8643        #[inline(always)]
8644        fn inline_align(_context: fidl::encoding::Context) -> usize {
8645            8
8646        }
8647
8648        #[inline(always)]
8649        fn inline_size(_context: fidl::encoding::Context) -> usize {
8650            16
8651        }
8652    }
8653
8654    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeInfo, D> for &NodeInfo {
8655        unsafe fn encode(
8656            self,
8657            encoder: &mut fidl::encoding::Encoder<'_, D>,
8658            offset: usize,
8659            mut depth: fidl::encoding::Depth,
8660        ) -> fidl::Result<()> {
8661            encoder.debug_check_bounds::<NodeInfo>(offset);
8662            // Vector header
8663            let max_ordinal: u64 = self.max_ordinal_present();
8664            encoder.write_num(max_ordinal, offset);
8665            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8666            // Calling encoder.out_of_line_offset(0) is not allowed.
8667            if max_ordinal == 0 {
8668                return Ok(());
8669            }
8670            depth.increment()?;
8671            let envelope_size = 8;
8672            let bytes_len = max_ordinal as usize * envelope_size;
8673            #[allow(unused_variables)]
8674            let offset = encoder.out_of_line_offset(bytes_len);
8675            let mut _prev_end_offset: usize = 0;
8676            if 1 > max_ordinal {
8677                return Ok(());
8678            }
8679
8680            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8681            // are envelope_size bytes.
8682            let cur_offset: usize = (1 - 1) * envelope_size;
8683
8684            // Zero reserved fields.
8685            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8686
8687            // Safety:
8688            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8689            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8690            //   envelope_size bytes, there is always sufficient room.
8691            fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
8692                self.attributes
8693                    .as_ref()
8694                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
8695                encoder,
8696                offset + cur_offset,
8697                depth,
8698            )?;
8699
8700            _prev_end_offset = cur_offset + envelope_size;
8701
8702            Ok(())
8703        }
8704    }
8705
8706    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeInfo {
8707        #[inline(always)]
8708        fn new_empty() -> Self {
8709            Self::default()
8710        }
8711
8712        unsafe fn decode(
8713            &mut self,
8714            decoder: &mut fidl::encoding::Decoder<'_, D>,
8715            offset: usize,
8716            mut depth: fidl::encoding::Depth,
8717        ) -> fidl::Result<()> {
8718            decoder.debug_check_bounds::<Self>(offset);
8719            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8720                None => return Err(fidl::Error::NotNullable),
8721                Some(len) => len,
8722            };
8723            // Calling decoder.out_of_line_offset(0) is not allowed.
8724            if len == 0 {
8725                return Ok(());
8726            };
8727            depth.increment()?;
8728            let envelope_size = 8;
8729            let bytes_len = len * envelope_size;
8730            let offset = decoder.out_of_line_offset(bytes_len)?;
8731            // Decode the envelope for each type.
8732            let mut _next_ordinal_to_read = 0;
8733            let mut next_offset = offset;
8734            let end_offset = offset + bytes_len;
8735            _next_ordinal_to_read += 1;
8736            if next_offset >= end_offset {
8737                return Ok(());
8738            }
8739
8740            // Decode unknown envelopes for gaps in ordinals.
8741            while _next_ordinal_to_read < 1 {
8742                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8743                _next_ordinal_to_read += 1;
8744                next_offset += envelope_size;
8745            }
8746
8747            let next_out_of_line = decoder.next_out_of_line();
8748            let handles_before = decoder.remaining_handles();
8749            if let Some((inlined, num_bytes, num_handles)) =
8750                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8751            {
8752                let member_inline_size =
8753                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8754                if inlined != (member_inline_size <= 4) {
8755                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8756                }
8757                let inner_offset;
8758                let mut inner_depth = depth.clone();
8759                if inlined {
8760                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8761                    inner_offset = next_offset;
8762                } else {
8763                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8764                    inner_depth.increment()?;
8765                }
8766                let val_ref =
8767                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
8768                fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
8769                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8770                {
8771                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8772                }
8773                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8774                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8775                }
8776            }
8777
8778            next_offset += envelope_size;
8779
8780            // Decode the remaining unknown envelopes.
8781            while next_offset < end_offset {
8782                _next_ordinal_to_read += 1;
8783                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8784                next_offset += envelope_size;
8785            }
8786
8787            Ok(())
8788        }
8789    }
8790
8791    impl Options {
8792        #[inline(always)]
8793        fn max_ordinal_present(&self) -> u64 {
8794            if let Some(_) = self.create_attributes {
8795                return 2;
8796            }
8797            if let Some(_) = self.attributes {
8798                return 1;
8799            }
8800            0
8801        }
8802    }
8803
8804    impl fidl::encoding::ValueTypeMarker for Options {
8805        type Borrowed<'a> = &'a Self;
8806        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8807            value
8808        }
8809    }
8810
8811    unsafe impl fidl::encoding::TypeMarker for Options {
8812        type Owned = Self;
8813
8814        #[inline(always)]
8815        fn inline_align(_context: fidl::encoding::Context) -> usize {
8816            8
8817        }
8818
8819        #[inline(always)]
8820        fn inline_size(_context: fidl::encoding::Context) -> usize {
8821            16
8822        }
8823    }
8824
8825    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
8826        unsafe fn encode(
8827            self,
8828            encoder: &mut fidl::encoding::Encoder<'_, D>,
8829            offset: usize,
8830            mut depth: fidl::encoding::Depth,
8831        ) -> fidl::Result<()> {
8832            encoder.debug_check_bounds::<Options>(offset);
8833            // Vector header
8834            let max_ordinal: u64 = self.max_ordinal_present();
8835            encoder.write_num(max_ordinal, offset);
8836            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8837            // Calling encoder.out_of_line_offset(0) is not allowed.
8838            if max_ordinal == 0 {
8839                return Ok(());
8840            }
8841            depth.increment()?;
8842            let envelope_size = 8;
8843            let bytes_len = max_ordinal as usize * envelope_size;
8844            #[allow(unused_variables)]
8845            let offset = encoder.out_of_line_offset(bytes_len);
8846            let mut _prev_end_offset: usize = 0;
8847            if 1 > max_ordinal {
8848                return Ok(());
8849            }
8850
8851            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8852            // are envelope_size bytes.
8853            let cur_offset: usize = (1 - 1) * envelope_size;
8854
8855            // Zero reserved fields.
8856            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8857
8858            // Safety:
8859            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8860            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8861            //   envelope_size bytes, there is always sufficient room.
8862            fidl::encoding::encode_in_envelope_optional::<NodeAttributesQuery, D>(
8863                self.attributes
8864                    .as_ref()
8865                    .map(<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow),
8866                encoder,
8867                offset + cur_offset,
8868                depth,
8869            )?;
8870
8871            _prev_end_offset = cur_offset + envelope_size;
8872            if 2 > max_ordinal {
8873                return Ok(());
8874            }
8875
8876            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8877            // are envelope_size bytes.
8878            let cur_offset: usize = (2 - 1) * envelope_size;
8879
8880            // Zero reserved fields.
8881            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8882
8883            // Safety:
8884            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8885            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8886            //   envelope_size bytes, there is always sufficient room.
8887            fidl::encoding::encode_in_envelope_optional::<MutableNodeAttributes, D>(
8888                self.create_attributes
8889                    .as_ref()
8890                    .map(<MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow),
8891                encoder,
8892                offset + cur_offset,
8893                depth,
8894            )?;
8895
8896            _prev_end_offset = cur_offset + envelope_size;
8897
8898            Ok(())
8899        }
8900    }
8901
8902    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
8903        #[inline(always)]
8904        fn new_empty() -> Self {
8905            Self::default()
8906        }
8907
8908        unsafe fn decode(
8909            &mut self,
8910            decoder: &mut fidl::encoding::Decoder<'_, D>,
8911            offset: usize,
8912            mut depth: fidl::encoding::Depth,
8913        ) -> fidl::Result<()> {
8914            decoder.debug_check_bounds::<Self>(offset);
8915            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8916                None => return Err(fidl::Error::NotNullable),
8917                Some(len) => len,
8918            };
8919            // Calling decoder.out_of_line_offset(0) is not allowed.
8920            if len == 0 {
8921                return Ok(());
8922            };
8923            depth.increment()?;
8924            let envelope_size = 8;
8925            let bytes_len = len * envelope_size;
8926            let offset = decoder.out_of_line_offset(bytes_len)?;
8927            // Decode the envelope for each type.
8928            let mut _next_ordinal_to_read = 0;
8929            let mut next_offset = offset;
8930            let end_offset = offset + bytes_len;
8931            _next_ordinal_to_read += 1;
8932            if next_offset >= end_offset {
8933                return Ok(());
8934            }
8935
8936            // Decode unknown envelopes for gaps in ordinals.
8937            while _next_ordinal_to_read < 1 {
8938                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8939                _next_ordinal_to_read += 1;
8940                next_offset += envelope_size;
8941            }
8942
8943            let next_out_of_line = decoder.next_out_of_line();
8944            let handles_before = decoder.remaining_handles();
8945            if let Some((inlined, num_bytes, num_handles)) =
8946                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8947            {
8948                let member_inline_size =
8949                    <NodeAttributesQuery as fidl::encoding::TypeMarker>::inline_size(
8950                        decoder.context,
8951                    );
8952                if inlined != (member_inline_size <= 4) {
8953                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8954                }
8955                let inner_offset;
8956                let mut inner_depth = depth.clone();
8957                if inlined {
8958                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8959                    inner_offset = next_offset;
8960                } else {
8961                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8962                    inner_depth.increment()?;
8963                }
8964                let val_ref =
8965                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributesQuery, D));
8966                fidl::decode!(NodeAttributesQuery, D, val_ref, decoder, inner_offset, inner_depth)?;
8967                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8968                {
8969                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8970                }
8971                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8972                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8973                }
8974            }
8975
8976            next_offset += envelope_size;
8977            _next_ordinal_to_read += 1;
8978            if next_offset >= end_offset {
8979                return Ok(());
8980            }
8981
8982            // Decode unknown envelopes for gaps in ordinals.
8983            while _next_ordinal_to_read < 2 {
8984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8985                _next_ordinal_to_read += 1;
8986                next_offset += envelope_size;
8987            }
8988
8989            let next_out_of_line = decoder.next_out_of_line();
8990            let handles_before = decoder.remaining_handles();
8991            if let Some((inlined, num_bytes, num_handles)) =
8992                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8993            {
8994                let member_inline_size =
8995                    <MutableNodeAttributes as fidl::encoding::TypeMarker>::inline_size(
8996                        decoder.context,
8997                    );
8998                if inlined != (member_inline_size <= 4) {
8999                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9000                }
9001                let inner_offset;
9002                let mut inner_depth = depth.clone();
9003                if inlined {
9004                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9005                    inner_offset = next_offset;
9006                } else {
9007                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9008                    inner_depth.increment()?;
9009                }
9010                let val_ref = self
9011                    .create_attributes
9012                    .get_or_insert_with(|| fidl::new_empty!(MutableNodeAttributes, D));
9013                fidl::decode!(
9014                    MutableNodeAttributes,
9015                    D,
9016                    val_ref,
9017                    decoder,
9018                    inner_offset,
9019                    inner_depth
9020                )?;
9021                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9022                {
9023                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9024                }
9025                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9026                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9027                }
9028            }
9029
9030            next_offset += envelope_size;
9031
9032            // Decode the remaining unknown envelopes.
9033            while next_offset < end_offset {
9034                _next_ordinal_to_read += 1;
9035                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9036                next_offset += envelope_size;
9037            }
9038
9039            Ok(())
9040        }
9041    }
9042
9043    impl SymlinkInfo {
9044        #[inline(always)]
9045        fn max_ordinal_present(&self) -> u64 {
9046            if let Some(_) = self.attributes {
9047                return 2;
9048            }
9049            if let Some(_) = self.target {
9050                return 1;
9051            }
9052            0
9053        }
9054    }
9055
9056    impl fidl::encoding::ValueTypeMarker for SymlinkInfo {
9057        type Borrowed<'a> = &'a Self;
9058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9059            value
9060        }
9061    }
9062
9063    unsafe impl fidl::encoding::TypeMarker for SymlinkInfo {
9064        type Owned = Self;
9065
9066        #[inline(always)]
9067        fn inline_align(_context: fidl::encoding::Context) -> usize {
9068            8
9069        }
9070
9071        #[inline(always)]
9072        fn inline_size(_context: fidl::encoding::Context) -> usize {
9073            16
9074        }
9075    }
9076
9077    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SymlinkInfo, D>
9078        for &SymlinkInfo
9079    {
9080        unsafe fn encode(
9081            self,
9082            encoder: &mut fidl::encoding::Encoder<'_, D>,
9083            offset: usize,
9084            mut depth: fidl::encoding::Depth,
9085        ) -> fidl::Result<()> {
9086            encoder.debug_check_bounds::<SymlinkInfo>(offset);
9087            // Vector header
9088            let max_ordinal: u64 = self.max_ordinal_present();
9089            encoder.write_num(max_ordinal, offset);
9090            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9091            // Calling encoder.out_of_line_offset(0) is not allowed.
9092            if max_ordinal == 0 {
9093                return Ok(());
9094            }
9095            depth.increment()?;
9096            let envelope_size = 8;
9097            let bytes_len = max_ordinal as usize * envelope_size;
9098            #[allow(unused_variables)]
9099            let offset = encoder.out_of_line_offset(bytes_len);
9100            let mut _prev_end_offset: usize = 0;
9101            if 1 > max_ordinal {
9102                return Ok(());
9103            }
9104
9105            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9106            // are envelope_size bytes.
9107            let cur_offset: usize = (1 - 1) * envelope_size;
9108
9109            // Zero reserved fields.
9110            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9111
9112            // Safety:
9113            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9114            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9115            //   envelope_size bytes, there is always sufficient room.
9116            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 4095>, D>(
9117                self.target.as_ref().map(
9118                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow,
9119                ),
9120                encoder,
9121                offset + cur_offset,
9122                depth,
9123            )?;
9124
9125            _prev_end_offset = cur_offset + envelope_size;
9126            if 2 > max_ordinal {
9127                return Ok(());
9128            }
9129
9130            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9131            // are envelope_size bytes.
9132            let cur_offset: usize = (2 - 1) * envelope_size;
9133
9134            // Zero reserved fields.
9135            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9136
9137            // Safety:
9138            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9139            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9140            //   envelope_size bytes, there is always sufficient room.
9141            fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
9142                self.attributes
9143                    .as_ref()
9144                    .map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
9145                encoder,
9146                offset + cur_offset,
9147                depth,
9148            )?;
9149
9150            _prev_end_offset = cur_offset + envelope_size;
9151
9152            Ok(())
9153        }
9154    }
9155
9156    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkInfo {
9157        #[inline(always)]
9158        fn new_empty() -> Self {
9159            Self::default()
9160        }
9161
9162        unsafe fn decode(
9163            &mut self,
9164            decoder: &mut fidl::encoding::Decoder<'_, D>,
9165            offset: usize,
9166            mut depth: fidl::encoding::Depth,
9167        ) -> fidl::Result<()> {
9168            decoder.debug_check_bounds::<Self>(offset);
9169            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9170                None => return Err(fidl::Error::NotNullable),
9171                Some(len) => len,
9172            };
9173            // Calling decoder.out_of_line_offset(0) is not allowed.
9174            if len == 0 {
9175                return Ok(());
9176            };
9177            depth.increment()?;
9178            let envelope_size = 8;
9179            let bytes_len = len * envelope_size;
9180            let offset = decoder.out_of_line_offset(bytes_len)?;
9181            // Decode the envelope for each type.
9182            let mut _next_ordinal_to_read = 0;
9183            let mut next_offset = offset;
9184            let end_offset = offset + bytes_len;
9185            _next_ordinal_to_read += 1;
9186            if next_offset >= end_offset {
9187                return Ok(());
9188            }
9189
9190            // Decode unknown envelopes for gaps in ordinals.
9191            while _next_ordinal_to_read < 1 {
9192                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9193                _next_ordinal_to_read += 1;
9194                next_offset += envelope_size;
9195            }
9196
9197            let next_out_of_line = decoder.next_out_of_line();
9198            let handles_before = decoder.remaining_handles();
9199            if let Some((inlined, num_bytes, num_handles)) =
9200                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9201            {
9202                let member_inline_size =
9203                    <fidl::encoding::Vector<u8, 4095> as fidl::encoding::TypeMarker>::inline_size(
9204                        decoder.context,
9205                    );
9206                if inlined != (member_inline_size <= 4) {
9207                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9208                }
9209                let inner_offset;
9210                let mut inner_depth = depth.clone();
9211                if inlined {
9212                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9213                    inner_offset = next_offset;
9214                } else {
9215                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9216                    inner_depth.increment()?;
9217                }
9218                let val_ref = self
9219                    .target
9220                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, D));
9221                fidl::decode!(fidl::encoding::Vector<u8, 4095>, D, val_ref, decoder, inner_offset, inner_depth)?;
9222                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9223                {
9224                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9225                }
9226                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9227                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9228                }
9229            }
9230
9231            next_offset += envelope_size;
9232            _next_ordinal_to_read += 1;
9233            if next_offset >= end_offset {
9234                return Ok(());
9235            }
9236
9237            // Decode unknown envelopes for gaps in ordinals.
9238            while _next_ordinal_to_read < 2 {
9239                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9240                _next_ordinal_to_read += 1;
9241                next_offset += envelope_size;
9242            }
9243
9244            let next_out_of_line = decoder.next_out_of_line();
9245            let handles_before = decoder.remaining_handles();
9246            if let Some((inlined, num_bytes, num_handles)) =
9247                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9248            {
9249                let member_inline_size =
9250                    <NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9251                if inlined != (member_inline_size <= 4) {
9252                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9253                }
9254                let inner_offset;
9255                let mut inner_depth = depth.clone();
9256                if inlined {
9257                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9258                    inner_offset = next_offset;
9259                } else {
9260                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9261                    inner_depth.increment()?;
9262                }
9263                let val_ref =
9264                    self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
9265                fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
9266                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9267                {
9268                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9269                }
9270                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9271                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9272                }
9273            }
9274
9275            next_offset += envelope_size;
9276
9277            // Decode the remaining unknown envelopes.
9278            while next_offset < end_offset {
9279                _next_ordinal_to_read += 1;
9280                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9281                next_offset += envelope_size;
9282            }
9283
9284            Ok(())
9285        }
9286    }
9287
9288    impl UnlinkOptions {
9289        #[inline(always)]
9290        fn max_ordinal_present(&self) -> u64 {
9291            if let Some(_) = self.flags {
9292                return 1;
9293            }
9294            0
9295        }
9296    }
9297
9298    impl fidl::encoding::ValueTypeMarker for UnlinkOptions {
9299        type Borrowed<'a> = &'a Self;
9300        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9301            value
9302        }
9303    }
9304
9305    unsafe impl fidl::encoding::TypeMarker for UnlinkOptions {
9306        type Owned = Self;
9307
9308        #[inline(always)]
9309        fn inline_align(_context: fidl::encoding::Context) -> usize {
9310            8
9311        }
9312
9313        #[inline(always)]
9314        fn inline_size(_context: fidl::encoding::Context) -> usize {
9315            16
9316        }
9317    }
9318
9319    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnlinkOptions, D>
9320        for &UnlinkOptions
9321    {
9322        unsafe fn encode(
9323            self,
9324            encoder: &mut fidl::encoding::Encoder<'_, D>,
9325            offset: usize,
9326            mut depth: fidl::encoding::Depth,
9327        ) -> fidl::Result<()> {
9328            encoder.debug_check_bounds::<UnlinkOptions>(offset);
9329            // Vector header
9330            let max_ordinal: u64 = self.max_ordinal_present();
9331            encoder.write_num(max_ordinal, offset);
9332            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9333            // Calling encoder.out_of_line_offset(0) is not allowed.
9334            if max_ordinal == 0 {
9335                return Ok(());
9336            }
9337            depth.increment()?;
9338            let envelope_size = 8;
9339            let bytes_len = max_ordinal as usize * envelope_size;
9340            #[allow(unused_variables)]
9341            let offset = encoder.out_of_line_offset(bytes_len);
9342            let mut _prev_end_offset: usize = 0;
9343            if 1 > max_ordinal {
9344                return Ok(());
9345            }
9346
9347            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9348            // are envelope_size bytes.
9349            let cur_offset: usize = (1 - 1) * envelope_size;
9350
9351            // Zero reserved fields.
9352            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9353
9354            // Safety:
9355            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9356            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9357            //   envelope_size bytes, there is always sufficient room.
9358            fidl::encoding::encode_in_envelope_optional::<UnlinkFlags, D>(
9359                self.flags.as_ref().map(<UnlinkFlags as fidl::encoding::ValueTypeMarker>::borrow),
9360                encoder,
9361                offset + cur_offset,
9362                depth,
9363            )?;
9364
9365            _prev_end_offset = cur_offset + envelope_size;
9366
9367            Ok(())
9368        }
9369    }
9370
9371    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnlinkOptions {
9372        #[inline(always)]
9373        fn new_empty() -> Self {
9374            Self::default()
9375        }
9376
9377        unsafe fn decode(
9378            &mut self,
9379            decoder: &mut fidl::encoding::Decoder<'_, D>,
9380            offset: usize,
9381            mut depth: fidl::encoding::Depth,
9382        ) -> fidl::Result<()> {
9383            decoder.debug_check_bounds::<Self>(offset);
9384            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9385                None => return Err(fidl::Error::NotNullable),
9386                Some(len) => len,
9387            };
9388            // Calling decoder.out_of_line_offset(0) is not allowed.
9389            if len == 0 {
9390                return Ok(());
9391            };
9392            depth.increment()?;
9393            let envelope_size = 8;
9394            let bytes_len = len * envelope_size;
9395            let offset = decoder.out_of_line_offset(bytes_len)?;
9396            // Decode the envelope for each type.
9397            let mut _next_ordinal_to_read = 0;
9398            let mut next_offset = offset;
9399            let end_offset = offset + bytes_len;
9400            _next_ordinal_to_read += 1;
9401            if next_offset >= end_offset {
9402                return Ok(());
9403            }
9404
9405            // Decode unknown envelopes for gaps in ordinals.
9406            while _next_ordinal_to_read < 1 {
9407                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9408                _next_ordinal_to_read += 1;
9409                next_offset += envelope_size;
9410            }
9411
9412            let next_out_of_line = decoder.next_out_of_line();
9413            let handles_before = decoder.remaining_handles();
9414            if let Some((inlined, num_bytes, num_handles)) =
9415                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9416            {
9417                let member_inline_size =
9418                    <UnlinkFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9419                if inlined != (member_inline_size <= 4) {
9420                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9421                }
9422                let inner_offset;
9423                let mut inner_depth = depth.clone();
9424                if inlined {
9425                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9426                    inner_offset = next_offset;
9427                } else {
9428                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9429                    inner_depth.increment()?;
9430                }
9431                let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(UnlinkFlags, D));
9432                fidl::decode!(UnlinkFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
9433                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9434                {
9435                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9436                }
9437                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9438                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9439                }
9440            }
9441
9442            next_offset += envelope_size;
9443
9444            // Decode the remaining unknown envelopes.
9445            while next_offset < end_offset {
9446                _next_ordinal_to_read += 1;
9447                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9448                next_offset += envelope_size;
9449            }
9450
9451            Ok(())
9452        }
9453    }
9454
9455    impl VerificationOptions {
9456        #[inline(always)]
9457        fn max_ordinal_present(&self) -> u64 {
9458            if let Some(_) = self.salt {
9459                return 2;
9460            }
9461            if let Some(_) = self.hash_algorithm {
9462                return 1;
9463            }
9464            0
9465        }
9466    }
9467
9468    impl fidl::encoding::ValueTypeMarker for VerificationOptions {
9469        type Borrowed<'a> = &'a Self;
9470        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9471            value
9472        }
9473    }
9474
9475    unsafe impl fidl::encoding::TypeMarker for VerificationOptions {
9476        type Owned = Self;
9477
9478        #[inline(always)]
9479        fn inline_align(_context: fidl::encoding::Context) -> usize {
9480            8
9481        }
9482
9483        #[inline(always)]
9484        fn inline_size(_context: fidl::encoding::Context) -> usize {
9485            16
9486        }
9487    }
9488
9489    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VerificationOptions, D>
9490        for &VerificationOptions
9491    {
9492        unsafe fn encode(
9493            self,
9494            encoder: &mut fidl::encoding::Encoder<'_, D>,
9495            offset: usize,
9496            mut depth: fidl::encoding::Depth,
9497        ) -> fidl::Result<()> {
9498            encoder.debug_check_bounds::<VerificationOptions>(offset);
9499            // Vector header
9500            let max_ordinal: u64 = self.max_ordinal_present();
9501            encoder.write_num(max_ordinal, offset);
9502            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9503            // Calling encoder.out_of_line_offset(0) is not allowed.
9504            if max_ordinal == 0 {
9505                return Ok(());
9506            }
9507            depth.increment()?;
9508            let envelope_size = 8;
9509            let bytes_len = max_ordinal as usize * envelope_size;
9510            #[allow(unused_variables)]
9511            let offset = encoder.out_of_line_offset(bytes_len);
9512            let mut _prev_end_offset: usize = 0;
9513            if 1 > max_ordinal {
9514                return Ok(());
9515            }
9516
9517            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9518            // are envelope_size bytes.
9519            let cur_offset: usize = (1 - 1) * envelope_size;
9520
9521            // Zero reserved fields.
9522            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9523
9524            // Safety:
9525            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9526            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9527            //   envelope_size bytes, there is always sufficient room.
9528            fidl::encoding::encode_in_envelope_optional::<HashAlgorithm, D>(
9529                self.hash_algorithm
9530                    .as_ref()
9531                    .map(<HashAlgorithm as fidl::encoding::ValueTypeMarker>::borrow),
9532                encoder,
9533                offset + cur_offset,
9534                depth,
9535            )?;
9536
9537            _prev_end_offset = cur_offset + envelope_size;
9538            if 2 > max_ordinal {
9539                return Ok(());
9540            }
9541
9542            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9543            // are envelope_size bytes.
9544            let cur_offset: usize = (2 - 1) * envelope_size;
9545
9546            // Zero reserved fields.
9547            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9548
9549            // Safety:
9550            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9551            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9552            //   envelope_size bytes, there is always sufficient room.
9553            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
9554                self.salt.as_ref().map(
9555                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
9556                ),
9557                encoder,
9558                offset + cur_offset,
9559                depth,
9560            )?;
9561
9562            _prev_end_offset = cur_offset + envelope_size;
9563
9564            Ok(())
9565        }
9566    }
9567
9568    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VerificationOptions {
9569        #[inline(always)]
9570        fn new_empty() -> Self {
9571            Self::default()
9572        }
9573
9574        unsafe fn decode(
9575            &mut self,
9576            decoder: &mut fidl::encoding::Decoder<'_, D>,
9577            offset: usize,
9578            mut depth: fidl::encoding::Depth,
9579        ) -> fidl::Result<()> {
9580            decoder.debug_check_bounds::<Self>(offset);
9581            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9582                None => return Err(fidl::Error::NotNullable),
9583                Some(len) => len,
9584            };
9585            // Calling decoder.out_of_line_offset(0) is not allowed.
9586            if len == 0 {
9587                return Ok(());
9588            };
9589            depth.increment()?;
9590            let envelope_size = 8;
9591            let bytes_len = len * envelope_size;
9592            let offset = decoder.out_of_line_offset(bytes_len)?;
9593            // Decode the envelope for each type.
9594            let mut _next_ordinal_to_read = 0;
9595            let mut next_offset = offset;
9596            let end_offset = offset + bytes_len;
9597            _next_ordinal_to_read += 1;
9598            if next_offset >= end_offset {
9599                return Ok(());
9600            }
9601
9602            // Decode unknown envelopes for gaps in ordinals.
9603            while _next_ordinal_to_read < 1 {
9604                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9605                _next_ordinal_to_read += 1;
9606                next_offset += envelope_size;
9607            }
9608
9609            let next_out_of_line = decoder.next_out_of_line();
9610            let handles_before = decoder.remaining_handles();
9611            if let Some((inlined, num_bytes, num_handles)) =
9612                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9613            {
9614                let member_inline_size =
9615                    <HashAlgorithm as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9616                if inlined != (member_inline_size <= 4) {
9617                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9618                }
9619                let inner_offset;
9620                let mut inner_depth = depth.clone();
9621                if inlined {
9622                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9623                    inner_offset = next_offset;
9624                } else {
9625                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9626                    inner_depth.increment()?;
9627                }
9628                let val_ref =
9629                    self.hash_algorithm.get_or_insert_with(|| fidl::new_empty!(HashAlgorithm, D));
9630                fidl::decode!(HashAlgorithm, D, val_ref, decoder, inner_offset, inner_depth)?;
9631                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9632                {
9633                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9634                }
9635                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9636                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9637                }
9638            }
9639
9640            next_offset += envelope_size;
9641            _next_ordinal_to_read += 1;
9642            if next_offset >= end_offset {
9643                return Ok(());
9644            }
9645
9646            // Decode unknown envelopes for gaps in ordinals.
9647            while _next_ordinal_to_read < 2 {
9648                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9649                _next_ordinal_to_read += 1;
9650                next_offset += envelope_size;
9651            }
9652
9653            let next_out_of_line = decoder.next_out_of_line();
9654            let handles_before = decoder.remaining_handles();
9655            if let Some((inlined, num_bytes, num_handles)) =
9656                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9657            {
9658                let member_inline_size =
9659                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
9660                        decoder.context,
9661                    );
9662                if inlined != (member_inline_size <= 4) {
9663                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9664                }
9665                let inner_offset;
9666                let mut inner_depth = depth.clone();
9667                if inlined {
9668                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9669                    inner_offset = next_offset;
9670                } else {
9671                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9672                    inner_depth.increment()?;
9673                }
9674                let val_ref = self
9675                    .salt
9676                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
9677                fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
9678                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9679                {
9680                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9681                }
9682                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9683                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9684                }
9685            }
9686
9687            next_offset += envelope_size;
9688
9689            // Decode the remaining unknown envelopes.
9690            while next_offset < end_offset {
9691                _next_ordinal_to_read += 1;
9692                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9693                next_offset += envelope_size;
9694            }
9695
9696            Ok(())
9697        }
9698    }
9699
9700    impl fidl::encoding::ValueTypeMarker for SelinuxContext {
9701        type Borrowed<'a> = &'a Self;
9702        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9703            value
9704        }
9705    }
9706
9707    unsafe impl fidl::encoding::TypeMarker for SelinuxContext {
9708        type Owned = Self;
9709
9710        #[inline(always)]
9711        fn inline_align(_context: fidl::encoding::Context) -> usize {
9712            8
9713        }
9714
9715        #[inline(always)]
9716        fn inline_size(_context: fidl::encoding::Context) -> usize {
9717            16
9718        }
9719    }
9720
9721    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SelinuxContext, D>
9722        for &SelinuxContext
9723    {
9724        #[inline]
9725        unsafe fn encode(
9726            self,
9727            encoder: &mut fidl::encoding::Encoder<'_, D>,
9728            offset: usize,
9729            _depth: fidl::encoding::Depth,
9730        ) -> fidl::Result<()> {
9731            encoder.debug_check_bounds::<SelinuxContext>(offset);
9732            encoder.write_num::<u64>(self.ordinal(), offset);
9733            match self {
9734                SelinuxContext::Data(ref val) => fidl::encoding::encode_in_envelope::<
9735                    fidl::encoding::Vector<u8, 256>,
9736                    D,
9737                >(
9738                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(
9739                        val,
9740                    ),
9741                    encoder,
9742                    offset + 8,
9743                    _depth,
9744                ),
9745                SelinuxContext::UseExtendedAttributes(ref val) => {
9746                    fidl::encoding::encode_in_envelope::<EmptyStruct, D>(
9747                        <EmptyStruct as fidl::encoding::ValueTypeMarker>::borrow(val),
9748                        encoder,
9749                        offset + 8,
9750                        _depth,
9751                    )
9752                }
9753                SelinuxContext::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
9754            }
9755        }
9756    }
9757
9758    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SelinuxContext {
9759        #[inline(always)]
9760        fn new_empty() -> Self {
9761            Self::__SourceBreaking { unknown_ordinal: 0 }
9762        }
9763
9764        #[inline]
9765        unsafe fn decode(
9766            &mut self,
9767            decoder: &mut fidl::encoding::Decoder<'_, D>,
9768            offset: usize,
9769            mut depth: fidl::encoding::Depth,
9770        ) -> fidl::Result<()> {
9771            decoder.debug_check_bounds::<Self>(offset);
9772            #[allow(unused_variables)]
9773            let next_out_of_line = decoder.next_out_of_line();
9774            let handles_before = decoder.remaining_handles();
9775            let (ordinal, inlined, num_bytes, num_handles) =
9776                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
9777
9778            let member_inline_size = match ordinal {
9779                1 => <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
9780                    decoder.context,
9781                ),
9782                2 => <EmptyStruct as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9783                0 => return Err(fidl::Error::UnknownUnionTag),
9784                _ => num_bytes as usize,
9785            };
9786
9787            if inlined != (member_inline_size <= 4) {
9788                return Err(fidl::Error::InvalidInlineBitInEnvelope);
9789            }
9790            let _inner_offset;
9791            if inlined {
9792                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
9793                _inner_offset = offset + 8;
9794            } else {
9795                depth.increment()?;
9796                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9797            }
9798            match ordinal {
9799                1 => {
9800                    #[allow(irrefutable_let_patterns)]
9801                    if let SelinuxContext::Data(_) = self {
9802                        // Do nothing, read the value into the object
9803                    } else {
9804                        // Initialize `self` to the right variant
9805                        *self = SelinuxContext::Data(
9806                            fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D),
9807                        );
9808                    }
9809                    #[allow(irrefutable_let_patterns)]
9810                    if let SelinuxContext::Data(ref mut val) = self {
9811                        fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val, decoder, _inner_offset, depth)?;
9812                    } else {
9813                        unreachable!()
9814                    }
9815                }
9816                2 => {
9817                    #[allow(irrefutable_let_patterns)]
9818                    if let SelinuxContext::UseExtendedAttributes(_) = self {
9819                        // Do nothing, read the value into the object
9820                    } else {
9821                        // Initialize `self` to the right variant
9822                        *self =
9823                            SelinuxContext::UseExtendedAttributes(fidl::new_empty!(EmptyStruct, D));
9824                    }
9825                    #[allow(irrefutable_let_patterns)]
9826                    if let SelinuxContext::UseExtendedAttributes(ref mut val) = self {
9827                        fidl::decode!(EmptyStruct, D, val, decoder, _inner_offset, depth)?;
9828                    } else {
9829                        unreachable!()
9830                    }
9831                }
9832                #[allow(deprecated)]
9833                ordinal => {
9834                    for _ in 0..num_handles {
9835                        decoder.drop_next_handle()?;
9836                    }
9837                    *self = SelinuxContext::__SourceBreaking { unknown_ordinal: ordinal };
9838                }
9839            }
9840            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
9841                return Err(fidl::Error::InvalidNumBytesInEnvelope);
9842            }
9843            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9844                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9845            }
9846            Ok(())
9847        }
9848    }
9849}