Skip to main content

fidl_fuchsia_io__common/
fidl_fuchsia_io__common.rs

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