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