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