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 ConfigKey = String;
13
14pub type ChildName = String;
15
16pub type DictionaryPath = String;
24
25pub type Name = String;
26
27pub type UrlScheme = String;
28
29pub const CONFIG_KEY_MAX_SIZE: u32 = 64;
31
32pub const MAX_CHILD_NAME_LENGTH: u32 = 1024;
33
34pub const MAX_MONIKER_LENGTH: u32 = 4096;
35
36pub const MAX_NAME_LENGTH: u32 = 100;
37
38pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100;
40
41pub const MAX_PATH_LENGTH: u32 = 1024;
42
43pub const MAX_URL_SCHEME_LENGTH: u32 = 100;
44
45bitflags! {
46 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
48 pub struct ConfigMutability: u32 {
49 const PARENT = 1;
51 }
52}
53
54impl ConfigMutability {
55 #[inline(always)]
56 pub fn from_bits_allow_unknown(bits: u32) -> Self {
57 Self::from_bits_retain(bits)
58 }
59
60 #[inline(always)]
61 pub fn has_unknown_bits(&self) -> bool {
62 self.get_unknown_bits() != 0
63 }
64
65 #[inline(always)]
66 pub fn get_unknown_bits(&self) -> u32 {
67 self.bits() & !Self::all().bits()
68 }
69}
70
71#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
73#[repr(u32)]
74pub enum AllowedOffers {
75 StaticOnly = 1,
81 StaticAndDynamic = 2,
86}
87
88impl AllowedOffers {
89 #[inline]
90 pub fn from_primitive(prim: u32) -> Option<Self> {
91 match prim {
92 1 => Some(Self::StaticOnly),
93 2 => Some(Self::StaticAndDynamic),
94 _ => None,
95 }
96 }
97
98 #[inline]
99 pub const fn into_primitive(self) -> u32 {
100 self as u32
101 }
102
103 #[deprecated = "Strict enums should not use `is_unknown`"]
104 #[inline]
105 pub fn is_unknown(&self) -> bool {
106 false
107 }
108}
109
110#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
118#[repr(u32)]
119pub enum Availability {
120 Required = 1,
123 Optional = 2,
130 SameAsTarget = 3,
138 Transitional = 4,
144}
145
146impl Availability {
147 #[inline]
148 pub fn from_primitive(prim: u32) -> Option<Self> {
149 match prim {
150 1 => Some(Self::Required),
151 2 => Some(Self::Optional),
152 3 => Some(Self::SameAsTarget),
153 4 => Some(Self::Transitional),
154 _ => None,
155 }
156 }
157
158 #[inline]
159 pub const fn into_primitive(self) -> u32 {
160 self as u32
161 }
162
163 #[deprecated = "Strict enums should not use `is_unknown`"]
164 #[inline]
165 pub fn is_unknown(&self) -> bool {
166 false
167 }
168}
169
170#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
171pub enum ConfigTypeLayout {
172 Bool,
173 Uint8,
174 Uint16,
175 Uint32,
176 Uint64,
177 Int8,
178 Int16,
179 Int32,
180 Int64,
181 String,
182 Vector,
183 #[doc(hidden)]
184 __SourceBreaking {
185 unknown_ordinal: u32,
186 },
187}
188
189#[macro_export]
191macro_rules! ConfigTypeLayoutUnknown {
192 () => {
193 _
194 };
195}
196
197impl ConfigTypeLayout {
198 #[inline]
199 pub fn from_primitive(prim: u32) -> Option<Self> {
200 match prim {
201 1 => Some(Self::Bool),
202 2 => Some(Self::Uint8),
203 3 => Some(Self::Uint16),
204 4 => Some(Self::Uint32),
205 5 => Some(Self::Uint64),
206 6 => Some(Self::Int8),
207 7 => Some(Self::Int16),
208 8 => Some(Self::Int32),
209 9 => Some(Self::Int64),
210 10 => Some(Self::String),
211 11 => Some(Self::Vector),
212 _ => None,
213 }
214 }
215
216 #[inline]
217 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
218 match prim {
219 1 => Self::Bool,
220 2 => Self::Uint8,
221 3 => Self::Uint16,
222 4 => Self::Uint32,
223 5 => Self::Uint64,
224 6 => Self::Int8,
225 7 => Self::Int16,
226 8 => Self::Int32,
227 9 => Self::Int64,
228 10 => Self::String,
229 11 => Self::Vector,
230 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
231 }
232 }
233
234 #[inline]
235 pub fn unknown() -> Self {
236 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
237 }
238
239 #[inline]
240 pub const fn into_primitive(self) -> u32 {
241 match self {
242 Self::Bool => 1,
243 Self::Uint8 => 2,
244 Self::Uint16 => 3,
245 Self::Uint32 => 4,
246 Self::Uint64 => 5,
247 Self::Int8 => 6,
248 Self::Int16 => 7,
249 Self::Int32 => 8,
250 Self::Int64 => 9,
251 Self::String => 10,
252 Self::Vector => 11,
253 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
254 }
255 }
256
257 #[inline]
258 pub fn is_unknown(&self) -> bool {
259 match self {
260 Self::__SourceBreaking { unknown_ordinal: _ } => true,
261 _ => false,
262 }
263 }
264}
265
266#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
270pub enum DeliveryType {
271 Immediate,
274 OnReadable,
279 #[doc(hidden)]
280 __SourceBreaking { unknown_ordinal: u32 },
281}
282
283#[macro_export]
285macro_rules! DeliveryTypeUnknown {
286 () => {
287 _
288 };
289}
290
291impl DeliveryType {
292 #[inline]
293 pub fn from_primitive(prim: u32) -> Option<Self> {
294 match prim {
295 0 => Some(Self::Immediate),
296 1 => Some(Self::OnReadable),
297 _ => None,
298 }
299 }
300
301 #[inline]
302 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
303 match prim {
304 0 => Self::Immediate,
305 1 => Self::OnReadable,
306 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
307 }
308 }
309
310 #[inline]
311 pub fn unknown() -> Self {
312 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
313 }
314
315 #[inline]
316 pub const fn into_primitive(self) -> u32 {
317 match self {
318 Self::Immediate => 0,
319 Self::OnReadable => 1,
320 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
321 }
322 }
323
324 #[inline]
325 pub fn is_unknown(&self) -> bool {
326 match self {
327 Self::__SourceBreaking { unknown_ordinal: _ } => true,
328 _ => false,
329 }
330 }
331}
332
333#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
335#[repr(u32)]
336pub enum DependencyType {
337 Strong = 1,
339 Weak = 2,
343}
344
345impl DependencyType {
346 #[inline]
347 pub fn from_primitive(prim: u32) -> Option<Self> {
348 match prim {
349 1 => Some(Self::Strong),
350 2 => Some(Self::Weak),
351 _ => None,
352 }
353 }
354
355 #[inline]
356 pub const fn into_primitive(self) -> u32 {
357 self as u32
358 }
359
360 #[deprecated = "Strict enums should not use `is_unknown`"]
361 #[inline]
362 pub fn is_unknown(&self) -> bool {
363 false
364 }
365}
366
367#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
369#[repr(u32)]
370pub enum Durability {
371 Transient = 2,
374 SingleRun = 3,
377}
378
379impl Durability {
380 #[inline]
381 pub fn from_primitive(prim: u32) -> Option<Self> {
382 match prim {
383 2 => Some(Self::Transient),
384 3 => Some(Self::SingleRun),
385 _ => None,
386 }
387 }
388
389 #[inline]
390 pub const fn into_primitive(self) -> u32 {
391 self as u32
392 }
393
394 #[deprecated = "Strict enums should not use `is_unknown`"]
395 #[inline]
396 pub fn is_unknown(&self) -> bool {
397 false
398 }
399}
400
401#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
403#[repr(u32)]
404pub enum EnvironmentExtends {
405 None = 0,
407 Realm = 1,
410}
411
412impl EnvironmentExtends {
413 #[inline]
414 pub fn from_primitive(prim: u32) -> Option<Self> {
415 match prim {
416 0 => Some(Self::None),
417 1 => Some(Self::Realm),
418 _ => None,
419 }
420 }
421
422 #[inline]
423 pub const fn into_primitive(self) -> u32 {
424 self as u32
425 }
426
427 #[deprecated = "Strict enums should not use `is_unknown`"]
428 #[inline]
429 pub fn is_unknown(&self) -> bool {
430 false
431 }
432}
433
434#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
437#[repr(u32)]
438pub enum OnTerminate {
439 None = 0,
441 Reboot = 1,
446}
447
448impl OnTerminate {
449 #[inline]
450 pub fn from_primitive(prim: u32) -> Option<Self> {
451 match prim {
452 0 => Some(Self::None),
453 1 => Some(Self::Reboot),
454 _ => None,
455 }
456 }
457
458 #[inline]
459 pub const fn into_primitive(self) -> u32 {
460 self as u32
461 }
462
463 #[deprecated = "Strict enums should not use `is_unknown`"]
464 #[inline]
465 pub fn is_unknown(&self) -> bool {
466 false
467 }
468}
469
470#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
472#[repr(u32)]
473pub enum StartupMode {
474 Lazy = 0,
477 Eager = 1,
480}
481
482impl StartupMode {
483 #[inline]
484 pub fn from_primitive(prim: u32) -> Option<Self> {
485 match prim {
486 0 => Some(Self::Lazy),
487 1 => Some(Self::Eager),
488 _ => None,
489 }
490 }
491
492 #[inline]
493 pub const fn into_primitive(self) -> u32 {
494 self as u32
495 }
496
497 #[deprecated = "Strict enums should not use `is_unknown`"]
498 #[inline]
499 pub fn is_unknown(&self) -> bool {
500 false
501 }
502}
503
504#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
507#[repr(u32)]
508pub enum StorageId {
509 StaticInstanceId = 1,
513 StaticInstanceIdOrMoniker = 2,
518}
519
520impl StorageId {
521 #[inline]
522 pub fn from_primitive(prim: u32) -> Option<Self> {
523 match prim {
524 1 => Some(Self::StaticInstanceId),
525 2 => Some(Self::StaticInstanceIdOrMoniker),
526 _ => None,
527 }
528 }
529
530 #[inline]
531 pub const fn into_primitive(self) -> u32 {
532 self as u32
533 }
534
535 #[deprecated = "Strict enums should not use `is_unknown`"]
536 #[inline]
537 pub fn is_unknown(&self) -> bool {
538 false
539 }
540}
541
542#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
544pub struct CapabilityRef {
545 pub name: String,
546}
547
548impl fidl::Persistable for CapabilityRef {}
549
550#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
552pub struct ChildRef {
553 pub name: String,
556 pub collection: Option<String>,
560}
561
562impl fidl::Persistable for ChildRef {}
563
564#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
566pub struct CollectionRef {
567 pub name: String,
568}
569
570impl fidl::Persistable for CollectionRef {}
571
572#[derive(Clone, Debug, PartialEq)]
573pub struct ConfigType {
574 pub layout: ConfigTypeLayout,
575 pub parameters: Option<Vec<LayoutParameter>>,
576 pub constraints: Vec<LayoutConstraint>,
577}
578
579impl fidl::Persistable for ConfigType {}
580
581#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
583pub struct DebugRef;
584
585impl fidl::Persistable for DebugRef {}
586
587#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
589pub struct EnvironmentRef;
590
591impl fidl::Persistable for EnvironmentRef {}
592
593#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
595pub struct FrameworkRef;
596
597impl fidl::Persistable for FrameworkRef {}
598
599#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
602pub struct NameMapping {
603 pub source_name: String,
605 pub target_name: String,
607}
608
609impl fidl::Persistable for NameMapping {}
610
611#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
613pub struct ParentRef;
614
615impl fidl::Persistable for ParentRef {}
616
617#[derive(Clone, Debug, PartialEq)]
619pub struct ResolvedConfig {
620 pub fields: Vec<ResolvedConfigField>,
621 pub checksum: ConfigChecksum,
622}
623
624impl fidl::Persistable for ResolvedConfig {}
625
626#[derive(Clone, Debug, PartialEq)]
627pub struct ResolvedConfigField {
628 pub key: String,
629 pub value: ConfigValue,
630}
631
632impl fidl::Persistable for ResolvedConfigField {}
633
634#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
636pub struct SelfRef;
637
638impl fidl::Persistable for SelfRef {}
639
640#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
642pub struct VoidRef;
643
644impl fidl::Persistable for VoidRef {}
645
646#[derive(Clone, Debug, Default, PartialEq)]
648pub struct Child {
649 pub name: Option<String>,
654 pub url: Option<String>,
658 pub startup: Option<StartupMode>,
662 pub environment: Option<String>,
669 pub on_terminate: Option<OnTerminate>,
672 pub config_overrides: Option<Vec<ConfigOverride>>,
679 #[doc(hidden)]
680 pub __source_breaking: fidl::marker::SourceBreaking,
681}
682
683impl fidl::Persistable for Child {}
684
685#[derive(Clone, Debug, Default, PartialEq)]
687pub struct Collection {
688 pub name: Option<String>,
691 pub durability: Option<Durability>,
693 pub environment: Option<String>,
701 pub allowed_offers: Option<AllowedOffers>,
707 pub allow_long_names: Option<bool>,
713 pub persistent_storage: Option<bool>,
727 #[doc(hidden)]
728 pub __source_breaking: fidl::marker::SourceBreaking,
729}
730
731impl fidl::Persistable for Collection {}
732
733#[derive(Clone, Debug, Default, PartialEq)]
739pub struct Component {
740 pub program: Option<Program>,
743 pub uses: Option<Vec<Use>>,
749 pub exposes: Option<Vec<Expose>>,
755 pub offers: Option<Vec<Offer>>,
761 pub capabilities: Option<Vec<Capability>>,
763 pub children: Option<Vec<Child>>,
766 pub collections: Option<Vec<Collection>>,
768 pub environments: Option<Vec<Environment>>,
772 pub facets: Option<fidl_fuchsia_data::Dictionary>,
774 pub config: Option<ConfigSchema>,
776 #[doc(hidden)]
777 pub __source_breaking: fidl::marker::SourceBreaking,
778}
779
780impl fidl::Persistable for Component {}
781
782#[derive(Clone, Debug, Default, PartialEq)]
784pub struct ConfigField {
785 pub key: Option<String>,
788 pub type_: Option<ConfigType>,
791 pub mutability: Option<ConfigMutability>,
793 #[doc(hidden)]
794 pub __source_breaking: fidl::marker::SourceBreaking,
795}
796
797impl fidl::Persistable for ConfigField {}
798
799#[derive(Clone, Debug, Default, PartialEq)]
801pub struct ConfigOverride {
802 pub key: Option<String>,
803 pub value: Option<ConfigValue>,
804 #[doc(hidden)]
805 pub __source_breaking: fidl::marker::SourceBreaking,
806}
807
808impl fidl::Persistable for ConfigOverride {}
809
810#[derive(Clone, Debug, Default, PartialEq)]
812pub struct ConfigSchema {
813 pub fields: Option<Vec<ConfigField>>,
815 pub checksum: Option<ConfigChecksum>,
817 pub value_source: Option<ConfigValueSource>,
819 #[doc(hidden)]
820 pub __source_breaking: fidl::marker::SourceBreaking,
821}
822
823impl fidl::Persistable for ConfigSchema {}
824
825#[derive(Clone, Debug, Default, PartialEq)]
826pub struct ConfigSourceCapabilities {
827 #[doc(hidden)]
828 pub __source_breaking: fidl::marker::SourceBreaking,
829}
830
831impl fidl::Persistable for ConfigSourceCapabilities {}
832
833#[derive(Clone, Debug, Default, PartialEq)]
836pub struct ConfigValueSpec {
837 pub value: Option<ConfigValue>,
838 #[doc(hidden)]
839 pub __source_breaking: fidl::marker::SourceBreaking,
840}
841
842impl fidl::Persistable for ConfigValueSpec {}
843
844#[derive(Clone, Debug, Default, PartialEq)]
846pub struct ConfigValuesData {
847 pub values: Option<Vec<ConfigValueSpec>>,
849 pub checksum: Option<ConfigChecksum>,
852 #[doc(hidden)]
853 pub __source_breaking: fidl::marker::SourceBreaking,
854}
855
856impl fidl::Persistable for ConfigValuesData {}
857
858#[derive(Clone, Debug, Default, PartialEq)]
865pub struct Configuration {
866 pub name: Option<String>,
868 pub value: Option<ConfigValue>,
870 #[doc(hidden)]
871 pub __source_breaking: fidl::marker::SourceBreaking,
872}
873
874impl fidl::Persistable for Configuration {}
875
876#[derive(Clone, Debug, Default, PartialEq)]
883pub struct DebugProtocolRegistration {
884 pub source: Option<Ref>,
887 pub source_name: Option<String>,
889 pub target_name: Option<String>,
891 #[doc(hidden)]
892 pub __source_breaking: fidl::marker::SourceBreaking,
893}
894
895impl fidl::Persistable for DebugProtocolRegistration {}
896
897#[derive(Clone, Debug, Default, PartialEq)]
899pub struct Dictionary {
900 pub name: Option<String>,
904 pub source: Option<Ref>,
907 pub source_dictionary: Option<String>,
912 pub source_path: Option<String>,
919 #[doc(hidden)]
920 pub __source_breaking: fidl::marker::SourceBreaking,
921}
922
923impl fidl::Persistable for Dictionary {}
924
925#[derive(Clone, Debug, Default, PartialEq)]
930pub struct Directory {
931 pub name: Option<String>,
933 pub source_path: Option<String>,
938 pub rights: Option<fidl_fuchsia_io::Operations>,
941 #[doc(hidden)]
942 pub __source_breaking: fidl::marker::SourceBreaking,
943}
944
945impl fidl::Persistable for Directory {}
946
947#[derive(Clone, Debug, Default, PartialEq)]
949pub struct Environment {
950 pub name: Option<String>,
952 pub extends: Option<EnvironmentExtends>,
955 pub runners: Option<Vec<RunnerRegistration>>,
960 pub resolvers: Option<Vec<ResolverRegistration>>,
966 pub debug_capabilities: Option<Vec<DebugRegistration>>,
974 pub stop_timeout_ms: Option<u32>,
978 #[doc(hidden)]
979 pub __source_breaking: fidl::marker::SourceBreaking,
980}
981
982impl fidl::Persistable for Environment {}
983
984#[derive(Clone, Debug, Default, PartialEq)]
990pub struct EventStream {
991 pub name: Option<String>,
995 #[doc(hidden)]
996 pub __source_breaking: fidl::marker::SourceBreaking,
997}
998
999impl fidl::Persistable for EventStream {}
1000
1001#[derive(Clone, Debug, Default, PartialEq)]
1003pub struct EventSubscription {
1004 pub event_name: Option<String>,
1006 #[doc(hidden)]
1007 pub __source_breaking: fidl::marker::SourceBreaking,
1008}
1009
1010impl fidl::Persistable for EventSubscription {}
1011
1012#[derive(Clone, Debug, Default, PartialEq)]
1015pub struct ExposeConfiguration {
1016 pub source: Option<Ref>,
1021 pub source_name: Option<String>,
1024 pub target: Option<Ref>,
1026 pub target_name: Option<String>,
1028 pub availability: Option<Availability>,
1031 pub source_dictionary: Option<String>,
1036 #[doc(hidden)]
1037 pub __source_breaking: fidl::marker::SourceBreaking,
1038}
1039
1040impl fidl::Persistable for ExposeConfiguration {}
1041
1042#[derive(Clone, Debug, Default, PartialEq)]
1048pub struct ExposeDictionary {
1049 pub source: Option<Ref>,
1054 pub source_name: Option<String>,
1057 pub target: Option<Ref>,
1060 pub target_name: Option<String>,
1062 pub availability: Option<Availability>,
1065 pub source_dictionary: Option<String>,
1074 #[doc(hidden)]
1075 pub __source_breaking: fidl::marker::SourceBreaking,
1076}
1077
1078impl fidl::Persistable for ExposeDictionary {}
1079
1080#[derive(Clone, Debug, Default, PartialEq)]
1083pub struct ExposeDirectory {
1084 pub source: Option<Ref>,
1089 pub source_name: Option<String>,
1092 pub target: Option<Ref>,
1095 pub target_name: Option<String>,
1097 pub rights: Option<fidl_fuchsia_io::Operations>,
1100 pub subdir: Option<String>,
1103 pub availability: Option<Availability>,
1106 pub source_dictionary: Option<String>,
1115 #[doc(hidden)]
1116 pub __source_breaking: fidl::marker::SourceBreaking,
1117}
1118
1119impl fidl::Persistable for ExposeDirectory {}
1120
1121#[derive(Clone, Debug, Default, PartialEq)]
1127pub struct ExposeProtocol {
1128 pub source: Option<Ref>,
1133 pub source_name: Option<String>,
1136 pub target: Option<Ref>,
1139 pub target_name: Option<String>,
1141 pub availability: Option<Availability>,
1144 pub source_dictionary: Option<String>,
1153 #[doc(hidden)]
1154 pub __source_breaking: fidl::marker::SourceBreaking,
1155}
1156
1157impl fidl::Persistable for ExposeProtocol {}
1158
1159#[derive(Clone, Debug, Default, PartialEq)]
1162pub struct ExposeResolver {
1163 pub source: Option<Ref>,
1166 pub source_name: Option<String>,
1169 pub target: Option<Ref>,
1171 pub target_name: Option<String>,
1173 pub source_dictionary: Option<String>,
1182 #[doc(hidden)]
1183 pub __source_breaking: fidl::marker::SourceBreaking,
1184}
1185
1186impl fidl::Persistable for ExposeResolver {}
1187
1188#[derive(Clone, Debug, Default, PartialEq)]
1191pub struct ExposeRunner {
1192 pub source: Option<Ref>,
1195 pub source_name: Option<String>,
1198 pub target: Option<Ref>,
1201 pub target_name: Option<String>,
1203 pub source_dictionary: Option<String>,
1212 #[doc(hidden)]
1213 pub __source_breaking: fidl::marker::SourceBreaking,
1214}
1215
1216impl fidl::Persistable for ExposeRunner {}
1217
1218#[derive(Clone, Debug, Default, PartialEq)]
1224pub struct ExposeService {
1225 pub source: Option<Ref>,
1230 pub source_name: Option<String>,
1233 pub target: Option<Ref>,
1236 pub target_name: Option<String>,
1238 pub availability: Option<Availability>,
1241 pub source_dictionary: Option<String>,
1246 #[doc(hidden)]
1247 pub __source_breaking: fidl::marker::SourceBreaking,
1248}
1249
1250impl fidl::Persistable for ExposeService {}
1251
1252#[derive(Clone, Debug, Default, PartialEq)]
1256pub struct OfferConfiguration {
1257 pub source: Option<Ref>,
1262 pub source_name: Option<String>,
1264 pub target: Option<Ref>,
1266 pub target_name: Option<String>,
1268 pub availability: Option<Availability>,
1275 pub source_dictionary: Option<String>,
1280 #[doc(hidden)]
1281 pub __source_breaking: fidl::marker::SourceBreaking,
1282}
1283
1284impl fidl::Persistable for OfferConfiguration {}
1285
1286#[derive(Clone, Debug, Default, PartialEq)]
1293pub struct OfferDictionary {
1294 pub source: Option<Ref>,
1299 pub source_name: Option<String>,
1301 pub target: Option<Ref>,
1304 pub target_name: Option<String>,
1306 pub dependency_type: Option<DependencyType>,
1310 pub availability: Option<Availability>,
1317 pub source_dictionary: Option<String>,
1322 #[doc(hidden)]
1323 pub __source_breaking: fidl::marker::SourceBreaking,
1324}
1325
1326impl fidl::Persistable for OfferDictionary {}
1327
1328#[derive(Clone, Debug, Default, PartialEq)]
1332pub struct OfferDirectory {
1333 pub source: Option<Ref>,
1338 pub source_name: Option<String>,
1340 pub target: Option<Ref>,
1343 pub target_name: Option<String>,
1345 pub rights: Option<fidl_fuchsia_io::Operations>,
1348 pub subdir: Option<String>,
1351 pub dependency_type: Option<DependencyType>,
1355 pub availability: Option<Availability>,
1362 pub source_dictionary: Option<String>,
1367 #[doc(hidden)]
1368 pub __source_breaking: fidl::marker::SourceBreaking,
1369}
1370
1371impl fidl::Persistable for OfferDirectory {}
1372
1373#[derive(Clone, Debug, Default, PartialEq)]
1375pub struct OfferEventStream {
1376 pub source: Option<Ref>,
1381 pub source_name: Option<String>,
1383 pub scope: Option<Vec<Ref>>,
1389 pub target: Option<Ref>,
1391 pub target_name: Option<String>,
1393 pub availability: Option<Availability>,
1400 #[doc(hidden)]
1401 pub __source_breaking: fidl::marker::SourceBreaking,
1402}
1403
1404impl fidl::Persistable for OfferEventStream {}
1405
1406#[derive(Clone, Debug, Default, PartialEq)]
1413pub struct OfferProtocol {
1414 pub source: Option<Ref>,
1419 pub source_name: Option<String>,
1421 pub target: Option<Ref>,
1424 pub target_name: Option<String>,
1426 pub dependency_type: Option<DependencyType>,
1430 pub availability: Option<Availability>,
1437 pub source_dictionary: Option<String>,
1442 #[doc(hidden)]
1443 pub __source_breaking: fidl::marker::SourceBreaking,
1444}
1445
1446impl fidl::Persistable for OfferProtocol {}
1447
1448#[derive(Clone, Debug, Default, PartialEq)]
1452pub struct OfferResolver {
1453 pub source: Option<Ref>,
1458 pub source_name: Option<String>,
1460 pub target: Option<Ref>,
1463 pub target_name: Option<String>,
1465 pub source_dictionary: Option<String>,
1470 #[doc(hidden)]
1471 pub __source_breaking: fidl::marker::SourceBreaking,
1472}
1473
1474impl fidl::Persistable for OfferResolver {}
1475
1476#[derive(Clone, Debug, Default, PartialEq)]
1480pub struct OfferRunner {
1481 pub source: Option<Ref>,
1486 pub source_name: Option<String>,
1488 pub target: Option<Ref>,
1491 pub target_name: Option<String>,
1493 pub source_dictionary: Option<String>,
1498 #[doc(hidden)]
1499 pub __source_breaking: fidl::marker::SourceBreaking,
1500}
1501
1502impl fidl::Persistable for OfferRunner {}
1503
1504#[derive(Clone, Debug, Default, PartialEq)]
1511pub struct OfferService {
1512 pub source: Option<Ref>,
1517 pub source_name: Option<String>,
1519 pub target: Option<Ref>,
1522 pub target_name: Option<String>,
1524 pub source_instance_filter: Option<Vec<String>>,
1529 pub renamed_instances: Option<Vec<NameMapping>>,
1541 pub availability: Option<Availability>,
1548 pub source_dictionary: Option<String>,
1553 pub dependency_type: Option<DependencyType>,
1557 #[doc(hidden)]
1558 pub __source_breaking: fidl::marker::SourceBreaking,
1559}
1560
1561impl fidl::Persistable for OfferService {}
1562
1563#[derive(Clone, Debug, Default, PartialEq)]
1567pub struct OfferStorage {
1568 pub source_name: Option<String>,
1570 pub source: Option<Ref>,
1575 pub target: Option<Ref>,
1578 pub target_name: Option<String>,
1580 pub availability: Option<Availability>,
1587 #[doc(hidden)]
1588 pub __source_breaking: fidl::marker::SourceBreaking,
1589}
1590
1591impl fidl::Persistable for OfferStorage {}
1592
1593#[derive(Clone, Debug, Default, PartialEq)]
1601pub struct Program {
1602 pub runner: Option<String>,
1607 pub info: Option<fidl_fuchsia_data::Dictionary>,
1618 #[doc(hidden)]
1619 pub __source_breaking: fidl::marker::SourceBreaking,
1620}
1621
1622impl fidl::Persistable for Program {}
1623
1624#[derive(Clone, Debug, Default, PartialEq)]
1629pub struct Protocol {
1630 pub name: Option<String>,
1632 pub source_path: Option<String>,
1637 pub delivery: Option<DeliveryType>,
1641 #[doc(hidden)]
1642 pub __source_breaking: fidl::marker::SourceBreaking,
1643}
1644
1645impl fidl::Persistable for Protocol {}
1646
1647#[derive(Clone, Debug, Default, PartialEq)]
1651pub struct Resolver {
1652 pub name: Option<String>,
1656 pub source_path: Option<String>,
1661 #[doc(hidden)]
1662 pub __source_breaking: fidl::marker::SourceBreaking,
1663}
1664
1665impl fidl::Persistable for Resolver {}
1666
1667#[derive(Clone, Debug, Default, PartialEq)]
1669pub struct ResolverRegistration {
1670 pub resolver: Option<String>,
1672 pub source: Option<Ref>,
1675 pub scheme: Option<String>,
1680 #[doc(hidden)]
1681 pub __source_breaking: fidl::marker::SourceBreaking,
1682}
1683
1684impl fidl::Persistable for ResolverRegistration {}
1685
1686#[derive(Clone, Debug, Default, PartialEq)]
1688pub struct Runner {
1689 pub name: Option<String>,
1693 pub source_path: Option<String>,
1698 #[doc(hidden)]
1699 pub __source_breaking: fidl::marker::SourceBreaking,
1700}
1701
1702impl fidl::Persistable for Runner {}
1703
1704#[derive(Clone, Debug, Default, PartialEq)]
1706pub struct RunnerRegistration {
1707 pub source_name: Option<String>,
1710 pub source: Option<Ref>,
1713 pub target_name: Option<String>,
1716 #[doc(hidden)]
1717 pub __source_breaking: fidl::marker::SourceBreaking,
1718}
1719
1720impl fidl::Persistable for RunnerRegistration {}
1721
1722#[derive(Clone, Debug, Default, PartialEq)]
1727pub struct Service {
1728 pub name: Option<String>,
1730 pub source_path: Option<String>,
1735 #[doc(hidden)]
1736 pub __source_breaking: fidl::marker::SourceBreaking,
1737}
1738
1739impl fidl::Persistable for Service {}
1740
1741#[derive(Clone, Debug, Default, PartialEq)]
1744pub struct Storage {
1745 pub name: Option<String>,
1747 pub source: Option<Ref>,
1750 pub backing_dir: Option<String>,
1753 pub subdir: Option<String>,
1756 pub storage_id: Option<StorageId>,
1760 #[doc(hidden)]
1761 pub __source_breaking: fidl::marker::SourceBreaking,
1762}
1763
1764impl fidl::Persistable for Storage {}
1765
1766#[derive(Clone, Debug, Default, PartialEq)]
1767pub struct UseConfiguration {
1768 pub source: Option<Ref>,
1771 pub source_name: Option<String>,
1774 pub target_name: Option<String>,
1778 pub availability: Option<Availability>,
1783 pub type_: Option<ConfigType>,
1786 pub default: Option<ConfigValue>,
1789 pub source_dictionary: Option<String>,
1794 #[doc(hidden)]
1795 pub __source_breaking: fidl::marker::SourceBreaking,
1796}
1797
1798impl fidl::Persistable for UseConfiguration {}
1799
1800#[derive(Clone, Debug, Default, PartialEq)]
1802pub struct UseDirectory {
1803 pub source: Option<Ref>,
1806 pub source_name: Option<String>,
1809 pub target_path: Option<String>,
1814 pub rights: Option<fidl_fuchsia_io::Operations>,
1816 pub subdir: Option<String>,
1819 pub dependency_type: Option<DependencyType>,
1828 pub availability: Option<Availability>,
1833 pub source_dictionary: Option<String>,
1838 #[doc(hidden)]
1839 pub __source_breaking: fidl::marker::SourceBreaking,
1840}
1841
1842impl fidl::Persistable for UseDirectory {}
1843
1844#[derive(Clone, Debug, Default, PartialEq)]
1846pub struct UseEventStream {
1847 pub source_name: Option<String>,
1849 pub source: Option<Ref>,
1851 pub scope: Option<Vec<Ref>>,
1857 pub target_path: Option<String>,
1860 pub availability: Option<Availability>,
1865 pub filter: Option<fidl_fuchsia_data::Dictionary>,
1869 #[doc(hidden)]
1870 pub __source_breaking: fidl::marker::SourceBreaking,
1871}
1872
1873impl fidl::Persistable for UseEventStream {}
1874
1875#[derive(Clone, Debug, Default, PartialEq)]
1880pub struct UseProtocol {
1881 pub source: Option<Ref>,
1884 pub source_name: Option<String>,
1887 pub target_path: Option<String>,
1892 pub dependency_type: Option<DependencyType>,
1901 pub availability: Option<Availability>,
1906 pub source_dictionary: Option<String>,
1911 #[doc(hidden)]
1912 pub __source_breaking: fidl::marker::SourceBreaking,
1913}
1914
1915impl fidl::Persistable for UseProtocol {}
1916
1917#[derive(Clone, Debug, Default, PartialEq)]
1919pub struct UseRunner {
1920 pub source: Option<Ref>,
1923 pub source_name: Option<String>,
1926 pub source_dictionary: Option<String>,
1931 #[doc(hidden)]
1932 pub __source_breaking: fidl::marker::SourceBreaking,
1933}
1934
1935impl fidl::Persistable for UseRunner {}
1936
1937#[derive(Clone, Debug, Default, PartialEq)]
1942pub struct UseService {
1943 pub source: Option<Ref>,
1946 pub source_name: Option<String>,
1949 pub target_path: Option<String>,
1954 pub dependency_type: Option<DependencyType>,
1963 pub availability: Option<Availability>,
1968 pub source_dictionary: Option<String>,
1973 #[doc(hidden)]
1974 pub __source_breaking: fidl::marker::SourceBreaking,
1975}
1976
1977impl fidl::Persistable for UseService {}
1978
1979#[derive(Clone, Debug, Default, PartialEq)]
1981pub struct UseStorage {
1982 pub source_name: Option<String>,
1985 pub target_path: Option<String>,
1990 pub availability: Option<Availability>,
1995 #[doc(hidden)]
1996 pub __source_breaking: fidl::marker::SourceBreaking,
1997}
1998
1999impl fidl::Persistable for UseStorage {}
2000
2001#[derive(Clone, Debug)]
2003pub enum Capability {
2004 Service(Service),
2005 Protocol(Protocol),
2006 Directory(Directory),
2007 Storage(Storage),
2008 Runner(Runner),
2009 Resolver(Resolver),
2010 EventStream(EventStream),
2011 Dictionary(Dictionary),
2012 Config(Configuration),
2013 #[doc(hidden)]
2014 __SourceBreaking {
2015 unknown_ordinal: u64,
2016 },
2017}
2018
2019#[macro_export]
2021macro_rules! CapabilityUnknown {
2022 () => {
2023 _
2024 };
2025}
2026
2027impl PartialEq for Capability {
2029 fn eq(&self, other: &Self) -> bool {
2030 match (self, other) {
2031 (Self::Service(x), Self::Service(y)) => *x == *y,
2032 (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
2033 (Self::Directory(x), Self::Directory(y)) => *x == *y,
2034 (Self::Storage(x), Self::Storage(y)) => *x == *y,
2035 (Self::Runner(x), Self::Runner(y)) => *x == *y,
2036 (Self::Resolver(x), Self::Resolver(y)) => *x == *y,
2037 (Self::EventStream(x), Self::EventStream(y)) => *x == *y,
2038 (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
2039 (Self::Config(x), Self::Config(y)) => *x == *y,
2040 _ => false,
2041 }
2042 }
2043}
2044
2045impl Capability {
2046 #[inline]
2047 pub fn ordinal(&self) -> u64 {
2048 match *self {
2049 Self::Service(_) => 1,
2050 Self::Protocol(_) => 2,
2051 Self::Directory(_) => 3,
2052 Self::Storage(_) => 4,
2053 Self::Runner(_) => 5,
2054 Self::Resolver(_) => 6,
2055 Self::EventStream(_) => 8,
2056 Self::Dictionary(_) => 9,
2057 Self::Config(_) => 10,
2058 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2059 }
2060 }
2061
2062 #[inline]
2063 pub fn unknown_variant_for_testing() -> Self {
2064 Self::__SourceBreaking { unknown_ordinal: 0 }
2065 }
2066
2067 #[inline]
2068 pub fn is_unknown(&self) -> bool {
2069 match self {
2070 Self::__SourceBreaking { .. } => true,
2071 _ => false,
2072 }
2073 }
2074}
2075
2076impl fidl::Persistable for Capability {}
2077
2078#[derive(Clone, Debug)]
2081pub enum ConfigChecksum {
2082 Sha256([u8; 32]),
2084 #[doc(hidden)]
2085 __SourceBreaking { unknown_ordinal: u64 },
2086}
2087
2088#[macro_export]
2090macro_rules! ConfigChecksumUnknown {
2091 () => {
2092 _
2093 };
2094}
2095
2096impl PartialEq for ConfigChecksum {
2098 fn eq(&self, other: &Self) -> bool {
2099 match (self, other) {
2100 (Self::Sha256(x), Self::Sha256(y)) => *x == *y,
2101 _ => false,
2102 }
2103 }
2104}
2105
2106impl ConfigChecksum {
2107 #[inline]
2108 pub fn ordinal(&self) -> u64 {
2109 match *self {
2110 Self::Sha256(_) => 1,
2111 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2112 }
2113 }
2114
2115 #[inline]
2116 pub fn unknown_variant_for_testing() -> Self {
2117 Self::__SourceBreaking { unknown_ordinal: 0 }
2118 }
2119
2120 #[inline]
2121 pub fn is_unknown(&self) -> bool {
2122 match self {
2123 Self::__SourceBreaking { .. } => true,
2124 _ => false,
2125 }
2126 }
2127}
2128
2129impl fidl::Persistable for ConfigChecksum {}
2130
2131#[derive(Clone, Debug)]
2133pub enum ConfigSingleValue {
2134 Bool(bool),
2135 Uint8(u8),
2136 Uint16(u16),
2137 Uint32(u32),
2138 Uint64(u64),
2139 Int8(i8),
2140 Int16(i16),
2141 Int32(i32),
2142 Int64(i64),
2143 String(String),
2144 #[doc(hidden)]
2145 __SourceBreaking {
2146 unknown_ordinal: u64,
2147 },
2148}
2149
2150#[macro_export]
2152macro_rules! ConfigSingleValueUnknown {
2153 () => {
2154 _
2155 };
2156}
2157
2158impl PartialEq for ConfigSingleValue {
2160 fn eq(&self, other: &Self) -> bool {
2161 match (self, other) {
2162 (Self::Bool(x), Self::Bool(y)) => *x == *y,
2163 (Self::Uint8(x), Self::Uint8(y)) => *x == *y,
2164 (Self::Uint16(x), Self::Uint16(y)) => *x == *y,
2165 (Self::Uint32(x), Self::Uint32(y)) => *x == *y,
2166 (Self::Uint64(x), Self::Uint64(y)) => *x == *y,
2167 (Self::Int8(x), Self::Int8(y)) => *x == *y,
2168 (Self::Int16(x), Self::Int16(y)) => *x == *y,
2169 (Self::Int32(x), Self::Int32(y)) => *x == *y,
2170 (Self::Int64(x), Self::Int64(y)) => *x == *y,
2171 (Self::String(x), Self::String(y)) => *x == *y,
2172 _ => false,
2173 }
2174 }
2175}
2176
2177impl ConfigSingleValue {
2178 #[inline]
2179 pub fn ordinal(&self) -> u64 {
2180 match *self {
2181 Self::Bool(_) => 1,
2182 Self::Uint8(_) => 2,
2183 Self::Uint16(_) => 3,
2184 Self::Uint32(_) => 4,
2185 Self::Uint64(_) => 5,
2186 Self::Int8(_) => 6,
2187 Self::Int16(_) => 7,
2188 Self::Int32(_) => 8,
2189 Self::Int64(_) => 9,
2190 Self::String(_) => 10,
2191 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2192 }
2193 }
2194
2195 #[inline]
2196 pub fn unknown_variant_for_testing() -> Self {
2197 Self::__SourceBreaking { unknown_ordinal: 0 }
2198 }
2199
2200 #[inline]
2201 pub fn is_unknown(&self) -> bool {
2202 match self {
2203 Self::__SourceBreaking { .. } => true,
2204 _ => false,
2205 }
2206 }
2207}
2208
2209impl fidl::Persistable for ConfigSingleValue {}
2210
2211#[derive(Clone, Debug)]
2215pub enum ConfigValue {
2216 Single(ConfigSingleValue),
2217 Vector(ConfigVectorValue),
2218 #[doc(hidden)]
2219 __SourceBreaking {
2220 unknown_ordinal: u64,
2221 },
2222}
2223
2224#[macro_export]
2226macro_rules! ConfigValueUnknown {
2227 () => {
2228 _
2229 };
2230}
2231
2232impl PartialEq for ConfigValue {
2234 fn eq(&self, other: &Self) -> bool {
2235 match (self, other) {
2236 (Self::Single(x), Self::Single(y)) => *x == *y,
2237 (Self::Vector(x), Self::Vector(y)) => *x == *y,
2238 _ => false,
2239 }
2240 }
2241}
2242
2243impl ConfigValue {
2244 #[inline]
2245 pub fn ordinal(&self) -> u64 {
2246 match *self {
2247 Self::Single(_) => 1,
2248 Self::Vector(_) => 2,
2249 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2250 }
2251 }
2252
2253 #[inline]
2254 pub fn unknown_variant_for_testing() -> Self {
2255 Self::__SourceBreaking { unknown_ordinal: 0 }
2256 }
2257
2258 #[inline]
2259 pub fn is_unknown(&self) -> bool {
2260 match self {
2261 Self::__SourceBreaking { .. } => true,
2262 _ => false,
2263 }
2264 }
2265}
2266
2267impl fidl::Persistable for ConfigValue {}
2268
2269#[derive(Clone, Debug)]
2271pub enum ConfigValueSource {
2272 PackagePath(String),
2274 Capabilities(ConfigSourceCapabilities),
2276 #[doc(hidden)]
2277 __SourceBreaking { unknown_ordinal: u64 },
2278}
2279
2280#[macro_export]
2282macro_rules! ConfigValueSourceUnknown {
2283 () => {
2284 _
2285 };
2286}
2287
2288impl PartialEq for ConfigValueSource {
2290 fn eq(&self, other: &Self) -> bool {
2291 match (self, other) {
2292 (Self::PackagePath(x), Self::PackagePath(y)) => *x == *y,
2293 (Self::Capabilities(x), Self::Capabilities(y)) => *x == *y,
2294 _ => false,
2295 }
2296 }
2297}
2298
2299impl ConfigValueSource {
2300 #[inline]
2301 pub fn ordinal(&self) -> u64 {
2302 match *self {
2303 Self::PackagePath(_) => 1,
2304 Self::Capabilities(_) => 2,
2305 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2306 }
2307 }
2308
2309 #[inline]
2310 pub fn unknown_variant_for_testing() -> Self {
2311 Self::__SourceBreaking { unknown_ordinal: 0 }
2312 }
2313
2314 #[inline]
2315 pub fn is_unknown(&self) -> bool {
2316 match self {
2317 Self::__SourceBreaking { .. } => true,
2318 _ => false,
2319 }
2320 }
2321}
2322
2323impl fidl::Persistable for ConfigValueSource {}
2324
2325#[derive(Clone, Debug)]
2327pub enum ConfigVectorValue {
2328 BoolVector(Vec<bool>),
2329 Uint8Vector(Vec<u8>),
2330 Uint16Vector(Vec<u16>),
2331 Uint32Vector(Vec<u32>),
2332 Uint64Vector(Vec<u64>),
2333 Int8Vector(Vec<i8>),
2334 Int16Vector(Vec<i16>),
2335 Int32Vector(Vec<i32>),
2336 Int64Vector(Vec<i64>),
2337 StringVector(Vec<String>),
2338 #[doc(hidden)]
2339 __SourceBreaking {
2340 unknown_ordinal: u64,
2341 },
2342}
2343
2344#[macro_export]
2346macro_rules! ConfigVectorValueUnknown {
2347 () => {
2348 _
2349 };
2350}
2351
2352impl PartialEq for ConfigVectorValue {
2354 fn eq(&self, other: &Self) -> bool {
2355 match (self, other) {
2356 (Self::BoolVector(x), Self::BoolVector(y)) => *x == *y,
2357 (Self::Uint8Vector(x), Self::Uint8Vector(y)) => *x == *y,
2358 (Self::Uint16Vector(x), Self::Uint16Vector(y)) => *x == *y,
2359 (Self::Uint32Vector(x), Self::Uint32Vector(y)) => *x == *y,
2360 (Self::Uint64Vector(x), Self::Uint64Vector(y)) => *x == *y,
2361 (Self::Int8Vector(x), Self::Int8Vector(y)) => *x == *y,
2362 (Self::Int16Vector(x), Self::Int16Vector(y)) => *x == *y,
2363 (Self::Int32Vector(x), Self::Int32Vector(y)) => *x == *y,
2364 (Self::Int64Vector(x), Self::Int64Vector(y)) => *x == *y,
2365 (Self::StringVector(x), Self::StringVector(y)) => *x == *y,
2366 _ => false,
2367 }
2368 }
2369}
2370
2371impl ConfigVectorValue {
2372 #[inline]
2373 pub fn ordinal(&self) -> u64 {
2374 match *self {
2375 Self::BoolVector(_) => 1,
2376 Self::Uint8Vector(_) => 2,
2377 Self::Uint16Vector(_) => 3,
2378 Self::Uint32Vector(_) => 4,
2379 Self::Uint64Vector(_) => 5,
2380 Self::Int8Vector(_) => 6,
2381 Self::Int16Vector(_) => 7,
2382 Self::Int32Vector(_) => 8,
2383 Self::Int64Vector(_) => 9,
2384 Self::StringVector(_) => 10,
2385 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2386 }
2387 }
2388
2389 #[inline]
2390 pub fn unknown_variant_for_testing() -> Self {
2391 Self::__SourceBreaking { unknown_ordinal: 0 }
2392 }
2393
2394 #[inline]
2395 pub fn is_unknown(&self) -> bool {
2396 match self {
2397 Self::__SourceBreaking { .. } => true,
2398 _ => false,
2399 }
2400 }
2401}
2402
2403impl fidl::Persistable for ConfigVectorValue {}
2404
2405#[derive(Clone, Debug)]
2407pub enum DebugRegistration {
2408 Protocol(DebugProtocolRegistration),
2409 #[doc(hidden)]
2410 __SourceBreaking {
2411 unknown_ordinal: u64,
2412 },
2413}
2414
2415#[macro_export]
2417macro_rules! DebugRegistrationUnknown {
2418 () => {
2419 _
2420 };
2421}
2422
2423impl PartialEq for DebugRegistration {
2425 fn eq(&self, other: &Self) -> bool {
2426 match (self, other) {
2427 (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
2428 _ => false,
2429 }
2430 }
2431}
2432
2433impl DebugRegistration {
2434 #[inline]
2435 pub fn ordinal(&self) -> u64 {
2436 match *self {
2437 Self::Protocol(_) => 1,
2438 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2439 }
2440 }
2441
2442 #[inline]
2443 pub fn unknown_variant_for_testing() -> Self {
2444 Self::__SourceBreaking { unknown_ordinal: 0 }
2445 }
2446
2447 #[inline]
2448 pub fn is_unknown(&self) -> bool {
2449 match self {
2450 Self::__SourceBreaking { .. } => true,
2451 _ => false,
2452 }
2453 }
2454}
2455
2456impl fidl::Persistable for DebugRegistration {}
2457
2458#[derive(Clone, Debug)]
2462pub enum Expose {
2463 Service(ExposeService),
2464 Protocol(ExposeProtocol),
2465 Directory(ExposeDirectory),
2466 Runner(ExposeRunner),
2467 Resolver(ExposeResolver),
2468 Dictionary(ExposeDictionary),
2469 Config(ExposeConfiguration),
2470 #[doc(hidden)]
2471 __SourceBreaking {
2472 unknown_ordinal: u64,
2473 },
2474}
2475
2476#[macro_export]
2478macro_rules! ExposeUnknown {
2479 () => {
2480 _
2481 };
2482}
2483
2484impl PartialEq for Expose {
2486 fn eq(&self, other: &Self) -> bool {
2487 match (self, other) {
2488 (Self::Service(x), Self::Service(y)) => *x == *y,
2489 (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
2490 (Self::Directory(x), Self::Directory(y)) => *x == *y,
2491 (Self::Runner(x), Self::Runner(y)) => *x == *y,
2492 (Self::Resolver(x), Self::Resolver(y)) => *x == *y,
2493 (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
2494 (Self::Config(x), Self::Config(y)) => *x == *y,
2495 _ => false,
2496 }
2497 }
2498}
2499
2500impl Expose {
2501 #[inline]
2502 pub fn ordinal(&self) -> u64 {
2503 match *self {
2504 Self::Service(_) => 1,
2505 Self::Protocol(_) => 2,
2506 Self::Directory(_) => 3,
2507 Self::Runner(_) => 4,
2508 Self::Resolver(_) => 5,
2509 Self::Dictionary(_) => 7,
2510 Self::Config(_) => 8,
2511 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2512 }
2513 }
2514
2515 #[inline]
2516 pub fn unknown_variant_for_testing() -> Self {
2517 Self::__SourceBreaking { unknown_ordinal: 0 }
2518 }
2519
2520 #[inline]
2521 pub fn is_unknown(&self) -> bool {
2522 match self {
2523 Self::__SourceBreaking { .. } => true,
2524 _ => false,
2525 }
2526 }
2527}
2528
2529impl fidl::Persistable for Expose {}
2530
2531#[derive(Clone, Debug)]
2532pub enum LayoutConstraint {
2533 MaxSize(u32),
2534 #[doc(hidden)]
2535 __SourceBreaking {
2536 unknown_ordinal: u64,
2537 },
2538}
2539
2540#[macro_export]
2542macro_rules! LayoutConstraintUnknown {
2543 () => {
2544 _
2545 };
2546}
2547
2548impl PartialEq for LayoutConstraint {
2550 fn eq(&self, other: &Self) -> bool {
2551 match (self, other) {
2552 (Self::MaxSize(x), Self::MaxSize(y)) => *x == *y,
2553 _ => false,
2554 }
2555 }
2556}
2557
2558impl LayoutConstraint {
2559 #[inline]
2560 pub fn ordinal(&self) -> u64 {
2561 match *self {
2562 Self::MaxSize(_) => 1,
2563 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2564 }
2565 }
2566
2567 #[inline]
2568 pub fn unknown_variant_for_testing() -> Self {
2569 Self::__SourceBreaking { unknown_ordinal: 0 }
2570 }
2571
2572 #[inline]
2573 pub fn is_unknown(&self) -> bool {
2574 match self {
2575 Self::__SourceBreaking { .. } => true,
2576 _ => false,
2577 }
2578 }
2579}
2580
2581impl fidl::Persistable for LayoutConstraint {}
2582
2583#[derive(Clone, Debug)]
2584pub enum LayoutParameter {
2585 NestedType(ConfigType),
2586 #[doc(hidden)]
2587 __SourceBreaking {
2588 unknown_ordinal: u64,
2589 },
2590}
2591
2592#[macro_export]
2594macro_rules! LayoutParameterUnknown {
2595 () => {
2596 _
2597 };
2598}
2599
2600impl PartialEq for LayoutParameter {
2602 fn eq(&self, other: &Self) -> bool {
2603 match (self, other) {
2604 (Self::NestedType(x), Self::NestedType(y)) => *x == *y,
2605 _ => false,
2606 }
2607 }
2608}
2609
2610impl LayoutParameter {
2611 #[inline]
2612 pub fn ordinal(&self) -> u64 {
2613 match *self {
2614 Self::NestedType(_) => 1,
2615 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2616 }
2617 }
2618
2619 #[inline]
2620 pub fn unknown_variant_for_testing() -> Self {
2621 Self::__SourceBreaking { unknown_ordinal: 0 }
2622 }
2623
2624 #[inline]
2625 pub fn is_unknown(&self) -> bool {
2626 match self {
2627 Self::__SourceBreaking { .. } => true,
2628 _ => false,
2629 }
2630 }
2631}
2632
2633impl fidl::Persistable for LayoutParameter {}
2634
2635#[derive(Clone, Debug)]
2639pub enum Offer {
2640 Service(OfferService),
2641 Protocol(OfferProtocol),
2642 Directory(OfferDirectory),
2643 Storage(OfferStorage),
2644 Runner(OfferRunner),
2645 Resolver(OfferResolver),
2646 EventStream(OfferEventStream),
2647 Dictionary(OfferDictionary),
2648 Config(OfferConfiguration),
2649 #[doc(hidden)]
2650 __SourceBreaking {
2651 unknown_ordinal: u64,
2652 },
2653}
2654
2655#[macro_export]
2657macro_rules! OfferUnknown {
2658 () => {
2659 _
2660 };
2661}
2662
2663impl PartialEq for Offer {
2665 fn eq(&self, other: &Self) -> bool {
2666 match (self, other) {
2667 (Self::Service(x), Self::Service(y)) => *x == *y,
2668 (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
2669 (Self::Directory(x), Self::Directory(y)) => *x == *y,
2670 (Self::Storage(x), Self::Storage(y)) => *x == *y,
2671 (Self::Runner(x), Self::Runner(y)) => *x == *y,
2672 (Self::Resolver(x), Self::Resolver(y)) => *x == *y,
2673 (Self::EventStream(x), Self::EventStream(y)) => *x == *y,
2674 (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
2675 (Self::Config(x), Self::Config(y)) => *x == *y,
2676 _ => false,
2677 }
2678 }
2679}
2680
2681impl Offer {
2682 #[inline]
2683 pub fn ordinal(&self) -> u64 {
2684 match *self {
2685 Self::Service(_) => 1,
2686 Self::Protocol(_) => 2,
2687 Self::Directory(_) => 3,
2688 Self::Storage(_) => 4,
2689 Self::Runner(_) => 5,
2690 Self::Resolver(_) => 6,
2691 Self::EventStream(_) => 8,
2692 Self::Dictionary(_) => 9,
2693 Self::Config(_) => 10,
2694 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2695 }
2696 }
2697
2698 #[inline]
2699 pub fn unknown_variant_for_testing() -> Self {
2700 Self::__SourceBreaking { unknown_ordinal: 0 }
2701 }
2702
2703 #[inline]
2704 pub fn is_unknown(&self) -> bool {
2705 match self {
2706 Self::__SourceBreaking { .. } => true,
2707 _ => false,
2708 }
2709 }
2710}
2711
2712impl fidl::Persistable for Offer {}
2713
2714#[derive(Clone, Debug)]
2717pub enum Ref {
2718 Parent(ParentRef),
2719 Self_(SelfRef),
2720 Child(ChildRef),
2721 Collection(CollectionRef),
2722 Framework(FrameworkRef),
2723 Capability(CapabilityRef),
2724 Debug(DebugRef),
2725 VoidType(VoidRef),
2726 Environment(EnvironmentRef),
2727 #[doc(hidden)]
2728 __SourceBreaking {
2729 unknown_ordinal: u64,
2730 },
2731}
2732
2733#[macro_export]
2735macro_rules! RefUnknown {
2736 () => {
2737 _
2738 };
2739}
2740
2741impl PartialEq for Ref {
2743 fn eq(&self, other: &Self) -> bool {
2744 match (self, other) {
2745 (Self::Parent(x), Self::Parent(y)) => *x == *y,
2746 (Self::Self_(x), Self::Self_(y)) => *x == *y,
2747 (Self::Child(x), Self::Child(y)) => *x == *y,
2748 (Self::Collection(x), Self::Collection(y)) => *x == *y,
2749 (Self::Framework(x), Self::Framework(y)) => *x == *y,
2750 (Self::Capability(x), Self::Capability(y)) => *x == *y,
2751 (Self::Debug(x), Self::Debug(y)) => *x == *y,
2752 (Self::VoidType(x), Self::VoidType(y)) => *x == *y,
2753 (Self::Environment(x), Self::Environment(y)) => *x == *y,
2754 _ => false,
2755 }
2756 }
2757}
2758
2759impl Ref {
2760 #[inline]
2761 pub fn ordinal(&self) -> u64 {
2762 match *self {
2763 Self::Parent(_) => 1,
2764 Self::Self_(_) => 2,
2765 Self::Child(_) => 3,
2766 Self::Collection(_) => 4,
2767 Self::Framework(_) => 5,
2768 Self::Capability(_) => 6,
2769 Self::Debug(_) => 7,
2770 Self::VoidType(_) => 8,
2771 Self::Environment(_) => 9,
2772 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2773 }
2774 }
2775
2776 #[inline]
2777 pub fn unknown_variant_for_testing() -> Self {
2778 Self::__SourceBreaking { unknown_ordinal: 0 }
2779 }
2780
2781 #[inline]
2782 pub fn is_unknown(&self) -> bool {
2783 match self {
2784 Self::__SourceBreaking { .. } => true,
2785 _ => false,
2786 }
2787 }
2788}
2789
2790impl fidl::Persistable for Ref {}
2791
2792#[derive(Clone, Debug)]
2794pub enum Use {
2795 Service(UseService),
2796 Protocol(UseProtocol),
2797 Directory(UseDirectory),
2798 Storage(UseStorage),
2799 EventStream(UseEventStream),
2800 Runner(UseRunner),
2801 Config(UseConfiguration),
2802 #[doc(hidden)]
2803 __SourceBreaking {
2804 unknown_ordinal: u64,
2805 },
2806}
2807
2808#[macro_export]
2810macro_rules! UseUnknown {
2811 () => {
2812 _
2813 };
2814}
2815
2816impl PartialEq for Use {
2818 fn eq(&self, other: &Self) -> bool {
2819 match (self, other) {
2820 (Self::Service(x), Self::Service(y)) => *x == *y,
2821 (Self::Protocol(x), Self::Protocol(y)) => *x == *y,
2822 (Self::Directory(x), Self::Directory(y)) => *x == *y,
2823 (Self::Storage(x), Self::Storage(y)) => *x == *y,
2824 (Self::EventStream(x), Self::EventStream(y)) => *x == *y,
2825 (Self::Runner(x), Self::Runner(y)) => *x == *y,
2826 (Self::Config(x), Self::Config(y)) => *x == *y,
2827 _ => false,
2828 }
2829 }
2830}
2831
2832impl Use {
2833 #[inline]
2834 pub fn ordinal(&self) -> u64 {
2835 match *self {
2836 Self::Service(_) => 1,
2837 Self::Protocol(_) => 2,
2838 Self::Directory(_) => 3,
2839 Self::Storage(_) => 4,
2840 Self::EventStream(_) => 7,
2841 Self::Runner(_) => 8,
2842 Self::Config(_) => 9,
2843 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
2844 }
2845 }
2846
2847 #[inline]
2848 pub fn unknown_variant_for_testing() -> Self {
2849 Self::__SourceBreaking { unknown_ordinal: 0 }
2850 }
2851
2852 #[inline]
2853 pub fn is_unknown(&self) -> bool {
2854 match self {
2855 Self::__SourceBreaking { .. } => true,
2856 _ => false,
2857 }
2858 }
2859}
2860
2861impl fidl::Persistable for Use {}
2862
2863mod internal {
2864 use super::*;
2865 unsafe impl fidl::encoding::TypeMarker for ConfigMutability {
2866 type Owned = Self;
2867
2868 #[inline(always)]
2869 fn inline_align(_context: fidl::encoding::Context) -> usize {
2870 4
2871 }
2872
2873 #[inline(always)]
2874 fn inline_size(_context: fidl::encoding::Context) -> usize {
2875 4
2876 }
2877 }
2878
2879 impl fidl::encoding::ValueTypeMarker for ConfigMutability {
2880 type Borrowed<'a> = Self;
2881 #[inline(always)]
2882 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2883 *value
2884 }
2885 }
2886
2887 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2888 for ConfigMutability
2889 {
2890 #[inline]
2891 unsafe fn encode(
2892 self,
2893 encoder: &mut fidl::encoding::Encoder<'_, D>,
2894 offset: usize,
2895 _depth: fidl::encoding::Depth,
2896 ) -> fidl::Result<()> {
2897 encoder.debug_check_bounds::<Self>(offset);
2898 encoder.write_num(self.bits(), offset);
2899 Ok(())
2900 }
2901 }
2902
2903 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigMutability {
2904 #[inline(always)]
2905 fn new_empty() -> Self {
2906 Self::empty()
2907 }
2908
2909 #[inline]
2910 unsafe fn decode(
2911 &mut self,
2912 decoder: &mut fidl::encoding::Decoder<'_, D>,
2913 offset: usize,
2914 _depth: fidl::encoding::Depth,
2915 ) -> fidl::Result<()> {
2916 decoder.debug_check_bounds::<Self>(offset);
2917 let prim = decoder.read_num::<u32>(offset);
2918 *self = Self::from_bits_allow_unknown(prim);
2919 Ok(())
2920 }
2921 }
2922 unsafe impl fidl::encoding::TypeMarker for AllowedOffers {
2923 type Owned = Self;
2924
2925 #[inline(always)]
2926 fn inline_align(_context: fidl::encoding::Context) -> usize {
2927 std::mem::align_of::<u32>()
2928 }
2929
2930 #[inline(always)]
2931 fn inline_size(_context: fidl::encoding::Context) -> usize {
2932 std::mem::size_of::<u32>()
2933 }
2934
2935 #[inline(always)]
2936 fn encode_is_copy() -> bool {
2937 true
2938 }
2939
2940 #[inline(always)]
2941 fn decode_is_copy() -> bool {
2942 false
2943 }
2944 }
2945
2946 impl fidl::encoding::ValueTypeMarker for AllowedOffers {
2947 type Borrowed<'a> = Self;
2948 #[inline(always)]
2949 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2950 *value
2951 }
2952 }
2953
2954 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AllowedOffers {
2955 #[inline]
2956 unsafe fn encode(
2957 self,
2958 encoder: &mut fidl::encoding::Encoder<'_, D>,
2959 offset: usize,
2960 _depth: fidl::encoding::Depth,
2961 ) -> fidl::Result<()> {
2962 encoder.debug_check_bounds::<Self>(offset);
2963 encoder.write_num(self.into_primitive(), offset);
2964 Ok(())
2965 }
2966 }
2967
2968 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllowedOffers {
2969 #[inline(always)]
2970 fn new_empty() -> Self {
2971 Self::StaticOnly
2972 }
2973
2974 #[inline]
2975 unsafe fn decode(
2976 &mut self,
2977 decoder: &mut fidl::encoding::Decoder<'_, D>,
2978 offset: usize,
2979 _depth: fidl::encoding::Depth,
2980 ) -> fidl::Result<()> {
2981 decoder.debug_check_bounds::<Self>(offset);
2982 let prim = decoder.read_num::<u32>(offset);
2983
2984 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2985 Ok(())
2986 }
2987 }
2988 unsafe impl fidl::encoding::TypeMarker for Availability {
2989 type Owned = Self;
2990
2991 #[inline(always)]
2992 fn inline_align(_context: fidl::encoding::Context) -> usize {
2993 std::mem::align_of::<u32>()
2994 }
2995
2996 #[inline(always)]
2997 fn inline_size(_context: fidl::encoding::Context) -> usize {
2998 std::mem::size_of::<u32>()
2999 }
3000
3001 #[inline(always)]
3002 fn encode_is_copy() -> bool {
3003 true
3004 }
3005
3006 #[inline(always)]
3007 fn decode_is_copy() -> bool {
3008 false
3009 }
3010 }
3011
3012 impl fidl::encoding::ValueTypeMarker for Availability {
3013 type Borrowed<'a> = Self;
3014 #[inline(always)]
3015 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3016 *value
3017 }
3018 }
3019
3020 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Availability {
3021 #[inline]
3022 unsafe fn encode(
3023 self,
3024 encoder: &mut fidl::encoding::Encoder<'_, D>,
3025 offset: usize,
3026 _depth: fidl::encoding::Depth,
3027 ) -> fidl::Result<()> {
3028 encoder.debug_check_bounds::<Self>(offset);
3029 encoder.write_num(self.into_primitive(), offset);
3030 Ok(())
3031 }
3032 }
3033
3034 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Availability {
3035 #[inline(always)]
3036 fn new_empty() -> Self {
3037 Self::Required
3038 }
3039
3040 #[inline]
3041 unsafe fn decode(
3042 &mut self,
3043 decoder: &mut fidl::encoding::Decoder<'_, D>,
3044 offset: usize,
3045 _depth: fidl::encoding::Depth,
3046 ) -> fidl::Result<()> {
3047 decoder.debug_check_bounds::<Self>(offset);
3048 let prim = decoder.read_num::<u32>(offset);
3049
3050 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3051 Ok(())
3052 }
3053 }
3054 unsafe impl fidl::encoding::TypeMarker for ConfigTypeLayout {
3055 type Owned = Self;
3056
3057 #[inline(always)]
3058 fn inline_align(_context: fidl::encoding::Context) -> usize {
3059 std::mem::align_of::<u32>()
3060 }
3061
3062 #[inline(always)]
3063 fn inline_size(_context: fidl::encoding::Context) -> usize {
3064 std::mem::size_of::<u32>()
3065 }
3066
3067 #[inline(always)]
3068 fn encode_is_copy() -> bool {
3069 false
3070 }
3071
3072 #[inline(always)]
3073 fn decode_is_copy() -> bool {
3074 false
3075 }
3076 }
3077
3078 impl fidl::encoding::ValueTypeMarker for ConfigTypeLayout {
3079 type Borrowed<'a> = Self;
3080 #[inline(always)]
3081 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3082 *value
3083 }
3084 }
3085
3086 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3087 for ConfigTypeLayout
3088 {
3089 #[inline]
3090 unsafe fn encode(
3091 self,
3092 encoder: &mut fidl::encoding::Encoder<'_, D>,
3093 offset: usize,
3094 _depth: fidl::encoding::Depth,
3095 ) -> fidl::Result<()> {
3096 encoder.debug_check_bounds::<Self>(offset);
3097 encoder.write_num(self.into_primitive(), offset);
3098 Ok(())
3099 }
3100 }
3101
3102 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigTypeLayout {
3103 #[inline(always)]
3104 fn new_empty() -> Self {
3105 Self::unknown()
3106 }
3107
3108 #[inline]
3109 unsafe fn decode(
3110 &mut self,
3111 decoder: &mut fidl::encoding::Decoder<'_, D>,
3112 offset: usize,
3113 _depth: fidl::encoding::Depth,
3114 ) -> fidl::Result<()> {
3115 decoder.debug_check_bounds::<Self>(offset);
3116 let prim = decoder.read_num::<u32>(offset);
3117
3118 *self = Self::from_primitive_allow_unknown(prim);
3119 Ok(())
3120 }
3121 }
3122 unsafe impl fidl::encoding::TypeMarker for DeliveryType {
3123 type Owned = Self;
3124
3125 #[inline(always)]
3126 fn inline_align(_context: fidl::encoding::Context) -> usize {
3127 std::mem::align_of::<u32>()
3128 }
3129
3130 #[inline(always)]
3131 fn inline_size(_context: fidl::encoding::Context) -> usize {
3132 std::mem::size_of::<u32>()
3133 }
3134
3135 #[inline(always)]
3136 fn encode_is_copy() -> bool {
3137 false
3138 }
3139
3140 #[inline(always)]
3141 fn decode_is_copy() -> bool {
3142 false
3143 }
3144 }
3145
3146 impl fidl::encoding::ValueTypeMarker for DeliveryType {
3147 type Borrowed<'a> = Self;
3148 #[inline(always)]
3149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3150 *value
3151 }
3152 }
3153
3154 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeliveryType {
3155 #[inline]
3156 unsafe fn encode(
3157 self,
3158 encoder: &mut fidl::encoding::Encoder<'_, D>,
3159 offset: usize,
3160 _depth: fidl::encoding::Depth,
3161 ) -> fidl::Result<()> {
3162 encoder.debug_check_bounds::<Self>(offset);
3163 encoder.write_num(self.into_primitive(), offset);
3164 Ok(())
3165 }
3166 }
3167
3168 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeliveryType {
3169 #[inline(always)]
3170 fn new_empty() -> Self {
3171 Self::unknown()
3172 }
3173
3174 #[inline]
3175 unsafe fn decode(
3176 &mut self,
3177 decoder: &mut fidl::encoding::Decoder<'_, D>,
3178 offset: usize,
3179 _depth: fidl::encoding::Depth,
3180 ) -> fidl::Result<()> {
3181 decoder.debug_check_bounds::<Self>(offset);
3182 let prim = decoder.read_num::<u32>(offset);
3183
3184 *self = Self::from_primitive_allow_unknown(prim);
3185 Ok(())
3186 }
3187 }
3188 unsafe impl fidl::encoding::TypeMarker for DependencyType {
3189 type Owned = Self;
3190
3191 #[inline(always)]
3192 fn inline_align(_context: fidl::encoding::Context) -> usize {
3193 std::mem::align_of::<u32>()
3194 }
3195
3196 #[inline(always)]
3197 fn inline_size(_context: fidl::encoding::Context) -> usize {
3198 std::mem::size_of::<u32>()
3199 }
3200
3201 #[inline(always)]
3202 fn encode_is_copy() -> bool {
3203 true
3204 }
3205
3206 #[inline(always)]
3207 fn decode_is_copy() -> bool {
3208 false
3209 }
3210 }
3211
3212 impl fidl::encoding::ValueTypeMarker for DependencyType {
3213 type Borrowed<'a> = Self;
3214 #[inline(always)]
3215 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3216 *value
3217 }
3218 }
3219
3220 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DependencyType {
3221 #[inline]
3222 unsafe fn encode(
3223 self,
3224 encoder: &mut fidl::encoding::Encoder<'_, D>,
3225 offset: usize,
3226 _depth: fidl::encoding::Depth,
3227 ) -> fidl::Result<()> {
3228 encoder.debug_check_bounds::<Self>(offset);
3229 encoder.write_num(self.into_primitive(), offset);
3230 Ok(())
3231 }
3232 }
3233
3234 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DependencyType {
3235 #[inline(always)]
3236 fn new_empty() -> Self {
3237 Self::Strong
3238 }
3239
3240 #[inline]
3241 unsafe fn decode(
3242 &mut self,
3243 decoder: &mut fidl::encoding::Decoder<'_, D>,
3244 offset: usize,
3245 _depth: fidl::encoding::Depth,
3246 ) -> fidl::Result<()> {
3247 decoder.debug_check_bounds::<Self>(offset);
3248 let prim = decoder.read_num::<u32>(offset);
3249
3250 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3251 Ok(())
3252 }
3253 }
3254 unsafe impl fidl::encoding::TypeMarker for Durability {
3255 type Owned = Self;
3256
3257 #[inline(always)]
3258 fn inline_align(_context: fidl::encoding::Context) -> usize {
3259 std::mem::align_of::<u32>()
3260 }
3261
3262 #[inline(always)]
3263 fn inline_size(_context: fidl::encoding::Context) -> usize {
3264 std::mem::size_of::<u32>()
3265 }
3266
3267 #[inline(always)]
3268 fn encode_is_copy() -> bool {
3269 true
3270 }
3271
3272 #[inline(always)]
3273 fn decode_is_copy() -> bool {
3274 false
3275 }
3276 }
3277
3278 impl fidl::encoding::ValueTypeMarker for Durability {
3279 type Borrowed<'a> = Self;
3280 #[inline(always)]
3281 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3282 *value
3283 }
3284 }
3285
3286 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Durability {
3287 #[inline]
3288 unsafe fn encode(
3289 self,
3290 encoder: &mut fidl::encoding::Encoder<'_, D>,
3291 offset: usize,
3292 _depth: fidl::encoding::Depth,
3293 ) -> fidl::Result<()> {
3294 encoder.debug_check_bounds::<Self>(offset);
3295 encoder.write_num(self.into_primitive(), offset);
3296 Ok(())
3297 }
3298 }
3299
3300 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Durability {
3301 #[inline(always)]
3302 fn new_empty() -> Self {
3303 Self::Transient
3304 }
3305
3306 #[inline]
3307 unsafe fn decode(
3308 &mut self,
3309 decoder: &mut fidl::encoding::Decoder<'_, D>,
3310 offset: usize,
3311 _depth: fidl::encoding::Depth,
3312 ) -> fidl::Result<()> {
3313 decoder.debug_check_bounds::<Self>(offset);
3314 let prim = decoder.read_num::<u32>(offset);
3315
3316 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3317 Ok(())
3318 }
3319 }
3320 unsafe impl fidl::encoding::TypeMarker for EnvironmentExtends {
3321 type Owned = Self;
3322
3323 #[inline(always)]
3324 fn inline_align(_context: fidl::encoding::Context) -> usize {
3325 std::mem::align_of::<u32>()
3326 }
3327
3328 #[inline(always)]
3329 fn inline_size(_context: fidl::encoding::Context) -> usize {
3330 std::mem::size_of::<u32>()
3331 }
3332
3333 #[inline(always)]
3334 fn encode_is_copy() -> bool {
3335 true
3336 }
3337
3338 #[inline(always)]
3339 fn decode_is_copy() -> bool {
3340 false
3341 }
3342 }
3343
3344 impl fidl::encoding::ValueTypeMarker for EnvironmentExtends {
3345 type Borrowed<'a> = Self;
3346 #[inline(always)]
3347 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3348 *value
3349 }
3350 }
3351
3352 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3353 for EnvironmentExtends
3354 {
3355 #[inline]
3356 unsafe fn encode(
3357 self,
3358 encoder: &mut fidl::encoding::Encoder<'_, D>,
3359 offset: usize,
3360 _depth: fidl::encoding::Depth,
3361 ) -> fidl::Result<()> {
3362 encoder.debug_check_bounds::<Self>(offset);
3363 encoder.write_num(self.into_primitive(), offset);
3364 Ok(())
3365 }
3366 }
3367
3368 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvironmentExtends {
3369 #[inline(always)]
3370 fn new_empty() -> Self {
3371 Self::None
3372 }
3373
3374 #[inline]
3375 unsafe fn decode(
3376 &mut self,
3377 decoder: &mut fidl::encoding::Decoder<'_, D>,
3378 offset: usize,
3379 _depth: fidl::encoding::Depth,
3380 ) -> fidl::Result<()> {
3381 decoder.debug_check_bounds::<Self>(offset);
3382 let prim = decoder.read_num::<u32>(offset);
3383
3384 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3385 Ok(())
3386 }
3387 }
3388 unsafe impl fidl::encoding::TypeMarker for OnTerminate {
3389 type Owned = Self;
3390
3391 #[inline(always)]
3392 fn inline_align(_context: fidl::encoding::Context) -> usize {
3393 std::mem::align_of::<u32>()
3394 }
3395
3396 #[inline(always)]
3397 fn inline_size(_context: fidl::encoding::Context) -> usize {
3398 std::mem::size_of::<u32>()
3399 }
3400
3401 #[inline(always)]
3402 fn encode_is_copy() -> bool {
3403 true
3404 }
3405
3406 #[inline(always)]
3407 fn decode_is_copy() -> bool {
3408 false
3409 }
3410 }
3411
3412 impl fidl::encoding::ValueTypeMarker for OnTerminate {
3413 type Borrowed<'a> = Self;
3414 #[inline(always)]
3415 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3416 *value
3417 }
3418 }
3419
3420 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OnTerminate {
3421 #[inline]
3422 unsafe fn encode(
3423 self,
3424 encoder: &mut fidl::encoding::Encoder<'_, D>,
3425 offset: usize,
3426 _depth: fidl::encoding::Depth,
3427 ) -> fidl::Result<()> {
3428 encoder.debug_check_bounds::<Self>(offset);
3429 encoder.write_num(self.into_primitive(), offset);
3430 Ok(())
3431 }
3432 }
3433
3434 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OnTerminate {
3435 #[inline(always)]
3436 fn new_empty() -> Self {
3437 Self::None
3438 }
3439
3440 #[inline]
3441 unsafe fn decode(
3442 &mut self,
3443 decoder: &mut fidl::encoding::Decoder<'_, D>,
3444 offset: usize,
3445 _depth: fidl::encoding::Depth,
3446 ) -> fidl::Result<()> {
3447 decoder.debug_check_bounds::<Self>(offset);
3448 let prim = decoder.read_num::<u32>(offset);
3449
3450 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3451 Ok(())
3452 }
3453 }
3454 unsafe impl fidl::encoding::TypeMarker for StartupMode {
3455 type Owned = Self;
3456
3457 #[inline(always)]
3458 fn inline_align(_context: fidl::encoding::Context) -> usize {
3459 std::mem::align_of::<u32>()
3460 }
3461
3462 #[inline(always)]
3463 fn inline_size(_context: fidl::encoding::Context) -> usize {
3464 std::mem::size_of::<u32>()
3465 }
3466
3467 #[inline(always)]
3468 fn encode_is_copy() -> bool {
3469 true
3470 }
3471
3472 #[inline(always)]
3473 fn decode_is_copy() -> bool {
3474 false
3475 }
3476 }
3477
3478 impl fidl::encoding::ValueTypeMarker for StartupMode {
3479 type Borrowed<'a> = Self;
3480 #[inline(always)]
3481 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3482 *value
3483 }
3484 }
3485
3486 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StartupMode {
3487 #[inline]
3488 unsafe fn encode(
3489 self,
3490 encoder: &mut fidl::encoding::Encoder<'_, D>,
3491 offset: usize,
3492 _depth: fidl::encoding::Depth,
3493 ) -> fidl::Result<()> {
3494 encoder.debug_check_bounds::<Self>(offset);
3495 encoder.write_num(self.into_primitive(), offset);
3496 Ok(())
3497 }
3498 }
3499
3500 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartupMode {
3501 #[inline(always)]
3502 fn new_empty() -> Self {
3503 Self::Lazy
3504 }
3505
3506 #[inline]
3507 unsafe fn decode(
3508 &mut self,
3509 decoder: &mut fidl::encoding::Decoder<'_, D>,
3510 offset: usize,
3511 _depth: fidl::encoding::Depth,
3512 ) -> fidl::Result<()> {
3513 decoder.debug_check_bounds::<Self>(offset);
3514 let prim = decoder.read_num::<u32>(offset);
3515
3516 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3517 Ok(())
3518 }
3519 }
3520 unsafe impl fidl::encoding::TypeMarker for StorageId {
3521 type Owned = Self;
3522
3523 #[inline(always)]
3524 fn inline_align(_context: fidl::encoding::Context) -> usize {
3525 std::mem::align_of::<u32>()
3526 }
3527
3528 #[inline(always)]
3529 fn inline_size(_context: fidl::encoding::Context) -> usize {
3530 std::mem::size_of::<u32>()
3531 }
3532
3533 #[inline(always)]
3534 fn encode_is_copy() -> bool {
3535 true
3536 }
3537
3538 #[inline(always)]
3539 fn decode_is_copy() -> bool {
3540 false
3541 }
3542 }
3543
3544 impl fidl::encoding::ValueTypeMarker for StorageId {
3545 type Borrowed<'a> = Self;
3546 #[inline(always)]
3547 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3548 *value
3549 }
3550 }
3551
3552 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StorageId {
3553 #[inline]
3554 unsafe fn encode(
3555 self,
3556 encoder: &mut fidl::encoding::Encoder<'_, D>,
3557 offset: usize,
3558 _depth: fidl::encoding::Depth,
3559 ) -> fidl::Result<()> {
3560 encoder.debug_check_bounds::<Self>(offset);
3561 encoder.write_num(self.into_primitive(), offset);
3562 Ok(())
3563 }
3564 }
3565
3566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StorageId {
3567 #[inline(always)]
3568 fn new_empty() -> Self {
3569 Self::StaticInstanceId
3570 }
3571
3572 #[inline]
3573 unsafe fn decode(
3574 &mut self,
3575 decoder: &mut fidl::encoding::Decoder<'_, D>,
3576 offset: usize,
3577 _depth: fidl::encoding::Depth,
3578 ) -> fidl::Result<()> {
3579 decoder.debug_check_bounds::<Self>(offset);
3580 let prim = decoder.read_num::<u32>(offset);
3581
3582 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3583 Ok(())
3584 }
3585 }
3586
3587 impl fidl::encoding::ValueTypeMarker for CapabilityRef {
3588 type Borrowed<'a> = &'a Self;
3589 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3590 value
3591 }
3592 }
3593
3594 unsafe impl fidl::encoding::TypeMarker for CapabilityRef {
3595 type Owned = Self;
3596
3597 #[inline(always)]
3598 fn inline_align(_context: fidl::encoding::Context) -> usize {
3599 8
3600 }
3601
3602 #[inline(always)]
3603 fn inline_size(_context: fidl::encoding::Context) -> usize {
3604 16
3605 }
3606 }
3607
3608 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CapabilityRef, D>
3609 for &CapabilityRef
3610 {
3611 #[inline]
3612 unsafe fn encode(
3613 self,
3614 encoder: &mut fidl::encoding::Encoder<'_, D>,
3615 offset: usize,
3616 _depth: fidl::encoding::Depth,
3617 ) -> fidl::Result<()> {
3618 encoder.debug_check_bounds::<CapabilityRef>(offset);
3619 fidl::encoding::Encode::<CapabilityRef, D>::encode(
3621 (<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
3622 &self.name,
3623 ),),
3624 encoder,
3625 offset,
3626 _depth,
3627 )
3628 }
3629 }
3630 unsafe impl<
3631 D: fidl::encoding::ResourceDialect,
3632 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<100>, D>,
3633 > fidl::encoding::Encode<CapabilityRef, D> for (T0,)
3634 {
3635 #[inline]
3636 unsafe fn encode(
3637 self,
3638 encoder: &mut fidl::encoding::Encoder<'_, D>,
3639 offset: usize,
3640 depth: fidl::encoding::Depth,
3641 ) -> fidl::Result<()> {
3642 encoder.debug_check_bounds::<CapabilityRef>(offset);
3643 self.0.encode(encoder, offset + 0, depth)?;
3647 Ok(())
3648 }
3649 }
3650
3651 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilityRef {
3652 #[inline(always)]
3653 fn new_empty() -> Self {
3654 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<100>, D) }
3655 }
3656
3657 #[inline]
3658 unsafe fn decode(
3659 &mut self,
3660 decoder: &mut fidl::encoding::Decoder<'_, D>,
3661 offset: usize,
3662 _depth: fidl::encoding::Depth,
3663 ) -> fidl::Result<()> {
3664 decoder.debug_check_bounds::<Self>(offset);
3665 fidl::decode!(
3667 fidl::encoding::BoundedString<100>,
3668 D,
3669 &mut self.name,
3670 decoder,
3671 offset + 0,
3672 _depth
3673 )?;
3674 Ok(())
3675 }
3676 }
3677
3678 impl fidl::encoding::ValueTypeMarker for ChildRef {
3679 type Borrowed<'a> = &'a Self;
3680 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3681 value
3682 }
3683 }
3684
3685 unsafe impl fidl::encoding::TypeMarker for ChildRef {
3686 type Owned = Self;
3687
3688 #[inline(always)]
3689 fn inline_align(_context: fidl::encoding::Context) -> usize {
3690 8
3691 }
3692
3693 #[inline(always)]
3694 fn inline_size(_context: fidl::encoding::Context) -> usize {
3695 32
3696 }
3697 }
3698
3699 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChildRef, D> for &ChildRef {
3700 #[inline]
3701 unsafe fn encode(
3702 self,
3703 encoder: &mut fidl::encoding::Encoder<'_, D>,
3704 offset: usize,
3705 _depth: fidl::encoding::Depth,
3706 ) -> fidl::Result<()> {
3707 encoder.debug_check_bounds::<ChildRef>(offset);
3708 fidl::encoding::Encode::<ChildRef, D>::encode(
3710 (
3711 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
3712 <fidl::encoding::Optional<fidl::encoding::BoundedString<100>> as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
3713 ),
3714 encoder, offset, _depth
3715 )
3716 }
3717 }
3718 unsafe impl<
3719 D: fidl::encoding::ResourceDialect,
3720 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
3721 T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<100>>, D>,
3722 > fidl::encoding::Encode<ChildRef, D> for (T0, T1)
3723 {
3724 #[inline]
3725 unsafe fn encode(
3726 self,
3727 encoder: &mut fidl::encoding::Encoder<'_, D>,
3728 offset: usize,
3729 depth: fidl::encoding::Depth,
3730 ) -> fidl::Result<()> {
3731 encoder.debug_check_bounds::<ChildRef>(offset);
3732 self.0.encode(encoder, offset + 0, depth)?;
3736 self.1.encode(encoder, offset + 16, depth)?;
3737 Ok(())
3738 }
3739 }
3740
3741 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildRef {
3742 #[inline(always)]
3743 fn new_empty() -> Self {
3744 Self {
3745 name: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
3746 collection: fidl::new_empty!(
3747 fidl::encoding::Optional<fidl::encoding::BoundedString<100>>,
3748 D
3749 ),
3750 }
3751 }
3752
3753 #[inline]
3754 unsafe fn decode(
3755 &mut self,
3756 decoder: &mut fidl::encoding::Decoder<'_, D>,
3757 offset: usize,
3758 _depth: fidl::encoding::Depth,
3759 ) -> fidl::Result<()> {
3760 decoder.debug_check_bounds::<Self>(offset);
3761 fidl::decode!(
3763 fidl::encoding::BoundedString<1024>,
3764 D,
3765 &mut self.name,
3766 decoder,
3767 offset + 0,
3768 _depth
3769 )?;
3770 fidl::decode!(
3771 fidl::encoding::Optional<fidl::encoding::BoundedString<100>>,
3772 D,
3773 &mut self.collection,
3774 decoder,
3775 offset + 16,
3776 _depth
3777 )?;
3778 Ok(())
3779 }
3780 }
3781
3782 impl fidl::encoding::ValueTypeMarker for CollectionRef {
3783 type Borrowed<'a> = &'a Self;
3784 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3785 value
3786 }
3787 }
3788
3789 unsafe impl fidl::encoding::TypeMarker for CollectionRef {
3790 type Owned = Self;
3791
3792 #[inline(always)]
3793 fn inline_align(_context: fidl::encoding::Context) -> usize {
3794 8
3795 }
3796
3797 #[inline(always)]
3798 fn inline_size(_context: fidl::encoding::Context) -> usize {
3799 16
3800 }
3801 }
3802
3803 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CollectionRef, D>
3804 for &CollectionRef
3805 {
3806 #[inline]
3807 unsafe fn encode(
3808 self,
3809 encoder: &mut fidl::encoding::Encoder<'_, D>,
3810 offset: usize,
3811 _depth: fidl::encoding::Depth,
3812 ) -> fidl::Result<()> {
3813 encoder.debug_check_bounds::<CollectionRef>(offset);
3814 fidl::encoding::Encode::<CollectionRef, D>::encode(
3816 (<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
3817 &self.name,
3818 ),),
3819 encoder,
3820 offset,
3821 _depth,
3822 )
3823 }
3824 }
3825 unsafe impl<
3826 D: fidl::encoding::ResourceDialect,
3827 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<100>, D>,
3828 > fidl::encoding::Encode<CollectionRef, D> for (T0,)
3829 {
3830 #[inline]
3831 unsafe fn encode(
3832 self,
3833 encoder: &mut fidl::encoding::Encoder<'_, D>,
3834 offset: usize,
3835 depth: fidl::encoding::Depth,
3836 ) -> fidl::Result<()> {
3837 encoder.debug_check_bounds::<CollectionRef>(offset);
3838 self.0.encode(encoder, offset + 0, depth)?;
3842 Ok(())
3843 }
3844 }
3845
3846 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CollectionRef {
3847 #[inline(always)]
3848 fn new_empty() -> Self {
3849 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<100>, D) }
3850 }
3851
3852 #[inline]
3853 unsafe fn decode(
3854 &mut self,
3855 decoder: &mut fidl::encoding::Decoder<'_, D>,
3856 offset: usize,
3857 _depth: fidl::encoding::Depth,
3858 ) -> fidl::Result<()> {
3859 decoder.debug_check_bounds::<Self>(offset);
3860 fidl::decode!(
3862 fidl::encoding::BoundedString<100>,
3863 D,
3864 &mut self.name,
3865 decoder,
3866 offset + 0,
3867 _depth
3868 )?;
3869 Ok(())
3870 }
3871 }
3872
3873 impl fidl::encoding::ValueTypeMarker for ConfigType {
3874 type Borrowed<'a> = &'a Self;
3875 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3876 value
3877 }
3878 }
3879
3880 unsafe impl fidl::encoding::TypeMarker for ConfigType {
3881 type Owned = Self;
3882
3883 #[inline(always)]
3884 fn inline_align(_context: fidl::encoding::Context) -> usize {
3885 8
3886 }
3887
3888 #[inline(always)]
3889 fn inline_size(_context: fidl::encoding::Context) -> usize {
3890 40
3891 }
3892 }
3893
3894 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigType, D>
3895 for &ConfigType
3896 {
3897 #[inline]
3898 unsafe fn encode(
3899 self,
3900 encoder: &mut fidl::encoding::Encoder<'_, D>,
3901 offset: usize,
3902 _depth: fidl::encoding::Depth,
3903 ) -> fidl::Result<()> {
3904 encoder.debug_check_bounds::<ConfigType>(offset);
3905 fidl::encoding::Encode::<ConfigType, D>::encode(
3907 (
3908 <ConfigTypeLayout as fidl::encoding::ValueTypeMarker>::borrow(&self.layout),
3909 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<LayoutParameter>> as fidl::encoding::ValueTypeMarker>::borrow(&self.parameters),
3910 <fidl::encoding::UnboundedVector<LayoutConstraint> as fidl::encoding::ValueTypeMarker>::borrow(&self.constraints),
3911 ),
3912 encoder, offset, _depth
3913 )
3914 }
3915 }
3916 unsafe impl<
3917 D: fidl::encoding::ResourceDialect,
3918 T0: fidl::encoding::Encode<ConfigTypeLayout, D>,
3919 T1: fidl::encoding::Encode<
3920 fidl::encoding::Optional<fidl::encoding::UnboundedVector<LayoutParameter>>,
3921 D,
3922 >,
3923 T2: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LayoutConstraint>, D>,
3924 > fidl::encoding::Encode<ConfigType, D> for (T0, T1, T2)
3925 {
3926 #[inline]
3927 unsafe fn encode(
3928 self,
3929 encoder: &mut fidl::encoding::Encoder<'_, D>,
3930 offset: usize,
3931 depth: fidl::encoding::Depth,
3932 ) -> fidl::Result<()> {
3933 encoder.debug_check_bounds::<ConfigType>(offset);
3934 unsafe {
3937 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3938 (ptr as *mut u64).write_unaligned(0);
3939 }
3940 self.0.encode(encoder, offset + 0, depth)?;
3942 self.1.encode(encoder, offset + 8, depth)?;
3943 self.2.encode(encoder, offset + 24, depth)?;
3944 Ok(())
3945 }
3946 }
3947
3948 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigType {
3949 #[inline(always)]
3950 fn new_empty() -> Self {
3951 Self {
3952 layout: fidl::new_empty!(ConfigTypeLayout, D),
3953 parameters: fidl::new_empty!(
3954 fidl::encoding::Optional<fidl::encoding::UnboundedVector<LayoutParameter>>,
3955 D
3956 ),
3957 constraints: fidl::new_empty!(fidl::encoding::UnboundedVector<LayoutConstraint>, D),
3958 }
3959 }
3960
3961 #[inline]
3962 unsafe fn decode(
3963 &mut self,
3964 decoder: &mut fidl::encoding::Decoder<'_, D>,
3965 offset: usize,
3966 _depth: fidl::encoding::Depth,
3967 ) -> fidl::Result<()> {
3968 decoder.debug_check_bounds::<Self>(offset);
3969 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3971 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3972 let mask = 0xffffffff00000000u64;
3973 let maskedval = padval & mask;
3974 if maskedval != 0 {
3975 return Err(fidl::Error::NonZeroPadding {
3976 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3977 });
3978 }
3979 fidl::decode!(ConfigTypeLayout, D, &mut self.layout, decoder, offset + 0, _depth)?;
3980 fidl::decode!(
3981 fidl::encoding::Optional<fidl::encoding::UnboundedVector<LayoutParameter>>,
3982 D,
3983 &mut self.parameters,
3984 decoder,
3985 offset + 8,
3986 _depth
3987 )?;
3988 fidl::decode!(
3989 fidl::encoding::UnboundedVector<LayoutConstraint>,
3990 D,
3991 &mut self.constraints,
3992 decoder,
3993 offset + 24,
3994 _depth
3995 )?;
3996 Ok(())
3997 }
3998 }
3999
4000 impl fidl::encoding::ValueTypeMarker for DebugRef {
4001 type Borrowed<'a> = &'a Self;
4002 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4003 value
4004 }
4005 }
4006
4007 unsafe impl fidl::encoding::TypeMarker for DebugRef {
4008 type Owned = Self;
4009
4010 #[inline(always)]
4011 fn inline_align(_context: fidl::encoding::Context) -> usize {
4012 1
4013 }
4014
4015 #[inline(always)]
4016 fn inline_size(_context: fidl::encoding::Context) -> usize {
4017 1
4018 }
4019 }
4020
4021 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DebugRef, D> for &DebugRef {
4022 #[inline]
4023 unsafe fn encode(
4024 self,
4025 encoder: &mut fidl::encoding::Encoder<'_, D>,
4026 offset: usize,
4027 _depth: fidl::encoding::Depth,
4028 ) -> fidl::Result<()> {
4029 encoder.debug_check_bounds::<DebugRef>(offset);
4030 encoder.write_num(0u8, offset);
4031 Ok(())
4032 }
4033 }
4034
4035 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DebugRef {
4036 #[inline(always)]
4037 fn new_empty() -> Self {
4038 Self
4039 }
4040
4041 #[inline]
4042 unsafe fn decode(
4043 &mut self,
4044 decoder: &mut fidl::encoding::Decoder<'_, D>,
4045 offset: usize,
4046 _depth: fidl::encoding::Depth,
4047 ) -> fidl::Result<()> {
4048 decoder.debug_check_bounds::<Self>(offset);
4049 match decoder.read_num::<u8>(offset) {
4050 0 => Ok(()),
4051 _ => Err(fidl::Error::Invalid),
4052 }
4053 }
4054 }
4055
4056 impl fidl::encoding::ValueTypeMarker for EnvironmentRef {
4057 type Borrowed<'a> = &'a Self;
4058 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4059 value
4060 }
4061 }
4062
4063 unsafe impl fidl::encoding::TypeMarker for EnvironmentRef {
4064 type Owned = Self;
4065
4066 #[inline(always)]
4067 fn inline_align(_context: fidl::encoding::Context) -> usize {
4068 1
4069 }
4070
4071 #[inline(always)]
4072 fn inline_size(_context: fidl::encoding::Context) -> usize {
4073 1
4074 }
4075 }
4076
4077 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EnvironmentRef, D>
4078 for &EnvironmentRef
4079 {
4080 #[inline]
4081 unsafe fn encode(
4082 self,
4083 encoder: &mut fidl::encoding::Encoder<'_, D>,
4084 offset: usize,
4085 _depth: fidl::encoding::Depth,
4086 ) -> fidl::Result<()> {
4087 encoder.debug_check_bounds::<EnvironmentRef>(offset);
4088 encoder.write_num(0u8, offset);
4089 Ok(())
4090 }
4091 }
4092
4093 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvironmentRef {
4094 #[inline(always)]
4095 fn new_empty() -> Self {
4096 Self
4097 }
4098
4099 #[inline]
4100 unsafe fn decode(
4101 &mut self,
4102 decoder: &mut fidl::encoding::Decoder<'_, D>,
4103 offset: usize,
4104 _depth: fidl::encoding::Depth,
4105 ) -> fidl::Result<()> {
4106 decoder.debug_check_bounds::<Self>(offset);
4107 match decoder.read_num::<u8>(offset) {
4108 0 => Ok(()),
4109 _ => Err(fidl::Error::Invalid),
4110 }
4111 }
4112 }
4113
4114 impl fidl::encoding::ValueTypeMarker for FrameworkRef {
4115 type Borrowed<'a> = &'a Self;
4116 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4117 value
4118 }
4119 }
4120
4121 unsafe impl fidl::encoding::TypeMarker for FrameworkRef {
4122 type Owned = Self;
4123
4124 #[inline(always)]
4125 fn inline_align(_context: fidl::encoding::Context) -> usize {
4126 1
4127 }
4128
4129 #[inline(always)]
4130 fn inline_size(_context: fidl::encoding::Context) -> usize {
4131 1
4132 }
4133 }
4134
4135 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FrameworkRef, D>
4136 for &FrameworkRef
4137 {
4138 #[inline]
4139 unsafe fn encode(
4140 self,
4141 encoder: &mut fidl::encoding::Encoder<'_, D>,
4142 offset: usize,
4143 _depth: fidl::encoding::Depth,
4144 ) -> fidl::Result<()> {
4145 encoder.debug_check_bounds::<FrameworkRef>(offset);
4146 encoder.write_num(0u8, offset);
4147 Ok(())
4148 }
4149 }
4150
4151 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FrameworkRef {
4152 #[inline(always)]
4153 fn new_empty() -> Self {
4154 Self
4155 }
4156
4157 #[inline]
4158 unsafe fn decode(
4159 &mut self,
4160 decoder: &mut fidl::encoding::Decoder<'_, D>,
4161 offset: usize,
4162 _depth: fidl::encoding::Depth,
4163 ) -> fidl::Result<()> {
4164 decoder.debug_check_bounds::<Self>(offset);
4165 match decoder.read_num::<u8>(offset) {
4166 0 => Ok(()),
4167 _ => Err(fidl::Error::Invalid),
4168 }
4169 }
4170 }
4171
4172 impl fidl::encoding::ValueTypeMarker for NameMapping {
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 NameMapping {
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 32
4190 }
4191 }
4192
4193 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NameMapping, D>
4194 for &NameMapping
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::<NameMapping>(offset);
4204 fidl::encoding::Encode::<NameMapping, D>::encode(
4206 (
4207 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
4208 &self.source_name,
4209 ),
4210 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
4211 &self.target_name,
4212 ),
4213 ),
4214 encoder,
4215 offset,
4216 _depth,
4217 )
4218 }
4219 }
4220 unsafe impl<
4221 D: fidl::encoding::ResourceDialect,
4222 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<100>, D>,
4223 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<100>, D>,
4224 > fidl::encoding::Encode<NameMapping, D> for (T0, T1)
4225 {
4226 #[inline]
4227 unsafe fn encode(
4228 self,
4229 encoder: &mut fidl::encoding::Encoder<'_, D>,
4230 offset: usize,
4231 depth: fidl::encoding::Depth,
4232 ) -> fidl::Result<()> {
4233 encoder.debug_check_bounds::<NameMapping>(offset);
4234 self.0.encode(encoder, offset + 0, depth)?;
4238 self.1.encode(encoder, offset + 16, depth)?;
4239 Ok(())
4240 }
4241 }
4242
4243 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NameMapping {
4244 #[inline(always)]
4245 fn new_empty() -> Self {
4246 Self {
4247 source_name: fidl::new_empty!(fidl::encoding::BoundedString<100>, D),
4248 target_name: fidl::new_empty!(fidl::encoding::BoundedString<100>, D),
4249 }
4250 }
4251
4252 #[inline]
4253 unsafe fn decode(
4254 &mut self,
4255 decoder: &mut fidl::encoding::Decoder<'_, D>,
4256 offset: usize,
4257 _depth: fidl::encoding::Depth,
4258 ) -> fidl::Result<()> {
4259 decoder.debug_check_bounds::<Self>(offset);
4260 fidl::decode!(
4262 fidl::encoding::BoundedString<100>,
4263 D,
4264 &mut self.source_name,
4265 decoder,
4266 offset + 0,
4267 _depth
4268 )?;
4269 fidl::decode!(
4270 fidl::encoding::BoundedString<100>,
4271 D,
4272 &mut self.target_name,
4273 decoder,
4274 offset + 16,
4275 _depth
4276 )?;
4277 Ok(())
4278 }
4279 }
4280
4281 impl fidl::encoding::ValueTypeMarker for ParentRef {
4282 type Borrowed<'a> = &'a Self;
4283 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4284 value
4285 }
4286 }
4287
4288 unsafe impl fidl::encoding::TypeMarker for ParentRef {
4289 type Owned = Self;
4290
4291 #[inline(always)]
4292 fn inline_align(_context: fidl::encoding::Context) -> usize {
4293 1
4294 }
4295
4296 #[inline(always)]
4297 fn inline_size(_context: fidl::encoding::Context) -> usize {
4298 1
4299 }
4300 }
4301
4302 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ParentRef, D>
4303 for &ParentRef
4304 {
4305 #[inline]
4306 unsafe fn encode(
4307 self,
4308 encoder: &mut fidl::encoding::Encoder<'_, D>,
4309 offset: usize,
4310 _depth: fidl::encoding::Depth,
4311 ) -> fidl::Result<()> {
4312 encoder.debug_check_bounds::<ParentRef>(offset);
4313 encoder.write_num(0u8, offset);
4314 Ok(())
4315 }
4316 }
4317
4318 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ParentRef {
4319 #[inline(always)]
4320 fn new_empty() -> Self {
4321 Self
4322 }
4323
4324 #[inline]
4325 unsafe fn decode(
4326 &mut self,
4327 decoder: &mut fidl::encoding::Decoder<'_, D>,
4328 offset: usize,
4329 _depth: fidl::encoding::Depth,
4330 ) -> fidl::Result<()> {
4331 decoder.debug_check_bounds::<Self>(offset);
4332 match decoder.read_num::<u8>(offset) {
4333 0 => Ok(()),
4334 _ => Err(fidl::Error::Invalid),
4335 }
4336 }
4337 }
4338
4339 impl fidl::encoding::ValueTypeMarker for ResolvedConfig {
4340 type Borrowed<'a> = &'a Self;
4341 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4342 value
4343 }
4344 }
4345
4346 unsafe impl fidl::encoding::TypeMarker for ResolvedConfig {
4347 type Owned = Self;
4348
4349 #[inline(always)]
4350 fn inline_align(_context: fidl::encoding::Context) -> usize {
4351 8
4352 }
4353
4354 #[inline(always)]
4355 fn inline_size(_context: fidl::encoding::Context) -> usize {
4356 32
4357 }
4358 }
4359
4360 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolvedConfig, D>
4361 for &ResolvedConfig
4362 {
4363 #[inline]
4364 unsafe fn encode(
4365 self,
4366 encoder: &mut fidl::encoding::Encoder<'_, D>,
4367 offset: usize,
4368 _depth: fidl::encoding::Depth,
4369 ) -> fidl::Result<()> {
4370 encoder.debug_check_bounds::<ResolvedConfig>(offset);
4371 fidl::encoding::Encode::<ResolvedConfig, D>::encode(
4373 (
4374 <fidl::encoding::UnboundedVector<ResolvedConfigField> as fidl::encoding::ValueTypeMarker>::borrow(&self.fields),
4375 <ConfigChecksum as fidl::encoding::ValueTypeMarker>::borrow(&self.checksum),
4376 ),
4377 encoder, offset, _depth
4378 )
4379 }
4380 }
4381 unsafe impl<
4382 D: fidl::encoding::ResourceDialect,
4383 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ResolvedConfigField>, D>,
4384 T1: fidl::encoding::Encode<ConfigChecksum, D>,
4385 > fidl::encoding::Encode<ResolvedConfig, D> for (T0, T1)
4386 {
4387 #[inline]
4388 unsafe fn encode(
4389 self,
4390 encoder: &mut fidl::encoding::Encoder<'_, D>,
4391 offset: usize,
4392 depth: fidl::encoding::Depth,
4393 ) -> fidl::Result<()> {
4394 encoder.debug_check_bounds::<ResolvedConfig>(offset);
4395 self.0.encode(encoder, offset + 0, depth)?;
4399 self.1.encode(encoder, offset + 16, depth)?;
4400 Ok(())
4401 }
4402 }
4403
4404 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolvedConfig {
4405 #[inline(always)]
4406 fn new_empty() -> Self {
4407 Self {
4408 fields: fidl::new_empty!(fidl::encoding::UnboundedVector<ResolvedConfigField>, D),
4409 checksum: fidl::new_empty!(ConfigChecksum, D),
4410 }
4411 }
4412
4413 #[inline]
4414 unsafe fn decode(
4415 &mut self,
4416 decoder: &mut fidl::encoding::Decoder<'_, D>,
4417 offset: usize,
4418 _depth: fidl::encoding::Depth,
4419 ) -> fidl::Result<()> {
4420 decoder.debug_check_bounds::<Self>(offset);
4421 fidl::decode!(
4423 fidl::encoding::UnboundedVector<ResolvedConfigField>,
4424 D,
4425 &mut self.fields,
4426 decoder,
4427 offset + 0,
4428 _depth
4429 )?;
4430 fidl::decode!(ConfigChecksum, D, &mut self.checksum, decoder, offset + 16, _depth)?;
4431 Ok(())
4432 }
4433 }
4434
4435 impl fidl::encoding::ValueTypeMarker for ResolvedConfigField {
4436 type Borrowed<'a> = &'a Self;
4437 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4438 value
4439 }
4440 }
4441
4442 unsafe impl fidl::encoding::TypeMarker for ResolvedConfigField {
4443 type Owned = Self;
4444
4445 #[inline(always)]
4446 fn inline_align(_context: fidl::encoding::Context) -> usize {
4447 8
4448 }
4449
4450 #[inline(always)]
4451 fn inline_size(_context: fidl::encoding::Context) -> usize {
4452 32
4453 }
4454 }
4455
4456 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolvedConfigField, D>
4457 for &ResolvedConfigField
4458 {
4459 #[inline]
4460 unsafe fn encode(
4461 self,
4462 encoder: &mut fidl::encoding::Encoder<'_, D>,
4463 offset: usize,
4464 _depth: fidl::encoding::Depth,
4465 ) -> fidl::Result<()> {
4466 encoder.debug_check_bounds::<ResolvedConfigField>(offset);
4467 fidl::encoding::Encode::<ResolvedConfigField, D>::encode(
4469 (
4470 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
4471 &self.key,
4472 ),
4473 <ConfigValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4474 ),
4475 encoder,
4476 offset,
4477 _depth,
4478 )
4479 }
4480 }
4481 unsafe impl<
4482 D: fidl::encoding::ResourceDialect,
4483 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
4484 T1: fidl::encoding::Encode<ConfigValue, D>,
4485 > fidl::encoding::Encode<ResolvedConfigField, D> for (T0, T1)
4486 {
4487 #[inline]
4488 unsafe fn encode(
4489 self,
4490 encoder: &mut fidl::encoding::Encoder<'_, D>,
4491 offset: usize,
4492 depth: fidl::encoding::Depth,
4493 ) -> fidl::Result<()> {
4494 encoder.debug_check_bounds::<ResolvedConfigField>(offset);
4495 self.0.encode(encoder, offset + 0, depth)?;
4499 self.1.encode(encoder, offset + 16, depth)?;
4500 Ok(())
4501 }
4502 }
4503
4504 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolvedConfigField {
4505 #[inline(always)]
4506 fn new_empty() -> Self {
4507 Self {
4508 key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
4509 value: fidl::new_empty!(ConfigValue, D),
4510 }
4511 }
4512
4513 #[inline]
4514 unsafe fn decode(
4515 &mut self,
4516 decoder: &mut fidl::encoding::Decoder<'_, D>,
4517 offset: usize,
4518 _depth: fidl::encoding::Depth,
4519 ) -> fidl::Result<()> {
4520 decoder.debug_check_bounds::<Self>(offset);
4521 fidl::decode!(
4523 fidl::encoding::UnboundedString,
4524 D,
4525 &mut self.key,
4526 decoder,
4527 offset + 0,
4528 _depth
4529 )?;
4530 fidl::decode!(ConfigValue, D, &mut self.value, decoder, offset + 16, _depth)?;
4531 Ok(())
4532 }
4533 }
4534
4535 impl fidl::encoding::ValueTypeMarker for SelfRef {
4536 type Borrowed<'a> = &'a Self;
4537 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4538 value
4539 }
4540 }
4541
4542 unsafe impl fidl::encoding::TypeMarker for SelfRef {
4543 type Owned = Self;
4544
4545 #[inline(always)]
4546 fn inline_align(_context: fidl::encoding::Context) -> usize {
4547 1
4548 }
4549
4550 #[inline(always)]
4551 fn inline_size(_context: fidl::encoding::Context) -> usize {
4552 1
4553 }
4554 }
4555
4556 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SelfRef, D> for &SelfRef {
4557 #[inline]
4558 unsafe fn encode(
4559 self,
4560 encoder: &mut fidl::encoding::Encoder<'_, D>,
4561 offset: usize,
4562 _depth: fidl::encoding::Depth,
4563 ) -> fidl::Result<()> {
4564 encoder.debug_check_bounds::<SelfRef>(offset);
4565 encoder.write_num(0u8, offset);
4566 Ok(())
4567 }
4568 }
4569
4570 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SelfRef {
4571 #[inline(always)]
4572 fn new_empty() -> Self {
4573 Self
4574 }
4575
4576 #[inline]
4577 unsafe fn decode(
4578 &mut self,
4579 decoder: &mut fidl::encoding::Decoder<'_, D>,
4580 offset: usize,
4581 _depth: fidl::encoding::Depth,
4582 ) -> fidl::Result<()> {
4583 decoder.debug_check_bounds::<Self>(offset);
4584 match decoder.read_num::<u8>(offset) {
4585 0 => Ok(()),
4586 _ => Err(fidl::Error::Invalid),
4587 }
4588 }
4589 }
4590
4591 impl fidl::encoding::ValueTypeMarker for VoidRef {
4592 type Borrowed<'a> = &'a Self;
4593 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4594 value
4595 }
4596 }
4597
4598 unsafe impl fidl::encoding::TypeMarker for VoidRef {
4599 type Owned = Self;
4600
4601 #[inline(always)]
4602 fn inline_align(_context: fidl::encoding::Context) -> usize {
4603 1
4604 }
4605
4606 #[inline(always)]
4607 fn inline_size(_context: fidl::encoding::Context) -> usize {
4608 1
4609 }
4610 }
4611
4612 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VoidRef, D> for &VoidRef {
4613 #[inline]
4614 unsafe fn encode(
4615 self,
4616 encoder: &mut fidl::encoding::Encoder<'_, D>,
4617 offset: usize,
4618 _depth: fidl::encoding::Depth,
4619 ) -> fidl::Result<()> {
4620 encoder.debug_check_bounds::<VoidRef>(offset);
4621 encoder.write_num(0u8, offset);
4622 Ok(())
4623 }
4624 }
4625
4626 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VoidRef {
4627 #[inline(always)]
4628 fn new_empty() -> Self {
4629 Self
4630 }
4631
4632 #[inline]
4633 unsafe fn decode(
4634 &mut self,
4635 decoder: &mut fidl::encoding::Decoder<'_, D>,
4636 offset: usize,
4637 _depth: fidl::encoding::Depth,
4638 ) -> fidl::Result<()> {
4639 decoder.debug_check_bounds::<Self>(offset);
4640 match decoder.read_num::<u8>(offset) {
4641 0 => Ok(()),
4642 _ => Err(fidl::Error::Invalid),
4643 }
4644 }
4645 }
4646
4647 impl Child {
4648 #[inline(always)]
4649 fn max_ordinal_present(&self) -> u64 {
4650 if let Some(_) = self.config_overrides {
4651 return 6;
4652 }
4653 if let Some(_) = self.on_terminate {
4654 return 5;
4655 }
4656 if let Some(_) = self.environment {
4657 return 4;
4658 }
4659 if let Some(_) = self.startup {
4660 return 3;
4661 }
4662 if let Some(_) = self.url {
4663 return 2;
4664 }
4665 if let Some(_) = self.name {
4666 return 1;
4667 }
4668 0
4669 }
4670 }
4671
4672 impl fidl::encoding::ValueTypeMarker for Child {
4673 type Borrowed<'a> = &'a Self;
4674 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4675 value
4676 }
4677 }
4678
4679 unsafe impl fidl::encoding::TypeMarker for Child {
4680 type Owned = Self;
4681
4682 #[inline(always)]
4683 fn inline_align(_context: fidl::encoding::Context) -> usize {
4684 8
4685 }
4686
4687 #[inline(always)]
4688 fn inline_size(_context: fidl::encoding::Context) -> usize {
4689 16
4690 }
4691 }
4692
4693 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Child, D> for &Child {
4694 unsafe fn encode(
4695 self,
4696 encoder: &mut fidl::encoding::Encoder<'_, D>,
4697 offset: usize,
4698 mut depth: fidl::encoding::Depth,
4699 ) -> fidl::Result<()> {
4700 encoder.debug_check_bounds::<Child>(offset);
4701 let max_ordinal: u64 = self.max_ordinal_present();
4703 encoder.write_num(max_ordinal, offset);
4704 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4705 if max_ordinal == 0 {
4707 return Ok(());
4708 }
4709 depth.increment()?;
4710 let envelope_size = 8;
4711 let bytes_len = max_ordinal as usize * envelope_size;
4712 #[allow(unused_variables)]
4713 let offset = encoder.out_of_line_offset(bytes_len);
4714 let mut _prev_end_offset: usize = 0;
4715 if 1 > max_ordinal {
4716 return Ok(());
4717 }
4718
4719 let cur_offset: usize = (1 - 1) * envelope_size;
4722
4723 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4725
4726 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
4731 self.name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
4732 encoder, offset + cur_offset, depth
4733 )?;
4734
4735 _prev_end_offset = cur_offset + envelope_size;
4736 if 2 > max_ordinal {
4737 return Ok(());
4738 }
4739
4740 let cur_offset: usize = (2 - 1) * envelope_size;
4743
4744 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4746
4747 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
4752 self.url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
4753 encoder, offset + cur_offset, depth
4754 )?;
4755
4756 _prev_end_offset = cur_offset + envelope_size;
4757 if 3 > max_ordinal {
4758 return Ok(());
4759 }
4760
4761 let cur_offset: usize = (3 - 1) * envelope_size;
4764
4765 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4767
4768 fidl::encoding::encode_in_envelope_optional::<StartupMode, D>(
4773 self.startup.as_ref().map(<StartupMode as fidl::encoding::ValueTypeMarker>::borrow),
4774 encoder,
4775 offset + cur_offset,
4776 depth,
4777 )?;
4778
4779 _prev_end_offset = cur_offset + envelope_size;
4780 if 4 > max_ordinal {
4781 return Ok(());
4782 }
4783
4784 let cur_offset: usize = (4 - 1) * envelope_size;
4787
4788 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4790
4791 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
4796 self.environment.as_ref().map(
4797 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
4798 ),
4799 encoder,
4800 offset + cur_offset,
4801 depth,
4802 )?;
4803
4804 _prev_end_offset = cur_offset + envelope_size;
4805 if 5 > max_ordinal {
4806 return Ok(());
4807 }
4808
4809 let cur_offset: usize = (5 - 1) * envelope_size;
4812
4813 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4815
4816 fidl::encoding::encode_in_envelope_optional::<OnTerminate, D>(
4821 self.on_terminate
4822 .as_ref()
4823 .map(<OnTerminate as fidl::encoding::ValueTypeMarker>::borrow),
4824 encoder,
4825 offset + cur_offset,
4826 depth,
4827 )?;
4828
4829 _prev_end_offset = cur_offset + envelope_size;
4830 if 6 > max_ordinal {
4831 return Ok(());
4832 }
4833
4834 let cur_offset: usize = (6 - 1) * envelope_size;
4837
4838 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4840
4841 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ConfigOverride>, D>(
4846 self.config_overrides.as_ref().map(<fidl::encoding::UnboundedVector<ConfigOverride> as fidl::encoding::ValueTypeMarker>::borrow),
4847 encoder, offset + cur_offset, depth
4848 )?;
4849
4850 _prev_end_offset = cur_offset + envelope_size;
4851
4852 Ok(())
4853 }
4854 }
4855
4856 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Child {
4857 #[inline(always)]
4858 fn new_empty() -> Self {
4859 Self::default()
4860 }
4861
4862 unsafe fn decode(
4863 &mut self,
4864 decoder: &mut fidl::encoding::Decoder<'_, D>,
4865 offset: usize,
4866 mut depth: fidl::encoding::Depth,
4867 ) -> fidl::Result<()> {
4868 decoder.debug_check_bounds::<Self>(offset);
4869 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4870 None => return Err(fidl::Error::NotNullable),
4871 Some(len) => len,
4872 };
4873 if len == 0 {
4875 return Ok(());
4876 };
4877 depth.increment()?;
4878 let envelope_size = 8;
4879 let bytes_len = len * envelope_size;
4880 let offset = decoder.out_of_line_offset(bytes_len)?;
4881 let mut _next_ordinal_to_read = 0;
4883 let mut next_offset = offset;
4884 let end_offset = offset + bytes_len;
4885 _next_ordinal_to_read += 1;
4886 if next_offset >= end_offset {
4887 return Ok(());
4888 }
4889
4890 while _next_ordinal_to_read < 1 {
4892 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4893 _next_ordinal_to_read += 1;
4894 next_offset += envelope_size;
4895 }
4896
4897 let next_out_of_line = decoder.next_out_of_line();
4898 let handles_before = decoder.remaining_handles();
4899 if let Some((inlined, num_bytes, num_handles)) =
4900 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4901 {
4902 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4903 if inlined != (member_inline_size <= 4) {
4904 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4905 }
4906 let inner_offset;
4907 let mut inner_depth = depth.clone();
4908 if inlined {
4909 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4910 inner_offset = next_offset;
4911 } else {
4912 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4913 inner_depth.increment()?;
4914 }
4915 let val_ref = self.name.get_or_insert_with(|| {
4916 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
4917 });
4918 fidl::decode!(
4919 fidl::encoding::BoundedString<1024>,
4920 D,
4921 val_ref,
4922 decoder,
4923 inner_offset,
4924 inner_depth
4925 )?;
4926 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4927 {
4928 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4929 }
4930 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4931 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4932 }
4933 }
4934
4935 next_offset += envelope_size;
4936 _next_ordinal_to_read += 1;
4937 if next_offset >= end_offset {
4938 return Ok(());
4939 }
4940
4941 while _next_ordinal_to_read < 2 {
4943 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4944 _next_ordinal_to_read += 1;
4945 next_offset += envelope_size;
4946 }
4947
4948 let next_out_of_line = decoder.next_out_of_line();
4949 let handles_before = decoder.remaining_handles();
4950 if let Some((inlined, num_bytes, num_handles)) =
4951 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4952 {
4953 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4954 if inlined != (member_inline_size <= 4) {
4955 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4956 }
4957 let inner_offset;
4958 let mut inner_depth = depth.clone();
4959 if inlined {
4960 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4961 inner_offset = next_offset;
4962 } else {
4963 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4964 inner_depth.increment()?;
4965 }
4966 let val_ref = self.url.get_or_insert_with(|| {
4967 fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
4968 });
4969 fidl::decode!(
4970 fidl::encoding::BoundedString<4096>,
4971 D,
4972 val_ref,
4973 decoder,
4974 inner_offset,
4975 inner_depth
4976 )?;
4977 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4978 {
4979 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4980 }
4981 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4982 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4983 }
4984 }
4985
4986 next_offset += envelope_size;
4987 _next_ordinal_to_read += 1;
4988 if next_offset >= end_offset {
4989 return Ok(());
4990 }
4991
4992 while _next_ordinal_to_read < 3 {
4994 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4995 _next_ordinal_to_read += 1;
4996 next_offset += envelope_size;
4997 }
4998
4999 let next_out_of_line = decoder.next_out_of_line();
5000 let handles_before = decoder.remaining_handles();
5001 if let Some((inlined, num_bytes, num_handles)) =
5002 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5003 {
5004 let member_inline_size =
5005 <StartupMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5006 if inlined != (member_inline_size <= 4) {
5007 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5008 }
5009 let inner_offset;
5010 let mut inner_depth = depth.clone();
5011 if inlined {
5012 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5013 inner_offset = next_offset;
5014 } else {
5015 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5016 inner_depth.increment()?;
5017 }
5018 let val_ref = self.startup.get_or_insert_with(|| fidl::new_empty!(StartupMode, D));
5019 fidl::decode!(StartupMode, D, val_ref, decoder, inner_offset, inner_depth)?;
5020 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5021 {
5022 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5023 }
5024 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5025 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5026 }
5027 }
5028
5029 next_offset += envelope_size;
5030 _next_ordinal_to_read += 1;
5031 if next_offset >= end_offset {
5032 return Ok(());
5033 }
5034
5035 while _next_ordinal_to_read < 4 {
5037 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5038 _next_ordinal_to_read += 1;
5039 next_offset += envelope_size;
5040 }
5041
5042 let next_out_of_line = decoder.next_out_of_line();
5043 let handles_before = decoder.remaining_handles();
5044 if let Some((inlined, num_bytes, num_handles)) =
5045 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5046 {
5047 let member_inline_size =
5048 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
5049 decoder.context,
5050 );
5051 if inlined != (member_inline_size <= 4) {
5052 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5053 }
5054 let inner_offset;
5055 let mut inner_depth = depth.clone();
5056 if inlined {
5057 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5058 inner_offset = next_offset;
5059 } else {
5060 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5061 inner_depth.increment()?;
5062 }
5063 let val_ref = self
5064 .environment
5065 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
5066 fidl::decode!(
5067 fidl::encoding::BoundedString<100>,
5068 D,
5069 val_ref,
5070 decoder,
5071 inner_offset,
5072 inner_depth
5073 )?;
5074 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5075 {
5076 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5077 }
5078 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5079 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5080 }
5081 }
5082
5083 next_offset += envelope_size;
5084 _next_ordinal_to_read += 1;
5085 if next_offset >= end_offset {
5086 return Ok(());
5087 }
5088
5089 while _next_ordinal_to_read < 5 {
5091 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5092 _next_ordinal_to_read += 1;
5093 next_offset += envelope_size;
5094 }
5095
5096 let next_out_of_line = decoder.next_out_of_line();
5097 let handles_before = decoder.remaining_handles();
5098 if let Some((inlined, num_bytes, num_handles)) =
5099 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5100 {
5101 let member_inline_size =
5102 <OnTerminate as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5103 if inlined != (member_inline_size <= 4) {
5104 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5105 }
5106 let inner_offset;
5107 let mut inner_depth = depth.clone();
5108 if inlined {
5109 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5110 inner_offset = next_offset;
5111 } else {
5112 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5113 inner_depth.increment()?;
5114 }
5115 let val_ref =
5116 self.on_terminate.get_or_insert_with(|| fidl::new_empty!(OnTerminate, D));
5117 fidl::decode!(OnTerminate, D, val_ref, decoder, inner_offset, inner_depth)?;
5118 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5119 {
5120 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5121 }
5122 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5123 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5124 }
5125 }
5126
5127 next_offset += envelope_size;
5128 _next_ordinal_to_read += 1;
5129 if next_offset >= end_offset {
5130 return Ok(());
5131 }
5132
5133 while _next_ordinal_to_read < 6 {
5135 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5136 _next_ordinal_to_read += 1;
5137 next_offset += envelope_size;
5138 }
5139
5140 let next_out_of_line = decoder.next_out_of_line();
5141 let handles_before = decoder.remaining_handles();
5142 if let Some((inlined, num_bytes, num_handles)) =
5143 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5144 {
5145 let member_inline_size = <fidl::encoding::UnboundedVector<ConfigOverride> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5146 if inlined != (member_inline_size <= 4) {
5147 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5148 }
5149 let inner_offset;
5150 let mut inner_depth = depth.clone();
5151 if inlined {
5152 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5153 inner_offset = next_offset;
5154 } else {
5155 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5156 inner_depth.increment()?;
5157 }
5158 let val_ref = self.config_overrides.get_or_insert_with(|| {
5159 fidl::new_empty!(fidl::encoding::UnboundedVector<ConfigOverride>, D)
5160 });
5161 fidl::decode!(
5162 fidl::encoding::UnboundedVector<ConfigOverride>,
5163 D,
5164 val_ref,
5165 decoder,
5166 inner_offset,
5167 inner_depth
5168 )?;
5169 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5170 {
5171 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5172 }
5173 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5174 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5175 }
5176 }
5177
5178 next_offset += envelope_size;
5179
5180 while next_offset < end_offset {
5182 _next_ordinal_to_read += 1;
5183 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5184 next_offset += envelope_size;
5185 }
5186
5187 Ok(())
5188 }
5189 }
5190
5191 impl Collection {
5192 #[inline(always)]
5193 fn max_ordinal_present(&self) -> u64 {
5194 if let Some(_) = self.persistent_storage {
5195 return 6;
5196 }
5197 if let Some(_) = self.allow_long_names {
5198 return 5;
5199 }
5200 if let Some(_) = self.allowed_offers {
5201 return 4;
5202 }
5203 if let Some(_) = self.environment {
5204 return 3;
5205 }
5206 if let Some(_) = self.durability {
5207 return 2;
5208 }
5209 if let Some(_) = self.name {
5210 return 1;
5211 }
5212 0
5213 }
5214 }
5215
5216 impl fidl::encoding::ValueTypeMarker for Collection {
5217 type Borrowed<'a> = &'a Self;
5218 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5219 value
5220 }
5221 }
5222
5223 unsafe impl fidl::encoding::TypeMarker for Collection {
5224 type Owned = Self;
5225
5226 #[inline(always)]
5227 fn inline_align(_context: fidl::encoding::Context) -> usize {
5228 8
5229 }
5230
5231 #[inline(always)]
5232 fn inline_size(_context: fidl::encoding::Context) -> usize {
5233 16
5234 }
5235 }
5236
5237 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Collection, D>
5238 for &Collection
5239 {
5240 unsafe fn encode(
5241 self,
5242 encoder: &mut fidl::encoding::Encoder<'_, D>,
5243 offset: usize,
5244 mut depth: fidl::encoding::Depth,
5245 ) -> fidl::Result<()> {
5246 encoder.debug_check_bounds::<Collection>(offset);
5247 let max_ordinal: u64 = self.max_ordinal_present();
5249 encoder.write_num(max_ordinal, offset);
5250 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5251 if max_ordinal == 0 {
5253 return Ok(());
5254 }
5255 depth.increment()?;
5256 let envelope_size = 8;
5257 let bytes_len = max_ordinal as usize * envelope_size;
5258 #[allow(unused_variables)]
5259 let offset = encoder.out_of_line_offset(bytes_len);
5260 let mut _prev_end_offset: usize = 0;
5261 if 1 > max_ordinal {
5262 return Ok(());
5263 }
5264
5265 let cur_offset: usize = (1 - 1) * envelope_size;
5268
5269 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5271
5272 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
5277 self.name.as_ref().map(
5278 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
5279 ),
5280 encoder,
5281 offset + cur_offset,
5282 depth,
5283 )?;
5284
5285 _prev_end_offset = cur_offset + envelope_size;
5286 if 2 > max_ordinal {
5287 return Ok(());
5288 }
5289
5290 let cur_offset: usize = (2 - 1) * envelope_size;
5293
5294 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5296
5297 fidl::encoding::encode_in_envelope_optional::<Durability, D>(
5302 self.durability
5303 .as_ref()
5304 .map(<Durability as fidl::encoding::ValueTypeMarker>::borrow),
5305 encoder,
5306 offset + cur_offset,
5307 depth,
5308 )?;
5309
5310 _prev_end_offset = cur_offset + envelope_size;
5311 if 3 > max_ordinal {
5312 return Ok(());
5313 }
5314
5315 let cur_offset: usize = (3 - 1) * envelope_size;
5318
5319 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5321
5322 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
5327 self.environment.as_ref().map(
5328 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
5329 ),
5330 encoder,
5331 offset + cur_offset,
5332 depth,
5333 )?;
5334
5335 _prev_end_offset = cur_offset + envelope_size;
5336 if 4 > max_ordinal {
5337 return Ok(());
5338 }
5339
5340 let cur_offset: usize = (4 - 1) * envelope_size;
5343
5344 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5346
5347 fidl::encoding::encode_in_envelope_optional::<AllowedOffers, D>(
5352 self.allowed_offers
5353 .as_ref()
5354 .map(<AllowedOffers as fidl::encoding::ValueTypeMarker>::borrow),
5355 encoder,
5356 offset + cur_offset,
5357 depth,
5358 )?;
5359
5360 _prev_end_offset = cur_offset + envelope_size;
5361 if 5 > max_ordinal {
5362 return Ok(());
5363 }
5364
5365 let cur_offset: usize = (5 - 1) * envelope_size;
5368
5369 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5371
5372 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5377 self.allow_long_names
5378 .as_ref()
5379 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5380 encoder,
5381 offset + cur_offset,
5382 depth,
5383 )?;
5384
5385 _prev_end_offset = cur_offset + envelope_size;
5386 if 6 > max_ordinal {
5387 return Ok(());
5388 }
5389
5390 let cur_offset: usize = (6 - 1) * envelope_size;
5393
5394 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5396
5397 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5402 self.persistent_storage
5403 .as_ref()
5404 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5405 encoder,
5406 offset + cur_offset,
5407 depth,
5408 )?;
5409
5410 _prev_end_offset = cur_offset + envelope_size;
5411
5412 Ok(())
5413 }
5414 }
5415
5416 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Collection {
5417 #[inline(always)]
5418 fn new_empty() -> Self {
5419 Self::default()
5420 }
5421
5422 unsafe fn decode(
5423 &mut self,
5424 decoder: &mut fidl::encoding::Decoder<'_, D>,
5425 offset: usize,
5426 mut depth: fidl::encoding::Depth,
5427 ) -> fidl::Result<()> {
5428 decoder.debug_check_bounds::<Self>(offset);
5429 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5430 None => return Err(fidl::Error::NotNullable),
5431 Some(len) => len,
5432 };
5433 if len == 0 {
5435 return Ok(());
5436 };
5437 depth.increment()?;
5438 let envelope_size = 8;
5439 let bytes_len = len * envelope_size;
5440 let offset = decoder.out_of_line_offset(bytes_len)?;
5441 let mut _next_ordinal_to_read = 0;
5443 let mut next_offset = offset;
5444 let end_offset = offset + bytes_len;
5445 _next_ordinal_to_read += 1;
5446 if next_offset >= end_offset {
5447 return Ok(());
5448 }
5449
5450 while _next_ordinal_to_read < 1 {
5452 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5453 _next_ordinal_to_read += 1;
5454 next_offset += envelope_size;
5455 }
5456
5457 let next_out_of_line = decoder.next_out_of_line();
5458 let handles_before = decoder.remaining_handles();
5459 if let Some((inlined, num_bytes, num_handles)) =
5460 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5461 {
5462 let member_inline_size =
5463 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
5464 decoder.context,
5465 );
5466 if inlined != (member_inline_size <= 4) {
5467 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5468 }
5469 let inner_offset;
5470 let mut inner_depth = depth.clone();
5471 if inlined {
5472 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5473 inner_offset = next_offset;
5474 } else {
5475 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5476 inner_depth.increment()?;
5477 }
5478 let val_ref = self
5479 .name
5480 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
5481 fidl::decode!(
5482 fidl::encoding::BoundedString<100>,
5483 D,
5484 val_ref,
5485 decoder,
5486 inner_offset,
5487 inner_depth
5488 )?;
5489 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5490 {
5491 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5492 }
5493 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5494 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5495 }
5496 }
5497
5498 next_offset += envelope_size;
5499 _next_ordinal_to_read += 1;
5500 if next_offset >= end_offset {
5501 return Ok(());
5502 }
5503
5504 while _next_ordinal_to_read < 2 {
5506 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5507 _next_ordinal_to_read += 1;
5508 next_offset += envelope_size;
5509 }
5510
5511 let next_out_of_line = decoder.next_out_of_line();
5512 let handles_before = decoder.remaining_handles();
5513 if let Some((inlined, num_bytes, num_handles)) =
5514 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5515 {
5516 let member_inline_size =
5517 <Durability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5518 if inlined != (member_inline_size <= 4) {
5519 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5520 }
5521 let inner_offset;
5522 let mut inner_depth = depth.clone();
5523 if inlined {
5524 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5525 inner_offset = next_offset;
5526 } else {
5527 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5528 inner_depth.increment()?;
5529 }
5530 let val_ref =
5531 self.durability.get_or_insert_with(|| fidl::new_empty!(Durability, D));
5532 fidl::decode!(Durability, D, val_ref, decoder, inner_offset, inner_depth)?;
5533 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5534 {
5535 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5536 }
5537 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5538 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5539 }
5540 }
5541
5542 next_offset += envelope_size;
5543 _next_ordinal_to_read += 1;
5544 if next_offset >= end_offset {
5545 return Ok(());
5546 }
5547
5548 while _next_ordinal_to_read < 3 {
5550 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5551 _next_ordinal_to_read += 1;
5552 next_offset += envelope_size;
5553 }
5554
5555 let next_out_of_line = decoder.next_out_of_line();
5556 let handles_before = decoder.remaining_handles();
5557 if let Some((inlined, num_bytes, num_handles)) =
5558 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5559 {
5560 let member_inline_size =
5561 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
5562 decoder.context,
5563 );
5564 if inlined != (member_inline_size <= 4) {
5565 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5566 }
5567 let inner_offset;
5568 let mut inner_depth = depth.clone();
5569 if inlined {
5570 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5571 inner_offset = next_offset;
5572 } else {
5573 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5574 inner_depth.increment()?;
5575 }
5576 let val_ref = self
5577 .environment
5578 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
5579 fidl::decode!(
5580 fidl::encoding::BoundedString<100>,
5581 D,
5582 val_ref,
5583 decoder,
5584 inner_offset,
5585 inner_depth
5586 )?;
5587 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5588 {
5589 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5590 }
5591 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5592 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5593 }
5594 }
5595
5596 next_offset += envelope_size;
5597 _next_ordinal_to_read += 1;
5598 if next_offset >= end_offset {
5599 return Ok(());
5600 }
5601
5602 while _next_ordinal_to_read < 4 {
5604 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5605 _next_ordinal_to_read += 1;
5606 next_offset += envelope_size;
5607 }
5608
5609 let next_out_of_line = decoder.next_out_of_line();
5610 let handles_before = decoder.remaining_handles();
5611 if let Some((inlined, num_bytes, num_handles)) =
5612 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5613 {
5614 let member_inline_size =
5615 <AllowedOffers as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5616 if inlined != (member_inline_size <= 4) {
5617 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5618 }
5619 let inner_offset;
5620 let mut inner_depth = depth.clone();
5621 if inlined {
5622 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5623 inner_offset = next_offset;
5624 } else {
5625 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5626 inner_depth.increment()?;
5627 }
5628 let val_ref =
5629 self.allowed_offers.get_or_insert_with(|| fidl::new_empty!(AllowedOffers, D));
5630 fidl::decode!(AllowedOffers, D, val_ref, decoder, inner_offset, inner_depth)?;
5631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5632 {
5633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5634 }
5635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5637 }
5638 }
5639
5640 next_offset += envelope_size;
5641 _next_ordinal_to_read += 1;
5642 if next_offset >= end_offset {
5643 return Ok(());
5644 }
5645
5646 while _next_ordinal_to_read < 5 {
5648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5649 _next_ordinal_to_read += 1;
5650 next_offset += envelope_size;
5651 }
5652
5653 let next_out_of_line = decoder.next_out_of_line();
5654 let handles_before = decoder.remaining_handles();
5655 if let Some((inlined, num_bytes, num_handles)) =
5656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5657 {
5658 let member_inline_size =
5659 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5660 if inlined != (member_inline_size <= 4) {
5661 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5662 }
5663 let inner_offset;
5664 let mut inner_depth = depth.clone();
5665 if inlined {
5666 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5667 inner_offset = next_offset;
5668 } else {
5669 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5670 inner_depth.increment()?;
5671 }
5672 let val_ref =
5673 self.allow_long_names.get_or_insert_with(|| fidl::new_empty!(bool, D));
5674 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5675 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5676 {
5677 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5678 }
5679 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5680 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5681 }
5682 }
5683
5684 next_offset += envelope_size;
5685 _next_ordinal_to_read += 1;
5686 if next_offset >= end_offset {
5687 return Ok(());
5688 }
5689
5690 while _next_ordinal_to_read < 6 {
5692 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5693 _next_ordinal_to_read += 1;
5694 next_offset += envelope_size;
5695 }
5696
5697 let next_out_of_line = decoder.next_out_of_line();
5698 let handles_before = decoder.remaining_handles();
5699 if let Some((inlined, num_bytes, num_handles)) =
5700 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5701 {
5702 let member_inline_size =
5703 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5704 if inlined != (member_inline_size <= 4) {
5705 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5706 }
5707 let inner_offset;
5708 let mut inner_depth = depth.clone();
5709 if inlined {
5710 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5711 inner_offset = next_offset;
5712 } else {
5713 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5714 inner_depth.increment()?;
5715 }
5716 let val_ref =
5717 self.persistent_storage.get_or_insert_with(|| fidl::new_empty!(bool, D));
5718 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5719 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5720 {
5721 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5722 }
5723 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5724 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5725 }
5726 }
5727
5728 next_offset += envelope_size;
5729
5730 while next_offset < end_offset {
5732 _next_ordinal_to_read += 1;
5733 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5734 next_offset += envelope_size;
5735 }
5736
5737 Ok(())
5738 }
5739 }
5740
5741 impl Component {
5742 #[inline(always)]
5743 fn max_ordinal_present(&self) -> u64 {
5744 if let Some(_) = self.config {
5745 return 10;
5746 }
5747 if let Some(_) = self.facets {
5748 return 9;
5749 }
5750 if let Some(_) = self.environments {
5751 return 8;
5752 }
5753 if let Some(_) = self.collections {
5754 return 7;
5755 }
5756 if let Some(_) = self.children {
5757 return 6;
5758 }
5759 if let Some(_) = self.capabilities {
5760 return 5;
5761 }
5762 if let Some(_) = self.offers {
5763 return 4;
5764 }
5765 if let Some(_) = self.exposes {
5766 return 3;
5767 }
5768 if let Some(_) = self.uses {
5769 return 2;
5770 }
5771 if let Some(_) = self.program {
5772 return 1;
5773 }
5774 0
5775 }
5776 }
5777
5778 impl fidl::encoding::ValueTypeMarker for Component {
5779 type Borrowed<'a> = &'a Self;
5780 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5781 value
5782 }
5783 }
5784
5785 unsafe impl fidl::encoding::TypeMarker for Component {
5786 type Owned = Self;
5787
5788 #[inline(always)]
5789 fn inline_align(_context: fidl::encoding::Context) -> usize {
5790 8
5791 }
5792
5793 #[inline(always)]
5794 fn inline_size(_context: fidl::encoding::Context) -> usize {
5795 16
5796 }
5797 }
5798
5799 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Component, D>
5800 for &Component
5801 {
5802 unsafe fn encode(
5803 self,
5804 encoder: &mut fidl::encoding::Encoder<'_, D>,
5805 offset: usize,
5806 mut depth: fidl::encoding::Depth,
5807 ) -> fidl::Result<()> {
5808 encoder.debug_check_bounds::<Component>(offset);
5809 let max_ordinal: u64 = self.max_ordinal_present();
5811 encoder.write_num(max_ordinal, offset);
5812 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5813 if max_ordinal == 0 {
5815 return Ok(());
5816 }
5817 depth.increment()?;
5818 let envelope_size = 8;
5819 let bytes_len = max_ordinal as usize * envelope_size;
5820 #[allow(unused_variables)]
5821 let offset = encoder.out_of_line_offset(bytes_len);
5822 let mut _prev_end_offset: usize = 0;
5823 if 1 > max_ordinal {
5824 return Ok(());
5825 }
5826
5827 let cur_offset: usize = (1 - 1) * envelope_size;
5830
5831 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5833
5834 fidl::encoding::encode_in_envelope_optional::<Program, D>(
5839 self.program.as_ref().map(<Program as fidl::encoding::ValueTypeMarker>::borrow),
5840 encoder,
5841 offset + cur_offset,
5842 depth,
5843 )?;
5844
5845 _prev_end_offset = cur_offset + envelope_size;
5846 if 2 > max_ordinal {
5847 return Ok(());
5848 }
5849
5850 let cur_offset: usize = (2 - 1) * envelope_size;
5853
5854 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5856
5857 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Use>, D>(
5862 self.uses.as_ref().map(<fidl::encoding::UnboundedVector<Use> as fidl::encoding::ValueTypeMarker>::borrow),
5863 encoder, offset + cur_offset, depth
5864 )?;
5865
5866 _prev_end_offset = cur_offset + envelope_size;
5867 if 3 > max_ordinal {
5868 return Ok(());
5869 }
5870
5871 let cur_offset: usize = (3 - 1) * envelope_size;
5874
5875 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5877
5878 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Expose>, D>(
5883 self.exposes.as_ref().map(<fidl::encoding::UnboundedVector<Expose> as fidl::encoding::ValueTypeMarker>::borrow),
5884 encoder, offset + cur_offset, depth
5885 )?;
5886
5887 _prev_end_offset = cur_offset + envelope_size;
5888 if 4 > max_ordinal {
5889 return Ok(());
5890 }
5891
5892 let cur_offset: usize = (4 - 1) * envelope_size;
5895
5896 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5898
5899 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Offer>, D>(
5904 self.offers.as_ref().map(<fidl::encoding::UnboundedVector<Offer> as fidl::encoding::ValueTypeMarker>::borrow),
5905 encoder, offset + cur_offset, depth
5906 )?;
5907
5908 _prev_end_offset = cur_offset + envelope_size;
5909 if 5 > max_ordinal {
5910 return Ok(());
5911 }
5912
5913 let cur_offset: usize = (5 - 1) * envelope_size;
5916
5917 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5919
5920 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Capability>, D>(
5925 self.capabilities.as_ref().map(<fidl::encoding::UnboundedVector<Capability> as fidl::encoding::ValueTypeMarker>::borrow),
5926 encoder, offset + cur_offset, depth
5927 )?;
5928
5929 _prev_end_offset = cur_offset + envelope_size;
5930 if 6 > max_ordinal {
5931 return Ok(());
5932 }
5933
5934 let cur_offset: usize = (6 - 1) * envelope_size;
5937
5938 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5940
5941 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Child>, D>(
5946 self.children.as_ref().map(<fidl::encoding::UnboundedVector<Child> as fidl::encoding::ValueTypeMarker>::borrow),
5947 encoder, offset + cur_offset, depth
5948 )?;
5949
5950 _prev_end_offset = cur_offset + envelope_size;
5951 if 7 > max_ordinal {
5952 return Ok(());
5953 }
5954
5955 let cur_offset: usize = (7 - 1) * envelope_size;
5958
5959 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5961
5962 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Collection>, D>(
5967 self.collections.as_ref().map(<fidl::encoding::UnboundedVector<Collection> as fidl::encoding::ValueTypeMarker>::borrow),
5968 encoder, offset + cur_offset, depth
5969 )?;
5970
5971 _prev_end_offset = cur_offset + envelope_size;
5972 if 8 > max_ordinal {
5973 return Ok(());
5974 }
5975
5976 let cur_offset: usize = (8 - 1) * envelope_size;
5979
5980 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5982
5983 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Environment>, D>(
5988 self.environments.as_ref().map(<fidl::encoding::UnboundedVector<Environment> as fidl::encoding::ValueTypeMarker>::borrow),
5989 encoder, offset + cur_offset, depth
5990 )?;
5991
5992 _prev_end_offset = cur_offset + envelope_size;
5993 if 9 > max_ordinal {
5994 return Ok(());
5995 }
5996
5997 let cur_offset: usize = (9 - 1) * envelope_size;
6000
6001 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6003
6004 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_data::Dictionary, D>(
6009 self.facets.as_ref().map(
6010 <fidl_fuchsia_data::Dictionary as fidl::encoding::ValueTypeMarker>::borrow,
6011 ),
6012 encoder,
6013 offset + cur_offset,
6014 depth,
6015 )?;
6016
6017 _prev_end_offset = cur_offset + envelope_size;
6018 if 10 > max_ordinal {
6019 return Ok(());
6020 }
6021
6022 let cur_offset: usize = (10 - 1) * envelope_size;
6025
6026 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6028
6029 fidl::encoding::encode_in_envelope_optional::<ConfigSchema, D>(
6034 self.config.as_ref().map(<ConfigSchema as fidl::encoding::ValueTypeMarker>::borrow),
6035 encoder,
6036 offset + cur_offset,
6037 depth,
6038 )?;
6039
6040 _prev_end_offset = cur_offset + envelope_size;
6041
6042 Ok(())
6043 }
6044 }
6045
6046 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Component {
6047 #[inline(always)]
6048 fn new_empty() -> Self {
6049 Self::default()
6050 }
6051
6052 unsafe fn decode(
6053 &mut self,
6054 decoder: &mut fidl::encoding::Decoder<'_, D>,
6055 offset: usize,
6056 mut depth: fidl::encoding::Depth,
6057 ) -> fidl::Result<()> {
6058 decoder.debug_check_bounds::<Self>(offset);
6059 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6060 None => return Err(fidl::Error::NotNullable),
6061 Some(len) => len,
6062 };
6063 if len == 0 {
6065 return Ok(());
6066 };
6067 depth.increment()?;
6068 let envelope_size = 8;
6069 let bytes_len = len * envelope_size;
6070 let offset = decoder.out_of_line_offset(bytes_len)?;
6071 let mut _next_ordinal_to_read = 0;
6073 let mut next_offset = offset;
6074 let end_offset = offset + bytes_len;
6075 _next_ordinal_to_read += 1;
6076 if next_offset >= end_offset {
6077 return Ok(());
6078 }
6079
6080 while _next_ordinal_to_read < 1 {
6082 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6083 _next_ordinal_to_read += 1;
6084 next_offset += envelope_size;
6085 }
6086
6087 let next_out_of_line = decoder.next_out_of_line();
6088 let handles_before = decoder.remaining_handles();
6089 if let Some((inlined, num_bytes, num_handles)) =
6090 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6091 {
6092 let member_inline_size =
6093 <Program as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6094 if inlined != (member_inline_size <= 4) {
6095 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6096 }
6097 let inner_offset;
6098 let mut inner_depth = depth.clone();
6099 if inlined {
6100 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6101 inner_offset = next_offset;
6102 } else {
6103 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6104 inner_depth.increment()?;
6105 }
6106 let val_ref = self.program.get_or_insert_with(|| fidl::new_empty!(Program, D));
6107 fidl::decode!(Program, D, val_ref, decoder, inner_offset, inner_depth)?;
6108 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6109 {
6110 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6111 }
6112 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6113 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6114 }
6115 }
6116
6117 next_offset += envelope_size;
6118 _next_ordinal_to_read += 1;
6119 if next_offset >= end_offset {
6120 return Ok(());
6121 }
6122
6123 while _next_ordinal_to_read < 2 {
6125 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6126 _next_ordinal_to_read += 1;
6127 next_offset += envelope_size;
6128 }
6129
6130 let next_out_of_line = decoder.next_out_of_line();
6131 let handles_before = decoder.remaining_handles();
6132 if let Some((inlined, num_bytes, num_handles)) =
6133 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6134 {
6135 let member_inline_size = <fidl::encoding::UnboundedVector<Use> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6136 if inlined != (member_inline_size <= 4) {
6137 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6138 }
6139 let inner_offset;
6140 let mut inner_depth = depth.clone();
6141 if inlined {
6142 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6143 inner_offset = next_offset;
6144 } else {
6145 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6146 inner_depth.increment()?;
6147 }
6148 let val_ref = self.uses.get_or_insert_with(|| {
6149 fidl::new_empty!(fidl::encoding::UnboundedVector<Use>, D)
6150 });
6151 fidl::decode!(
6152 fidl::encoding::UnboundedVector<Use>,
6153 D,
6154 val_ref,
6155 decoder,
6156 inner_offset,
6157 inner_depth
6158 )?;
6159 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6160 {
6161 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6162 }
6163 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6164 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6165 }
6166 }
6167
6168 next_offset += envelope_size;
6169 _next_ordinal_to_read += 1;
6170 if next_offset >= end_offset {
6171 return Ok(());
6172 }
6173
6174 while _next_ordinal_to_read < 3 {
6176 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6177 _next_ordinal_to_read += 1;
6178 next_offset += envelope_size;
6179 }
6180
6181 let next_out_of_line = decoder.next_out_of_line();
6182 let handles_before = decoder.remaining_handles();
6183 if let Some((inlined, num_bytes, num_handles)) =
6184 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6185 {
6186 let member_inline_size = <fidl::encoding::UnboundedVector<Expose> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6187 if inlined != (member_inline_size <= 4) {
6188 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6189 }
6190 let inner_offset;
6191 let mut inner_depth = depth.clone();
6192 if inlined {
6193 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6194 inner_offset = next_offset;
6195 } else {
6196 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6197 inner_depth.increment()?;
6198 }
6199 let val_ref = self.exposes.get_or_insert_with(|| {
6200 fidl::new_empty!(fidl::encoding::UnboundedVector<Expose>, D)
6201 });
6202 fidl::decode!(
6203 fidl::encoding::UnboundedVector<Expose>,
6204 D,
6205 val_ref,
6206 decoder,
6207 inner_offset,
6208 inner_depth
6209 )?;
6210 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6211 {
6212 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6213 }
6214 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6215 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6216 }
6217 }
6218
6219 next_offset += envelope_size;
6220 _next_ordinal_to_read += 1;
6221 if next_offset >= end_offset {
6222 return Ok(());
6223 }
6224
6225 while _next_ordinal_to_read < 4 {
6227 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6228 _next_ordinal_to_read += 1;
6229 next_offset += envelope_size;
6230 }
6231
6232 let next_out_of_line = decoder.next_out_of_line();
6233 let handles_before = decoder.remaining_handles();
6234 if let Some((inlined, num_bytes, num_handles)) =
6235 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6236 {
6237 let member_inline_size = <fidl::encoding::UnboundedVector<Offer> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6238 if inlined != (member_inline_size <= 4) {
6239 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6240 }
6241 let inner_offset;
6242 let mut inner_depth = depth.clone();
6243 if inlined {
6244 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6245 inner_offset = next_offset;
6246 } else {
6247 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6248 inner_depth.increment()?;
6249 }
6250 let val_ref = self.offers.get_or_insert_with(|| {
6251 fidl::new_empty!(fidl::encoding::UnboundedVector<Offer>, D)
6252 });
6253 fidl::decode!(
6254 fidl::encoding::UnboundedVector<Offer>,
6255 D,
6256 val_ref,
6257 decoder,
6258 inner_offset,
6259 inner_depth
6260 )?;
6261 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6262 {
6263 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6264 }
6265 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6266 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6267 }
6268 }
6269
6270 next_offset += envelope_size;
6271 _next_ordinal_to_read += 1;
6272 if next_offset >= end_offset {
6273 return Ok(());
6274 }
6275
6276 while _next_ordinal_to_read < 5 {
6278 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6279 _next_ordinal_to_read += 1;
6280 next_offset += envelope_size;
6281 }
6282
6283 let next_out_of_line = decoder.next_out_of_line();
6284 let handles_before = decoder.remaining_handles();
6285 if let Some((inlined, num_bytes, num_handles)) =
6286 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6287 {
6288 let member_inline_size = <fidl::encoding::UnboundedVector<Capability> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6289 if inlined != (member_inline_size <= 4) {
6290 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6291 }
6292 let inner_offset;
6293 let mut inner_depth = depth.clone();
6294 if inlined {
6295 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6296 inner_offset = next_offset;
6297 } else {
6298 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6299 inner_depth.increment()?;
6300 }
6301 let val_ref = self.capabilities.get_or_insert_with(|| {
6302 fidl::new_empty!(fidl::encoding::UnboundedVector<Capability>, D)
6303 });
6304 fidl::decode!(
6305 fidl::encoding::UnboundedVector<Capability>,
6306 D,
6307 val_ref,
6308 decoder,
6309 inner_offset,
6310 inner_depth
6311 )?;
6312 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6313 {
6314 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6315 }
6316 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6317 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6318 }
6319 }
6320
6321 next_offset += envelope_size;
6322 _next_ordinal_to_read += 1;
6323 if next_offset >= end_offset {
6324 return Ok(());
6325 }
6326
6327 while _next_ordinal_to_read < 6 {
6329 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6330 _next_ordinal_to_read += 1;
6331 next_offset += envelope_size;
6332 }
6333
6334 let next_out_of_line = decoder.next_out_of_line();
6335 let handles_before = decoder.remaining_handles();
6336 if let Some((inlined, num_bytes, num_handles)) =
6337 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6338 {
6339 let member_inline_size = <fidl::encoding::UnboundedVector<Child> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6340 if inlined != (member_inline_size <= 4) {
6341 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6342 }
6343 let inner_offset;
6344 let mut inner_depth = depth.clone();
6345 if inlined {
6346 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6347 inner_offset = next_offset;
6348 } else {
6349 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6350 inner_depth.increment()?;
6351 }
6352 let val_ref = self.children.get_or_insert_with(|| {
6353 fidl::new_empty!(fidl::encoding::UnboundedVector<Child>, D)
6354 });
6355 fidl::decode!(
6356 fidl::encoding::UnboundedVector<Child>,
6357 D,
6358 val_ref,
6359 decoder,
6360 inner_offset,
6361 inner_depth
6362 )?;
6363 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6364 {
6365 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6366 }
6367 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6368 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6369 }
6370 }
6371
6372 next_offset += envelope_size;
6373 _next_ordinal_to_read += 1;
6374 if next_offset >= end_offset {
6375 return Ok(());
6376 }
6377
6378 while _next_ordinal_to_read < 7 {
6380 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6381 _next_ordinal_to_read += 1;
6382 next_offset += envelope_size;
6383 }
6384
6385 let next_out_of_line = decoder.next_out_of_line();
6386 let handles_before = decoder.remaining_handles();
6387 if let Some((inlined, num_bytes, num_handles)) =
6388 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6389 {
6390 let member_inline_size = <fidl::encoding::UnboundedVector<Collection> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6391 if inlined != (member_inline_size <= 4) {
6392 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6393 }
6394 let inner_offset;
6395 let mut inner_depth = depth.clone();
6396 if inlined {
6397 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6398 inner_offset = next_offset;
6399 } else {
6400 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6401 inner_depth.increment()?;
6402 }
6403 let val_ref = self.collections.get_or_insert_with(|| {
6404 fidl::new_empty!(fidl::encoding::UnboundedVector<Collection>, D)
6405 });
6406 fidl::decode!(
6407 fidl::encoding::UnboundedVector<Collection>,
6408 D,
6409 val_ref,
6410 decoder,
6411 inner_offset,
6412 inner_depth
6413 )?;
6414 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6415 {
6416 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6417 }
6418 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6419 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6420 }
6421 }
6422
6423 next_offset += envelope_size;
6424 _next_ordinal_to_read += 1;
6425 if next_offset >= end_offset {
6426 return Ok(());
6427 }
6428
6429 while _next_ordinal_to_read < 8 {
6431 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6432 _next_ordinal_to_read += 1;
6433 next_offset += envelope_size;
6434 }
6435
6436 let next_out_of_line = decoder.next_out_of_line();
6437 let handles_before = decoder.remaining_handles();
6438 if let Some((inlined, num_bytes, num_handles)) =
6439 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6440 {
6441 let member_inline_size = <fidl::encoding::UnboundedVector<Environment> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6442 if inlined != (member_inline_size <= 4) {
6443 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6444 }
6445 let inner_offset;
6446 let mut inner_depth = depth.clone();
6447 if inlined {
6448 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6449 inner_offset = next_offset;
6450 } else {
6451 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6452 inner_depth.increment()?;
6453 }
6454 let val_ref = self.environments.get_or_insert_with(|| {
6455 fidl::new_empty!(fidl::encoding::UnboundedVector<Environment>, D)
6456 });
6457 fidl::decode!(
6458 fidl::encoding::UnboundedVector<Environment>,
6459 D,
6460 val_ref,
6461 decoder,
6462 inner_offset,
6463 inner_depth
6464 )?;
6465 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6466 {
6467 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6468 }
6469 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6470 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6471 }
6472 }
6473
6474 next_offset += envelope_size;
6475 _next_ordinal_to_read += 1;
6476 if next_offset >= end_offset {
6477 return Ok(());
6478 }
6479
6480 while _next_ordinal_to_read < 9 {
6482 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6483 _next_ordinal_to_read += 1;
6484 next_offset += envelope_size;
6485 }
6486
6487 let next_out_of_line = decoder.next_out_of_line();
6488 let handles_before = decoder.remaining_handles();
6489 if let Some((inlined, num_bytes, num_handles)) =
6490 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6491 {
6492 let member_inline_size =
6493 <fidl_fuchsia_data::Dictionary as fidl::encoding::TypeMarker>::inline_size(
6494 decoder.context,
6495 );
6496 if inlined != (member_inline_size <= 4) {
6497 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6498 }
6499 let inner_offset;
6500 let mut inner_depth = depth.clone();
6501 if inlined {
6502 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6503 inner_offset = next_offset;
6504 } else {
6505 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6506 inner_depth.increment()?;
6507 }
6508 let val_ref = self
6509 .facets
6510 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_data::Dictionary, D));
6511 fidl::decode!(
6512 fidl_fuchsia_data::Dictionary,
6513 D,
6514 val_ref,
6515 decoder,
6516 inner_offset,
6517 inner_depth
6518 )?;
6519 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6520 {
6521 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6522 }
6523 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6524 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6525 }
6526 }
6527
6528 next_offset += envelope_size;
6529 _next_ordinal_to_read += 1;
6530 if next_offset >= end_offset {
6531 return Ok(());
6532 }
6533
6534 while _next_ordinal_to_read < 10 {
6536 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6537 _next_ordinal_to_read += 1;
6538 next_offset += envelope_size;
6539 }
6540
6541 let next_out_of_line = decoder.next_out_of_line();
6542 let handles_before = decoder.remaining_handles();
6543 if let Some((inlined, num_bytes, num_handles)) =
6544 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6545 {
6546 let member_inline_size =
6547 <ConfigSchema as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6548 if inlined != (member_inline_size <= 4) {
6549 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6550 }
6551 let inner_offset;
6552 let mut inner_depth = depth.clone();
6553 if inlined {
6554 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6555 inner_offset = next_offset;
6556 } else {
6557 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6558 inner_depth.increment()?;
6559 }
6560 let val_ref = self.config.get_or_insert_with(|| fidl::new_empty!(ConfigSchema, D));
6561 fidl::decode!(ConfigSchema, D, val_ref, decoder, inner_offset, inner_depth)?;
6562 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6563 {
6564 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6565 }
6566 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6567 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6568 }
6569 }
6570
6571 next_offset += envelope_size;
6572
6573 while next_offset < end_offset {
6575 _next_ordinal_to_read += 1;
6576 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6577 next_offset += envelope_size;
6578 }
6579
6580 Ok(())
6581 }
6582 }
6583
6584 impl ConfigField {
6585 #[inline(always)]
6586 fn max_ordinal_present(&self) -> u64 {
6587 if let Some(_) = self.mutability {
6588 return 3;
6589 }
6590 if let Some(_) = self.type_ {
6591 return 2;
6592 }
6593 if let Some(_) = self.key {
6594 return 1;
6595 }
6596 0
6597 }
6598 }
6599
6600 impl fidl::encoding::ValueTypeMarker for ConfigField {
6601 type Borrowed<'a> = &'a Self;
6602 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6603 value
6604 }
6605 }
6606
6607 unsafe impl fidl::encoding::TypeMarker for ConfigField {
6608 type Owned = Self;
6609
6610 #[inline(always)]
6611 fn inline_align(_context: fidl::encoding::Context) -> usize {
6612 8
6613 }
6614
6615 #[inline(always)]
6616 fn inline_size(_context: fidl::encoding::Context) -> usize {
6617 16
6618 }
6619 }
6620
6621 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigField, D>
6622 for &ConfigField
6623 {
6624 unsafe fn encode(
6625 self,
6626 encoder: &mut fidl::encoding::Encoder<'_, D>,
6627 offset: usize,
6628 mut depth: fidl::encoding::Depth,
6629 ) -> fidl::Result<()> {
6630 encoder.debug_check_bounds::<ConfigField>(offset);
6631 let max_ordinal: u64 = self.max_ordinal_present();
6633 encoder.write_num(max_ordinal, offset);
6634 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6635 if max_ordinal == 0 {
6637 return Ok(());
6638 }
6639 depth.increment()?;
6640 let envelope_size = 8;
6641 let bytes_len = max_ordinal as usize * envelope_size;
6642 #[allow(unused_variables)]
6643 let offset = encoder.out_of_line_offset(bytes_len);
6644 let mut _prev_end_offset: usize = 0;
6645 if 1 > max_ordinal {
6646 return Ok(());
6647 }
6648
6649 let cur_offset: usize = (1 - 1) * envelope_size;
6652
6653 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6655
6656 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
6661 self.key.as_ref().map(
6662 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
6663 ),
6664 encoder,
6665 offset + cur_offset,
6666 depth,
6667 )?;
6668
6669 _prev_end_offset = cur_offset + envelope_size;
6670 if 2 > max_ordinal {
6671 return Ok(());
6672 }
6673
6674 let cur_offset: usize = (2 - 1) * envelope_size;
6677
6678 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6680
6681 fidl::encoding::encode_in_envelope_optional::<ConfigType, D>(
6686 self.type_.as_ref().map(<ConfigType as fidl::encoding::ValueTypeMarker>::borrow),
6687 encoder,
6688 offset + cur_offset,
6689 depth,
6690 )?;
6691
6692 _prev_end_offset = cur_offset + envelope_size;
6693 if 3 > max_ordinal {
6694 return Ok(());
6695 }
6696
6697 let cur_offset: usize = (3 - 1) * envelope_size;
6700
6701 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6703
6704 fidl::encoding::encode_in_envelope_optional::<ConfigMutability, D>(
6709 self.mutability
6710 .as_ref()
6711 .map(<ConfigMutability as fidl::encoding::ValueTypeMarker>::borrow),
6712 encoder,
6713 offset + cur_offset,
6714 depth,
6715 )?;
6716
6717 _prev_end_offset = cur_offset + envelope_size;
6718
6719 Ok(())
6720 }
6721 }
6722
6723 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigField {
6724 #[inline(always)]
6725 fn new_empty() -> Self {
6726 Self::default()
6727 }
6728
6729 unsafe fn decode(
6730 &mut self,
6731 decoder: &mut fidl::encoding::Decoder<'_, D>,
6732 offset: usize,
6733 mut depth: fidl::encoding::Depth,
6734 ) -> fidl::Result<()> {
6735 decoder.debug_check_bounds::<Self>(offset);
6736 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6737 None => return Err(fidl::Error::NotNullable),
6738 Some(len) => len,
6739 };
6740 if len == 0 {
6742 return Ok(());
6743 };
6744 depth.increment()?;
6745 let envelope_size = 8;
6746 let bytes_len = len * envelope_size;
6747 let offset = decoder.out_of_line_offset(bytes_len)?;
6748 let mut _next_ordinal_to_read = 0;
6750 let mut next_offset = offset;
6751 let end_offset = offset + bytes_len;
6752 _next_ordinal_to_read += 1;
6753 if next_offset >= end_offset {
6754 return Ok(());
6755 }
6756
6757 while _next_ordinal_to_read < 1 {
6759 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6760 _next_ordinal_to_read += 1;
6761 next_offset += envelope_size;
6762 }
6763
6764 let next_out_of_line = decoder.next_out_of_line();
6765 let handles_before = decoder.remaining_handles();
6766 if let Some((inlined, num_bytes, num_handles)) =
6767 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6768 {
6769 let member_inline_size =
6770 <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
6771 decoder.context,
6772 );
6773 if inlined != (member_inline_size <= 4) {
6774 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6775 }
6776 let inner_offset;
6777 let mut inner_depth = depth.clone();
6778 if inlined {
6779 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6780 inner_offset = next_offset;
6781 } else {
6782 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6783 inner_depth.increment()?;
6784 }
6785 let val_ref = self
6786 .key
6787 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
6788 fidl::decode!(
6789 fidl::encoding::BoundedString<64>,
6790 D,
6791 val_ref,
6792 decoder,
6793 inner_offset,
6794 inner_depth
6795 )?;
6796 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6797 {
6798 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6799 }
6800 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6801 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6802 }
6803 }
6804
6805 next_offset += envelope_size;
6806 _next_ordinal_to_read += 1;
6807 if next_offset >= end_offset {
6808 return Ok(());
6809 }
6810
6811 while _next_ordinal_to_read < 2 {
6813 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6814 _next_ordinal_to_read += 1;
6815 next_offset += envelope_size;
6816 }
6817
6818 let next_out_of_line = decoder.next_out_of_line();
6819 let handles_before = decoder.remaining_handles();
6820 if let Some((inlined, num_bytes, num_handles)) =
6821 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6822 {
6823 let member_inline_size =
6824 <ConfigType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6825 if inlined != (member_inline_size <= 4) {
6826 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6827 }
6828 let inner_offset;
6829 let mut inner_depth = depth.clone();
6830 if inlined {
6831 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6832 inner_offset = next_offset;
6833 } else {
6834 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6835 inner_depth.increment()?;
6836 }
6837 let val_ref = self.type_.get_or_insert_with(|| fidl::new_empty!(ConfigType, D));
6838 fidl::decode!(ConfigType, D, val_ref, decoder, inner_offset, inner_depth)?;
6839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6840 {
6841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6842 }
6843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6845 }
6846 }
6847
6848 next_offset += envelope_size;
6849 _next_ordinal_to_read += 1;
6850 if next_offset >= end_offset {
6851 return Ok(());
6852 }
6853
6854 while _next_ordinal_to_read < 3 {
6856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6857 _next_ordinal_to_read += 1;
6858 next_offset += envelope_size;
6859 }
6860
6861 let next_out_of_line = decoder.next_out_of_line();
6862 let handles_before = decoder.remaining_handles();
6863 if let Some((inlined, num_bytes, num_handles)) =
6864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6865 {
6866 let member_inline_size =
6867 <ConfigMutability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6868 if inlined != (member_inline_size <= 4) {
6869 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6870 }
6871 let inner_offset;
6872 let mut inner_depth = depth.clone();
6873 if inlined {
6874 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6875 inner_offset = next_offset;
6876 } else {
6877 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6878 inner_depth.increment()?;
6879 }
6880 let val_ref =
6881 self.mutability.get_or_insert_with(|| fidl::new_empty!(ConfigMutability, D));
6882 fidl::decode!(ConfigMutability, D, val_ref, decoder, inner_offset, inner_depth)?;
6883 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6884 {
6885 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6886 }
6887 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6888 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6889 }
6890 }
6891
6892 next_offset += envelope_size;
6893
6894 while next_offset < end_offset {
6896 _next_ordinal_to_read += 1;
6897 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6898 next_offset += envelope_size;
6899 }
6900
6901 Ok(())
6902 }
6903 }
6904
6905 impl ConfigOverride {
6906 #[inline(always)]
6907 fn max_ordinal_present(&self) -> u64 {
6908 if let Some(_) = self.value {
6909 return 2;
6910 }
6911 if let Some(_) = self.key {
6912 return 1;
6913 }
6914 0
6915 }
6916 }
6917
6918 impl fidl::encoding::ValueTypeMarker for ConfigOverride {
6919 type Borrowed<'a> = &'a Self;
6920 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6921 value
6922 }
6923 }
6924
6925 unsafe impl fidl::encoding::TypeMarker for ConfigOverride {
6926 type Owned = Self;
6927
6928 #[inline(always)]
6929 fn inline_align(_context: fidl::encoding::Context) -> usize {
6930 8
6931 }
6932
6933 #[inline(always)]
6934 fn inline_size(_context: fidl::encoding::Context) -> usize {
6935 16
6936 }
6937 }
6938
6939 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigOverride, D>
6940 for &ConfigOverride
6941 {
6942 unsafe fn encode(
6943 self,
6944 encoder: &mut fidl::encoding::Encoder<'_, D>,
6945 offset: usize,
6946 mut depth: fidl::encoding::Depth,
6947 ) -> fidl::Result<()> {
6948 encoder.debug_check_bounds::<ConfigOverride>(offset);
6949 let max_ordinal: u64 = self.max_ordinal_present();
6951 encoder.write_num(max_ordinal, offset);
6952 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6953 if max_ordinal == 0 {
6955 return Ok(());
6956 }
6957 depth.increment()?;
6958 let envelope_size = 8;
6959 let bytes_len = max_ordinal as usize * envelope_size;
6960 #[allow(unused_variables)]
6961 let offset = encoder.out_of_line_offset(bytes_len);
6962 let mut _prev_end_offset: usize = 0;
6963 if 1 > max_ordinal {
6964 return Ok(());
6965 }
6966
6967 let cur_offset: usize = (1 - 1) * envelope_size;
6970
6971 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6973
6974 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
6979 self.key.as_ref().map(
6980 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
6981 ),
6982 encoder,
6983 offset + cur_offset,
6984 depth,
6985 )?;
6986
6987 _prev_end_offset = cur_offset + envelope_size;
6988 if 2 > max_ordinal {
6989 return Ok(());
6990 }
6991
6992 let cur_offset: usize = (2 - 1) * envelope_size;
6995
6996 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6998
6999 fidl::encoding::encode_in_envelope_optional::<ConfigValue, D>(
7004 self.value.as_ref().map(<ConfigValue as fidl::encoding::ValueTypeMarker>::borrow),
7005 encoder,
7006 offset + cur_offset,
7007 depth,
7008 )?;
7009
7010 _prev_end_offset = cur_offset + envelope_size;
7011
7012 Ok(())
7013 }
7014 }
7015
7016 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigOverride {
7017 #[inline(always)]
7018 fn new_empty() -> Self {
7019 Self::default()
7020 }
7021
7022 unsafe fn decode(
7023 &mut self,
7024 decoder: &mut fidl::encoding::Decoder<'_, D>,
7025 offset: usize,
7026 mut depth: fidl::encoding::Depth,
7027 ) -> fidl::Result<()> {
7028 decoder.debug_check_bounds::<Self>(offset);
7029 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7030 None => return Err(fidl::Error::NotNullable),
7031 Some(len) => len,
7032 };
7033 if len == 0 {
7035 return Ok(());
7036 };
7037 depth.increment()?;
7038 let envelope_size = 8;
7039 let bytes_len = len * envelope_size;
7040 let offset = decoder.out_of_line_offset(bytes_len)?;
7041 let mut _next_ordinal_to_read = 0;
7043 let mut next_offset = offset;
7044 let end_offset = offset + bytes_len;
7045 _next_ordinal_to_read += 1;
7046 if next_offset >= end_offset {
7047 return Ok(());
7048 }
7049
7050 while _next_ordinal_to_read < 1 {
7052 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7053 _next_ordinal_to_read += 1;
7054 next_offset += envelope_size;
7055 }
7056
7057 let next_out_of_line = decoder.next_out_of_line();
7058 let handles_before = decoder.remaining_handles();
7059 if let Some((inlined, num_bytes, num_handles)) =
7060 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7061 {
7062 let member_inline_size =
7063 <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
7064 decoder.context,
7065 );
7066 if inlined != (member_inline_size <= 4) {
7067 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7068 }
7069 let inner_offset;
7070 let mut inner_depth = depth.clone();
7071 if inlined {
7072 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7073 inner_offset = next_offset;
7074 } else {
7075 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7076 inner_depth.increment()?;
7077 }
7078 let val_ref = self
7079 .key
7080 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
7081 fidl::decode!(
7082 fidl::encoding::BoundedString<64>,
7083 D,
7084 val_ref,
7085 decoder,
7086 inner_offset,
7087 inner_depth
7088 )?;
7089 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7090 {
7091 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7092 }
7093 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7094 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7095 }
7096 }
7097
7098 next_offset += envelope_size;
7099 _next_ordinal_to_read += 1;
7100 if next_offset >= end_offset {
7101 return Ok(());
7102 }
7103
7104 while _next_ordinal_to_read < 2 {
7106 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7107 _next_ordinal_to_read += 1;
7108 next_offset += envelope_size;
7109 }
7110
7111 let next_out_of_line = decoder.next_out_of_line();
7112 let handles_before = decoder.remaining_handles();
7113 if let Some((inlined, num_bytes, num_handles)) =
7114 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7115 {
7116 let member_inline_size =
7117 <ConfigValue as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7118 if inlined != (member_inline_size <= 4) {
7119 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7120 }
7121 let inner_offset;
7122 let mut inner_depth = depth.clone();
7123 if inlined {
7124 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7125 inner_offset = next_offset;
7126 } else {
7127 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7128 inner_depth.increment()?;
7129 }
7130 let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(ConfigValue, D));
7131 fidl::decode!(ConfigValue, D, val_ref, decoder, inner_offset, inner_depth)?;
7132 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7133 {
7134 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7135 }
7136 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7137 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7138 }
7139 }
7140
7141 next_offset += envelope_size;
7142
7143 while next_offset < end_offset {
7145 _next_ordinal_to_read += 1;
7146 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7147 next_offset += envelope_size;
7148 }
7149
7150 Ok(())
7151 }
7152 }
7153
7154 impl ConfigSchema {
7155 #[inline(always)]
7156 fn max_ordinal_present(&self) -> u64 {
7157 if let Some(_) = self.value_source {
7158 return 3;
7159 }
7160 if let Some(_) = self.checksum {
7161 return 2;
7162 }
7163 if let Some(_) = self.fields {
7164 return 1;
7165 }
7166 0
7167 }
7168 }
7169
7170 impl fidl::encoding::ValueTypeMarker for ConfigSchema {
7171 type Borrowed<'a> = &'a Self;
7172 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7173 value
7174 }
7175 }
7176
7177 unsafe impl fidl::encoding::TypeMarker for ConfigSchema {
7178 type Owned = Self;
7179
7180 #[inline(always)]
7181 fn inline_align(_context: fidl::encoding::Context) -> usize {
7182 8
7183 }
7184
7185 #[inline(always)]
7186 fn inline_size(_context: fidl::encoding::Context) -> usize {
7187 16
7188 }
7189 }
7190
7191 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigSchema, D>
7192 for &ConfigSchema
7193 {
7194 unsafe fn encode(
7195 self,
7196 encoder: &mut fidl::encoding::Encoder<'_, D>,
7197 offset: usize,
7198 mut depth: fidl::encoding::Depth,
7199 ) -> fidl::Result<()> {
7200 encoder.debug_check_bounds::<ConfigSchema>(offset);
7201 let max_ordinal: u64 = self.max_ordinal_present();
7203 encoder.write_num(max_ordinal, offset);
7204 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7205 if max_ordinal == 0 {
7207 return Ok(());
7208 }
7209 depth.increment()?;
7210 let envelope_size = 8;
7211 let bytes_len = max_ordinal as usize * envelope_size;
7212 #[allow(unused_variables)]
7213 let offset = encoder.out_of_line_offset(bytes_len);
7214 let mut _prev_end_offset: usize = 0;
7215 if 1 > max_ordinal {
7216 return Ok(());
7217 }
7218
7219 let cur_offset: usize = (1 - 1) * envelope_size;
7222
7223 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7225
7226 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ConfigField>, D>(
7231 self.fields.as_ref().map(<fidl::encoding::UnboundedVector<ConfigField> as fidl::encoding::ValueTypeMarker>::borrow),
7232 encoder, offset + cur_offset, depth
7233 )?;
7234
7235 _prev_end_offset = cur_offset + envelope_size;
7236 if 2 > max_ordinal {
7237 return Ok(());
7238 }
7239
7240 let cur_offset: usize = (2 - 1) * envelope_size;
7243
7244 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7246
7247 fidl::encoding::encode_in_envelope_optional::<ConfigChecksum, D>(
7252 self.checksum
7253 .as_ref()
7254 .map(<ConfigChecksum as fidl::encoding::ValueTypeMarker>::borrow),
7255 encoder,
7256 offset + cur_offset,
7257 depth,
7258 )?;
7259
7260 _prev_end_offset = cur_offset + envelope_size;
7261 if 3 > max_ordinal {
7262 return Ok(());
7263 }
7264
7265 let cur_offset: usize = (3 - 1) * envelope_size;
7268
7269 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7271
7272 fidl::encoding::encode_in_envelope_optional::<ConfigValueSource, D>(
7277 self.value_source
7278 .as_ref()
7279 .map(<ConfigValueSource as fidl::encoding::ValueTypeMarker>::borrow),
7280 encoder,
7281 offset + cur_offset,
7282 depth,
7283 )?;
7284
7285 _prev_end_offset = cur_offset + envelope_size;
7286
7287 Ok(())
7288 }
7289 }
7290
7291 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigSchema {
7292 #[inline(always)]
7293 fn new_empty() -> Self {
7294 Self::default()
7295 }
7296
7297 unsafe fn decode(
7298 &mut self,
7299 decoder: &mut fidl::encoding::Decoder<'_, D>,
7300 offset: usize,
7301 mut depth: fidl::encoding::Depth,
7302 ) -> fidl::Result<()> {
7303 decoder.debug_check_bounds::<Self>(offset);
7304 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7305 None => return Err(fidl::Error::NotNullable),
7306 Some(len) => len,
7307 };
7308 if len == 0 {
7310 return Ok(());
7311 };
7312 depth.increment()?;
7313 let envelope_size = 8;
7314 let bytes_len = len * envelope_size;
7315 let offset = decoder.out_of_line_offset(bytes_len)?;
7316 let mut _next_ordinal_to_read = 0;
7318 let mut next_offset = offset;
7319 let end_offset = offset + bytes_len;
7320 _next_ordinal_to_read += 1;
7321 if next_offset >= end_offset {
7322 return Ok(());
7323 }
7324
7325 while _next_ordinal_to_read < 1 {
7327 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7328 _next_ordinal_to_read += 1;
7329 next_offset += envelope_size;
7330 }
7331
7332 let next_out_of_line = decoder.next_out_of_line();
7333 let handles_before = decoder.remaining_handles();
7334 if let Some((inlined, num_bytes, num_handles)) =
7335 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7336 {
7337 let member_inline_size = <fidl::encoding::UnboundedVector<ConfigField> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7338 if inlined != (member_inline_size <= 4) {
7339 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7340 }
7341 let inner_offset;
7342 let mut inner_depth = depth.clone();
7343 if inlined {
7344 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7345 inner_offset = next_offset;
7346 } else {
7347 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7348 inner_depth.increment()?;
7349 }
7350 let val_ref = self.fields.get_or_insert_with(|| {
7351 fidl::new_empty!(fidl::encoding::UnboundedVector<ConfigField>, D)
7352 });
7353 fidl::decode!(
7354 fidl::encoding::UnboundedVector<ConfigField>,
7355 D,
7356 val_ref,
7357 decoder,
7358 inner_offset,
7359 inner_depth
7360 )?;
7361 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7362 {
7363 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7364 }
7365 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7366 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7367 }
7368 }
7369
7370 next_offset += envelope_size;
7371 _next_ordinal_to_read += 1;
7372 if next_offset >= end_offset {
7373 return Ok(());
7374 }
7375
7376 while _next_ordinal_to_read < 2 {
7378 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7379 _next_ordinal_to_read += 1;
7380 next_offset += envelope_size;
7381 }
7382
7383 let next_out_of_line = decoder.next_out_of_line();
7384 let handles_before = decoder.remaining_handles();
7385 if let Some((inlined, num_bytes, num_handles)) =
7386 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7387 {
7388 let member_inline_size =
7389 <ConfigChecksum as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7390 if inlined != (member_inline_size <= 4) {
7391 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7392 }
7393 let inner_offset;
7394 let mut inner_depth = depth.clone();
7395 if inlined {
7396 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7397 inner_offset = next_offset;
7398 } else {
7399 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7400 inner_depth.increment()?;
7401 }
7402 let val_ref =
7403 self.checksum.get_or_insert_with(|| fidl::new_empty!(ConfigChecksum, D));
7404 fidl::decode!(ConfigChecksum, D, val_ref, decoder, inner_offset, inner_depth)?;
7405 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7406 {
7407 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7408 }
7409 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7410 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7411 }
7412 }
7413
7414 next_offset += envelope_size;
7415 _next_ordinal_to_read += 1;
7416 if next_offset >= end_offset {
7417 return Ok(());
7418 }
7419
7420 while _next_ordinal_to_read < 3 {
7422 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7423 _next_ordinal_to_read += 1;
7424 next_offset += envelope_size;
7425 }
7426
7427 let next_out_of_line = decoder.next_out_of_line();
7428 let handles_before = decoder.remaining_handles();
7429 if let Some((inlined, num_bytes, num_handles)) =
7430 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7431 {
7432 let member_inline_size =
7433 <ConfigValueSource as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7434 if inlined != (member_inline_size <= 4) {
7435 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7436 }
7437 let inner_offset;
7438 let mut inner_depth = depth.clone();
7439 if inlined {
7440 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7441 inner_offset = next_offset;
7442 } else {
7443 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7444 inner_depth.increment()?;
7445 }
7446 let val_ref =
7447 self.value_source.get_or_insert_with(|| fidl::new_empty!(ConfigValueSource, D));
7448 fidl::decode!(ConfigValueSource, D, val_ref, decoder, inner_offset, inner_depth)?;
7449 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7450 {
7451 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7452 }
7453 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7454 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7455 }
7456 }
7457
7458 next_offset += envelope_size;
7459
7460 while next_offset < end_offset {
7462 _next_ordinal_to_read += 1;
7463 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7464 next_offset += envelope_size;
7465 }
7466
7467 Ok(())
7468 }
7469 }
7470
7471 impl ConfigSourceCapabilities {
7472 #[inline(always)]
7473 fn max_ordinal_present(&self) -> u64 {
7474 0
7475 }
7476 }
7477
7478 impl fidl::encoding::ValueTypeMarker for ConfigSourceCapabilities {
7479 type Borrowed<'a> = &'a Self;
7480 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7481 value
7482 }
7483 }
7484
7485 unsafe impl fidl::encoding::TypeMarker for ConfigSourceCapabilities {
7486 type Owned = Self;
7487
7488 #[inline(always)]
7489 fn inline_align(_context: fidl::encoding::Context) -> usize {
7490 8
7491 }
7492
7493 #[inline(always)]
7494 fn inline_size(_context: fidl::encoding::Context) -> usize {
7495 16
7496 }
7497 }
7498
7499 unsafe impl<D: fidl::encoding::ResourceDialect>
7500 fidl::encoding::Encode<ConfigSourceCapabilities, D> for &ConfigSourceCapabilities
7501 {
7502 unsafe fn encode(
7503 self,
7504 encoder: &mut fidl::encoding::Encoder<'_, D>,
7505 offset: usize,
7506 mut depth: fidl::encoding::Depth,
7507 ) -> fidl::Result<()> {
7508 encoder.debug_check_bounds::<ConfigSourceCapabilities>(offset);
7509 let max_ordinal: u64 = self.max_ordinal_present();
7511 encoder.write_num(max_ordinal, offset);
7512 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7513 if max_ordinal == 0 {
7515 return Ok(());
7516 }
7517 depth.increment()?;
7518 let envelope_size = 8;
7519 let bytes_len = max_ordinal as usize * envelope_size;
7520 #[allow(unused_variables)]
7521 let offset = encoder.out_of_line_offset(bytes_len);
7522 let mut _prev_end_offset: usize = 0;
7523
7524 Ok(())
7525 }
7526 }
7527
7528 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7529 for ConfigSourceCapabilities
7530 {
7531 #[inline(always)]
7532 fn new_empty() -> Self {
7533 Self::default()
7534 }
7535
7536 unsafe fn decode(
7537 &mut self,
7538 decoder: &mut fidl::encoding::Decoder<'_, D>,
7539 offset: usize,
7540 mut depth: fidl::encoding::Depth,
7541 ) -> fidl::Result<()> {
7542 decoder.debug_check_bounds::<Self>(offset);
7543 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7544 None => return Err(fidl::Error::NotNullable),
7545 Some(len) => len,
7546 };
7547 if len == 0 {
7549 return Ok(());
7550 };
7551 depth.increment()?;
7552 let envelope_size = 8;
7553 let bytes_len = len * envelope_size;
7554 let offset = decoder.out_of_line_offset(bytes_len)?;
7555 let mut _next_ordinal_to_read = 0;
7557 let mut next_offset = offset;
7558 let end_offset = offset + bytes_len;
7559
7560 while next_offset < end_offset {
7562 _next_ordinal_to_read += 1;
7563 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7564 next_offset += envelope_size;
7565 }
7566
7567 Ok(())
7568 }
7569 }
7570
7571 impl ConfigValueSpec {
7572 #[inline(always)]
7573 fn max_ordinal_present(&self) -> u64 {
7574 if let Some(_) = self.value {
7575 return 1;
7576 }
7577 0
7578 }
7579 }
7580
7581 impl fidl::encoding::ValueTypeMarker for ConfigValueSpec {
7582 type Borrowed<'a> = &'a Self;
7583 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7584 value
7585 }
7586 }
7587
7588 unsafe impl fidl::encoding::TypeMarker for ConfigValueSpec {
7589 type Owned = Self;
7590
7591 #[inline(always)]
7592 fn inline_align(_context: fidl::encoding::Context) -> usize {
7593 8
7594 }
7595
7596 #[inline(always)]
7597 fn inline_size(_context: fidl::encoding::Context) -> usize {
7598 16
7599 }
7600 }
7601
7602 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigValueSpec, D>
7603 for &ConfigValueSpec
7604 {
7605 unsafe fn encode(
7606 self,
7607 encoder: &mut fidl::encoding::Encoder<'_, D>,
7608 offset: usize,
7609 mut depth: fidl::encoding::Depth,
7610 ) -> fidl::Result<()> {
7611 encoder.debug_check_bounds::<ConfigValueSpec>(offset);
7612 let max_ordinal: u64 = self.max_ordinal_present();
7614 encoder.write_num(max_ordinal, offset);
7615 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7616 if max_ordinal == 0 {
7618 return Ok(());
7619 }
7620 depth.increment()?;
7621 let envelope_size = 8;
7622 let bytes_len = max_ordinal as usize * envelope_size;
7623 #[allow(unused_variables)]
7624 let offset = encoder.out_of_line_offset(bytes_len);
7625 let mut _prev_end_offset: usize = 0;
7626 if 1 > max_ordinal {
7627 return Ok(());
7628 }
7629
7630 let cur_offset: usize = (1 - 1) * envelope_size;
7633
7634 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7636
7637 fidl::encoding::encode_in_envelope_optional::<ConfigValue, D>(
7642 self.value.as_ref().map(<ConfigValue as fidl::encoding::ValueTypeMarker>::borrow),
7643 encoder,
7644 offset + cur_offset,
7645 depth,
7646 )?;
7647
7648 _prev_end_offset = cur_offset + envelope_size;
7649
7650 Ok(())
7651 }
7652 }
7653
7654 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigValueSpec {
7655 #[inline(always)]
7656 fn new_empty() -> Self {
7657 Self::default()
7658 }
7659
7660 unsafe fn decode(
7661 &mut self,
7662 decoder: &mut fidl::encoding::Decoder<'_, D>,
7663 offset: usize,
7664 mut depth: fidl::encoding::Depth,
7665 ) -> fidl::Result<()> {
7666 decoder.debug_check_bounds::<Self>(offset);
7667 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7668 None => return Err(fidl::Error::NotNullable),
7669 Some(len) => len,
7670 };
7671 if len == 0 {
7673 return Ok(());
7674 };
7675 depth.increment()?;
7676 let envelope_size = 8;
7677 let bytes_len = len * envelope_size;
7678 let offset = decoder.out_of_line_offset(bytes_len)?;
7679 let mut _next_ordinal_to_read = 0;
7681 let mut next_offset = offset;
7682 let end_offset = offset + bytes_len;
7683 _next_ordinal_to_read += 1;
7684 if next_offset >= end_offset {
7685 return Ok(());
7686 }
7687
7688 while _next_ordinal_to_read < 1 {
7690 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7691 _next_ordinal_to_read += 1;
7692 next_offset += envelope_size;
7693 }
7694
7695 let next_out_of_line = decoder.next_out_of_line();
7696 let handles_before = decoder.remaining_handles();
7697 if let Some((inlined, num_bytes, num_handles)) =
7698 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7699 {
7700 let member_inline_size =
7701 <ConfigValue as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7702 if inlined != (member_inline_size <= 4) {
7703 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7704 }
7705 let inner_offset;
7706 let mut inner_depth = depth.clone();
7707 if inlined {
7708 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7709 inner_offset = next_offset;
7710 } else {
7711 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7712 inner_depth.increment()?;
7713 }
7714 let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(ConfigValue, D));
7715 fidl::decode!(ConfigValue, D, val_ref, decoder, inner_offset, inner_depth)?;
7716 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7717 {
7718 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7719 }
7720 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7721 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7722 }
7723 }
7724
7725 next_offset += envelope_size;
7726
7727 while next_offset < end_offset {
7729 _next_ordinal_to_read += 1;
7730 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7731 next_offset += envelope_size;
7732 }
7733
7734 Ok(())
7735 }
7736 }
7737
7738 impl ConfigValuesData {
7739 #[inline(always)]
7740 fn max_ordinal_present(&self) -> u64 {
7741 if let Some(_) = self.checksum {
7742 return 2;
7743 }
7744 if let Some(_) = self.values {
7745 return 1;
7746 }
7747 0
7748 }
7749 }
7750
7751 impl fidl::encoding::ValueTypeMarker for ConfigValuesData {
7752 type Borrowed<'a> = &'a Self;
7753 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7754 value
7755 }
7756 }
7757
7758 unsafe impl fidl::encoding::TypeMarker for ConfigValuesData {
7759 type Owned = Self;
7760
7761 #[inline(always)]
7762 fn inline_align(_context: fidl::encoding::Context) -> usize {
7763 8
7764 }
7765
7766 #[inline(always)]
7767 fn inline_size(_context: fidl::encoding::Context) -> usize {
7768 16
7769 }
7770 }
7771
7772 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigValuesData, D>
7773 for &ConfigValuesData
7774 {
7775 unsafe fn encode(
7776 self,
7777 encoder: &mut fidl::encoding::Encoder<'_, D>,
7778 offset: usize,
7779 mut depth: fidl::encoding::Depth,
7780 ) -> fidl::Result<()> {
7781 encoder.debug_check_bounds::<ConfigValuesData>(offset);
7782 let max_ordinal: u64 = self.max_ordinal_present();
7784 encoder.write_num(max_ordinal, offset);
7785 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7786 if max_ordinal == 0 {
7788 return Ok(());
7789 }
7790 depth.increment()?;
7791 let envelope_size = 8;
7792 let bytes_len = max_ordinal as usize * envelope_size;
7793 #[allow(unused_variables)]
7794 let offset = encoder.out_of_line_offset(bytes_len);
7795 let mut _prev_end_offset: usize = 0;
7796 if 1 > max_ordinal {
7797 return Ok(());
7798 }
7799
7800 let cur_offset: usize = (1 - 1) * envelope_size;
7803
7804 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7806
7807 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ConfigValueSpec>, D>(
7812 self.values.as_ref().map(<fidl::encoding::UnboundedVector<ConfigValueSpec> as fidl::encoding::ValueTypeMarker>::borrow),
7813 encoder, offset + cur_offset, depth
7814 )?;
7815
7816 _prev_end_offset = cur_offset + envelope_size;
7817 if 2 > max_ordinal {
7818 return Ok(());
7819 }
7820
7821 let cur_offset: usize = (2 - 1) * envelope_size;
7824
7825 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7827
7828 fidl::encoding::encode_in_envelope_optional::<ConfigChecksum, D>(
7833 self.checksum
7834 .as_ref()
7835 .map(<ConfigChecksum as fidl::encoding::ValueTypeMarker>::borrow),
7836 encoder,
7837 offset + cur_offset,
7838 depth,
7839 )?;
7840
7841 _prev_end_offset = cur_offset + envelope_size;
7842
7843 Ok(())
7844 }
7845 }
7846
7847 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigValuesData {
7848 #[inline(always)]
7849 fn new_empty() -> Self {
7850 Self::default()
7851 }
7852
7853 unsafe fn decode(
7854 &mut self,
7855 decoder: &mut fidl::encoding::Decoder<'_, D>,
7856 offset: usize,
7857 mut depth: fidl::encoding::Depth,
7858 ) -> fidl::Result<()> {
7859 decoder.debug_check_bounds::<Self>(offset);
7860 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7861 None => return Err(fidl::Error::NotNullable),
7862 Some(len) => len,
7863 };
7864 if len == 0 {
7866 return Ok(());
7867 };
7868 depth.increment()?;
7869 let envelope_size = 8;
7870 let bytes_len = len * envelope_size;
7871 let offset = decoder.out_of_line_offset(bytes_len)?;
7872 let mut _next_ordinal_to_read = 0;
7874 let mut next_offset = offset;
7875 let end_offset = offset + bytes_len;
7876 _next_ordinal_to_read += 1;
7877 if next_offset >= end_offset {
7878 return Ok(());
7879 }
7880
7881 while _next_ordinal_to_read < 1 {
7883 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7884 _next_ordinal_to_read += 1;
7885 next_offset += envelope_size;
7886 }
7887
7888 let next_out_of_line = decoder.next_out_of_line();
7889 let handles_before = decoder.remaining_handles();
7890 if let Some((inlined, num_bytes, num_handles)) =
7891 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7892 {
7893 let member_inline_size = <fidl::encoding::UnboundedVector<ConfigValueSpec> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7894 if inlined != (member_inline_size <= 4) {
7895 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7896 }
7897 let inner_offset;
7898 let mut inner_depth = depth.clone();
7899 if inlined {
7900 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7901 inner_offset = next_offset;
7902 } else {
7903 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7904 inner_depth.increment()?;
7905 }
7906 let val_ref = self.values.get_or_insert_with(|| {
7907 fidl::new_empty!(fidl::encoding::UnboundedVector<ConfigValueSpec>, D)
7908 });
7909 fidl::decode!(
7910 fidl::encoding::UnboundedVector<ConfigValueSpec>,
7911 D,
7912 val_ref,
7913 decoder,
7914 inner_offset,
7915 inner_depth
7916 )?;
7917 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7918 {
7919 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7920 }
7921 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7922 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7923 }
7924 }
7925
7926 next_offset += envelope_size;
7927 _next_ordinal_to_read += 1;
7928 if next_offset >= end_offset {
7929 return Ok(());
7930 }
7931
7932 while _next_ordinal_to_read < 2 {
7934 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7935 _next_ordinal_to_read += 1;
7936 next_offset += envelope_size;
7937 }
7938
7939 let next_out_of_line = decoder.next_out_of_line();
7940 let handles_before = decoder.remaining_handles();
7941 if let Some((inlined, num_bytes, num_handles)) =
7942 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7943 {
7944 let member_inline_size =
7945 <ConfigChecksum as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7946 if inlined != (member_inline_size <= 4) {
7947 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7948 }
7949 let inner_offset;
7950 let mut inner_depth = depth.clone();
7951 if inlined {
7952 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7953 inner_offset = next_offset;
7954 } else {
7955 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7956 inner_depth.increment()?;
7957 }
7958 let val_ref =
7959 self.checksum.get_or_insert_with(|| fidl::new_empty!(ConfigChecksum, D));
7960 fidl::decode!(ConfigChecksum, D, val_ref, decoder, inner_offset, inner_depth)?;
7961 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7962 {
7963 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7964 }
7965 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7966 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7967 }
7968 }
7969
7970 next_offset += envelope_size;
7971
7972 while next_offset < end_offset {
7974 _next_ordinal_to_read += 1;
7975 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7976 next_offset += envelope_size;
7977 }
7978
7979 Ok(())
7980 }
7981 }
7982
7983 impl Configuration {
7984 #[inline(always)]
7985 fn max_ordinal_present(&self) -> u64 {
7986 if let Some(_) = self.value {
7987 return 2;
7988 }
7989 if let Some(_) = self.name {
7990 return 1;
7991 }
7992 0
7993 }
7994 }
7995
7996 impl fidl::encoding::ValueTypeMarker for Configuration {
7997 type Borrowed<'a> = &'a Self;
7998 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7999 value
8000 }
8001 }
8002
8003 unsafe impl fidl::encoding::TypeMarker for Configuration {
8004 type Owned = Self;
8005
8006 #[inline(always)]
8007 fn inline_align(_context: fidl::encoding::Context) -> usize {
8008 8
8009 }
8010
8011 #[inline(always)]
8012 fn inline_size(_context: fidl::encoding::Context) -> usize {
8013 16
8014 }
8015 }
8016
8017 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Configuration, D>
8018 for &Configuration
8019 {
8020 unsafe fn encode(
8021 self,
8022 encoder: &mut fidl::encoding::Encoder<'_, D>,
8023 offset: usize,
8024 mut depth: fidl::encoding::Depth,
8025 ) -> fidl::Result<()> {
8026 encoder.debug_check_bounds::<Configuration>(offset);
8027 let max_ordinal: u64 = self.max_ordinal_present();
8029 encoder.write_num(max_ordinal, offset);
8030 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8031 if max_ordinal == 0 {
8033 return Ok(());
8034 }
8035 depth.increment()?;
8036 let envelope_size = 8;
8037 let bytes_len = max_ordinal as usize * envelope_size;
8038 #[allow(unused_variables)]
8039 let offset = encoder.out_of_line_offset(bytes_len);
8040 let mut _prev_end_offset: usize = 0;
8041 if 1 > max_ordinal {
8042 return Ok(());
8043 }
8044
8045 let cur_offset: usize = (1 - 1) * envelope_size;
8048
8049 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8051
8052 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
8057 self.name.as_ref().map(
8058 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
8059 ),
8060 encoder,
8061 offset + cur_offset,
8062 depth,
8063 )?;
8064
8065 _prev_end_offset = cur_offset + envelope_size;
8066 if 2 > max_ordinal {
8067 return Ok(());
8068 }
8069
8070 let cur_offset: usize = (2 - 1) * envelope_size;
8073
8074 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8076
8077 fidl::encoding::encode_in_envelope_optional::<ConfigValue, D>(
8082 self.value.as_ref().map(<ConfigValue as fidl::encoding::ValueTypeMarker>::borrow),
8083 encoder,
8084 offset + cur_offset,
8085 depth,
8086 )?;
8087
8088 _prev_end_offset = cur_offset + envelope_size;
8089
8090 Ok(())
8091 }
8092 }
8093
8094 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
8095 #[inline(always)]
8096 fn new_empty() -> Self {
8097 Self::default()
8098 }
8099
8100 unsafe fn decode(
8101 &mut self,
8102 decoder: &mut fidl::encoding::Decoder<'_, D>,
8103 offset: usize,
8104 mut depth: fidl::encoding::Depth,
8105 ) -> fidl::Result<()> {
8106 decoder.debug_check_bounds::<Self>(offset);
8107 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8108 None => return Err(fidl::Error::NotNullable),
8109 Some(len) => len,
8110 };
8111 if len == 0 {
8113 return Ok(());
8114 };
8115 depth.increment()?;
8116 let envelope_size = 8;
8117 let bytes_len = len * envelope_size;
8118 let offset = decoder.out_of_line_offset(bytes_len)?;
8119 let mut _next_ordinal_to_read = 0;
8121 let mut next_offset = offset;
8122 let end_offset = offset + bytes_len;
8123 _next_ordinal_to_read += 1;
8124 if next_offset >= end_offset {
8125 return Ok(());
8126 }
8127
8128 while _next_ordinal_to_read < 1 {
8130 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8131 _next_ordinal_to_read += 1;
8132 next_offset += envelope_size;
8133 }
8134
8135 let next_out_of_line = decoder.next_out_of_line();
8136 let handles_before = decoder.remaining_handles();
8137 if let Some((inlined, num_bytes, num_handles)) =
8138 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8139 {
8140 let member_inline_size =
8141 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
8142 decoder.context,
8143 );
8144 if inlined != (member_inline_size <= 4) {
8145 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8146 }
8147 let inner_offset;
8148 let mut inner_depth = depth.clone();
8149 if inlined {
8150 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8151 inner_offset = next_offset;
8152 } else {
8153 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8154 inner_depth.increment()?;
8155 }
8156 let val_ref = self
8157 .name
8158 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
8159 fidl::decode!(
8160 fidl::encoding::BoundedString<100>,
8161 D,
8162 val_ref,
8163 decoder,
8164 inner_offset,
8165 inner_depth
8166 )?;
8167 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8168 {
8169 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8170 }
8171 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8172 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8173 }
8174 }
8175
8176 next_offset += envelope_size;
8177 _next_ordinal_to_read += 1;
8178 if next_offset >= end_offset {
8179 return Ok(());
8180 }
8181
8182 while _next_ordinal_to_read < 2 {
8184 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8185 _next_ordinal_to_read += 1;
8186 next_offset += envelope_size;
8187 }
8188
8189 let next_out_of_line = decoder.next_out_of_line();
8190 let handles_before = decoder.remaining_handles();
8191 if let Some((inlined, num_bytes, num_handles)) =
8192 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8193 {
8194 let member_inline_size =
8195 <ConfigValue as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8196 if inlined != (member_inline_size <= 4) {
8197 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8198 }
8199 let inner_offset;
8200 let mut inner_depth = depth.clone();
8201 if inlined {
8202 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8203 inner_offset = next_offset;
8204 } else {
8205 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8206 inner_depth.increment()?;
8207 }
8208 let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(ConfigValue, D));
8209 fidl::decode!(ConfigValue, D, val_ref, decoder, inner_offset, inner_depth)?;
8210 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8211 {
8212 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8213 }
8214 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8215 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8216 }
8217 }
8218
8219 next_offset += envelope_size;
8220
8221 while next_offset < end_offset {
8223 _next_ordinal_to_read += 1;
8224 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8225 next_offset += envelope_size;
8226 }
8227
8228 Ok(())
8229 }
8230 }
8231
8232 impl DebugProtocolRegistration {
8233 #[inline(always)]
8234 fn max_ordinal_present(&self) -> u64 {
8235 if let Some(_) = self.target_name {
8236 return 3;
8237 }
8238 if let Some(_) = self.source_name {
8239 return 2;
8240 }
8241 if let Some(_) = self.source {
8242 return 1;
8243 }
8244 0
8245 }
8246 }
8247
8248 impl fidl::encoding::ValueTypeMarker for DebugProtocolRegistration {
8249 type Borrowed<'a> = &'a Self;
8250 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8251 value
8252 }
8253 }
8254
8255 unsafe impl fidl::encoding::TypeMarker for DebugProtocolRegistration {
8256 type Owned = Self;
8257
8258 #[inline(always)]
8259 fn inline_align(_context: fidl::encoding::Context) -> usize {
8260 8
8261 }
8262
8263 #[inline(always)]
8264 fn inline_size(_context: fidl::encoding::Context) -> usize {
8265 16
8266 }
8267 }
8268
8269 unsafe impl<D: fidl::encoding::ResourceDialect>
8270 fidl::encoding::Encode<DebugProtocolRegistration, D> for &DebugProtocolRegistration
8271 {
8272 unsafe fn encode(
8273 self,
8274 encoder: &mut fidl::encoding::Encoder<'_, D>,
8275 offset: usize,
8276 mut depth: fidl::encoding::Depth,
8277 ) -> fidl::Result<()> {
8278 encoder.debug_check_bounds::<DebugProtocolRegistration>(offset);
8279 let max_ordinal: u64 = self.max_ordinal_present();
8281 encoder.write_num(max_ordinal, offset);
8282 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8283 if max_ordinal == 0 {
8285 return Ok(());
8286 }
8287 depth.increment()?;
8288 let envelope_size = 8;
8289 let bytes_len = max_ordinal as usize * envelope_size;
8290 #[allow(unused_variables)]
8291 let offset = encoder.out_of_line_offset(bytes_len);
8292 let mut _prev_end_offset: usize = 0;
8293 if 1 > max_ordinal {
8294 return Ok(());
8295 }
8296
8297 let cur_offset: usize = (1 - 1) * envelope_size;
8300
8301 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8303
8304 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
8309 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
8310 encoder,
8311 offset + cur_offset,
8312 depth,
8313 )?;
8314
8315 _prev_end_offset = cur_offset + envelope_size;
8316 if 2 > max_ordinal {
8317 return Ok(());
8318 }
8319
8320 let cur_offset: usize = (2 - 1) * envelope_size;
8323
8324 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8326
8327 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
8332 self.source_name.as_ref().map(
8333 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
8334 ),
8335 encoder,
8336 offset + cur_offset,
8337 depth,
8338 )?;
8339
8340 _prev_end_offset = cur_offset + envelope_size;
8341 if 3 > max_ordinal {
8342 return Ok(());
8343 }
8344
8345 let cur_offset: usize = (3 - 1) * envelope_size;
8348
8349 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8351
8352 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
8357 self.target_name.as_ref().map(
8358 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
8359 ),
8360 encoder,
8361 offset + cur_offset,
8362 depth,
8363 )?;
8364
8365 _prev_end_offset = cur_offset + envelope_size;
8366
8367 Ok(())
8368 }
8369 }
8370
8371 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8372 for DebugProtocolRegistration
8373 {
8374 #[inline(always)]
8375 fn new_empty() -> Self {
8376 Self::default()
8377 }
8378
8379 unsafe fn decode(
8380 &mut self,
8381 decoder: &mut fidl::encoding::Decoder<'_, D>,
8382 offset: usize,
8383 mut depth: fidl::encoding::Depth,
8384 ) -> fidl::Result<()> {
8385 decoder.debug_check_bounds::<Self>(offset);
8386 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8387 None => return Err(fidl::Error::NotNullable),
8388 Some(len) => len,
8389 };
8390 if len == 0 {
8392 return Ok(());
8393 };
8394 depth.increment()?;
8395 let envelope_size = 8;
8396 let bytes_len = len * envelope_size;
8397 let offset = decoder.out_of_line_offset(bytes_len)?;
8398 let mut _next_ordinal_to_read = 0;
8400 let mut next_offset = offset;
8401 let end_offset = offset + bytes_len;
8402 _next_ordinal_to_read += 1;
8403 if next_offset >= end_offset {
8404 return Ok(());
8405 }
8406
8407 while _next_ordinal_to_read < 1 {
8409 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8410 _next_ordinal_to_read += 1;
8411 next_offset += envelope_size;
8412 }
8413
8414 let next_out_of_line = decoder.next_out_of_line();
8415 let handles_before = decoder.remaining_handles();
8416 if let Some((inlined, num_bytes, num_handles)) =
8417 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8418 {
8419 let member_inline_size =
8420 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8421 if inlined != (member_inline_size <= 4) {
8422 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8423 }
8424 let inner_offset;
8425 let mut inner_depth = depth.clone();
8426 if inlined {
8427 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8428 inner_offset = next_offset;
8429 } else {
8430 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8431 inner_depth.increment()?;
8432 }
8433 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
8434 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
8435 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8436 {
8437 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8438 }
8439 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8440 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8441 }
8442 }
8443
8444 next_offset += envelope_size;
8445 _next_ordinal_to_read += 1;
8446 if next_offset >= end_offset {
8447 return Ok(());
8448 }
8449
8450 while _next_ordinal_to_read < 2 {
8452 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8453 _next_ordinal_to_read += 1;
8454 next_offset += envelope_size;
8455 }
8456
8457 let next_out_of_line = decoder.next_out_of_line();
8458 let handles_before = decoder.remaining_handles();
8459 if let Some((inlined, num_bytes, num_handles)) =
8460 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8461 {
8462 let member_inline_size =
8463 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
8464 decoder.context,
8465 );
8466 if inlined != (member_inline_size <= 4) {
8467 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8468 }
8469 let inner_offset;
8470 let mut inner_depth = depth.clone();
8471 if inlined {
8472 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8473 inner_offset = next_offset;
8474 } else {
8475 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8476 inner_depth.increment()?;
8477 }
8478 let val_ref = self
8479 .source_name
8480 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
8481 fidl::decode!(
8482 fidl::encoding::BoundedString<100>,
8483 D,
8484 val_ref,
8485 decoder,
8486 inner_offset,
8487 inner_depth
8488 )?;
8489 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8490 {
8491 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8492 }
8493 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8494 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8495 }
8496 }
8497
8498 next_offset += envelope_size;
8499 _next_ordinal_to_read += 1;
8500 if next_offset >= end_offset {
8501 return Ok(());
8502 }
8503
8504 while _next_ordinal_to_read < 3 {
8506 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8507 _next_ordinal_to_read += 1;
8508 next_offset += envelope_size;
8509 }
8510
8511 let next_out_of_line = decoder.next_out_of_line();
8512 let handles_before = decoder.remaining_handles();
8513 if let Some((inlined, num_bytes, num_handles)) =
8514 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8515 {
8516 let member_inline_size =
8517 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
8518 decoder.context,
8519 );
8520 if inlined != (member_inline_size <= 4) {
8521 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8522 }
8523 let inner_offset;
8524 let mut inner_depth = depth.clone();
8525 if inlined {
8526 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8527 inner_offset = next_offset;
8528 } else {
8529 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8530 inner_depth.increment()?;
8531 }
8532 let val_ref = self
8533 .target_name
8534 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
8535 fidl::decode!(
8536 fidl::encoding::BoundedString<100>,
8537 D,
8538 val_ref,
8539 decoder,
8540 inner_offset,
8541 inner_depth
8542 )?;
8543 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8544 {
8545 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8546 }
8547 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8548 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8549 }
8550 }
8551
8552 next_offset += envelope_size;
8553
8554 while next_offset < end_offset {
8556 _next_ordinal_to_read += 1;
8557 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8558 next_offset += envelope_size;
8559 }
8560
8561 Ok(())
8562 }
8563 }
8564
8565 impl Dictionary {
8566 #[inline(always)]
8567 fn max_ordinal_present(&self) -> u64 {
8568 if let Some(_) = self.source_path {
8569 return 4;
8570 }
8571 if let Some(_) = self.source_dictionary {
8572 return 3;
8573 }
8574 if let Some(_) = self.source {
8575 return 2;
8576 }
8577 if let Some(_) = self.name {
8578 return 1;
8579 }
8580 0
8581 }
8582 }
8583
8584 impl fidl::encoding::ValueTypeMarker for Dictionary {
8585 type Borrowed<'a> = &'a Self;
8586 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8587 value
8588 }
8589 }
8590
8591 unsafe impl fidl::encoding::TypeMarker for Dictionary {
8592 type Owned = Self;
8593
8594 #[inline(always)]
8595 fn inline_align(_context: fidl::encoding::Context) -> usize {
8596 8
8597 }
8598
8599 #[inline(always)]
8600 fn inline_size(_context: fidl::encoding::Context) -> usize {
8601 16
8602 }
8603 }
8604
8605 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Dictionary, D>
8606 for &Dictionary
8607 {
8608 unsafe fn encode(
8609 self,
8610 encoder: &mut fidl::encoding::Encoder<'_, D>,
8611 offset: usize,
8612 mut depth: fidl::encoding::Depth,
8613 ) -> fidl::Result<()> {
8614 encoder.debug_check_bounds::<Dictionary>(offset);
8615 let max_ordinal: u64 = self.max_ordinal_present();
8617 encoder.write_num(max_ordinal, offset);
8618 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8619 if max_ordinal == 0 {
8621 return Ok(());
8622 }
8623 depth.increment()?;
8624 let envelope_size = 8;
8625 let bytes_len = max_ordinal as usize * envelope_size;
8626 #[allow(unused_variables)]
8627 let offset = encoder.out_of_line_offset(bytes_len);
8628 let mut _prev_end_offset: usize = 0;
8629 if 1 > max_ordinal {
8630 return Ok(());
8631 }
8632
8633 let cur_offset: usize = (1 - 1) * envelope_size;
8636
8637 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8639
8640 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
8645 self.name.as_ref().map(
8646 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
8647 ),
8648 encoder,
8649 offset + cur_offset,
8650 depth,
8651 )?;
8652
8653 _prev_end_offset = cur_offset + envelope_size;
8654 if 2 > max_ordinal {
8655 return Ok(());
8656 }
8657
8658 let cur_offset: usize = (2 - 1) * envelope_size;
8661
8662 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8664
8665 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
8670 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
8671 encoder,
8672 offset + cur_offset,
8673 depth,
8674 )?;
8675
8676 _prev_end_offset = cur_offset + envelope_size;
8677 if 3 > max_ordinal {
8678 return Ok(());
8679 }
8680
8681 let cur_offset: usize = (3 - 1) * envelope_size;
8684
8685 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8687
8688 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
8693 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
8694 encoder, offset + cur_offset, depth
8695 )?;
8696
8697 _prev_end_offset = cur_offset + envelope_size;
8698 if 4 > max_ordinal {
8699 return Ok(());
8700 }
8701
8702 let cur_offset: usize = (4 - 1) * envelope_size;
8705
8706 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8708
8709 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
8714 self.source_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
8715 encoder, offset + cur_offset, depth
8716 )?;
8717
8718 _prev_end_offset = cur_offset + envelope_size;
8719
8720 Ok(())
8721 }
8722 }
8723
8724 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Dictionary {
8725 #[inline(always)]
8726 fn new_empty() -> Self {
8727 Self::default()
8728 }
8729
8730 unsafe fn decode(
8731 &mut self,
8732 decoder: &mut fidl::encoding::Decoder<'_, D>,
8733 offset: usize,
8734 mut depth: fidl::encoding::Depth,
8735 ) -> fidl::Result<()> {
8736 decoder.debug_check_bounds::<Self>(offset);
8737 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8738 None => return Err(fidl::Error::NotNullable),
8739 Some(len) => len,
8740 };
8741 if len == 0 {
8743 return Ok(());
8744 };
8745 depth.increment()?;
8746 let envelope_size = 8;
8747 let bytes_len = len * envelope_size;
8748 let offset = decoder.out_of_line_offset(bytes_len)?;
8749 let mut _next_ordinal_to_read = 0;
8751 let mut next_offset = offset;
8752 let end_offset = offset + bytes_len;
8753 _next_ordinal_to_read += 1;
8754 if next_offset >= end_offset {
8755 return Ok(());
8756 }
8757
8758 while _next_ordinal_to_read < 1 {
8760 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8761 _next_ordinal_to_read += 1;
8762 next_offset += envelope_size;
8763 }
8764
8765 let next_out_of_line = decoder.next_out_of_line();
8766 let handles_before = decoder.remaining_handles();
8767 if let Some((inlined, num_bytes, num_handles)) =
8768 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8769 {
8770 let member_inline_size =
8771 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
8772 decoder.context,
8773 );
8774 if inlined != (member_inline_size <= 4) {
8775 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8776 }
8777 let inner_offset;
8778 let mut inner_depth = depth.clone();
8779 if inlined {
8780 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8781 inner_offset = next_offset;
8782 } else {
8783 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8784 inner_depth.increment()?;
8785 }
8786 let val_ref = self
8787 .name
8788 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
8789 fidl::decode!(
8790 fidl::encoding::BoundedString<100>,
8791 D,
8792 val_ref,
8793 decoder,
8794 inner_offset,
8795 inner_depth
8796 )?;
8797 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8798 {
8799 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8800 }
8801 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8802 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8803 }
8804 }
8805
8806 next_offset += envelope_size;
8807 _next_ordinal_to_read += 1;
8808 if next_offset >= end_offset {
8809 return Ok(());
8810 }
8811
8812 while _next_ordinal_to_read < 2 {
8814 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8815 _next_ordinal_to_read += 1;
8816 next_offset += envelope_size;
8817 }
8818
8819 let next_out_of_line = decoder.next_out_of_line();
8820 let handles_before = decoder.remaining_handles();
8821 if let Some((inlined, num_bytes, num_handles)) =
8822 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8823 {
8824 let member_inline_size =
8825 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8826 if inlined != (member_inline_size <= 4) {
8827 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8828 }
8829 let inner_offset;
8830 let mut inner_depth = depth.clone();
8831 if inlined {
8832 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8833 inner_offset = next_offset;
8834 } else {
8835 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8836 inner_depth.increment()?;
8837 }
8838 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
8839 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
8840 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8841 {
8842 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8843 }
8844 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8845 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8846 }
8847 }
8848
8849 next_offset += envelope_size;
8850 _next_ordinal_to_read += 1;
8851 if next_offset >= end_offset {
8852 return Ok(());
8853 }
8854
8855 while _next_ordinal_to_read < 3 {
8857 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8858 _next_ordinal_to_read += 1;
8859 next_offset += envelope_size;
8860 }
8861
8862 let next_out_of_line = decoder.next_out_of_line();
8863 let handles_before = decoder.remaining_handles();
8864 if let Some((inlined, num_bytes, num_handles)) =
8865 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8866 {
8867 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8868 if inlined != (member_inline_size <= 4) {
8869 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8870 }
8871 let inner_offset;
8872 let mut inner_depth = depth.clone();
8873 if inlined {
8874 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8875 inner_offset = next_offset;
8876 } else {
8877 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8878 inner_depth.increment()?;
8879 }
8880 let val_ref = self.source_dictionary.get_or_insert_with(|| {
8881 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
8882 });
8883 fidl::decode!(
8884 fidl::encoding::BoundedString<1024>,
8885 D,
8886 val_ref,
8887 decoder,
8888 inner_offset,
8889 inner_depth
8890 )?;
8891 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8892 {
8893 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8894 }
8895 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8896 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8897 }
8898 }
8899
8900 next_offset += envelope_size;
8901 _next_ordinal_to_read += 1;
8902 if next_offset >= end_offset {
8903 return Ok(());
8904 }
8905
8906 while _next_ordinal_to_read < 4 {
8908 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8909 _next_ordinal_to_read += 1;
8910 next_offset += envelope_size;
8911 }
8912
8913 let next_out_of_line = decoder.next_out_of_line();
8914 let handles_before = decoder.remaining_handles();
8915 if let Some((inlined, num_bytes, num_handles)) =
8916 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8917 {
8918 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8919 if inlined != (member_inline_size <= 4) {
8920 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8921 }
8922 let inner_offset;
8923 let mut inner_depth = depth.clone();
8924 if inlined {
8925 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8926 inner_offset = next_offset;
8927 } else {
8928 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8929 inner_depth.increment()?;
8930 }
8931 let val_ref = self.source_path.get_or_insert_with(|| {
8932 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
8933 });
8934 fidl::decode!(
8935 fidl::encoding::BoundedString<1024>,
8936 D,
8937 val_ref,
8938 decoder,
8939 inner_offset,
8940 inner_depth
8941 )?;
8942 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8943 {
8944 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8945 }
8946 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8947 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8948 }
8949 }
8950
8951 next_offset += envelope_size;
8952
8953 while next_offset < end_offset {
8955 _next_ordinal_to_read += 1;
8956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8957 next_offset += envelope_size;
8958 }
8959
8960 Ok(())
8961 }
8962 }
8963
8964 impl Directory {
8965 #[inline(always)]
8966 fn max_ordinal_present(&self) -> u64 {
8967 if let Some(_) = self.rights {
8968 return 3;
8969 }
8970 if let Some(_) = self.source_path {
8971 return 2;
8972 }
8973 if let Some(_) = self.name {
8974 return 1;
8975 }
8976 0
8977 }
8978 }
8979
8980 impl fidl::encoding::ValueTypeMarker for Directory {
8981 type Borrowed<'a> = &'a Self;
8982 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8983 value
8984 }
8985 }
8986
8987 unsafe impl fidl::encoding::TypeMarker for Directory {
8988 type Owned = Self;
8989
8990 #[inline(always)]
8991 fn inline_align(_context: fidl::encoding::Context) -> usize {
8992 8
8993 }
8994
8995 #[inline(always)]
8996 fn inline_size(_context: fidl::encoding::Context) -> usize {
8997 16
8998 }
8999 }
9000
9001 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Directory, D>
9002 for &Directory
9003 {
9004 unsafe fn encode(
9005 self,
9006 encoder: &mut fidl::encoding::Encoder<'_, D>,
9007 offset: usize,
9008 mut depth: fidl::encoding::Depth,
9009 ) -> fidl::Result<()> {
9010 encoder.debug_check_bounds::<Directory>(offset);
9011 let max_ordinal: u64 = self.max_ordinal_present();
9013 encoder.write_num(max_ordinal, offset);
9014 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9015 if max_ordinal == 0 {
9017 return Ok(());
9018 }
9019 depth.increment()?;
9020 let envelope_size = 8;
9021 let bytes_len = max_ordinal as usize * envelope_size;
9022 #[allow(unused_variables)]
9023 let offset = encoder.out_of_line_offset(bytes_len);
9024 let mut _prev_end_offset: usize = 0;
9025 if 1 > max_ordinal {
9026 return Ok(());
9027 }
9028
9029 let cur_offset: usize = (1 - 1) * envelope_size;
9032
9033 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9035
9036 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
9041 self.name.as_ref().map(
9042 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
9043 ),
9044 encoder,
9045 offset + cur_offset,
9046 depth,
9047 )?;
9048
9049 _prev_end_offset = cur_offset + envelope_size;
9050 if 2 > max_ordinal {
9051 return Ok(());
9052 }
9053
9054 let cur_offset: usize = (2 - 1) * envelope_size;
9057
9058 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9060
9061 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
9066 self.source_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
9067 encoder, offset + cur_offset, depth
9068 )?;
9069
9070 _prev_end_offset = cur_offset + envelope_size;
9071 if 3 > max_ordinal {
9072 return Ok(());
9073 }
9074
9075 let cur_offset: usize = (3 - 1) * envelope_size;
9078
9079 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9081
9082 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_io::Operations, D>(
9087 self.rights
9088 .as_ref()
9089 .map(<fidl_fuchsia_io::Operations as fidl::encoding::ValueTypeMarker>::borrow),
9090 encoder,
9091 offset + cur_offset,
9092 depth,
9093 )?;
9094
9095 _prev_end_offset = cur_offset + envelope_size;
9096
9097 Ok(())
9098 }
9099 }
9100
9101 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Directory {
9102 #[inline(always)]
9103 fn new_empty() -> Self {
9104 Self::default()
9105 }
9106
9107 unsafe fn decode(
9108 &mut self,
9109 decoder: &mut fidl::encoding::Decoder<'_, D>,
9110 offset: usize,
9111 mut depth: fidl::encoding::Depth,
9112 ) -> fidl::Result<()> {
9113 decoder.debug_check_bounds::<Self>(offset);
9114 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9115 None => return Err(fidl::Error::NotNullable),
9116 Some(len) => len,
9117 };
9118 if len == 0 {
9120 return Ok(());
9121 };
9122 depth.increment()?;
9123 let envelope_size = 8;
9124 let bytes_len = len * envelope_size;
9125 let offset = decoder.out_of_line_offset(bytes_len)?;
9126 let mut _next_ordinal_to_read = 0;
9128 let mut next_offset = offset;
9129 let end_offset = offset + bytes_len;
9130 _next_ordinal_to_read += 1;
9131 if next_offset >= end_offset {
9132 return Ok(());
9133 }
9134
9135 while _next_ordinal_to_read < 1 {
9137 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9138 _next_ordinal_to_read += 1;
9139 next_offset += envelope_size;
9140 }
9141
9142 let next_out_of_line = decoder.next_out_of_line();
9143 let handles_before = decoder.remaining_handles();
9144 if let Some((inlined, num_bytes, num_handles)) =
9145 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9146 {
9147 let member_inline_size =
9148 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
9149 decoder.context,
9150 );
9151 if inlined != (member_inline_size <= 4) {
9152 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9153 }
9154 let inner_offset;
9155 let mut inner_depth = depth.clone();
9156 if inlined {
9157 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9158 inner_offset = next_offset;
9159 } else {
9160 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9161 inner_depth.increment()?;
9162 }
9163 let val_ref = self
9164 .name
9165 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
9166 fidl::decode!(
9167 fidl::encoding::BoundedString<100>,
9168 D,
9169 val_ref,
9170 decoder,
9171 inner_offset,
9172 inner_depth
9173 )?;
9174 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9175 {
9176 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9177 }
9178 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9179 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9180 }
9181 }
9182
9183 next_offset += envelope_size;
9184 _next_ordinal_to_read += 1;
9185 if next_offset >= end_offset {
9186 return Ok(());
9187 }
9188
9189 while _next_ordinal_to_read < 2 {
9191 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9192 _next_ordinal_to_read += 1;
9193 next_offset += envelope_size;
9194 }
9195
9196 let next_out_of_line = decoder.next_out_of_line();
9197 let handles_before = decoder.remaining_handles();
9198 if let Some((inlined, num_bytes, num_handles)) =
9199 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9200 {
9201 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9202 if inlined != (member_inline_size <= 4) {
9203 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9204 }
9205 let inner_offset;
9206 let mut inner_depth = depth.clone();
9207 if inlined {
9208 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9209 inner_offset = next_offset;
9210 } else {
9211 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9212 inner_depth.increment()?;
9213 }
9214 let val_ref = self.source_path.get_or_insert_with(|| {
9215 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
9216 });
9217 fidl::decode!(
9218 fidl::encoding::BoundedString<1024>,
9219 D,
9220 val_ref,
9221 decoder,
9222 inner_offset,
9223 inner_depth
9224 )?;
9225 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9226 {
9227 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9228 }
9229 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9230 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9231 }
9232 }
9233
9234 next_offset += envelope_size;
9235 _next_ordinal_to_read += 1;
9236 if next_offset >= end_offset {
9237 return Ok(());
9238 }
9239
9240 while _next_ordinal_to_read < 3 {
9242 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9243 _next_ordinal_to_read += 1;
9244 next_offset += envelope_size;
9245 }
9246
9247 let next_out_of_line = decoder.next_out_of_line();
9248 let handles_before = decoder.remaining_handles();
9249 if let Some((inlined, num_bytes, num_handles)) =
9250 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9251 {
9252 let member_inline_size =
9253 <fidl_fuchsia_io::Operations as fidl::encoding::TypeMarker>::inline_size(
9254 decoder.context,
9255 );
9256 if inlined != (member_inline_size <= 4) {
9257 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9258 }
9259 let inner_offset;
9260 let mut inner_depth = depth.clone();
9261 if inlined {
9262 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9263 inner_offset = next_offset;
9264 } else {
9265 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9266 inner_depth.increment()?;
9267 }
9268 let val_ref = self
9269 .rights
9270 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_io::Operations, D));
9271 fidl::decode!(
9272 fidl_fuchsia_io::Operations,
9273 D,
9274 val_ref,
9275 decoder,
9276 inner_offset,
9277 inner_depth
9278 )?;
9279 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9280 {
9281 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9282 }
9283 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9284 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9285 }
9286 }
9287
9288 next_offset += envelope_size;
9289
9290 while next_offset < end_offset {
9292 _next_ordinal_to_read += 1;
9293 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9294 next_offset += envelope_size;
9295 }
9296
9297 Ok(())
9298 }
9299 }
9300
9301 impl Environment {
9302 #[inline(always)]
9303 fn max_ordinal_present(&self) -> u64 {
9304 if let Some(_) = self.stop_timeout_ms {
9305 return 6;
9306 }
9307 if let Some(_) = self.debug_capabilities {
9308 return 5;
9309 }
9310 if let Some(_) = self.resolvers {
9311 return 4;
9312 }
9313 if let Some(_) = self.runners {
9314 return 3;
9315 }
9316 if let Some(_) = self.extends {
9317 return 2;
9318 }
9319 if let Some(_) = self.name {
9320 return 1;
9321 }
9322 0
9323 }
9324 }
9325
9326 impl fidl::encoding::ValueTypeMarker for Environment {
9327 type Borrowed<'a> = &'a Self;
9328 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9329 value
9330 }
9331 }
9332
9333 unsafe impl fidl::encoding::TypeMarker for Environment {
9334 type Owned = Self;
9335
9336 #[inline(always)]
9337 fn inline_align(_context: fidl::encoding::Context) -> usize {
9338 8
9339 }
9340
9341 #[inline(always)]
9342 fn inline_size(_context: fidl::encoding::Context) -> usize {
9343 16
9344 }
9345 }
9346
9347 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Environment, D>
9348 for &Environment
9349 {
9350 unsafe fn encode(
9351 self,
9352 encoder: &mut fidl::encoding::Encoder<'_, D>,
9353 offset: usize,
9354 mut depth: fidl::encoding::Depth,
9355 ) -> fidl::Result<()> {
9356 encoder.debug_check_bounds::<Environment>(offset);
9357 let max_ordinal: u64 = self.max_ordinal_present();
9359 encoder.write_num(max_ordinal, offset);
9360 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9361 if max_ordinal == 0 {
9363 return Ok(());
9364 }
9365 depth.increment()?;
9366 let envelope_size = 8;
9367 let bytes_len = max_ordinal as usize * envelope_size;
9368 #[allow(unused_variables)]
9369 let offset = encoder.out_of_line_offset(bytes_len);
9370 let mut _prev_end_offset: usize = 0;
9371 if 1 > max_ordinal {
9372 return Ok(());
9373 }
9374
9375 let cur_offset: usize = (1 - 1) * envelope_size;
9378
9379 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9381
9382 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
9387 self.name.as_ref().map(
9388 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
9389 ),
9390 encoder,
9391 offset + cur_offset,
9392 depth,
9393 )?;
9394
9395 _prev_end_offset = cur_offset + envelope_size;
9396 if 2 > max_ordinal {
9397 return Ok(());
9398 }
9399
9400 let cur_offset: usize = (2 - 1) * envelope_size;
9403
9404 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9406
9407 fidl::encoding::encode_in_envelope_optional::<EnvironmentExtends, D>(
9412 self.extends
9413 .as_ref()
9414 .map(<EnvironmentExtends as fidl::encoding::ValueTypeMarker>::borrow),
9415 encoder,
9416 offset + cur_offset,
9417 depth,
9418 )?;
9419
9420 _prev_end_offset = cur_offset + envelope_size;
9421 if 3 > max_ordinal {
9422 return Ok(());
9423 }
9424
9425 let cur_offset: usize = (3 - 1) * envelope_size;
9428
9429 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9431
9432 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<RunnerRegistration>, D>(
9437 self.runners.as_ref().map(<fidl::encoding::UnboundedVector<RunnerRegistration> as fidl::encoding::ValueTypeMarker>::borrow),
9438 encoder, offset + cur_offset, depth
9439 )?;
9440
9441 _prev_end_offset = cur_offset + envelope_size;
9442 if 4 > max_ordinal {
9443 return Ok(());
9444 }
9445
9446 let cur_offset: usize = (4 - 1) * envelope_size;
9449
9450 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9452
9453 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ResolverRegistration>, D>(
9458 self.resolvers.as_ref().map(<fidl::encoding::UnboundedVector<ResolverRegistration> as fidl::encoding::ValueTypeMarker>::borrow),
9459 encoder, offset + cur_offset, depth
9460 )?;
9461
9462 _prev_end_offset = cur_offset + envelope_size;
9463 if 5 > max_ordinal {
9464 return Ok(());
9465 }
9466
9467 let cur_offset: usize = (5 - 1) * envelope_size;
9470
9471 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9473
9474 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<DebugRegistration>, D>(
9479 self.debug_capabilities.as_ref().map(<fidl::encoding::UnboundedVector<DebugRegistration> as fidl::encoding::ValueTypeMarker>::borrow),
9480 encoder, offset + cur_offset, depth
9481 )?;
9482
9483 _prev_end_offset = cur_offset + envelope_size;
9484 if 6 > max_ordinal {
9485 return Ok(());
9486 }
9487
9488 let cur_offset: usize = (6 - 1) * envelope_size;
9491
9492 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9494
9495 fidl::encoding::encode_in_envelope_optional::<u32, D>(
9500 self.stop_timeout_ms.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9501 encoder,
9502 offset + cur_offset,
9503 depth,
9504 )?;
9505
9506 _prev_end_offset = cur_offset + envelope_size;
9507
9508 Ok(())
9509 }
9510 }
9511
9512 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Environment {
9513 #[inline(always)]
9514 fn new_empty() -> Self {
9515 Self::default()
9516 }
9517
9518 unsafe fn decode(
9519 &mut self,
9520 decoder: &mut fidl::encoding::Decoder<'_, D>,
9521 offset: usize,
9522 mut depth: fidl::encoding::Depth,
9523 ) -> fidl::Result<()> {
9524 decoder.debug_check_bounds::<Self>(offset);
9525 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9526 None => return Err(fidl::Error::NotNullable),
9527 Some(len) => len,
9528 };
9529 if len == 0 {
9531 return Ok(());
9532 };
9533 depth.increment()?;
9534 let envelope_size = 8;
9535 let bytes_len = len * envelope_size;
9536 let offset = decoder.out_of_line_offset(bytes_len)?;
9537 let mut _next_ordinal_to_read = 0;
9539 let mut next_offset = offset;
9540 let end_offset = offset + bytes_len;
9541 _next_ordinal_to_read += 1;
9542 if next_offset >= end_offset {
9543 return Ok(());
9544 }
9545
9546 while _next_ordinal_to_read < 1 {
9548 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9549 _next_ordinal_to_read += 1;
9550 next_offset += envelope_size;
9551 }
9552
9553 let next_out_of_line = decoder.next_out_of_line();
9554 let handles_before = decoder.remaining_handles();
9555 if let Some((inlined, num_bytes, num_handles)) =
9556 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9557 {
9558 let member_inline_size =
9559 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
9560 decoder.context,
9561 );
9562 if inlined != (member_inline_size <= 4) {
9563 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9564 }
9565 let inner_offset;
9566 let mut inner_depth = depth.clone();
9567 if inlined {
9568 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9569 inner_offset = next_offset;
9570 } else {
9571 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9572 inner_depth.increment()?;
9573 }
9574 let val_ref = self
9575 .name
9576 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
9577 fidl::decode!(
9578 fidl::encoding::BoundedString<100>,
9579 D,
9580 val_ref,
9581 decoder,
9582 inner_offset,
9583 inner_depth
9584 )?;
9585 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9586 {
9587 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9588 }
9589 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9590 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9591 }
9592 }
9593
9594 next_offset += envelope_size;
9595 _next_ordinal_to_read += 1;
9596 if next_offset >= end_offset {
9597 return Ok(());
9598 }
9599
9600 while _next_ordinal_to_read < 2 {
9602 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9603 _next_ordinal_to_read += 1;
9604 next_offset += envelope_size;
9605 }
9606
9607 let next_out_of_line = decoder.next_out_of_line();
9608 let handles_before = decoder.remaining_handles();
9609 if let Some((inlined, num_bytes, num_handles)) =
9610 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9611 {
9612 let member_inline_size =
9613 <EnvironmentExtends as fidl::encoding::TypeMarker>::inline_size(
9614 decoder.context,
9615 );
9616 if inlined != (member_inline_size <= 4) {
9617 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9618 }
9619 let inner_offset;
9620 let mut inner_depth = depth.clone();
9621 if inlined {
9622 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9623 inner_offset = next_offset;
9624 } else {
9625 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9626 inner_depth.increment()?;
9627 }
9628 let val_ref =
9629 self.extends.get_or_insert_with(|| fidl::new_empty!(EnvironmentExtends, D));
9630 fidl::decode!(EnvironmentExtends, D, val_ref, decoder, inner_offset, inner_depth)?;
9631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9632 {
9633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9634 }
9635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9637 }
9638 }
9639
9640 next_offset += envelope_size;
9641 _next_ordinal_to_read += 1;
9642 if next_offset >= end_offset {
9643 return Ok(());
9644 }
9645
9646 while _next_ordinal_to_read < 3 {
9648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9649 _next_ordinal_to_read += 1;
9650 next_offset += envelope_size;
9651 }
9652
9653 let next_out_of_line = decoder.next_out_of_line();
9654 let handles_before = decoder.remaining_handles();
9655 if let Some((inlined, num_bytes, num_handles)) =
9656 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9657 {
9658 let member_inline_size = <fidl::encoding::UnboundedVector<RunnerRegistration> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9659 if inlined != (member_inline_size <= 4) {
9660 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9661 }
9662 let inner_offset;
9663 let mut inner_depth = depth.clone();
9664 if inlined {
9665 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9666 inner_offset = next_offset;
9667 } else {
9668 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9669 inner_depth.increment()?;
9670 }
9671 let val_ref = self.runners.get_or_insert_with(|| {
9672 fidl::new_empty!(fidl::encoding::UnboundedVector<RunnerRegistration>, D)
9673 });
9674 fidl::decode!(
9675 fidl::encoding::UnboundedVector<RunnerRegistration>,
9676 D,
9677 val_ref,
9678 decoder,
9679 inner_offset,
9680 inner_depth
9681 )?;
9682 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9683 {
9684 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9685 }
9686 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9687 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9688 }
9689 }
9690
9691 next_offset += envelope_size;
9692 _next_ordinal_to_read += 1;
9693 if next_offset >= end_offset {
9694 return Ok(());
9695 }
9696
9697 while _next_ordinal_to_read < 4 {
9699 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9700 _next_ordinal_to_read += 1;
9701 next_offset += envelope_size;
9702 }
9703
9704 let next_out_of_line = decoder.next_out_of_line();
9705 let handles_before = decoder.remaining_handles();
9706 if let Some((inlined, num_bytes, num_handles)) =
9707 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9708 {
9709 let member_inline_size = <fidl::encoding::UnboundedVector<ResolverRegistration> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9710 if inlined != (member_inline_size <= 4) {
9711 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9712 }
9713 let inner_offset;
9714 let mut inner_depth = depth.clone();
9715 if inlined {
9716 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9717 inner_offset = next_offset;
9718 } else {
9719 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9720 inner_depth.increment()?;
9721 }
9722 let val_ref = self.resolvers.get_or_insert_with(|| {
9723 fidl::new_empty!(fidl::encoding::UnboundedVector<ResolverRegistration>, D)
9724 });
9725 fidl::decode!(
9726 fidl::encoding::UnboundedVector<ResolverRegistration>,
9727 D,
9728 val_ref,
9729 decoder,
9730 inner_offset,
9731 inner_depth
9732 )?;
9733 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9734 {
9735 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9736 }
9737 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9738 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9739 }
9740 }
9741
9742 next_offset += envelope_size;
9743 _next_ordinal_to_read += 1;
9744 if next_offset >= end_offset {
9745 return Ok(());
9746 }
9747
9748 while _next_ordinal_to_read < 5 {
9750 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9751 _next_ordinal_to_read += 1;
9752 next_offset += envelope_size;
9753 }
9754
9755 let next_out_of_line = decoder.next_out_of_line();
9756 let handles_before = decoder.remaining_handles();
9757 if let Some((inlined, num_bytes, num_handles)) =
9758 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9759 {
9760 let member_inline_size = <fidl::encoding::UnboundedVector<DebugRegistration> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9761 if inlined != (member_inline_size <= 4) {
9762 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9763 }
9764 let inner_offset;
9765 let mut inner_depth = depth.clone();
9766 if inlined {
9767 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9768 inner_offset = next_offset;
9769 } else {
9770 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9771 inner_depth.increment()?;
9772 }
9773 let val_ref = self.debug_capabilities.get_or_insert_with(|| {
9774 fidl::new_empty!(fidl::encoding::UnboundedVector<DebugRegistration>, D)
9775 });
9776 fidl::decode!(
9777 fidl::encoding::UnboundedVector<DebugRegistration>,
9778 D,
9779 val_ref,
9780 decoder,
9781 inner_offset,
9782 inner_depth
9783 )?;
9784 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9785 {
9786 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9787 }
9788 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9789 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9790 }
9791 }
9792
9793 next_offset += envelope_size;
9794 _next_ordinal_to_read += 1;
9795 if next_offset >= end_offset {
9796 return Ok(());
9797 }
9798
9799 while _next_ordinal_to_read < 6 {
9801 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9802 _next_ordinal_to_read += 1;
9803 next_offset += envelope_size;
9804 }
9805
9806 let next_out_of_line = decoder.next_out_of_line();
9807 let handles_before = decoder.remaining_handles();
9808 if let Some((inlined, num_bytes, num_handles)) =
9809 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9810 {
9811 let member_inline_size =
9812 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9813 if inlined != (member_inline_size <= 4) {
9814 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9815 }
9816 let inner_offset;
9817 let mut inner_depth = depth.clone();
9818 if inlined {
9819 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9820 inner_offset = next_offset;
9821 } else {
9822 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9823 inner_depth.increment()?;
9824 }
9825 let val_ref = self.stop_timeout_ms.get_or_insert_with(|| fidl::new_empty!(u32, D));
9826 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9827 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9828 {
9829 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9830 }
9831 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9832 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9833 }
9834 }
9835
9836 next_offset += envelope_size;
9837
9838 while next_offset < end_offset {
9840 _next_ordinal_to_read += 1;
9841 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9842 next_offset += envelope_size;
9843 }
9844
9845 Ok(())
9846 }
9847 }
9848
9849 impl EventStream {
9850 #[inline(always)]
9851 fn max_ordinal_present(&self) -> u64 {
9852 if let Some(_) = self.name {
9853 return 1;
9854 }
9855 0
9856 }
9857 }
9858
9859 impl fidl::encoding::ValueTypeMarker for EventStream {
9860 type Borrowed<'a> = &'a Self;
9861 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9862 value
9863 }
9864 }
9865
9866 unsafe impl fidl::encoding::TypeMarker for EventStream {
9867 type Owned = Self;
9868
9869 #[inline(always)]
9870 fn inline_align(_context: fidl::encoding::Context) -> usize {
9871 8
9872 }
9873
9874 #[inline(always)]
9875 fn inline_size(_context: fidl::encoding::Context) -> usize {
9876 16
9877 }
9878 }
9879
9880 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventStream, D>
9881 for &EventStream
9882 {
9883 unsafe fn encode(
9884 self,
9885 encoder: &mut fidl::encoding::Encoder<'_, D>,
9886 offset: usize,
9887 mut depth: fidl::encoding::Depth,
9888 ) -> fidl::Result<()> {
9889 encoder.debug_check_bounds::<EventStream>(offset);
9890 let max_ordinal: u64 = self.max_ordinal_present();
9892 encoder.write_num(max_ordinal, offset);
9893 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9894 if max_ordinal == 0 {
9896 return Ok(());
9897 }
9898 depth.increment()?;
9899 let envelope_size = 8;
9900 let bytes_len = max_ordinal as usize * envelope_size;
9901 #[allow(unused_variables)]
9902 let offset = encoder.out_of_line_offset(bytes_len);
9903 let mut _prev_end_offset: usize = 0;
9904 if 1 > max_ordinal {
9905 return Ok(());
9906 }
9907
9908 let cur_offset: usize = (1 - 1) * envelope_size;
9911
9912 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9914
9915 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
9920 self.name.as_ref().map(
9921 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
9922 ),
9923 encoder,
9924 offset + cur_offset,
9925 depth,
9926 )?;
9927
9928 _prev_end_offset = cur_offset + envelope_size;
9929
9930 Ok(())
9931 }
9932 }
9933
9934 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventStream {
9935 #[inline(always)]
9936 fn new_empty() -> Self {
9937 Self::default()
9938 }
9939
9940 unsafe fn decode(
9941 &mut self,
9942 decoder: &mut fidl::encoding::Decoder<'_, D>,
9943 offset: usize,
9944 mut depth: fidl::encoding::Depth,
9945 ) -> fidl::Result<()> {
9946 decoder.debug_check_bounds::<Self>(offset);
9947 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9948 None => return Err(fidl::Error::NotNullable),
9949 Some(len) => len,
9950 };
9951 if len == 0 {
9953 return Ok(());
9954 };
9955 depth.increment()?;
9956 let envelope_size = 8;
9957 let bytes_len = len * envelope_size;
9958 let offset = decoder.out_of_line_offset(bytes_len)?;
9959 let mut _next_ordinal_to_read = 0;
9961 let mut next_offset = offset;
9962 let end_offset = offset + bytes_len;
9963 _next_ordinal_to_read += 1;
9964 if next_offset >= end_offset {
9965 return Ok(());
9966 }
9967
9968 while _next_ordinal_to_read < 1 {
9970 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9971 _next_ordinal_to_read += 1;
9972 next_offset += envelope_size;
9973 }
9974
9975 let next_out_of_line = decoder.next_out_of_line();
9976 let handles_before = decoder.remaining_handles();
9977 if let Some((inlined, num_bytes, num_handles)) =
9978 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9979 {
9980 let member_inline_size =
9981 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
9982 decoder.context,
9983 );
9984 if inlined != (member_inline_size <= 4) {
9985 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9986 }
9987 let inner_offset;
9988 let mut inner_depth = depth.clone();
9989 if inlined {
9990 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9991 inner_offset = next_offset;
9992 } else {
9993 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9994 inner_depth.increment()?;
9995 }
9996 let val_ref = self
9997 .name
9998 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
9999 fidl::decode!(
10000 fidl::encoding::BoundedString<100>,
10001 D,
10002 val_ref,
10003 decoder,
10004 inner_offset,
10005 inner_depth
10006 )?;
10007 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10008 {
10009 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10010 }
10011 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10012 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10013 }
10014 }
10015
10016 next_offset += envelope_size;
10017
10018 while next_offset < end_offset {
10020 _next_ordinal_to_read += 1;
10021 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10022 next_offset += envelope_size;
10023 }
10024
10025 Ok(())
10026 }
10027 }
10028
10029 impl EventSubscription {
10030 #[inline(always)]
10031 fn max_ordinal_present(&self) -> u64 {
10032 if let Some(_) = self.event_name {
10033 return 1;
10034 }
10035 0
10036 }
10037 }
10038
10039 impl fidl::encoding::ValueTypeMarker for EventSubscription {
10040 type Borrowed<'a> = &'a Self;
10041 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10042 value
10043 }
10044 }
10045
10046 unsafe impl fidl::encoding::TypeMarker for EventSubscription {
10047 type Owned = Self;
10048
10049 #[inline(always)]
10050 fn inline_align(_context: fidl::encoding::Context) -> usize {
10051 8
10052 }
10053
10054 #[inline(always)]
10055 fn inline_size(_context: fidl::encoding::Context) -> usize {
10056 16
10057 }
10058 }
10059
10060 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventSubscription, D>
10061 for &EventSubscription
10062 {
10063 unsafe fn encode(
10064 self,
10065 encoder: &mut fidl::encoding::Encoder<'_, D>,
10066 offset: usize,
10067 mut depth: fidl::encoding::Depth,
10068 ) -> fidl::Result<()> {
10069 encoder.debug_check_bounds::<EventSubscription>(offset);
10070 let max_ordinal: u64 = self.max_ordinal_present();
10072 encoder.write_num(max_ordinal, offset);
10073 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10074 if max_ordinal == 0 {
10076 return Ok(());
10077 }
10078 depth.increment()?;
10079 let envelope_size = 8;
10080 let bytes_len = max_ordinal as usize * envelope_size;
10081 #[allow(unused_variables)]
10082 let offset = encoder.out_of_line_offset(bytes_len);
10083 let mut _prev_end_offset: usize = 0;
10084 if 1 > max_ordinal {
10085 return Ok(());
10086 }
10087
10088 let cur_offset: usize = (1 - 1) * envelope_size;
10091
10092 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10094
10095 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
10100 self.event_name.as_ref().map(
10101 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
10102 ),
10103 encoder,
10104 offset + cur_offset,
10105 depth,
10106 )?;
10107
10108 _prev_end_offset = cur_offset + envelope_size;
10109
10110 Ok(())
10111 }
10112 }
10113
10114 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventSubscription {
10115 #[inline(always)]
10116 fn new_empty() -> Self {
10117 Self::default()
10118 }
10119
10120 unsafe fn decode(
10121 &mut self,
10122 decoder: &mut fidl::encoding::Decoder<'_, D>,
10123 offset: usize,
10124 mut depth: fidl::encoding::Depth,
10125 ) -> fidl::Result<()> {
10126 decoder.debug_check_bounds::<Self>(offset);
10127 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10128 None => return Err(fidl::Error::NotNullable),
10129 Some(len) => len,
10130 };
10131 if len == 0 {
10133 return Ok(());
10134 };
10135 depth.increment()?;
10136 let envelope_size = 8;
10137 let bytes_len = len * envelope_size;
10138 let offset = decoder.out_of_line_offset(bytes_len)?;
10139 let mut _next_ordinal_to_read = 0;
10141 let mut next_offset = offset;
10142 let end_offset = offset + bytes_len;
10143 _next_ordinal_to_read += 1;
10144 if next_offset >= end_offset {
10145 return Ok(());
10146 }
10147
10148 while _next_ordinal_to_read < 1 {
10150 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10151 _next_ordinal_to_read += 1;
10152 next_offset += envelope_size;
10153 }
10154
10155 let next_out_of_line = decoder.next_out_of_line();
10156 let handles_before = decoder.remaining_handles();
10157 if let Some((inlined, num_bytes, num_handles)) =
10158 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10159 {
10160 let member_inline_size =
10161 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
10162 decoder.context,
10163 );
10164 if inlined != (member_inline_size <= 4) {
10165 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10166 }
10167 let inner_offset;
10168 let mut inner_depth = depth.clone();
10169 if inlined {
10170 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10171 inner_offset = next_offset;
10172 } else {
10173 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10174 inner_depth.increment()?;
10175 }
10176 let val_ref = self
10177 .event_name
10178 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
10179 fidl::decode!(
10180 fidl::encoding::BoundedString<100>,
10181 D,
10182 val_ref,
10183 decoder,
10184 inner_offset,
10185 inner_depth
10186 )?;
10187 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10188 {
10189 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10190 }
10191 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10192 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10193 }
10194 }
10195
10196 next_offset += envelope_size;
10197
10198 while next_offset < end_offset {
10200 _next_ordinal_to_read += 1;
10201 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10202 next_offset += envelope_size;
10203 }
10204
10205 Ok(())
10206 }
10207 }
10208
10209 impl ExposeConfiguration {
10210 #[inline(always)]
10211 fn max_ordinal_present(&self) -> u64 {
10212 if let Some(_) = self.source_dictionary {
10213 return 6;
10214 }
10215 if let Some(_) = self.availability {
10216 return 5;
10217 }
10218 if let Some(_) = self.target_name {
10219 return 4;
10220 }
10221 if let Some(_) = self.target {
10222 return 3;
10223 }
10224 if let Some(_) = self.source_name {
10225 return 2;
10226 }
10227 if let Some(_) = self.source {
10228 return 1;
10229 }
10230 0
10231 }
10232 }
10233
10234 impl fidl::encoding::ValueTypeMarker for ExposeConfiguration {
10235 type Borrowed<'a> = &'a Self;
10236 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10237 value
10238 }
10239 }
10240
10241 unsafe impl fidl::encoding::TypeMarker for ExposeConfiguration {
10242 type Owned = Self;
10243
10244 #[inline(always)]
10245 fn inline_align(_context: fidl::encoding::Context) -> usize {
10246 8
10247 }
10248
10249 #[inline(always)]
10250 fn inline_size(_context: fidl::encoding::Context) -> usize {
10251 16
10252 }
10253 }
10254
10255 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeConfiguration, D>
10256 for &ExposeConfiguration
10257 {
10258 unsafe fn encode(
10259 self,
10260 encoder: &mut fidl::encoding::Encoder<'_, D>,
10261 offset: usize,
10262 mut depth: fidl::encoding::Depth,
10263 ) -> fidl::Result<()> {
10264 encoder.debug_check_bounds::<ExposeConfiguration>(offset);
10265 let max_ordinal: u64 = self.max_ordinal_present();
10267 encoder.write_num(max_ordinal, offset);
10268 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10269 if max_ordinal == 0 {
10271 return Ok(());
10272 }
10273 depth.increment()?;
10274 let envelope_size = 8;
10275 let bytes_len = max_ordinal as usize * envelope_size;
10276 #[allow(unused_variables)]
10277 let offset = encoder.out_of_line_offset(bytes_len);
10278 let mut _prev_end_offset: usize = 0;
10279 if 1 > max_ordinal {
10280 return Ok(());
10281 }
10282
10283 let cur_offset: usize = (1 - 1) * envelope_size;
10286
10287 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10289
10290 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
10295 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
10296 encoder,
10297 offset + cur_offset,
10298 depth,
10299 )?;
10300
10301 _prev_end_offset = cur_offset + envelope_size;
10302 if 2 > max_ordinal {
10303 return Ok(());
10304 }
10305
10306 let cur_offset: usize = (2 - 1) * envelope_size;
10309
10310 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10312
10313 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
10318 self.source_name.as_ref().map(
10319 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
10320 ),
10321 encoder,
10322 offset + cur_offset,
10323 depth,
10324 )?;
10325
10326 _prev_end_offset = cur_offset + envelope_size;
10327 if 3 > max_ordinal {
10328 return Ok(());
10329 }
10330
10331 let cur_offset: usize = (3 - 1) * envelope_size;
10334
10335 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10337
10338 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
10343 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
10344 encoder,
10345 offset + cur_offset,
10346 depth,
10347 )?;
10348
10349 _prev_end_offset = cur_offset + envelope_size;
10350 if 4 > max_ordinal {
10351 return Ok(());
10352 }
10353
10354 let cur_offset: usize = (4 - 1) * envelope_size;
10357
10358 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10360
10361 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
10366 self.target_name.as_ref().map(
10367 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
10368 ),
10369 encoder,
10370 offset + cur_offset,
10371 depth,
10372 )?;
10373
10374 _prev_end_offset = cur_offset + envelope_size;
10375 if 5 > max_ordinal {
10376 return Ok(());
10377 }
10378
10379 let cur_offset: usize = (5 - 1) * envelope_size;
10382
10383 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10385
10386 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
10391 self.availability
10392 .as_ref()
10393 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
10394 encoder,
10395 offset + cur_offset,
10396 depth,
10397 )?;
10398
10399 _prev_end_offset = cur_offset + envelope_size;
10400 if 6 > max_ordinal {
10401 return Ok(());
10402 }
10403
10404 let cur_offset: usize = (6 - 1) * envelope_size;
10407
10408 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10410
10411 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
10416 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
10417 encoder, offset + cur_offset, depth
10418 )?;
10419
10420 _prev_end_offset = cur_offset + envelope_size;
10421
10422 Ok(())
10423 }
10424 }
10425
10426 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeConfiguration {
10427 #[inline(always)]
10428 fn new_empty() -> Self {
10429 Self::default()
10430 }
10431
10432 unsafe fn decode(
10433 &mut self,
10434 decoder: &mut fidl::encoding::Decoder<'_, D>,
10435 offset: usize,
10436 mut depth: fidl::encoding::Depth,
10437 ) -> fidl::Result<()> {
10438 decoder.debug_check_bounds::<Self>(offset);
10439 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10440 None => return Err(fidl::Error::NotNullable),
10441 Some(len) => len,
10442 };
10443 if len == 0 {
10445 return Ok(());
10446 };
10447 depth.increment()?;
10448 let envelope_size = 8;
10449 let bytes_len = len * envelope_size;
10450 let offset = decoder.out_of_line_offset(bytes_len)?;
10451 let mut _next_ordinal_to_read = 0;
10453 let mut next_offset = offset;
10454 let end_offset = offset + bytes_len;
10455 _next_ordinal_to_read += 1;
10456 if next_offset >= end_offset {
10457 return Ok(());
10458 }
10459
10460 while _next_ordinal_to_read < 1 {
10462 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10463 _next_ordinal_to_read += 1;
10464 next_offset += envelope_size;
10465 }
10466
10467 let next_out_of_line = decoder.next_out_of_line();
10468 let handles_before = decoder.remaining_handles();
10469 if let Some((inlined, num_bytes, num_handles)) =
10470 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10471 {
10472 let member_inline_size =
10473 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10474 if inlined != (member_inline_size <= 4) {
10475 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10476 }
10477 let inner_offset;
10478 let mut inner_depth = depth.clone();
10479 if inlined {
10480 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10481 inner_offset = next_offset;
10482 } else {
10483 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10484 inner_depth.increment()?;
10485 }
10486 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
10487 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
10488 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10489 {
10490 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10491 }
10492 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10493 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10494 }
10495 }
10496
10497 next_offset += envelope_size;
10498 _next_ordinal_to_read += 1;
10499 if next_offset >= end_offset {
10500 return Ok(());
10501 }
10502
10503 while _next_ordinal_to_read < 2 {
10505 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10506 _next_ordinal_to_read += 1;
10507 next_offset += envelope_size;
10508 }
10509
10510 let next_out_of_line = decoder.next_out_of_line();
10511 let handles_before = decoder.remaining_handles();
10512 if let Some((inlined, num_bytes, num_handles)) =
10513 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10514 {
10515 let member_inline_size =
10516 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
10517 decoder.context,
10518 );
10519 if inlined != (member_inline_size <= 4) {
10520 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10521 }
10522 let inner_offset;
10523 let mut inner_depth = depth.clone();
10524 if inlined {
10525 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10526 inner_offset = next_offset;
10527 } else {
10528 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10529 inner_depth.increment()?;
10530 }
10531 let val_ref = self
10532 .source_name
10533 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
10534 fidl::decode!(
10535 fidl::encoding::BoundedString<100>,
10536 D,
10537 val_ref,
10538 decoder,
10539 inner_offset,
10540 inner_depth
10541 )?;
10542 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10543 {
10544 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10545 }
10546 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10547 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10548 }
10549 }
10550
10551 next_offset += envelope_size;
10552 _next_ordinal_to_read += 1;
10553 if next_offset >= end_offset {
10554 return Ok(());
10555 }
10556
10557 while _next_ordinal_to_read < 3 {
10559 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10560 _next_ordinal_to_read += 1;
10561 next_offset += envelope_size;
10562 }
10563
10564 let next_out_of_line = decoder.next_out_of_line();
10565 let handles_before = decoder.remaining_handles();
10566 if let Some((inlined, num_bytes, num_handles)) =
10567 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10568 {
10569 let member_inline_size =
10570 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10571 if inlined != (member_inline_size <= 4) {
10572 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10573 }
10574 let inner_offset;
10575 let mut inner_depth = depth.clone();
10576 if inlined {
10577 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10578 inner_offset = next_offset;
10579 } else {
10580 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10581 inner_depth.increment()?;
10582 }
10583 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
10584 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
10585 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10586 {
10587 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10588 }
10589 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10590 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10591 }
10592 }
10593
10594 next_offset += envelope_size;
10595 _next_ordinal_to_read += 1;
10596 if next_offset >= end_offset {
10597 return Ok(());
10598 }
10599
10600 while _next_ordinal_to_read < 4 {
10602 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10603 _next_ordinal_to_read += 1;
10604 next_offset += envelope_size;
10605 }
10606
10607 let next_out_of_line = decoder.next_out_of_line();
10608 let handles_before = decoder.remaining_handles();
10609 if let Some((inlined, num_bytes, num_handles)) =
10610 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10611 {
10612 let member_inline_size =
10613 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
10614 decoder.context,
10615 );
10616 if inlined != (member_inline_size <= 4) {
10617 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10618 }
10619 let inner_offset;
10620 let mut inner_depth = depth.clone();
10621 if inlined {
10622 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10623 inner_offset = next_offset;
10624 } else {
10625 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10626 inner_depth.increment()?;
10627 }
10628 let val_ref = self
10629 .target_name
10630 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
10631 fidl::decode!(
10632 fidl::encoding::BoundedString<100>,
10633 D,
10634 val_ref,
10635 decoder,
10636 inner_offset,
10637 inner_depth
10638 )?;
10639 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10640 {
10641 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10642 }
10643 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10644 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10645 }
10646 }
10647
10648 next_offset += envelope_size;
10649 _next_ordinal_to_read += 1;
10650 if next_offset >= end_offset {
10651 return Ok(());
10652 }
10653
10654 while _next_ordinal_to_read < 5 {
10656 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10657 _next_ordinal_to_read += 1;
10658 next_offset += envelope_size;
10659 }
10660
10661 let next_out_of_line = decoder.next_out_of_line();
10662 let handles_before = decoder.remaining_handles();
10663 if let Some((inlined, num_bytes, num_handles)) =
10664 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10665 {
10666 let member_inline_size =
10667 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10668 if inlined != (member_inline_size <= 4) {
10669 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10670 }
10671 let inner_offset;
10672 let mut inner_depth = depth.clone();
10673 if inlined {
10674 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10675 inner_offset = next_offset;
10676 } else {
10677 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10678 inner_depth.increment()?;
10679 }
10680 let val_ref =
10681 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
10682 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
10683 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10684 {
10685 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10686 }
10687 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10688 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10689 }
10690 }
10691
10692 next_offset += envelope_size;
10693 _next_ordinal_to_read += 1;
10694 if next_offset >= end_offset {
10695 return Ok(());
10696 }
10697
10698 while _next_ordinal_to_read < 6 {
10700 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10701 _next_ordinal_to_read += 1;
10702 next_offset += envelope_size;
10703 }
10704
10705 let next_out_of_line = decoder.next_out_of_line();
10706 let handles_before = decoder.remaining_handles();
10707 if let Some((inlined, num_bytes, num_handles)) =
10708 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10709 {
10710 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10711 if inlined != (member_inline_size <= 4) {
10712 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10713 }
10714 let inner_offset;
10715 let mut inner_depth = depth.clone();
10716 if inlined {
10717 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10718 inner_offset = next_offset;
10719 } else {
10720 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10721 inner_depth.increment()?;
10722 }
10723 let val_ref = self.source_dictionary.get_or_insert_with(|| {
10724 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
10725 });
10726 fidl::decode!(
10727 fidl::encoding::BoundedString<1024>,
10728 D,
10729 val_ref,
10730 decoder,
10731 inner_offset,
10732 inner_depth
10733 )?;
10734 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10735 {
10736 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10737 }
10738 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10739 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10740 }
10741 }
10742
10743 next_offset += envelope_size;
10744
10745 while next_offset < end_offset {
10747 _next_ordinal_to_read += 1;
10748 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10749 next_offset += envelope_size;
10750 }
10751
10752 Ok(())
10753 }
10754 }
10755
10756 impl ExposeDictionary {
10757 #[inline(always)]
10758 fn max_ordinal_present(&self) -> u64 {
10759 if let Some(_) = self.source_dictionary {
10760 return 6;
10761 }
10762 if let Some(_) = self.availability {
10763 return 5;
10764 }
10765 if let Some(_) = self.target_name {
10766 return 4;
10767 }
10768 if let Some(_) = self.target {
10769 return 3;
10770 }
10771 if let Some(_) = self.source_name {
10772 return 2;
10773 }
10774 if let Some(_) = self.source {
10775 return 1;
10776 }
10777 0
10778 }
10779 }
10780
10781 impl fidl::encoding::ValueTypeMarker for ExposeDictionary {
10782 type Borrowed<'a> = &'a Self;
10783 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10784 value
10785 }
10786 }
10787
10788 unsafe impl fidl::encoding::TypeMarker for ExposeDictionary {
10789 type Owned = Self;
10790
10791 #[inline(always)]
10792 fn inline_align(_context: fidl::encoding::Context) -> usize {
10793 8
10794 }
10795
10796 #[inline(always)]
10797 fn inline_size(_context: fidl::encoding::Context) -> usize {
10798 16
10799 }
10800 }
10801
10802 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeDictionary, D>
10803 for &ExposeDictionary
10804 {
10805 unsafe fn encode(
10806 self,
10807 encoder: &mut fidl::encoding::Encoder<'_, D>,
10808 offset: usize,
10809 mut depth: fidl::encoding::Depth,
10810 ) -> fidl::Result<()> {
10811 encoder.debug_check_bounds::<ExposeDictionary>(offset);
10812 let max_ordinal: u64 = self.max_ordinal_present();
10814 encoder.write_num(max_ordinal, offset);
10815 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10816 if max_ordinal == 0 {
10818 return Ok(());
10819 }
10820 depth.increment()?;
10821 let envelope_size = 8;
10822 let bytes_len = max_ordinal as usize * envelope_size;
10823 #[allow(unused_variables)]
10824 let offset = encoder.out_of_line_offset(bytes_len);
10825 let mut _prev_end_offset: usize = 0;
10826 if 1 > max_ordinal {
10827 return Ok(());
10828 }
10829
10830 let cur_offset: usize = (1 - 1) * envelope_size;
10833
10834 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10836
10837 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
10842 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
10843 encoder,
10844 offset + cur_offset,
10845 depth,
10846 )?;
10847
10848 _prev_end_offset = cur_offset + envelope_size;
10849 if 2 > max_ordinal {
10850 return Ok(());
10851 }
10852
10853 let cur_offset: usize = (2 - 1) * envelope_size;
10856
10857 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10859
10860 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
10865 self.source_name.as_ref().map(
10866 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
10867 ),
10868 encoder,
10869 offset + cur_offset,
10870 depth,
10871 )?;
10872
10873 _prev_end_offset = cur_offset + envelope_size;
10874 if 3 > max_ordinal {
10875 return Ok(());
10876 }
10877
10878 let cur_offset: usize = (3 - 1) * envelope_size;
10881
10882 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10884
10885 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
10890 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
10891 encoder,
10892 offset + cur_offset,
10893 depth,
10894 )?;
10895
10896 _prev_end_offset = cur_offset + envelope_size;
10897 if 4 > max_ordinal {
10898 return Ok(());
10899 }
10900
10901 let cur_offset: usize = (4 - 1) * envelope_size;
10904
10905 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10907
10908 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
10913 self.target_name.as_ref().map(
10914 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
10915 ),
10916 encoder,
10917 offset + cur_offset,
10918 depth,
10919 )?;
10920
10921 _prev_end_offset = cur_offset + envelope_size;
10922 if 5 > max_ordinal {
10923 return Ok(());
10924 }
10925
10926 let cur_offset: usize = (5 - 1) * envelope_size;
10929
10930 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10932
10933 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
10938 self.availability
10939 .as_ref()
10940 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
10941 encoder,
10942 offset + cur_offset,
10943 depth,
10944 )?;
10945
10946 _prev_end_offset = cur_offset + envelope_size;
10947 if 6 > max_ordinal {
10948 return Ok(());
10949 }
10950
10951 let cur_offset: usize = (6 - 1) * envelope_size;
10954
10955 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10957
10958 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
10963 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
10964 encoder, offset + cur_offset, depth
10965 )?;
10966
10967 _prev_end_offset = cur_offset + envelope_size;
10968
10969 Ok(())
10970 }
10971 }
10972
10973 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeDictionary {
10974 #[inline(always)]
10975 fn new_empty() -> Self {
10976 Self::default()
10977 }
10978
10979 unsafe fn decode(
10980 &mut self,
10981 decoder: &mut fidl::encoding::Decoder<'_, D>,
10982 offset: usize,
10983 mut depth: fidl::encoding::Depth,
10984 ) -> fidl::Result<()> {
10985 decoder.debug_check_bounds::<Self>(offset);
10986 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10987 None => return Err(fidl::Error::NotNullable),
10988 Some(len) => len,
10989 };
10990 if len == 0 {
10992 return Ok(());
10993 };
10994 depth.increment()?;
10995 let envelope_size = 8;
10996 let bytes_len = len * envelope_size;
10997 let offset = decoder.out_of_line_offset(bytes_len)?;
10998 let mut _next_ordinal_to_read = 0;
11000 let mut next_offset = offset;
11001 let end_offset = offset + bytes_len;
11002 _next_ordinal_to_read += 1;
11003 if next_offset >= end_offset {
11004 return Ok(());
11005 }
11006
11007 while _next_ordinal_to_read < 1 {
11009 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11010 _next_ordinal_to_read += 1;
11011 next_offset += envelope_size;
11012 }
11013
11014 let next_out_of_line = decoder.next_out_of_line();
11015 let handles_before = decoder.remaining_handles();
11016 if let Some((inlined, num_bytes, num_handles)) =
11017 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11018 {
11019 let member_inline_size =
11020 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11021 if inlined != (member_inline_size <= 4) {
11022 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11023 }
11024 let inner_offset;
11025 let mut inner_depth = depth.clone();
11026 if inlined {
11027 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11028 inner_offset = next_offset;
11029 } else {
11030 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11031 inner_depth.increment()?;
11032 }
11033 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
11034 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
11035 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11036 {
11037 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11038 }
11039 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11040 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11041 }
11042 }
11043
11044 next_offset += envelope_size;
11045 _next_ordinal_to_read += 1;
11046 if next_offset >= end_offset {
11047 return Ok(());
11048 }
11049
11050 while _next_ordinal_to_read < 2 {
11052 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11053 _next_ordinal_to_read += 1;
11054 next_offset += envelope_size;
11055 }
11056
11057 let next_out_of_line = decoder.next_out_of_line();
11058 let handles_before = decoder.remaining_handles();
11059 if let Some((inlined, num_bytes, num_handles)) =
11060 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11061 {
11062 let member_inline_size =
11063 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11064 decoder.context,
11065 );
11066 if inlined != (member_inline_size <= 4) {
11067 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11068 }
11069 let inner_offset;
11070 let mut inner_depth = depth.clone();
11071 if inlined {
11072 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11073 inner_offset = next_offset;
11074 } else {
11075 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11076 inner_depth.increment()?;
11077 }
11078 let val_ref = self
11079 .source_name
11080 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
11081 fidl::decode!(
11082 fidl::encoding::BoundedString<100>,
11083 D,
11084 val_ref,
11085 decoder,
11086 inner_offset,
11087 inner_depth
11088 )?;
11089 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11090 {
11091 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11092 }
11093 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11094 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11095 }
11096 }
11097
11098 next_offset += envelope_size;
11099 _next_ordinal_to_read += 1;
11100 if next_offset >= end_offset {
11101 return Ok(());
11102 }
11103
11104 while _next_ordinal_to_read < 3 {
11106 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11107 _next_ordinal_to_read += 1;
11108 next_offset += envelope_size;
11109 }
11110
11111 let next_out_of_line = decoder.next_out_of_line();
11112 let handles_before = decoder.remaining_handles();
11113 if let Some((inlined, num_bytes, num_handles)) =
11114 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11115 {
11116 let member_inline_size =
11117 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11118 if inlined != (member_inline_size <= 4) {
11119 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11120 }
11121 let inner_offset;
11122 let mut inner_depth = depth.clone();
11123 if inlined {
11124 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11125 inner_offset = next_offset;
11126 } else {
11127 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11128 inner_depth.increment()?;
11129 }
11130 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
11131 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
11132 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11133 {
11134 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11135 }
11136 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11137 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11138 }
11139 }
11140
11141 next_offset += envelope_size;
11142 _next_ordinal_to_read += 1;
11143 if next_offset >= end_offset {
11144 return Ok(());
11145 }
11146
11147 while _next_ordinal_to_read < 4 {
11149 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11150 _next_ordinal_to_read += 1;
11151 next_offset += envelope_size;
11152 }
11153
11154 let next_out_of_line = decoder.next_out_of_line();
11155 let handles_before = decoder.remaining_handles();
11156 if let Some((inlined, num_bytes, num_handles)) =
11157 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11158 {
11159 let member_inline_size =
11160 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11161 decoder.context,
11162 );
11163 if inlined != (member_inline_size <= 4) {
11164 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11165 }
11166 let inner_offset;
11167 let mut inner_depth = depth.clone();
11168 if inlined {
11169 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11170 inner_offset = next_offset;
11171 } else {
11172 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11173 inner_depth.increment()?;
11174 }
11175 let val_ref = self
11176 .target_name
11177 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
11178 fidl::decode!(
11179 fidl::encoding::BoundedString<100>,
11180 D,
11181 val_ref,
11182 decoder,
11183 inner_offset,
11184 inner_depth
11185 )?;
11186 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11187 {
11188 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11189 }
11190 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11191 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11192 }
11193 }
11194
11195 next_offset += envelope_size;
11196 _next_ordinal_to_read += 1;
11197 if next_offset >= end_offset {
11198 return Ok(());
11199 }
11200
11201 while _next_ordinal_to_read < 5 {
11203 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11204 _next_ordinal_to_read += 1;
11205 next_offset += envelope_size;
11206 }
11207
11208 let next_out_of_line = decoder.next_out_of_line();
11209 let handles_before = decoder.remaining_handles();
11210 if let Some((inlined, num_bytes, num_handles)) =
11211 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11212 {
11213 let member_inline_size =
11214 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11215 if inlined != (member_inline_size <= 4) {
11216 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11217 }
11218 let inner_offset;
11219 let mut inner_depth = depth.clone();
11220 if inlined {
11221 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11222 inner_offset = next_offset;
11223 } else {
11224 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11225 inner_depth.increment()?;
11226 }
11227 let val_ref =
11228 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
11229 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
11230 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11231 {
11232 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11233 }
11234 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11235 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11236 }
11237 }
11238
11239 next_offset += envelope_size;
11240 _next_ordinal_to_read += 1;
11241 if next_offset >= end_offset {
11242 return Ok(());
11243 }
11244
11245 while _next_ordinal_to_read < 6 {
11247 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11248 _next_ordinal_to_read += 1;
11249 next_offset += envelope_size;
11250 }
11251
11252 let next_out_of_line = decoder.next_out_of_line();
11253 let handles_before = decoder.remaining_handles();
11254 if let Some((inlined, num_bytes, num_handles)) =
11255 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11256 {
11257 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11258 if inlined != (member_inline_size <= 4) {
11259 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11260 }
11261 let inner_offset;
11262 let mut inner_depth = depth.clone();
11263 if inlined {
11264 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11265 inner_offset = next_offset;
11266 } else {
11267 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11268 inner_depth.increment()?;
11269 }
11270 let val_ref = self.source_dictionary.get_or_insert_with(|| {
11271 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
11272 });
11273 fidl::decode!(
11274 fidl::encoding::BoundedString<1024>,
11275 D,
11276 val_ref,
11277 decoder,
11278 inner_offset,
11279 inner_depth
11280 )?;
11281 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11282 {
11283 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11284 }
11285 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11286 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11287 }
11288 }
11289
11290 next_offset += envelope_size;
11291
11292 while next_offset < end_offset {
11294 _next_ordinal_to_read += 1;
11295 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11296 next_offset += envelope_size;
11297 }
11298
11299 Ok(())
11300 }
11301 }
11302
11303 impl ExposeDirectory {
11304 #[inline(always)]
11305 fn max_ordinal_present(&self) -> u64 {
11306 if let Some(_) = self.source_dictionary {
11307 return 8;
11308 }
11309 if let Some(_) = self.availability {
11310 return 7;
11311 }
11312 if let Some(_) = self.subdir {
11313 return 6;
11314 }
11315 if let Some(_) = self.rights {
11316 return 5;
11317 }
11318 if let Some(_) = self.target_name {
11319 return 4;
11320 }
11321 if let Some(_) = self.target {
11322 return 3;
11323 }
11324 if let Some(_) = self.source_name {
11325 return 2;
11326 }
11327 if let Some(_) = self.source {
11328 return 1;
11329 }
11330 0
11331 }
11332 }
11333
11334 impl fidl::encoding::ValueTypeMarker for ExposeDirectory {
11335 type Borrowed<'a> = &'a Self;
11336 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11337 value
11338 }
11339 }
11340
11341 unsafe impl fidl::encoding::TypeMarker for ExposeDirectory {
11342 type Owned = Self;
11343
11344 #[inline(always)]
11345 fn inline_align(_context: fidl::encoding::Context) -> usize {
11346 8
11347 }
11348
11349 #[inline(always)]
11350 fn inline_size(_context: fidl::encoding::Context) -> usize {
11351 16
11352 }
11353 }
11354
11355 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeDirectory, D>
11356 for &ExposeDirectory
11357 {
11358 unsafe fn encode(
11359 self,
11360 encoder: &mut fidl::encoding::Encoder<'_, D>,
11361 offset: usize,
11362 mut depth: fidl::encoding::Depth,
11363 ) -> fidl::Result<()> {
11364 encoder.debug_check_bounds::<ExposeDirectory>(offset);
11365 let max_ordinal: u64 = self.max_ordinal_present();
11367 encoder.write_num(max_ordinal, offset);
11368 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11369 if max_ordinal == 0 {
11371 return Ok(());
11372 }
11373 depth.increment()?;
11374 let envelope_size = 8;
11375 let bytes_len = max_ordinal as usize * envelope_size;
11376 #[allow(unused_variables)]
11377 let offset = encoder.out_of_line_offset(bytes_len);
11378 let mut _prev_end_offset: usize = 0;
11379 if 1 > max_ordinal {
11380 return Ok(());
11381 }
11382
11383 let cur_offset: usize = (1 - 1) * envelope_size;
11386
11387 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11389
11390 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
11395 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
11396 encoder,
11397 offset + cur_offset,
11398 depth,
11399 )?;
11400
11401 _prev_end_offset = cur_offset + envelope_size;
11402 if 2 > max_ordinal {
11403 return Ok(());
11404 }
11405
11406 let cur_offset: usize = (2 - 1) * envelope_size;
11409
11410 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11412
11413 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
11418 self.source_name.as_ref().map(
11419 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
11420 ),
11421 encoder,
11422 offset + cur_offset,
11423 depth,
11424 )?;
11425
11426 _prev_end_offset = cur_offset + envelope_size;
11427 if 3 > max_ordinal {
11428 return Ok(());
11429 }
11430
11431 let cur_offset: usize = (3 - 1) * envelope_size;
11434
11435 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11437
11438 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
11443 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
11444 encoder,
11445 offset + cur_offset,
11446 depth,
11447 )?;
11448
11449 _prev_end_offset = cur_offset + envelope_size;
11450 if 4 > max_ordinal {
11451 return Ok(());
11452 }
11453
11454 let cur_offset: usize = (4 - 1) * envelope_size;
11457
11458 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11460
11461 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
11466 self.target_name.as_ref().map(
11467 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
11468 ),
11469 encoder,
11470 offset + cur_offset,
11471 depth,
11472 )?;
11473
11474 _prev_end_offset = cur_offset + envelope_size;
11475 if 5 > max_ordinal {
11476 return Ok(());
11477 }
11478
11479 let cur_offset: usize = (5 - 1) * envelope_size;
11482
11483 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11485
11486 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_io::Operations, D>(
11491 self.rights
11492 .as_ref()
11493 .map(<fidl_fuchsia_io::Operations as fidl::encoding::ValueTypeMarker>::borrow),
11494 encoder,
11495 offset + cur_offset,
11496 depth,
11497 )?;
11498
11499 _prev_end_offset = cur_offset + envelope_size;
11500 if 6 > max_ordinal {
11501 return Ok(());
11502 }
11503
11504 let cur_offset: usize = (6 - 1) * envelope_size;
11507
11508 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11510
11511 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
11516 self.subdir.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
11517 encoder, offset + cur_offset, depth
11518 )?;
11519
11520 _prev_end_offset = cur_offset + envelope_size;
11521 if 7 > max_ordinal {
11522 return Ok(());
11523 }
11524
11525 let cur_offset: usize = (7 - 1) * envelope_size;
11528
11529 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11531
11532 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
11537 self.availability
11538 .as_ref()
11539 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
11540 encoder,
11541 offset + cur_offset,
11542 depth,
11543 )?;
11544
11545 _prev_end_offset = cur_offset + envelope_size;
11546 if 8 > max_ordinal {
11547 return Ok(());
11548 }
11549
11550 let cur_offset: usize = (8 - 1) * envelope_size;
11553
11554 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11556
11557 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
11562 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
11563 encoder, offset + cur_offset, depth
11564 )?;
11565
11566 _prev_end_offset = cur_offset + envelope_size;
11567
11568 Ok(())
11569 }
11570 }
11571
11572 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeDirectory {
11573 #[inline(always)]
11574 fn new_empty() -> Self {
11575 Self::default()
11576 }
11577
11578 unsafe fn decode(
11579 &mut self,
11580 decoder: &mut fidl::encoding::Decoder<'_, D>,
11581 offset: usize,
11582 mut depth: fidl::encoding::Depth,
11583 ) -> fidl::Result<()> {
11584 decoder.debug_check_bounds::<Self>(offset);
11585 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11586 None => return Err(fidl::Error::NotNullable),
11587 Some(len) => len,
11588 };
11589 if len == 0 {
11591 return Ok(());
11592 };
11593 depth.increment()?;
11594 let envelope_size = 8;
11595 let bytes_len = len * envelope_size;
11596 let offset = decoder.out_of_line_offset(bytes_len)?;
11597 let mut _next_ordinal_to_read = 0;
11599 let mut next_offset = offset;
11600 let end_offset = offset + bytes_len;
11601 _next_ordinal_to_read += 1;
11602 if next_offset >= end_offset {
11603 return Ok(());
11604 }
11605
11606 while _next_ordinal_to_read < 1 {
11608 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11609 _next_ordinal_to_read += 1;
11610 next_offset += envelope_size;
11611 }
11612
11613 let next_out_of_line = decoder.next_out_of_line();
11614 let handles_before = decoder.remaining_handles();
11615 if let Some((inlined, num_bytes, num_handles)) =
11616 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11617 {
11618 let member_inline_size =
11619 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11620 if inlined != (member_inline_size <= 4) {
11621 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11622 }
11623 let inner_offset;
11624 let mut inner_depth = depth.clone();
11625 if inlined {
11626 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11627 inner_offset = next_offset;
11628 } else {
11629 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11630 inner_depth.increment()?;
11631 }
11632 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
11633 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
11634 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11635 {
11636 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11637 }
11638 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11639 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11640 }
11641 }
11642
11643 next_offset += envelope_size;
11644 _next_ordinal_to_read += 1;
11645 if next_offset >= end_offset {
11646 return Ok(());
11647 }
11648
11649 while _next_ordinal_to_read < 2 {
11651 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11652 _next_ordinal_to_read += 1;
11653 next_offset += envelope_size;
11654 }
11655
11656 let next_out_of_line = decoder.next_out_of_line();
11657 let handles_before = decoder.remaining_handles();
11658 if let Some((inlined, num_bytes, num_handles)) =
11659 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11660 {
11661 let member_inline_size =
11662 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11663 decoder.context,
11664 );
11665 if inlined != (member_inline_size <= 4) {
11666 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11667 }
11668 let inner_offset;
11669 let mut inner_depth = depth.clone();
11670 if inlined {
11671 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11672 inner_offset = next_offset;
11673 } else {
11674 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11675 inner_depth.increment()?;
11676 }
11677 let val_ref = self
11678 .source_name
11679 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
11680 fidl::decode!(
11681 fidl::encoding::BoundedString<100>,
11682 D,
11683 val_ref,
11684 decoder,
11685 inner_offset,
11686 inner_depth
11687 )?;
11688 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11689 {
11690 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11691 }
11692 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11693 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11694 }
11695 }
11696
11697 next_offset += envelope_size;
11698 _next_ordinal_to_read += 1;
11699 if next_offset >= end_offset {
11700 return Ok(());
11701 }
11702
11703 while _next_ordinal_to_read < 3 {
11705 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11706 _next_ordinal_to_read += 1;
11707 next_offset += envelope_size;
11708 }
11709
11710 let next_out_of_line = decoder.next_out_of_line();
11711 let handles_before = decoder.remaining_handles();
11712 if let Some((inlined, num_bytes, num_handles)) =
11713 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11714 {
11715 let member_inline_size =
11716 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11717 if inlined != (member_inline_size <= 4) {
11718 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11719 }
11720 let inner_offset;
11721 let mut inner_depth = depth.clone();
11722 if inlined {
11723 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11724 inner_offset = next_offset;
11725 } else {
11726 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11727 inner_depth.increment()?;
11728 }
11729 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
11730 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
11731 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11732 {
11733 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11734 }
11735 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11736 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11737 }
11738 }
11739
11740 next_offset += envelope_size;
11741 _next_ordinal_to_read += 1;
11742 if next_offset >= end_offset {
11743 return Ok(());
11744 }
11745
11746 while _next_ordinal_to_read < 4 {
11748 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11749 _next_ordinal_to_read += 1;
11750 next_offset += envelope_size;
11751 }
11752
11753 let next_out_of_line = decoder.next_out_of_line();
11754 let handles_before = decoder.remaining_handles();
11755 if let Some((inlined, num_bytes, num_handles)) =
11756 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11757 {
11758 let member_inline_size =
11759 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
11760 decoder.context,
11761 );
11762 if inlined != (member_inline_size <= 4) {
11763 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11764 }
11765 let inner_offset;
11766 let mut inner_depth = depth.clone();
11767 if inlined {
11768 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11769 inner_offset = next_offset;
11770 } else {
11771 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11772 inner_depth.increment()?;
11773 }
11774 let val_ref = self
11775 .target_name
11776 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
11777 fidl::decode!(
11778 fidl::encoding::BoundedString<100>,
11779 D,
11780 val_ref,
11781 decoder,
11782 inner_offset,
11783 inner_depth
11784 )?;
11785 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11786 {
11787 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11788 }
11789 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11790 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11791 }
11792 }
11793
11794 next_offset += envelope_size;
11795 _next_ordinal_to_read += 1;
11796 if next_offset >= end_offset {
11797 return Ok(());
11798 }
11799
11800 while _next_ordinal_to_read < 5 {
11802 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11803 _next_ordinal_to_read += 1;
11804 next_offset += envelope_size;
11805 }
11806
11807 let next_out_of_line = decoder.next_out_of_line();
11808 let handles_before = decoder.remaining_handles();
11809 if let Some((inlined, num_bytes, num_handles)) =
11810 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11811 {
11812 let member_inline_size =
11813 <fidl_fuchsia_io::Operations as fidl::encoding::TypeMarker>::inline_size(
11814 decoder.context,
11815 );
11816 if inlined != (member_inline_size <= 4) {
11817 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11818 }
11819 let inner_offset;
11820 let mut inner_depth = depth.clone();
11821 if inlined {
11822 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11823 inner_offset = next_offset;
11824 } else {
11825 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11826 inner_depth.increment()?;
11827 }
11828 let val_ref = self
11829 .rights
11830 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_io::Operations, D));
11831 fidl::decode!(
11832 fidl_fuchsia_io::Operations,
11833 D,
11834 val_ref,
11835 decoder,
11836 inner_offset,
11837 inner_depth
11838 )?;
11839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11840 {
11841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11842 }
11843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11845 }
11846 }
11847
11848 next_offset += envelope_size;
11849 _next_ordinal_to_read += 1;
11850 if next_offset >= end_offset {
11851 return Ok(());
11852 }
11853
11854 while _next_ordinal_to_read < 6 {
11856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11857 _next_ordinal_to_read += 1;
11858 next_offset += envelope_size;
11859 }
11860
11861 let next_out_of_line = decoder.next_out_of_line();
11862 let handles_before = decoder.remaining_handles();
11863 if let Some((inlined, num_bytes, num_handles)) =
11864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11865 {
11866 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11867 if inlined != (member_inline_size <= 4) {
11868 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11869 }
11870 let inner_offset;
11871 let mut inner_depth = depth.clone();
11872 if inlined {
11873 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11874 inner_offset = next_offset;
11875 } else {
11876 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11877 inner_depth.increment()?;
11878 }
11879 let val_ref = self.subdir.get_or_insert_with(|| {
11880 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
11881 });
11882 fidl::decode!(
11883 fidl::encoding::BoundedString<1024>,
11884 D,
11885 val_ref,
11886 decoder,
11887 inner_offset,
11888 inner_depth
11889 )?;
11890 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11891 {
11892 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11893 }
11894 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11895 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11896 }
11897 }
11898
11899 next_offset += envelope_size;
11900 _next_ordinal_to_read += 1;
11901 if next_offset >= end_offset {
11902 return Ok(());
11903 }
11904
11905 while _next_ordinal_to_read < 7 {
11907 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11908 _next_ordinal_to_read += 1;
11909 next_offset += envelope_size;
11910 }
11911
11912 let next_out_of_line = decoder.next_out_of_line();
11913 let handles_before = decoder.remaining_handles();
11914 if let Some((inlined, num_bytes, num_handles)) =
11915 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11916 {
11917 let member_inline_size =
11918 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11919 if inlined != (member_inline_size <= 4) {
11920 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11921 }
11922 let inner_offset;
11923 let mut inner_depth = depth.clone();
11924 if inlined {
11925 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11926 inner_offset = next_offset;
11927 } else {
11928 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11929 inner_depth.increment()?;
11930 }
11931 let val_ref =
11932 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
11933 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
11934 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11935 {
11936 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11937 }
11938 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11939 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11940 }
11941 }
11942
11943 next_offset += envelope_size;
11944 _next_ordinal_to_read += 1;
11945 if next_offset >= end_offset {
11946 return Ok(());
11947 }
11948
11949 while _next_ordinal_to_read < 8 {
11951 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11952 _next_ordinal_to_read += 1;
11953 next_offset += envelope_size;
11954 }
11955
11956 let next_out_of_line = decoder.next_out_of_line();
11957 let handles_before = decoder.remaining_handles();
11958 if let Some((inlined, num_bytes, num_handles)) =
11959 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11960 {
11961 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11962 if inlined != (member_inline_size <= 4) {
11963 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11964 }
11965 let inner_offset;
11966 let mut inner_depth = depth.clone();
11967 if inlined {
11968 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11969 inner_offset = next_offset;
11970 } else {
11971 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11972 inner_depth.increment()?;
11973 }
11974 let val_ref = self.source_dictionary.get_or_insert_with(|| {
11975 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
11976 });
11977 fidl::decode!(
11978 fidl::encoding::BoundedString<1024>,
11979 D,
11980 val_ref,
11981 decoder,
11982 inner_offset,
11983 inner_depth
11984 )?;
11985 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11986 {
11987 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11988 }
11989 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11990 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11991 }
11992 }
11993
11994 next_offset += envelope_size;
11995
11996 while next_offset < end_offset {
11998 _next_ordinal_to_read += 1;
11999 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12000 next_offset += envelope_size;
12001 }
12002
12003 Ok(())
12004 }
12005 }
12006
12007 impl ExposeProtocol {
12008 #[inline(always)]
12009 fn max_ordinal_present(&self) -> u64 {
12010 if let Some(_) = self.source_dictionary {
12011 return 6;
12012 }
12013 if let Some(_) = self.availability {
12014 return 5;
12015 }
12016 if let Some(_) = self.target_name {
12017 return 4;
12018 }
12019 if let Some(_) = self.target {
12020 return 3;
12021 }
12022 if let Some(_) = self.source_name {
12023 return 2;
12024 }
12025 if let Some(_) = self.source {
12026 return 1;
12027 }
12028 0
12029 }
12030 }
12031
12032 impl fidl::encoding::ValueTypeMarker for ExposeProtocol {
12033 type Borrowed<'a> = &'a Self;
12034 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12035 value
12036 }
12037 }
12038
12039 unsafe impl fidl::encoding::TypeMarker for ExposeProtocol {
12040 type Owned = Self;
12041
12042 #[inline(always)]
12043 fn inline_align(_context: fidl::encoding::Context) -> usize {
12044 8
12045 }
12046
12047 #[inline(always)]
12048 fn inline_size(_context: fidl::encoding::Context) -> usize {
12049 16
12050 }
12051 }
12052
12053 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeProtocol, D>
12054 for &ExposeProtocol
12055 {
12056 unsafe fn encode(
12057 self,
12058 encoder: &mut fidl::encoding::Encoder<'_, D>,
12059 offset: usize,
12060 mut depth: fidl::encoding::Depth,
12061 ) -> fidl::Result<()> {
12062 encoder.debug_check_bounds::<ExposeProtocol>(offset);
12063 let max_ordinal: u64 = self.max_ordinal_present();
12065 encoder.write_num(max_ordinal, offset);
12066 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12067 if max_ordinal == 0 {
12069 return Ok(());
12070 }
12071 depth.increment()?;
12072 let envelope_size = 8;
12073 let bytes_len = max_ordinal as usize * envelope_size;
12074 #[allow(unused_variables)]
12075 let offset = encoder.out_of_line_offset(bytes_len);
12076 let mut _prev_end_offset: usize = 0;
12077 if 1 > max_ordinal {
12078 return Ok(());
12079 }
12080
12081 let cur_offset: usize = (1 - 1) * envelope_size;
12084
12085 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12087
12088 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
12093 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
12094 encoder,
12095 offset + cur_offset,
12096 depth,
12097 )?;
12098
12099 _prev_end_offset = cur_offset + envelope_size;
12100 if 2 > max_ordinal {
12101 return Ok(());
12102 }
12103
12104 let cur_offset: usize = (2 - 1) * envelope_size;
12107
12108 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12110
12111 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
12116 self.source_name.as_ref().map(
12117 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12118 ),
12119 encoder,
12120 offset + cur_offset,
12121 depth,
12122 )?;
12123
12124 _prev_end_offset = cur_offset + envelope_size;
12125 if 3 > max_ordinal {
12126 return Ok(());
12127 }
12128
12129 let cur_offset: usize = (3 - 1) * envelope_size;
12132
12133 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12135
12136 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
12141 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
12142 encoder,
12143 offset + cur_offset,
12144 depth,
12145 )?;
12146
12147 _prev_end_offset = cur_offset + envelope_size;
12148 if 4 > max_ordinal {
12149 return Ok(());
12150 }
12151
12152 let cur_offset: usize = (4 - 1) * envelope_size;
12155
12156 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12158
12159 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
12164 self.target_name.as_ref().map(
12165 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12166 ),
12167 encoder,
12168 offset + cur_offset,
12169 depth,
12170 )?;
12171
12172 _prev_end_offset = cur_offset + envelope_size;
12173 if 5 > max_ordinal {
12174 return Ok(());
12175 }
12176
12177 let cur_offset: usize = (5 - 1) * envelope_size;
12180
12181 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12183
12184 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
12189 self.availability
12190 .as_ref()
12191 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
12192 encoder,
12193 offset + cur_offset,
12194 depth,
12195 )?;
12196
12197 _prev_end_offset = cur_offset + envelope_size;
12198 if 6 > max_ordinal {
12199 return Ok(());
12200 }
12201
12202 let cur_offset: usize = (6 - 1) * envelope_size;
12205
12206 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12208
12209 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
12214 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
12215 encoder, offset + cur_offset, depth
12216 )?;
12217
12218 _prev_end_offset = cur_offset + envelope_size;
12219
12220 Ok(())
12221 }
12222 }
12223
12224 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeProtocol {
12225 #[inline(always)]
12226 fn new_empty() -> Self {
12227 Self::default()
12228 }
12229
12230 unsafe fn decode(
12231 &mut self,
12232 decoder: &mut fidl::encoding::Decoder<'_, D>,
12233 offset: usize,
12234 mut depth: fidl::encoding::Depth,
12235 ) -> fidl::Result<()> {
12236 decoder.debug_check_bounds::<Self>(offset);
12237 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12238 None => return Err(fidl::Error::NotNullable),
12239 Some(len) => len,
12240 };
12241 if len == 0 {
12243 return Ok(());
12244 };
12245 depth.increment()?;
12246 let envelope_size = 8;
12247 let bytes_len = len * envelope_size;
12248 let offset = decoder.out_of_line_offset(bytes_len)?;
12249 let mut _next_ordinal_to_read = 0;
12251 let mut next_offset = offset;
12252 let end_offset = offset + bytes_len;
12253 _next_ordinal_to_read += 1;
12254 if next_offset >= end_offset {
12255 return Ok(());
12256 }
12257
12258 while _next_ordinal_to_read < 1 {
12260 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12261 _next_ordinal_to_read += 1;
12262 next_offset += envelope_size;
12263 }
12264
12265 let next_out_of_line = decoder.next_out_of_line();
12266 let handles_before = decoder.remaining_handles();
12267 if let Some((inlined, num_bytes, num_handles)) =
12268 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12269 {
12270 let member_inline_size =
12271 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12272 if inlined != (member_inline_size <= 4) {
12273 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12274 }
12275 let inner_offset;
12276 let mut inner_depth = depth.clone();
12277 if inlined {
12278 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12279 inner_offset = next_offset;
12280 } else {
12281 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12282 inner_depth.increment()?;
12283 }
12284 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
12285 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
12286 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12287 {
12288 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12289 }
12290 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12291 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12292 }
12293 }
12294
12295 next_offset += envelope_size;
12296 _next_ordinal_to_read += 1;
12297 if next_offset >= end_offset {
12298 return Ok(());
12299 }
12300
12301 while _next_ordinal_to_read < 2 {
12303 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12304 _next_ordinal_to_read += 1;
12305 next_offset += envelope_size;
12306 }
12307
12308 let next_out_of_line = decoder.next_out_of_line();
12309 let handles_before = decoder.remaining_handles();
12310 if let Some((inlined, num_bytes, num_handles)) =
12311 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12312 {
12313 let member_inline_size =
12314 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12315 decoder.context,
12316 );
12317 if inlined != (member_inline_size <= 4) {
12318 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12319 }
12320 let inner_offset;
12321 let mut inner_depth = depth.clone();
12322 if inlined {
12323 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12324 inner_offset = next_offset;
12325 } else {
12326 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12327 inner_depth.increment()?;
12328 }
12329 let val_ref = self
12330 .source_name
12331 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
12332 fidl::decode!(
12333 fidl::encoding::BoundedString<100>,
12334 D,
12335 val_ref,
12336 decoder,
12337 inner_offset,
12338 inner_depth
12339 )?;
12340 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12341 {
12342 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12343 }
12344 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12345 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12346 }
12347 }
12348
12349 next_offset += envelope_size;
12350 _next_ordinal_to_read += 1;
12351 if next_offset >= end_offset {
12352 return Ok(());
12353 }
12354
12355 while _next_ordinal_to_read < 3 {
12357 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12358 _next_ordinal_to_read += 1;
12359 next_offset += envelope_size;
12360 }
12361
12362 let next_out_of_line = decoder.next_out_of_line();
12363 let handles_before = decoder.remaining_handles();
12364 if let Some((inlined, num_bytes, num_handles)) =
12365 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12366 {
12367 let member_inline_size =
12368 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12369 if inlined != (member_inline_size <= 4) {
12370 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12371 }
12372 let inner_offset;
12373 let mut inner_depth = depth.clone();
12374 if inlined {
12375 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12376 inner_offset = next_offset;
12377 } else {
12378 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12379 inner_depth.increment()?;
12380 }
12381 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
12382 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
12383 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12384 {
12385 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12386 }
12387 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12388 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12389 }
12390 }
12391
12392 next_offset += envelope_size;
12393 _next_ordinal_to_read += 1;
12394 if next_offset >= end_offset {
12395 return Ok(());
12396 }
12397
12398 while _next_ordinal_to_read < 4 {
12400 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12401 _next_ordinal_to_read += 1;
12402 next_offset += envelope_size;
12403 }
12404
12405 let next_out_of_line = decoder.next_out_of_line();
12406 let handles_before = decoder.remaining_handles();
12407 if let Some((inlined, num_bytes, num_handles)) =
12408 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12409 {
12410 let member_inline_size =
12411 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12412 decoder.context,
12413 );
12414 if inlined != (member_inline_size <= 4) {
12415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12416 }
12417 let inner_offset;
12418 let mut inner_depth = depth.clone();
12419 if inlined {
12420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12421 inner_offset = next_offset;
12422 } else {
12423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12424 inner_depth.increment()?;
12425 }
12426 let val_ref = self
12427 .target_name
12428 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
12429 fidl::decode!(
12430 fidl::encoding::BoundedString<100>,
12431 D,
12432 val_ref,
12433 decoder,
12434 inner_offset,
12435 inner_depth
12436 )?;
12437 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12438 {
12439 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12440 }
12441 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12442 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12443 }
12444 }
12445
12446 next_offset += envelope_size;
12447 _next_ordinal_to_read += 1;
12448 if next_offset >= end_offset {
12449 return Ok(());
12450 }
12451
12452 while _next_ordinal_to_read < 5 {
12454 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12455 _next_ordinal_to_read += 1;
12456 next_offset += envelope_size;
12457 }
12458
12459 let next_out_of_line = decoder.next_out_of_line();
12460 let handles_before = decoder.remaining_handles();
12461 if let Some((inlined, num_bytes, num_handles)) =
12462 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12463 {
12464 let member_inline_size =
12465 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12466 if inlined != (member_inline_size <= 4) {
12467 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12468 }
12469 let inner_offset;
12470 let mut inner_depth = depth.clone();
12471 if inlined {
12472 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12473 inner_offset = next_offset;
12474 } else {
12475 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12476 inner_depth.increment()?;
12477 }
12478 let val_ref =
12479 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
12480 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
12481 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12482 {
12483 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12484 }
12485 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12486 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12487 }
12488 }
12489
12490 next_offset += envelope_size;
12491 _next_ordinal_to_read += 1;
12492 if next_offset >= end_offset {
12493 return Ok(());
12494 }
12495
12496 while _next_ordinal_to_read < 6 {
12498 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12499 _next_ordinal_to_read += 1;
12500 next_offset += envelope_size;
12501 }
12502
12503 let next_out_of_line = decoder.next_out_of_line();
12504 let handles_before = decoder.remaining_handles();
12505 if let Some((inlined, num_bytes, num_handles)) =
12506 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12507 {
12508 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12509 if inlined != (member_inline_size <= 4) {
12510 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12511 }
12512 let inner_offset;
12513 let mut inner_depth = depth.clone();
12514 if inlined {
12515 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12516 inner_offset = next_offset;
12517 } else {
12518 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12519 inner_depth.increment()?;
12520 }
12521 let val_ref = self.source_dictionary.get_or_insert_with(|| {
12522 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
12523 });
12524 fidl::decode!(
12525 fidl::encoding::BoundedString<1024>,
12526 D,
12527 val_ref,
12528 decoder,
12529 inner_offset,
12530 inner_depth
12531 )?;
12532 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12533 {
12534 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12535 }
12536 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12537 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12538 }
12539 }
12540
12541 next_offset += envelope_size;
12542
12543 while next_offset < end_offset {
12545 _next_ordinal_to_read += 1;
12546 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12547 next_offset += envelope_size;
12548 }
12549
12550 Ok(())
12551 }
12552 }
12553
12554 impl ExposeResolver {
12555 #[inline(always)]
12556 fn max_ordinal_present(&self) -> u64 {
12557 if let Some(_) = self.source_dictionary {
12558 return 6;
12559 }
12560 if let Some(_) = self.target_name {
12561 return 4;
12562 }
12563 if let Some(_) = self.target {
12564 return 3;
12565 }
12566 if let Some(_) = self.source_name {
12567 return 2;
12568 }
12569 if let Some(_) = self.source {
12570 return 1;
12571 }
12572 0
12573 }
12574 }
12575
12576 impl fidl::encoding::ValueTypeMarker for ExposeResolver {
12577 type Borrowed<'a> = &'a Self;
12578 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12579 value
12580 }
12581 }
12582
12583 unsafe impl fidl::encoding::TypeMarker for ExposeResolver {
12584 type Owned = Self;
12585
12586 #[inline(always)]
12587 fn inline_align(_context: fidl::encoding::Context) -> usize {
12588 8
12589 }
12590
12591 #[inline(always)]
12592 fn inline_size(_context: fidl::encoding::Context) -> usize {
12593 16
12594 }
12595 }
12596
12597 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeResolver, D>
12598 for &ExposeResolver
12599 {
12600 unsafe fn encode(
12601 self,
12602 encoder: &mut fidl::encoding::Encoder<'_, D>,
12603 offset: usize,
12604 mut depth: fidl::encoding::Depth,
12605 ) -> fidl::Result<()> {
12606 encoder.debug_check_bounds::<ExposeResolver>(offset);
12607 let max_ordinal: u64 = self.max_ordinal_present();
12609 encoder.write_num(max_ordinal, offset);
12610 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12611 if max_ordinal == 0 {
12613 return Ok(());
12614 }
12615 depth.increment()?;
12616 let envelope_size = 8;
12617 let bytes_len = max_ordinal as usize * envelope_size;
12618 #[allow(unused_variables)]
12619 let offset = encoder.out_of_line_offset(bytes_len);
12620 let mut _prev_end_offset: usize = 0;
12621 if 1 > max_ordinal {
12622 return Ok(());
12623 }
12624
12625 let cur_offset: usize = (1 - 1) * envelope_size;
12628
12629 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12631
12632 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
12637 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
12638 encoder,
12639 offset + cur_offset,
12640 depth,
12641 )?;
12642
12643 _prev_end_offset = cur_offset + envelope_size;
12644 if 2 > max_ordinal {
12645 return Ok(());
12646 }
12647
12648 let cur_offset: usize = (2 - 1) * envelope_size;
12651
12652 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12654
12655 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
12660 self.source_name.as_ref().map(
12661 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12662 ),
12663 encoder,
12664 offset + cur_offset,
12665 depth,
12666 )?;
12667
12668 _prev_end_offset = cur_offset + envelope_size;
12669 if 3 > max_ordinal {
12670 return Ok(());
12671 }
12672
12673 let cur_offset: usize = (3 - 1) * envelope_size;
12676
12677 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12679
12680 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
12685 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
12686 encoder,
12687 offset + cur_offset,
12688 depth,
12689 )?;
12690
12691 _prev_end_offset = cur_offset + envelope_size;
12692 if 4 > max_ordinal {
12693 return Ok(());
12694 }
12695
12696 let cur_offset: usize = (4 - 1) * envelope_size;
12699
12700 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12702
12703 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
12708 self.target_name.as_ref().map(
12709 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12710 ),
12711 encoder,
12712 offset + cur_offset,
12713 depth,
12714 )?;
12715
12716 _prev_end_offset = cur_offset + envelope_size;
12717 if 6 > max_ordinal {
12718 return Ok(());
12719 }
12720
12721 let cur_offset: usize = (6 - 1) * envelope_size;
12724
12725 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12727
12728 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
12733 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
12734 encoder, offset + cur_offset, depth
12735 )?;
12736
12737 _prev_end_offset = cur_offset + envelope_size;
12738
12739 Ok(())
12740 }
12741 }
12742
12743 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeResolver {
12744 #[inline(always)]
12745 fn new_empty() -> Self {
12746 Self::default()
12747 }
12748
12749 unsafe fn decode(
12750 &mut self,
12751 decoder: &mut fidl::encoding::Decoder<'_, D>,
12752 offset: usize,
12753 mut depth: fidl::encoding::Depth,
12754 ) -> fidl::Result<()> {
12755 decoder.debug_check_bounds::<Self>(offset);
12756 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12757 None => return Err(fidl::Error::NotNullable),
12758 Some(len) => len,
12759 };
12760 if len == 0 {
12762 return Ok(());
12763 };
12764 depth.increment()?;
12765 let envelope_size = 8;
12766 let bytes_len = len * envelope_size;
12767 let offset = decoder.out_of_line_offset(bytes_len)?;
12768 let mut _next_ordinal_to_read = 0;
12770 let mut next_offset = offset;
12771 let end_offset = offset + bytes_len;
12772 _next_ordinal_to_read += 1;
12773 if next_offset >= end_offset {
12774 return Ok(());
12775 }
12776
12777 while _next_ordinal_to_read < 1 {
12779 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12780 _next_ordinal_to_read += 1;
12781 next_offset += envelope_size;
12782 }
12783
12784 let next_out_of_line = decoder.next_out_of_line();
12785 let handles_before = decoder.remaining_handles();
12786 if let Some((inlined, num_bytes, num_handles)) =
12787 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12788 {
12789 let member_inline_size =
12790 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12791 if inlined != (member_inline_size <= 4) {
12792 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12793 }
12794 let inner_offset;
12795 let mut inner_depth = depth.clone();
12796 if inlined {
12797 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12798 inner_offset = next_offset;
12799 } else {
12800 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12801 inner_depth.increment()?;
12802 }
12803 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
12804 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
12805 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12806 {
12807 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12808 }
12809 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12810 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12811 }
12812 }
12813
12814 next_offset += envelope_size;
12815 _next_ordinal_to_read += 1;
12816 if next_offset >= end_offset {
12817 return Ok(());
12818 }
12819
12820 while _next_ordinal_to_read < 2 {
12822 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12823 _next_ordinal_to_read += 1;
12824 next_offset += envelope_size;
12825 }
12826
12827 let next_out_of_line = decoder.next_out_of_line();
12828 let handles_before = decoder.remaining_handles();
12829 if let Some((inlined, num_bytes, num_handles)) =
12830 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12831 {
12832 let member_inline_size =
12833 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12834 decoder.context,
12835 );
12836 if inlined != (member_inline_size <= 4) {
12837 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12838 }
12839 let inner_offset;
12840 let mut inner_depth = depth.clone();
12841 if inlined {
12842 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12843 inner_offset = next_offset;
12844 } else {
12845 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12846 inner_depth.increment()?;
12847 }
12848 let val_ref = self
12849 .source_name
12850 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
12851 fidl::decode!(
12852 fidl::encoding::BoundedString<100>,
12853 D,
12854 val_ref,
12855 decoder,
12856 inner_offset,
12857 inner_depth
12858 )?;
12859 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12860 {
12861 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12862 }
12863 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12864 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12865 }
12866 }
12867
12868 next_offset += envelope_size;
12869 _next_ordinal_to_read += 1;
12870 if next_offset >= end_offset {
12871 return Ok(());
12872 }
12873
12874 while _next_ordinal_to_read < 3 {
12876 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12877 _next_ordinal_to_read += 1;
12878 next_offset += envelope_size;
12879 }
12880
12881 let next_out_of_line = decoder.next_out_of_line();
12882 let handles_before = decoder.remaining_handles();
12883 if let Some((inlined, num_bytes, num_handles)) =
12884 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12885 {
12886 let member_inline_size =
12887 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12888 if inlined != (member_inline_size <= 4) {
12889 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12890 }
12891 let inner_offset;
12892 let mut inner_depth = depth.clone();
12893 if inlined {
12894 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12895 inner_offset = next_offset;
12896 } else {
12897 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12898 inner_depth.increment()?;
12899 }
12900 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
12901 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
12902 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12903 {
12904 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12905 }
12906 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12907 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12908 }
12909 }
12910
12911 next_offset += envelope_size;
12912 _next_ordinal_to_read += 1;
12913 if next_offset >= end_offset {
12914 return Ok(());
12915 }
12916
12917 while _next_ordinal_to_read < 4 {
12919 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12920 _next_ordinal_to_read += 1;
12921 next_offset += envelope_size;
12922 }
12923
12924 let next_out_of_line = decoder.next_out_of_line();
12925 let handles_before = decoder.remaining_handles();
12926 if let Some((inlined, num_bytes, num_handles)) =
12927 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12928 {
12929 let member_inline_size =
12930 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12931 decoder.context,
12932 );
12933 if inlined != (member_inline_size <= 4) {
12934 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12935 }
12936 let inner_offset;
12937 let mut inner_depth = depth.clone();
12938 if inlined {
12939 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12940 inner_offset = next_offset;
12941 } else {
12942 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12943 inner_depth.increment()?;
12944 }
12945 let val_ref = self
12946 .target_name
12947 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
12948 fidl::decode!(
12949 fidl::encoding::BoundedString<100>,
12950 D,
12951 val_ref,
12952 decoder,
12953 inner_offset,
12954 inner_depth
12955 )?;
12956 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12957 {
12958 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12959 }
12960 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12961 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12962 }
12963 }
12964
12965 next_offset += envelope_size;
12966 _next_ordinal_to_read += 1;
12967 if next_offset >= end_offset {
12968 return Ok(());
12969 }
12970
12971 while _next_ordinal_to_read < 6 {
12973 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12974 _next_ordinal_to_read += 1;
12975 next_offset += envelope_size;
12976 }
12977
12978 let next_out_of_line = decoder.next_out_of_line();
12979 let handles_before = decoder.remaining_handles();
12980 if let Some((inlined, num_bytes, num_handles)) =
12981 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12982 {
12983 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12984 if inlined != (member_inline_size <= 4) {
12985 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12986 }
12987 let inner_offset;
12988 let mut inner_depth = depth.clone();
12989 if inlined {
12990 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12991 inner_offset = next_offset;
12992 } else {
12993 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12994 inner_depth.increment()?;
12995 }
12996 let val_ref = self.source_dictionary.get_or_insert_with(|| {
12997 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
12998 });
12999 fidl::decode!(
13000 fidl::encoding::BoundedString<1024>,
13001 D,
13002 val_ref,
13003 decoder,
13004 inner_offset,
13005 inner_depth
13006 )?;
13007 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13008 {
13009 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13010 }
13011 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13012 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13013 }
13014 }
13015
13016 next_offset += envelope_size;
13017
13018 while next_offset < end_offset {
13020 _next_ordinal_to_read += 1;
13021 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13022 next_offset += envelope_size;
13023 }
13024
13025 Ok(())
13026 }
13027 }
13028
13029 impl ExposeRunner {
13030 #[inline(always)]
13031 fn max_ordinal_present(&self) -> u64 {
13032 if let Some(_) = self.source_dictionary {
13033 return 6;
13034 }
13035 if let Some(_) = self.target_name {
13036 return 4;
13037 }
13038 if let Some(_) = self.target {
13039 return 3;
13040 }
13041 if let Some(_) = self.source_name {
13042 return 2;
13043 }
13044 if let Some(_) = self.source {
13045 return 1;
13046 }
13047 0
13048 }
13049 }
13050
13051 impl fidl::encoding::ValueTypeMarker for ExposeRunner {
13052 type Borrowed<'a> = &'a Self;
13053 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13054 value
13055 }
13056 }
13057
13058 unsafe impl fidl::encoding::TypeMarker for ExposeRunner {
13059 type Owned = Self;
13060
13061 #[inline(always)]
13062 fn inline_align(_context: fidl::encoding::Context) -> usize {
13063 8
13064 }
13065
13066 #[inline(always)]
13067 fn inline_size(_context: fidl::encoding::Context) -> usize {
13068 16
13069 }
13070 }
13071
13072 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeRunner, D>
13073 for &ExposeRunner
13074 {
13075 unsafe fn encode(
13076 self,
13077 encoder: &mut fidl::encoding::Encoder<'_, D>,
13078 offset: usize,
13079 mut depth: fidl::encoding::Depth,
13080 ) -> fidl::Result<()> {
13081 encoder.debug_check_bounds::<ExposeRunner>(offset);
13082 let max_ordinal: u64 = self.max_ordinal_present();
13084 encoder.write_num(max_ordinal, offset);
13085 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13086 if max_ordinal == 0 {
13088 return Ok(());
13089 }
13090 depth.increment()?;
13091 let envelope_size = 8;
13092 let bytes_len = max_ordinal as usize * envelope_size;
13093 #[allow(unused_variables)]
13094 let offset = encoder.out_of_line_offset(bytes_len);
13095 let mut _prev_end_offset: usize = 0;
13096 if 1 > max_ordinal {
13097 return Ok(());
13098 }
13099
13100 let cur_offset: usize = (1 - 1) * envelope_size;
13103
13104 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13106
13107 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
13112 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
13113 encoder,
13114 offset + cur_offset,
13115 depth,
13116 )?;
13117
13118 _prev_end_offset = cur_offset + envelope_size;
13119 if 2 > max_ordinal {
13120 return Ok(());
13121 }
13122
13123 let cur_offset: usize = (2 - 1) * envelope_size;
13126
13127 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13129
13130 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
13135 self.source_name.as_ref().map(
13136 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
13137 ),
13138 encoder,
13139 offset + cur_offset,
13140 depth,
13141 )?;
13142
13143 _prev_end_offset = cur_offset + envelope_size;
13144 if 3 > max_ordinal {
13145 return Ok(());
13146 }
13147
13148 let cur_offset: usize = (3 - 1) * envelope_size;
13151
13152 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13154
13155 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
13160 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
13161 encoder,
13162 offset + cur_offset,
13163 depth,
13164 )?;
13165
13166 _prev_end_offset = cur_offset + envelope_size;
13167 if 4 > max_ordinal {
13168 return Ok(());
13169 }
13170
13171 let cur_offset: usize = (4 - 1) * envelope_size;
13174
13175 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13177
13178 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
13183 self.target_name.as_ref().map(
13184 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
13185 ),
13186 encoder,
13187 offset + cur_offset,
13188 depth,
13189 )?;
13190
13191 _prev_end_offset = cur_offset + envelope_size;
13192 if 6 > max_ordinal {
13193 return Ok(());
13194 }
13195
13196 let cur_offset: usize = (6 - 1) * envelope_size;
13199
13200 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13202
13203 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
13208 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
13209 encoder, offset + cur_offset, depth
13210 )?;
13211
13212 _prev_end_offset = cur_offset + envelope_size;
13213
13214 Ok(())
13215 }
13216 }
13217
13218 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeRunner {
13219 #[inline(always)]
13220 fn new_empty() -> Self {
13221 Self::default()
13222 }
13223
13224 unsafe fn decode(
13225 &mut self,
13226 decoder: &mut fidl::encoding::Decoder<'_, D>,
13227 offset: usize,
13228 mut depth: fidl::encoding::Depth,
13229 ) -> fidl::Result<()> {
13230 decoder.debug_check_bounds::<Self>(offset);
13231 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13232 None => return Err(fidl::Error::NotNullable),
13233 Some(len) => len,
13234 };
13235 if len == 0 {
13237 return Ok(());
13238 };
13239 depth.increment()?;
13240 let envelope_size = 8;
13241 let bytes_len = len * envelope_size;
13242 let offset = decoder.out_of_line_offset(bytes_len)?;
13243 let mut _next_ordinal_to_read = 0;
13245 let mut next_offset = offset;
13246 let end_offset = offset + bytes_len;
13247 _next_ordinal_to_read += 1;
13248 if next_offset >= end_offset {
13249 return Ok(());
13250 }
13251
13252 while _next_ordinal_to_read < 1 {
13254 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13255 _next_ordinal_to_read += 1;
13256 next_offset += envelope_size;
13257 }
13258
13259 let next_out_of_line = decoder.next_out_of_line();
13260 let handles_before = decoder.remaining_handles();
13261 if let Some((inlined, num_bytes, num_handles)) =
13262 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13263 {
13264 let member_inline_size =
13265 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13266 if inlined != (member_inline_size <= 4) {
13267 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13268 }
13269 let inner_offset;
13270 let mut inner_depth = depth.clone();
13271 if inlined {
13272 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13273 inner_offset = next_offset;
13274 } else {
13275 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13276 inner_depth.increment()?;
13277 }
13278 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
13279 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
13280 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13281 {
13282 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13283 }
13284 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13285 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13286 }
13287 }
13288
13289 next_offset += envelope_size;
13290 _next_ordinal_to_read += 1;
13291 if next_offset >= end_offset {
13292 return Ok(());
13293 }
13294
13295 while _next_ordinal_to_read < 2 {
13297 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13298 _next_ordinal_to_read += 1;
13299 next_offset += envelope_size;
13300 }
13301
13302 let next_out_of_line = decoder.next_out_of_line();
13303 let handles_before = decoder.remaining_handles();
13304 if let Some((inlined, num_bytes, num_handles)) =
13305 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13306 {
13307 let member_inline_size =
13308 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
13309 decoder.context,
13310 );
13311 if inlined != (member_inline_size <= 4) {
13312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13313 }
13314 let inner_offset;
13315 let mut inner_depth = depth.clone();
13316 if inlined {
13317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13318 inner_offset = next_offset;
13319 } else {
13320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13321 inner_depth.increment()?;
13322 }
13323 let val_ref = self
13324 .source_name
13325 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
13326 fidl::decode!(
13327 fidl::encoding::BoundedString<100>,
13328 D,
13329 val_ref,
13330 decoder,
13331 inner_offset,
13332 inner_depth
13333 )?;
13334 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13335 {
13336 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13337 }
13338 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13339 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13340 }
13341 }
13342
13343 next_offset += envelope_size;
13344 _next_ordinal_to_read += 1;
13345 if next_offset >= end_offset {
13346 return Ok(());
13347 }
13348
13349 while _next_ordinal_to_read < 3 {
13351 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13352 _next_ordinal_to_read += 1;
13353 next_offset += envelope_size;
13354 }
13355
13356 let next_out_of_line = decoder.next_out_of_line();
13357 let handles_before = decoder.remaining_handles();
13358 if let Some((inlined, num_bytes, num_handles)) =
13359 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13360 {
13361 let member_inline_size =
13362 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13363 if inlined != (member_inline_size <= 4) {
13364 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13365 }
13366 let inner_offset;
13367 let mut inner_depth = depth.clone();
13368 if inlined {
13369 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13370 inner_offset = next_offset;
13371 } else {
13372 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13373 inner_depth.increment()?;
13374 }
13375 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
13376 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
13377 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13378 {
13379 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13380 }
13381 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13382 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13383 }
13384 }
13385
13386 next_offset += envelope_size;
13387 _next_ordinal_to_read += 1;
13388 if next_offset >= end_offset {
13389 return Ok(());
13390 }
13391
13392 while _next_ordinal_to_read < 4 {
13394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13395 _next_ordinal_to_read += 1;
13396 next_offset += envelope_size;
13397 }
13398
13399 let next_out_of_line = decoder.next_out_of_line();
13400 let handles_before = decoder.remaining_handles();
13401 if let Some((inlined, num_bytes, num_handles)) =
13402 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13403 {
13404 let member_inline_size =
13405 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
13406 decoder.context,
13407 );
13408 if inlined != (member_inline_size <= 4) {
13409 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13410 }
13411 let inner_offset;
13412 let mut inner_depth = depth.clone();
13413 if inlined {
13414 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13415 inner_offset = next_offset;
13416 } else {
13417 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13418 inner_depth.increment()?;
13419 }
13420 let val_ref = self
13421 .target_name
13422 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
13423 fidl::decode!(
13424 fidl::encoding::BoundedString<100>,
13425 D,
13426 val_ref,
13427 decoder,
13428 inner_offset,
13429 inner_depth
13430 )?;
13431 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13432 {
13433 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13434 }
13435 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13436 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13437 }
13438 }
13439
13440 next_offset += envelope_size;
13441 _next_ordinal_to_read += 1;
13442 if next_offset >= end_offset {
13443 return Ok(());
13444 }
13445
13446 while _next_ordinal_to_read < 6 {
13448 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13449 _next_ordinal_to_read += 1;
13450 next_offset += envelope_size;
13451 }
13452
13453 let next_out_of_line = decoder.next_out_of_line();
13454 let handles_before = decoder.remaining_handles();
13455 if let Some((inlined, num_bytes, num_handles)) =
13456 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13457 {
13458 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13459 if inlined != (member_inline_size <= 4) {
13460 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13461 }
13462 let inner_offset;
13463 let mut inner_depth = depth.clone();
13464 if inlined {
13465 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13466 inner_offset = next_offset;
13467 } else {
13468 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13469 inner_depth.increment()?;
13470 }
13471 let val_ref = self.source_dictionary.get_or_insert_with(|| {
13472 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
13473 });
13474 fidl::decode!(
13475 fidl::encoding::BoundedString<1024>,
13476 D,
13477 val_ref,
13478 decoder,
13479 inner_offset,
13480 inner_depth
13481 )?;
13482 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13483 {
13484 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13485 }
13486 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13487 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13488 }
13489 }
13490
13491 next_offset += envelope_size;
13492
13493 while next_offset < end_offset {
13495 _next_ordinal_to_read += 1;
13496 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13497 next_offset += envelope_size;
13498 }
13499
13500 Ok(())
13501 }
13502 }
13503
13504 impl ExposeService {
13505 #[inline(always)]
13506 fn max_ordinal_present(&self) -> u64 {
13507 if let Some(_) = self.source_dictionary {
13508 return 6;
13509 }
13510 if let Some(_) = self.availability {
13511 return 5;
13512 }
13513 if let Some(_) = self.target_name {
13514 return 4;
13515 }
13516 if let Some(_) = self.target {
13517 return 3;
13518 }
13519 if let Some(_) = self.source_name {
13520 return 2;
13521 }
13522 if let Some(_) = self.source {
13523 return 1;
13524 }
13525 0
13526 }
13527 }
13528
13529 impl fidl::encoding::ValueTypeMarker for ExposeService {
13530 type Borrowed<'a> = &'a Self;
13531 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13532 value
13533 }
13534 }
13535
13536 unsafe impl fidl::encoding::TypeMarker for ExposeService {
13537 type Owned = Self;
13538
13539 #[inline(always)]
13540 fn inline_align(_context: fidl::encoding::Context) -> usize {
13541 8
13542 }
13543
13544 #[inline(always)]
13545 fn inline_size(_context: fidl::encoding::Context) -> usize {
13546 16
13547 }
13548 }
13549
13550 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposeService, D>
13551 for &ExposeService
13552 {
13553 unsafe fn encode(
13554 self,
13555 encoder: &mut fidl::encoding::Encoder<'_, D>,
13556 offset: usize,
13557 mut depth: fidl::encoding::Depth,
13558 ) -> fidl::Result<()> {
13559 encoder.debug_check_bounds::<ExposeService>(offset);
13560 let max_ordinal: u64 = self.max_ordinal_present();
13562 encoder.write_num(max_ordinal, offset);
13563 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13564 if max_ordinal == 0 {
13566 return Ok(());
13567 }
13568 depth.increment()?;
13569 let envelope_size = 8;
13570 let bytes_len = max_ordinal as usize * envelope_size;
13571 #[allow(unused_variables)]
13572 let offset = encoder.out_of_line_offset(bytes_len);
13573 let mut _prev_end_offset: usize = 0;
13574 if 1 > max_ordinal {
13575 return Ok(());
13576 }
13577
13578 let cur_offset: usize = (1 - 1) * envelope_size;
13581
13582 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13584
13585 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
13590 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
13591 encoder,
13592 offset + cur_offset,
13593 depth,
13594 )?;
13595
13596 _prev_end_offset = cur_offset + envelope_size;
13597 if 2 > max_ordinal {
13598 return Ok(());
13599 }
13600
13601 let cur_offset: usize = (2 - 1) * envelope_size;
13604
13605 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13607
13608 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
13613 self.source_name.as_ref().map(
13614 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
13615 ),
13616 encoder,
13617 offset + cur_offset,
13618 depth,
13619 )?;
13620
13621 _prev_end_offset = cur_offset + envelope_size;
13622 if 3 > max_ordinal {
13623 return Ok(());
13624 }
13625
13626 let cur_offset: usize = (3 - 1) * envelope_size;
13629
13630 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13632
13633 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
13638 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
13639 encoder,
13640 offset + cur_offset,
13641 depth,
13642 )?;
13643
13644 _prev_end_offset = cur_offset + envelope_size;
13645 if 4 > max_ordinal {
13646 return Ok(());
13647 }
13648
13649 let cur_offset: usize = (4 - 1) * envelope_size;
13652
13653 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13655
13656 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
13661 self.target_name.as_ref().map(
13662 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
13663 ),
13664 encoder,
13665 offset + cur_offset,
13666 depth,
13667 )?;
13668
13669 _prev_end_offset = cur_offset + envelope_size;
13670 if 5 > max_ordinal {
13671 return Ok(());
13672 }
13673
13674 let cur_offset: usize = (5 - 1) * envelope_size;
13677
13678 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13680
13681 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
13686 self.availability
13687 .as_ref()
13688 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
13689 encoder,
13690 offset + cur_offset,
13691 depth,
13692 )?;
13693
13694 _prev_end_offset = cur_offset + envelope_size;
13695 if 6 > max_ordinal {
13696 return Ok(());
13697 }
13698
13699 let cur_offset: usize = (6 - 1) * envelope_size;
13702
13703 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13705
13706 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
13711 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
13712 encoder, offset + cur_offset, depth
13713 )?;
13714
13715 _prev_end_offset = cur_offset + envelope_size;
13716
13717 Ok(())
13718 }
13719 }
13720
13721 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposeService {
13722 #[inline(always)]
13723 fn new_empty() -> Self {
13724 Self::default()
13725 }
13726
13727 unsafe fn decode(
13728 &mut self,
13729 decoder: &mut fidl::encoding::Decoder<'_, D>,
13730 offset: usize,
13731 mut depth: fidl::encoding::Depth,
13732 ) -> fidl::Result<()> {
13733 decoder.debug_check_bounds::<Self>(offset);
13734 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13735 None => return Err(fidl::Error::NotNullable),
13736 Some(len) => len,
13737 };
13738 if len == 0 {
13740 return Ok(());
13741 };
13742 depth.increment()?;
13743 let envelope_size = 8;
13744 let bytes_len = len * envelope_size;
13745 let offset = decoder.out_of_line_offset(bytes_len)?;
13746 let mut _next_ordinal_to_read = 0;
13748 let mut next_offset = offset;
13749 let end_offset = offset + bytes_len;
13750 _next_ordinal_to_read += 1;
13751 if next_offset >= end_offset {
13752 return Ok(());
13753 }
13754
13755 while _next_ordinal_to_read < 1 {
13757 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13758 _next_ordinal_to_read += 1;
13759 next_offset += envelope_size;
13760 }
13761
13762 let next_out_of_line = decoder.next_out_of_line();
13763 let handles_before = decoder.remaining_handles();
13764 if let Some((inlined, num_bytes, num_handles)) =
13765 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13766 {
13767 let member_inline_size =
13768 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13769 if inlined != (member_inline_size <= 4) {
13770 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13771 }
13772 let inner_offset;
13773 let mut inner_depth = depth.clone();
13774 if inlined {
13775 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13776 inner_offset = next_offset;
13777 } else {
13778 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13779 inner_depth.increment()?;
13780 }
13781 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
13782 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
13783 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13784 {
13785 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13786 }
13787 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13788 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13789 }
13790 }
13791
13792 next_offset += envelope_size;
13793 _next_ordinal_to_read += 1;
13794 if next_offset >= end_offset {
13795 return Ok(());
13796 }
13797
13798 while _next_ordinal_to_read < 2 {
13800 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13801 _next_ordinal_to_read += 1;
13802 next_offset += envelope_size;
13803 }
13804
13805 let next_out_of_line = decoder.next_out_of_line();
13806 let handles_before = decoder.remaining_handles();
13807 if let Some((inlined, num_bytes, num_handles)) =
13808 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13809 {
13810 let member_inline_size =
13811 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
13812 decoder.context,
13813 );
13814 if inlined != (member_inline_size <= 4) {
13815 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13816 }
13817 let inner_offset;
13818 let mut inner_depth = depth.clone();
13819 if inlined {
13820 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13821 inner_offset = next_offset;
13822 } else {
13823 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13824 inner_depth.increment()?;
13825 }
13826 let val_ref = self
13827 .source_name
13828 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
13829 fidl::decode!(
13830 fidl::encoding::BoundedString<100>,
13831 D,
13832 val_ref,
13833 decoder,
13834 inner_offset,
13835 inner_depth
13836 )?;
13837 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13838 {
13839 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13840 }
13841 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13842 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13843 }
13844 }
13845
13846 next_offset += envelope_size;
13847 _next_ordinal_to_read += 1;
13848 if next_offset >= end_offset {
13849 return Ok(());
13850 }
13851
13852 while _next_ordinal_to_read < 3 {
13854 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13855 _next_ordinal_to_read += 1;
13856 next_offset += envelope_size;
13857 }
13858
13859 let next_out_of_line = decoder.next_out_of_line();
13860 let handles_before = decoder.remaining_handles();
13861 if let Some((inlined, num_bytes, num_handles)) =
13862 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13863 {
13864 let member_inline_size =
13865 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13866 if inlined != (member_inline_size <= 4) {
13867 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13868 }
13869 let inner_offset;
13870 let mut inner_depth = depth.clone();
13871 if inlined {
13872 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13873 inner_offset = next_offset;
13874 } else {
13875 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13876 inner_depth.increment()?;
13877 }
13878 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
13879 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
13880 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13881 {
13882 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13883 }
13884 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13885 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13886 }
13887 }
13888
13889 next_offset += envelope_size;
13890 _next_ordinal_to_read += 1;
13891 if next_offset >= end_offset {
13892 return Ok(());
13893 }
13894
13895 while _next_ordinal_to_read < 4 {
13897 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13898 _next_ordinal_to_read += 1;
13899 next_offset += envelope_size;
13900 }
13901
13902 let next_out_of_line = decoder.next_out_of_line();
13903 let handles_before = decoder.remaining_handles();
13904 if let Some((inlined, num_bytes, num_handles)) =
13905 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13906 {
13907 let member_inline_size =
13908 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
13909 decoder.context,
13910 );
13911 if inlined != (member_inline_size <= 4) {
13912 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13913 }
13914 let inner_offset;
13915 let mut inner_depth = depth.clone();
13916 if inlined {
13917 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13918 inner_offset = next_offset;
13919 } else {
13920 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13921 inner_depth.increment()?;
13922 }
13923 let val_ref = self
13924 .target_name
13925 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
13926 fidl::decode!(
13927 fidl::encoding::BoundedString<100>,
13928 D,
13929 val_ref,
13930 decoder,
13931 inner_offset,
13932 inner_depth
13933 )?;
13934 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13935 {
13936 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13937 }
13938 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13939 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13940 }
13941 }
13942
13943 next_offset += envelope_size;
13944 _next_ordinal_to_read += 1;
13945 if next_offset >= end_offset {
13946 return Ok(());
13947 }
13948
13949 while _next_ordinal_to_read < 5 {
13951 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13952 _next_ordinal_to_read += 1;
13953 next_offset += envelope_size;
13954 }
13955
13956 let next_out_of_line = decoder.next_out_of_line();
13957 let handles_before = decoder.remaining_handles();
13958 if let Some((inlined, num_bytes, num_handles)) =
13959 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13960 {
13961 let member_inline_size =
13962 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13963 if inlined != (member_inline_size <= 4) {
13964 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13965 }
13966 let inner_offset;
13967 let mut inner_depth = depth.clone();
13968 if inlined {
13969 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13970 inner_offset = next_offset;
13971 } else {
13972 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13973 inner_depth.increment()?;
13974 }
13975 let val_ref =
13976 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
13977 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
13978 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13979 {
13980 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13981 }
13982 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13983 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13984 }
13985 }
13986
13987 next_offset += envelope_size;
13988 _next_ordinal_to_read += 1;
13989 if next_offset >= end_offset {
13990 return Ok(());
13991 }
13992
13993 while _next_ordinal_to_read < 6 {
13995 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13996 _next_ordinal_to_read += 1;
13997 next_offset += envelope_size;
13998 }
13999
14000 let next_out_of_line = decoder.next_out_of_line();
14001 let handles_before = decoder.remaining_handles();
14002 if let Some((inlined, num_bytes, num_handles)) =
14003 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14004 {
14005 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14006 if inlined != (member_inline_size <= 4) {
14007 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14008 }
14009 let inner_offset;
14010 let mut inner_depth = depth.clone();
14011 if inlined {
14012 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14013 inner_offset = next_offset;
14014 } else {
14015 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14016 inner_depth.increment()?;
14017 }
14018 let val_ref = self.source_dictionary.get_or_insert_with(|| {
14019 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
14020 });
14021 fidl::decode!(
14022 fidl::encoding::BoundedString<1024>,
14023 D,
14024 val_ref,
14025 decoder,
14026 inner_offset,
14027 inner_depth
14028 )?;
14029 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14030 {
14031 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14032 }
14033 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14034 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14035 }
14036 }
14037
14038 next_offset += envelope_size;
14039
14040 while next_offset < end_offset {
14042 _next_ordinal_to_read += 1;
14043 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14044 next_offset += envelope_size;
14045 }
14046
14047 Ok(())
14048 }
14049 }
14050
14051 impl OfferConfiguration {
14052 #[inline(always)]
14053 fn max_ordinal_present(&self) -> u64 {
14054 if let Some(_) = self.source_dictionary {
14055 return 6;
14056 }
14057 if let Some(_) = self.availability {
14058 return 5;
14059 }
14060 if let Some(_) = self.target_name {
14061 return 4;
14062 }
14063 if let Some(_) = self.target {
14064 return 3;
14065 }
14066 if let Some(_) = self.source_name {
14067 return 2;
14068 }
14069 if let Some(_) = self.source {
14070 return 1;
14071 }
14072 0
14073 }
14074 }
14075
14076 impl fidl::encoding::ValueTypeMarker for OfferConfiguration {
14077 type Borrowed<'a> = &'a Self;
14078 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14079 value
14080 }
14081 }
14082
14083 unsafe impl fidl::encoding::TypeMarker for OfferConfiguration {
14084 type Owned = Self;
14085
14086 #[inline(always)]
14087 fn inline_align(_context: fidl::encoding::Context) -> usize {
14088 8
14089 }
14090
14091 #[inline(always)]
14092 fn inline_size(_context: fidl::encoding::Context) -> usize {
14093 16
14094 }
14095 }
14096
14097 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferConfiguration, D>
14098 for &OfferConfiguration
14099 {
14100 unsafe fn encode(
14101 self,
14102 encoder: &mut fidl::encoding::Encoder<'_, D>,
14103 offset: usize,
14104 mut depth: fidl::encoding::Depth,
14105 ) -> fidl::Result<()> {
14106 encoder.debug_check_bounds::<OfferConfiguration>(offset);
14107 let max_ordinal: u64 = self.max_ordinal_present();
14109 encoder.write_num(max_ordinal, offset);
14110 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14111 if max_ordinal == 0 {
14113 return Ok(());
14114 }
14115 depth.increment()?;
14116 let envelope_size = 8;
14117 let bytes_len = max_ordinal as usize * envelope_size;
14118 #[allow(unused_variables)]
14119 let offset = encoder.out_of_line_offset(bytes_len);
14120 let mut _prev_end_offset: usize = 0;
14121 if 1 > max_ordinal {
14122 return Ok(());
14123 }
14124
14125 let cur_offset: usize = (1 - 1) * envelope_size;
14128
14129 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14131
14132 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
14137 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
14138 encoder,
14139 offset + cur_offset,
14140 depth,
14141 )?;
14142
14143 _prev_end_offset = cur_offset + envelope_size;
14144 if 2 > max_ordinal {
14145 return Ok(());
14146 }
14147
14148 let cur_offset: usize = (2 - 1) * envelope_size;
14151
14152 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14154
14155 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
14160 self.source_name.as_ref().map(
14161 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
14162 ),
14163 encoder,
14164 offset + cur_offset,
14165 depth,
14166 )?;
14167
14168 _prev_end_offset = cur_offset + envelope_size;
14169 if 3 > max_ordinal {
14170 return Ok(());
14171 }
14172
14173 let cur_offset: usize = (3 - 1) * envelope_size;
14176
14177 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14179
14180 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
14185 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
14186 encoder,
14187 offset + cur_offset,
14188 depth,
14189 )?;
14190
14191 _prev_end_offset = cur_offset + envelope_size;
14192 if 4 > max_ordinal {
14193 return Ok(());
14194 }
14195
14196 let cur_offset: usize = (4 - 1) * envelope_size;
14199
14200 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14202
14203 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
14208 self.target_name.as_ref().map(
14209 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
14210 ),
14211 encoder,
14212 offset + cur_offset,
14213 depth,
14214 )?;
14215
14216 _prev_end_offset = cur_offset + envelope_size;
14217 if 5 > max_ordinal {
14218 return Ok(());
14219 }
14220
14221 let cur_offset: usize = (5 - 1) * envelope_size;
14224
14225 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14227
14228 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
14233 self.availability
14234 .as_ref()
14235 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
14236 encoder,
14237 offset + cur_offset,
14238 depth,
14239 )?;
14240
14241 _prev_end_offset = cur_offset + envelope_size;
14242 if 6 > max_ordinal {
14243 return Ok(());
14244 }
14245
14246 let cur_offset: usize = (6 - 1) * envelope_size;
14249
14250 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14252
14253 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
14258 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
14259 encoder, offset + cur_offset, depth
14260 )?;
14261
14262 _prev_end_offset = cur_offset + envelope_size;
14263
14264 Ok(())
14265 }
14266 }
14267
14268 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferConfiguration {
14269 #[inline(always)]
14270 fn new_empty() -> Self {
14271 Self::default()
14272 }
14273
14274 unsafe fn decode(
14275 &mut self,
14276 decoder: &mut fidl::encoding::Decoder<'_, D>,
14277 offset: usize,
14278 mut depth: fidl::encoding::Depth,
14279 ) -> fidl::Result<()> {
14280 decoder.debug_check_bounds::<Self>(offset);
14281 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14282 None => return Err(fidl::Error::NotNullable),
14283 Some(len) => len,
14284 };
14285 if len == 0 {
14287 return Ok(());
14288 };
14289 depth.increment()?;
14290 let envelope_size = 8;
14291 let bytes_len = len * envelope_size;
14292 let offset = decoder.out_of_line_offset(bytes_len)?;
14293 let mut _next_ordinal_to_read = 0;
14295 let mut next_offset = offset;
14296 let end_offset = offset + bytes_len;
14297 _next_ordinal_to_read += 1;
14298 if next_offset >= end_offset {
14299 return Ok(());
14300 }
14301
14302 while _next_ordinal_to_read < 1 {
14304 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14305 _next_ordinal_to_read += 1;
14306 next_offset += envelope_size;
14307 }
14308
14309 let next_out_of_line = decoder.next_out_of_line();
14310 let handles_before = decoder.remaining_handles();
14311 if let Some((inlined, num_bytes, num_handles)) =
14312 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14313 {
14314 let member_inline_size =
14315 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14316 if inlined != (member_inline_size <= 4) {
14317 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14318 }
14319 let inner_offset;
14320 let mut inner_depth = depth.clone();
14321 if inlined {
14322 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14323 inner_offset = next_offset;
14324 } else {
14325 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14326 inner_depth.increment()?;
14327 }
14328 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
14329 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
14330 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14331 {
14332 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14333 }
14334 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14335 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14336 }
14337 }
14338
14339 next_offset += envelope_size;
14340 _next_ordinal_to_read += 1;
14341 if next_offset >= end_offset {
14342 return Ok(());
14343 }
14344
14345 while _next_ordinal_to_read < 2 {
14347 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14348 _next_ordinal_to_read += 1;
14349 next_offset += envelope_size;
14350 }
14351
14352 let next_out_of_line = decoder.next_out_of_line();
14353 let handles_before = decoder.remaining_handles();
14354 if let Some((inlined, num_bytes, num_handles)) =
14355 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14356 {
14357 let member_inline_size =
14358 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
14359 decoder.context,
14360 );
14361 if inlined != (member_inline_size <= 4) {
14362 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14363 }
14364 let inner_offset;
14365 let mut inner_depth = depth.clone();
14366 if inlined {
14367 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14368 inner_offset = next_offset;
14369 } else {
14370 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14371 inner_depth.increment()?;
14372 }
14373 let val_ref = self
14374 .source_name
14375 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
14376 fidl::decode!(
14377 fidl::encoding::BoundedString<100>,
14378 D,
14379 val_ref,
14380 decoder,
14381 inner_offset,
14382 inner_depth
14383 )?;
14384 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14385 {
14386 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14387 }
14388 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14389 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14390 }
14391 }
14392
14393 next_offset += envelope_size;
14394 _next_ordinal_to_read += 1;
14395 if next_offset >= end_offset {
14396 return Ok(());
14397 }
14398
14399 while _next_ordinal_to_read < 3 {
14401 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14402 _next_ordinal_to_read += 1;
14403 next_offset += envelope_size;
14404 }
14405
14406 let next_out_of_line = decoder.next_out_of_line();
14407 let handles_before = decoder.remaining_handles();
14408 if let Some((inlined, num_bytes, num_handles)) =
14409 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14410 {
14411 let member_inline_size =
14412 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14413 if inlined != (member_inline_size <= 4) {
14414 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14415 }
14416 let inner_offset;
14417 let mut inner_depth = depth.clone();
14418 if inlined {
14419 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14420 inner_offset = next_offset;
14421 } else {
14422 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14423 inner_depth.increment()?;
14424 }
14425 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
14426 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
14427 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14428 {
14429 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14430 }
14431 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14432 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14433 }
14434 }
14435
14436 next_offset += envelope_size;
14437 _next_ordinal_to_read += 1;
14438 if next_offset >= end_offset {
14439 return Ok(());
14440 }
14441
14442 while _next_ordinal_to_read < 4 {
14444 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14445 _next_ordinal_to_read += 1;
14446 next_offset += envelope_size;
14447 }
14448
14449 let next_out_of_line = decoder.next_out_of_line();
14450 let handles_before = decoder.remaining_handles();
14451 if let Some((inlined, num_bytes, num_handles)) =
14452 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14453 {
14454 let member_inline_size =
14455 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
14456 decoder.context,
14457 );
14458 if inlined != (member_inline_size <= 4) {
14459 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14460 }
14461 let inner_offset;
14462 let mut inner_depth = depth.clone();
14463 if inlined {
14464 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14465 inner_offset = next_offset;
14466 } else {
14467 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14468 inner_depth.increment()?;
14469 }
14470 let val_ref = self
14471 .target_name
14472 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
14473 fidl::decode!(
14474 fidl::encoding::BoundedString<100>,
14475 D,
14476 val_ref,
14477 decoder,
14478 inner_offset,
14479 inner_depth
14480 )?;
14481 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14482 {
14483 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14484 }
14485 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14486 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14487 }
14488 }
14489
14490 next_offset += envelope_size;
14491 _next_ordinal_to_read += 1;
14492 if next_offset >= end_offset {
14493 return Ok(());
14494 }
14495
14496 while _next_ordinal_to_read < 5 {
14498 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14499 _next_ordinal_to_read += 1;
14500 next_offset += envelope_size;
14501 }
14502
14503 let next_out_of_line = decoder.next_out_of_line();
14504 let handles_before = decoder.remaining_handles();
14505 if let Some((inlined, num_bytes, num_handles)) =
14506 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14507 {
14508 let member_inline_size =
14509 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14510 if inlined != (member_inline_size <= 4) {
14511 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14512 }
14513 let inner_offset;
14514 let mut inner_depth = depth.clone();
14515 if inlined {
14516 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14517 inner_offset = next_offset;
14518 } else {
14519 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14520 inner_depth.increment()?;
14521 }
14522 let val_ref =
14523 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
14524 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
14525 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14526 {
14527 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14528 }
14529 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14530 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14531 }
14532 }
14533
14534 next_offset += envelope_size;
14535 _next_ordinal_to_read += 1;
14536 if next_offset >= end_offset {
14537 return Ok(());
14538 }
14539
14540 while _next_ordinal_to_read < 6 {
14542 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14543 _next_ordinal_to_read += 1;
14544 next_offset += envelope_size;
14545 }
14546
14547 let next_out_of_line = decoder.next_out_of_line();
14548 let handles_before = decoder.remaining_handles();
14549 if let Some((inlined, num_bytes, num_handles)) =
14550 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14551 {
14552 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14553 if inlined != (member_inline_size <= 4) {
14554 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14555 }
14556 let inner_offset;
14557 let mut inner_depth = depth.clone();
14558 if inlined {
14559 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14560 inner_offset = next_offset;
14561 } else {
14562 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14563 inner_depth.increment()?;
14564 }
14565 let val_ref = self.source_dictionary.get_or_insert_with(|| {
14566 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
14567 });
14568 fidl::decode!(
14569 fidl::encoding::BoundedString<1024>,
14570 D,
14571 val_ref,
14572 decoder,
14573 inner_offset,
14574 inner_depth
14575 )?;
14576 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14577 {
14578 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14579 }
14580 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14581 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14582 }
14583 }
14584
14585 next_offset += envelope_size;
14586
14587 while next_offset < end_offset {
14589 _next_ordinal_to_read += 1;
14590 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14591 next_offset += envelope_size;
14592 }
14593
14594 Ok(())
14595 }
14596 }
14597
14598 impl OfferDictionary {
14599 #[inline(always)]
14600 fn max_ordinal_present(&self) -> u64 {
14601 if let Some(_) = self.source_dictionary {
14602 return 7;
14603 }
14604 if let Some(_) = self.availability {
14605 return 6;
14606 }
14607 if let Some(_) = self.dependency_type {
14608 return 5;
14609 }
14610 if let Some(_) = self.target_name {
14611 return 4;
14612 }
14613 if let Some(_) = self.target {
14614 return 3;
14615 }
14616 if let Some(_) = self.source_name {
14617 return 2;
14618 }
14619 if let Some(_) = self.source {
14620 return 1;
14621 }
14622 0
14623 }
14624 }
14625
14626 impl fidl::encoding::ValueTypeMarker for OfferDictionary {
14627 type Borrowed<'a> = &'a Self;
14628 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14629 value
14630 }
14631 }
14632
14633 unsafe impl fidl::encoding::TypeMarker for OfferDictionary {
14634 type Owned = Self;
14635
14636 #[inline(always)]
14637 fn inline_align(_context: fidl::encoding::Context) -> usize {
14638 8
14639 }
14640
14641 #[inline(always)]
14642 fn inline_size(_context: fidl::encoding::Context) -> usize {
14643 16
14644 }
14645 }
14646
14647 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferDictionary, D>
14648 for &OfferDictionary
14649 {
14650 unsafe fn encode(
14651 self,
14652 encoder: &mut fidl::encoding::Encoder<'_, D>,
14653 offset: usize,
14654 mut depth: fidl::encoding::Depth,
14655 ) -> fidl::Result<()> {
14656 encoder.debug_check_bounds::<OfferDictionary>(offset);
14657 let max_ordinal: u64 = self.max_ordinal_present();
14659 encoder.write_num(max_ordinal, offset);
14660 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14661 if max_ordinal == 0 {
14663 return Ok(());
14664 }
14665 depth.increment()?;
14666 let envelope_size = 8;
14667 let bytes_len = max_ordinal as usize * envelope_size;
14668 #[allow(unused_variables)]
14669 let offset = encoder.out_of_line_offset(bytes_len);
14670 let mut _prev_end_offset: usize = 0;
14671 if 1 > max_ordinal {
14672 return Ok(());
14673 }
14674
14675 let cur_offset: usize = (1 - 1) * envelope_size;
14678
14679 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14681
14682 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
14687 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
14688 encoder,
14689 offset + cur_offset,
14690 depth,
14691 )?;
14692
14693 _prev_end_offset = cur_offset + envelope_size;
14694 if 2 > max_ordinal {
14695 return Ok(());
14696 }
14697
14698 let cur_offset: usize = (2 - 1) * envelope_size;
14701
14702 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14704
14705 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
14710 self.source_name.as_ref().map(
14711 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
14712 ),
14713 encoder,
14714 offset + cur_offset,
14715 depth,
14716 )?;
14717
14718 _prev_end_offset = cur_offset + envelope_size;
14719 if 3 > max_ordinal {
14720 return Ok(());
14721 }
14722
14723 let cur_offset: usize = (3 - 1) * envelope_size;
14726
14727 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14729
14730 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
14735 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
14736 encoder,
14737 offset + cur_offset,
14738 depth,
14739 )?;
14740
14741 _prev_end_offset = cur_offset + envelope_size;
14742 if 4 > max_ordinal {
14743 return Ok(());
14744 }
14745
14746 let cur_offset: usize = (4 - 1) * envelope_size;
14749
14750 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14752
14753 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
14758 self.target_name.as_ref().map(
14759 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
14760 ),
14761 encoder,
14762 offset + cur_offset,
14763 depth,
14764 )?;
14765
14766 _prev_end_offset = cur_offset + envelope_size;
14767 if 5 > max_ordinal {
14768 return Ok(());
14769 }
14770
14771 let cur_offset: usize = (5 - 1) * envelope_size;
14774
14775 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14777
14778 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
14783 self.dependency_type
14784 .as_ref()
14785 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
14786 encoder,
14787 offset + cur_offset,
14788 depth,
14789 )?;
14790
14791 _prev_end_offset = cur_offset + envelope_size;
14792 if 6 > max_ordinal {
14793 return Ok(());
14794 }
14795
14796 let cur_offset: usize = (6 - 1) * envelope_size;
14799
14800 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14802
14803 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
14808 self.availability
14809 .as_ref()
14810 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
14811 encoder,
14812 offset + cur_offset,
14813 depth,
14814 )?;
14815
14816 _prev_end_offset = cur_offset + envelope_size;
14817 if 7 > max_ordinal {
14818 return Ok(());
14819 }
14820
14821 let cur_offset: usize = (7 - 1) * envelope_size;
14824
14825 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14827
14828 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
14833 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
14834 encoder, offset + cur_offset, depth
14835 )?;
14836
14837 _prev_end_offset = cur_offset + envelope_size;
14838
14839 Ok(())
14840 }
14841 }
14842
14843 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferDictionary {
14844 #[inline(always)]
14845 fn new_empty() -> Self {
14846 Self::default()
14847 }
14848
14849 unsafe fn decode(
14850 &mut self,
14851 decoder: &mut fidl::encoding::Decoder<'_, D>,
14852 offset: usize,
14853 mut depth: fidl::encoding::Depth,
14854 ) -> fidl::Result<()> {
14855 decoder.debug_check_bounds::<Self>(offset);
14856 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14857 None => return Err(fidl::Error::NotNullable),
14858 Some(len) => len,
14859 };
14860 if len == 0 {
14862 return Ok(());
14863 };
14864 depth.increment()?;
14865 let envelope_size = 8;
14866 let bytes_len = len * envelope_size;
14867 let offset = decoder.out_of_line_offset(bytes_len)?;
14868 let mut _next_ordinal_to_read = 0;
14870 let mut next_offset = offset;
14871 let end_offset = offset + bytes_len;
14872 _next_ordinal_to_read += 1;
14873 if next_offset >= end_offset {
14874 return Ok(());
14875 }
14876
14877 while _next_ordinal_to_read < 1 {
14879 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14880 _next_ordinal_to_read += 1;
14881 next_offset += envelope_size;
14882 }
14883
14884 let next_out_of_line = decoder.next_out_of_line();
14885 let handles_before = decoder.remaining_handles();
14886 if let Some((inlined, num_bytes, num_handles)) =
14887 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14888 {
14889 let member_inline_size =
14890 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14891 if inlined != (member_inline_size <= 4) {
14892 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14893 }
14894 let inner_offset;
14895 let mut inner_depth = depth.clone();
14896 if inlined {
14897 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14898 inner_offset = next_offset;
14899 } else {
14900 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14901 inner_depth.increment()?;
14902 }
14903 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
14904 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
14905 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14906 {
14907 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14908 }
14909 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14910 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14911 }
14912 }
14913
14914 next_offset += envelope_size;
14915 _next_ordinal_to_read += 1;
14916 if next_offset >= end_offset {
14917 return Ok(());
14918 }
14919
14920 while _next_ordinal_to_read < 2 {
14922 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14923 _next_ordinal_to_read += 1;
14924 next_offset += envelope_size;
14925 }
14926
14927 let next_out_of_line = decoder.next_out_of_line();
14928 let handles_before = decoder.remaining_handles();
14929 if let Some((inlined, num_bytes, num_handles)) =
14930 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14931 {
14932 let member_inline_size =
14933 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
14934 decoder.context,
14935 );
14936 if inlined != (member_inline_size <= 4) {
14937 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14938 }
14939 let inner_offset;
14940 let mut inner_depth = depth.clone();
14941 if inlined {
14942 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14943 inner_offset = next_offset;
14944 } else {
14945 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14946 inner_depth.increment()?;
14947 }
14948 let val_ref = self
14949 .source_name
14950 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
14951 fidl::decode!(
14952 fidl::encoding::BoundedString<100>,
14953 D,
14954 val_ref,
14955 decoder,
14956 inner_offset,
14957 inner_depth
14958 )?;
14959 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14960 {
14961 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14962 }
14963 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14964 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14965 }
14966 }
14967
14968 next_offset += envelope_size;
14969 _next_ordinal_to_read += 1;
14970 if next_offset >= end_offset {
14971 return Ok(());
14972 }
14973
14974 while _next_ordinal_to_read < 3 {
14976 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14977 _next_ordinal_to_read += 1;
14978 next_offset += envelope_size;
14979 }
14980
14981 let next_out_of_line = decoder.next_out_of_line();
14982 let handles_before = decoder.remaining_handles();
14983 if let Some((inlined, num_bytes, num_handles)) =
14984 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14985 {
14986 let member_inline_size =
14987 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14988 if inlined != (member_inline_size <= 4) {
14989 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14990 }
14991 let inner_offset;
14992 let mut inner_depth = depth.clone();
14993 if inlined {
14994 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14995 inner_offset = next_offset;
14996 } else {
14997 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14998 inner_depth.increment()?;
14999 }
15000 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
15001 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
15002 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15003 {
15004 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15005 }
15006 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15007 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15008 }
15009 }
15010
15011 next_offset += envelope_size;
15012 _next_ordinal_to_read += 1;
15013 if next_offset >= end_offset {
15014 return Ok(());
15015 }
15016
15017 while _next_ordinal_to_read < 4 {
15019 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15020 _next_ordinal_to_read += 1;
15021 next_offset += envelope_size;
15022 }
15023
15024 let next_out_of_line = decoder.next_out_of_line();
15025 let handles_before = decoder.remaining_handles();
15026 if let Some((inlined, num_bytes, num_handles)) =
15027 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15028 {
15029 let member_inline_size =
15030 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
15031 decoder.context,
15032 );
15033 if inlined != (member_inline_size <= 4) {
15034 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15035 }
15036 let inner_offset;
15037 let mut inner_depth = depth.clone();
15038 if inlined {
15039 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15040 inner_offset = next_offset;
15041 } else {
15042 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15043 inner_depth.increment()?;
15044 }
15045 let val_ref = self
15046 .target_name
15047 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
15048 fidl::decode!(
15049 fidl::encoding::BoundedString<100>,
15050 D,
15051 val_ref,
15052 decoder,
15053 inner_offset,
15054 inner_depth
15055 )?;
15056 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15057 {
15058 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15059 }
15060 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15061 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15062 }
15063 }
15064
15065 next_offset += envelope_size;
15066 _next_ordinal_to_read += 1;
15067 if next_offset >= end_offset {
15068 return Ok(());
15069 }
15070
15071 while _next_ordinal_to_read < 5 {
15073 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15074 _next_ordinal_to_read += 1;
15075 next_offset += envelope_size;
15076 }
15077
15078 let next_out_of_line = decoder.next_out_of_line();
15079 let handles_before = decoder.remaining_handles();
15080 if let Some((inlined, num_bytes, num_handles)) =
15081 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15082 {
15083 let member_inline_size =
15084 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15085 if inlined != (member_inline_size <= 4) {
15086 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15087 }
15088 let inner_offset;
15089 let mut inner_depth = depth.clone();
15090 if inlined {
15091 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15092 inner_offset = next_offset;
15093 } else {
15094 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15095 inner_depth.increment()?;
15096 }
15097 let val_ref =
15098 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
15099 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
15100 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15101 {
15102 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15103 }
15104 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15105 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15106 }
15107 }
15108
15109 next_offset += envelope_size;
15110 _next_ordinal_to_read += 1;
15111 if next_offset >= end_offset {
15112 return Ok(());
15113 }
15114
15115 while _next_ordinal_to_read < 6 {
15117 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15118 _next_ordinal_to_read += 1;
15119 next_offset += envelope_size;
15120 }
15121
15122 let next_out_of_line = decoder.next_out_of_line();
15123 let handles_before = decoder.remaining_handles();
15124 if let Some((inlined, num_bytes, num_handles)) =
15125 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15126 {
15127 let member_inline_size =
15128 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15129 if inlined != (member_inline_size <= 4) {
15130 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15131 }
15132 let inner_offset;
15133 let mut inner_depth = depth.clone();
15134 if inlined {
15135 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15136 inner_offset = next_offset;
15137 } else {
15138 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15139 inner_depth.increment()?;
15140 }
15141 let val_ref =
15142 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
15143 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
15144 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15145 {
15146 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15147 }
15148 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15149 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15150 }
15151 }
15152
15153 next_offset += envelope_size;
15154 _next_ordinal_to_read += 1;
15155 if next_offset >= end_offset {
15156 return Ok(());
15157 }
15158
15159 while _next_ordinal_to_read < 7 {
15161 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15162 _next_ordinal_to_read += 1;
15163 next_offset += envelope_size;
15164 }
15165
15166 let next_out_of_line = decoder.next_out_of_line();
15167 let handles_before = decoder.remaining_handles();
15168 if let Some((inlined, num_bytes, num_handles)) =
15169 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15170 {
15171 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15172 if inlined != (member_inline_size <= 4) {
15173 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15174 }
15175 let inner_offset;
15176 let mut inner_depth = depth.clone();
15177 if inlined {
15178 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15179 inner_offset = next_offset;
15180 } else {
15181 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15182 inner_depth.increment()?;
15183 }
15184 let val_ref = self.source_dictionary.get_or_insert_with(|| {
15185 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
15186 });
15187 fidl::decode!(
15188 fidl::encoding::BoundedString<1024>,
15189 D,
15190 val_ref,
15191 decoder,
15192 inner_offset,
15193 inner_depth
15194 )?;
15195 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15196 {
15197 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15198 }
15199 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15200 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15201 }
15202 }
15203
15204 next_offset += envelope_size;
15205
15206 while next_offset < end_offset {
15208 _next_ordinal_to_read += 1;
15209 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15210 next_offset += envelope_size;
15211 }
15212
15213 Ok(())
15214 }
15215 }
15216
15217 impl OfferDirectory {
15218 #[inline(always)]
15219 fn max_ordinal_present(&self) -> u64 {
15220 if let Some(_) = self.source_dictionary {
15221 return 9;
15222 }
15223 if let Some(_) = self.availability {
15224 return 8;
15225 }
15226 if let Some(_) = self.dependency_type {
15227 return 7;
15228 }
15229 if let Some(_) = self.subdir {
15230 return 6;
15231 }
15232 if let Some(_) = self.rights {
15233 return 5;
15234 }
15235 if let Some(_) = self.target_name {
15236 return 4;
15237 }
15238 if let Some(_) = self.target {
15239 return 3;
15240 }
15241 if let Some(_) = self.source_name {
15242 return 2;
15243 }
15244 if let Some(_) = self.source {
15245 return 1;
15246 }
15247 0
15248 }
15249 }
15250
15251 impl fidl::encoding::ValueTypeMarker for OfferDirectory {
15252 type Borrowed<'a> = &'a Self;
15253 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15254 value
15255 }
15256 }
15257
15258 unsafe impl fidl::encoding::TypeMarker for OfferDirectory {
15259 type Owned = Self;
15260
15261 #[inline(always)]
15262 fn inline_align(_context: fidl::encoding::Context) -> usize {
15263 8
15264 }
15265
15266 #[inline(always)]
15267 fn inline_size(_context: fidl::encoding::Context) -> usize {
15268 16
15269 }
15270 }
15271
15272 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferDirectory, D>
15273 for &OfferDirectory
15274 {
15275 unsafe fn encode(
15276 self,
15277 encoder: &mut fidl::encoding::Encoder<'_, D>,
15278 offset: usize,
15279 mut depth: fidl::encoding::Depth,
15280 ) -> fidl::Result<()> {
15281 encoder.debug_check_bounds::<OfferDirectory>(offset);
15282 let max_ordinal: u64 = self.max_ordinal_present();
15284 encoder.write_num(max_ordinal, offset);
15285 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15286 if max_ordinal == 0 {
15288 return Ok(());
15289 }
15290 depth.increment()?;
15291 let envelope_size = 8;
15292 let bytes_len = max_ordinal as usize * envelope_size;
15293 #[allow(unused_variables)]
15294 let offset = encoder.out_of_line_offset(bytes_len);
15295 let mut _prev_end_offset: usize = 0;
15296 if 1 > max_ordinal {
15297 return Ok(());
15298 }
15299
15300 let cur_offset: usize = (1 - 1) * envelope_size;
15303
15304 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15306
15307 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
15312 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
15313 encoder,
15314 offset + cur_offset,
15315 depth,
15316 )?;
15317
15318 _prev_end_offset = cur_offset + envelope_size;
15319 if 2 > max_ordinal {
15320 return Ok(());
15321 }
15322
15323 let cur_offset: usize = (2 - 1) * envelope_size;
15326
15327 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15329
15330 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
15335 self.source_name.as_ref().map(
15336 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
15337 ),
15338 encoder,
15339 offset + cur_offset,
15340 depth,
15341 )?;
15342
15343 _prev_end_offset = cur_offset + envelope_size;
15344 if 3 > max_ordinal {
15345 return Ok(());
15346 }
15347
15348 let cur_offset: usize = (3 - 1) * envelope_size;
15351
15352 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15354
15355 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
15360 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
15361 encoder,
15362 offset + cur_offset,
15363 depth,
15364 )?;
15365
15366 _prev_end_offset = cur_offset + envelope_size;
15367 if 4 > max_ordinal {
15368 return Ok(());
15369 }
15370
15371 let cur_offset: usize = (4 - 1) * envelope_size;
15374
15375 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15377
15378 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
15383 self.target_name.as_ref().map(
15384 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
15385 ),
15386 encoder,
15387 offset + cur_offset,
15388 depth,
15389 )?;
15390
15391 _prev_end_offset = cur_offset + envelope_size;
15392 if 5 > max_ordinal {
15393 return Ok(());
15394 }
15395
15396 let cur_offset: usize = (5 - 1) * envelope_size;
15399
15400 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15402
15403 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_io::Operations, D>(
15408 self.rights
15409 .as_ref()
15410 .map(<fidl_fuchsia_io::Operations as fidl::encoding::ValueTypeMarker>::borrow),
15411 encoder,
15412 offset + cur_offset,
15413 depth,
15414 )?;
15415
15416 _prev_end_offset = cur_offset + envelope_size;
15417 if 6 > max_ordinal {
15418 return Ok(());
15419 }
15420
15421 let cur_offset: usize = (6 - 1) * envelope_size;
15424
15425 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15427
15428 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
15433 self.subdir.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
15434 encoder, offset + cur_offset, depth
15435 )?;
15436
15437 _prev_end_offset = cur_offset + envelope_size;
15438 if 7 > max_ordinal {
15439 return Ok(());
15440 }
15441
15442 let cur_offset: usize = (7 - 1) * envelope_size;
15445
15446 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15448
15449 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
15454 self.dependency_type
15455 .as_ref()
15456 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
15457 encoder,
15458 offset + cur_offset,
15459 depth,
15460 )?;
15461
15462 _prev_end_offset = cur_offset + envelope_size;
15463 if 8 > max_ordinal {
15464 return Ok(());
15465 }
15466
15467 let cur_offset: usize = (8 - 1) * envelope_size;
15470
15471 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15473
15474 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
15479 self.availability
15480 .as_ref()
15481 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
15482 encoder,
15483 offset + cur_offset,
15484 depth,
15485 )?;
15486
15487 _prev_end_offset = cur_offset + envelope_size;
15488 if 9 > max_ordinal {
15489 return Ok(());
15490 }
15491
15492 let cur_offset: usize = (9 - 1) * envelope_size;
15495
15496 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15498
15499 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
15504 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
15505 encoder, offset + cur_offset, depth
15506 )?;
15507
15508 _prev_end_offset = cur_offset + envelope_size;
15509
15510 Ok(())
15511 }
15512 }
15513
15514 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferDirectory {
15515 #[inline(always)]
15516 fn new_empty() -> Self {
15517 Self::default()
15518 }
15519
15520 unsafe fn decode(
15521 &mut self,
15522 decoder: &mut fidl::encoding::Decoder<'_, D>,
15523 offset: usize,
15524 mut depth: fidl::encoding::Depth,
15525 ) -> fidl::Result<()> {
15526 decoder.debug_check_bounds::<Self>(offset);
15527 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15528 None => return Err(fidl::Error::NotNullable),
15529 Some(len) => len,
15530 };
15531 if len == 0 {
15533 return Ok(());
15534 };
15535 depth.increment()?;
15536 let envelope_size = 8;
15537 let bytes_len = len * envelope_size;
15538 let offset = decoder.out_of_line_offset(bytes_len)?;
15539 let mut _next_ordinal_to_read = 0;
15541 let mut next_offset = offset;
15542 let end_offset = offset + bytes_len;
15543 _next_ordinal_to_read += 1;
15544 if next_offset >= end_offset {
15545 return Ok(());
15546 }
15547
15548 while _next_ordinal_to_read < 1 {
15550 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15551 _next_ordinal_to_read += 1;
15552 next_offset += envelope_size;
15553 }
15554
15555 let next_out_of_line = decoder.next_out_of_line();
15556 let handles_before = decoder.remaining_handles();
15557 if let Some((inlined, num_bytes, num_handles)) =
15558 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15559 {
15560 let member_inline_size =
15561 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15562 if inlined != (member_inline_size <= 4) {
15563 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15564 }
15565 let inner_offset;
15566 let mut inner_depth = depth.clone();
15567 if inlined {
15568 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15569 inner_offset = next_offset;
15570 } else {
15571 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15572 inner_depth.increment()?;
15573 }
15574 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
15575 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
15576 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15577 {
15578 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15579 }
15580 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15581 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15582 }
15583 }
15584
15585 next_offset += envelope_size;
15586 _next_ordinal_to_read += 1;
15587 if next_offset >= end_offset {
15588 return Ok(());
15589 }
15590
15591 while _next_ordinal_to_read < 2 {
15593 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15594 _next_ordinal_to_read += 1;
15595 next_offset += envelope_size;
15596 }
15597
15598 let next_out_of_line = decoder.next_out_of_line();
15599 let handles_before = decoder.remaining_handles();
15600 if let Some((inlined, num_bytes, num_handles)) =
15601 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15602 {
15603 let member_inline_size =
15604 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
15605 decoder.context,
15606 );
15607 if inlined != (member_inline_size <= 4) {
15608 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15609 }
15610 let inner_offset;
15611 let mut inner_depth = depth.clone();
15612 if inlined {
15613 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15614 inner_offset = next_offset;
15615 } else {
15616 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15617 inner_depth.increment()?;
15618 }
15619 let val_ref = self
15620 .source_name
15621 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
15622 fidl::decode!(
15623 fidl::encoding::BoundedString<100>,
15624 D,
15625 val_ref,
15626 decoder,
15627 inner_offset,
15628 inner_depth
15629 )?;
15630 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15631 {
15632 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15633 }
15634 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15635 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15636 }
15637 }
15638
15639 next_offset += envelope_size;
15640 _next_ordinal_to_read += 1;
15641 if next_offset >= end_offset {
15642 return Ok(());
15643 }
15644
15645 while _next_ordinal_to_read < 3 {
15647 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15648 _next_ordinal_to_read += 1;
15649 next_offset += envelope_size;
15650 }
15651
15652 let next_out_of_line = decoder.next_out_of_line();
15653 let handles_before = decoder.remaining_handles();
15654 if let Some((inlined, num_bytes, num_handles)) =
15655 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15656 {
15657 let member_inline_size =
15658 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15659 if inlined != (member_inline_size <= 4) {
15660 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15661 }
15662 let inner_offset;
15663 let mut inner_depth = depth.clone();
15664 if inlined {
15665 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15666 inner_offset = next_offset;
15667 } else {
15668 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15669 inner_depth.increment()?;
15670 }
15671 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
15672 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
15673 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15674 {
15675 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15676 }
15677 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15678 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15679 }
15680 }
15681
15682 next_offset += envelope_size;
15683 _next_ordinal_to_read += 1;
15684 if next_offset >= end_offset {
15685 return Ok(());
15686 }
15687
15688 while _next_ordinal_to_read < 4 {
15690 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15691 _next_ordinal_to_read += 1;
15692 next_offset += envelope_size;
15693 }
15694
15695 let next_out_of_line = decoder.next_out_of_line();
15696 let handles_before = decoder.remaining_handles();
15697 if let Some((inlined, num_bytes, num_handles)) =
15698 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15699 {
15700 let member_inline_size =
15701 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
15702 decoder.context,
15703 );
15704 if inlined != (member_inline_size <= 4) {
15705 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15706 }
15707 let inner_offset;
15708 let mut inner_depth = depth.clone();
15709 if inlined {
15710 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15711 inner_offset = next_offset;
15712 } else {
15713 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15714 inner_depth.increment()?;
15715 }
15716 let val_ref = self
15717 .target_name
15718 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
15719 fidl::decode!(
15720 fidl::encoding::BoundedString<100>,
15721 D,
15722 val_ref,
15723 decoder,
15724 inner_offset,
15725 inner_depth
15726 )?;
15727 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15728 {
15729 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15730 }
15731 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15732 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15733 }
15734 }
15735
15736 next_offset += envelope_size;
15737 _next_ordinal_to_read += 1;
15738 if next_offset >= end_offset {
15739 return Ok(());
15740 }
15741
15742 while _next_ordinal_to_read < 5 {
15744 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15745 _next_ordinal_to_read += 1;
15746 next_offset += envelope_size;
15747 }
15748
15749 let next_out_of_line = decoder.next_out_of_line();
15750 let handles_before = decoder.remaining_handles();
15751 if let Some((inlined, num_bytes, num_handles)) =
15752 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15753 {
15754 let member_inline_size =
15755 <fidl_fuchsia_io::Operations as fidl::encoding::TypeMarker>::inline_size(
15756 decoder.context,
15757 );
15758 if inlined != (member_inline_size <= 4) {
15759 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15760 }
15761 let inner_offset;
15762 let mut inner_depth = depth.clone();
15763 if inlined {
15764 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15765 inner_offset = next_offset;
15766 } else {
15767 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15768 inner_depth.increment()?;
15769 }
15770 let val_ref = self
15771 .rights
15772 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_io::Operations, D));
15773 fidl::decode!(
15774 fidl_fuchsia_io::Operations,
15775 D,
15776 val_ref,
15777 decoder,
15778 inner_offset,
15779 inner_depth
15780 )?;
15781 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15782 {
15783 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15784 }
15785 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15786 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15787 }
15788 }
15789
15790 next_offset += envelope_size;
15791 _next_ordinal_to_read += 1;
15792 if next_offset >= end_offset {
15793 return Ok(());
15794 }
15795
15796 while _next_ordinal_to_read < 6 {
15798 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15799 _next_ordinal_to_read += 1;
15800 next_offset += envelope_size;
15801 }
15802
15803 let next_out_of_line = decoder.next_out_of_line();
15804 let handles_before = decoder.remaining_handles();
15805 if let Some((inlined, num_bytes, num_handles)) =
15806 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15807 {
15808 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15809 if inlined != (member_inline_size <= 4) {
15810 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15811 }
15812 let inner_offset;
15813 let mut inner_depth = depth.clone();
15814 if inlined {
15815 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15816 inner_offset = next_offset;
15817 } else {
15818 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15819 inner_depth.increment()?;
15820 }
15821 let val_ref = self.subdir.get_or_insert_with(|| {
15822 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
15823 });
15824 fidl::decode!(
15825 fidl::encoding::BoundedString<1024>,
15826 D,
15827 val_ref,
15828 decoder,
15829 inner_offset,
15830 inner_depth
15831 )?;
15832 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15833 {
15834 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15835 }
15836 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15837 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15838 }
15839 }
15840
15841 next_offset += envelope_size;
15842 _next_ordinal_to_read += 1;
15843 if next_offset >= end_offset {
15844 return Ok(());
15845 }
15846
15847 while _next_ordinal_to_read < 7 {
15849 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15850 _next_ordinal_to_read += 1;
15851 next_offset += envelope_size;
15852 }
15853
15854 let next_out_of_line = decoder.next_out_of_line();
15855 let handles_before = decoder.remaining_handles();
15856 if let Some((inlined, num_bytes, num_handles)) =
15857 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15858 {
15859 let member_inline_size =
15860 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15861 if inlined != (member_inline_size <= 4) {
15862 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15863 }
15864 let inner_offset;
15865 let mut inner_depth = depth.clone();
15866 if inlined {
15867 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15868 inner_offset = next_offset;
15869 } else {
15870 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15871 inner_depth.increment()?;
15872 }
15873 let val_ref =
15874 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
15875 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
15876 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15877 {
15878 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15879 }
15880 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15881 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15882 }
15883 }
15884
15885 next_offset += envelope_size;
15886 _next_ordinal_to_read += 1;
15887 if next_offset >= end_offset {
15888 return Ok(());
15889 }
15890
15891 while _next_ordinal_to_read < 8 {
15893 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15894 _next_ordinal_to_read += 1;
15895 next_offset += envelope_size;
15896 }
15897
15898 let next_out_of_line = decoder.next_out_of_line();
15899 let handles_before = decoder.remaining_handles();
15900 if let Some((inlined, num_bytes, num_handles)) =
15901 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15902 {
15903 let member_inline_size =
15904 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15905 if inlined != (member_inline_size <= 4) {
15906 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15907 }
15908 let inner_offset;
15909 let mut inner_depth = depth.clone();
15910 if inlined {
15911 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15912 inner_offset = next_offset;
15913 } else {
15914 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15915 inner_depth.increment()?;
15916 }
15917 let val_ref =
15918 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
15919 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
15920 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15921 {
15922 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15923 }
15924 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15925 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15926 }
15927 }
15928
15929 next_offset += envelope_size;
15930 _next_ordinal_to_read += 1;
15931 if next_offset >= end_offset {
15932 return Ok(());
15933 }
15934
15935 while _next_ordinal_to_read < 9 {
15937 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15938 _next_ordinal_to_read += 1;
15939 next_offset += envelope_size;
15940 }
15941
15942 let next_out_of_line = decoder.next_out_of_line();
15943 let handles_before = decoder.remaining_handles();
15944 if let Some((inlined, num_bytes, num_handles)) =
15945 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15946 {
15947 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15948 if inlined != (member_inline_size <= 4) {
15949 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15950 }
15951 let inner_offset;
15952 let mut inner_depth = depth.clone();
15953 if inlined {
15954 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15955 inner_offset = next_offset;
15956 } else {
15957 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15958 inner_depth.increment()?;
15959 }
15960 let val_ref = self.source_dictionary.get_or_insert_with(|| {
15961 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
15962 });
15963 fidl::decode!(
15964 fidl::encoding::BoundedString<1024>,
15965 D,
15966 val_ref,
15967 decoder,
15968 inner_offset,
15969 inner_depth
15970 )?;
15971 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15972 {
15973 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15974 }
15975 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15976 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15977 }
15978 }
15979
15980 next_offset += envelope_size;
15981
15982 while next_offset < end_offset {
15984 _next_ordinal_to_read += 1;
15985 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15986 next_offset += envelope_size;
15987 }
15988
15989 Ok(())
15990 }
15991 }
15992
15993 impl OfferEventStream {
15994 #[inline(always)]
15995 fn max_ordinal_present(&self) -> u64 {
15996 if let Some(_) = self.availability {
15997 return 7;
15998 }
15999 if let Some(_) = self.target_name {
16000 return 5;
16001 }
16002 if let Some(_) = self.target {
16003 return 4;
16004 }
16005 if let Some(_) = self.scope {
16006 return 3;
16007 }
16008 if let Some(_) = self.source_name {
16009 return 2;
16010 }
16011 if let Some(_) = self.source {
16012 return 1;
16013 }
16014 0
16015 }
16016 }
16017
16018 impl fidl::encoding::ValueTypeMarker for OfferEventStream {
16019 type Borrowed<'a> = &'a Self;
16020 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16021 value
16022 }
16023 }
16024
16025 unsafe impl fidl::encoding::TypeMarker for OfferEventStream {
16026 type Owned = Self;
16027
16028 #[inline(always)]
16029 fn inline_align(_context: fidl::encoding::Context) -> usize {
16030 8
16031 }
16032
16033 #[inline(always)]
16034 fn inline_size(_context: fidl::encoding::Context) -> usize {
16035 16
16036 }
16037 }
16038
16039 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferEventStream, D>
16040 for &OfferEventStream
16041 {
16042 unsafe fn encode(
16043 self,
16044 encoder: &mut fidl::encoding::Encoder<'_, D>,
16045 offset: usize,
16046 mut depth: fidl::encoding::Depth,
16047 ) -> fidl::Result<()> {
16048 encoder.debug_check_bounds::<OfferEventStream>(offset);
16049 let max_ordinal: u64 = self.max_ordinal_present();
16051 encoder.write_num(max_ordinal, offset);
16052 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16053 if max_ordinal == 0 {
16055 return Ok(());
16056 }
16057 depth.increment()?;
16058 let envelope_size = 8;
16059 let bytes_len = max_ordinal as usize * envelope_size;
16060 #[allow(unused_variables)]
16061 let offset = encoder.out_of_line_offset(bytes_len);
16062 let mut _prev_end_offset: usize = 0;
16063 if 1 > max_ordinal {
16064 return Ok(());
16065 }
16066
16067 let cur_offset: usize = (1 - 1) * envelope_size;
16070
16071 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16073
16074 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
16079 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
16080 encoder,
16081 offset + cur_offset,
16082 depth,
16083 )?;
16084
16085 _prev_end_offset = cur_offset + envelope_size;
16086 if 2 > max_ordinal {
16087 return Ok(());
16088 }
16089
16090 let cur_offset: usize = (2 - 1) * envelope_size;
16093
16094 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16096
16097 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
16102 self.source_name.as_ref().map(
16103 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
16104 ),
16105 encoder,
16106 offset + cur_offset,
16107 depth,
16108 )?;
16109
16110 _prev_end_offset = cur_offset + envelope_size;
16111 if 3 > max_ordinal {
16112 return Ok(());
16113 }
16114
16115 let cur_offset: usize = (3 - 1) * envelope_size;
16118
16119 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16121
16122 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Ref>, D>(
16127 self.scope.as_ref().map(<fidl::encoding::UnboundedVector<Ref> as fidl::encoding::ValueTypeMarker>::borrow),
16128 encoder, offset + cur_offset, depth
16129 )?;
16130
16131 _prev_end_offset = cur_offset + envelope_size;
16132 if 4 > max_ordinal {
16133 return Ok(());
16134 }
16135
16136 let cur_offset: usize = (4 - 1) * envelope_size;
16139
16140 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16142
16143 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
16148 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
16149 encoder,
16150 offset + cur_offset,
16151 depth,
16152 )?;
16153
16154 _prev_end_offset = cur_offset + envelope_size;
16155 if 5 > max_ordinal {
16156 return Ok(());
16157 }
16158
16159 let cur_offset: usize = (5 - 1) * envelope_size;
16162
16163 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16165
16166 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
16171 self.target_name.as_ref().map(
16172 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
16173 ),
16174 encoder,
16175 offset + cur_offset,
16176 depth,
16177 )?;
16178
16179 _prev_end_offset = cur_offset + envelope_size;
16180 if 7 > max_ordinal {
16181 return Ok(());
16182 }
16183
16184 let cur_offset: usize = (7 - 1) * envelope_size;
16187
16188 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16190
16191 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
16196 self.availability
16197 .as_ref()
16198 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
16199 encoder,
16200 offset + cur_offset,
16201 depth,
16202 )?;
16203
16204 _prev_end_offset = cur_offset + envelope_size;
16205
16206 Ok(())
16207 }
16208 }
16209
16210 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferEventStream {
16211 #[inline(always)]
16212 fn new_empty() -> Self {
16213 Self::default()
16214 }
16215
16216 unsafe fn decode(
16217 &mut self,
16218 decoder: &mut fidl::encoding::Decoder<'_, D>,
16219 offset: usize,
16220 mut depth: fidl::encoding::Depth,
16221 ) -> fidl::Result<()> {
16222 decoder.debug_check_bounds::<Self>(offset);
16223 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16224 None => return Err(fidl::Error::NotNullable),
16225 Some(len) => len,
16226 };
16227 if len == 0 {
16229 return Ok(());
16230 };
16231 depth.increment()?;
16232 let envelope_size = 8;
16233 let bytes_len = len * envelope_size;
16234 let offset = decoder.out_of_line_offset(bytes_len)?;
16235 let mut _next_ordinal_to_read = 0;
16237 let mut next_offset = offset;
16238 let end_offset = offset + bytes_len;
16239 _next_ordinal_to_read += 1;
16240 if next_offset >= end_offset {
16241 return Ok(());
16242 }
16243
16244 while _next_ordinal_to_read < 1 {
16246 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16247 _next_ordinal_to_read += 1;
16248 next_offset += envelope_size;
16249 }
16250
16251 let next_out_of_line = decoder.next_out_of_line();
16252 let handles_before = decoder.remaining_handles();
16253 if let Some((inlined, num_bytes, num_handles)) =
16254 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16255 {
16256 let member_inline_size =
16257 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16258 if inlined != (member_inline_size <= 4) {
16259 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16260 }
16261 let inner_offset;
16262 let mut inner_depth = depth.clone();
16263 if inlined {
16264 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16265 inner_offset = next_offset;
16266 } else {
16267 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16268 inner_depth.increment()?;
16269 }
16270 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
16271 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
16272 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16273 {
16274 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16275 }
16276 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16277 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16278 }
16279 }
16280
16281 next_offset += envelope_size;
16282 _next_ordinal_to_read += 1;
16283 if next_offset >= end_offset {
16284 return Ok(());
16285 }
16286
16287 while _next_ordinal_to_read < 2 {
16289 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16290 _next_ordinal_to_read += 1;
16291 next_offset += envelope_size;
16292 }
16293
16294 let next_out_of_line = decoder.next_out_of_line();
16295 let handles_before = decoder.remaining_handles();
16296 if let Some((inlined, num_bytes, num_handles)) =
16297 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16298 {
16299 let member_inline_size =
16300 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
16301 decoder.context,
16302 );
16303 if inlined != (member_inline_size <= 4) {
16304 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16305 }
16306 let inner_offset;
16307 let mut inner_depth = depth.clone();
16308 if inlined {
16309 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16310 inner_offset = next_offset;
16311 } else {
16312 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16313 inner_depth.increment()?;
16314 }
16315 let val_ref = self
16316 .source_name
16317 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
16318 fidl::decode!(
16319 fidl::encoding::BoundedString<100>,
16320 D,
16321 val_ref,
16322 decoder,
16323 inner_offset,
16324 inner_depth
16325 )?;
16326 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16327 {
16328 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16329 }
16330 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16331 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16332 }
16333 }
16334
16335 next_offset += envelope_size;
16336 _next_ordinal_to_read += 1;
16337 if next_offset >= end_offset {
16338 return Ok(());
16339 }
16340
16341 while _next_ordinal_to_read < 3 {
16343 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16344 _next_ordinal_to_read += 1;
16345 next_offset += envelope_size;
16346 }
16347
16348 let next_out_of_line = decoder.next_out_of_line();
16349 let handles_before = decoder.remaining_handles();
16350 if let Some((inlined, num_bytes, num_handles)) =
16351 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16352 {
16353 let member_inline_size = <fidl::encoding::UnboundedVector<Ref> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16354 if inlined != (member_inline_size <= 4) {
16355 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16356 }
16357 let inner_offset;
16358 let mut inner_depth = depth.clone();
16359 if inlined {
16360 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16361 inner_offset = next_offset;
16362 } else {
16363 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16364 inner_depth.increment()?;
16365 }
16366 let val_ref = self.scope.get_or_insert_with(|| {
16367 fidl::new_empty!(fidl::encoding::UnboundedVector<Ref>, D)
16368 });
16369 fidl::decode!(
16370 fidl::encoding::UnboundedVector<Ref>,
16371 D,
16372 val_ref,
16373 decoder,
16374 inner_offset,
16375 inner_depth
16376 )?;
16377 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16378 {
16379 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16380 }
16381 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16382 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16383 }
16384 }
16385
16386 next_offset += envelope_size;
16387 _next_ordinal_to_read += 1;
16388 if next_offset >= end_offset {
16389 return Ok(());
16390 }
16391
16392 while _next_ordinal_to_read < 4 {
16394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16395 _next_ordinal_to_read += 1;
16396 next_offset += envelope_size;
16397 }
16398
16399 let next_out_of_line = decoder.next_out_of_line();
16400 let handles_before = decoder.remaining_handles();
16401 if let Some((inlined, num_bytes, num_handles)) =
16402 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16403 {
16404 let member_inline_size =
16405 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16406 if inlined != (member_inline_size <= 4) {
16407 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16408 }
16409 let inner_offset;
16410 let mut inner_depth = depth.clone();
16411 if inlined {
16412 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16413 inner_offset = next_offset;
16414 } else {
16415 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16416 inner_depth.increment()?;
16417 }
16418 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
16419 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
16420 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16421 {
16422 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16423 }
16424 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16425 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16426 }
16427 }
16428
16429 next_offset += envelope_size;
16430 _next_ordinal_to_read += 1;
16431 if next_offset >= end_offset {
16432 return Ok(());
16433 }
16434
16435 while _next_ordinal_to_read < 5 {
16437 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16438 _next_ordinal_to_read += 1;
16439 next_offset += envelope_size;
16440 }
16441
16442 let next_out_of_line = decoder.next_out_of_line();
16443 let handles_before = decoder.remaining_handles();
16444 if let Some((inlined, num_bytes, num_handles)) =
16445 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16446 {
16447 let member_inline_size =
16448 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
16449 decoder.context,
16450 );
16451 if inlined != (member_inline_size <= 4) {
16452 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16453 }
16454 let inner_offset;
16455 let mut inner_depth = depth.clone();
16456 if inlined {
16457 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16458 inner_offset = next_offset;
16459 } else {
16460 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16461 inner_depth.increment()?;
16462 }
16463 let val_ref = self
16464 .target_name
16465 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
16466 fidl::decode!(
16467 fidl::encoding::BoundedString<100>,
16468 D,
16469 val_ref,
16470 decoder,
16471 inner_offset,
16472 inner_depth
16473 )?;
16474 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16475 {
16476 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16477 }
16478 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16479 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16480 }
16481 }
16482
16483 next_offset += envelope_size;
16484 _next_ordinal_to_read += 1;
16485 if next_offset >= end_offset {
16486 return Ok(());
16487 }
16488
16489 while _next_ordinal_to_read < 7 {
16491 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16492 _next_ordinal_to_read += 1;
16493 next_offset += envelope_size;
16494 }
16495
16496 let next_out_of_line = decoder.next_out_of_line();
16497 let handles_before = decoder.remaining_handles();
16498 if let Some((inlined, num_bytes, num_handles)) =
16499 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16500 {
16501 let member_inline_size =
16502 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16503 if inlined != (member_inline_size <= 4) {
16504 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16505 }
16506 let inner_offset;
16507 let mut inner_depth = depth.clone();
16508 if inlined {
16509 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16510 inner_offset = next_offset;
16511 } else {
16512 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16513 inner_depth.increment()?;
16514 }
16515 let val_ref =
16516 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
16517 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
16518 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16519 {
16520 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16521 }
16522 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16523 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16524 }
16525 }
16526
16527 next_offset += envelope_size;
16528
16529 while next_offset < end_offset {
16531 _next_ordinal_to_read += 1;
16532 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16533 next_offset += envelope_size;
16534 }
16535
16536 Ok(())
16537 }
16538 }
16539
16540 impl OfferProtocol {
16541 #[inline(always)]
16542 fn max_ordinal_present(&self) -> u64 {
16543 if let Some(_) = self.source_dictionary {
16544 return 7;
16545 }
16546 if let Some(_) = self.availability {
16547 return 6;
16548 }
16549 if let Some(_) = self.dependency_type {
16550 return 5;
16551 }
16552 if let Some(_) = self.target_name {
16553 return 4;
16554 }
16555 if let Some(_) = self.target {
16556 return 3;
16557 }
16558 if let Some(_) = self.source_name {
16559 return 2;
16560 }
16561 if let Some(_) = self.source {
16562 return 1;
16563 }
16564 0
16565 }
16566 }
16567
16568 impl fidl::encoding::ValueTypeMarker for OfferProtocol {
16569 type Borrowed<'a> = &'a Self;
16570 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16571 value
16572 }
16573 }
16574
16575 unsafe impl fidl::encoding::TypeMarker for OfferProtocol {
16576 type Owned = Self;
16577
16578 #[inline(always)]
16579 fn inline_align(_context: fidl::encoding::Context) -> usize {
16580 8
16581 }
16582
16583 #[inline(always)]
16584 fn inline_size(_context: fidl::encoding::Context) -> usize {
16585 16
16586 }
16587 }
16588
16589 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferProtocol, D>
16590 for &OfferProtocol
16591 {
16592 unsafe fn encode(
16593 self,
16594 encoder: &mut fidl::encoding::Encoder<'_, D>,
16595 offset: usize,
16596 mut depth: fidl::encoding::Depth,
16597 ) -> fidl::Result<()> {
16598 encoder.debug_check_bounds::<OfferProtocol>(offset);
16599 let max_ordinal: u64 = self.max_ordinal_present();
16601 encoder.write_num(max_ordinal, offset);
16602 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16603 if max_ordinal == 0 {
16605 return Ok(());
16606 }
16607 depth.increment()?;
16608 let envelope_size = 8;
16609 let bytes_len = max_ordinal as usize * envelope_size;
16610 #[allow(unused_variables)]
16611 let offset = encoder.out_of_line_offset(bytes_len);
16612 let mut _prev_end_offset: usize = 0;
16613 if 1 > max_ordinal {
16614 return Ok(());
16615 }
16616
16617 let cur_offset: usize = (1 - 1) * envelope_size;
16620
16621 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16623
16624 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
16629 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
16630 encoder,
16631 offset + cur_offset,
16632 depth,
16633 )?;
16634
16635 _prev_end_offset = cur_offset + envelope_size;
16636 if 2 > max_ordinal {
16637 return Ok(());
16638 }
16639
16640 let cur_offset: usize = (2 - 1) * envelope_size;
16643
16644 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16646
16647 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
16652 self.source_name.as_ref().map(
16653 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
16654 ),
16655 encoder,
16656 offset + cur_offset,
16657 depth,
16658 )?;
16659
16660 _prev_end_offset = cur_offset + envelope_size;
16661 if 3 > max_ordinal {
16662 return Ok(());
16663 }
16664
16665 let cur_offset: usize = (3 - 1) * envelope_size;
16668
16669 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16671
16672 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
16677 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
16678 encoder,
16679 offset + cur_offset,
16680 depth,
16681 )?;
16682
16683 _prev_end_offset = cur_offset + envelope_size;
16684 if 4 > max_ordinal {
16685 return Ok(());
16686 }
16687
16688 let cur_offset: usize = (4 - 1) * envelope_size;
16691
16692 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16694
16695 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
16700 self.target_name.as_ref().map(
16701 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
16702 ),
16703 encoder,
16704 offset + cur_offset,
16705 depth,
16706 )?;
16707
16708 _prev_end_offset = cur_offset + envelope_size;
16709 if 5 > max_ordinal {
16710 return Ok(());
16711 }
16712
16713 let cur_offset: usize = (5 - 1) * envelope_size;
16716
16717 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16719
16720 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
16725 self.dependency_type
16726 .as_ref()
16727 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
16728 encoder,
16729 offset + cur_offset,
16730 depth,
16731 )?;
16732
16733 _prev_end_offset = cur_offset + envelope_size;
16734 if 6 > max_ordinal {
16735 return Ok(());
16736 }
16737
16738 let cur_offset: usize = (6 - 1) * envelope_size;
16741
16742 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16744
16745 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
16750 self.availability
16751 .as_ref()
16752 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
16753 encoder,
16754 offset + cur_offset,
16755 depth,
16756 )?;
16757
16758 _prev_end_offset = cur_offset + envelope_size;
16759 if 7 > max_ordinal {
16760 return Ok(());
16761 }
16762
16763 let cur_offset: usize = (7 - 1) * envelope_size;
16766
16767 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16769
16770 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
16775 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
16776 encoder, offset + cur_offset, depth
16777 )?;
16778
16779 _prev_end_offset = cur_offset + envelope_size;
16780
16781 Ok(())
16782 }
16783 }
16784
16785 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferProtocol {
16786 #[inline(always)]
16787 fn new_empty() -> Self {
16788 Self::default()
16789 }
16790
16791 unsafe fn decode(
16792 &mut self,
16793 decoder: &mut fidl::encoding::Decoder<'_, D>,
16794 offset: usize,
16795 mut depth: fidl::encoding::Depth,
16796 ) -> fidl::Result<()> {
16797 decoder.debug_check_bounds::<Self>(offset);
16798 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16799 None => return Err(fidl::Error::NotNullable),
16800 Some(len) => len,
16801 };
16802 if len == 0 {
16804 return Ok(());
16805 };
16806 depth.increment()?;
16807 let envelope_size = 8;
16808 let bytes_len = len * envelope_size;
16809 let offset = decoder.out_of_line_offset(bytes_len)?;
16810 let mut _next_ordinal_to_read = 0;
16812 let mut next_offset = offset;
16813 let end_offset = offset + bytes_len;
16814 _next_ordinal_to_read += 1;
16815 if next_offset >= end_offset {
16816 return Ok(());
16817 }
16818
16819 while _next_ordinal_to_read < 1 {
16821 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16822 _next_ordinal_to_read += 1;
16823 next_offset += envelope_size;
16824 }
16825
16826 let next_out_of_line = decoder.next_out_of_line();
16827 let handles_before = decoder.remaining_handles();
16828 if let Some((inlined, num_bytes, num_handles)) =
16829 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16830 {
16831 let member_inline_size =
16832 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16833 if inlined != (member_inline_size <= 4) {
16834 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16835 }
16836 let inner_offset;
16837 let mut inner_depth = depth.clone();
16838 if inlined {
16839 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16840 inner_offset = next_offset;
16841 } else {
16842 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16843 inner_depth.increment()?;
16844 }
16845 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
16846 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
16847 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16848 {
16849 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16850 }
16851 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16852 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16853 }
16854 }
16855
16856 next_offset += envelope_size;
16857 _next_ordinal_to_read += 1;
16858 if next_offset >= end_offset {
16859 return Ok(());
16860 }
16861
16862 while _next_ordinal_to_read < 2 {
16864 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16865 _next_ordinal_to_read += 1;
16866 next_offset += envelope_size;
16867 }
16868
16869 let next_out_of_line = decoder.next_out_of_line();
16870 let handles_before = decoder.remaining_handles();
16871 if let Some((inlined, num_bytes, num_handles)) =
16872 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16873 {
16874 let member_inline_size =
16875 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
16876 decoder.context,
16877 );
16878 if inlined != (member_inline_size <= 4) {
16879 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16880 }
16881 let inner_offset;
16882 let mut inner_depth = depth.clone();
16883 if inlined {
16884 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16885 inner_offset = next_offset;
16886 } else {
16887 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16888 inner_depth.increment()?;
16889 }
16890 let val_ref = self
16891 .source_name
16892 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
16893 fidl::decode!(
16894 fidl::encoding::BoundedString<100>,
16895 D,
16896 val_ref,
16897 decoder,
16898 inner_offset,
16899 inner_depth
16900 )?;
16901 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16902 {
16903 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16904 }
16905 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16906 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16907 }
16908 }
16909
16910 next_offset += envelope_size;
16911 _next_ordinal_to_read += 1;
16912 if next_offset >= end_offset {
16913 return Ok(());
16914 }
16915
16916 while _next_ordinal_to_read < 3 {
16918 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16919 _next_ordinal_to_read += 1;
16920 next_offset += envelope_size;
16921 }
16922
16923 let next_out_of_line = decoder.next_out_of_line();
16924 let handles_before = decoder.remaining_handles();
16925 if let Some((inlined, num_bytes, num_handles)) =
16926 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16927 {
16928 let member_inline_size =
16929 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16930 if inlined != (member_inline_size <= 4) {
16931 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16932 }
16933 let inner_offset;
16934 let mut inner_depth = depth.clone();
16935 if inlined {
16936 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16937 inner_offset = next_offset;
16938 } else {
16939 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16940 inner_depth.increment()?;
16941 }
16942 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
16943 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
16944 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16945 {
16946 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16947 }
16948 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16949 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16950 }
16951 }
16952
16953 next_offset += envelope_size;
16954 _next_ordinal_to_read += 1;
16955 if next_offset >= end_offset {
16956 return Ok(());
16957 }
16958
16959 while _next_ordinal_to_read < 4 {
16961 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16962 _next_ordinal_to_read += 1;
16963 next_offset += envelope_size;
16964 }
16965
16966 let next_out_of_line = decoder.next_out_of_line();
16967 let handles_before = decoder.remaining_handles();
16968 if let Some((inlined, num_bytes, num_handles)) =
16969 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16970 {
16971 let member_inline_size =
16972 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
16973 decoder.context,
16974 );
16975 if inlined != (member_inline_size <= 4) {
16976 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16977 }
16978 let inner_offset;
16979 let mut inner_depth = depth.clone();
16980 if inlined {
16981 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16982 inner_offset = next_offset;
16983 } else {
16984 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16985 inner_depth.increment()?;
16986 }
16987 let val_ref = self
16988 .target_name
16989 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
16990 fidl::decode!(
16991 fidl::encoding::BoundedString<100>,
16992 D,
16993 val_ref,
16994 decoder,
16995 inner_offset,
16996 inner_depth
16997 )?;
16998 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16999 {
17000 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17001 }
17002 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17003 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17004 }
17005 }
17006
17007 next_offset += envelope_size;
17008 _next_ordinal_to_read += 1;
17009 if next_offset >= end_offset {
17010 return Ok(());
17011 }
17012
17013 while _next_ordinal_to_read < 5 {
17015 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17016 _next_ordinal_to_read += 1;
17017 next_offset += envelope_size;
17018 }
17019
17020 let next_out_of_line = decoder.next_out_of_line();
17021 let handles_before = decoder.remaining_handles();
17022 if let Some((inlined, num_bytes, num_handles)) =
17023 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17024 {
17025 let member_inline_size =
17026 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17027 if inlined != (member_inline_size <= 4) {
17028 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17029 }
17030 let inner_offset;
17031 let mut inner_depth = depth.clone();
17032 if inlined {
17033 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17034 inner_offset = next_offset;
17035 } else {
17036 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17037 inner_depth.increment()?;
17038 }
17039 let val_ref =
17040 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
17041 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
17042 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17043 {
17044 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17045 }
17046 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17047 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17048 }
17049 }
17050
17051 next_offset += envelope_size;
17052 _next_ordinal_to_read += 1;
17053 if next_offset >= end_offset {
17054 return Ok(());
17055 }
17056
17057 while _next_ordinal_to_read < 6 {
17059 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17060 _next_ordinal_to_read += 1;
17061 next_offset += envelope_size;
17062 }
17063
17064 let next_out_of_line = decoder.next_out_of_line();
17065 let handles_before = decoder.remaining_handles();
17066 if let Some((inlined, num_bytes, num_handles)) =
17067 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17068 {
17069 let member_inline_size =
17070 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17071 if inlined != (member_inline_size <= 4) {
17072 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17073 }
17074 let inner_offset;
17075 let mut inner_depth = depth.clone();
17076 if inlined {
17077 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17078 inner_offset = next_offset;
17079 } else {
17080 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17081 inner_depth.increment()?;
17082 }
17083 let val_ref =
17084 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
17085 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
17086 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17087 {
17088 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17089 }
17090 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17091 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17092 }
17093 }
17094
17095 next_offset += envelope_size;
17096 _next_ordinal_to_read += 1;
17097 if next_offset >= end_offset {
17098 return Ok(());
17099 }
17100
17101 while _next_ordinal_to_read < 7 {
17103 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17104 _next_ordinal_to_read += 1;
17105 next_offset += envelope_size;
17106 }
17107
17108 let next_out_of_line = decoder.next_out_of_line();
17109 let handles_before = decoder.remaining_handles();
17110 if let Some((inlined, num_bytes, num_handles)) =
17111 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17112 {
17113 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17114 if inlined != (member_inline_size <= 4) {
17115 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17116 }
17117 let inner_offset;
17118 let mut inner_depth = depth.clone();
17119 if inlined {
17120 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17121 inner_offset = next_offset;
17122 } else {
17123 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17124 inner_depth.increment()?;
17125 }
17126 let val_ref = self.source_dictionary.get_or_insert_with(|| {
17127 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
17128 });
17129 fidl::decode!(
17130 fidl::encoding::BoundedString<1024>,
17131 D,
17132 val_ref,
17133 decoder,
17134 inner_offset,
17135 inner_depth
17136 )?;
17137 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17138 {
17139 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17140 }
17141 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17142 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17143 }
17144 }
17145
17146 next_offset += envelope_size;
17147
17148 while next_offset < end_offset {
17150 _next_ordinal_to_read += 1;
17151 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17152 next_offset += envelope_size;
17153 }
17154
17155 Ok(())
17156 }
17157 }
17158
17159 impl OfferResolver {
17160 #[inline(always)]
17161 fn max_ordinal_present(&self) -> u64 {
17162 if let Some(_) = self.source_dictionary {
17163 return 5;
17164 }
17165 if let Some(_) = self.target_name {
17166 return 4;
17167 }
17168 if let Some(_) = self.target {
17169 return 3;
17170 }
17171 if let Some(_) = self.source_name {
17172 return 2;
17173 }
17174 if let Some(_) = self.source {
17175 return 1;
17176 }
17177 0
17178 }
17179 }
17180
17181 impl fidl::encoding::ValueTypeMarker for OfferResolver {
17182 type Borrowed<'a> = &'a Self;
17183 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17184 value
17185 }
17186 }
17187
17188 unsafe impl fidl::encoding::TypeMarker for OfferResolver {
17189 type Owned = Self;
17190
17191 #[inline(always)]
17192 fn inline_align(_context: fidl::encoding::Context) -> usize {
17193 8
17194 }
17195
17196 #[inline(always)]
17197 fn inline_size(_context: fidl::encoding::Context) -> usize {
17198 16
17199 }
17200 }
17201
17202 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferResolver, D>
17203 for &OfferResolver
17204 {
17205 unsafe fn encode(
17206 self,
17207 encoder: &mut fidl::encoding::Encoder<'_, D>,
17208 offset: usize,
17209 mut depth: fidl::encoding::Depth,
17210 ) -> fidl::Result<()> {
17211 encoder.debug_check_bounds::<OfferResolver>(offset);
17212 let max_ordinal: u64 = self.max_ordinal_present();
17214 encoder.write_num(max_ordinal, offset);
17215 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17216 if max_ordinal == 0 {
17218 return Ok(());
17219 }
17220 depth.increment()?;
17221 let envelope_size = 8;
17222 let bytes_len = max_ordinal as usize * envelope_size;
17223 #[allow(unused_variables)]
17224 let offset = encoder.out_of_line_offset(bytes_len);
17225 let mut _prev_end_offset: usize = 0;
17226 if 1 > max_ordinal {
17227 return Ok(());
17228 }
17229
17230 let cur_offset: usize = (1 - 1) * envelope_size;
17233
17234 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17236
17237 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
17242 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
17243 encoder,
17244 offset + cur_offset,
17245 depth,
17246 )?;
17247
17248 _prev_end_offset = cur_offset + envelope_size;
17249 if 2 > max_ordinal {
17250 return Ok(());
17251 }
17252
17253 let cur_offset: usize = (2 - 1) * envelope_size;
17256
17257 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17259
17260 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
17265 self.source_name.as_ref().map(
17266 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
17267 ),
17268 encoder,
17269 offset + cur_offset,
17270 depth,
17271 )?;
17272
17273 _prev_end_offset = cur_offset + envelope_size;
17274 if 3 > max_ordinal {
17275 return Ok(());
17276 }
17277
17278 let cur_offset: usize = (3 - 1) * envelope_size;
17281
17282 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17284
17285 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
17290 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
17291 encoder,
17292 offset + cur_offset,
17293 depth,
17294 )?;
17295
17296 _prev_end_offset = cur_offset + envelope_size;
17297 if 4 > max_ordinal {
17298 return Ok(());
17299 }
17300
17301 let cur_offset: usize = (4 - 1) * envelope_size;
17304
17305 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17307
17308 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
17313 self.target_name.as_ref().map(
17314 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
17315 ),
17316 encoder,
17317 offset + cur_offset,
17318 depth,
17319 )?;
17320
17321 _prev_end_offset = cur_offset + envelope_size;
17322 if 5 > max_ordinal {
17323 return Ok(());
17324 }
17325
17326 let cur_offset: usize = (5 - 1) * envelope_size;
17329
17330 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17332
17333 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
17338 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
17339 encoder, offset + cur_offset, depth
17340 )?;
17341
17342 _prev_end_offset = cur_offset + envelope_size;
17343
17344 Ok(())
17345 }
17346 }
17347
17348 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferResolver {
17349 #[inline(always)]
17350 fn new_empty() -> Self {
17351 Self::default()
17352 }
17353
17354 unsafe fn decode(
17355 &mut self,
17356 decoder: &mut fidl::encoding::Decoder<'_, D>,
17357 offset: usize,
17358 mut depth: fidl::encoding::Depth,
17359 ) -> fidl::Result<()> {
17360 decoder.debug_check_bounds::<Self>(offset);
17361 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17362 None => return Err(fidl::Error::NotNullable),
17363 Some(len) => len,
17364 };
17365 if len == 0 {
17367 return Ok(());
17368 };
17369 depth.increment()?;
17370 let envelope_size = 8;
17371 let bytes_len = len * envelope_size;
17372 let offset = decoder.out_of_line_offset(bytes_len)?;
17373 let mut _next_ordinal_to_read = 0;
17375 let mut next_offset = offset;
17376 let end_offset = offset + bytes_len;
17377 _next_ordinal_to_read += 1;
17378 if next_offset >= end_offset {
17379 return Ok(());
17380 }
17381
17382 while _next_ordinal_to_read < 1 {
17384 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17385 _next_ordinal_to_read += 1;
17386 next_offset += envelope_size;
17387 }
17388
17389 let next_out_of_line = decoder.next_out_of_line();
17390 let handles_before = decoder.remaining_handles();
17391 if let Some((inlined, num_bytes, num_handles)) =
17392 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17393 {
17394 let member_inline_size =
17395 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17396 if inlined != (member_inline_size <= 4) {
17397 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17398 }
17399 let inner_offset;
17400 let mut inner_depth = depth.clone();
17401 if inlined {
17402 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17403 inner_offset = next_offset;
17404 } else {
17405 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17406 inner_depth.increment()?;
17407 }
17408 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
17409 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
17410 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17411 {
17412 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17413 }
17414 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17415 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17416 }
17417 }
17418
17419 next_offset += envelope_size;
17420 _next_ordinal_to_read += 1;
17421 if next_offset >= end_offset {
17422 return Ok(());
17423 }
17424
17425 while _next_ordinal_to_read < 2 {
17427 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17428 _next_ordinal_to_read += 1;
17429 next_offset += envelope_size;
17430 }
17431
17432 let next_out_of_line = decoder.next_out_of_line();
17433 let handles_before = decoder.remaining_handles();
17434 if let Some((inlined, num_bytes, num_handles)) =
17435 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17436 {
17437 let member_inline_size =
17438 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
17439 decoder.context,
17440 );
17441 if inlined != (member_inline_size <= 4) {
17442 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17443 }
17444 let inner_offset;
17445 let mut inner_depth = depth.clone();
17446 if inlined {
17447 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17448 inner_offset = next_offset;
17449 } else {
17450 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17451 inner_depth.increment()?;
17452 }
17453 let val_ref = self
17454 .source_name
17455 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
17456 fidl::decode!(
17457 fidl::encoding::BoundedString<100>,
17458 D,
17459 val_ref,
17460 decoder,
17461 inner_offset,
17462 inner_depth
17463 )?;
17464 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17465 {
17466 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17467 }
17468 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17469 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17470 }
17471 }
17472
17473 next_offset += envelope_size;
17474 _next_ordinal_to_read += 1;
17475 if next_offset >= end_offset {
17476 return Ok(());
17477 }
17478
17479 while _next_ordinal_to_read < 3 {
17481 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17482 _next_ordinal_to_read += 1;
17483 next_offset += envelope_size;
17484 }
17485
17486 let next_out_of_line = decoder.next_out_of_line();
17487 let handles_before = decoder.remaining_handles();
17488 if let Some((inlined, num_bytes, num_handles)) =
17489 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17490 {
17491 let member_inline_size =
17492 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17493 if inlined != (member_inline_size <= 4) {
17494 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17495 }
17496 let inner_offset;
17497 let mut inner_depth = depth.clone();
17498 if inlined {
17499 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17500 inner_offset = next_offset;
17501 } else {
17502 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17503 inner_depth.increment()?;
17504 }
17505 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
17506 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
17507 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17508 {
17509 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17510 }
17511 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17512 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17513 }
17514 }
17515
17516 next_offset += envelope_size;
17517 _next_ordinal_to_read += 1;
17518 if next_offset >= end_offset {
17519 return Ok(());
17520 }
17521
17522 while _next_ordinal_to_read < 4 {
17524 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17525 _next_ordinal_to_read += 1;
17526 next_offset += envelope_size;
17527 }
17528
17529 let next_out_of_line = decoder.next_out_of_line();
17530 let handles_before = decoder.remaining_handles();
17531 if let Some((inlined, num_bytes, num_handles)) =
17532 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17533 {
17534 let member_inline_size =
17535 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
17536 decoder.context,
17537 );
17538 if inlined != (member_inline_size <= 4) {
17539 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17540 }
17541 let inner_offset;
17542 let mut inner_depth = depth.clone();
17543 if inlined {
17544 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17545 inner_offset = next_offset;
17546 } else {
17547 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17548 inner_depth.increment()?;
17549 }
17550 let val_ref = self
17551 .target_name
17552 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
17553 fidl::decode!(
17554 fidl::encoding::BoundedString<100>,
17555 D,
17556 val_ref,
17557 decoder,
17558 inner_offset,
17559 inner_depth
17560 )?;
17561 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17562 {
17563 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17564 }
17565 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17566 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17567 }
17568 }
17569
17570 next_offset += envelope_size;
17571 _next_ordinal_to_read += 1;
17572 if next_offset >= end_offset {
17573 return Ok(());
17574 }
17575
17576 while _next_ordinal_to_read < 5 {
17578 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17579 _next_ordinal_to_read += 1;
17580 next_offset += envelope_size;
17581 }
17582
17583 let next_out_of_line = decoder.next_out_of_line();
17584 let handles_before = decoder.remaining_handles();
17585 if let Some((inlined, num_bytes, num_handles)) =
17586 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17587 {
17588 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17589 if inlined != (member_inline_size <= 4) {
17590 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17591 }
17592 let inner_offset;
17593 let mut inner_depth = depth.clone();
17594 if inlined {
17595 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17596 inner_offset = next_offset;
17597 } else {
17598 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17599 inner_depth.increment()?;
17600 }
17601 let val_ref = self.source_dictionary.get_or_insert_with(|| {
17602 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
17603 });
17604 fidl::decode!(
17605 fidl::encoding::BoundedString<1024>,
17606 D,
17607 val_ref,
17608 decoder,
17609 inner_offset,
17610 inner_depth
17611 )?;
17612 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17613 {
17614 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17615 }
17616 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17617 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17618 }
17619 }
17620
17621 next_offset += envelope_size;
17622
17623 while next_offset < end_offset {
17625 _next_ordinal_to_read += 1;
17626 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17627 next_offset += envelope_size;
17628 }
17629
17630 Ok(())
17631 }
17632 }
17633
17634 impl OfferRunner {
17635 #[inline(always)]
17636 fn max_ordinal_present(&self) -> u64 {
17637 if let Some(_) = self.source_dictionary {
17638 return 5;
17639 }
17640 if let Some(_) = self.target_name {
17641 return 4;
17642 }
17643 if let Some(_) = self.target {
17644 return 3;
17645 }
17646 if let Some(_) = self.source_name {
17647 return 2;
17648 }
17649 if let Some(_) = self.source {
17650 return 1;
17651 }
17652 0
17653 }
17654 }
17655
17656 impl fidl::encoding::ValueTypeMarker for OfferRunner {
17657 type Borrowed<'a> = &'a Self;
17658 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17659 value
17660 }
17661 }
17662
17663 unsafe impl fidl::encoding::TypeMarker for OfferRunner {
17664 type Owned = Self;
17665
17666 #[inline(always)]
17667 fn inline_align(_context: fidl::encoding::Context) -> usize {
17668 8
17669 }
17670
17671 #[inline(always)]
17672 fn inline_size(_context: fidl::encoding::Context) -> usize {
17673 16
17674 }
17675 }
17676
17677 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferRunner, D>
17678 for &OfferRunner
17679 {
17680 unsafe fn encode(
17681 self,
17682 encoder: &mut fidl::encoding::Encoder<'_, D>,
17683 offset: usize,
17684 mut depth: fidl::encoding::Depth,
17685 ) -> fidl::Result<()> {
17686 encoder.debug_check_bounds::<OfferRunner>(offset);
17687 let max_ordinal: u64 = self.max_ordinal_present();
17689 encoder.write_num(max_ordinal, offset);
17690 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17691 if max_ordinal == 0 {
17693 return Ok(());
17694 }
17695 depth.increment()?;
17696 let envelope_size = 8;
17697 let bytes_len = max_ordinal as usize * envelope_size;
17698 #[allow(unused_variables)]
17699 let offset = encoder.out_of_line_offset(bytes_len);
17700 let mut _prev_end_offset: usize = 0;
17701 if 1 > max_ordinal {
17702 return Ok(());
17703 }
17704
17705 let cur_offset: usize = (1 - 1) * envelope_size;
17708
17709 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17711
17712 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
17717 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
17718 encoder,
17719 offset + cur_offset,
17720 depth,
17721 )?;
17722
17723 _prev_end_offset = cur_offset + envelope_size;
17724 if 2 > max_ordinal {
17725 return Ok(());
17726 }
17727
17728 let cur_offset: usize = (2 - 1) * envelope_size;
17731
17732 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17734
17735 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
17740 self.source_name.as_ref().map(
17741 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
17742 ),
17743 encoder,
17744 offset + cur_offset,
17745 depth,
17746 )?;
17747
17748 _prev_end_offset = cur_offset + envelope_size;
17749 if 3 > max_ordinal {
17750 return Ok(());
17751 }
17752
17753 let cur_offset: usize = (3 - 1) * envelope_size;
17756
17757 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17759
17760 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
17765 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
17766 encoder,
17767 offset + cur_offset,
17768 depth,
17769 )?;
17770
17771 _prev_end_offset = cur_offset + envelope_size;
17772 if 4 > max_ordinal {
17773 return Ok(());
17774 }
17775
17776 let cur_offset: usize = (4 - 1) * envelope_size;
17779
17780 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17782
17783 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
17788 self.target_name.as_ref().map(
17789 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
17790 ),
17791 encoder,
17792 offset + cur_offset,
17793 depth,
17794 )?;
17795
17796 _prev_end_offset = cur_offset + envelope_size;
17797 if 5 > max_ordinal {
17798 return Ok(());
17799 }
17800
17801 let cur_offset: usize = (5 - 1) * envelope_size;
17804
17805 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17807
17808 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
17813 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
17814 encoder, offset + cur_offset, depth
17815 )?;
17816
17817 _prev_end_offset = cur_offset + envelope_size;
17818
17819 Ok(())
17820 }
17821 }
17822
17823 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferRunner {
17824 #[inline(always)]
17825 fn new_empty() -> Self {
17826 Self::default()
17827 }
17828
17829 unsafe fn decode(
17830 &mut self,
17831 decoder: &mut fidl::encoding::Decoder<'_, D>,
17832 offset: usize,
17833 mut depth: fidl::encoding::Depth,
17834 ) -> fidl::Result<()> {
17835 decoder.debug_check_bounds::<Self>(offset);
17836 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17837 None => return Err(fidl::Error::NotNullable),
17838 Some(len) => len,
17839 };
17840 if len == 0 {
17842 return Ok(());
17843 };
17844 depth.increment()?;
17845 let envelope_size = 8;
17846 let bytes_len = len * envelope_size;
17847 let offset = decoder.out_of_line_offset(bytes_len)?;
17848 let mut _next_ordinal_to_read = 0;
17850 let mut next_offset = offset;
17851 let end_offset = offset + bytes_len;
17852 _next_ordinal_to_read += 1;
17853 if next_offset >= end_offset {
17854 return Ok(());
17855 }
17856
17857 while _next_ordinal_to_read < 1 {
17859 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17860 _next_ordinal_to_read += 1;
17861 next_offset += envelope_size;
17862 }
17863
17864 let next_out_of_line = decoder.next_out_of_line();
17865 let handles_before = decoder.remaining_handles();
17866 if let Some((inlined, num_bytes, num_handles)) =
17867 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17868 {
17869 let member_inline_size =
17870 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17871 if inlined != (member_inline_size <= 4) {
17872 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17873 }
17874 let inner_offset;
17875 let mut inner_depth = depth.clone();
17876 if inlined {
17877 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17878 inner_offset = next_offset;
17879 } else {
17880 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17881 inner_depth.increment()?;
17882 }
17883 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
17884 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
17885 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17886 {
17887 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17888 }
17889 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17890 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17891 }
17892 }
17893
17894 next_offset += envelope_size;
17895 _next_ordinal_to_read += 1;
17896 if next_offset >= end_offset {
17897 return Ok(());
17898 }
17899
17900 while _next_ordinal_to_read < 2 {
17902 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17903 _next_ordinal_to_read += 1;
17904 next_offset += envelope_size;
17905 }
17906
17907 let next_out_of_line = decoder.next_out_of_line();
17908 let handles_before = decoder.remaining_handles();
17909 if let Some((inlined, num_bytes, num_handles)) =
17910 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17911 {
17912 let member_inline_size =
17913 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
17914 decoder.context,
17915 );
17916 if inlined != (member_inline_size <= 4) {
17917 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17918 }
17919 let inner_offset;
17920 let mut inner_depth = depth.clone();
17921 if inlined {
17922 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17923 inner_offset = next_offset;
17924 } else {
17925 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17926 inner_depth.increment()?;
17927 }
17928 let val_ref = self
17929 .source_name
17930 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
17931 fidl::decode!(
17932 fidl::encoding::BoundedString<100>,
17933 D,
17934 val_ref,
17935 decoder,
17936 inner_offset,
17937 inner_depth
17938 )?;
17939 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17940 {
17941 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17942 }
17943 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17944 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17945 }
17946 }
17947
17948 next_offset += envelope_size;
17949 _next_ordinal_to_read += 1;
17950 if next_offset >= end_offset {
17951 return Ok(());
17952 }
17953
17954 while _next_ordinal_to_read < 3 {
17956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17957 _next_ordinal_to_read += 1;
17958 next_offset += envelope_size;
17959 }
17960
17961 let next_out_of_line = decoder.next_out_of_line();
17962 let handles_before = decoder.remaining_handles();
17963 if let Some((inlined, num_bytes, num_handles)) =
17964 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17965 {
17966 let member_inline_size =
17967 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17968 if inlined != (member_inline_size <= 4) {
17969 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17970 }
17971 let inner_offset;
17972 let mut inner_depth = depth.clone();
17973 if inlined {
17974 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17975 inner_offset = next_offset;
17976 } else {
17977 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17978 inner_depth.increment()?;
17979 }
17980 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
17981 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
17982 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17983 {
17984 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17985 }
17986 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17987 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17988 }
17989 }
17990
17991 next_offset += envelope_size;
17992 _next_ordinal_to_read += 1;
17993 if next_offset >= end_offset {
17994 return Ok(());
17995 }
17996
17997 while _next_ordinal_to_read < 4 {
17999 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18000 _next_ordinal_to_read += 1;
18001 next_offset += envelope_size;
18002 }
18003
18004 let next_out_of_line = decoder.next_out_of_line();
18005 let handles_before = decoder.remaining_handles();
18006 if let Some((inlined, num_bytes, num_handles)) =
18007 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18008 {
18009 let member_inline_size =
18010 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
18011 decoder.context,
18012 );
18013 if inlined != (member_inline_size <= 4) {
18014 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18015 }
18016 let inner_offset;
18017 let mut inner_depth = depth.clone();
18018 if inlined {
18019 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18020 inner_offset = next_offset;
18021 } else {
18022 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18023 inner_depth.increment()?;
18024 }
18025 let val_ref = self
18026 .target_name
18027 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
18028 fidl::decode!(
18029 fidl::encoding::BoundedString<100>,
18030 D,
18031 val_ref,
18032 decoder,
18033 inner_offset,
18034 inner_depth
18035 )?;
18036 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18037 {
18038 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18039 }
18040 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18041 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18042 }
18043 }
18044
18045 next_offset += envelope_size;
18046 _next_ordinal_to_read += 1;
18047 if next_offset >= end_offset {
18048 return Ok(());
18049 }
18050
18051 while _next_ordinal_to_read < 5 {
18053 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18054 _next_ordinal_to_read += 1;
18055 next_offset += envelope_size;
18056 }
18057
18058 let next_out_of_line = decoder.next_out_of_line();
18059 let handles_before = decoder.remaining_handles();
18060 if let Some((inlined, num_bytes, num_handles)) =
18061 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18062 {
18063 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18064 if inlined != (member_inline_size <= 4) {
18065 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18066 }
18067 let inner_offset;
18068 let mut inner_depth = depth.clone();
18069 if inlined {
18070 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18071 inner_offset = next_offset;
18072 } else {
18073 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18074 inner_depth.increment()?;
18075 }
18076 let val_ref = self.source_dictionary.get_or_insert_with(|| {
18077 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
18078 });
18079 fidl::decode!(
18080 fidl::encoding::BoundedString<1024>,
18081 D,
18082 val_ref,
18083 decoder,
18084 inner_offset,
18085 inner_depth
18086 )?;
18087 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18088 {
18089 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18090 }
18091 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18092 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18093 }
18094 }
18095
18096 next_offset += envelope_size;
18097
18098 while next_offset < end_offset {
18100 _next_ordinal_to_read += 1;
18101 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18102 next_offset += envelope_size;
18103 }
18104
18105 Ok(())
18106 }
18107 }
18108
18109 impl OfferService {
18110 #[inline(always)]
18111 fn max_ordinal_present(&self) -> u64 {
18112 if let Some(_) = self.dependency_type {
18113 return 9;
18114 }
18115 if let Some(_) = self.source_dictionary {
18116 return 8;
18117 }
18118 if let Some(_) = self.availability {
18119 return 7;
18120 }
18121 if let Some(_) = self.renamed_instances {
18122 return 6;
18123 }
18124 if let Some(_) = self.source_instance_filter {
18125 return 5;
18126 }
18127 if let Some(_) = self.target_name {
18128 return 4;
18129 }
18130 if let Some(_) = self.target {
18131 return 3;
18132 }
18133 if let Some(_) = self.source_name {
18134 return 2;
18135 }
18136 if let Some(_) = self.source {
18137 return 1;
18138 }
18139 0
18140 }
18141 }
18142
18143 impl fidl::encoding::ValueTypeMarker for OfferService {
18144 type Borrowed<'a> = &'a Self;
18145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18146 value
18147 }
18148 }
18149
18150 unsafe impl fidl::encoding::TypeMarker for OfferService {
18151 type Owned = Self;
18152
18153 #[inline(always)]
18154 fn inline_align(_context: fidl::encoding::Context) -> usize {
18155 8
18156 }
18157
18158 #[inline(always)]
18159 fn inline_size(_context: fidl::encoding::Context) -> usize {
18160 16
18161 }
18162 }
18163
18164 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferService, D>
18165 for &OfferService
18166 {
18167 unsafe fn encode(
18168 self,
18169 encoder: &mut fidl::encoding::Encoder<'_, D>,
18170 offset: usize,
18171 mut depth: fidl::encoding::Depth,
18172 ) -> fidl::Result<()> {
18173 encoder.debug_check_bounds::<OfferService>(offset);
18174 let max_ordinal: u64 = self.max_ordinal_present();
18176 encoder.write_num(max_ordinal, offset);
18177 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18178 if max_ordinal == 0 {
18180 return Ok(());
18181 }
18182 depth.increment()?;
18183 let envelope_size = 8;
18184 let bytes_len = max_ordinal as usize * envelope_size;
18185 #[allow(unused_variables)]
18186 let offset = encoder.out_of_line_offset(bytes_len);
18187 let mut _prev_end_offset: usize = 0;
18188 if 1 > max_ordinal {
18189 return Ok(());
18190 }
18191
18192 let cur_offset: usize = (1 - 1) * envelope_size;
18195
18196 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18198
18199 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
18204 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
18205 encoder,
18206 offset + cur_offset,
18207 depth,
18208 )?;
18209
18210 _prev_end_offset = cur_offset + envelope_size;
18211 if 2 > max_ordinal {
18212 return Ok(());
18213 }
18214
18215 let cur_offset: usize = (2 - 1) * envelope_size;
18218
18219 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18221
18222 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
18227 self.source_name.as_ref().map(
18228 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
18229 ),
18230 encoder,
18231 offset + cur_offset,
18232 depth,
18233 )?;
18234
18235 _prev_end_offset = cur_offset + envelope_size;
18236 if 3 > max_ordinal {
18237 return Ok(());
18238 }
18239
18240 let cur_offset: usize = (3 - 1) * envelope_size;
18243
18244 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18246
18247 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
18252 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
18253 encoder,
18254 offset + cur_offset,
18255 depth,
18256 )?;
18257
18258 _prev_end_offset = cur_offset + envelope_size;
18259 if 4 > max_ordinal {
18260 return Ok(());
18261 }
18262
18263 let cur_offset: usize = (4 - 1) * envelope_size;
18266
18267 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18269
18270 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
18275 self.target_name.as_ref().map(
18276 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
18277 ),
18278 encoder,
18279 offset + cur_offset,
18280 depth,
18281 )?;
18282
18283 _prev_end_offset = cur_offset + envelope_size;
18284 if 5 > max_ordinal {
18285 return Ok(());
18286 }
18287
18288 let cur_offset: usize = (5 - 1) * envelope_size;
18291
18292 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18294
18295 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>, D>(
18300 self.source_instance_filter.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>> as fidl::encoding::ValueTypeMarker>::borrow),
18301 encoder, offset + cur_offset, depth
18302 )?;
18303
18304 _prev_end_offset = cur_offset + envelope_size;
18305 if 6 > max_ordinal {
18306 return Ok(());
18307 }
18308
18309 let cur_offset: usize = (6 - 1) * envelope_size;
18312
18313 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18315
18316 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<NameMapping>, D>(
18321 self.renamed_instances.as_ref().map(<fidl::encoding::UnboundedVector<NameMapping> as fidl::encoding::ValueTypeMarker>::borrow),
18322 encoder, offset + cur_offset, depth
18323 )?;
18324
18325 _prev_end_offset = cur_offset + envelope_size;
18326 if 7 > max_ordinal {
18327 return Ok(());
18328 }
18329
18330 let cur_offset: usize = (7 - 1) * envelope_size;
18333
18334 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18336
18337 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
18342 self.availability
18343 .as_ref()
18344 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
18345 encoder,
18346 offset + cur_offset,
18347 depth,
18348 )?;
18349
18350 _prev_end_offset = cur_offset + envelope_size;
18351 if 8 > max_ordinal {
18352 return Ok(());
18353 }
18354
18355 let cur_offset: usize = (8 - 1) * envelope_size;
18358
18359 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18361
18362 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
18367 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
18368 encoder, offset + cur_offset, depth
18369 )?;
18370
18371 _prev_end_offset = cur_offset + envelope_size;
18372 if 9 > max_ordinal {
18373 return Ok(());
18374 }
18375
18376 let cur_offset: usize = (9 - 1) * envelope_size;
18379
18380 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18382
18383 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
18388 self.dependency_type
18389 .as_ref()
18390 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
18391 encoder,
18392 offset + cur_offset,
18393 depth,
18394 )?;
18395
18396 _prev_end_offset = cur_offset + envelope_size;
18397
18398 Ok(())
18399 }
18400 }
18401
18402 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferService {
18403 #[inline(always)]
18404 fn new_empty() -> Self {
18405 Self::default()
18406 }
18407
18408 unsafe fn decode(
18409 &mut self,
18410 decoder: &mut fidl::encoding::Decoder<'_, D>,
18411 offset: usize,
18412 mut depth: fidl::encoding::Depth,
18413 ) -> fidl::Result<()> {
18414 decoder.debug_check_bounds::<Self>(offset);
18415 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18416 None => return Err(fidl::Error::NotNullable),
18417 Some(len) => len,
18418 };
18419 if len == 0 {
18421 return Ok(());
18422 };
18423 depth.increment()?;
18424 let envelope_size = 8;
18425 let bytes_len = len * envelope_size;
18426 let offset = decoder.out_of_line_offset(bytes_len)?;
18427 let mut _next_ordinal_to_read = 0;
18429 let mut next_offset = offset;
18430 let end_offset = offset + bytes_len;
18431 _next_ordinal_to_read += 1;
18432 if next_offset >= end_offset {
18433 return Ok(());
18434 }
18435
18436 while _next_ordinal_to_read < 1 {
18438 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18439 _next_ordinal_to_read += 1;
18440 next_offset += envelope_size;
18441 }
18442
18443 let next_out_of_line = decoder.next_out_of_line();
18444 let handles_before = decoder.remaining_handles();
18445 if let Some((inlined, num_bytes, num_handles)) =
18446 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18447 {
18448 let member_inline_size =
18449 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18450 if inlined != (member_inline_size <= 4) {
18451 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18452 }
18453 let inner_offset;
18454 let mut inner_depth = depth.clone();
18455 if inlined {
18456 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18457 inner_offset = next_offset;
18458 } else {
18459 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18460 inner_depth.increment()?;
18461 }
18462 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
18463 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
18464 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18465 {
18466 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18467 }
18468 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18469 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18470 }
18471 }
18472
18473 next_offset += envelope_size;
18474 _next_ordinal_to_read += 1;
18475 if next_offset >= end_offset {
18476 return Ok(());
18477 }
18478
18479 while _next_ordinal_to_read < 2 {
18481 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18482 _next_ordinal_to_read += 1;
18483 next_offset += envelope_size;
18484 }
18485
18486 let next_out_of_line = decoder.next_out_of_line();
18487 let handles_before = decoder.remaining_handles();
18488 if let Some((inlined, num_bytes, num_handles)) =
18489 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18490 {
18491 let member_inline_size =
18492 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
18493 decoder.context,
18494 );
18495 if inlined != (member_inline_size <= 4) {
18496 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18497 }
18498 let inner_offset;
18499 let mut inner_depth = depth.clone();
18500 if inlined {
18501 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18502 inner_offset = next_offset;
18503 } else {
18504 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18505 inner_depth.increment()?;
18506 }
18507 let val_ref = self
18508 .source_name
18509 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
18510 fidl::decode!(
18511 fidl::encoding::BoundedString<100>,
18512 D,
18513 val_ref,
18514 decoder,
18515 inner_offset,
18516 inner_depth
18517 )?;
18518 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18519 {
18520 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18521 }
18522 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18523 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18524 }
18525 }
18526
18527 next_offset += envelope_size;
18528 _next_ordinal_to_read += 1;
18529 if next_offset >= end_offset {
18530 return Ok(());
18531 }
18532
18533 while _next_ordinal_to_read < 3 {
18535 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18536 _next_ordinal_to_read += 1;
18537 next_offset += envelope_size;
18538 }
18539
18540 let next_out_of_line = decoder.next_out_of_line();
18541 let handles_before = decoder.remaining_handles();
18542 if let Some((inlined, num_bytes, num_handles)) =
18543 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18544 {
18545 let member_inline_size =
18546 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18547 if inlined != (member_inline_size <= 4) {
18548 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18549 }
18550 let inner_offset;
18551 let mut inner_depth = depth.clone();
18552 if inlined {
18553 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18554 inner_offset = next_offset;
18555 } else {
18556 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18557 inner_depth.increment()?;
18558 }
18559 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
18560 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
18561 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18562 {
18563 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18564 }
18565 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18566 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18567 }
18568 }
18569
18570 next_offset += envelope_size;
18571 _next_ordinal_to_read += 1;
18572 if next_offset >= end_offset {
18573 return Ok(());
18574 }
18575
18576 while _next_ordinal_to_read < 4 {
18578 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18579 _next_ordinal_to_read += 1;
18580 next_offset += envelope_size;
18581 }
18582
18583 let next_out_of_line = decoder.next_out_of_line();
18584 let handles_before = decoder.remaining_handles();
18585 if let Some((inlined, num_bytes, num_handles)) =
18586 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18587 {
18588 let member_inline_size =
18589 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
18590 decoder.context,
18591 );
18592 if inlined != (member_inline_size <= 4) {
18593 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18594 }
18595 let inner_offset;
18596 let mut inner_depth = depth.clone();
18597 if inlined {
18598 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18599 inner_offset = next_offset;
18600 } else {
18601 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18602 inner_depth.increment()?;
18603 }
18604 let val_ref = self
18605 .target_name
18606 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
18607 fidl::decode!(
18608 fidl::encoding::BoundedString<100>,
18609 D,
18610 val_ref,
18611 decoder,
18612 inner_offset,
18613 inner_depth
18614 )?;
18615 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18616 {
18617 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18618 }
18619 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18620 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18621 }
18622 }
18623
18624 next_offset += envelope_size;
18625 _next_ordinal_to_read += 1;
18626 if next_offset >= end_offset {
18627 return Ok(());
18628 }
18629
18630 while _next_ordinal_to_read < 5 {
18632 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18633 _next_ordinal_to_read += 1;
18634 next_offset += envelope_size;
18635 }
18636
18637 let next_out_of_line = decoder.next_out_of_line();
18638 let handles_before = decoder.remaining_handles();
18639 if let Some((inlined, num_bytes, num_handles)) =
18640 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18641 {
18642 let member_inline_size = <fidl::encoding::UnboundedVector<
18643 fidl::encoding::BoundedString<100>,
18644 > as fidl::encoding::TypeMarker>::inline_size(
18645 decoder.context
18646 );
18647 if inlined != (member_inline_size <= 4) {
18648 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18649 }
18650 let inner_offset;
18651 let mut inner_depth = depth.clone();
18652 if inlined {
18653 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18654 inner_offset = next_offset;
18655 } else {
18656 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18657 inner_depth.increment()?;
18658 }
18659 let val_ref = self.source_instance_filter.get_or_insert_with(|| {
18660 fidl::new_empty!(
18661 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
18662 D
18663 )
18664 });
18665 fidl::decode!(
18666 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
18667 D,
18668 val_ref,
18669 decoder,
18670 inner_offset,
18671 inner_depth
18672 )?;
18673 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18674 {
18675 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18676 }
18677 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18678 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18679 }
18680 }
18681
18682 next_offset += envelope_size;
18683 _next_ordinal_to_read += 1;
18684 if next_offset >= end_offset {
18685 return Ok(());
18686 }
18687
18688 while _next_ordinal_to_read < 6 {
18690 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18691 _next_ordinal_to_read += 1;
18692 next_offset += envelope_size;
18693 }
18694
18695 let next_out_of_line = decoder.next_out_of_line();
18696 let handles_before = decoder.remaining_handles();
18697 if let Some((inlined, num_bytes, num_handles)) =
18698 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18699 {
18700 let member_inline_size = <fidl::encoding::UnboundedVector<NameMapping> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18701 if inlined != (member_inline_size <= 4) {
18702 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18703 }
18704 let inner_offset;
18705 let mut inner_depth = depth.clone();
18706 if inlined {
18707 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18708 inner_offset = next_offset;
18709 } else {
18710 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18711 inner_depth.increment()?;
18712 }
18713 let val_ref = self.renamed_instances.get_or_insert_with(|| {
18714 fidl::new_empty!(fidl::encoding::UnboundedVector<NameMapping>, D)
18715 });
18716 fidl::decode!(
18717 fidl::encoding::UnboundedVector<NameMapping>,
18718 D,
18719 val_ref,
18720 decoder,
18721 inner_offset,
18722 inner_depth
18723 )?;
18724 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18725 {
18726 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18727 }
18728 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18729 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18730 }
18731 }
18732
18733 next_offset += envelope_size;
18734 _next_ordinal_to_read += 1;
18735 if next_offset >= end_offset {
18736 return Ok(());
18737 }
18738
18739 while _next_ordinal_to_read < 7 {
18741 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18742 _next_ordinal_to_read += 1;
18743 next_offset += envelope_size;
18744 }
18745
18746 let next_out_of_line = decoder.next_out_of_line();
18747 let handles_before = decoder.remaining_handles();
18748 if let Some((inlined, num_bytes, num_handles)) =
18749 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18750 {
18751 let member_inline_size =
18752 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18753 if inlined != (member_inline_size <= 4) {
18754 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18755 }
18756 let inner_offset;
18757 let mut inner_depth = depth.clone();
18758 if inlined {
18759 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18760 inner_offset = next_offset;
18761 } else {
18762 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18763 inner_depth.increment()?;
18764 }
18765 let val_ref =
18766 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
18767 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
18768 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18769 {
18770 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18771 }
18772 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18773 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18774 }
18775 }
18776
18777 next_offset += envelope_size;
18778 _next_ordinal_to_read += 1;
18779 if next_offset >= end_offset {
18780 return Ok(());
18781 }
18782
18783 while _next_ordinal_to_read < 8 {
18785 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18786 _next_ordinal_to_read += 1;
18787 next_offset += envelope_size;
18788 }
18789
18790 let next_out_of_line = decoder.next_out_of_line();
18791 let handles_before = decoder.remaining_handles();
18792 if let Some((inlined, num_bytes, num_handles)) =
18793 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18794 {
18795 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18796 if inlined != (member_inline_size <= 4) {
18797 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18798 }
18799 let inner_offset;
18800 let mut inner_depth = depth.clone();
18801 if inlined {
18802 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18803 inner_offset = next_offset;
18804 } else {
18805 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18806 inner_depth.increment()?;
18807 }
18808 let val_ref = self.source_dictionary.get_or_insert_with(|| {
18809 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
18810 });
18811 fidl::decode!(
18812 fidl::encoding::BoundedString<1024>,
18813 D,
18814 val_ref,
18815 decoder,
18816 inner_offset,
18817 inner_depth
18818 )?;
18819 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18820 {
18821 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18822 }
18823 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18824 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18825 }
18826 }
18827
18828 next_offset += envelope_size;
18829 _next_ordinal_to_read += 1;
18830 if next_offset >= end_offset {
18831 return Ok(());
18832 }
18833
18834 while _next_ordinal_to_read < 9 {
18836 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18837 _next_ordinal_to_read += 1;
18838 next_offset += envelope_size;
18839 }
18840
18841 let next_out_of_line = decoder.next_out_of_line();
18842 let handles_before = decoder.remaining_handles();
18843 if let Some((inlined, num_bytes, num_handles)) =
18844 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18845 {
18846 let member_inline_size =
18847 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18848 if inlined != (member_inline_size <= 4) {
18849 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18850 }
18851 let inner_offset;
18852 let mut inner_depth = depth.clone();
18853 if inlined {
18854 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18855 inner_offset = next_offset;
18856 } else {
18857 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18858 inner_depth.increment()?;
18859 }
18860 let val_ref =
18861 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
18862 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
18863 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18864 {
18865 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18866 }
18867 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18868 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18869 }
18870 }
18871
18872 next_offset += envelope_size;
18873
18874 while next_offset < end_offset {
18876 _next_ordinal_to_read += 1;
18877 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18878 next_offset += envelope_size;
18879 }
18880
18881 Ok(())
18882 }
18883 }
18884
18885 impl OfferStorage {
18886 #[inline(always)]
18887 fn max_ordinal_present(&self) -> u64 {
18888 if let Some(_) = self.availability {
18889 return 5;
18890 }
18891 if let Some(_) = self.target_name {
18892 return 4;
18893 }
18894 if let Some(_) = self.target {
18895 return 3;
18896 }
18897 if let Some(_) = self.source {
18898 return 2;
18899 }
18900 if let Some(_) = self.source_name {
18901 return 1;
18902 }
18903 0
18904 }
18905 }
18906
18907 impl fidl::encoding::ValueTypeMarker for OfferStorage {
18908 type Borrowed<'a> = &'a Self;
18909 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18910 value
18911 }
18912 }
18913
18914 unsafe impl fidl::encoding::TypeMarker for OfferStorage {
18915 type Owned = Self;
18916
18917 #[inline(always)]
18918 fn inline_align(_context: fidl::encoding::Context) -> usize {
18919 8
18920 }
18921
18922 #[inline(always)]
18923 fn inline_size(_context: fidl::encoding::Context) -> usize {
18924 16
18925 }
18926 }
18927
18928 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OfferStorage, D>
18929 for &OfferStorage
18930 {
18931 unsafe fn encode(
18932 self,
18933 encoder: &mut fidl::encoding::Encoder<'_, D>,
18934 offset: usize,
18935 mut depth: fidl::encoding::Depth,
18936 ) -> fidl::Result<()> {
18937 encoder.debug_check_bounds::<OfferStorage>(offset);
18938 let max_ordinal: u64 = self.max_ordinal_present();
18940 encoder.write_num(max_ordinal, offset);
18941 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18942 if max_ordinal == 0 {
18944 return Ok(());
18945 }
18946 depth.increment()?;
18947 let envelope_size = 8;
18948 let bytes_len = max_ordinal as usize * envelope_size;
18949 #[allow(unused_variables)]
18950 let offset = encoder.out_of_line_offset(bytes_len);
18951 let mut _prev_end_offset: usize = 0;
18952 if 1 > max_ordinal {
18953 return Ok(());
18954 }
18955
18956 let cur_offset: usize = (1 - 1) * envelope_size;
18959
18960 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18962
18963 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
18968 self.source_name.as_ref().map(
18969 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
18970 ),
18971 encoder,
18972 offset + cur_offset,
18973 depth,
18974 )?;
18975
18976 _prev_end_offset = cur_offset + envelope_size;
18977 if 2 > max_ordinal {
18978 return Ok(());
18979 }
18980
18981 let cur_offset: usize = (2 - 1) * envelope_size;
18984
18985 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18987
18988 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
18993 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
18994 encoder,
18995 offset + cur_offset,
18996 depth,
18997 )?;
18998
18999 _prev_end_offset = cur_offset + envelope_size;
19000 if 3 > max_ordinal {
19001 return Ok(());
19002 }
19003
19004 let cur_offset: usize = (3 - 1) * envelope_size;
19007
19008 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19010
19011 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
19016 self.target.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
19017 encoder,
19018 offset + cur_offset,
19019 depth,
19020 )?;
19021
19022 _prev_end_offset = cur_offset + envelope_size;
19023 if 4 > max_ordinal {
19024 return Ok(());
19025 }
19026
19027 let cur_offset: usize = (4 - 1) * envelope_size;
19030
19031 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19033
19034 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
19039 self.target_name.as_ref().map(
19040 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
19041 ),
19042 encoder,
19043 offset + cur_offset,
19044 depth,
19045 )?;
19046
19047 _prev_end_offset = cur_offset + envelope_size;
19048 if 5 > max_ordinal {
19049 return Ok(());
19050 }
19051
19052 let cur_offset: usize = (5 - 1) * envelope_size;
19055
19056 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19058
19059 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
19064 self.availability
19065 .as_ref()
19066 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
19067 encoder,
19068 offset + cur_offset,
19069 depth,
19070 )?;
19071
19072 _prev_end_offset = cur_offset + envelope_size;
19073
19074 Ok(())
19075 }
19076 }
19077
19078 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OfferStorage {
19079 #[inline(always)]
19080 fn new_empty() -> Self {
19081 Self::default()
19082 }
19083
19084 unsafe fn decode(
19085 &mut self,
19086 decoder: &mut fidl::encoding::Decoder<'_, D>,
19087 offset: usize,
19088 mut depth: fidl::encoding::Depth,
19089 ) -> fidl::Result<()> {
19090 decoder.debug_check_bounds::<Self>(offset);
19091 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19092 None => return Err(fidl::Error::NotNullable),
19093 Some(len) => len,
19094 };
19095 if len == 0 {
19097 return Ok(());
19098 };
19099 depth.increment()?;
19100 let envelope_size = 8;
19101 let bytes_len = len * envelope_size;
19102 let offset = decoder.out_of_line_offset(bytes_len)?;
19103 let mut _next_ordinal_to_read = 0;
19105 let mut next_offset = offset;
19106 let end_offset = offset + bytes_len;
19107 _next_ordinal_to_read += 1;
19108 if next_offset >= end_offset {
19109 return Ok(());
19110 }
19111
19112 while _next_ordinal_to_read < 1 {
19114 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19115 _next_ordinal_to_read += 1;
19116 next_offset += envelope_size;
19117 }
19118
19119 let next_out_of_line = decoder.next_out_of_line();
19120 let handles_before = decoder.remaining_handles();
19121 if let Some((inlined, num_bytes, num_handles)) =
19122 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19123 {
19124 let member_inline_size =
19125 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
19126 decoder.context,
19127 );
19128 if inlined != (member_inline_size <= 4) {
19129 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19130 }
19131 let inner_offset;
19132 let mut inner_depth = depth.clone();
19133 if inlined {
19134 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19135 inner_offset = next_offset;
19136 } else {
19137 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19138 inner_depth.increment()?;
19139 }
19140 let val_ref = self
19141 .source_name
19142 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
19143 fidl::decode!(
19144 fidl::encoding::BoundedString<100>,
19145 D,
19146 val_ref,
19147 decoder,
19148 inner_offset,
19149 inner_depth
19150 )?;
19151 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19152 {
19153 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19154 }
19155 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19156 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19157 }
19158 }
19159
19160 next_offset += envelope_size;
19161 _next_ordinal_to_read += 1;
19162 if next_offset >= end_offset {
19163 return Ok(());
19164 }
19165
19166 while _next_ordinal_to_read < 2 {
19168 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19169 _next_ordinal_to_read += 1;
19170 next_offset += envelope_size;
19171 }
19172
19173 let next_out_of_line = decoder.next_out_of_line();
19174 let handles_before = decoder.remaining_handles();
19175 if let Some((inlined, num_bytes, num_handles)) =
19176 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19177 {
19178 let member_inline_size =
19179 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19180 if inlined != (member_inline_size <= 4) {
19181 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19182 }
19183 let inner_offset;
19184 let mut inner_depth = depth.clone();
19185 if inlined {
19186 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19187 inner_offset = next_offset;
19188 } else {
19189 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19190 inner_depth.increment()?;
19191 }
19192 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
19193 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
19194 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19195 {
19196 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19197 }
19198 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19199 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19200 }
19201 }
19202
19203 next_offset += envelope_size;
19204 _next_ordinal_to_read += 1;
19205 if next_offset >= end_offset {
19206 return Ok(());
19207 }
19208
19209 while _next_ordinal_to_read < 3 {
19211 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19212 _next_ordinal_to_read += 1;
19213 next_offset += envelope_size;
19214 }
19215
19216 let next_out_of_line = decoder.next_out_of_line();
19217 let handles_before = decoder.remaining_handles();
19218 if let Some((inlined, num_bytes, num_handles)) =
19219 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19220 {
19221 let member_inline_size =
19222 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19223 if inlined != (member_inline_size <= 4) {
19224 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19225 }
19226 let inner_offset;
19227 let mut inner_depth = depth.clone();
19228 if inlined {
19229 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19230 inner_offset = next_offset;
19231 } else {
19232 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19233 inner_depth.increment()?;
19234 }
19235 let val_ref = self.target.get_or_insert_with(|| fidl::new_empty!(Ref, D));
19236 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
19237 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19238 {
19239 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19240 }
19241 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19242 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19243 }
19244 }
19245
19246 next_offset += envelope_size;
19247 _next_ordinal_to_read += 1;
19248 if next_offset >= end_offset {
19249 return Ok(());
19250 }
19251
19252 while _next_ordinal_to_read < 4 {
19254 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19255 _next_ordinal_to_read += 1;
19256 next_offset += envelope_size;
19257 }
19258
19259 let next_out_of_line = decoder.next_out_of_line();
19260 let handles_before = decoder.remaining_handles();
19261 if let Some((inlined, num_bytes, num_handles)) =
19262 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19263 {
19264 let member_inline_size =
19265 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
19266 decoder.context,
19267 );
19268 if inlined != (member_inline_size <= 4) {
19269 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19270 }
19271 let inner_offset;
19272 let mut inner_depth = depth.clone();
19273 if inlined {
19274 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19275 inner_offset = next_offset;
19276 } else {
19277 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19278 inner_depth.increment()?;
19279 }
19280 let val_ref = self
19281 .target_name
19282 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
19283 fidl::decode!(
19284 fidl::encoding::BoundedString<100>,
19285 D,
19286 val_ref,
19287 decoder,
19288 inner_offset,
19289 inner_depth
19290 )?;
19291 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19292 {
19293 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19294 }
19295 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19296 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19297 }
19298 }
19299
19300 next_offset += envelope_size;
19301 _next_ordinal_to_read += 1;
19302 if next_offset >= end_offset {
19303 return Ok(());
19304 }
19305
19306 while _next_ordinal_to_read < 5 {
19308 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19309 _next_ordinal_to_read += 1;
19310 next_offset += envelope_size;
19311 }
19312
19313 let next_out_of_line = decoder.next_out_of_line();
19314 let handles_before = decoder.remaining_handles();
19315 if let Some((inlined, num_bytes, num_handles)) =
19316 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19317 {
19318 let member_inline_size =
19319 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19320 if inlined != (member_inline_size <= 4) {
19321 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19322 }
19323 let inner_offset;
19324 let mut inner_depth = depth.clone();
19325 if inlined {
19326 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19327 inner_offset = next_offset;
19328 } else {
19329 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19330 inner_depth.increment()?;
19331 }
19332 let val_ref =
19333 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
19334 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
19335 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19336 {
19337 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19338 }
19339 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19340 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19341 }
19342 }
19343
19344 next_offset += envelope_size;
19345
19346 while next_offset < end_offset {
19348 _next_ordinal_to_read += 1;
19349 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19350 next_offset += envelope_size;
19351 }
19352
19353 Ok(())
19354 }
19355 }
19356
19357 impl Program {
19358 #[inline(always)]
19359 fn max_ordinal_present(&self) -> u64 {
19360 if let Some(_) = self.info {
19361 return 2;
19362 }
19363 if let Some(_) = self.runner {
19364 return 1;
19365 }
19366 0
19367 }
19368 }
19369
19370 impl fidl::encoding::ValueTypeMarker for Program {
19371 type Borrowed<'a> = &'a Self;
19372 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19373 value
19374 }
19375 }
19376
19377 unsafe impl fidl::encoding::TypeMarker for Program {
19378 type Owned = Self;
19379
19380 #[inline(always)]
19381 fn inline_align(_context: fidl::encoding::Context) -> usize {
19382 8
19383 }
19384
19385 #[inline(always)]
19386 fn inline_size(_context: fidl::encoding::Context) -> usize {
19387 16
19388 }
19389 }
19390
19391 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Program, D> for &Program {
19392 unsafe fn encode(
19393 self,
19394 encoder: &mut fidl::encoding::Encoder<'_, D>,
19395 offset: usize,
19396 mut depth: fidl::encoding::Depth,
19397 ) -> fidl::Result<()> {
19398 encoder.debug_check_bounds::<Program>(offset);
19399 let max_ordinal: u64 = self.max_ordinal_present();
19401 encoder.write_num(max_ordinal, offset);
19402 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19403 if max_ordinal == 0 {
19405 return Ok(());
19406 }
19407 depth.increment()?;
19408 let envelope_size = 8;
19409 let bytes_len = max_ordinal as usize * envelope_size;
19410 #[allow(unused_variables)]
19411 let offset = encoder.out_of_line_offset(bytes_len);
19412 let mut _prev_end_offset: usize = 0;
19413 if 1 > max_ordinal {
19414 return Ok(());
19415 }
19416
19417 let cur_offset: usize = (1 - 1) * envelope_size;
19420
19421 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19423
19424 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
19429 self.runner.as_ref().map(
19430 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
19431 ),
19432 encoder,
19433 offset + cur_offset,
19434 depth,
19435 )?;
19436
19437 _prev_end_offset = cur_offset + envelope_size;
19438 if 2 > max_ordinal {
19439 return Ok(());
19440 }
19441
19442 let cur_offset: usize = (2 - 1) * envelope_size;
19445
19446 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19448
19449 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_data::Dictionary, D>(
19454 self.info.as_ref().map(
19455 <fidl_fuchsia_data::Dictionary as fidl::encoding::ValueTypeMarker>::borrow,
19456 ),
19457 encoder,
19458 offset + cur_offset,
19459 depth,
19460 )?;
19461
19462 _prev_end_offset = cur_offset + envelope_size;
19463
19464 Ok(())
19465 }
19466 }
19467
19468 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Program {
19469 #[inline(always)]
19470 fn new_empty() -> Self {
19471 Self::default()
19472 }
19473
19474 unsafe fn decode(
19475 &mut self,
19476 decoder: &mut fidl::encoding::Decoder<'_, D>,
19477 offset: usize,
19478 mut depth: fidl::encoding::Depth,
19479 ) -> fidl::Result<()> {
19480 decoder.debug_check_bounds::<Self>(offset);
19481 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19482 None => return Err(fidl::Error::NotNullable),
19483 Some(len) => len,
19484 };
19485 if len == 0 {
19487 return Ok(());
19488 };
19489 depth.increment()?;
19490 let envelope_size = 8;
19491 let bytes_len = len * envelope_size;
19492 let offset = decoder.out_of_line_offset(bytes_len)?;
19493 let mut _next_ordinal_to_read = 0;
19495 let mut next_offset = offset;
19496 let end_offset = offset + bytes_len;
19497 _next_ordinal_to_read += 1;
19498 if next_offset >= end_offset {
19499 return Ok(());
19500 }
19501
19502 while _next_ordinal_to_read < 1 {
19504 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19505 _next_ordinal_to_read += 1;
19506 next_offset += envelope_size;
19507 }
19508
19509 let next_out_of_line = decoder.next_out_of_line();
19510 let handles_before = decoder.remaining_handles();
19511 if let Some((inlined, num_bytes, num_handles)) =
19512 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19513 {
19514 let member_inline_size =
19515 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
19516 decoder.context,
19517 );
19518 if inlined != (member_inline_size <= 4) {
19519 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19520 }
19521 let inner_offset;
19522 let mut inner_depth = depth.clone();
19523 if inlined {
19524 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19525 inner_offset = next_offset;
19526 } else {
19527 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19528 inner_depth.increment()?;
19529 }
19530 let val_ref = self
19531 .runner
19532 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
19533 fidl::decode!(
19534 fidl::encoding::BoundedString<100>,
19535 D,
19536 val_ref,
19537 decoder,
19538 inner_offset,
19539 inner_depth
19540 )?;
19541 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19542 {
19543 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19544 }
19545 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19546 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19547 }
19548 }
19549
19550 next_offset += envelope_size;
19551 _next_ordinal_to_read += 1;
19552 if next_offset >= end_offset {
19553 return Ok(());
19554 }
19555
19556 while _next_ordinal_to_read < 2 {
19558 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19559 _next_ordinal_to_read += 1;
19560 next_offset += envelope_size;
19561 }
19562
19563 let next_out_of_line = decoder.next_out_of_line();
19564 let handles_before = decoder.remaining_handles();
19565 if let Some((inlined, num_bytes, num_handles)) =
19566 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19567 {
19568 let member_inline_size =
19569 <fidl_fuchsia_data::Dictionary as fidl::encoding::TypeMarker>::inline_size(
19570 decoder.context,
19571 );
19572 if inlined != (member_inline_size <= 4) {
19573 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19574 }
19575 let inner_offset;
19576 let mut inner_depth = depth.clone();
19577 if inlined {
19578 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19579 inner_offset = next_offset;
19580 } else {
19581 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19582 inner_depth.increment()?;
19583 }
19584 let val_ref = self
19585 .info
19586 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_data::Dictionary, D));
19587 fidl::decode!(
19588 fidl_fuchsia_data::Dictionary,
19589 D,
19590 val_ref,
19591 decoder,
19592 inner_offset,
19593 inner_depth
19594 )?;
19595 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19596 {
19597 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19598 }
19599 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19600 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19601 }
19602 }
19603
19604 next_offset += envelope_size;
19605
19606 while next_offset < end_offset {
19608 _next_ordinal_to_read += 1;
19609 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19610 next_offset += envelope_size;
19611 }
19612
19613 Ok(())
19614 }
19615 }
19616
19617 impl Protocol {
19618 #[inline(always)]
19619 fn max_ordinal_present(&self) -> u64 {
19620 if let Some(_) = self.delivery {
19621 return 3;
19622 }
19623 if let Some(_) = self.source_path {
19624 return 2;
19625 }
19626 if let Some(_) = self.name {
19627 return 1;
19628 }
19629 0
19630 }
19631 }
19632
19633 impl fidl::encoding::ValueTypeMarker for Protocol {
19634 type Borrowed<'a> = &'a Self;
19635 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19636 value
19637 }
19638 }
19639
19640 unsafe impl fidl::encoding::TypeMarker for Protocol {
19641 type Owned = Self;
19642
19643 #[inline(always)]
19644 fn inline_align(_context: fidl::encoding::Context) -> usize {
19645 8
19646 }
19647
19648 #[inline(always)]
19649 fn inline_size(_context: fidl::encoding::Context) -> usize {
19650 16
19651 }
19652 }
19653
19654 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Protocol, D> for &Protocol {
19655 unsafe fn encode(
19656 self,
19657 encoder: &mut fidl::encoding::Encoder<'_, D>,
19658 offset: usize,
19659 mut depth: fidl::encoding::Depth,
19660 ) -> fidl::Result<()> {
19661 encoder.debug_check_bounds::<Protocol>(offset);
19662 let max_ordinal: u64 = self.max_ordinal_present();
19664 encoder.write_num(max_ordinal, offset);
19665 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19666 if max_ordinal == 0 {
19668 return Ok(());
19669 }
19670 depth.increment()?;
19671 let envelope_size = 8;
19672 let bytes_len = max_ordinal as usize * envelope_size;
19673 #[allow(unused_variables)]
19674 let offset = encoder.out_of_line_offset(bytes_len);
19675 let mut _prev_end_offset: usize = 0;
19676 if 1 > max_ordinal {
19677 return Ok(());
19678 }
19679
19680 let cur_offset: usize = (1 - 1) * envelope_size;
19683
19684 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19686
19687 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
19692 self.name.as_ref().map(
19693 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
19694 ),
19695 encoder,
19696 offset + cur_offset,
19697 depth,
19698 )?;
19699
19700 _prev_end_offset = cur_offset + envelope_size;
19701 if 2 > max_ordinal {
19702 return Ok(());
19703 }
19704
19705 let cur_offset: usize = (2 - 1) * envelope_size;
19708
19709 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19711
19712 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
19717 self.source_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
19718 encoder, offset + cur_offset, depth
19719 )?;
19720
19721 _prev_end_offset = cur_offset + envelope_size;
19722 if 3 > max_ordinal {
19723 return Ok(());
19724 }
19725
19726 let cur_offset: usize = (3 - 1) * envelope_size;
19729
19730 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19732
19733 fidl::encoding::encode_in_envelope_optional::<DeliveryType, D>(
19738 self.delivery
19739 .as_ref()
19740 .map(<DeliveryType as fidl::encoding::ValueTypeMarker>::borrow),
19741 encoder,
19742 offset + cur_offset,
19743 depth,
19744 )?;
19745
19746 _prev_end_offset = cur_offset + envelope_size;
19747
19748 Ok(())
19749 }
19750 }
19751
19752 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Protocol {
19753 #[inline(always)]
19754 fn new_empty() -> Self {
19755 Self::default()
19756 }
19757
19758 unsafe fn decode(
19759 &mut self,
19760 decoder: &mut fidl::encoding::Decoder<'_, D>,
19761 offset: usize,
19762 mut depth: fidl::encoding::Depth,
19763 ) -> fidl::Result<()> {
19764 decoder.debug_check_bounds::<Self>(offset);
19765 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19766 None => return Err(fidl::Error::NotNullable),
19767 Some(len) => len,
19768 };
19769 if len == 0 {
19771 return Ok(());
19772 };
19773 depth.increment()?;
19774 let envelope_size = 8;
19775 let bytes_len = len * envelope_size;
19776 let offset = decoder.out_of_line_offset(bytes_len)?;
19777 let mut _next_ordinal_to_read = 0;
19779 let mut next_offset = offset;
19780 let end_offset = offset + bytes_len;
19781 _next_ordinal_to_read += 1;
19782 if next_offset >= end_offset {
19783 return Ok(());
19784 }
19785
19786 while _next_ordinal_to_read < 1 {
19788 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19789 _next_ordinal_to_read += 1;
19790 next_offset += envelope_size;
19791 }
19792
19793 let next_out_of_line = decoder.next_out_of_line();
19794 let handles_before = decoder.remaining_handles();
19795 if let Some((inlined, num_bytes, num_handles)) =
19796 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19797 {
19798 let member_inline_size =
19799 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
19800 decoder.context,
19801 );
19802 if inlined != (member_inline_size <= 4) {
19803 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19804 }
19805 let inner_offset;
19806 let mut inner_depth = depth.clone();
19807 if inlined {
19808 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19809 inner_offset = next_offset;
19810 } else {
19811 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19812 inner_depth.increment()?;
19813 }
19814 let val_ref = self
19815 .name
19816 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
19817 fidl::decode!(
19818 fidl::encoding::BoundedString<100>,
19819 D,
19820 val_ref,
19821 decoder,
19822 inner_offset,
19823 inner_depth
19824 )?;
19825 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19826 {
19827 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19828 }
19829 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19830 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19831 }
19832 }
19833
19834 next_offset += envelope_size;
19835 _next_ordinal_to_read += 1;
19836 if next_offset >= end_offset {
19837 return Ok(());
19838 }
19839
19840 while _next_ordinal_to_read < 2 {
19842 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19843 _next_ordinal_to_read += 1;
19844 next_offset += envelope_size;
19845 }
19846
19847 let next_out_of_line = decoder.next_out_of_line();
19848 let handles_before = decoder.remaining_handles();
19849 if let Some((inlined, num_bytes, num_handles)) =
19850 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19851 {
19852 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19853 if inlined != (member_inline_size <= 4) {
19854 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19855 }
19856 let inner_offset;
19857 let mut inner_depth = depth.clone();
19858 if inlined {
19859 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19860 inner_offset = next_offset;
19861 } else {
19862 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19863 inner_depth.increment()?;
19864 }
19865 let val_ref = self.source_path.get_or_insert_with(|| {
19866 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
19867 });
19868 fidl::decode!(
19869 fidl::encoding::BoundedString<1024>,
19870 D,
19871 val_ref,
19872 decoder,
19873 inner_offset,
19874 inner_depth
19875 )?;
19876 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19877 {
19878 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19879 }
19880 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19881 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19882 }
19883 }
19884
19885 next_offset += envelope_size;
19886 _next_ordinal_to_read += 1;
19887 if next_offset >= end_offset {
19888 return Ok(());
19889 }
19890
19891 while _next_ordinal_to_read < 3 {
19893 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19894 _next_ordinal_to_read += 1;
19895 next_offset += envelope_size;
19896 }
19897
19898 let next_out_of_line = decoder.next_out_of_line();
19899 let handles_before = decoder.remaining_handles();
19900 if let Some((inlined, num_bytes, num_handles)) =
19901 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19902 {
19903 let member_inline_size =
19904 <DeliveryType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19905 if inlined != (member_inline_size <= 4) {
19906 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19907 }
19908 let inner_offset;
19909 let mut inner_depth = depth.clone();
19910 if inlined {
19911 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19912 inner_offset = next_offset;
19913 } else {
19914 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19915 inner_depth.increment()?;
19916 }
19917 let val_ref =
19918 self.delivery.get_or_insert_with(|| fidl::new_empty!(DeliveryType, D));
19919 fidl::decode!(DeliveryType, D, val_ref, decoder, inner_offset, inner_depth)?;
19920 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19921 {
19922 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19923 }
19924 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19925 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19926 }
19927 }
19928
19929 next_offset += envelope_size;
19930
19931 while next_offset < end_offset {
19933 _next_ordinal_to_read += 1;
19934 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19935 next_offset += envelope_size;
19936 }
19937
19938 Ok(())
19939 }
19940 }
19941
19942 impl Resolver {
19943 #[inline(always)]
19944 fn max_ordinal_present(&self) -> u64 {
19945 if let Some(_) = self.source_path {
19946 return 2;
19947 }
19948 if let Some(_) = self.name {
19949 return 1;
19950 }
19951 0
19952 }
19953 }
19954
19955 impl fidl::encoding::ValueTypeMarker for Resolver {
19956 type Borrowed<'a> = &'a Self;
19957 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19958 value
19959 }
19960 }
19961
19962 unsafe impl fidl::encoding::TypeMarker for Resolver {
19963 type Owned = Self;
19964
19965 #[inline(always)]
19966 fn inline_align(_context: fidl::encoding::Context) -> usize {
19967 8
19968 }
19969
19970 #[inline(always)]
19971 fn inline_size(_context: fidl::encoding::Context) -> usize {
19972 16
19973 }
19974 }
19975
19976 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Resolver, D> for &Resolver {
19977 unsafe fn encode(
19978 self,
19979 encoder: &mut fidl::encoding::Encoder<'_, D>,
19980 offset: usize,
19981 mut depth: fidl::encoding::Depth,
19982 ) -> fidl::Result<()> {
19983 encoder.debug_check_bounds::<Resolver>(offset);
19984 let max_ordinal: u64 = self.max_ordinal_present();
19986 encoder.write_num(max_ordinal, offset);
19987 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19988 if max_ordinal == 0 {
19990 return Ok(());
19991 }
19992 depth.increment()?;
19993 let envelope_size = 8;
19994 let bytes_len = max_ordinal as usize * envelope_size;
19995 #[allow(unused_variables)]
19996 let offset = encoder.out_of_line_offset(bytes_len);
19997 let mut _prev_end_offset: usize = 0;
19998 if 1 > max_ordinal {
19999 return Ok(());
20000 }
20001
20002 let cur_offset: usize = (1 - 1) * envelope_size;
20005
20006 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20008
20009 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
20014 self.name.as_ref().map(
20015 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
20016 ),
20017 encoder,
20018 offset + cur_offset,
20019 depth,
20020 )?;
20021
20022 _prev_end_offset = cur_offset + envelope_size;
20023 if 2 > max_ordinal {
20024 return Ok(());
20025 }
20026
20027 let cur_offset: usize = (2 - 1) * envelope_size;
20030
20031 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20033
20034 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
20039 self.source_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
20040 encoder, offset + cur_offset, depth
20041 )?;
20042
20043 _prev_end_offset = cur_offset + envelope_size;
20044
20045 Ok(())
20046 }
20047 }
20048
20049 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Resolver {
20050 #[inline(always)]
20051 fn new_empty() -> Self {
20052 Self::default()
20053 }
20054
20055 unsafe fn decode(
20056 &mut self,
20057 decoder: &mut fidl::encoding::Decoder<'_, D>,
20058 offset: usize,
20059 mut depth: fidl::encoding::Depth,
20060 ) -> fidl::Result<()> {
20061 decoder.debug_check_bounds::<Self>(offset);
20062 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20063 None => return Err(fidl::Error::NotNullable),
20064 Some(len) => len,
20065 };
20066 if len == 0 {
20068 return Ok(());
20069 };
20070 depth.increment()?;
20071 let envelope_size = 8;
20072 let bytes_len = len * envelope_size;
20073 let offset = decoder.out_of_line_offset(bytes_len)?;
20074 let mut _next_ordinal_to_read = 0;
20076 let mut next_offset = offset;
20077 let end_offset = offset + bytes_len;
20078 _next_ordinal_to_read += 1;
20079 if next_offset >= end_offset {
20080 return Ok(());
20081 }
20082
20083 while _next_ordinal_to_read < 1 {
20085 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20086 _next_ordinal_to_read += 1;
20087 next_offset += envelope_size;
20088 }
20089
20090 let next_out_of_line = decoder.next_out_of_line();
20091 let handles_before = decoder.remaining_handles();
20092 if let Some((inlined, num_bytes, num_handles)) =
20093 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20094 {
20095 let member_inline_size =
20096 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
20097 decoder.context,
20098 );
20099 if inlined != (member_inline_size <= 4) {
20100 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20101 }
20102 let inner_offset;
20103 let mut inner_depth = depth.clone();
20104 if inlined {
20105 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20106 inner_offset = next_offset;
20107 } else {
20108 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20109 inner_depth.increment()?;
20110 }
20111 let val_ref = self
20112 .name
20113 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
20114 fidl::decode!(
20115 fidl::encoding::BoundedString<100>,
20116 D,
20117 val_ref,
20118 decoder,
20119 inner_offset,
20120 inner_depth
20121 )?;
20122 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20123 {
20124 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20125 }
20126 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20127 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20128 }
20129 }
20130
20131 next_offset += envelope_size;
20132 _next_ordinal_to_read += 1;
20133 if next_offset >= end_offset {
20134 return Ok(());
20135 }
20136
20137 while _next_ordinal_to_read < 2 {
20139 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20140 _next_ordinal_to_read += 1;
20141 next_offset += envelope_size;
20142 }
20143
20144 let next_out_of_line = decoder.next_out_of_line();
20145 let handles_before = decoder.remaining_handles();
20146 if let Some((inlined, num_bytes, num_handles)) =
20147 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20148 {
20149 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20150 if inlined != (member_inline_size <= 4) {
20151 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20152 }
20153 let inner_offset;
20154 let mut inner_depth = depth.clone();
20155 if inlined {
20156 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20157 inner_offset = next_offset;
20158 } else {
20159 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20160 inner_depth.increment()?;
20161 }
20162 let val_ref = self.source_path.get_or_insert_with(|| {
20163 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
20164 });
20165 fidl::decode!(
20166 fidl::encoding::BoundedString<1024>,
20167 D,
20168 val_ref,
20169 decoder,
20170 inner_offset,
20171 inner_depth
20172 )?;
20173 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20174 {
20175 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20176 }
20177 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20178 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20179 }
20180 }
20181
20182 next_offset += envelope_size;
20183
20184 while next_offset < end_offset {
20186 _next_ordinal_to_read += 1;
20187 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20188 next_offset += envelope_size;
20189 }
20190
20191 Ok(())
20192 }
20193 }
20194
20195 impl ResolverRegistration {
20196 #[inline(always)]
20197 fn max_ordinal_present(&self) -> u64 {
20198 if let Some(_) = self.scheme {
20199 return 3;
20200 }
20201 if let Some(_) = self.source {
20202 return 2;
20203 }
20204 if let Some(_) = self.resolver {
20205 return 1;
20206 }
20207 0
20208 }
20209 }
20210
20211 impl fidl::encoding::ValueTypeMarker for ResolverRegistration {
20212 type Borrowed<'a> = &'a Self;
20213 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
20214 value
20215 }
20216 }
20217
20218 unsafe impl fidl::encoding::TypeMarker for ResolverRegistration {
20219 type Owned = Self;
20220
20221 #[inline(always)]
20222 fn inline_align(_context: fidl::encoding::Context) -> usize {
20223 8
20224 }
20225
20226 #[inline(always)]
20227 fn inline_size(_context: fidl::encoding::Context) -> usize {
20228 16
20229 }
20230 }
20231
20232 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolverRegistration, D>
20233 for &ResolverRegistration
20234 {
20235 unsafe fn encode(
20236 self,
20237 encoder: &mut fidl::encoding::Encoder<'_, D>,
20238 offset: usize,
20239 mut depth: fidl::encoding::Depth,
20240 ) -> fidl::Result<()> {
20241 encoder.debug_check_bounds::<ResolverRegistration>(offset);
20242 let max_ordinal: u64 = self.max_ordinal_present();
20244 encoder.write_num(max_ordinal, offset);
20245 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20246 if max_ordinal == 0 {
20248 return Ok(());
20249 }
20250 depth.increment()?;
20251 let envelope_size = 8;
20252 let bytes_len = max_ordinal as usize * envelope_size;
20253 #[allow(unused_variables)]
20254 let offset = encoder.out_of_line_offset(bytes_len);
20255 let mut _prev_end_offset: usize = 0;
20256 if 1 > max_ordinal {
20257 return Ok(());
20258 }
20259
20260 let cur_offset: usize = (1 - 1) * envelope_size;
20263
20264 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20266
20267 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
20272 self.resolver.as_ref().map(
20273 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
20274 ),
20275 encoder,
20276 offset + cur_offset,
20277 depth,
20278 )?;
20279
20280 _prev_end_offset = cur_offset + envelope_size;
20281 if 2 > max_ordinal {
20282 return Ok(());
20283 }
20284
20285 let cur_offset: usize = (2 - 1) * envelope_size;
20288
20289 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20291
20292 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
20297 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
20298 encoder,
20299 offset + cur_offset,
20300 depth,
20301 )?;
20302
20303 _prev_end_offset = cur_offset + envelope_size;
20304 if 3 > max_ordinal {
20305 return Ok(());
20306 }
20307
20308 let cur_offset: usize = (3 - 1) * envelope_size;
20311
20312 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20314
20315 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
20320 self.scheme.as_ref().map(
20321 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
20322 ),
20323 encoder,
20324 offset + cur_offset,
20325 depth,
20326 )?;
20327
20328 _prev_end_offset = cur_offset + envelope_size;
20329
20330 Ok(())
20331 }
20332 }
20333
20334 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolverRegistration {
20335 #[inline(always)]
20336 fn new_empty() -> Self {
20337 Self::default()
20338 }
20339
20340 unsafe fn decode(
20341 &mut self,
20342 decoder: &mut fidl::encoding::Decoder<'_, D>,
20343 offset: usize,
20344 mut depth: fidl::encoding::Depth,
20345 ) -> fidl::Result<()> {
20346 decoder.debug_check_bounds::<Self>(offset);
20347 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20348 None => return Err(fidl::Error::NotNullable),
20349 Some(len) => len,
20350 };
20351 if len == 0 {
20353 return Ok(());
20354 };
20355 depth.increment()?;
20356 let envelope_size = 8;
20357 let bytes_len = len * envelope_size;
20358 let offset = decoder.out_of_line_offset(bytes_len)?;
20359 let mut _next_ordinal_to_read = 0;
20361 let mut next_offset = offset;
20362 let end_offset = offset + bytes_len;
20363 _next_ordinal_to_read += 1;
20364 if next_offset >= end_offset {
20365 return Ok(());
20366 }
20367
20368 while _next_ordinal_to_read < 1 {
20370 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20371 _next_ordinal_to_read += 1;
20372 next_offset += envelope_size;
20373 }
20374
20375 let next_out_of_line = decoder.next_out_of_line();
20376 let handles_before = decoder.remaining_handles();
20377 if let Some((inlined, num_bytes, num_handles)) =
20378 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20379 {
20380 let member_inline_size =
20381 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
20382 decoder.context,
20383 );
20384 if inlined != (member_inline_size <= 4) {
20385 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20386 }
20387 let inner_offset;
20388 let mut inner_depth = depth.clone();
20389 if inlined {
20390 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20391 inner_offset = next_offset;
20392 } else {
20393 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20394 inner_depth.increment()?;
20395 }
20396 let val_ref = self
20397 .resolver
20398 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
20399 fidl::decode!(
20400 fidl::encoding::BoundedString<100>,
20401 D,
20402 val_ref,
20403 decoder,
20404 inner_offset,
20405 inner_depth
20406 )?;
20407 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20408 {
20409 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20410 }
20411 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20412 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20413 }
20414 }
20415
20416 next_offset += envelope_size;
20417 _next_ordinal_to_read += 1;
20418 if next_offset >= end_offset {
20419 return Ok(());
20420 }
20421
20422 while _next_ordinal_to_read < 2 {
20424 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20425 _next_ordinal_to_read += 1;
20426 next_offset += envelope_size;
20427 }
20428
20429 let next_out_of_line = decoder.next_out_of_line();
20430 let handles_before = decoder.remaining_handles();
20431 if let Some((inlined, num_bytes, num_handles)) =
20432 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20433 {
20434 let member_inline_size =
20435 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20436 if inlined != (member_inline_size <= 4) {
20437 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20438 }
20439 let inner_offset;
20440 let mut inner_depth = depth.clone();
20441 if inlined {
20442 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20443 inner_offset = next_offset;
20444 } else {
20445 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20446 inner_depth.increment()?;
20447 }
20448 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
20449 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
20450 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20451 {
20452 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20453 }
20454 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20455 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20456 }
20457 }
20458
20459 next_offset += envelope_size;
20460 _next_ordinal_to_read += 1;
20461 if next_offset >= end_offset {
20462 return Ok(());
20463 }
20464
20465 while _next_ordinal_to_read < 3 {
20467 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20468 _next_ordinal_to_read += 1;
20469 next_offset += envelope_size;
20470 }
20471
20472 let next_out_of_line = decoder.next_out_of_line();
20473 let handles_before = decoder.remaining_handles();
20474 if let Some((inlined, num_bytes, num_handles)) =
20475 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20476 {
20477 let member_inline_size =
20478 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
20479 decoder.context,
20480 );
20481 if inlined != (member_inline_size <= 4) {
20482 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20483 }
20484 let inner_offset;
20485 let mut inner_depth = depth.clone();
20486 if inlined {
20487 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20488 inner_offset = next_offset;
20489 } else {
20490 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20491 inner_depth.increment()?;
20492 }
20493 let val_ref = self
20494 .scheme
20495 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
20496 fidl::decode!(
20497 fidl::encoding::BoundedString<100>,
20498 D,
20499 val_ref,
20500 decoder,
20501 inner_offset,
20502 inner_depth
20503 )?;
20504 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20505 {
20506 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20507 }
20508 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20509 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20510 }
20511 }
20512
20513 next_offset += envelope_size;
20514
20515 while next_offset < end_offset {
20517 _next_ordinal_to_read += 1;
20518 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20519 next_offset += envelope_size;
20520 }
20521
20522 Ok(())
20523 }
20524 }
20525
20526 impl Runner {
20527 #[inline(always)]
20528 fn max_ordinal_present(&self) -> u64 {
20529 if let Some(_) = self.source_path {
20530 return 2;
20531 }
20532 if let Some(_) = self.name {
20533 return 1;
20534 }
20535 0
20536 }
20537 }
20538
20539 impl fidl::encoding::ValueTypeMarker for Runner {
20540 type Borrowed<'a> = &'a Self;
20541 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
20542 value
20543 }
20544 }
20545
20546 unsafe impl fidl::encoding::TypeMarker for Runner {
20547 type Owned = Self;
20548
20549 #[inline(always)]
20550 fn inline_align(_context: fidl::encoding::Context) -> usize {
20551 8
20552 }
20553
20554 #[inline(always)]
20555 fn inline_size(_context: fidl::encoding::Context) -> usize {
20556 16
20557 }
20558 }
20559
20560 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Runner, D> for &Runner {
20561 unsafe fn encode(
20562 self,
20563 encoder: &mut fidl::encoding::Encoder<'_, D>,
20564 offset: usize,
20565 mut depth: fidl::encoding::Depth,
20566 ) -> fidl::Result<()> {
20567 encoder.debug_check_bounds::<Runner>(offset);
20568 let max_ordinal: u64 = self.max_ordinal_present();
20570 encoder.write_num(max_ordinal, offset);
20571 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20572 if max_ordinal == 0 {
20574 return Ok(());
20575 }
20576 depth.increment()?;
20577 let envelope_size = 8;
20578 let bytes_len = max_ordinal as usize * envelope_size;
20579 #[allow(unused_variables)]
20580 let offset = encoder.out_of_line_offset(bytes_len);
20581 let mut _prev_end_offset: usize = 0;
20582 if 1 > max_ordinal {
20583 return Ok(());
20584 }
20585
20586 let cur_offset: usize = (1 - 1) * envelope_size;
20589
20590 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20592
20593 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
20598 self.name.as_ref().map(
20599 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
20600 ),
20601 encoder,
20602 offset + cur_offset,
20603 depth,
20604 )?;
20605
20606 _prev_end_offset = cur_offset + envelope_size;
20607 if 2 > max_ordinal {
20608 return Ok(());
20609 }
20610
20611 let cur_offset: usize = (2 - 1) * envelope_size;
20614
20615 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20617
20618 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
20623 self.source_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
20624 encoder, offset + cur_offset, depth
20625 )?;
20626
20627 _prev_end_offset = cur_offset + envelope_size;
20628
20629 Ok(())
20630 }
20631 }
20632
20633 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Runner {
20634 #[inline(always)]
20635 fn new_empty() -> Self {
20636 Self::default()
20637 }
20638
20639 unsafe fn decode(
20640 &mut self,
20641 decoder: &mut fidl::encoding::Decoder<'_, D>,
20642 offset: usize,
20643 mut depth: fidl::encoding::Depth,
20644 ) -> fidl::Result<()> {
20645 decoder.debug_check_bounds::<Self>(offset);
20646 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20647 None => return Err(fidl::Error::NotNullable),
20648 Some(len) => len,
20649 };
20650 if len == 0 {
20652 return Ok(());
20653 };
20654 depth.increment()?;
20655 let envelope_size = 8;
20656 let bytes_len = len * envelope_size;
20657 let offset = decoder.out_of_line_offset(bytes_len)?;
20658 let mut _next_ordinal_to_read = 0;
20660 let mut next_offset = offset;
20661 let end_offset = offset + bytes_len;
20662 _next_ordinal_to_read += 1;
20663 if next_offset >= end_offset {
20664 return Ok(());
20665 }
20666
20667 while _next_ordinal_to_read < 1 {
20669 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20670 _next_ordinal_to_read += 1;
20671 next_offset += envelope_size;
20672 }
20673
20674 let next_out_of_line = decoder.next_out_of_line();
20675 let handles_before = decoder.remaining_handles();
20676 if let Some((inlined, num_bytes, num_handles)) =
20677 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20678 {
20679 let member_inline_size =
20680 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
20681 decoder.context,
20682 );
20683 if inlined != (member_inline_size <= 4) {
20684 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20685 }
20686 let inner_offset;
20687 let mut inner_depth = depth.clone();
20688 if inlined {
20689 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20690 inner_offset = next_offset;
20691 } else {
20692 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20693 inner_depth.increment()?;
20694 }
20695 let val_ref = self
20696 .name
20697 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
20698 fidl::decode!(
20699 fidl::encoding::BoundedString<100>,
20700 D,
20701 val_ref,
20702 decoder,
20703 inner_offset,
20704 inner_depth
20705 )?;
20706 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20707 {
20708 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20709 }
20710 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20711 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20712 }
20713 }
20714
20715 next_offset += envelope_size;
20716 _next_ordinal_to_read += 1;
20717 if next_offset >= end_offset {
20718 return Ok(());
20719 }
20720
20721 while _next_ordinal_to_read < 2 {
20723 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20724 _next_ordinal_to_read += 1;
20725 next_offset += envelope_size;
20726 }
20727
20728 let next_out_of_line = decoder.next_out_of_line();
20729 let handles_before = decoder.remaining_handles();
20730 if let Some((inlined, num_bytes, num_handles)) =
20731 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20732 {
20733 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20734 if inlined != (member_inline_size <= 4) {
20735 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20736 }
20737 let inner_offset;
20738 let mut inner_depth = depth.clone();
20739 if inlined {
20740 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20741 inner_offset = next_offset;
20742 } else {
20743 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20744 inner_depth.increment()?;
20745 }
20746 let val_ref = self.source_path.get_or_insert_with(|| {
20747 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
20748 });
20749 fidl::decode!(
20750 fidl::encoding::BoundedString<1024>,
20751 D,
20752 val_ref,
20753 decoder,
20754 inner_offset,
20755 inner_depth
20756 )?;
20757 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20758 {
20759 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20760 }
20761 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20762 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20763 }
20764 }
20765
20766 next_offset += envelope_size;
20767
20768 while next_offset < end_offset {
20770 _next_ordinal_to_read += 1;
20771 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20772 next_offset += envelope_size;
20773 }
20774
20775 Ok(())
20776 }
20777 }
20778
20779 impl RunnerRegistration {
20780 #[inline(always)]
20781 fn max_ordinal_present(&self) -> u64 {
20782 if let Some(_) = self.target_name {
20783 return 3;
20784 }
20785 if let Some(_) = self.source {
20786 return 2;
20787 }
20788 if let Some(_) = self.source_name {
20789 return 1;
20790 }
20791 0
20792 }
20793 }
20794
20795 impl fidl::encoding::ValueTypeMarker for RunnerRegistration {
20796 type Borrowed<'a> = &'a Self;
20797 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
20798 value
20799 }
20800 }
20801
20802 unsafe impl fidl::encoding::TypeMarker for RunnerRegistration {
20803 type Owned = Self;
20804
20805 #[inline(always)]
20806 fn inline_align(_context: fidl::encoding::Context) -> usize {
20807 8
20808 }
20809
20810 #[inline(always)]
20811 fn inline_size(_context: fidl::encoding::Context) -> usize {
20812 16
20813 }
20814 }
20815
20816 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RunnerRegistration, D>
20817 for &RunnerRegistration
20818 {
20819 unsafe fn encode(
20820 self,
20821 encoder: &mut fidl::encoding::Encoder<'_, D>,
20822 offset: usize,
20823 mut depth: fidl::encoding::Depth,
20824 ) -> fidl::Result<()> {
20825 encoder.debug_check_bounds::<RunnerRegistration>(offset);
20826 let max_ordinal: u64 = self.max_ordinal_present();
20828 encoder.write_num(max_ordinal, offset);
20829 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20830 if max_ordinal == 0 {
20832 return Ok(());
20833 }
20834 depth.increment()?;
20835 let envelope_size = 8;
20836 let bytes_len = max_ordinal as usize * envelope_size;
20837 #[allow(unused_variables)]
20838 let offset = encoder.out_of_line_offset(bytes_len);
20839 let mut _prev_end_offset: usize = 0;
20840 if 1 > max_ordinal {
20841 return Ok(());
20842 }
20843
20844 let cur_offset: usize = (1 - 1) * envelope_size;
20847
20848 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20850
20851 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
20856 self.source_name.as_ref().map(
20857 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
20858 ),
20859 encoder,
20860 offset + cur_offset,
20861 depth,
20862 )?;
20863
20864 _prev_end_offset = cur_offset + envelope_size;
20865 if 2 > max_ordinal {
20866 return Ok(());
20867 }
20868
20869 let cur_offset: usize = (2 - 1) * envelope_size;
20872
20873 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20875
20876 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
20881 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
20882 encoder,
20883 offset + cur_offset,
20884 depth,
20885 )?;
20886
20887 _prev_end_offset = cur_offset + envelope_size;
20888 if 3 > max_ordinal {
20889 return Ok(());
20890 }
20891
20892 let cur_offset: usize = (3 - 1) * envelope_size;
20895
20896 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20898
20899 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
20904 self.target_name.as_ref().map(
20905 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
20906 ),
20907 encoder,
20908 offset + cur_offset,
20909 depth,
20910 )?;
20911
20912 _prev_end_offset = cur_offset + envelope_size;
20913
20914 Ok(())
20915 }
20916 }
20917
20918 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RunnerRegistration {
20919 #[inline(always)]
20920 fn new_empty() -> Self {
20921 Self::default()
20922 }
20923
20924 unsafe fn decode(
20925 &mut self,
20926 decoder: &mut fidl::encoding::Decoder<'_, D>,
20927 offset: usize,
20928 mut depth: fidl::encoding::Depth,
20929 ) -> fidl::Result<()> {
20930 decoder.debug_check_bounds::<Self>(offset);
20931 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20932 None => return Err(fidl::Error::NotNullable),
20933 Some(len) => len,
20934 };
20935 if len == 0 {
20937 return Ok(());
20938 };
20939 depth.increment()?;
20940 let envelope_size = 8;
20941 let bytes_len = len * envelope_size;
20942 let offset = decoder.out_of_line_offset(bytes_len)?;
20943 let mut _next_ordinal_to_read = 0;
20945 let mut next_offset = offset;
20946 let end_offset = offset + bytes_len;
20947 _next_ordinal_to_read += 1;
20948 if next_offset >= end_offset {
20949 return Ok(());
20950 }
20951
20952 while _next_ordinal_to_read < 1 {
20954 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20955 _next_ordinal_to_read += 1;
20956 next_offset += envelope_size;
20957 }
20958
20959 let next_out_of_line = decoder.next_out_of_line();
20960 let handles_before = decoder.remaining_handles();
20961 if let Some((inlined, num_bytes, num_handles)) =
20962 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20963 {
20964 let member_inline_size =
20965 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
20966 decoder.context,
20967 );
20968 if inlined != (member_inline_size <= 4) {
20969 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20970 }
20971 let inner_offset;
20972 let mut inner_depth = depth.clone();
20973 if inlined {
20974 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20975 inner_offset = next_offset;
20976 } else {
20977 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20978 inner_depth.increment()?;
20979 }
20980 let val_ref = self
20981 .source_name
20982 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
20983 fidl::decode!(
20984 fidl::encoding::BoundedString<100>,
20985 D,
20986 val_ref,
20987 decoder,
20988 inner_offset,
20989 inner_depth
20990 )?;
20991 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20992 {
20993 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20994 }
20995 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20996 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20997 }
20998 }
20999
21000 next_offset += envelope_size;
21001 _next_ordinal_to_read += 1;
21002 if next_offset >= end_offset {
21003 return Ok(());
21004 }
21005
21006 while _next_ordinal_to_read < 2 {
21008 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21009 _next_ordinal_to_read += 1;
21010 next_offset += envelope_size;
21011 }
21012
21013 let next_out_of_line = decoder.next_out_of_line();
21014 let handles_before = decoder.remaining_handles();
21015 if let Some((inlined, num_bytes, num_handles)) =
21016 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21017 {
21018 let member_inline_size =
21019 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21020 if inlined != (member_inline_size <= 4) {
21021 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21022 }
21023 let inner_offset;
21024 let mut inner_depth = depth.clone();
21025 if inlined {
21026 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21027 inner_offset = next_offset;
21028 } else {
21029 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21030 inner_depth.increment()?;
21031 }
21032 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
21033 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
21034 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21035 {
21036 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21037 }
21038 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21039 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21040 }
21041 }
21042
21043 next_offset += envelope_size;
21044 _next_ordinal_to_read += 1;
21045 if next_offset >= end_offset {
21046 return Ok(());
21047 }
21048
21049 while _next_ordinal_to_read < 3 {
21051 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21052 _next_ordinal_to_read += 1;
21053 next_offset += envelope_size;
21054 }
21055
21056 let next_out_of_line = decoder.next_out_of_line();
21057 let handles_before = decoder.remaining_handles();
21058 if let Some((inlined, num_bytes, num_handles)) =
21059 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21060 {
21061 let member_inline_size =
21062 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
21063 decoder.context,
21064 );
21065 if inlined != (member_inline_size <= 4) {
21066 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21067 }
21068 let inner_offset;
21069 let mut inner_depth = depth.clone();
21070 if inlined {
21071 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21072 inner_offset = next_offset;
21073 } else {
21074 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21075 inner_depth.increment()?;
21076 }
21077 let val_ref = self
21078 .target_name
21079 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
21080 fidl::decode!(
21081 fidl::encoding::BoundedString<100>,
21082 D,
21083 val_ref,
21084 decoder,
21085 inner_offset,
21086 inner_depth
21087 )?;
21088 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21089 {
21090 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21091 }
21092 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21093 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21094 }
21095 }
21096
21097 next_offset += envelope_size;
21098
21099 while next_offset < end_offset {
21101 _next_ordinal_to_read += 1;
21102 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21103 next_offset += envelope_size;
21104 }
21105
21106 Ok(())
21107 }
21108 }
21109
21110 impl Service {
21111 #[inline(always)]
21112 fn max_ordinal_present(&self) -> u64 {
21113 if let Some(_) = self.source_path {
21114 return 2;
21115 }
21116 if let Some(_) = self.name {
21117 return 1;
21118 }
21119 0
21120 }
21121 }
21122
21123 impl fidl::encoding::ValueTypeMarker for Service {
21124 type Borrowed<'a> = &'a Self;
21125 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21126 value
21127 }
21128 }
21129
21130 unsafe impl fidl::encoding::TypeMarker for Service {
21131 type Owned = Self;
21132
21133 #[inline(always)]
21134 fn inline_align(_context: fidl::encoding::Context) -> usize {
21135 8
21136 }
21137
21138 #[inline(always)]
21139 fn inline_size(_context: fidl::encoding::Context) -> usize {
21140 16
21141 }
21142 }
21143
21144 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Service, D> for &Service {
21145 unsafe fn encode(
21146 self,
21147 encoder: &mut fidl::encoding::Encoder<'_, D>,
21148 offset: usize,
21149 mut depth: fidl::encoding::Depth,
21150 ) -> fidl::Result<()> {
21151 encoder.debug_check_bounds::<Service>(offset);
21152 let max_ordinal: u64 = self.max_ordinal_present();
21154 encoder.write_num(max_ordinal, offset);
21155 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21156 if max_ordinal == 0 {
21158 return Ok(());
21159 }
21160 depth.increment()?;
21161 let envelope_size = 8;
21162 let bytes_len = max_ordinal as usize * envelope_size;
21163 #[allow(unused_variables)]
21164 let offset = encoder.out_of_line_offset(bytes_len);
21165 let mut _prev_end_offset: usize = 0;
21166 if 1 > max_ordinal {
21167 return Ok(());
21168 }
21169
21170 let cur_offset: usize = (1 - 1) * envelope_size;
21173
21174 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21176
21177 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
21182 self.name.as_ref().map(
21183 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
21184 ),
21185 encoder,
21186 offset + cur_offset,
21187 depth,
21188 )?;
21189
21190 _prev_end_offset = cur_offset + envelope_size;
21191 if 2 > max_ordinal {
21192 return Ok(());
21193 }
21194
21195 let cur_offset: usize = (2 - 1) * envelope_size;
21198
21199 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21201
21202 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
21207 self.source_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
21208 encoder, offset + cur_offset, depth
21209 )?;
21210
21211 _prev_end_offset = cur_offset + envelope_size;
21212
21213 Ok(())
21214 }
21215 }
21216
21217 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Service {
21218 #[inline(always)]
21219 fn new_empty() -> Self {
21220 Self::default()
21221 }
21222
21223 unsafe fn decode(
21224 &mut self,
21225 decoder: &mut fidl::encoding::Decoder<'_, D>,
21226 offset: usize,
21227 mut depth: fidl::encoding::Depth,
21228 ) -> fidl::Result<()> {
21229 decoder.debug_check_bounds::<Self>(offset);
21230 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
21231 None => return Err(fidl::Error::NotNullable),
21232 Some(len) => len,
21233 };
21234 if len == 0 {
21236 return Ok(());
21237 };
21238 depth.increment()?;
21239 let envelope_size = 8;
21240 let bytes_len = len * envelope_size;
21241 let offset = decoder.out_of_line_offset(bytes_len)?;
21242 let mut _next_ordinal_to_read = 0;
21244 let mut next_offset = offset;
21245 let end_offset = offset + bytes_len;
21246 _next_ordinal_to_read += 1;
21247 if next_offset >= end_offset {
21248 return Ok(());
21249 }
21250
21251 while _next_ordinal_to_read < 1 {
21253 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21254 _next_ordinal_to_read += 1;
21255 next_offset += envelope_size;
21256 }
21257
21258 let next_out_of_line = decoder.next_out_of_line();
21259 let handles_before = decoder.remaining_handles();
21260 if let Some((inlined, num_bytes, num_handles)) =
21261 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21262 {
21263 let member_inline_size =
21264 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
21265 decoder.context,
21266 );
21267 if inlined != (member_inline_size <= 4) {
21268 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21269 }
21270 let inner_offset;
21271 let mut inner_depth = depth.clone();
21272 if inlined {
21273 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21274 inner_offset = next_offset;
21275 } else {
21276 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21277 inner_depth.increment()?;
21278 }
21279 let val_ref = self
21280 .name
21281 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
21282 fidl::decode!(
21283 fidl::encoding::BoundedString<100>,
21284 D,
21285 val_ref,
21286 decoder,
21287 inner_offset,
21288 inner_depth
21289 )?;
21290 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21291 {
21292 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21293 }
21294 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21295 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21296 }
21297 }
21298
21299 next_offset += envelope_size;
21300 _next_ordinal_to_read += 1;
21301 if next_offset >= end_offset {
21302 return Ok(());
21303 }
21304
21305 while _next_ordinal_to_read < 2 {
21307 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21308 _next_ordinal_to_read += 1;
21309 next_offset += envelope_size;
21310 }
21311
21312 let next_out_of_line = decoder.next_out_of_line();
21313 let handles_before = decoder.remaining_handles();
21314 if let Some((inlined, num_bytes, num_handles)) =
21315 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21316 {
21317 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21318 if inlined != (member_inline_size <= 4) {
21319 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21320 }
21321 let inner_offset;
21322 let mut inner_depth = depth.clone();
21323 if inlined {
21324 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21325 inner_offset = next_offset;
21326 } else {
21327 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21328 inner_depth.increment()?;
21329 }
21330 let val_ref = self.source_path.get_or_insert_with(|| {
21331 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
21332 });
21333 fidl::decode!(
21334 fidl::encoding::BoundedString<1024>,
21335 D,
21336 val_ref,
21337 decoder,
21338 inner_offset,
21339 inner_depth
21340 )?;
21341 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21342 {
21343 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21344 }
21345 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21346 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21347 }
21348 }
21349
21350 next_offset += envelope_size;
21351
21352 while next_offset < end_offset {
21354 _next_ordinal_to_read += 1;
21355 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21356 next_offset += envelope_size;
21357 }
21358
21359 Ok(())
21360 }
21361 }
21362
21363 impl Storage {
21364 #[inline(always)]
21365 fn max_ordinal_present(&self) -> u64 {
21366 if let Some(_) = self.storage_id {
21367 return 5;
21368 }
21369 if let Some(_) = self.subdir {
21370 return 4;
21371 }
21372 if let Some(_) = self.backing_dir {
21373 return 3;
21374 }
21375 if let Some(_) = self.source {
21376 return 2;
21377 }
21378 if let Some(_) = self.name {
21379 return 1;
21380 }
21381 0
21382 }
21383 }
21384
21385 impl fidl::encoding::ValueTypeMarker for Storage {
21386 type Borrowed<'a> = &'a Self;
21387 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21388 value
21389 }
21390 }
21391
21392 unsafe impl fidl::encoding::TypeMarker for Storage {
21393 type Owned = Self;
21394
21395 #[inline(always)]
21396 fn inline_align(_context: fidl::encoding::Context) -> usize {
21397 8
21398 }
21399
21400 #[inline(always)]
21401 fn inline_size(_context: fidl::encoding::Context) -> usize {
21402 16
21403 }
21404 }
21405
21406 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Storage, D> for &Storage {
21407 unsafe fn encode(
21408 self,
21409 encoder: &mut fidl::encoding::Encoder<'_, D>,
21410 offset: usize,
21411 mut depth: fidl::encoding::Depth,
21412 ) -> fidl::Result<()> {
21413 encoder.debug_check_bounds::<Storage>(offset);
21414 let max_ordinal: u64 = self.max_ordinal_present();
21416 encoder.write_num(max_ordinal, offset);
21417 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21418 if max_ordinal == 0 {
21420 return Ok(());
21421 }
21422 depth.increment()?;
21423 let envelope_size = 8;
21424 let bytes_len = max_ordinal as usize * envelope_size;
21425 #[allow(unused_variables)]
21426 let offset = encoder.out_of_line_offset(bytes_len);
21427 let mut _prev_end_offset: usize = 0;
21428 if 1 > max_ordinal {
21429 return Ok(());
21430 }
21431
21432 let cur_offset: usize = (1 - 1) * envelope_size;
21435
21436 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21438
21439 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
21444 self.name.as_ref().map(
21445 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
21446 ),
21447 encoder,
21448 offset + cur_offset,
21449 depth,
21450 )?;
21451
21452 _prev_end_offset = cur_offset + envelope_size;
21453 if 2 > max_ordinal {
21454 return Ok(());
21455 }
21456
21457 let cur_offset: usize = (2 - 1) * envelope_size;
21460
21461 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21463
21464 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
21469 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
21470 encoder,
21471 offset + cur_offset,
21472 depth,
21473 )?;
21474
21475 _prev_end_offset = cur_offset + envelope_size;
21476 if 3 > max_ordinal {
21477 return Ok(());
21478 }
21479
21480 let cur_offset: usize = (3 - 1) * envelope_size;
21483
21484 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21486
21487 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
21492 self.backing_dir.as_ref().map(
21493 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
21494 ),
21495 encoder,
21496 offset + cur_offset,
21497 depth,
21498 )?;
21499
21500 _prev_end_offset = cur_offset + envelope_size;
21501 if 4 > max_ordinal {
21502 return Ok(());
21503 }
21504
21505 let cur_offset: usize = (4 - 1) * envelope_size;
21508
21509 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21511
21512 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
21517 self.subdir.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
21518 encoder, offset + cur_offset, depth
21519 )?;
21520
21521 _prev_end_offset = cur_offset + envelope_size;
21522 if 5 > max_ordinal {
21523 return Ok(());
21524 }
21525
21526 let cur_offset: usize = (5 - 1) * envelope_size;
21529
21530 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21532
21533 fidl::encoding::encode_in_envelope_optional::<StorageId, D>(
21538 self.storage_id
21539 .as_ref()
21540 .map(<StorageId as fidl::encoding::ValueTypeMarker>::borrow),
21541 encoder,
21542 offset + cur_offset,
21543 depth,
21544 )?;
21545
21546 _prev_end_offset = cur_offset + envelope_size;
21547
21548 Ok(())
21549 }
21550 }
21551
21552 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Storage {
21553 #[inline(always)]
21554 fn new_empty() -> Self {
21555 Self::default()
21556 }
21557
21558 unsafe fn decode(
21559 &mut self,
21560 decoder: &mut fidl::encoding::Decoder<'_, D>,
21561 offset: usize,
21562 mut depth: fidl::encoding::Depth,
21563 ) -> fidl::Result<()> {
21564 decoder.debug_check_bounds::<Self>(offset);
21565 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
21566 None => return Err(fidl::Error::NotNullable),
21567 Some(len) => len,
21568 };
21569 if len == 0 {
21571 return Ok(());
21572 };
21573 depth.increment()?;
21574 let envelope_size = 8;
21575 let bytes_len = len * envelope_size;
21576 let offset = decoder.out_of_line_offset(bytes_len)?;
21577 let mut _next_ordinal_to_read = 0;
21579 let mut next_offset = offset;
21580 let end_offset = offset + bytes_len;
21581 _next_ordinal_to_read += 1;
21582 if next_offset >= end_offset {
21583 return Ok(());
21584 }
21585
21586 while _next_ordinal_to_read < 1 {
21588 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21589 _next_ordinal_to_read += 1;
21590 next_offset += envelope_size;
21591 }
21592
21593 let next_out_of_line = decoder.next_out_of_line();
21594 let handles_before = decoder.remaining_handles();
21595 if let Some((inlined, num_bytes, num_handles)) =
21596 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21597 {
21598 let member_inline_size =
21599 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
21600 decoder.context,
21601 );
21602 if inlined != (member_inline_size <= 4) {
21603 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21604 }
21605 let inner_offset;
21606 let mut inner_depth = depth.clone();
21607 if inlined {
21608 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21609 inner_offset = next_offset;
21610 } else {
21611 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21612 inner_depth.increment()?;
21613 }
21614 let val_ref = self
21615 .name
21616 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
21617 fidl::decode!(
21618 fidl::encoding::BoundedString<100>,
21619 D,
21620 val_ref,
21621 decoder,
21622 inner_offset,
21623 inner_depth
21624 )?;
21625 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21626 {
21627 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21628 }
21629 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21630 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21631 }
21632 }
21633
21634 next_offset += envelope_size;
21635 _next_ordinal_to_read += 1;
21636 if next_offset >= end_offset {
21637 return Ok(());
21638 }
21639
21640 while _next_ordinal_to_read < 2 {
21642 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21643 _next_ordinal_to_read += 1;
21644 next_offset += envelope_size;
21645 }
21646
21647 let next_out_of_line = decoder.next_out_of_line();
21648 let handles_before = decoder.remaining_handles();
21649 if let Some((inlined, num_bytes, num_handles)) =
21650 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21651 {
21652 let member_inline_size =
21653 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21654 if inlined != (member_inline_size <= 4) {
21655 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21656 }
21657 let inner_offset;
21658 let mut inner_depth = depth.clone();
21659 if inlined {
21660 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21661 inner_offset = next_offset;
21662 } else {
21663 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21664 inner_depth.increment()?;
21665 }
21666 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
21667 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
21668 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21669 {
21670 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21671 }
21672 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21673 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21674 }
21675 }
21676
21677 next_offset += envelope_size;
21678 _next_ordinal_to_read += 1;
21679 if next_offset >= end_offset {
21680 return Ok(());
21681 }
21682
21683 while _next_ordinal_to_read < 3 {
21685 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21686 _next_ordinal_to_read += 1;
21687 next_offset += envelope_size;
21688 }
21689
21690 let next_out_of_line = decoder.next_out_of_line();
21691 let handles_before = decoder.remaining_handles();
21692 if let Some((inlined, num_bytes, num_handles)) =
21693 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21694 {
21695 let member_inline_size =
21696 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
21697 decoder.context,
21698 );
21699 if inlined != (member_inline_size <= 4) {
21700 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21701 }
21702 let inner_offset;
21703 let mut inner_depth = depth.clone();
21704 if inlined {
21705 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21706 inner_offset = next_offset;
21707 } else {
21708 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21709 inner_depth.increment()?;
21710 }
21711 let val_ref = self
21712 .backing_dir
21713 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
21714 fidl::decode!(
21715 fidl::encoding::BoundedString<100>,
21716 D,
21717 val_ref,
21718 decoder,
21719 inner_offset,
21720 inner_depth
21721 )?;
21722 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21723 {
21724 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21725 }
21726 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21727 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21728 }
21729 }
21730
21731 next_offset += envelope_size;
21732 _next_ordinal_to_read += 1;
21733 if next_offset >= end_offset {
21734 return Ok(());
21735 }
21736
21737 while _next_ordinal_to_read < 4 {
21739 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21740 _next_ordinal_to_read += 1;
21741 next_offset += envelope_size;
21742 }
21743
21744 let next_out_of_line = decoder.next_out_of_line();
21745 let handles_before = decoder.remaining_handles();
21746 if let Some((inlined, num_bytes, num_handles)) =
21747 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21748 {
21749 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21750 if inlined != (member_inline_size <= 4) {
21751 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21752 }
21753 let inner_offset;
21754 let mut inner_depth = depth.clone();
21755 if inlined {
21756 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21757 inner_offset = next_offset;
21758 } else {
21759 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21760 inner_depth.increment()?;
21761 }
21762 let val_ref = self.subdir.get_or_insert_with(|| {
21763 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
21764 });
21765 fidl::decode!(
21766 fidl::encoding::BoundedString<1024>,
21767 D,
21768 val_ref,
21769 decoder,
21770 inner_offset,
21771 inner_depth
21772 )?;
21773 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21774 {
21775 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21776 }
21777 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21778 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21779 }
21780 }
21781
21782 next_offset += envelope_size;
21783 _next_ordinal_to_read += 1;
21784 if next_offset >= end_offset {
21785 return Ok(());
21786 }
21787
21788 while _next_ordinal_to_read < 5 {
21790 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21791 _next_ordinal_to_read += 1;
21792 next_offset += envelope_size;
21793 }
21794
21795 let next_out_of_line = decoder.next_out_of_line();
21796 let handles_before = decoder.remaining_handles();
21797 if let Some((inlined, num_bytes, num_handles)) =
21798 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21799 {
21800 let member_inline_size =
21801 <StorageId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21802 if inlined != (member_inline_size <= 4) {
21803 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21804 }
21805 let inner_offset;
21806 let mut inner_depth = depth.clone();
21807 if inlined {
21808 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21809 inner_offset = next_offset;
21810 } else {
21811 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21812 inner_depth.increment()?;
21813 }
21814 let val_ref = self.storage_id.get_or_insert_with(|| fidl::new_empty!(StorageId, D));
21815 fidl::decode!(StorageId, D, val_ref, decoder, inner_offset, inner_depth)?;
21816 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21817 {
21818 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21819 }
21820 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21821 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21822 }
21823 }
21824
21825 next_offset += envelope_size;
21826
21827 while next_offset < end_offset {
21829 _next_ordinal_to_read += 1;
21830 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21831 next_offset += envelope_size;
21832 }
21833
21834 Ok(())
21835 }
21836 }
21837
21838 impl UseConfiguration {
21839 #[inline(always)]
21840 fn max_ordinal_present(&self) -> u64 {
21841 if let Some(_) = self.source_dictionary {
21842 return 7;
21843 }
21844 if let Some(_) = self.default {
21845 return 6;
21846 }
21847 if let Some(_) = self.type_ {
21848 return 5;
21849 }
21850 if let Some(_) = self.availability {
21851 return 4;
21852 }
21853 if let Some(_) = self.target_name {
21854 return 3;
21855 }
21856 if let Some(_) = self.source_name {
21857 return 2;
21858 }
21859 if let Some(_) = self.source {
21860 return 1;
21861 }
21862 0
21863 }
21864 }
21865
21866 impl fidl::encoding::ValueTypeMarker for UseConfiguration {
21867 type Borrowed<'a> = &'a Self;
21868 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21869 value
21870 }
21871 }
21872
21873 unsafe impl fidl::encoding::TypeMarker for UseConfiguration {
21874 type Owned = Self;
21875
21876 #[inline(always)]
21877 fn inline_align(_context: fidl::encoding::Context) -> usize {
21878 8
21879 }
21880
21881 #[inline(always)]
21882 fn inline_size(_context: fidl::encoding::Context) -> usize {
21883 16
21884 }
21885 }
21886
21887 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseConfiguration, D>
21888 for &UseConfiguration
21889 {
21890 unsafe fn encode(
21891 self,
21892 encoder: &mut fidl::encoding::Encoder<'_, D>,
21893 offset: usize,
21894 mut depth: fidl::encoding::Depth,
21895 ) -> fidl::Result<()> {
21896 encoder.debug_check_bounds::<UseConfiguration>(offset);
21897 let max_ordinal: u64 = self.max_ordinal_present();
21899 encoder.write_num(max_ordinal, offset);
21900 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21901 if max_ordinal == 0 {
21903 return Ok(());
21904 }
21905 depth.increment()?;
21906 let envelope_size = 8;
21907 let bytes_len = max_ordinal as usize * envelope_size;
21908 #[allow(unused_variables)]
21909 let offset = encoder.out_of_line_offset(bytes_len);
21910 let mut _prev_end_offset: usize = 0;
21911 if 1 > max_ordinal {
21912 return Ok(());
21913 }
21914
21915 let cur_offset: usize = (1 - 1) * envelope_size;
21918
21919 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21921
21922 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
21927 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
21928 encoder,
21929 offset + cur_offset,
21930 depth,
21931 )?;
21932
21933 _prev_end_offset = cur_offset + envelope_size;
21934 if 2 > max_ordinal {
21935 return Ok(());
21936 }
21937
21938 let cur_offset: usize = (2 - 1) * envelope_size;
21941
21942 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21944
21945 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
21950 self.source_name.as_ref().map(
21951 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
21952 ),
21953 encoder,
21954 offset + cur_offset,
21955 depth,
21956 )?;
21957
21958 _prev_end_offset = cur_offset + envelope_size;
21959 if 3 > max_ordinal {
21960 return Ok(());
21961 }
21962
21963 let cur_offset: usize = (3 - 1) * envelope_size;
21966
21967 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21969
21970 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
21975 self.target_name.as_ref().map(
21976 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
21977 ),
21978 encoder,
21979 offset + cur_offset,
21980 depth,
21981 )?;
21982
21983 _prev_end_offset = cur_offset + envelope_size;
21984 if 4 > max_ordinal {
21985 return Ok(());
21986 }
21987
21988 let cur_offset: usize = (4 - 1) * envelope_size;
21991
21992 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21994
21995 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
22000 self.availability
22001 .as_ref()
22002 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
22003 encoder,
22004 offset + cur_offset,
22005 depth,
22006 )?;
22007
22008 _prev_end_offset = cur_offset + envelope_size;
22009 if 5 > max_ordinal {
22010 return Ok(());
22011 }
22012
22013 let cur_offset: usize = (5 - 1) * envelope_size;
22016
22017 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22019
22020 fidl::encoding::encode_in_envelope_optional::<ConfigType, D>(
22025 self.type_.as_ref().map(<ConfigType as fidl::encoding::ValueTypeMarker>::borrow),
22026 encoder,
22027 offset + cur_offset,
22028 depth,
22029 )?;
22030
22031 _prev_end_offset = cur_offset + envelope_size;
22032 if 6 > max_ordinal {
22033 return Ok(());
22034 }
22035
22036 let cur_offset: usize = (6 - 1) * envelope_size;
22039
22040 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22042
22043 fidl::encoding::encode_in_envelope_optional::<ConfigValue, D>(
22048 self.default.as_ref().map(<ConfigValue as fidl::encoding::ValueTypeMarker>::borrow),
22049 encoder,
22050 offset + cur_offset,
22051 depth,
22052 )?;
22053
22054 _prev_end_offset = cur_offset + envelope_size;
22055 if 7 > max_ordinal {
22056 return Ok(());
22057 }
22058
22059 let cur_offset: usize = (7 - 1) * envelope_size;
22062
22063 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22065
22066 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
22071 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
22072 encoder, offset + cur_offset, depth
22073 )?;
22074
22075 _prev_end_offset = cur_offset + envelope_size;
22076
22077 Ok(())
22078 }
22079 }
22080
22081 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseConfiguration {
22082 #[inline(always)]
22083 fn new_empty() -> Self {
22084 Self::default()
22085 }
22086
22087 unsafe fn decode(
22088 &mut self,
22089 decoder: &mut fidl::encoding::Decoder<'_, D>,
22090 offset: usize,
22091 mut depth: fidl::encoding::Depth,
22092 ) -> fidl::Result<()> {
22093 decoder.debug_check_bounds::<Self>(offset);
22094 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22095 None => return Err(fidl::Error::NotNullable),
22096 Some(len) => len,
22097 };
22098 if len == 0 {
22100 return Ok(());
22101 };
22102 depth.increment()?;
22103 let envelope_size = 8;
22104 let bytes_len = len * envelope_size;
22105 let offset = decoder.out_of_line_offset(bytes_len)?;
22106 let mut _next_ordinal_to_read = 0;
22108 let mut next_offset = offset;
22109 let end_offset = offset + bytes_len;
22110 _next_ordinal_to_read += 1;
22111 if next_offset >= end_offset {
22112 return Ok(());
22113 }
22114
22115 while _next_ordinal_to_read < 1 {
22117 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22118 _next_ordinal_to_read += 1;
22119 next_offset += envelope_size;
22120 }
22121
22122 let next_out_of_line = decoder.next_out_of_line();
22123 let handles_before = decoder.remaining_handles();
22124 if let Some((inlined, num_bytes, num_handles)) =
22125 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22126 {
22127 let member_inline_size =
22128 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22129 if inlined != (member_inline_size <= 4) {
22130 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22131 }
22132 let inner_offset;
22133 let mut inner_depth = depth.clone();
22134 if inlined {
22135 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22136 inner_offset = next_offset;
22137 } else {
22138 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22139 inner_depth.increment()?;
22140 }
22141 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
22142 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
22143 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22144 {
22145 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22146 }
22147 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22148 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22149 }
22150 }
22151
22152 next_offset += envelope_size;
22153 _next_ordinal_to_read += 1;
22154 if next_offset >= end_offset {
22155 return Ok(());
22156 }
22157
22158 while _next_ordinal_to_read < 2 {
22160 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22161 _next_ordinal_to_read += 1;
22162 next_offset += envelope_size;
22163 }
22164
22165 let next_out_of_line = decoder.next_out_of_line();
22166 let handles_before = decoder.remaining_handles();
22167 if let Some((inlined, num_bytes, num_handles)) =
22168 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22169 {
22170 let member_inline_size =
22171 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
22172 decoder.context,
22173 );
22174 if inlined != (member_inline_size <= 4) {
22175 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22176 }
22177 let inner_offset;
22178 let mut inner_depth = depth.clone();
22179 if inlined {
22180 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22181 inner_offset = next_offset;
22182 } else {
22183 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22184 inner_depth.increment()?;
22185 }
22186 let val_ref = self
22187 .source_name
22188 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
22189 fidl::decode!(
22190 fidl::encoding::BoundedString<100>,
22191 D,
22192 val_ref,
22193 decoder,
22194 inner_offset,
22195 inner_depth
22196 )?;
22197 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22198 {
22199 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22200 }
22201 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22202 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22203 }
22204 }
22205
22206 next_offset += envelope_size;
22207 _next_ordinal_to_read += 1;
22208 if next_offset >= end_offset {
22209 return Ok(());
22210 }
22211
22212 while _next_ordinal_to_read < 3 {
22214 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22215 _next_ordinal_to_read += 1;
22216 next_offset += envelope_size;
22217 }
22218
22219 let next_out_of_line = decoder.next_out_of_line();
22220 let handles_before = decoder.remaining_handles();
22221 if let Some((inlined, num_bytes, num_handles)) =
22222 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22223 {
22224 let member_inline_size =
22225 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
22226 decoder.context,
22227 );
22228 if inlined != (member_inline_size <= 4) {
22229 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22230 }
22231 let inner_offset;
22232 let mut inner_depth = depth.clone();
22233 if inlined {
22234 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22235 inner_offset = next_offset;
22236 } else {
22237 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22238 inner_depth.increment()?;
22239 }
22240 let val_ref = self
22241 .target_name
22242 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
22243 fidl::decode!(
22244 fidl::encoding::BoundedString<100>,
22245 D,
22246 val_ref,
22247 decoder,
22248 inner_offset,
22249 inner_depth
22250 )?;
22251 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22252 {
22253 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22254 }
22255 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22256 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22257 }
22258 }
22259
22260 next_offset += envelope_size;
22261 _next_ordinal_to_read += 1;
22262 if next_offset >= end_offset {
22263 return Ok(());
22264 }
22265
22266 while _next_ordinal_to_read < 4 {
22268 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22269 _next_ordinal_to_read += 1;
22270 next_offset += envelope_size;
22271 }
22272
22273 let next_out_of_line = decoder.next_out_of_line();
22274 let handles_before = decoder.remaining_handles();
22275 if let Some((inlined, num_bytes, num_handles)) =
22276 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22277 {
22278 let member_inline_size =
22279 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22280 if inlined != (member_inline_size <= 4) {
22281 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22282 }
22283 let inner_offset;
22284 let mut inner_depth = depth.clone();
22285 if inlined {
22286 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22287 inner_offset = next_offset;
22288 } else {
22289 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22290 inner_depth.increment()?;
22291 }
22292 let val_ref =
22293 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
22294 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
22295 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22296 {
22297 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22298 }
22299 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22300 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22301 }
22302 }
22303
22304 next_offset += envelope_size;
22305 _next_ordinal_to_read += 1;
22306 if next_offset >= end_offset {
22307 return Ok(());
22308 }
22309
22310 while _next_ordinal_to_read < 5 {
22312 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22313 _next_ordinal_to_read += 1;
22314 next_offset += envelope_size;
22315 }
22316
22317 let next_out_of_line = decoder.next_out_of_line();
22318 let handles_before = decoder.remaining_handles();
22319 if let Some((inlined, num_bytes, num_handles)) =
22320 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22321 {
22322 let member_inline_size =
22323 <ConfigType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22324 if inlined != (member_inline_size <= 4) {
22325 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22326 }
22327 let inner_offset;
22328 let mut inner_depth = depth.clone();
22329 if inlined {
22330 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22331 inner_offset = next_offset;
22332 } else {
22333 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22334 inner_depth.increment()?;
22335 }
22336 let val_ref = self.type_.get_or_insert_with(|| fidl::new_empty!(ConfigType, D));
22337 fidl::decode!(ConfigType, D, val_ref, decoder, inner_offset, inner_depth)?;
22338 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22339 {
22340 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22341 }
22342 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22343 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22344 }
22345 }
22346
22347 next_offset += envelope_size;
22348 _next_ordinal_to_read += 1;
22349 if next_offset >= end_offset {
22350 return Ok(());
22351 }
22352
22353 while _next_ordinal_to_read < 6 {
22355 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22356 _next_ordinal_to_read += 1;
22357 next_offset += envelope_size;
22358 }
22359
22360 let next_out_of_line = decoder.next_out_of_line();
22361 let handles_before = decoder.remaining_handles();
22362 if let Some((inlined, num_bytes, num_handles)) =
22363 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22364 {
22365 let member_inline_size =
22366 <ConfigValue as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22367 if inlined != (member_inline_size <= 4) {
22368 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22369 }
22370 let inner_offset;
22371 let mut inner_depth = depth.clone();
22372 if inlined {
22373 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22374 inner_offset = next_offset;
22375 } else {
22376 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22377 inner_depth.increment()?;
22378 }
22379 let val_ref = self.default.get_or_insert_with(|| fidl::new_empty!(ConfigValue, D));
22380 fidl::decode!(ConfigValue, D, val_ref, decoder, inner_offset, inner_depth)?;
22381 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22382 {
22383 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22384 }
22385 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22386 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22387 }
22388 }
22389
22390 next_offset += envelope_size;
22391 _next_ordinal_to_read += 1;
22392 if next_offset >= end_offset {
22393 return Ok(());
22394 }
22395
22396 while _next_ordinal_to_read < 7 {
22398 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22399 _next_ordinal_to_read += 1;
22400 next_offset += envelope_size;
22401 }
22402
22403 let next_out_of_line = decoder.next_out_of_line();
22404 let handles_before = decoder.remaining_handles();
22405 if let Some((inlined, num_bytes, num_handles)) =
22406 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22407 {
22408 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22409 if inlined != (member_inline_size <= 4) {
22410 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22411 }
22412 let inner_offset;
22413 let mut inner_depth = depth.clone();
22414 if inlined {
22415 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22416 inner_offset = next_offset;
22417 } else {
22418 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22419 inner_depth.increment()?;
22420 }
22421 let val_ref = self.source_dictionary.get_or_insert_with(|| {
22422 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
22423 });
22424 fidl::decode!(
22425 fidl::encoding::BoundedString<1024>,
22426 D,
22427 val_ref,
22428 decoder,
22429 inner_offset,
22430 inner_depth
22431 )?;
22432 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22433 {
22434 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22435 }
22436 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22437 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22438 }
22439 }
22440
22441 next_offset += envelope_size;
22442
22443 while next_offset < end_offset {
22445 _next_ordinal_to_read += 1;
22446 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22447 next_offset += envelope_size;
22448 }
22449
22450 Ok(())
22451 }
22452 }
22453
22454 impl UseDirectory {
22455 #[inline(always)]
22456 fn max_ordinal_present(&self) -> u64 {
22457 if let Some(_) = self.source_dictionary {
22458 return 8;
22459 }
22460 if let Some(_) = self.availability {
22461 return 7;
22462 }
22463 if let Some(_) = self.dependency_type {
22464 return 6;
22465 }
22466 if let Some(_) = self.subdir {
22467 return 5;
22468 }
22469 if let Some(_) = self.rights {
22470 return 4;
22471 }
22472 if let Some(_) = self.target_path {
22473 return 3;
22474 }
22475 if let Some(_) = self.source_name {
22476 return 2;
22477 }
22478 if let Some(_) = self.source {
22479 return 1;
22480 }
22481 0
22482 }
22483 }
22484
22485 impl fidl::encoding::ValueTypeMarker for UseDirectory {
22486 type Borrowed<'a> = &'a Self;
22487 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22488 value
22489 }
22490 }
22491
22492 unsafe impl fidl::encoding::TypeMarker for UseDirectory {
22493 type Owned = Self;
22494
22495 #[inline(always)]
22496 fn inline_align(_context: fidl::encoding::Context) -> usize {
22497 8
22498 }
22499
22500 #[inline(always)]
22501 fn inline_size(_context: fidl::encoding::Context) -> usize {
22502 16
22503 }
22504 }
22505
22506 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseDirectory, D>
22507 for &UseDirectory
22508 {
22509 unsafe fn encode(
22510 self,
22511 encoder: &mut fidl::encoding::Encoder<'_, D>,
22512 offset: usize,
22513 mut depth: fidl::encoding::Depth,
22514 ) -> fidl::Result<()> {
22515 encoder.debug_check_bounds::<UseDirectory>(offset);
22516 let max_ordinal: u64 = self.max_ordinal_present();
22518 encoder.write_num(max_ordinal, offset);
22519 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22520 if max_ordinal == 0 {
22522 return Ok(());
22523 }
22524 depth.increment()?;
22525 let envelope_size = 8;
22526 let bytes_len = max_ordinal as usize * envelope_size;
22527 #[allow(unused_variables)]
22528 let offset = encoder.out_of_line_offset(bytes_len);
22529 let mut _prev_end_offset: usize = 0;
22530 if 1 > max_ordinal {
22531 return Ok(());
22532 }
22533
22534 let cur_offset: usize = (1 - 1) * envelope_size;
22537
22538 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22540
22541 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
22546 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
22547 encoder,
22548 offset + cur_offset,
22549 depth,
22550 )?;
22551
22552 _prev_end_offset = cur_offset + envelope_size;
22553 if 2 > max_ordinal {
22554 return Ok(());
22555 }
22556
22557 let cur_offset: usize = (2 - 1) * envelope_size;
22560
22561 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22563
22564 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
22569 self.source_name.as_ref().map(
22570 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
22571 ),
22572 encoder,
22573 offset + cur_offset,
22574 depth,
22575 )?;
22576
22577 _prev_end_offset = cur_offset + envelope_size;
22578 if 3 > max_ordinal {
22579 return Ok(());
22580 }
22581
22582 let cur_offset: usize = (3 - 1) * envelope_size;
22585
22586 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22588
22589 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
22594 self.target_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
22595 encoder, offset + cur_offset, depth
22596 )?;
22597
22598 _prev_end_offset = cur_offset + envelope_size;
22599 if 4 > max_ordinal {
22600 return Ok(());
22601 }
22602
22603 let cur_offset: usize = (4 - 1) * envelope_size;
22606
22607 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22609
22610 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_io::Operations, D>(
22615 self.rights
22616 .as_ref()
22617 .map(<fidl_fuchsia_io::Operations as fidl::encoding::ValueTypeMarker>::borrow),
22618 encoder,
22619 offset + cur_offset,
22620 depth,
22621 )?;
22622
22623 _prev_end_offset = cur_offset + envelope_size;
22624 if 5 > max_ordinal {
22625 return Ok(());
22626 }
22627
22628 let cur_offset: usize = (5 - 1) * envelope_size;
22631
22632 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22634
22635 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
22640 self.subdir.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
22641 encoder, offset + cur_offset, depth
22642 )?;
22643
22644 _prev_end_offset = cur_offset + envelope_size;
22645 if 6 > max_ordinal {
22646 return Ok(());
22647 }
22648
22649 let cur_offset: usize = (6 - 1) * envelope_size;
22652
22653 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22655
22656 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
22661 self.dependency_type
22662 .as_ref()
22663 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
22664 encoder,
22665 offset + cur_offset,
22666 depth,
22667 )?;
22668
22669 _prev_end_offset = cur_offset + envelope_size;
22670 if 7 > max_ordinal {
22671 return Ok(());
22672 }
22673
22674 let cur_offset: usize = (7 - 1) * envelope_size;
22677
22678 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22680
22681 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
22686 self.availability
22687 .as_ref()
22688 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
22689 encoder,
22690 offset + cur_offset,
22691 depth,
22692 )?;
22693
22694 _prev_end_offset = cur_offset + envelope_size;
22695 if 8 > max_ordinal {
22696 return Ok(());
22697 }
22698
22699 let cur_offset: usize = (8 - 1) * envelope_size;
22702
22703 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22705
22706 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
22711 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
22712 encoder, offset + cur_offset, depth
22713 )?;
22714
22715 _prev_end_offset = cur_offset + envelope_size;
22716
22717 Ok(())
22718 }
22719 }
22720
22721 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseDirectory {
22722 #[inline(always)]
22723 fn new_empty() -> Self {
22724 Self::default()
22725 }
22726
22727 unsafe fn decode(
22728 &mut self,
22729 decoder: &mut fidl::encoding::Decoder<'_, D>,
22730 offset: usize,
22731 mut depth: fidl::encoding::Depth,
22732 ) -> fidl::Result<()> {
22733 decoder.debug_check_bounds::<Self>(offset);
22734 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22735 None => return Err(fidl::Error::NotNullable),
22736 Some(len) => len,
22737 };
22738 if len == 0 {
22740 return Ok(());
22741 };
22742 depth.increment()?;
22743 let envelope_size = 8;
22744 let bytes_len = len * envelope_size;
22745 let offset = decoder.out_of_line_offset(bytes_len)?;
22746 let mut _next_ordinal_to_read = 0;
22748 let mut next_offset = offset;
22749 let end_offset = offset + bytes_len;
22750 _next_ordinal_to_read += 1;
22751 if next_offset >= end_offset {
22752 return Ok(());
22753 }
22754
22755 while _next_ordinal_to_read < 1 {
22757 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22758 _next_ordinal_to_read += 1;
22759 next_offset += envelope_size;
22760 }
22761
22762 let next_out_of_line = decoder.next_out_of_line();
22763 let handles_before = decoder.remaining_handles();
22764 if let Some((inlined, num_bytes, num_handles)) =
22765 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22766 {
22767 let member_inline_size =
22768 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22769 if inlined != (member_inline_size <= 4) {
22770 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22771 }
22772 let inner_offset;
22773 let mut inner_depth = depth.clone();
22774 if inlined {
22775 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22776 inner_offset = next_offset;
22777 } else {
22778 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22779 inner_depth.increment()?;
22780 }
22781 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
22782 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
22783 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22784 {
22785 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22786 }
22787 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22788 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22789 }
22790 }
22791
22792 next_offset += envelope_size;
22793 _next_ordinal_to_read += 1;
22794 if next_offset >= end_offset {
22795 return Ok(());
22796 }
22797
22798 while _next_ordinal_to_read < 2 {
22800 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22801 _next_ordinal_to_read += 1;
22802 next_offset += envelope_size;
22803 }
22804
22805 let next_out_of_line = decoder.next_out_of_line();
22806 let handles_before = decoder.remaining_handles();
22807 if let Some((inlined, num_bytes, num_handles)) =
22808 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22809 {
22810 let member_inline_size =
22811 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
22812 decoder.context,
22813 );
22814 if inlined != (member_inline_size <= 4) {
22815 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22816 }
22817 let inner_offset;
22818 let mut inner_depth = depth.clone();
22819 if inlined {
22820 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22821 inner_offset = next_offset;
22822 } else {
22823 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22824 inner_depth.increment()?;
22825 }
22826 let val_ref = self
22827 .source_name
22828 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
22829 fidl::decode!(
22830 fidl::encoding::BoundedString<100>,
22831 D,
22832 val_ref,
22833 decoder,
22834 inner_offset,
22835 inner_depth
22836 )?;
22837 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22838 {
22839 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22840 }
22841 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22842 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22843 }
22844 }
22845
22846 next_offset += envelope_size;
22847 _next_ordinal_to_read += 1;
22848 if next_offset >= end_offset {
22849 return Ok(());
22850 }
22851
22852 while _next_ordinal_to_read < 3 {
22854 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22855 _next_ordinal_to_read += 1;
22856 next_offset += envelope_size;
22857 }
22858
22859 let next_out_of_line = decoder.next_out_of_line();
22860 let handles_before = decoder.remaining_handles();
22861 if let Some((inlined, num_bytes, num_handles)) =
22862 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22863 {
22864 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22865 if inlined != (member_inline_size <= 4) {
22866 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22867 }
22868 let inner_offset;
22869 let mut inner_depth = depth.clone();
22870 if inlined {
22871 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22872 inner_offset = next_offset;
22873 } else {
22874 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22875 inner_depth.increment()?;
22876 }
22877 let val_ref = self.target_path.get_or_insert_with(|| {
22878 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
22879 });
22880 fidl::decode!(
22881 fidl::encoding::BoundedString<1024>,
22882 D,
22883 val_ref,
22884 decoder,
22885 inner_offset,
22886 inner_depth
22887 )?;
22888 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22889 {
22890 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22891 }
22892 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22893 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22894 }
22895 }
22896
22897 next_offset += envelope_size;
22898 _next_ordinal_to_read += 1;
22899 if next_offset >= end_offset {
22900 return Ok(());
22901 }
22902
22903 while _next_ordinal_to_read < 4 {
22905 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22906 _next_ordinal_to_read += 1;
22907 next_offset += envelope_size;
22908 }
22909
22910 let next_out_of_line = decoder.next_out_of_line();
22911 let handles_before = decoder.remaining_handles();
22912 if let Some((inlined, num_bytes, num_handles)) =
22913 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22914 {
22915 let member_inline_size =
22916 <fidl_fuchsia_io::Operations as fidl::encoding::TypeMarker>::inline_size(
22917 decoder.context,
22918 );
22919 if inlined != (member_inline_size <= 4) {
22920 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22921 }
22922 let inner_offset;
22923 let mut inner_depth = depth.clone();
22924 if inlined {
22925 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22926 inner_offset = next_offset;
22927 } else {
22928 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22929 inner_depth.increment()?;
22930 }
22931 let val_ref = self
22932 .rights
22933 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_io::Operations, D));
22934 fidl::decode!(
22935 fidl_fuchsia_io::Operations,
22936 D,
22937 val_ref,
22938 decoder,
22939 inner_offset,
22940 inner_depth
22941 )?;
22942 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22943 {
22944 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22945 }
22946 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22947 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22948 }
22949 }
22950
22951 next_offset += envelope_size;
22952 _next_ordinal_to_read += 1;
22953 if next_offset >= end_offset {
22954 return Ok(());
22955 }
22956
22957 while _next_ordinal_to_read < 5 {
22959 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22960 _next_ordinal_to_read += 1;
22961 next_offset += envelope_size;
22962 }
22963
22964 let next_out_of_line = decoder.next_out_of_line();
22965 let handles_before = decoder.remaining_handles();
22966 if let Some((inlined, num_bytes, num_handles)) =
22967 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22968 {
22969 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22970 if inlined != (member_inline_size <= 4) {
22971 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22972 }
22973 let inner_offset;
22974 let mut inner_depth = depth.clone();
22975 if inlined {
22976 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22977 inner_offset = next_offset;
22978 } else {
22979 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22980 inner_depth.increment()?;
22981 }
22982 let val_ref = self.subdir.get_or_insert_with(|| {
22983 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
22984 });
22985 fidl::decode!(
22986 fidl::encoding::BoundedString<1024>,
22987 D,
22988 val_ref,
22989 decoder,
22990 inner_offset,
22991 inner_depth
22992 )?;
22993 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22994 {
22995 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22996 }
22997 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22998 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22999 }
23000 }
23001
23002 next_offset += envelope_size;
23003 _next_ordinal_to_read += 1;
23004 if next_offset >= end_offset {
23005 return Ok(());
23006 }
23007
23008 while _next_ordinal_to_read < 6 {
23010 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23011 _next_ordinal_to_read += 1;
23012 next_offset += envelope_size;
23013 }
23014
23015 let next_out_of_line = decoder.next_out_of_line();
23016 let handles_before = decoder.remaining_handles();
23017 if let Some((inlined, num_bytes, num_handles)) =
23018 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23019 {
23020 let member_inline_size =
23021 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23022 if inlined != (member_inline_size <= 4) {
23023 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23024 }
23025 let inner_offset;
23026 let mut inner_depth = depth.clone();
23027 if inlined {
23028 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23029 inner_offset = next_offset;
23030 } else {
23031 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23032 inner_depth.increment()?;
23033 }
23034 let val_ref =
23035 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
23036 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
23037 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23038 {
23039 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23040 }
23041 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23042 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23043 }
23044 }
23045
23046 next_offset += envelope_size;
23047 _next_ordinal_to_read += 1;
23048 if next_offset >= end_offset {
23049 return Ok(());
23050 }
23051
23052 while _next_ordinal_to_read < 7 {
23054 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23055 _next_ordinal_to_read += 1;
23056 next_offset += envelope_size;
23057 }
23058
23059 let next_out_of_line = decoder.next_out_of_line();
23060 let handles_before = decoder.remaining_handles();
23061 if let Some((inlined, num_bytes, num_handles)) =
23062 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23063 {
23064 let member_inline_size =
23065 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23066 if inlined != (member_inline_size <= 4) {
23067 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23068 }
23069 let inner_offset;
23070 let mut inner_depth = depth.clone();
23071 if inlined {
23072 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23073 inner_offset = next_offset;
23074 } else {
23075 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23076 inner_depth.increment()?;
23077 }
23078 let val_ref =
23079 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
23080 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
23081 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23082 {
23083 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23084 }
23085 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23086 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23087 }
23088 }
23089
23090 next_offset += envelope_size;
23091 _next_ordinal_to_read += 1;
23092 if next_offset >= end_offset {
23093 return Ok(());
23094 }
23095
23096 while _next_ordinal_to_read < 8 {
23098 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23099 _next_ordinal_to_read += 1;
23100 next_offset += envelope_size;
23101 }
23102
23103 let next_out_of_line = decoder.next_out_of_line();
23104 let handles_before = decoder.remaining_handles();
23105 if let Some((inlined, num_bytes, num_handles)) =
23106 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23107 {
23108 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23109 if inlined != (member_inline_size <= 4) {
23110 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23111 }
23112 let inner_offset;
23113 let mut inner_depth = depth.clone();
23114 if inlined {
23115 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23116 inner_offset = next_offset;
23117 } else {
23118 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23119 inner_depth.increment()?;
23120 }
23121 let val_ref = self.source_dictionary.get_or_insert_with(|| {
23122 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
23123 });
23124 fidl::decode!(
23125 fidl::encoding::BoundedString<1024>,
23126 D,
23127 val_ref,
23128 decoder,
23129 inner_offset,
23130 inner_depth
23131 )?;
23132 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23133 {
23134 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23135 }
23136 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23137 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23138 }
23139 }
23140
23141 next_offset += envelope_size;
23142
23143 while next_offset < end_offset {
23145 _next_ordinal_to_read += 1;
23146 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23147 next_offset += envelope_size;
23148 }
23149
23150 Ok(())
23151 }
23152 }
23153
23154 impl UseEventStream {
23155 #[inline(always)]
23156 fn max_ordinal_present(&self) -> u64 {
23157 if let Some(_) = self.filter {
23158 return 6;
23159 }
23160 if let Some(_) = self.availability {
23161 return 5;
23162 }
23163 if let Some(_) = self.target_path {
23164 return 4;
23165 }
23166 if let Some(_) = self.scope {
23167 return 3;
23168 }
23169 if let Some(_) = self.source {
23170 return 2;
23171 }
23172 if let Some(_) = self.source_name {
23173 return 1;
23174 }
23175 0
23176 }
23177 }
23178
23179 impl fidl::encoding::ValueTypeMarker for UseEventStream {
23180 type Borrowed<'a> = &'a Self;
23181 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23182 value
23183 }
23184 }
23185
23186 unsafe impl fidl::encoding::TypeMarker for UseEventStream {
23187 type Owned = Self;
23188
23189 #[inline(always)]
23190 fn inline_align(_context: fidl::encoding::Context) -> usize {
23191 8
23192 }
23193
23194 #[inline(always)]
23195 fn inline_size(_context: fidl::encoding::Context) -> usize {
23196 16
23197 }
23198 }
23199
23200 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseEventStream, D>
23201 for &UseEventStream
23202 {
23203 unsafe fn encode(
23204 self,
23205 encoder: &mut fidl::encoding::Encoder<'_, D>,
23206 offset: usize,
23207 mut depth: fidl::encoding::Depth,
23208 ) -> fidl::Result<()> {
23209 encoder.debug_check_bounds::<UseEventStream>(offset);
23210 let max_ordinal: u64 = self.max_ordinal_present();
23212 encoder.write_num(max_ordinal, offset);
23213 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23214 if max_ordinal == 0 {
23216 return Ok(());
23217 }
23218 depth.increment()?;
23219 let envelope_size = 8;
23220 let bytes_len = max_ordinal as usize * envelope_size;
23221 #[allow(unused_variables)]
23222 let offset = encoder.out_of_line_offset(bytes_len);
23223 let mut _prev_end_offset: usize = 0;
23224 if 1 > max_ordinal {
23225 return Ok(());
23226 }
23227
23228 let cur_offset: usize = (1 - 1) * envelope_size;
23231
23232 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23234
23235 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
23240 self.source_name.as_ref().map(
23241 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
23242 ),
23243 encoder,
23244 offset + cur_offset,
23245 depth,
23246 )?;
23247
23248 _prev_end_offset = cur_offset + envelope_size;
23249 if 2 > max_ordinal {
23250 return Ok(());
23251 }
23252
23253 let cur_offset: usize = (2 - 1) * envelope_size;
23256
23257 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23259
23260 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
23265 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
23266 encoder,
23267 offset + cur_offset,
23268 depth,
23269 )?;
23270
23271 _prev_end_offset = cur_offset + envelope_size;
23272 if 3 > max_ordinal {
23273 return Ok(());
23274 }
23275
23276 let cur_offset: usize = (3 - 1) * envelope_size;
23279
23280 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23282
23283 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Ref>, D>(
23288 self.scope.as_ref().map(<fidl::encoding::UnboundedVector<Ref> as fidl::encoding::ValueTypeMarker>::borrow),
23289 encoder, offset + cur_offset, depth
23290 )?;
23291
23292 _prev_end_offset = cur_offset + envelope_size;
23293 if 4 > max_ordinal {
23294 return Ok(());
23295 }
23296
23297 let cur_offset: usize = (4 - 1) * envelope_size;
23300
23301 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23303
23304 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
23309 self.target_path.as_ref().map(
23310 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
23311 ),
23312 encoder,
23313 offset + cur_offset,
23314 depth,
23315 )?;
23316
23317 _prev_end_offset = cur_offset + envelope_size;
23318 if 5 > max_ordinal {
23319 return Ok(());
23320 }
23321
23322 let cur_offset: usize = (5 - 1) * envelope_size;
23325
23326 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23328
23329 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
23334 self.availability
23335 .as_ref()
23336 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
23337 encoder,
23338 offset + cur_offset,
23339 depth,
23340 )?;
23341
23342 _prev_end_offset = cur_offset + envelope_size;
23343 if 6 > max_ordinal {
23344 return Ok(());
23345 }
23346
23347 let cur_offset: usize = (6 - 1) * envelope_size;
23350
23351 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23353
23354 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_data::Dictionary, D>(
23359 self.filter.as_ref().map(
23360 <fidl_fuchsia_data::Dictionary as fidl::encoding::ValueTypeMarker>::borrow,
23361 ),
23362 encoder,
23363 offset + cur_offset,
23364 depth,
23365 )?;
23366
23367 _prev_end_offset = cur_offset + envelope_size;
23368
23369 Ok(())
23370 }
23371 }
23372
23373 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseEventStream {
23374 #[inline(always)]
23375 fn new_empty() -> Self {
23376 Self::default()
23377 }
23378
23379 unsafe fn decode(
23380 &mut self,
23381 decoder: &mut fidl::encoding::Decoder<'_, D>,
23382 offset: usize,
23383 mut depth: fidl::encoding::Depth,
23384 ) -> fidl::Result<()> {
23385 decoder.debug_check_bounds::<Self>(offset);
23386 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23387 None => return Err(fidl::Error::NotNullable),
23388 Some(len) => len,
23389 };
23390 if len == 0 {
23392 return Ok(());
23393 };
23394 depth.increment()?;
23395 let envelope_size = 8;
23396 let bytes_len = len * envelope_size;
23397 let offset = decoder.out_of_line_offset(bytes_len)?;
23398 let mut _next_ordinal_to_read = 0;
23400 let mut next_offset = offset;
23401 let end_offset = offset + bytes_len;
23402 _next_ordinal_to_read += 1;
23403 if next_offset >= end_offset {
23404 return Ok(());
23405 }
23406
23407 while _next_ordinal_to_read < 1 {
23409 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23410 _next_ordinal_to_read += 1;
23411 next_offset += envelope_size;
23412 }
23413
23414 let next_out_of_line = decoder.next_out_of_line();
23415 let handles_before = decoder.remaining_handles();
23416 if let Some((inlined, num_bytes, num_handles)) =
23417 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23418 {
23419 let member_inline_size =
23420 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
23421 decoder.context,
23422 );
23423 if inlined != (member_inline_size <= 4) {
23424 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23425 }
23426 let inner_offset;
23427 let mut inner_depth = depth.clone();
23428 if inlined {
23429 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23430 inner_offset = next_offset;
23431 } else {
23432 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23433 inner_depth.increment()?;
23434 }
23435 let val_ref = self
23436 .source_name
23437 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
23438 fidl::decode!(
23439 fidl::encoding::BoundedString<100>,
23440 D,
23441 val_ref,
23442 decoder,
23443 inner_offset,
23444 inner_depth
23445 )?;
23446 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23447 {
23448 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23449 }
23450 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23451 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23452 }
23453 }
23454
23455 next_offset += envelope_size;
23456 _next_ordinal_to_read += 1;
23457 if next_offset >= end_offset {
23458 return Ok(());
23459 }
23460
23461 while _next_ordinal_to_read < 2 {
23463 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23464 _next_ordinal_to_read += 1;
23465 next_offset += envelope_size;
23466 }
23467
23468 let next_out_of_line = decoder.next_out_of_line();
23469 let handles_before = decoder.remaining_handles();
23470 if let Some((inlined, num_bytes, num_handles)) =
23471 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23472 {
23473 let member_inline_size =
23474 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23475 if inlined != (member_inline_size <= 4) {
23476 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23477 }
23478 let inner_offset;
23479 let mut inner_depth = depth.clone();
23480 if inlined {
23481 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23482 inner_offset = next_offset;
23483 } else {
23484 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23485 inner_depth.increment()?;
23486 }
23487 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
23488 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
23489 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23490 {
23491 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23492 }
23493 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23494 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23495 }
23496 }
23497
23498 next_offset += envelope_size;
23499 _next_ordinal_to_read += 1;
23500 if next_offset >= end_offset {
23501 return Ok(());
23502 }
23503
23504 while _next_ordinal_to_read < 3 {
23506 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23507 _next_ordinal_to_read += 1;
23508 next_offset += envelope_size;
23509 }
23510
23511 let next_out_of_line = decoder.next_out_of_line();
23512 let handles_before = decoder.remaining_handles();
23513 if let Some((inlined, num_bytes, num_handles)) =
23514 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23515 {
23516 let member_inline_size = <fidl::encoding::UnboundedVector<Ref> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23517 if inlined != (member_inline_size <= 4) {
23518 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23519 }
23520 let inner_offset;
23521 let mut inner_depth = depth.clone();
23522 if inlined {
23523 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23524 inner_offset = next_offset;
23525 } else {
23526 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23527 inner_depth.increment()?;
23528 }
23529 let val_ref = self.scope.get_or_insert_with(|| {
23530 fidl::new_empty!(fidl::encoding::UnboundedVector<Ref>, D)
23531 });
23532 fidl::decode!(
23533 fidl::encoding::UnboundedVector<Ref>,
23534 D,
23535 val_ref,
23536 decoder,
23537 inner_offset,
23538 inner_depth
23539 )?;
23540 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23541 {
23542 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23543 }
23544 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23545 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23546 }
23547 }
23548
23549 next_offset += envelope_size;
23550 _next_ordinal_to_read += 1;
23551 if next_offset >= end_offset {
23552 return Ok(());
23553 }
23554
23555 while _next_ordinal_to_read < 4 {
23557 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23558 _next_ordinal_to_read += 1;
23559 next_offset += envelope_size;
23560 }
23561
23562 let next_out_of_line = decoder.next_out_of_line();
23563 let handles_before = decoder.remaining_handles();
23564 if let Some((inlined, num_bytes, num_handles)) =
23565 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23566 {
23567 let member_inline_size =
23568 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
23569 decoder.context,
23570 );
23571 if inlined != (member_inline_size <= 4) {
23572 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23573 }
23574 let inner_offset;
23575 let mut inner_depth = depth.clone();
23576 if inlined {
23577 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23578 inner_offset = next_offset;
23579 } else {
23580 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23581 inner_depth.increment()?;
23582 }
23583 let val_ref = self
23584 .target_path
23585 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
23586 fidl::decode!(
23587 fidl::encoding::BoundedString<100>,
23588 D,
23589 val_ref,
23590 decoder,
23591 inner_offset,
23592 inner_depth
23593 )?;
23594 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23595 {
23596 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23597 }
23598 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23599 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23600 }
23601 }
23602
23603 next_offset += envelope_size;
23604 _next_ordinal_to_read += 1;
23605 if next_offset >= end_offset {
23606 return Ok(());
23607 }
23608
23609 while _next_ordinal_to_read < 5 {
23611 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23612 _next_ordinal_to_read += 1;
23613 next_offset += envelope_size;
23614 }
23615
23616 let next_out_of_line = decoder.next_out_of_line();
23617 let handles_before = decoder.remaining_handles();
23618 if let Some((inlined, num_bytes, num_handles)) =
23619 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23620 {
23621 let member_inline_size =
23622 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23623 if inlined != (member_inline_size <= 4) {
23624 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23625 }
23626 let inner_offset;
23627 let mut inner_depth = depth.clone();
23628 if inlined {
23629 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23630 inner_offset = next_offset;
23631 } else {
23632 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23633 inner_depth.increment()?;
23634 }
23635 let val_ref =
23636 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
23637 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
23638 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23639 {
23640 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23641 }
23642 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23643 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23644 }
23645 }
23646
23647 next_offset += envelope_size;
23648 _next_ordinal_to_read += 1;
23649 if next_offset >= end_offset {
23650 return Ok(());
23651 }
23652
23653 while _next_ordinal_to_read < 6 {
23655 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23656 _next_ordinal_to_read += 1;
23657 next_offset += envelope_size;
23658 }
23659
23660 let next_out_of_line = decoder.next_out_of_line();
23661 let handles_before = decoder.remaining_handles();
23662 if let Some((inlined, num_bytes, num_handles)) =
23663 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23664 {
23665 let member_inline_size =
23666 <fidl_fuchsia_data::Dictionary as fidl::encoding::TypeMarker>::inline_size(
23667 decoder.context,
23668 );
23669 if inlined != (member_inline_size <= 4) {
23670 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23671 }
23672 let inner_offset;
23673 let mut inner_depth = depth.clone();
23674 if inlined {
23675 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23676 inner_offset = next_offset;
23677 } else {
23678 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23679 inner_depth.increment()?;
23680 }
23681 let val_ref = self
23682 .filter
23683 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_data::Dictionary, D));
23684 fidl::decode!(
23685 fidl_fuchsia_data::Dictionary,
23686 D,
23687 val_ref,
23688 decoder,
23689 inner_offset,
23690 inner_depth
23691 )?;
23692 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23693 {
23694 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23695 }
23696 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23697 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23698 }
23699 }
23700
23701 next_offset += envelope_size;
23702
23703 while next_offset < end_offset {
23705 _next_ordinal_to_read += 1;
23706 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23707 next_offset += envelope_size;
23708 }
23709
23710 Ok(())
23711 }
23712 }
23713
23714 impl UseProtocol {
23715 #[inline(always)]
23716 fn max_ordinal_present(&self) -> u64 {
23717 if let Some(_) = self.source_dictionary {
23718 return 6;
23719 }
23720 if let Some(_) = self.availability {
23721 return 5;
23722 }
23723 if let Some(_) = self.dependency_type {
23724 return 4;
23725 }
23726 if let Some(_) = self.target_path {
23727 return 3;
23728 }
23729 if let Some(_) = self.source_name {
23730 return 2;
23731 }
23732 if let Some(_) = self.source {
23733 return 1;
23734 }
23735 0
23736 }
23737 }
23738
23739 impl fidl::encoding::ValueTypeMarker for UseProtocol {
23740 type Borrowed<'a> = &'a Self;
23741 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23742 value
23743 }
23744 }
23745
23746 unsafe impl fidl::encoding::TypeMarker for UseProtocol {
23747 type Owned = Self;
23748
23749 #[inline(always)]
23750 fn inline_align(_context: fidl::encoding::Context) -> usize {
23751 8
23752 }
23753
23754 #[inline(always)]
23755 fn inline_size(_context: fidl::encoding::Context) -> usize {
23756 16
23757 }
23758 }
23759
23760 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseProtocol, D>
23761 for &UseProtocol
23762 {
23763 unsafe fn encode(
23764 self,
23765 encoder: &mut fidl::encoding::Encoder<'_, D>,
23766 offset: usize,
23767 mut depth: fidl::encoding::Depth,
23768 ) -> fidl::Result<()> {
23769 encoder.debug_check_bounds::<UseProtocol>(offset);
23770 let max_ordinal: u64 = self.max_ordinal_present();
23772 encoder.write_num(max_ordinal, offset);
23773 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23774 if max_ordinal == 0 {
23776 return Ok(());
23777 }
23778 depth.increment()?;
23779 let envelope_size = 8;
23780 let bytes_len = max_ordinal as usize * envelope_size;
23781 #[allow(unused_variables)]
23782 let offset = encoder.out_of_line_offset(bytes_len);
23783 let mut _prev_end_offset: usize = 0;
23784 if 1 > max_ordinal {
23785 return Ok(());
23786 }
23787
23788 let cur_offset: usize = (1 - 1) * envelope_size;
23791
23792 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23794
23795 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
23800 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
23801 encoder,
23802 offset + cur_offset,
23803 depth,
23804 )?;
23805
23806 _prev_end_offset = cur_offset + envelope_size;
23807 if 2 > max_ordinal {
23808 return Ok(());
23809 }
23810
23811 let cur_offset: usize = (2 - 1) * envelope_size;
23814
23815 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23817
23818 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
23823 self.source_name.as_ref().map(
23824 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
23825 ),
23826 encoder,
23827 offset + cur_offset,
23828 depth,
23829 )?;
23830
23831 _prev_end_offset = cur_offset + envelope_size;
23832 if 3 > max_ordinal {
23833 return Ok(());
23834 }
23835
23836 let cur_offset: usize = (3 - 1) * envelope_size;
23839
23840 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23842
23843 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
23848 self.target_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
23849 encoder, offset + cur_offset, depth
23850 )?;
23851
23852 _prev_end_offset = cur_offset + envelope_size;
23853 if 4 > max_ordinal {
23854 return Ok(());
23855 }
23856
23857 let cur_offset: usize = (4 - 1) * envelope_size;
23860
23861 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23863
23864 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
23869 self.dependency_type
23870 .as_ref()
23871 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
23872 encoder,
23873 offset + cur_offset,
23874 depth,
23875 )?;
23876
23877 _prev_end_offset = cur_offset + envelope_size;
23878 if 5 > max_ordinal {
23879 return Ok(());
23880 }
23881
23882 let cur_offset: usize = (5 - 1) * envelope_size;
23885
23886 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23888
23889 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
23894 self.availability
23895 .as_ref()
23896 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
23897 encoder,
23898 offset + cur_offset,
23899 depth,
23900 )?;
23901
23902 _prev_end_offset = cur_offset + envelope_size;
23903 if 6 > max_ordinal {
23904 return Ok(());
23905 }
23906
23907 let cur_offset: usize = (6 - 1) * envelope_size;
23910
23911 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
23913
23914 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
23919 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
23920 encoder, offset + cur_offset, depth
23921 )?;
23922
23923 _prev_end_offset = cur_offset + envelope_size;
23924
23925 Ok(())
23926 }
23927 }
23928
23929 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseProtocol {
23930 #[inline(always)]
23931 fn new_empty() -> Self {
23932 Self::default()
23933 }
23934
23935 unsafe fn decode(
23936 &mut self,
23937 decoder: &mut fidl::encoding::Decoder<'_, D>,
23938 offset: usize,
23939 mut depth: fidl::encoding::Depth,
23940 ) -> fidl::Result<()> {
23941 decoder.debug_check_bounds::<Self>(offset);
23942 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23943 None => return Err(fidl::Error::NotNullable),
23944 Some(len) => len,
23945 };
23946 if len == 0 {
23948 return Ok(());
23949 };
23950 depth.increment()?;
23951 let envelope_size = 8;
23952 let bytes_len = len * envelope_size;
23953 let offset = decoder.out_of_line_offset(bytes_len)?;
23954 let mut _next_ordinal_to_read = 0;
23956 let mut next_offset = offset;
23957 let end_offset = offset + bytes_len;
23958 _next_ordinal_to_read += 1;
23959 if next_offset >= end_offset {
23960 return Ok(());
23961 }
23962
23963 while _next_ordinal_to_read < 1 {
23965 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23966 _next_ordinal_to_read += 1;
23967 next_offset += envelope_size;
23968 }
23969
23970 let next_out_of_line = decoder.next_out_of_line();
23971 let handles_before = decoder.remaining_handles();
23972 if let Some((inlined, num_bytes, num_handles)) =
23973 fidl::encoding::decode_envelope_header(decoder, next_offset)?
23974 {
23975 let member_inline_size =
23976 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
23977 if inlined != (member_inline_size <= 4) {
23978 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23979 }
23980 let inner_offset;
23981 let mut inner_depth = depth.clone();
23982 if inlined {
23983 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
23984 inner_offset = next_offset;
23985 } else {
23986 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23987 inner_depth.increment()?;
23988 }
23989 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
23990 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
23991 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23992 {
23993 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23994 }
23995 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23996 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23997 }
23998 }
23999
24000 next_offset += envelope_size;
24001 _next_ordinal_to_read += 1;
24002 if next_offset >= end_offset {
24003 return Ok(());
24004 }
24005
24006 while _next_ordinal_to_read < 2 {
24008 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24009 _next_ordinal_to_read += 1;
24010 next_offset += envelope_size;
24011 }
24012
24013 let next_out_of_line = decoder.next_out_of_line();
24014 let handles_before = decoder.remaining_handles();
24015 if let Some((inlined, num_bytes, num_handles)) =
24016 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24017 {
24018 let member_inline_size =
24019 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
24020 decoder.context,
24021 );
24022 if inlined != (member_inline_size <= 4) {
24023 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24024 }
24025 let inner_offset;
24026 let mut inner_depth = depth.clone();
24027 if inlined {
24028 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24029 inner_offset = next_offset;
24030 } else {
24031 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24032 inner_depth.increment()?;
24033 }
24034 let val_ref = self
24035 .source_name
24036 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
24037 fidl::decode!(
24038 fidl::encoding::BoundedString<100>,
24039 D,
24040 val_ref,
24041 decoder,
24042 inner_offset,
24043 inner_depth
24044 )?;
24045 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24046 {
24047 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24048 }
24049 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24050 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24051 }
24052 }
24053
24054 next_offset += envelope_size;
24055 _next_ordinal_to_read += 1;
24056 if next_offset >= end_offset {
24057 return Ok(());
24058 }
24059
24060 while _next_ordinal_to_read < 3 {
24062 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24063 _next_ordinal_to_read += 1;
24064 next_offset += envelope_size;
24065 }
24066
24067 let next_out_of_line = decoder.next_out_of_line();
24068 let handles_before = decoder.remaining_handles();
24069 if let Some((inlined, num_bytes, num_handles)) =
24070 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24071 {
24072 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24073 if inlined != (member_inline_size <= 4) {
24074 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24075 }
24076 let inner_offset;
24077 let mut inner_depth = depth.clone();
24078 if inlined {
24079 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24080 inner_offset = next_offset;
24081 } else {
24082 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24083 inner_depth.increment()?;
24084 }
24085 let val_ref = self.target_path.get_or_insert_with(|| {
24086 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
24087 });
24088 fidl::decode!(
24089 fidl::encoding::BoundedString<1024>,
24090 D,
24091 val_ref,
24092 decoder,
24093 inner_offset,
24094 inner_depth
24095 )?;
24096 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24097 {
24098 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24099 }
24100 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24101 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24102 }
24103 }
24104
24105 next_offset += envelope_size;
24106 _next_ordinal_to_read += 1;
24107 if next_offset >= end_offset {
24108 return Ok(());
24109 }
24110
24111 while _next_ordinal_to_read < 4 {
24113 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24114 _next_ordinal_to_read += 1;
24115 next_offset += envelope_size;
24116 }
24117
24118 let next_out_of_line = decoder.next_out_of_line();
24119 let handles_before = decoder.remaining_handles();
24120 if let Some((inlined, num_bytes, num_handles)) =
24121 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24122 {
24123 let member_inline_size =
24124 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24125 if inlined != (member_inline_size <= 4) {
24126 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24127 }
24128 let inner_offset;
24129 let mut inner_depth = depth.clone();
24130 if inlined {
24131 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24132 inner_offset = next_offset;
24133 } else {
24134 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24135 inner_depth.increment()?;
24136 }
24137 let val_ref =
24138 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
24139 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
24140 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24141 {
24142 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24143 }
24144 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24145 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24146 }
24147 }
24148
24149 next_offset += envelope_size;
24150 _next_ordinal_to_read += 1;
24151 if next_offset >= end_offset {
24152 return Ok(());
24153 }
24154
24155 while _next_ordinal_to_read < 5 {
24157 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24158 _next_ordinal_to_read += 1;
24159 next_offset += envelope_size;
24160 }
24161
24162 let next_out_of_line = decoder.next_out_of_line();
24163 let handles_before = decoder.remaining_handles();
24164 if let Some((inlined, num_bytes, num_handles)) =
24165 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24166 {
24167 let member_inline_size =
24168 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24169 if inlined != (member_inline_size <= 4) {
24170 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24171 }
24172 let inner_offset;
24173 let mut inner_depth = depth.clone();
24174 if inlined {
24175 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24176 inner_offset = next_offset;
24177 } else {
24178 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24179 inner_depth.increment()?;
24180 }
24181 let val_ref =
24182 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
24183 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
24184 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24185 {
24186 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24187 }
24188 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24189 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24190 }
24191 }
24192
24193 next_offset += envelope_size;
24194 _next_ordinal_to_read += 1;
24195 if next_offset >= end_offset {
24196 return Ok(());
24197 }
24198
24199 while _next_ordinal_to_read < 6 {
24201 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24202 _next_ordinal_to_read += 1;
24203 next_offset += envelope_size;
24204 }
24205
24206 let next_out_of_line = decoder.next_out_of_line();
24207 let handles_before = decoder.remaining_handles();
24208 if let Some((inlined, num_bytes, num_handles)) =
24209 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24210 {
24211 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24212 if inlined != (member_inline_size <= 4) {
24213 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24214 }
24215 let inner_offset;
24216 let mut inner_depth = depth.clone();
24217 if inlined {
24218 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24219 inner_offset = next_offset;
24220 } else {
24221 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24222 inner_depth.increment()?;
24223 }
24224 let val_ref = self.source_dictionary.get_or_insert_with(|| {
24225 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
24226 });
24227 fidl::decode!(
24228 fidl::encoding::BoundedString<1024>,
24229 D,
24230 val_ref,
24231 decoder,
24232 inner_offset,
24233 inner_depth
24234 )?;
24235 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24236 {
24237 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24238 }
24239 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24240 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24241 }
24242 }
24243
24244 next_offset += envelope_size;
24245
24246 while next_offset < end_offset {
24248 _next_ordinal_to_read += 1;
24249 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24250 next_offset += envelope_size;
24251 }
24252
24253 Ok(())
24254 }
24255 }
24256
24257 impl UseRunner {
24258 #[inline(always)]
24259 fn max_ordinal_present(&self) -> u64 {
24260 if let Some(_) = self.source_dictionary {
24261 return 3;
24262 }
24263 if let Some(_) = self.source_name {
24264 return 2;
24265 }
24266 if let Some(_) = self.source {
24267 return 1;
24268 }
24269 0
24270 }
24271 }
24272
24273 impl fidl::encoding::ValueTypeMarker for UseRunner {
24274 type Borrowed<'a> = &'a Self;
24275 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24276 value
24277 }
24278 }
24279
24280 unsafe impl fidl::encoding::TypeMarker for UseRunner {
24281 type Owned = Self;
24282
24283 #[inline(always)]
24284 fn inline_align(_context: fidl::encoding::Context) -> usize {
24285 8
24286 }
24287
24288 #[inline(always)]
24289 fn inline_size(_context: fidl::encoding::Context) -> usize {
24290 16
24291 }
24292 }
24293
24294 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseRunner, D>
24295 for &UseRunner
24296 {
24297 unsafe fn encode(
24298 self,
24299 encoder: &mut fidl::encoding::Encoder<'_, D>,
24300 offset: usize,
24301 mut depth: fidl::encoding::Depth,
24302 ) -> fidl::Result<()> {
24303 encoder.debug_check_bounds::<UseRunner>(offset);
24304 let max_ordinal: u64 = self.max_ordinal_present();
24306 encoder.write_num(max_ordinal, offset);
24307 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
24308 if max_ordinal == 0 {
24310 return Ok(());
24311 }
24312 depth.increment()?;
24313 let envelope_size = 8;
24314 let bytes_len = max_ordinal as usize * envelope_size;
24315 #[allow(unused_variables)]
24316 let offset = encoder.out_of_line_offset(bytes_len);
24317 let mut _prev_end_offset: usize = 0;
24318 if 1 > max_ordinal {
24319 return Ok(());
24320 }
24321
24322 let cur_offset: usize = (1 - 1) * envelope_size;
24325
24326 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24328
24329 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
24334 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
24335 encoder,
24336 offset + cur_offset,
24337 depth,
24338 )?;
24339
24340 _prev_end_offset = cur_offset + envelope_size;
24341 if 2 > max_ordinal {
24342 return Ok(());
24343 }
24344
24345 let cur_offset: usize = (2 - 1) * envelope_size;
24348
24349 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24351
24352 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
24357 self.source_name.as_ref().map(
24358 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
24359 ),
24360 encoder,
24361 offset + cur_offset,
24362 depth,
24363 )?;
24364
24365 _prev_end_offset = cur_offset + envelope_size;
24366 if 3 > max_ordinal {
24367 return Ok(());
24368 }
24369
24370 let cur_offset: usize = (3 - 1) * envelope_size;
24373
24374 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24376
24377 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
24382 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
24383 encoder, offset + cur_offset, depth
24384 )?;
24385
24386 _prev_end_offset = cur_offset + envelope_size;
24387
24388 Ok(())
24389 }
24390 }
24391
24392 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseRunner {
24393 #[inline(always)]
24394 fn new_empty() -> Self {
24395 Self::default()
24396 }
24397
24398 unsafe fn decode(
24399 &mut self,
24400 decoder: &mut fidl::encoding::Decoder<'_, D>,
24401 offset: usize,
24402 mut depth: fidl::encoding::Depth,
24403 ) -> fidl::Result<()> {
24404 decoder.debug_check_bounds::<Self>(offset);
24405 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
24406 None => return Err(fidl::Error::NotNullable),
24407 Some(len) => len,
24408 };
24409 if len == 0 {
24411 return Ok(());
24412 };
24413 depth.increment()?;
24414 let envelope_size = 8;
24415 let bytes_len = len * envelope_size;
24416 let offset = decoder.out_of_line_offset(bytes_len)?;
24417 let mut _next_ordinal_to_read = 0;
24419 let mut next_offset = offset;
24420 let end_offset = offset + bytes_len;
24421 _next_ordinal_to_read += 1;
24422 if next_offset >= end_offset {
24423 return Ok(());
24424 }
24425
24426 while _next_ordinal_to_read < 1 {
24428 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24429 _next_ordinal_to_read += 1;
24430 next_offset += envelope_size;
24431 }
24432
24433 let next_out_of_line = decoder.next_out_of_line();
24434 let handles_before = decoder.remaining_handles();
24435 if let Some((inlined, num_bytes, num_handles)) =
24436 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24437 {
24438 let member_inline_size =
24439 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24440 if inlined != (member_inline_size <= 4) {
24441 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24442 }
24443 let inner_offset;
24444 let mut inner_depth = depth.clone();
24445 if inlined {
24446 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24447 inner_offset = next_offset;
24448 } else {
24449 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24450 inner_depth.increment()?;
24451 }
24452 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
24453 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
24454 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24455 {
24456 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24457 }
24458 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24459 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24460 }
24461 }
24462
24463 next_offset += envelope_size;
24464 _next_ordinal_to_read += 1;
24465 if next_offset >= end_offset {
24466 return Ok(());
24467 }
24468
24469 while _next_ordinal_to_read < 2 {
24471 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24472 _next_ordinal_to_read += 1;
24473 next_offset += envelope_size;
24474 }
24475
24476 let next_out_of_line = decoder.next_out_of_line();
24477 let handles_before = decoder.remaining_handles();
24478 if let Some((inlined, num_bytes, num_handles)) =
24479 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24480 {
24481 let member_inline_size =
24482 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
24483 decoder.context,
24484 );
24485 if inlined != (member_inline_size <= 4) {
24486 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24487 }
24488 let inner_offset;
24489 let mut inner_depth = depth.clone();
24490 if inlined {
24491 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24492 inner_offset = next_offset;
24493 } else {
24494 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24495 inner_depth.increment()?;
24496 }
24497 let val_ref = self
24498 .source_name
24499 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
24500 fidl::decode!(
24501 fidl::encoding::BoundedString<100>,
24502 D,
24503 val_ref,
24504 decoder,
24505 inner_offset,
24506 inner_depth
24507 )?;
24508 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24509 {
24510 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24511 }
24512 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24513 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24514 }
24515 }
24516
24517 next_offset += envelope_size;
24518 _next_ordinal_to_read += 1;
24519 if next_offset >= end_offset {
24520 return Ok(());
24521 }
24522
24523 while _next_ordinal_to_read < 3 {
24525 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24526 _next_ordinal_to_read += 1;
24527 next_offset += envelope_size;
24528 }
24529
24530 let next_out_of_line = decoder.next_out_of_line();
24531 let handles_before = decoder.remaining_handles();
24532 if let Some((inlined, num_bytes, num_handles)) =
24533 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24534 {
24535 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24536 if inlined != (member_inline_size <= 4) {
24537 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24538 }
24539 let inner_offset;
24540 let mut inner_depth = depth.clone();
24541 if inlined {
24542 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24543 inner_offset = next_offset;
24544 } else {
24545 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24546 inner_depth.increment()?;
24547 }
24548 let val_ref = self.source_dictionary.get_or_insert_with(|| {
24549 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
24550 });
24551 fidl::decode!(
24552 fidl::encoding::BoundedString<1024>,
24553 D,
24554 val_ref,
24555 decoder,
24556 inner_offset,
24557 inner_depth
24558 )?;
24559 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24560 {
24561 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24562 }
24563 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24564 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24565 }
24566 }
24567
24568 next_offset += envelope_size;
24569
24570 while next_offset < end_offset {
24572 _next_ordinal_to_read += 1;
24573 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24574 next_offset += envelope_size;
24575 }
24576
24577 Ok(())
24578 }
24579 }
24580
24581 impl UseService {
24582 #[inline(always)]
24583 fn max_ordinal_present(&self) -> u64 {
24584 if let Some(_) = self.source_dictionary {
24585 return 6;
24586 }
24587 if let Some(_) = self.availability {
24588 return 5;
24589 }
24590 if let Some(_) = self.dependency_type {
24591 return 4;
24592 }
24593 if let Some(_) = self.target_path {
24594 return 3;
24595 }
24596 if let Some(_) = self.source_name {
24597 return 2;
24598 }
24599 if let Some(_) = self.source {
24600 return 1;
24601 }
24602 0
24603 }
24604 }
24605
24606 impl fidl::encoding::ValueTypeMarker for UseService {
24607 type Borrowed<'a> = &'a Self;
24608 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24609 value
24610 }
24611 }
24612
24613 unsafe impl fidl::encoding::TypeMarker for UseService {
24614 type Owned = Self;
24615
24616 #[inline(always)]
24617 fn inline_align(_context: fidl::encoding::Context) -> usize {
24618 8
24619 }
24620
24621 #[inline(always)]
24622 fn inline_size(_context: fidl::encoding::Context) -> usize {
24623 16
24624 }
24625 }
24626
24627 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseService, D>
24628 for &UseService
24629 {
24630 unsafe fn encode(
24631 self,
24632 encoder: &mut fidl::encoding::Encoder<'_, D>,
24633 offset: usize,
24634 mut depth: fidl::encoding::Depth,
24635 ) -> fidl::Result<()> {
24636 encoder.debug_check_bounds::<UseService>(offset);
24637 let max_ordinal: u64 = self.max_ordinal_present();
24639 encoder.write_num(max_ordinal, offset);
24640 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
24641 if max_ordinal == 0 {
24643 return Ok(());
24644 }
24645 depth.increment()?;
24646 let envelope_size = 8;
24647 let bytes_len = max_ordinal as usize * envelope_size;
24648 #[allow(unused_variables)]
24649 let offset = encoder.out_of_line_offset(bytes_len);
24650 let mut _prev_end_offset: usize = 0;
24651 if 1 > max_ordinal {
24652 return Ok(());
24653 }
24654
24655 let cur_offset: usize = (1 - 1) * envelope_size;
24658
24659 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24661
24662 fidl::encoding::encode_in_envelope_optional::<Ref, D>(
24667 self.source.as_ref().map(<Ref as fidl::encoding::ValueTypeMarker>::borrow),
24668 encoder,
24669 offset + cur_offset,
24670 depth,
24671 )?;
24672
24673 _prev_end_offset = cur_offset + envelope_size;
24674 if 2 > max_ordinal {
24675 return Ok(());
24676 }
24677
24678 let cur_offset: usize = (2 - 1) * envelope_size;
24681
24682 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24684
24685 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
24690 self.source_name.as_ref().map(
24691 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
24692 ),
24693 encoder,
24694 offset + cur_offset,
24695 depth,
24696 )?;
24697
24698 _prev_end_offset = cur_offset + envelope_size;
24699 if 3 > max_ordinal {
24700 return Ok(());
24701 }
24702
24703 let cur_offset: usize = (3 - 1) * envelope_size;
24706
24707 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24709
24710 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
24715 self.target_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
24716 encoder, offset + cur_offset, depth
24717 )?;
24718
24719 _prev_end_offset = cur_offset + envelope_size;
24720 if 4 > max_ordinal {
24721 return Ok(());
24722 }
24723
24724 let cur_offset: usize = (4 - 1) * envelope_size;
24727
24728 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24730
24731 fidl::encoding::encode_in_envelope_optional::<DependencyType, D>(
24736 self.dependency_type
24737 .as_ref()
24738 .map(<DependencyType as fidl::encoding::ValueTypeMarker>::borrow),
24739 encoder,
24740 offset + cur_offset,
24741 depth,
24742 )?;
24743
24744 _prev_end_offset = cur_offset + envelope_size;
24745 if 5 > max_ordinal {
24746 return Ok(());
24747 }
24748
24749 let cur_offset: usize = (5 - 1) * envelope_size;
24752
24753 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24755
24756 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
24761 self.availability
24762 .as_ref()
24763 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
24764 encoder,
24765 offset + cur_offset,
24766 depth,
24767 )?;
24768
24769 _prev_end_offset = cur_offset + envelope_size;
24770 if 6 > max_ordinal {
24771 return Ok(());
24772 }
24773
24774 let cur_offset: usize = (6 - 1) * envelope_size;
24777
24778 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
24780
24781 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
24786 self.source_dictionary.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
24787 encoder, offset + cur_offset, depth
24788 )?;
24789
24790 _prev_end_offset = cur_offset + envelope_size;
24791
24792 Ok(())
24793 }
24794 }
24795
24796 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseService {
24797 #[inline(always)]
24798 fn new_empty() -> Self {
24799 Self::default()
24800 }
24801
24802 unsafe fn decode(
24803 &mut self,
24804 decoder: &mut fidl::encoding::Decoder<'_, D>,
24805 offset: usize,
24806 mut depth: fidl::encoding::Depth,
24807 ) -> fidl::Result<()> {
24808 decoder.debug_check_bounds::<Self>(offset);
24809 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
24810 None => return Err(fidl::Error::NotNullable),
24811 Some(len) => len,
24812 };
24813 if len == 0 {
24815 return Ok(());
24816 };
24817 depth.increment()?;
24818 let envelope_size = 8;
24819 let bytes_len = len * envelope_size;
24820 let offset = decoder.out_of_line_offset(bytes_len)?;
24821 let mut _next_ordinal_to_read = 0;
24823 let mut next_offset = offset;
24824 let end_offset = offset + bytes_len;
24825 _next_ordinal_to_read += 1;
24826 if next_offset >= end_offset {
24827 return Ok(());
24828 }
24829
24830 while _next_ordinal_to_read < 1 {
24832 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24833 _next_ordinal_to_read += 1;
24834 next_offset += envelope_size;
24835 }
24836
24837 let next_out_of_line = decoder.next_out_of_line();
24838 let handles_before = decoder.remaining_handles();
24839 if let Some((inlined, num_bytes, num_handles)) =
24840 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24841 {
24842 let member_inline_size =
24843 <Ref as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24844 if inlined != (member_inline_size <= 4) {
24845 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24846 }
24847 let inner_offset;
24848 let mut inner_depth = depth.clone();
24849 if inlined {
24850 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24851 inner_offset = next_offset;
24852 } else {
24853 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24854 inner_depth.increment()?;
24855 }
24856 let val_ref = self.source.get_or_insert_with(|| fidl::new_empty!(Ref, D));
24857 fidl::decode!(Ref, D, val_ref, decoder, inner_offset, inner_depth)?;
24858 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24859 {
24860 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24861 }
24862 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24863 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24864 }
24865 }
24866
24867 next_offset += envelope_size;
24868 _next_ordinal_to_read += 1;
24869 if next_offset >= end_offset {
24870 return Ok(());
24871 }
24872
24873 while _next_ordinal_to_read < 2 {
24875 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24876 _next_ordinal_to_read += 1;
24877 next_offset += envelope_size;
24878 }
24879
24880 let next_out_of_line = decoder.next_out_of_line();
24881 let handles_before = decoder.remaining_handles();
24882 if let Some((inlined, num_bytes, num_handles)) =
24883 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24884 {
24885 let member_inline_size =
24886 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
24887 decoder.context,
24888 );
24889 if inlined != (member_inline_size <= 4) {
24890 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24891 }
24892 let inner_offset;
24893 let mut inner_depth = depth.clone();
24894 if inlined {
24895 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24896 inner_offset = next_offset;
24897 } else {
24898 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24899 inner_depth.increment()?;
24900 }
24901 let val_ref = self
24902 .source_name
24903 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
24904 fidl::decode!(
24905 fidl::encoding::BoundedString<100>,
24906 D,
24907 val_ref,
24908 decoder,
24909 inner_offset,
24910 inner_depth
24911 )?;
24912 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24913 {
24914 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24915 }
24916 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24917 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24918 }
24919 }
24920
24921 next_offset += envelope_size;
24922 _next_ordinal_to_read += 1;
24923 if next_offset >= end_offset {
24924 return Ok(());
24925 }
24926
24927 while _next_ordinal_to_read < 3 {
24929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24930 _next_ordinal_to_read += 1;
24931 next_offset += envelope_size;
24932 }
24933
24934 let next_out_of_line = decoder.next_out_of_line();
24935 let handles_before = decoder.remaining_handles();
24936 if let Some((inlined, num_bytes, num_handles)) =
24937 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24938 {
24939 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24940 if inlined != (member_inline_size <= 4) {
24941 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24942 }
24943 let inner_offset;
24944 let mut inner_depth = depth.clone();
24945 if inlined {
24946 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24947 inner_offset = next_offset;
24948 } else {
24949 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24950 inner_depth.increment()?;
24951 }
24952 let val_ref = self.target_path.get_or_insert_with(|| {
24953 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
24954 });
24955 fidl::decode!(
24956 fidl::encoding::BoundedString<1024>,
24957 D,
24958 val_ref,
24959 decoder,
24960 inner_offset,
24961 inner_depth
24962 )?;
24963 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
24964 {
24965 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24966 }
24967 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24968 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24969 }
24970 }
24971
24972 next_offset += envelope_size;
24973 _next_ordinal_to_read += 1;
24974 if next_offset >= end_offset {
24975 return Ok(());
24976 }
24977
24978 while _next_ordinal_to_read < 4 {
24980 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
24981 _next_ordinal_to_read += 1;
24982 next_offset += envelope_size;
24983 }
24984
24985 let next_out_of_line = decoder.next_out_of_line();
24986 let handles_before = decoder.remaining_handles();
24987 if let Some((inlined, num_bytes, num_handles)) =
24988 fidl::encoding::decode_envelope_header(decoder, next_offset)?
24989 {
24990 let member_inline_size =
24991 <DependencyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
24992 if inlined != (member_inline_size <= 4) {
24993 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24994 }
24995 let inner_offset;
24996 let mut inner_depth = depth.clone();
24997 if inlined {
24998 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
24999 inner_offset = next_offset;
25000 } else {
25001 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25002 inner_depth.increment()?;
25003 }
25004 let val_ref =
25005 self.dependency_type.get_or_insert_with(|| fidl::new_empty!(DependencyType, D));
25006 fidl::decode!(DependencyType, D, val_ref, decoder, inner_offset, inner_depth)?;
25007 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
25008 {
25009 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25010 }
25011 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25012 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25013 }
25014 }
25015
25016 next_offset += envelope_size;
25017 _next_ordinal_to_read += 1;
25018 if next_offset >= end_offset {
25019 return Ok(());
25020 }
25021
25022 while _next_ordinal_to_read < 5 {
25024 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25025 _next_ordinal_to_read += 1;
25026 next_offset += envelope_size;
25027 }
25028
25029 let next_out_of_line = decoder.next_out_of_line();
25030 let handles_before = decoder.remaining_handles();
25031 if let Some((inlined, num_bytes, num_handles)) =
25032 fidl::encoding::decode_envelope_header(decoder, next_offset)?
25033 {
25034 let member_inline_size =
25035 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
25036 if inlined != (member_inline_size <= 4) {
25037 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25038 }
25039 let inner_offset;
25040 let mut inner_depth = depth.clone();
25041 if inlined {
25042 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
25043 inner_offset = next_offset;
25044 } else {
25045 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25046 inner_depth.increment()?;
25047 }
25048 let val_ref =
25049 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
25050 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
25051 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
25052 {
25053 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25054 }
25055 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25056 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25057 }
25058 }
25059
25060 next_offset += envelope_size;
25061 _next_ordinal_to_read += 1;
25062 if next_offset >= end_offset {
25063 return Ok(());
25064 }
25065
25066 while _next_ordinal_to_read < 6 {
25068 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25069 _next_ordinal_to_read += 1;
25070 next_offset += envelope_size;
25071 }
25072
25073 let next_out_of_line = decoder.next_out_of_line();
25074 let handles_before = decoder.remaining_handles();
25075 if let Some((inlined, num_bytes, num_handles)) =
25076 fidl::encoding::decode_envelope_header(decoder, next_offset)?
25077 {
25078 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
25079 if inlined != (member_inline_size <= 4) {
25080 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25081 }
25082 let inner_offset;
25083 let mut inner_depth = depth.clone();
25084 if inlined {
25085 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
25086 inner_offset = next_offset;
25087 } else {
25088 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25089 inner_depth.increment()?;
25090 }
25091 let val_ref = self.source_dictionary.get_or_insert_with(|| {
25092 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
25093 });
25094 fidl::decode!(
25095 fidl::encoding::BoundedString<1024>,
25096 D,
25097 val_ref,
25098 decoder,
25099 inner_offset,
25100 inner_depth
25101 )?;
25102 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
25103 {
25104 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25105 }
25106 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25107 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25108 }
25109 }
25110
25111 next_offset += envelope_size;
25112
25113 while next_offset < end_offset {
25115 _next_ordinal_to_read += 1;
25116 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25117 next_offset += envelope_size;
25118 }
25119
25120 Ok(())
25121 }
25122 }
25123
25124 impl UseStorage {
25125 #[inline(always)]
25126 fn max_ordinal_present(&self) -> u64 {
25127 if let Some(_) = self.availability {
25128 return 3;
25129 }
25130 if let Some(_) = self.target_path {
25131 return 2;
25132 }
25133 if let Some(_) = self.source_name {
25134 return 1;
25135 }
25136 0
25137 }
25138 }
25139
25140 impl fidl::encoding::ValueTypeMarker for UseStorage {
25141 type Borrowed<'a> = &'a Self;
25142 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25143 value
25144 }
25145 }
25146
25147 unsafe impl fidl::encoding::TypeMarker for UseStorage {
25148 type Owned = Self;
25149
25150 #[inline(always)]
25151 fn inline_align(_context: fidl::encoding::Context) -> usize {
25152 8
25153 }
25154
25155 #[inline(always)]
25156 fn inline_size(_context: fidl::encoding::Context) -> usize {
25157 16
25158 }
25159 }
25160
25161 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UseStorage, D>
25162 for &UseStorage
25163 {
25164 unsafe fn encode(
25165 self,
25166 encoder: &mut fidl::encoding::Encoder<'_, D>,
25167 offset: usize,
25168 mut depth: fidl::encoding::Depth,
25169 ) -> fidl::Result<()> {
25170 encoder.debug_check_bounds::<UseStorage>(offset);
25171 let max_ordinal: u64 = self.max_ordinal_present();
25173 encoder.write_num(max_ordinal, offset);
25174 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
25175 if max_ordinal == 0 {
25177 return Ok(());
25178 }
25179 depth.increment()?;
25180 let envelope_size = 8;
25181 let bytes_len = max_ordinal as usize * envelope_size;
25182 #[allow(unused_variables)]
25183 let offset = encoder.out_of_line_offset(bytes_len);
25184 let mut _prev_end_offset: usize = 0;
25185 if 1 > max_ordinal {
25186 return Ok(());
25187 }
25188
25189 let cur_offset: usize = (1 - 1) * envelope_size;
25192
25193 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
25195
25196 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
25201 self.source_name.as_ref().map(
25202 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
25203 ),
25204 encoder,
25205 offset + cur_offset,
25206 depth,
25207 )?;
25208
25209 _prev_end_offset = cur_offset + envelope_size;
25210 if 2 > max_ordinal {
25211 return Ok(());
25212 }
25213
25214 let cur_offset: usize = (2 - 1) * envelope_size;
25217
25218 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
25220
25221 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
25226 self.target_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
25227 encoder, offset + cur_offset, depth
25228 )?;
25229
25230 _prev_end_offset = cur_offset + envelope_size;
25231 if 3 > max_ordinal {
25232 return Ok(());
25233 }
25234
25235 let cur_offset: usize = (3 - 1) * envelope_size;
25238
25239 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
25241
25242 fidl::encoding::encode_in_envelope_optional::<Availability, D>(
25247 self.availability
25248 .as_ref()
25249 .map(<Availability as fidl::encoding::ValueTypeMarker>::borrow),
25250 encoder,
25251 offset + cur_offset,
25252 depth,
25253 )?;
25254
25255 _prev_end_offset = cur_offset + envelope_size;
25256
25257 Ok(())
25258 }
25259 }
25260
25261 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UseStorage {
25262 #[inline(always)]
25263 fn new_empty() -> Self {
25264 Self::default()
25265 }
25266
25267 unsafe fn decode(
25268 &mut self,
25269 decoder: &mut fidl::encoding::Decoder<'_, D>,
25270 offset: usize,
25271 mut depth: fidl::encoding::Depth,
25272 ) -> fidl::Result<()> {
25273 decoder.debug_check_bounds::<Self>(offset);
25274 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
25275 None => return Err(fidl::Error::NotNullable),
25276 Some(len) => len,
25277 };
25278 if len == 0 {
25280 return Ok(());
25281 };
25282 depth.increment()?;
25283 let envelope_size = 8;
25284 let bytes_len = len * envelope_size;
25285 let offset = decoder.out_of_line_offset(bytes_len)?;
25286 let mut _next_ordinal_to_read = 0;
25288 let mut next_offset = offset;
25289 let end_offset = offset + bytes_len;
25290 _next_ordinal_to_read += 1;
25291 if next_offset >= end_offset {
25292 return Ok(());
25293 }
25294
25295 while _next_ordinal_to_read < 1 {
25297 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25298 _next_ordinal_to_read += 1;
25299 next_offset += envelope_size;
25300 }
25301
25302 let next_out_of_line = decoder.next_out_of_line();
25303 let handles_before = decoder.remaining_handles();
25304 if let Some((inlined, num_bytes, num_handles)) =
25305 fidl::encoding::decode_envelope_header(decoder, next_offset)?
25306 {
25307 let member_inline_size =
25308 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
25309 decoder.context,
25310 );
25311 if inlined != (member_inline_size <= 4) {
25312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25313 }
25314 let inner_offset;
25315 let mut inner_depth = depth.clone();
25316 if inlined {
25317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
25318 inner_offset = next_offset;
25319 } else {
25320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25321 inner_depth.increment()?;
25322 }
25323 let val_ref = self
25324 .source_name
25325 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
25326 fidl::decode!(
25327 fidl::encoding::BoundedString<100>,
25328 D,
25329 val_ref,
25330 decoder,
25331 inner_offset,
25332 inner_depth
25333 )?;
25334 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
25335 {
25336 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25337 }
25338 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25339 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25340 }
25341 }
25342
25343 next_offset += envelope_size;
25344 _next_ordinal_to_read += 1;
25345 if next_offset >= end_offset {
25346 return Ok(());
25347 }
25348
25349 while _next_ordinal_to_read < 2 {
25351 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25352 _next_ordinal_to_read += 1;
25353 next_offset += envelope_size;
25354 }
25355
25356 let next_out_of_line = decoder.next_out_of_line();
25357 let handles_before = decoder.remaining_handles();
25358 if let Some((inlined, num_bytes, num_handles)) =
25359 fidl::encoding::decode_envelope_header(decoder, next_offset)?
25360 {
25361 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
25362 if inlined != (member_inline_size <= 4) {
25363 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25364 }
25365 let inner_offset;
25366 let mut inner_depth = depth.clone();
25367 if inlined {
25368 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
25369 inner_offset = next_offset;
25370 } else {
25371 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25372 inner_depth.increment()?;
25373 }
25374 let val_ref = self.target_path.get_or_insert_with(|| {
25375 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
25376 });
25377 fidl::decode!(
25378 fidl::encoding::BoundedString<1024>,
25379 D,
25380 val_ref,
25381 decoder,
25382 inner_offset,
25383 inner_depth
25384 )?;
25385 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
25386 {
25387 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25388 }
25389 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25390 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25391 }
25392 }
25393
25394 next_offset += envelope_size;
25395 _next_ordinal_to_read += 1;
25396 if next_offset >= end_offset {
25397 return Ok(());
25398 }
25399
25400 while _next_ordinal_to_read < 3 {
25402 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25403 _next_ordinal_to_read += 1;
25404 next_offset += envelope_size;
25405 }
25406
25407 let next_out_of_line = decoder.next_out_of_line();
25408 let handles_before = decoder.remaining_handles();
25409 if let Some((inlined, num_bytes, num_handles)) =
25410 fidl::encoding::decode_envelope_header(decoder, next_offset)?
25411 {
25412 let member_inline_size =
25413 <Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
25414 if inlined != (member_inline_size <= 4) {
25415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25416 }
25417 let inner_offset;
25418 let mut inner_depth = depth.clone();
25419 if inlined {
25420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
25421 inner_offset = next_offset;
25422 } else {
25423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25424 inner_depth.increment()?;
25425 }
25426 let val_ref =
25427 self.availability.get_or_insert_with(|| fidl::new_empty!(Availability, D));
25428 fidl::decode!(Availability, D, val_ref, decoder, inner_offset, inner_depth)?;
25429 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
25430 {
25431 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25432 }
25433 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25434 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25435 }
25436 }
25437
25438 next_offset += envelope_size;
25439
25440 while next_offset < end_offset {
25442 _next_ordinal_to_read += 1;
25443 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
25444 next_offset += envelope_size;
25445 }
25446
25447 Ok(())
25448 }
25449 }
25450
25451 impl fidl::encoding::ValueTypeMarker for Capability {
25452 type Borrowed<'a> = &'a Self;
25453 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25454 value
25455 }
25456 }
25457
25458 unsafe impl fidl::encoding::TypeMarker for Capability {
25459 type Owned = Self;
25460
25461 #[inline(always)]
25462 fn inline_align(_context: fidl::encoding::Context) -> usize {
25463 8
25464 }
25465
25466 #[inline(always)]
25467 fn inline_size(_context: fidl::encoding::Context) -> usize {
25468 16
25469 }
25470 }
25471
25472 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Capability, D>
25473 for &Capability
25474 {
25475 #[inline]
25476 unsafe fn encode(
25477 self,
25478 encoder: &mut fidl::encoding::Encoder<'_, D>,
25479 offset: usize,
25480 _depth: fidl::encoding::Depth,
25481 ) -> fidl::Result<()> {
25482 encoder.debug_check_bounds::<Capability>(offset);
25483 encoder.write_num::<u64>(self.ordinal(), offset);
25484 match self {
25485 Capability::Service(ref val) => fidl::encoding::encode_in_envelope::<Service, D>(
25486 <Service as fidl::encoding::ValueTypeMarker>::borrow(val),
25487 encoder,
25488 offset + 8,
25489 _depth,
25490 ),
25491 Capability::Protocol(ref val) => fidl::encoding::encode_in_envelope::<Protocol, D>(
25492 <Protocol as fidl::encoding::ValueTypeMarker>::borrow(val),
25493 encoder,
25494 offset + 8,
25495 _depth,
25496 ),
25497 Capability::Directory(ref val) => {
25498 fidl::encoding::encode_in_envelope::<Directory, D>(
25499 <Directory as fidl::encoding::ValueTypeMarker>::borrow(val),
25500 encoder,
25501 offset + 8,
25502 _depth,
25503 )
25504 }
25505 Capability::Storage(ref val) => fidl::encoding::encode_in_envelope::<Storage, D>(
25506 <Storage as fidl::encoding::ValueTypeMarker>::borrow(val),
25507 encoder,
25508 offset + 8,
25509 _depth,
25510 ),
25511 Capability::Runner(ref val) => fidl::encoding::encode_in_envelope::<Runner, D>(
25512 <Runner as fidl::encoding::ValueTypeMarker>::borrow(val),
25513 encoder,
25514 offset + 8,
25515 _depth,
25516 ),
25517 Capability::Resolver(ref val) => fidl::encoding::encode_in_envelope::<Resolver, D>(
25518 <Resolver as fidl::encoding::ValueTypeMarker>::borrow(val),
25519 encoder,
25520 offset + 8,
25521 _depth,
25522 ),
25523 Capability::EventStream(ref val) => {
25524 fidl::encoding::encode_in_envelope::<EventStream, D>(
25525 <EventStream as fidl::encoding::ValueTypeMarker>::borrow(val),
25526 encoder,
25527 offset + 8,
25528 _depth,
25529 )
25530 }
25531 Capability::Dictionary(ref val) => {
25532 fidl::encoding::encode_in_envelope::<Dictionary, D>(
25533 <Dictionary as fidl::encoding::ValueTypeMarker>::borrow(val),
25534 encoder,
25535 offset + 8,
25536 _depth,
25537 )
25538 }
25539 Capability::Config(ref val) => {
25540 fidl::encoding::encode_in_envelope::<Configuration, D>(
25541 <Configuration as fidl::encoding::ValueTypeMarker>::borrow(val),
25542 encoder,
25543 offset + 8,
25544 _depth,
25545 )
25546 }
25547 Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
25548 }
25549 }
25550 }
25551
25552 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
25553 #[inline(always)]
25554 fn new_empty() -> Self {
25555 Self::__SourceBreaking { unknown_ordinal: 0 }
25556 }
25557
25558 #[inline]
25559 unsafe fn decode(
25560 &mut self,
25561 decoder: &mut fidl::encoding::Decoder<'_, D>,
25562 offset: usize,
25563 mut depth: fidl::encoding::Depth,
25564 ) -> fidl::Result<()> {
25565 decoder.debug_check_bounds::<Self>(offset);
25566 #[allow(unused_variables)]
25567 let next_out_of_line = decoder.next_out_of_line();
25568 let handles_before = decoder.remaining_handles();
25569 let (ordinal, inlined, num_bytes, num_handles) =
25570 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25571
25572 let member_inline_size = match ordinal {
25573 1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25574 2 => <Protocol as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25575 3 => <Directory as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25576 4 => <Storage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25577 5 => <Runner as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25578 6 => <Resolver as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25579 8 => <EventStream as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25580 9 => <Dictionary as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25581 10 => <Configuration as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25582 0 => return Err(fidl::Error::UnknownUnionTag),
25583 _ => num_bytes as usize,
25584 };
25585
25586 if inlined != (member_inline_size <= 4) {
25587 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25588 }
25589 let _inner_offset;
25590 if inlined {
25591 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25592 _inner_offset = offset + 8;
25593 } else {
25594 depth.increment()?;
25595 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25596 }
25597 match ordinal {
25598 1 => {
25599 #[allow(irrefutable_let_patterns)]
25600 if let Capability::Service(_) = self {
25601 } else {
25603 *self = Capability::Service(fidl::new_empty!(Service, D));
25605 }
25606 #[allow(irrefutable_let_patterns)]
25607 if let Capability::Service(ref mut val) = self {
25608 fidl::decode!(Service, D, val, decoder, _inner_offset, depth)?;
25609 } else {
25610 unreachable!()
25611 }
25612 }
25613 2 => {
25614 #[allow(irrefutable_let_patterns)]
25615 if let Capability::Protocol(_) = self {
25616 } else {
25618 *self = Capability::Protocol(fidl::new_empty!(Protocol, D));
25620 }
25621 #[allow(irrefutable_let_patterns)]
25622 if let Capability::Protocol(ref mut val) = self {
25623 fidl::decode!(Protocol, D, val, decoder, _inner_offset, depth)?;
25624 } else {
25625 unreachable!()
25626 }
25627 }
25628 3 => {
25629 #[allow(irrefutable_let_patterns)]
25630 if let Capability::Directory(_) = self {
25631 } else {
25633 *self = Capability::Directory(fidl::new_empty!(Directory, D));
25635 }
25636 #[allow(irrefutable_let_patterns)]
25637 if let Capability::Directory(ref mut val) = self {
25638 fidl::decode!(Directory, D, val, decoder, _inner_offset, depth)?;
25639 } else {
25640 unreachable!()
25641 }
25642 }
25643 4 => {
25644 #[allow(irrefutable_let_patterns)]
25645 if let Capability::Storage(_) = self {
25646 } else {
25648 *self = Capability::Storage(fidl::new_empty!(Storage, D));
25650 }
25651 #[allow(irrefutable_let_patterns)]
25652 if let Capability::Storage(ref mut val) = self {
25653 fidl::decode!(Storage, D, val, decoder, _inner_offset, depth)?;
25654 } else {
25655 unreachable!()
25656 }
25657 }
25658 5 => {
25659 #[allow(irrefutable_let_patterns)]
25660 if let Capability::Runner(_) = self {
25661 } else {
25663 *self = Capability::Runner(fidl::new_empty!(Runner, D));
25665 }
25666 #[allow(irrefutable_let_patterns)]
25667 if let Capability::Runner(ref mut val) = self {
25668 fidl::decode!(Runner, D, val, decoder, _inner_offset, depth)?;
25669 } else {
25670 unreachable!()
25671 }
25672 }
25673 6 => {
25674 #[allow(irrefutable_let_patterns)]
25675 if let Capability::Resolver(_) = self {
25676 } else {
25678 *self = Capability::Resolver(fidl::new_empty!(Resolver, D));
25680 }
25681 #[allow(irrefutable_let_patterns)]
25682 if let Capability::Resolver(ref mut val) = self {
25683 fidl::decode!(Resolver, D, val, decoder, _inner_offset, depth)?;
25684 } else {
25685 unreachable!()
25686 }
25687 }
25688 8 => {
25689 #[allow(irrefutable_let_patterns)]
25690 if let Capability::EventStream(_) = self {
25691 } else {
25693 *self = Capability::EventStream(fidl::new_empty!(EventStream, D));
25695 }
25696 #[allow(irrefutable_let_patterns)]
25697 if let Capability::EventStream(ref mut val) = self {
25698 fidl::decode!(EventStream, D, val, decoder, _inner_offset, depth)?;
25699 } else {
25700 unreachable!()
25701 }
25702 }
25703 9 => {
25704 #[allow(irrefutable_let_patterns)]
25705 if let Capability::Dictionary(_) = self {
25706 } else {
25708 *self = Capability::Dictionary(fidl::new_empty!(Dictionary, D));
25710 }
25711 #[allow(irrefutable_let_patterns)]
25712 if let Capability::Dictionary(ref mut val) = self {
25713 fidl::decode!(Dictionary, D, val, decoder, _inner_offset, depth)?;
25714 } else {
25715 unreachable!()
25716 }
25717 }
25718 10 => {
25719 #[allow(irrefutable_let_patterns)]
25720 if let Capability::Config(_) = self {
25721 } else {
25723 *self = Capability::Config(fidl::new_empty!(Configuration, D));
25725 }
25726 #[allow(irrefutable_let_patterns)]
25727 if let Capability::Config(ref mut val) = self {
25728 fidl::decode!(Configuration, D, val, decoder, _inner_offset, depth)?;
25729 } else {
25730 unreachable!()
25731 }
25732 }
25733 #[allow(deprecated)]
25734 ordinal => {
25735 for _ in 0..num_handles {
25736 decoder.drop_next_handle()?;
25737 }
25738 *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
25739 }
25740 }
25741 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25742 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25743 }
25744 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25745 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25746 }
25747 Ok(())
25748 }
25749 }
25750
25751 impl fidl::encoding::ValueTypeMarker for ConfigChecksum {
25752 type Borrowed<'a> = &'a Self;
25753 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25754 value
25755 }
25756 }
25757
25758 unsafe impl fidl::encoding::TypeMarker for ConfigChecksum {
25759 type Owned = Self;
25760
25761 #[inline(always)]
25762 fn inline_align(_context: fidl::encoding::Context) -> usize {
25763 8
25764 }
25765
25766 #[inline(always)]
25767 fn inline_size(_context: fidl::encoding::Context) -> usize {
25768 16
25769 }
25770 }
25771
25772 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigChecksum, D>
25773 for &ConfigChecksum
25774 {
25775 #[inline]
25776 unsafe fn encode(
25777 self,
25778 encoder: &mut fidl::encoding::Encoder<'_, D>,
25779 offset: usize,
25780 _depth: fidl::encoding::Depth,
25781 ) -> fidl::Result<()> {
25782 encoder.debug_check_bounds::<ConfigChecksum>(offset);
25783 encoder.write_num::<u64>(self.ordinal(), offset);
25784 match self {
25785 ConfigChecksum::Sha256(ref val) => fidl::encoding::encode_in_envelope::<
25786 fidl::encoding::Array<u8, 32>,
25787 D,
25788 >(
25789 <fidl::encoding::Array<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(val),
25790 encoder,
25791 offset + 8,
25792 _depth,
25793 ),
25794 ConfigChecksum::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
25795 }
25796 }
25797 }
25798
25799 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigChecksum {
25800 #[inline(always)]
25801 fn new_empty() -> Self {
25802 Self::__SourceBreaking { unknown_ordinal: 0 }
25803 }
25804
25805 #[inline]
25806 unsafe fn decode(
25807 &mut self,
25808 decoder: &mut fidl::encoding::Decoder<'_, D>,
25809 offset: usize,
25810 mut depth: fidl::encoding::Depth,
25811 ) -> fidl::Result<()> {
25812 decoder.debug_check_bounds::<Self>(offset);
25813 #[allow(unused_variables)]
25814 let next_out_of_line = decoder.next_out_of_line();
25815 let handles_before = decoder.remaining_handles();
25816 let (ordinal, inlined, num_bytes, num_handles) =
25817 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25818
25819 let member_inline_size = match ordinal {
25820 1 => <fidl::encoding::Array<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
25821 decoder.context,
25822 ),
25823 0 => return Err(fidl::Error::UnknownUnionTag),
25824 _ => num_bytes as usize,
25825 };
25826
25827 if inlined != (member_inline_size <= 4) {
25828 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25829 }
25830 let _inner_offset;
25831 if inlined {
25832 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25833 _inner_offset = offset + 8;
25834 } else {
25835 depth.increment()?;
25836 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25837 }
25838 match ordinal {
25839 1 => {
25840 #[allow(irrefutable_let_patterns)]
25841 if let ConfigChecksum::Sha256(_) = self {
25842 } else {
25844 *self = ConfigChecksum::Sha256(
25846 fidl::new_empty!(fidl::encoding::Array<u8, 32>, D),
25847 );
25848 }
25849 #[allow(irrefutable_let_patterns)]
25850 if let ConfigChecksum::Sha256(ref mut val) = self {
25851 fidl::decode!(fidl::encoding::Array<u8, 32>, D, val, decoder, _inner_offset, depth)?;
25852 } else {
25853 unreachable!()
25854 }
25855 }
25856 #[allow(deprecated)]
25857 ordinal => {
25858 for _ in 0..num_handles {
25859 decoder.drop_next_handle()?;
25860 }
25861 *self = ConfigChecksum::__SourceBreaking { unknown_ordinal: ordinal };
25862 }
25863 }
25864 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25865 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25866 }
25867 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25868 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25869 }
25870 Ok(())
25871 }
25872 }
25873
25874 impl fidl::encoding::ValueTypeMarker for ConfigSingleValue {
25875 type Borrowed<'a> = &'a Self;
25876 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25877 value
25878 }
25879 }
25880
25881 unsafe impl fidl::encoding::TypeMarker for ConfigSingleValue {
25882 type Owned = Self;
25883
25884 #[inline(always)]
25885 fn inline_align(_context: fidl::encoding::Context) -> usize {
25886 8
25887 }
25888
25889 #[inline(always)]
25890 fn inline_size(_context: fidl::encoding::Context) -> usize {
25891 16
25892 }
25893 }
25894
25895 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigSingleValue, D>
25896 for &ConfigSingleValue
25897 {
25898 #[inline]
25899 unsafe fn encode(
25900 self,
25901 encoder: &mut fidl::encoding::Encoder<'_, D>,
25902 offset: usize,
25903 _depth: fidl::encoding::Depth,
25904 ) -> fidl::Result<()> {
25905 encoder.debug_check_bounds::<ConfigSingleValue>(offset);
25906 encoder.write_num::<u64>(self.ordinal(), offset);
25907 match self {
25908 ConfigSingleValue::Bool(ref val) => fidl::encoding::encode_in_envelope::<bool, D>(
25909 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
25910 encoder,
25911 offset + 8,
25912 _depth,
25913 ),
25914 ConfigSingleValue::Uint8(ref val) => fidl::encoding::encode_in_envelope::<u8, D>(
25915 <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
25916 encoder,
25917 offset + 8,
25918 _depth,
25919 ),
25920 ConfigSingleValue::Uint16(ref val) => fidl::encoding::encode_in_envelope::<u16, D>(
25921 <u16 as fidl::encoding::ValueTypeMarker>::borrow(val),
25922 encoder,
25923 offset + 8,
25924 _depth,
25925 ),
25926 ConfigSingleValue::Uint32(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
25927 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
25928 encoder,
25929 offset + 8,
25930 _depth,
25931 ),
25932 ConfigSingleValue::Uint64(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
25933 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
25934 encoder,
25935 offset + 8,
25936 _depth,
25937 ),
25938 ConfigSingleValue::Int8(ref val) => fidl::encoding::encode_in_envelope::<i8, D>(
25939 <i8 as fidl::encoding::ValueTypeMarker>::borrow(val),
25940 encoder,
25941 offset + 8,
25942 _depth,
25943 ),
25944 ConfigSingleValue::Int16(ref val) => fidl::encoding::encode_in_envelope::<i16, D>(
25945 <i16 as fidl::encoding::ValueTypeMarker>::borrow(val),
25946 encoder,
25947 offset + 8,
25948 _depth,
25949 ),
25950 ConfigSingleValue::Int32(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
25951 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
25952 encoder,
25953 offset + 8,
25954 _depth,
25955 ),
25956 ConfigSingleValue::Int64(ref val) => fidl::encoding::encode_in_envelope::<i64, D>(
25957 <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
25958 encoder,
25959 offset + 8,
25960 _depth,
25961 ),
25962 ConfigSingleValue::String(ref val) => fidl::encoding::encode_in_envelope::<
25963 fidl::encoding::UnboundedString,
25964 D,
25965 >(
25966 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
25967 val,
25968 ),
25969 encoder,
25970 offset + 8,
25971 _depth,
25972 ),
25973 ConfigSingleValue::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
25974 }
25975 }
25976 }
25977
25978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigSingleValue {
25979 #[inline(always)]
25980 fn new_empty() -> Self {
25981 Self::__SourceBreaking { unknown_ordinal: 0 }
25982 }
25983
25984 #[inline]
25985 unsafe fn decode(
25986 &mut self,
25987 decoder: &mut fidl::encoding::Decoder<'_, D>,
25988 offset: usize,
25989 mut depth: fidl::encoding::Depth,
25990 ) -> fidl::Result<()> {
25991 decoder.debug_check_bounds::<Self>(offset);
25992 #[allow(unused_variables)]
25993 let next_out_of_line = decoder.next_out_of_line();
25994 let handles_before = decoder.remaining_handles();
25995 let (ordinal, inlined, num_bytes, num_handles) =
25996 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25997
25998 let member_inline_size = match ordinal {
25999 1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26000 2 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26001 3 => <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26002 4 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26003 5 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26004 6 => <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26005 7 => <i16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26006 8 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26007 9 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26008 10 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
26009 decoder.context,
26010 ),
26011 0 => return Err(fidl::Error::UnknownUnionTag),
26012 _ => num_bytes as usize,
26013 };
26014
26015 if inlined != (member_inline_size <= 4) {
26016 return Err(fidl::Error::InvalidInlineBitInEnvelope);
26017 }
26018 let _inner_offset;
26019 if inlined {
26020 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
26021 _inner_offset = offset + 8;
26022 } else {
26023 depth.increment()?;
26024 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
26025 }
26026 match ordinal {
26027 1 => {
26028 #[allow(irrefutable_let_patterns)]
26029 if let ConfigSingleValue::Bool(_) = self {
26030 } else {
26032 *self = ConfigSingleValue::Bool(fidl::new_empty!(bool, D));
26034 }
26035 #[allow(irrefutable_let_patterns)]
26036 if let ConfigSingleValue::Bool(ref mut val) = self {
26037 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
26038 } else {
26039 unreachable!()
26040 }
26041 }
26042 2 => {
26043 #[allow(irrefutable_let_patterns)]
26044 if let ConfigSingleValue::Uint8(_) = self {
26045 } else {
26047 *self = ConfigSingleValue::Uint8(fidl::new_empty!(u8, D));
26049 }
26050 #[allow(irrefutable_let_patterns)]
26051 if let ConfigSingleValue::Uint8(ref mut val) = self {
26052 fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
26053 } else {
26054 unreachable!()
26055 }
26056 }
26057 3 => {
26058 #[allow(irrefutable_let_patterns)]
26059 if let ConfigSingleValue::Uint16(_) = self {
26060 } else {
26062 *self = ConfigSingleValue::Uint16(fidl::new_empty!(u16, D));
26064 }
26065 #[allow(irrefutable_let_patterns)]
26066 if let ConfigSingleValue::Uint16(ref mut val) = self {
26067 fidl::decode!(u16, D, val, decoder, _inner_offset, depth)?;
26068 } else {
26069 unreachable!()
26070 }
26071 }
26072 4 => {
26073 #[allow(irrefutable_let_patterns)]
26074 if let ConfigSingleValue::Uint32(_) = self {
26075 } else {
26077 *self = ConfigSingleValue::Uint32(fidl::new_empty!(u32, D));
26079 }
26080 #[allow(irrefutable_let_patterns)]
26081 if let ConfigSingleValue::Uint32(ref mut val) = self {
26082 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
26083 } else {
26084 unreachable!()
26085 }
26086 }
26087 5 => {
26088 #[allow(irrefutable_let_patterns)]
26089 if let ConfigSingleValue::Uint64(_) = self {
26090 } else {
26092 *self = ConfigSingleValue::Uint64(fidl::new_empty!(u64, D));
26094 }
26095 #[allow(irrefutable_let_patterns)]
26096 if let ConfigSingleValue::Uint64(ref mut val) = self {
26097 fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
26098 } else {
26099 unreachable!()
26100 }
26101 }
26102 6 => {
26103 #[allow(irrefutable_let_patterns)]
26104 if let ConfigSingleValue::Int8(_) = self {
26105 } else {
26107 *self = ConfigSingleValue::Int8(fidl::new_empty!(i8, D));
26109 }
26110 #[allow(irrefutable_let_patterns)]
26111 if let ConfigSingleValue::Int8(ref mut val) = self {
26112 fidl::decode!(i8, D, val, decoder, _inner_offset, depth)?;
26113 } else {
26114 unreachable!()
26115 }
26116 }
26117 7 => {
26118 #[allow(irrefutable_let_patterns)]
26119 if let ConfigSingleValue::Int16(_) = self {
26120 } else {
26122 *self = ConfigSingleValue::Int16(fidl::new_empty!(i16, D));
26124 }
26125 #[allow(irrefutable_let_patterns)]
26126 if let ConfigSingleValue::Int16(ref mut val) = self {
26127 fidl::decode!(i16, D, val, decoder, _inner_offset, depth)?;
26128 } else {
26129 unreachable!()
26130 }
26131 }
26132 8 => {
26133 #[allow(irrefutable_let_patterns)]
26134 if let ConfigSingleValue::Int32(_) = self {
26135 } else {
26137 *self = ConfigSingleValue::Int32(fidl::new_empty!(i32, D));
26139 }
26140 #[allow(irrefutable_let_patterns)]
26141 if let ConfigSingleValue::Int32(ref mut val) = self {
26142 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
26143 } else {
26144 unreachable!()
26145 }
26146 }
26147 9 => {
26148 #[allow(irrefutable_let_patterns)]
26149 if let ConfigSingleValue::Int64(_) = self {
26150 } else {
26152 *self = ConfigSingleValue::Int64(fidl::new_empty!(i64, D));
26154 }
26155 #[allow(irrefutable_let_patterns)]
26156 if let ConfigSingleValue::Int64(ref mut val) = self {
26157 fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
26158 } else {
26159 unreachable!()
26160 }
26161 }
26162 10 => {
26163 #[allow(irrefutable_let_patterns)]
26164 if let ConfigSingleValue::String(_) = self {
26165 } else {
26167 *self = ConfigSingleValue::String(fidl::new_empty!(
26169 fidl::encoding::UnboundedString,
26170 D
26171 ));
26172 }
26173 #[allow(irrefutable_let_patterns)]
26174 if let ConfigSingleValue::String(ref mut val) = self {
26175 fidl::decode!(
26176 fidl::encoding::UnboundedString,
26177 D,
26178 val,
26179 decoder,
26180 _inner_offset,
26181 depth
26182 )?;
26183 } else {
26184 unreachable!()
26185 }
26186 }
26187 #[allow(deprecated)]
26188 ordinal => {
26189 for _ in 0..num_handles {
26190 decoder.drop_next_handle()?;
26191 }
26192 *self = ConfigSingleValue::__SourceBreaking { unknown_ordinal: ordinal };
26193 }
26194 }
26195 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
26196 return Err(fidl::Error::InvalidNumBytesInEnvelope);
26197 }
26198 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
26199 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
26200 }
26201 Ok(())
26202 }
26203 }
26204
26205 impl fidl::encoding::ValueTypeMarker for ConfigValue {
26206 type Borrowed<'a> = &'a Self;
26207 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
26208 value
26209 }
26210 }
26211
26212 unsafe impl fidl::encoding::TypeMarker for ConfigValue {
26213 type Owned = Self;
26214
26215 #[inline(always)]
26216 fn inline_align(_context: fidl::encoding::Context) -> usize {
26217 8
26218 }
26219
26220 #[inline(always)]
26221 fn inline_size(_context: fidl::encoding::Context) -> usize {
26222 16
26223 }
26224 }
26225
26226 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigValue, D>
26227 for &ConfigValue
26228 {
26229 #[inline]
26230 unsafe fn encode(
26231 self,
26232 encoder: &mut fidl::encoding::Encoder<'_, D>,
26233 offset: usize,
26234 _depth: fidl::encoding::Depth,
26235 ) -> fidl::Result<()> {
26236 encoder.debug_check_bounds::<ConfigValue>(offset);
26237 encoder.write_num::<u64>(self.ordinal(), offset);
26238 match self {
26239 ConfigValue::Single(ref val) => {
26240 fidl::encoding::encode_in_envelope::<ConfigSingleValue, D>(
26241 <ConfigSingleValue as fidl::encoding::ValueTypeMarker>::borrow(val),
26242 encoder,
26243 offset + 8,
26244 _depth,
26245 )
26246 }
26247 ConfigValue::Vector(ref val) => {
26248 fidl::encoding::encode_in_envelope::<ConfigVectorValue, D>(
26249 <ConfigVectorValue as fidl::encoding::ValueTypeMarker>::borrow(val),
26250 encoder,
26251 offset + 8,
26252 _depth,
26253 )
26254 }
26255 ConfigValue::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
26256 }
26257 }
26258 }
26259
26260 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigValue {
26261 #[inline(always)]
26262 fn new_empty() -> Self {
26263 Self::__SourceBreaking { unknown_ordinal: 0 }
26264 }
26265
26266 #[inline]
26267 unsafe fn decode(
26268 &mut self,
26269 decoder: &mut fidl::encoding::Decoder<'_, D>,
26270 offset: usize,
26271 mut depth: fidl::encoding::Depth,
26272 ) -> fidl::Result<()> {
26273 decoder.debug_check_bounds::<Self>(offset);
26274 #[allow(unused_variables)]
26275 let next_out_of_line = decoder.next_out_of_line();
26276 let handles_before = decoder.remaining_handles();
26277 let (ordinal, inlined, num_bytes, num_handles) =
26278 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
26279
26280 let member_inline_size = match ordinal {
26281 1 => {
26282 <ConfigSingleValue as fidl::encoding::TypeMarker>::inline_size(decoder.context)
26283 }
26284 2 => {
26285 <ConfigVectorValue as fidl::encoding::TypeMarker>::inline_size(decoder.context)
26286 }
26287 0 => return Err(fidl::Error::UnknownUnionTag),
26288 _ => num_bytes as usize,
26289 };
26290
26291 if inlined != (member_inline_size <= 4) {
26292 return Err(fidl::Error::InvalidInlineBitInEnvelope);
26293 }
26294 let _inner_offset;
26295 if inlined {
26296 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
26297 _inner_offset = offset + 8;
26298 } else {
26299 depth.increment()?;
26300 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
26301 }
26302 match ordinal {
26303 1 => {
26304 #[allow(irrefutable_let_patterns)]
26305 if let ConfigValue::Single(_) = self {
26306 } else {
26308 *self = ConfigValue::Single(fidl::new_empty!(ConfigSingleValue, D));
26310 }
26311 #[allow(irrefutable_let_patterns)]
26312 if let ConfigValue::Single(ref mut val) = self {
26313 fidl::decode!(ConfigSingleValue, D, val, decoder, _inner_offset, depth)?;
26314 } else {
26315 unreachable!()
26316 }
26317 }
26318 2 => {
26319 #[allow(irrefutable_let_patterns)]
26320 if let ConfigValue::Vector(_) = self {
26321 } else {
26323 *self = ConfigValue::Vector(fidl::new_empty!(ConfigVectorValue, D));
26325 }
26326 #[allow(irrefutable_let_patterns)]
26327 if let ConfigValue::Vector(ref mut val) = self {
26328 fidl::decode!(ConfigVectorValue, D, val, decoder, _inner_offset, depth)?;
26329 } else {
26330 unreachable!()
26331 }
26332 }
26333 #[allow(deprecated)]
26334 ordinal => {
26335 for _ in 0..num_handles {
26336 decoder.drop_next_handle()?;
26337 }
26338 *self = ConfigValue::__SourceBreaking { unknown_ordinal: ordinal };
26339 }
26340 }
26341 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
26342 return Err(fidl::Error::InvalidNumBytesInEnvelope);
26343 }
26344 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
26345 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
26346 }
26347 Ok(())
26348 }
26349 }
26350
26351 impl fidl::encoding::ValueTypeMarker for ConfigValueSource {
26352 type Borrowed<'a> = &'a Self;
26353 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
26354 value
26355 }
26356 }
26357
26358 unsafe impl fidl::encoding::TypeMarker for ConfigValueSource {
26359 type Owned = Self;
26360
26361 #[inline(always)]
26362 fn inline_align(_context: fidl::encoding::Context) -> usize {
26363 8
26364 }
26365
26366 #[inline(always)]
26367 fn inline_size(_context: fidl::encoding::Context) -> usize {
26368 16
26369 }
26370 }
26371
26372 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigValueSource, D>
26373 for &ConfigValueSource
26374 {
26375 #[inline]
26376 unsafe fn encode(
26377 self,
26378 encoder: &mut fidl::encoding::Encoder<'_, D>,
26379 offset: usize,
26380 _depth: fidl::encoding::Depth,
26381 ) -> fidl::Result<()> {
26382 encoder.debug_check_bounds::<ConfigValueSource>(offset);
26383 encoder.write_num::<u64>(self.ordinal(), offset);
26384 match self {
26385 ConfigValueSource::PackagePath(ref val) => fidl::encoding::encode_in_envelope::<
26386 fidl::encoding::UnboundedString,
26387 D,
26388 >(
26389 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
26390 val,
26391 ),
26392 encoder,
26393 offset + 8,
26394 _depth,
26395 ),
26396 ConfigValueSource::Capabilities(ref val) => {
26397 fidl::encoding::encode_in_envelope::<ConfigSourceCapabilities, D>(
26398 <ConfigSourceCapabilities as fidl::encoding::ValueTypeMarker>::borrow(val),
26399 encoder,
26400 offset + 8,
26401 _depth,
26402 )
26403 }
26404 ConfigValueSource::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
26405 }
26406 }
26407 }
26408
26409 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigValueSource {
26410 #[inline(always)]
26411 fn new_empty() -> Self {
26412 Self::__SourceBreaking { unknown_ordinal: 0 }
26413 }
26414
26415 #[inline]
26416 unsafe fn decode(
26417 &mut self,
26418 decoder: &mut fidl::encoding::Decoder<'_, D>,
26419 offset: usize,
26420 mut depth: fidl::encoding::Depth,
26421 ) -> fidl::Result<()> {
26422 decoder.debug_check_bounds::<Self>(offset);
26423 #[allow(unused_variables)]
26424 let next_out_of_line = decoder.next_out_of_line();
26425 let handles_before = decoder.remaining_handles();
26426 let (ordinal, inlined, num_bytes, num_handles) =
26427 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
26428
26429 let member_inline_size = match ordinal {
26430 1 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
26431 decoder.context,
26432 ),
26433 2 => <ConfigSourceCapabilities as fidl::encoding::TypeMarker>::inline_size(
26434 decoder.context,
26435 ),
26436 0 => return Err(fidl::Error::UnknownUnionTag),
26437 _ => num_bytes as usize,
26438 };
26439
26440 if inlined != (member_inline_size <= 4) {
26441 return Err(fidl::Error::InvalidInlineBitInEnvelope);
26442 }
26443 let _inner_offset;
26444 if inlined {
26445 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
26446 _inner_offset = offset + 8;
26447 } else {
26448 depth.increment()?;
26449 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
26450 }
26451 match ordinal {
26452 1 => {
26453 #[allow(irrefutable_let_patterns)]
26454 if let ConfigValueSource::PackagePath(_) = self {
26455 } else {
26457 *self = ConfigValueSource::PackagePath(fidl::new_empty!(
26459 fidl::encoding::UnboundedString,
26460 D
26461 ));
26462 }
26463 #[allow(irrefutable_let_patterns)]
26464 if let ConfigValueSource::PackagePath(ref mut val) = self {
26465 fidl::decode!(
26466 fidl::encoding::UnboundedString,
26467 D,
26468 val,
26469 decoder,
26470 _inner_offset,
26471 depth
26472 )?;
26473 } else {
26474 unreachable!()
26475 }
26476 }
26477 2 => {
26478 #[allow(irrefutable_let_patterns)]
26479 if let ConfigValueSource::Capabilities(_) = self {
26480 } else {
26482 *self = ConfigValueSource::Capabilities(fidl::new_empty!(
26484 ConfigSourceCapabilities,
26485 D
26486 ));
26487 }
26488 #[allow(irrefutable_let_patterns)]
26489 if let ConfigValueSource::Capabilities(ref mut val) = self {
26490 fidl::decode!(
26491 ConfigSourceCapabilities,
26492 D,
26493 val,
26494 decoder,
26495 _inner_offset,
26496 depth
26497 )?;
26498 } else {
26499 unreachable!()
26500 }
26501 }
26502 #[allow(deprecated)]
26503 ordinal => {
26504 for _ in 0..num_handles {
26505 decoder.drop_next_handle()?;
26506 }
26507 *self = ConfigValueSource::__SourceBreaking { unknown_ordinal: ordinal };
26508 }
26509 }
26510 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
26511 return Err(fidl::Error::InvalidNumBytesInEnvelope);
26512 }
26513 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
26514 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
26515 }
26516 Ok(())
26517 }
26518 }
26519
26520 impl fidl::encoding::ValueTypeMarker for ConfigVectorValue {
26521 type Borrowed<'a> = &'a Self;
26522 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
26523 value
26524 }
26525 }
26526
26527 unsafe impl fidl::encoding::TypeMarker for ConfigVectorValue {
26528 type Owned = Self;
26529
26530 #[inline(always)]
26531 fn inline_align(_context: fidl::encoding::Context) -> usize {
26532 8
26533 }
26534
26535 #[inline(always)]
26536 fn inline_size(_context: fidl::encoding::Context) -> usize {
26537 16
26538 }
26539 }
26540
26541 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigVectorValue, D>
26542 for &ConfigVectorValue
26543 {
26544 #[inline]
26545 unsafe fn encode(
26546 self,
26547 encoder: &mut fidl::encoding::Encoder<'_, D>,
26548 offset: usize,
26549 _depth: fidl::encoding::Depth,
26550 ) -> fidl::Result<()> {
26551 encoder.debug_check_bounds::<ConfigVectorValue>(offset);
26552 encoder.write_num::<u64>(self.ordinal(), offset);
26553 match self {
26554 ConfigVectorValue::BoolVector(ref val) => {
26555 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<bool>, D>(
26556 <fidl::encoding::UnboundedVector<bool> as fidl::encoding::ValueTypeMarker>::borrow(val),
26557 encoder, offset + 8, _depth
26558 )
26559 }
26560 ConfigVectorValue::Uint8Vector(ref val) => {
26561 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
26562 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
26563 encoder, offset + 8, _depth
26564 )
26565 }
26566 ConfigVectorValue::Uint16Vector(ref val) => {
26567 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u16>, D>(
26568 <fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(val),
26569 encoder, offset + 8, _depth
26570 )
26571 }
26572 ConfigVectorValue::Uint32Vector(ref val) => {
26573 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u32>, D>(
26574 <fidl::encoding::UnboundedVector<u32> as fidl::encoding::ValueTypeMarker>::borrow(val),
26575 encoder, offset + 8, _depth
26576 )
26577 }
26578 ConfigVectorValue::Uint64Vector(ref val) => {
26579 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u64>, D>(
26580 <fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow(val),
26581 encoder, offset + 8, _depth
26582 )
26583 }
26584 ConfigVectorValue::Int8Vector(ref val) => {
26585 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<i8>, D>(
26586 <fidl::encoding::UnboundedVector<i8> as fidl::encoding::ValueTypeMarker>::borrow(val),
26587 encoder, offset + 8, _depth
26588 )
26589 }
26590 ConfigVectorValue::Int16Vector(ref val) => {
26591 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<i16>, D>(
26592 <fidl::encoding::UnboundedVector<i16> as fidl::encoding::ValueTypeMarker>::borrow(val),
26593 encoder, offset + 8, _depth
26594 )
26595 }
26596 ConfigVectorValue::Int32Vector(ref val) => {
26597 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<i32>, D>(
26598 <fidl::encoding::UnboundedVector<i32> as fidl::encoding::ValueTypeMarker>::borrow(val),
26599 encoder, offset + 8, _depth
26600 )
26601 }
26602 ConfigVectorValue::Int64Vector(ref val) => {
26603 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<i64>, D>(
26604 <fidl::encoding::UnboundedVector<i64> as fidl::encoding::ValueTypeMarker>::borrow(val),
26605 encoder, offset + 8, _depth
26606 )
26607 }
26608 ConfigVectorValue::StringVector(ref val) => {
26609 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, D>(
26610 <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(val),
26611 encoder, offset + 8, _depth
26612 )
26613 }
26614 ConfigVectorValue::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
26615 }
26616 }
26617 }
26618
26619 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigVectorValue {
26620 #[inline(always)]
26621 fn new_empty() -> Self {
26622 Self::__SourceBreaking { unknown_ordinal: 0 }
26623 }
26624
26625 #[inline]
26626 unsafe fn decode(
26627 &mut self,
26628 decoder: &mut fidl::encoding::Decoder<'_, D>,
26629 offset: usize,
26630 mut depth: fidl::encoding::Depth,
26631 ) -> fidl::Result<()> {
26632 decoder.debug_check_bounds::<Self>(offset);
26633 #[allow(unused_variables)]
26634 let next_out_of_line = decoder.next_out_of_line();
26635 let handles_before = decoder.remaining_handles();
26636 let (ordinal, inlined, num_bytes, num_handles) =
26637 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
26638
26639 let member_inline_size = match ordinal {
26640 1 => <fidl::encoding::UnboundedVector<bool> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26641 2 => <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26642 3 => <fidl::encoding::UnboundedVector<u16> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26643 4 => <fidl::encoding::UnboundedVector<u32> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26644 5 => <fidl::encoding::UnboundedVector<u64> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26645 6 => <fidl::encoding::UnboundedVector<i8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26646 7 => <fidl::encoding::UnboundedVector<i16> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26647 8 => <fidl::encoding::UnboundedVector<i32> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26648 9 => <fidl::encoding::UnboundedVector<i64> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26649 10 => <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26650 0 => return Err(fidl::Error::UnknownUnionTag),
26651 _ => num_bytes as usize,
26652 };
26653
26654 if inlined != (member_inline_size <= 4) {
26655 return Err(fidl::Error::InvalidInlineBitInEnvelope);
26656 }
26657 let _inner_offset;
26658 if inlined {
26659 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
26660 _inner_offset = offset + 8;
26661 } else {
26662 depth.increment()?;
26663 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
26664 }
26665 match ordinal {
26666 1 => {
26667 #[allow(irrefutable_let_patterns)]
26668 if let ConfigVectorValue::BoolVector(_) = self {
26669 } else {
26671 *self = ConfigVectorValue::BoolVector(fidl::new_empty!(
26673 fidl::encoding::UnboundedVector<bool>,
26674 D
26675 ));
26676 }
26677 #[allow(irrefutable_let_patterns)]
26678 if let ConfigVectorValue::BoolVector(ref mut val) = self {
26679 fidl::decode!(
26680 fidl::encoding::UnboundedVector<bool>,
26681 D,
26682 val,
26683 decoder,
26684 _inner_offset,
26685 depth
26686 )?;
26687 } else {
26688 unreachable!()
26689 }
26690 }
26691 2 => {
26692 #[allow(irrefutable_let_patterns)]
26693 if let ConfigVectorValue::Uint8Vector(_) = self {
26694 } else {
26696 *self = ConfigVectorValue::Uint8Vector(fidl::new_empty!(
26698 fidl::encoding::UnboundedVector<u8>,
26699 D
26700 ));
26701 }
26702 #[allow(irrefutable_let_patterns)]
26703 if let ConfigVectorValue::Uint8Vector(ref mut val) = self {
26704 fidl::decode!(
26705 fidl::encoding::UnboundedVector<u8>,
26706 D,
26707 val,
26708 decoder,
26709 _inner_offset,
26710 depth
26711 )?;
26712 } else {
26713 unreachable!()
26714 }
26715 }
26716 3 => {
26717 #[allow(irrefutable_let_patterns)]
26718 if let ConfigVectorValue::Uint16Vector(_) = self {
26719 } else {
26721 *self = ConfigVectorValue::Uint16Vector(fidl::new_empty!(
26723 fidl::encoding::UnboundedVector<u16>,
26724 D
26725 ));
26726 }
26727 #[allow(irrefutable_let_patterns)]
26728 if let ConfigVectorValue::Uint16Vector(ref mut val) = self {
26729 fidl::decode!(
26730 fidl::encoding::UnboundedVector<u16>,
26731 D,
26732 val,
26733 decoder,
26734 _inner_offset,
26735 depth
26736 )?;
26737 } else {
26738 unreachable!()
26739 }
26740 }
26741 4 => {
26742 #[allow(irrefutable_let_patterns)]
26743 if let ConfigVectorValue::Uint32Vector(_) = self {
26744 } else {
26746 *self = ConfigVectorValue::Uint32Vector(fidl::new_empty!(
26748 fidl::encoding::UnboundedVector<u32>,
26749 D
26750 ));
26751 }
26752 #[allow(irrefutable_let_patterns)]
26753 if let ConfigVectorValue::Uint32Vector(ref mut val) = self {
26754 fidl::decode!(
26755 fidl::encoding::UnboundedVector<u32>,
26756 D,
26757 val,
26758 decoder,
26759 _inner_offset,
26760 depth
26761 )?;
26762 } else {
26763 unreachable!()
26764 }
26765 }
26766 5 => {
26767 #[allow(irrefutable_let_patterns)]
26768 if let ConfigVectorValue::Uint64Vector(_) = self {
26769 } else {
26771 *self = ConfigVectorValue::Uint64Vector(fidl::new_empty!(
26773 fidl::encoding::UnboundedVector<u64>,
26774 D
26775 ));
26776 }
26777 #[allow(irrefutable_let_patterns)]
26778 if let ConfigVectorValue::Uint64Vector(ref mut val) = self {
26779 fidl::decode!(
26780 fidl::encoding::UnboundedVector<u64>,
26781 D,
26782 val,
26783 decoder,
26784 _inner_offset,
26785 depth
26786 )?;
26787 } else {
26788 unreachable!()
26789 }
26790 }
26791 6 => {
26792 #[allow(irrefutable_let_patterns)]
26793 if let ConfigVectorValue::Int8Vector(_) = self {
26794 } else {
26796 *self = ConfigVectorValue::Int8Vector(fidl::new_empty!(
26798 fidl::encoding::UnboundedVector<i8>,
26799 D
26800 ));
26801 }
26802 #[allow(irrefutable_let_patterns)]
26803 if let ConfigVectorValue::Int8Vector(ref mut val) = self {
26804 fidl::decode!(
26805 fidl::encoding::UnboundedVector<i8>,
26806 D,
26807 val,
26808 decoder,
26809 _inner_offset,
26810 depth
26811 )?;
26812 } else {
26813 unreachable!()
26814 }
26815 }
26816 7 => {
26817 #[allow(irrefutable_let_patterns)]
26818 if let ConfigVectorValue::Int16Vector(_) = self {
26819 } else {
26821 *self = ConfigVectorValue::Int16Vector(fidl::new_empty!(
26823 fidl::encoding::UnboundedVector<i16>,
26824 D
26825 ));
26826 }
26827 #[allow(irrefutable_let_patterns)]
26828 if let ConfigVectorValue::Int16Vector(ref mut val) = self {
26829 fidl::decode!(
26830 fidl::encoding::UnboundedVector<i16>,
26831 D,
26832 val,
26833 decoder,
26834 _inner_offset,
26835 depth
26836 )?;
26837 } else {
26838 unreachable!()
26839 }
26840 }
26841 8 => {
26842 #[allow(irrefutable_let_patterns)]
26843 if let ConfigVectorValue::Int32Vector(_) = self {
26844 } else {
26846 *self = ConfigVectorValue::Int32Vector(fidl::new_empty!(
26848 fidl::encoding::UnboundedVector<i32>,
26849 D
26850 ));
26851 }
26852 #[allow(irrefutable_let_patterns)]
26853 if let ConfigVectorValue::Int32Vector(ref mut val) = self {
26854 fidl::decode!(
26855 fidl::encoding::UnboundedVector<i32>,
26856 D,
26857 val,
26858 decoder,
26859 _inner_offset,
26860 depth
26861 )?;
26862 } else {
26863 unreachable!()
26864 }
26865 }
26866 9 => {
26867 #[allow(irrefutable_let_patterns)]
26868 if let ConfigVectorValue::Int64Vector(_) = self {
26869 } else {
26871 *self = ConfigVectorValue::Int64Vector(fidl::new_empty!(
26873 fidl::encoding::UnboundedVector<i64>,
26874 D
26875 ));
26876 }
26877 #[allow(irrefutable_let_patterns)]
26878 if let ConfigVectorValue::Int64Vector(ref mut val) = self {
26879 fidl::decode!(
26880 fidl::encoding::UnboundedVector<i64>,
26881 D,
26882 val,
26883 decoder,
26884 _inner_offset,
26885 depth
26886 )?;
26887 } else {
26888 unreachable!()
26889 }
26890 }
26891 10 => {
26892 #[allow(irrefutable_let_patterns)]
26893 if let ConfigVectorValue::StringVector(_) = self {
26894 } else {
26896 *self = ConfigVectorValue::StringVector(fidl::new_empty!(
26898 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
26899 D
26900 ));
26901 }
26902 #[allow(irrefutable_let_patterns)]
26903 if let ConfigVectorValue::StringVector(ref mut val) = self {
26904 fidl::decode!(
26905 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
26906 D,
26907 val,
26908 decoder,
26909 _inner_offset,
26910 depth
26911 )?;
26912 } else {
26913 unreachable!()
26914 }
26915 }
26916 #[allow(deprecated)]
26917 ordinal => {
26918 for _ in 0..num_handles {
26919 decoder.drop_next_handle()?;
26920 }
26921 *self = ConfigVectorValue::__SourceBreaking { unknown_ordinal: ordinal };
26922 }
26923 }
26924 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
26925 return Err(fidl::Error::InvalidNumBytesInEnvelope);
26926 }
26927 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
26928 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
26929 }
26930 Ok(())
26931 }
26932 }
26933
26934 impl fidl::encoding::ValueTypeMarker for DebugRegistration {
26935 type Borrowed<'a> = &'a Self;
26936 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
26937 value
26938 }
26939 }
26940
26941 unsafe impl fidl::encoding::TypeMarker for DebugRegistration {
26942 type Owned = Self;
26943
26944 #[inline(always)]
26945 fn inline_align(_context: fidl::encoding::Context) -> usize {
26946 8
26947 }
26948
26949 #[inline(always)]
26950 fn inline_size(_context: fidl::encoding::Context) -> usize {
26951 16
26952 }
26953 }
26954
26955 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DebugRegistration, D>
26956 for &DebugRegistration
26957 {
26958 #[inline]
26959 unsafe fn encode(
26960 self,
26961 encoder: &mut fidl::encoding::Encoder<'_, D>,
26962 offset: usize,
26963 _depth: fidl::encoding::Depth,
26964 ) -> fidl::Result<()> {
26965 encoder.debug_check_bounds::<DebugRegistration>(offset);
26966 encoder.write_num::<u64>(self.ordinal(), offset);
26967 match self {
26968 DebugRegistration::Protocol(ref val) => {
26969 fidl::encoding::encode_in_envelope::<DebugProtocolRegistration, D>(
26970 <DebugProtocolRegistration as fidl::encoding::ValueTypeMarker>::borrow(val),
26971 encoder,
26972 offset + 8,
26973 _depth,
26974 )
26975 }
26976 DebugRegistration::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
26977 }
26978 }
26979 }
26980
26981 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DebugRegistration {
26982 #[inline(always)]
26983 fn new_empty() -> Self {
26984 Self::__SourceBreaking { unknown_ordinal: 0 }
26985 }
26986
26987 #[inline]
26988 unsafe fn decode(
26989 &mut self,
26990 decoder: &mut fidl::encoding::Decoder<'_, D>,
26991 offset: usize,
26992 mut depth: fidl::encoding::Depth,
26993 ) -> fidl::Result<()> {
26994 decoder.debug_check_bounds::<Self>(offset);
26995 #[allow(unused_variables)]
26996 let next_out_of_line = decoder.next_out_of_line();
26997 let handles_before = decoder.remaining_handles();
26998 let (ordinal, inlined, num_bytes, num_handles) =
26999 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
27000
27001 let member_inline_size = match ordinal {
27002 1 => <DebugProtocolRegistration as fidl::encoding::TypeMarker>::inline_size(
27003 decoder.context,
27004 ),
27005 0 => return Err(fidl::Error::UnknownUnionTag),
27006 _ => num_bytes as usize,
27007 };
27008
27009 if inlined != (member_inline_size <= 4) {
27010 return Err(fidl::Error::InvalidInlineBitInEnvelope);
27011 }
27012 let _inner_offset;
27013 if inlined {
27014 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
27015 _inner_offset = offset + 8;
27016 } else {
27017 depth.increment()?;
27018 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
27019 }
27020 match ordinal {
27021 1 => {
27022 #[allow(irrefutable_let_patterns)]
27023 if let DebugRegistration::Protocol(_) = self {
27024 } else {
27026 *self = DebugRegistration::Protocol(fidl::new_empty!(
27028 DebugProtocolRegistration,
27029 D
27030 ));
27031 }
27032 #[allow(irrefutable_let_patterns)]
27033 if let DebugRegistration::Protocol(ref mut val) = self {
27034 fidl::decode!(
27035 DebugProtocolRegistration,
27036 D,
27037 val,
27038 decoder,
27039 _inner_offset,
27040 depth
27041 )?;
27042 } else {
27043 unreachable!()
27044 }
27045 }
27046 #[allow(deprecated)]
27047 ordinal => {
27048 for _ in 0..num_handles {
27049 decoder.drop_next_handle()?;
27050 }
27051 *self = DebugRegistration::__SourceBreaking { unknown_ordinal: ordinal };
27052 }
27053 }
27054 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
27055 return Err(fidl::Error::InvalidNumBytesInEnvelope);
27056 }
27057 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
27058 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
27059 }
27060 Ok(())
27061 }
27062 }
27063
27064 impl fidl::encoding::ValueTypeMarker for Expose {
27065 type Borrowed<'a> = &'a Self;
27066 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
27067 value
27068 }
27069 }
27070
27071 unsafe impl fidl::encoding::TypeMarker for Expose {
27072 type Owned = Self;
27073
27074 #[inline(always)]
27075 fn inline_align(_context: fidl::encoding::Context) -> usize {
27076 8
27077 }
27078
27079 #[inline(always)]
27080 fn inline_size(_context: fidl::encoding::Context) -> usize {
27081 16
27082 }
27083 }
27084
27085 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Expose, D> for &Expose {
27086 #[inline]
27087 unsafe fn encode(
27088 self,
27089 encoder: &mut fidl::encoding::Encoder<'_, D>,
27090 offset: usize,
27091 _depth: fidl::encoding::Depth,
27092 ) -> fidl::Result<()> {
27093 encoder.debug_check_bounds::<Expose>(offset);
27094 encoder.write_num::<u64>(self.ordinal(), offset);
27095 match self {
27096 Expose::Service(ref val) => fidl::encoding::encode_in_envelope::<ExposeService, D>(
27097 <ExposeService as fidl::encoding::ValueTypeMarker>::borrow(val),
27098 encoder,
27099 offset + 8,
27100 _depth,
27101 ),
27102 Expose::Protocol(ref val) => {
27103 fidl::encoding::encode_in_envelope::<ExposeProtocol, D>(
27104 <ExposeProtocol as fidl::encoding::ValueTypeMarker>::borrow(val),
27105 encoder,
27106 offset + 8,
27107 _depth,
27108 )
27109 }
27110 Expose::Directory(ref val) => {
27111 fidl::encoding::encode_in_envelope::<ExposeDirectory, D>(
27112 <ExposeDirectory as fidl::encoding::ValueTypeMarker>::borrow(val),
27113 encoder,
27114 offset + 8,
27115 _depth,
27116 )
27117 }
27118 Expose::Runner(ref val) => fidl::encoding::encode_in_envelope::<ExposeRunner, D>(
27119 <ExposeRunner as fidl::encoding::ValueTypeMarker>::borrow(val),
27120 encoder,
27121 offset + 8,
27122 _depth,
27123 ),
27124 Expose::Resolver(ref val) => {
27125 fidl::encoding::encode_in_envelope::<ExposeResolver, D>(
27126 <ExposeResolver as fidl::encoding::ValueTypeMarker>::borrow(val),
27127 encoder,
27128 offset + 8,
27129 _depth,
27130 )
27131 }
27132 Expose::Dictionary(ref val) => {
27133 fidl::encoding::encode_in_envelope::<ExposeDictionary, D>(
27134 <ExposeDictionary as fidl::encoding::ValueTypeMarker>::borrow(val),
27135 encoder,
27136 offset + 8,
27137 _depth,
27138 )
27139 }
27140 Expose::Config(ref val) => {
27141 fidl::encoding::encode_in_envelope::<ExposeConfiguration, D>(
27142 <ExposeConfiguration as fidl::encoding::ValueTypeMarker>::borrow(val),
27143 encoder,
27144 offset + 8,
27145 _depth,
27146 )
27147 }
27148 Expose::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
27149 }
27150 }
27151 }
27152
27153 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Expose {
27154 #[inline(always)]
27155 fn new_empty() -> Self {
27156 Self::__SourceBreaking { unknown_ordinal: 0 }
27157 }
27158
27159 #[inline]
27160 unsafe fn decode(
27161 &mut self,
27162 decoder: &mut fidl::encoding::Decoder<'_, D>,
27163 offset: usize,
27164 mut depth: fidl::encoding::Depth,
27165 ) -> fidl::Result<()> {
27166 decoder.debug_check_bounds::<Self>(offset);
27167 #[allow(unused_variables)]
27168 let next_out_of_line = decoder.next_out_of_line();
27169 let handles_before = decoder.remaining_handles();
27170 let (ordinal, inlined, num_bytes, num_handles) =
27171 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
27172
27173 let member_inline_size = match ordinal {
27174 1 => <ExposeService as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27175 2 => <ExposeProtocol as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27176 3 => <ExposeDirectory as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27177 4 => <ExposeRunner as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27178 5 => <ExposeResolver as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27179 7 => <ExposeDictionary as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27180 8 => <ExposeConfiguration as fidl::encoding::TypeMarker>::inline_size(
27181 decoder.context,
27182 ),
27183 0 => return Err(fidl::Error::UnknownUnionTag),
27184 _ => num_bytes as usize,
27185 };
27186
27187 if inlined != (member_inline_size <= 4) {
27188 return Err(fidl::Error::InvalidInlineBitInEnvelope);
27189 }
27190 let _inner_offset;
27191 if inlined {
27192 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
27193 _inner_offset = offset + 8;
27194 } else {
27195 depth.increment()?;
27196 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
27197 }
27198 match ordinal {
27199 1 => {
27200 #[allow(irrefutable_let_patterns)]
27201 if let Expose::Service(_) = self {
27202 } else {
27204 *self = Expose::Service(fidl::new_empty!(ExposeService, D));
27206 }
27207 #[allow(irrefutable_let_patterns)]
27208 if let Expose::Service(ref mut val) = self {
27209 fidl::decode!(ExposeService, D, val, decoder, _inner_offset, depth)?;
27210 } else {
27211 unreachable!()
27212 }
27213 }
27214 2 => {
27215 #[allow(irrefutable_let_patterns)]
27216 if let Expose::Protocol(_) = self {
27217 } else {
27219 *self = Expose::Protocol(fidl::new_empty!(ExposeProtocol, D));
27221 }
27222 #[allow(irrefutable_let_patterns)]
27223 if let Expose::Protocol(ref mut val) = self {
27224 fidl::decode!(ExposeProtocol, D, val, decoder, _inner_offset, depth)?;
27225 } else {
27226 unreachable!()
27227 }
27228 }
27229 3 => {
27230 #[allow(irrefutable_let_patterns)]
27231 if let Expose::Directory(_) = self {
27232 } else {
27234 *self = Expose::Directory(fidl::new_empty!(ExposeDirectory, D));
27236 }
27237 #[allow(irrefutable_let_patterns)]
27238 if let Expose::Directory(ref mut val) = self {
27239 fidl::decode!(ExposeDirectory, D, val, decoder, _inner_offset, depth)?;
27240 } else {
27241 unreachable!()
27242 }
27243 }
27244 4 => {
27245 #[allow(irrefutable_let_patterns)]
27246 if let Expose::Runner(_) = self {
27247 } else {
27249 *self = Expose::Runner(fidl::new_empty!(ExposeRunner, D));
27251 }
27252 #[allow(irrefutable_let_patterns)]
27253 if let Expose::Runner(ref mut val) = self {
27254 fidl::decode!(ExposeRunner, D, val, decoder, _inner_offset, depth)?;
27255 } else {
27256 unreachable!()
27257 }
27258 }
27259 5 => {
27260 #[allow(irrefutable_let_patterns)]
27261 if let Expose::Resolver(_) = self {
27262 } else {
27264 *self = Expose::Resolver(fidl::new_empty!(ExposeResolver, D));
27266 }
27267 #[allow(irrefutable_let_patterns)]
27268 if let Expose::Resolver(ref mut val) = self {
27269 fidl::decode!(ExposeResolver, D, val, decoder, _inner_offset, depth)?;
27270 } else {
27271 unreachable!()
27272 }
27273 }
27274 7 => {
27275 #[allow(irrefutable_let_patterns)]
27276 if let Expose::Dictionary(_) = self {
27277 } else {
27279 *self = Expose::Dictionary(fidl::new_empty!(ExposeDictionary, D));
27281 }
27282 #[allow(irrefutable_let_patterns)]
27283 if let Expose::Dictionary(ref mut val) = self {
27284 fidl::decode!(ExposeDictionary, D, val, decoder, _inner_offset, depth)?;
27285 } else {
27286 unreachable!()
27287 }
27288 }
27289 8 => {
27290 #[allow(irrefutable_let_patterns)]
27291 if let Expose::Config(_) = self {
27292 } else {
27294 *self = Expose::Config(fidl::new_empty!(ExposeConfiguration, D));
27296 }
27297 #[allow(irrefutable_let_patterns)]
27298 if let Expose::Config(ref mut val) = self {
27299 fidl::decode!(ExposeConfiguration, D, val, decoder, _inner_offset, depth)?;
27300 } else {
27301 unreachable!()
27302 }
27303 }
27304 #[allow(deprecated)]
27305 ordinal => {
27306 for _ in 0..num_handles {
27307 decoder.drop_next_handle()?;
27308 }
27309 *self = Expose::__SourceBreaking { unknown_ordinal: ordinal };
27310 }
27311 }
27312 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
27313 return Err(fidl::Error::InvalidNumBytesInEnvelope);
27314 }
27315 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
27316 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
27317 }
27318 Ok(())
27319 }
27320 }
27321
27322 impl fidl::encoding::ValueTypeMarker for LayoutConstraint {
27323 type Borrowed<'a> = &'a Self;
27324 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
27325 value
27326 }
27327 }
27328
27329 unsafe impl fidl::encoding::TypeMarker for LayoutConstraint {
27330 type Owned = Self;
27331
27332 #[inline(always)]
27333 fn inline_align(_context: fidl::encoding::Context) -> usize {
27334 8
27335 }
27336
27337 #[inline(always)]
27338 fn inline_size(_context: fidl::encoding::Context) -> usize {
27339 16
27340 }
27341 }
27342
27343 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayoutConstraint, D>
27344 for &LayoutConstraint
27345 {
27346 #[inline]
27347 unsafe fn encode(
27348 self,
27349 encoder: &mut fidl::encoding::Encoder<'_, D>,
27350 offset: usize,
27351 _depth: fidl::encoding::Depth,
27352 ) -> fidl::Result<()> {
27353 encoder.debug_check_bounds::<LayoutConstraint>(offset);
27354 encoder.write_num::<u64>(self.ordinal(), offset);
27355 match self {
27356 LayoutConstraint::MaxSize(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
27357 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
27358 encoder,
27359 offset + 8,
27360 _depth,
27361 ),
27362 LayoutConstraint::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
27363 }
27364 }
27365 }
27366
27367 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayoutConstraint {
27368 #[inline(always)]
27369 fn new_empty() -> Self {
27370 Self::__SourceBreaking { unknown_ordinal: 0 }
27371 }
27372
27373 #[inline]
27374 unsafe fn decode(
27375 &mut self,
27376 decoder: &mut fidl::encoding::Decoder<'_, D>,
27377 offset: usize,
27378 mut depth: fidl::encoding::Depth,
27379 ) -> fidl::Result<()> {
27380 decoder.debug_check_bounds::<Self>(offset);
27381 #[allow(unused_variables)]
27382 let next_out_of_line = decoder.next_out_of_line();
27383 let handles_before = decoder.remaining_handles();
27384 let (ordinal, inlined, num_bytes, num_handles) =
27385 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
27386
27387 let member_inline_size = match ordinal {
27388 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27389 0 => return Err(fidl::Error::UnknownUnionTag),
27390 _ => num_bytes as usize,
27391 };
27392
27393 if inlined != (member_inline_size <= 4) {
27394 return Err(fidl::Error::InvalidInlineBitInEnvelope);
27395 }
27396 let _inner_offset;
27397 if inlined {
27398 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
27399 _inner_offset = offset + 8;
27400 } else {
27401 depth.increment()?;
27402 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
27403 }
27404 match ordinal {
27405 1 => {
27406 #[allow(irrefutable_let_patterns)]
27407 if let LayoutConstraint::MaxSize(_) = self {
27408 } else {
27410 *self = LayoutConstraint::MaxSize(fidl::new_empty!(u32, D));
27412 }
27413 #[allow(irrefutable_let_patterns)]
27414 if let LayoutConstraint::MaxSize(ref mut val) = self {
27415 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
27416 } else {
27417 unreachable!()
27418 }
27419 }
27420 #[allow(deprecated)]
27421 ordinal => {
27422 for _ in 0..num_handles {
27423 decoder.drop_next_handle()?;
27424 }
27425 *self = LayoutConstraint::__SourceBreaking { unknown_ordinal: ordinal };
27426 }
27427 }
27428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
27429 return Err(fidl::Error::InvalidNumBytesInEnvelope);
27430 }
27431 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
27432 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
27433 }
27434 Ok(())
27435 }
27436 }
27437
27438 impl fidl::encoding::ValueTypeMarker for LayoutParameter {
27439 type Borrowed<'a> = &'a Self;
27440 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
27441 value
27442 }
27443 }
27444
27445 unsafe impl fidl::encoding::TypeMarker for LayoutParameter {
27446 type Owned = Self;
27447
27448 #[inline(always)]
27449 fn inline_align(_context: fidl::encoding::Context) -> usize {
27450 8
27451 }
27452
27453 #[inline(always)]
27454 fn inline_size(_context: fidl::encoding::Context) -> usize {
27455 16
27456 }
27457 }
27458
27459 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayoutParameter, D>
27460 for &LayoutParameter
27461 {
27462 #[inline]
27463 unsafe fn encode(
27464 self,
27465 encoder: &mut fidl::encoding::Encoder<'_, D>,
27466 offset: usize,
27467 _depth: fidl::encoding::Depth,
27468 ) -> fidl::Result<()> {
27469 encoder.debug_check_bounds::<LayoutParameter>(offset);
27470 encoder.write_num::<u64>(self.ordinal(), offset);
27471 match self {
27472 LayoutParameter::NestedType(ref val) => {
27473 fidl::encoding::encode_in_envelope::<ConfigType, D>(
27474 <ConfigType as fidl::encoding::ValueTypeMarker>::borrow(val),
27475 encoder,
27476 offset + 8,
27477 _depth,
27478 )
27479 }
27480 LayoutParameter::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
27481 }
27482 }
27483 }
27484
27485 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayoutParameter {
27486 #[inline(always)]
27487 fn new_empty() -> Self {
27488 Self::__SourceBreaking { unknown_ordinal: 0 }
27489 }
27490
27491 #[inline]
27492 unsafe fn decode(
27493 &mut self,
27494 decoder: &mut fidl::encoding::Decoder<'_, D>,
27495 offset: usize,
27496 mut depth: fidl::encoding::Depth,
27497 ) -> fidl::Result<()> {
27498 decoder.debug_check_bounds::<Self>(offset);
27499 #[allow(unused_variables)]
27500 let next_out_of_line = decoder.next_out_of_line();
27501 let handles_before = decoder.remaining_handles();
27502 let (ordinal, inlined, num_bytes, num_handles) =
27503 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
27504
27505 let member_inline_size = match ordinal {
27506 1 => <ConfigType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27507 0 => return Err(fidl::Error::UnknownUnionTag),
27508 _ => num_bytes as usize,
27509 };
27510
27511 if inlined != (member_inline_size <= 4) {
27512 return Err(fidl::Error::InvalidInlineBitInEnvelope);
27513 }
27514 let _inner_offset;
27515 if inlined {
27516 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
27517 _inner_offset = offset + 8;
27518 } else {
27519 depth.increment()?;
27520 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
27521 }
27522 match ordinal {
27523 1 => {
27524 #[allow(irrefutable_let_patterns)]
27525 if let LayoutParameter::NestedType(_) = self {
27526 } else {
27528 *self = LayoutParameter::NestedType(fidl::new_empty!(ConfigType, D));
27530 }
27531 #[allow(irrefutable_let_patterns)]
27532 if let LayoutParameter::NestedType(ref mut val) = self {
27533 fidl::decode!(ConfigType, D, val, decoder, _inner_offset, depth)?;
27534 } else {
27535 unreachable!()
27536 }
27537 }
27538 #[allow(deprecated)]
27539 ordinal => {
27540 for _ in 0..num_handles {
27541 decoder.drop_next_handle()?;
27542 }
27543 *self = LayoutParameter::__SourceBreaking { unknown_ordinal: ordinal };
27544 }
27545 }
27546 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
27547 return Err(fidl::Error::InvalidNumBytesInEnvelope);
27548 }
27549 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
27550 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
27551 }
27552 Ok(())
27553 }
27554 }
27555
27556 impl fidl::encoding::ValueTypeMarker for Offer {
27557 type Borrowed<'a> = &'a Self;
27558 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
27559 value
27560 }
27561 }
27562
27563 unsafe impl fidl::encoding::TypeMarker for Offer {
27564 type Owned = Self;
27565
27566 #[inline(always)]
27567 fn inline_align(_context: fidl::encoding::Context) -> usize {
27568 8
27569 }
27570
27571 #[inline(always)]
27572 fn inline_size(_context: fidl::encoding::Context) -> usize {
27573 16
27574 }
27575 }
27576
27577 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Offer, D> for &Offer {
27578 #[inline]
27579 unsafe fn encode(
27580 self,
27581 encoder: &mut fidl::encoding::Encoder<'_, D>,
27582 offset: usize,
27583 _depth: fidl::encoding::Depth,
27584 ) -> fidl::Result<()> {
27585 encoder.debug_check_bounds::<Offer>(offset);
27586 encoder.write_num::<u64>(self.ordinal(), offset);
27587 match self {
27588 Offer::Service(ref val) => fidl::encoding::encode_in_envelope::<OfferService, D>(
27589 <OfferService as fidl::encoding::ValueTypeMarker>::borrow(val),
27590 encoder,
27591 offset + 8,
27592 _depth,
27593 ),
27594 Offer::Protocol(ref val) => fidl::encoding::encode_in_envelope::<OfferProtocol, D>(
27595 <OfferProtocol as fidl::encoding::ValueTypeMarker>::borrow(val),
27596 encoder,
27597 offset + 8,
27598 _depth,
27599 ),
27600 Offer::Directory(ref val) => {
27601 fidl::encoding::encode_in_envelope::<OfferDirectory, D>(
27602 <OfferDirectory as fidl::encoding::ValueTypeMarker>::borrow(val),
27603 encoder,
27604 offset + 8,
27605 _depth,
27606 )
27607 }
27608 Offer::Storage(ref val) => fidl::encoding::encode_in_envelope::<OfferStorage, D>(
27609 <OfferStorage as fidl::encoding::ValueTypeMarker>::borrow(val),
27610 encoder,
27611 offset + 8,
27612 _depth,
27613 ),
27614 Offer::Runner(ref val) => fidl::encoding::encode_in_envelope::<OfferRunner, D>(
27615 <OfferRunner as fidl::encoding::ValueTypeMarker>::borrow(val),
27616 encoder,
27617 offset + 8,
27618 _depth,
27619 ),
27620 Offer::Resolver(ref val) => fidl::encoding::encode_in_envelope::<OfferResolver, D>(
27621 <OfferResolver as fidl::encoding::ValueTypeMarker>::borrow(val),
27622 encoder,
27623 offset + 8,
27624 _depth,
27625 ),
27626 Offer::EventStream(ref val) => {
27627 fidl::encoding::encode_in_envelope::<OfferEventStream, D>(
27628 <OfferEventStream as fidl::encoding::ValueTypeMarker>::borrow(val),
27629 encoder,
27630 offset + 8,
27631 _depth,
27632 )
27633 }
27634 Offer::Dictionary(ref val) => {
27635 fidl::encoding::encode_in_envelope::<OfferDictionary, D>(
27636 <OfferDictionary as fidl::encoding::ValueTypeMarker>::borrow(val),
27637 encoder,
27638 offset + 8,
27639 _depth,
27640 )
27641 }
27642 Offer::Config(ref val) => {
27643 fidl::encoding::encode_in_envelope::<OfferConfiguration, D>(
27644 <OfferConfiguration as fidl::encoding::ValueTypeMarker>::borrow(val),
27645 encoder,
27646 offset + 8,
27647 _depth,
27648 )
27649 }
27650 Offer::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
27651 }
27652 }
27653 }
27654
27655 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Offer {
27656 #[inline(always)]
27657 fn new_empty() -> Self {
27658 Self::__SourceBreaking { unknown_ordinal: 0 }
27659 }
27660
27661 #[inline]
27662 unsafe fn decode(
27663 &mut self,
27664 decoder: &mut fidl::encoding::Decoder<'_, D>,
27665 offset: usize,
27666 mut depth: fidl::encoding::Depth,
27667 ) -> fidl::Result<()> {
27668 decoder.debug_check_bounds::<Self>(offset);
27669 #[allow(unused_variables)]
27670 let next_out_of_line = decoder.next_out_of_line();
27671 let handles_before = decoder.remaining_handles();
27672 let (ordinal, inlined, num_bytes, num_handles) =
27673 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
27674
27675 let member_inline_size = match ordinal {
27676 1 => <OfferService as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27677 2 => <OfferProtocol as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27678 3 => <OfferDirectory as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27679 4 => <OfferStorage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27680 5 => <OfferRunner as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27681 6 => <OfferResolver as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27682 8 => <OfferEventStream as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27683 9 => <OfferDictionary as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27684 10 => {
27685 <OfferConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context)
27686 }
27687 0 => return Err(fidl::Error::UnknownUnionTag),
27688 _ => num_bytes as usize,
27689 };
27690
27691 if inlined != (member_inline_size <= 4) {
27692 return Err(fidl::Error::InvalidInlineBitInEnvelope);
27693 }
27694 let _inner_offset;
27695 if inlined {
27696 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
27697 _inner_offset = offset + 8;
27698 } else {
27699 depth.increment()?;
27700 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
27701 }
27702 match ordinal {
27703 1 => {
27704 #[allow(irrefutable_let_patterns)]
27705 if let Offer::Service(_) = self {
27706 } else {
27708 *self = Offer::Service(fidl::new_empty!(OfferService, D));
27710 }
27711 #[allow(irrefutable_let_patterns)]
27712 if let Offer::Service(ref mut val) = self {
27713 fidl::decode!(OfferService, D, val, decoder, _inner_offset, depth)?;
27714 } else {
27715 unreachable!()
27716 }
27717 }
27718 2 => {
27719 #[allow(irrefutable_let_patterns)]
27720 if let Offer::Protocol(_) = self {
27721 } else {
27723 *self = Offer::Protocol(fidl::new_empty!(OfferProtocol, D));
27725 }
27726 #[allow(irrefutable_let_patterns)]
27727 if let Offer::Protocol(ref mut val) = self {
27728 fidl::decode!(OfferProtocol, D, val, decoder, _inner_offset, depth)?;
27729 } else {
27730 unreachable!()
27731 }
27732 }
27733 3 => {
27734 #[allow(irrefutable_let_patterns)]
27735 if let Offer::Directory(_) = self {
27736 } else {
27738 *self = Offer::Directory(fidl::new_empty!(OfferDirectory, D));
27740 }
27741 #[allow(irrefutable_let_patterns)]
27742 if let Offer::Directory(ref mut val) = self {
27743 fidl::decode!(OfferDirectory, D, val, decoder, _inner_offset, depth)?;
27744 } else {
27745 unreachable!()
27746 }
27747 }
27748 4 => {
27749 #[allow(irrefutable_let_patterns)]
27750 if let Offer::Storage(_) = self {
27751 } else {
27753 *self = Offer::Storage(fidl::new_empty!(OfferStorage, D));
27755 }
27756 #[allow(irrefutable_let_patterns)]
27757 if let Offer::Storage(ref mut val) = self {
27758 fidl::decode!(OfferStorage, D, val, decoder, _inner_offset, depth)?;
27759 } else {
27760 unreachable!()
27761 }
27762 }
27763 5 => {
27764 #[allow(irrefutable_let_patterns)]
27765 if let Offer::Runner(_) = self {
27766 } else {
27768 *self = Offer::Runner(fidl::new_empty!(OfferRunner, D));
27770 }
27771 #[allow(irrefutable_let_patterns)]
27772 if let Offer::Runner(ref mut val) = self {
27773 fidl::decode!(OfferRunner, D, val, decoder, _inner_offset, depth)?;
27774 } else {
27775 unreachable!()
27776 }
27777 }
27778 6 => {
27779 #[allow(irrefutable_let_patterns)]
27780 if let Offer::Resolver(_) = self {
27781 } else {
27783 *self = Offer::Resolver(fidl::new_empty!(OfferResolver, D));
27785 }
27786 #[allow(irrefutable_let_patterns)]
27787 if let Offer::Resolver(ref mut val) = self {
27788 fidl::decode!(OfferResolver, D, val, decoder, _inner_offset, depth)?;
27789 } else {
27790 unreachable!()
27791 }
27792 }
27793 8 => {
27794 #[allow(irrefutable_let_patterns)]
27795 if let Offer::EventStream(_) = self {
27796 } else {
27798 *self = Offer::EventStream(fidl::new_empty!(OfferEventStream, D));
27800 }
27801 #[allow(irrefutable_let_patterns)]
27802 if let Offer::EventStream(ref mut val) = self {
27803 fidl::decode!(OfferEventStream, D, val, decoder, _inner_offset, depth)?;
27804 } else {
27805 unreachable!()
27806 }
27807 }
27808 9 => {
27809 #[allow(irrefutable_let_patterns)]
27810 if let Offer::Dictionary(_) = self {
27811 } else {
27813 *self = Offer::Dictionary(fidl::new_empty!(OfferDictionary, D));
27815 }
27816 #[allow(irrefutable_let_patterns)]
27817 if let Offer::Dictionary(ref mut val) = self {
27818 fidl::decode!(OfferDictionary, D, val, decoder, _inner_offset, depth)?;
27819 } else {
27820 unreachable!()
27821 }
27822 }
27823 10 => {
27824 #[allow(irrefutable_let_patterns)]
27825 if let Offer::Config(_) = self {
27826 } else {
27828 *self = Offer::Config(fidl::new_empty!(OfferConfiguration, D));
27830 }
27831 #[allow(irrefutable_let_patterns)]
27832 if let Offer::Config(ref mut val) = self {
27833 fidl::decode!(OfferConfiguration, D, val, decoder, _inner_offset, depth)?;
27834 } else {
27835 unreachable!()
27836 }
27837 }
27838 #[allow(deprecated)]
27839 ordinal => {
27840 for _ in 0..num_handles {
27841 decoder.drop_next_handle()?;
27842 }
27843 *self = Offer::__SourceBreaking { unknown_ordinal: ordinal };
27844 }
27845 }
27846 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
27847 return Err(fidl::Error::InvalidNumBytesInEnvelope);
27848 }
27849 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
27850 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
27851 }
27852 Ok(())
27853 }
27854 }
27855
27856 impl fidl::encoding::ValueTypeMarker for Ref {
27857 type Borrowed<'a> = &'a Self;
27858 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
27859 value
27860 }
27861 }
27862
27863 unsafe impl fidl::encoding::TypeMarker for Ref {
27864 type Owned = Self;
27865
27866 #[inline(always)]
27867 fn inline_align(_context: fidl::encoding::Context) -> usize {
27868 8
27869 }
27870
27871 #[inline(always)]
27872 fn inline_size(_context: fidl::encoding::Context) -> usize {
27873 16
27874 }
27875 }
27876
27877 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ref, D> for &Ref {
27878 #[inline]
27879 unsafe fn encode(
27880 self,
27881 encoder: &mut fidl::encoding::Encoder<'_, D>,
27882 offset: usize,
27883 _depth: fidl::encoding::Depth,
27884 ) -> fidl::Result<()> {
27885 encoder.debug_check_bounds::<Ref>(offset);
27886 encoder.write_num::<u64>(self.ordinal(), offset);
27887 match self {
27888 Ref::Parent(ref val) => fidl::encoding::encode_in_envelope::<ParentRef, D>(
27889 <ParentRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27890 encoder,
27891 offset + 8,
27892 _depth,
27893 ),
27894 Ref::Self_(ref val) => fidl::encoding::encode_in_envelope::<SelfRef, D>(
27895 <SelfRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27896 encoder,
27897 offset + 8,
27898 _depth,
27899 ),
27900 Ref::Child(ref val) => fidl::encoding::encode_in_envelope::<ChildRef, D>(
27901 <ChildRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27902 encoder,
27903 offset + 8,
27904 _depth,
27905 ),
27906 Ref::Collection(ref val) => fidl::encoding::encode_in_envelope::<CollectionRef, D>(
27907 <CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27908 encoder,
27909 offset + 8,
27910 _depth,
27911 ),
27912 Ref::Framework(ref val) => fidl::encoding::encode_in_envelope::<FrameworkRef, D>(
27913 <FrameworkRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27914 encoder,
27915 offset + 8,
27916 _depth,
27917 ),
27918 Ref::Capability(ref val) => fidl::encoding::encode_in_envelope::<CapabilityRef, D>(
27919 <CapabilityRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27920 encoder,
27921 offset + 8,
27922 _depth,
27923 ),
27924 Ref::Debug(ref val) => fidl::encoding::encode_in_envelope::<DebugRef, D>(
27925 <DebugRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27926 encoder,
27927 offset + 8,
27928 _depth,
27929 ),
27930 Ref::VoidType(ref val) => fidl::encoding::encode_in_envelope::<VoidRef, D>(
27931 <VoidRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27932 encoder,
27933 offset + 8,
27934 _depth,
27935 ),
27936 Ref::Environment(ref val) => {
27937 fidl::encoding::encode_in_envelope::<EnvironmentRef, D>(
27938 <EnvironmentRef as fidl::encoding::ValueTypeMarker>::borrow(val),
27939 encoder,
27940 offset + 8,
27941 _depth,
27942 )
27943 }
27944 Ref::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
27945 }
27946 }
27947 }
27948
27949 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ref {
27950 #[inline(always)]
27951 fn new_empty() -> Self {
27952 Self::__SourceBreaking { unknown_ordinal: 0 }
27953 }
27954
27955 #[inline]
27956 unsafe fn decode(
27957 &mut self,
27958 decoder: &mut fidl::encoding::Decoder<'_, D>,
27959 offset: usize,
27960 mut depth: fidl::encoding::Depth,
27961 ) -> fidl::Result<()> {
27962 decoder.debug_check_bounds::<Self>(offset);
27963 #[allow(unused_variables)]
27964 let next_out_of_line = decoder.next_out_of_line();
27965 let handles_before = decoder.remaining_handles();
27966 let (ordinal, inlined, num_bytes, num_handles) =
27967 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
27968
27969 let member_inline_size = match ordinal {
27970 1 => <ParentRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27971 2 => <SelfRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27972 3 => <ChildRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27973 4 => <CollectionRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27974 5 => <FrameworkRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27975 6 => <CapabilityRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27976 7 => <DebugRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27977 8 => <VoidRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27978 9 => <EnvironmentRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27979 0 => return Err(fidl::Error::UnknownUnionTag),
27980 _ => num_bytes as usize,
27981 };
27982
27983 if inlined != (member_inline_size <= 4) {
27984 return Err(fidl::Error::InvalidInlineBitInEnvelope);
27985 }
27986 let _inner_offset;
27987 if inlined {
27988 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
27989 _inner_offset = offset + 8;
27990 } else {
27991 depth.increment()?;
27992 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
27993 }
27994 match ordinal {
27995 1 => {
27996 #[allow(irrefutable_let_patterns)]
27997 if let Ref::Parent(_) = self {
27998 } else {
28000 *self = Ref::Parent(fidl::new_empty!(ParentRef, D));
28002 }
28003 #[allow(irrefutable_let_patterns)]
28004 if let Ref::Parent(ref mut val) = self {
28005 fidl::decode!(ParentRef, D, val, decoder, _inner_offset, depth)?;
28006 } else {
28007 unreachable!()
28008 }
28009 }
28010 2 => {
28011 #[allow(irrefutable_let_patterns)]
28012 if let Ref::Self_(_) = self {
28013 } else {
28015 *self = Ref::Self_(fidl::new_empty!(SelfRef, D));
28017 }
28018 #[allow(irrefutable_let_patterns)]
28019 if let Ref::Self_(ref mut val) = self {
28020 fidl::decode!(SelfRef, D, val, decoder, _inner_offset, depth)?;
28021 } else {
28022 unreachable!()
28023 }
28024 }
28025 3 => {
28026 #[allow(irrefutable_let_patterns)]
28027 if let Ref::Child(_) = self {
28028 } else {
28030 *self = Ref::Child(fidl::new_empty!(ChildRef, D));
28032 }
28033 #[allow(irrefutable_let_patterns)]
28034 if let Ref::Child(ref mut val) = self {
28035 fidl::decode!(ChildRef, D, val, decoder, _inner_offset, depth)?;
28036 } else {
28037 unreachable!()
28038 }
28039 }
28040 4 => {
28041 #[allow(irrefutable_let_patterns)]
28042 if let Ref::Collection(_) = self {
28043 } else {
28045 *self = Ref::Collection(fidl::new_empty!(CollectionRef, D));
28047 }
28048 #[allow(irrefutable_let_patterns)]
28049 if let Ref::Collection(ref mut val) = self {
28050 fidl::decode!(CollectionRef, D, val, decoder, _inner_offset, depth)?;
28051 } else {
28052 unreachable!()
28053 }
28054 }
28055 5 => {
28056 #[allow(irrefutable_let_patterns)]
28057 if let Ref::Framework(_) = self {
28058 } else {
28060 *self = Ref::Framework(fidl::new_empty!(FrameworkRef, D));
28062 }
28063 #[allow(irrefutable_let_patterns)]
28064 if let Ref::Framework(ref mut val) = self {
28065 fidl::decode!(FrameworkRef, D, val, decoder, _inner_offset, depth)?;
28066 } else {
28067 unreachable!()
28068 }
28069 }
28070 6 => {
28071 #[allow(irrefutable_let_patterns)]
28072 if let Ref::Capability(_) = self {
28073 } else {
28075 *self = Ref::Capability(fidl::new_empty!(CapabilityRef, D));
28077 }
28078 #[allow(irrefutable_let_patterns)]
28079 if let Ref::Capability(ref mut val) = self {
28080 fidl::decode!(CapabilityRef, D, val, decoder, _inner_offset, depth)?;
28081 } else {
28082 unreachable!()
28083 }
28084 }
28085 7 => {
28086 #[allow(irrefutable_let_patterns)]
28087 if let Ref::Debug(_) = self {
28088 } else {
28090 *self = Ref::Debug(fidl::new_empty!(DebugRef, D));
28092 }
28093 #[allow(irrefutable_let_patterns)]
28094 if let Ref::Debug(ref mut val) = self {
28095 fidl::decode!(DebugRef, D, val, decoder, _inner_offset, depth)?;
28096 } else {
28097 unreachable!()
28098 }
28099 }
28100 8 => {
28101 #[allow(irrefutable_let_patterns)]
28102 if let Ref::VoidType(_) = self {
28103 } else {
28105 *self = Ref::VoidType(fidl::new_empty!(VoidRef, D));
28107 }
28108 #[allow(irrefutable_let_patterns)]
28109 if let Ref::VoidType(ref mut val) = self {
28110 fidl::decode!(VoidRef, D, val, decoder, _inner_offset, depth)?;
28111 } else {
28112 unreachable!()
28113 }
28114 }
28115 9 => {
28116 #[allow(irrefutable_let_patterns)]
28117 if let Ref::Environment(_) = self {
28118 } else {
28120 *self = Ref::Environment(fidl::new_empty!(EnvironmentRef, D));
28122 }
28123 #[allow(irrefutable_let_patterns)]
28124 if let Ref::Environment(ref mut val) = self {
28125 fidl::decode!(EnvironmentRef, D, val, decoder, _inner_offset, depth)?;
28126 } else {
28127 unreachable!()
28128 }
28129 }
28130 #[allow(deprecated)]
28131 ordinal => {
28132 for _ in 0..num_handles {
28133 decoder.drop_next_handle()?;
28134 }
28135 *self = Ref::__SourceBreaking { unknown_ordinal: ordinal };
28136 }
28137 }
28138 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
28139 return Err(fidl::Error::InvalidNumBytesInEnvelope);
28140 }
28141 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
28142 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
28143 }
28144 Ok(())
28145 }
28146 }
28147
28148 impl fidl::encoding::ValueTypeMarker for Use {
28149 type Borrowed<'a> = &'a Self;
28150 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
28151 value
28152 }
28153 }
28154
28155 unsafe impl fidl::encoding::TypeMarker for Use {
28156 type Owned = Self;
28157
28158 #[inline(always)]
28159 fn inline_align(_context: fidl::encoding::Context) -> usize {
28160 8
28161 }
28162
28163 #[inline(always)]
28164 fn inline_size(_context: fidl::encoding::Context) -> usize {
28165 16
28166 }
28167 }
28168
28169 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Use, D> for &Use {
28170 #[inline]
28171 unsafe fn encode(
28172 self,
28173 encoder: &mut fidl::encoding::Encoder<'_, D>,
28174 offset: usize,
28175 _depth: fidl::encoding::Depth,
28176 ) -> fidl::Result<()> {
28177 encoder.debug_check_bounds::<Use>(offset);
28178 encoder.write_num::<u64>(self.ordinal(), offset);
28179 match self {
28180 Use::Service(ref val) => fidl::encoding::encode_in_envelope::<UseService, D>(
28181 <UseService as fidl::encoding::ValueTypeMarker>::borrow(val),
28182 encoder,
28183 offset + 8,
28184 _depth,
28185 ),
28186 Use::Protocol(ref val) => fidl::encoding::encode_in_envelope::<UseProtocol, D>(
28187 <UseProtocol as fidl::encoding::ValueTypeMarker>::borrow(val),
28188 encoder,
28189 offset + 8,
28190 _depth,
28191 ),
28192 Use::Directory(ref val) => fidl::encoding::encode_in_envelope::<UseDirectory, D>(
28193 <UseDirectory as fidl::encoding::ValueTypeMarker>::borrow(val),
28194 encoder,
28195 offset + 8,
28196 _depth,
28197 ),
28198 Use::Storage(ref val) => fidl::encoding::encode_in_envelope::<UseStorage, D>(
28199 <UseStorage as fidl::encoding::ValueTypeMarker>::borrow(val),
28200 encoder,
28201 offset + 8,
28202 _depth,
28203 ),
28204 Use::EventStream(ref val) => {
28205 fidl::encoding::encode_in_envelope::<UseEventStream, D>(
28206 <UseEventStream as fidl::encoding::ValueTypeMarker>::borrow(val),
28207 encoder,
28208 offset + 8,
28209 _depth,
28210 )
28211 }
28212 Use::Runner(ref val) => fidl::encoding::encode_in_envelope::<UseRunner, D>(
28213 <UseRunner as fidl::encoding::ValueTypeMarker>::borrow(val),
28214 encoder,
28215 offset + 8,
28216 _depth,
28217 ),
28218 Use::Config(ref val) => fidl::encoding::encode_in_envelope::<UseConfiguration, D>(
28219 <UseConfiguration as fidl::encoding::ValueTypeMarker>::borrow(val),
28220 encoder,
28221 offset + 8,
28222 _depth,
28223 ),
28224 Use::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
28225 }
28226 }
28227 }
28228
28229 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Use {
28230 #[inline(always)]
28231 fn new_empty() -> Self {
28232 Self::__SourceBreaking { unknown_ordinal: 0 }
28233 }
28234
28235 #[inline]
28236 unsafe fn decode(
28237 &mut self,
28238 decoder: &mut fidl::encoding::Decoder<'_, D>,
28239 offset: usize,
28240 mut depth: fidl::encoding::Depth,
28241 ) -> fidl::Result<()> {
28242 decoder.debug_check_bounds::<Self>(offset);
28243 #[allow(unused_variables)]
28244 let next_out_of_line = decoder.next_out_of_line();
28245 let handles_before = decoder.remaining_handles();
28246 let (ordinal, inlined, num_bytes, num_handles) =
28247 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
28248
28249 let member_inline_size = match ordinal {
28250 1 => <UseService as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28251 2 => <UseProtocol as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28252 3 => <UseDirectory as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28253 4 => <UseStorage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28254 7 => <UseEventStream as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28255 8 => <UseRunner as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28256 9 => <UseConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28257 0 => return Err(fidl::Error::UnknownUnionTag),
28258 _ => num_bytes as usize,
28259 };
28260
28261 if inlined != (member_inline_size <= 4) {
28262 return Err(fidl::Error::InvalidInlineBitInEnvelope);
28263 }
28264 let _inner_offset;
28265 if inlined {
28266 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
28267 _inner_offset = offset + 8;
28268 } else {
28269 depth.increment()?;
28270 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
28271 }
28272 match ordinal {
28273 1 => {
28274 #[allow(irrefutable_let_patterns)]
28275 if let Use::Service(_) = self {
28276 } else {
28278 *self = Use::Service(fidl::new_empty!(UseService, D));
28280 }
28281 #[allow(irrefutable_let_patterns)]
28282 if let Use::Service(ref mut val) = self {
28283 fidl::decode!(UseService, D, val, decoder, _inner_offset, depth)?;
28284 } else {
28285 unreachable!()
28286 }
28287 }
28288 2 => {
28289 #[allow(irrefutable_let_patterns)]
28290 if let Use::Protocol(_) = self {
28291 } else {
28293 *self = Use::Protocol(fidl::new_empty!(UseProtocol, D));
28295 }
28296 #[allow(irrefutable_let_patterns)]
28297 if let Use::Protocol(ref mut val) = self {
28298 fidl::decode!(UseProtocol, D, val, decoder, _inner_offset, depth)?;
28299 } else {
28300 unreachable!()
28301 }
28302 }
28303 3 => {
28304 #[allow(irrefutable_let_patterns)]
28305 if let Use::Directory(_) = self {
28306 } else {
28308 *self = Use::Directory(fidl::new_empty!(UseDirectory, D));
28310 }
28311 #[allow(irrefutable_let_patterns)]
28312 if let Use::Directory(ref mut val) = self {
28313 fidl::decode!(UseDirectory, D, val, decoder, _inner_offset, depth)?;
28314 } else {
28315 unreachable!()
28316 }
28317 }
28318 4 => {
28319 #[allow(irrefutable_let_patterns)]
28320 if let Use::Storage(_) = self {
28321 } else {
28323 *self = Use::Storage(fidl::new_empty!(UseStorage, D));
28325 }
28326 #[allow(irrefutable_let_patterns)]
28327 if let Use::Storage(ref mut val) = self {
28328 fidl::decode!(UseStorage, D, val, decoder, _inner_offset, depth)?;
28329 } else {
28330 unreachable!()
28331 }
28332 }
28333 7 => {
28334 #[allow(irrefutable_let_patterns)]
28335 if let Use::EventStream(_) = self {
28336 } else {
28338 *self = Use::EventStream(fidl::new_empty!(UseEventStream, D));
28340 }
28341 #[allow(irrefutable_let_patterns)]
28342 if let Use::EventStream(ref mut val) = self {
28343 fidl::decode!(UseEventStream, D, val, decoder, _inner_offset, depth)?;
28344 } else {
28345 unreachable!()
28346 }
28347 }
28348 8 => {
28349 #[allow(irrefutable_let_patterns)]
28350 if let Use::Runner(_) = self {
28351 } else {
28353 *self = Use::Runner(fidl::new_empty!(UseRunner, D));
28355 }
28356 #[allow(irrefutable_let_patterns)]
28357 if let Use::Runner(ref mut val) = self {
28358 fidl::decode!(UseRunner, D, val, decoder, _inner_offset, depth)?;
28359 } else {
28360 unreachable!()
28361 }
28362 }
28363 9 => {
28364 #[allow(irrefutable_let_patterns)]
28365 if let Use::Config(_) = self {
28366 } else {
28368 *self = Use::Config(fidl::new_empty!(UseConfiguration, D));
28370 }
28371 #[allow(irrefutable_let_patterns)]
28372 if let Use::Config(ref mut val) = self {
28373 fidl::decode!(UseConfiguration, D, val, decoder, _inner_offset, depth)?;
28374 } else {
28375 unreachable!()
28376 }
28377 }
28378 #[allow(deprecated)]
28379 ordinal => {
28380 for _ in 0..num_handles {
28381 decoder.drop_next_handle()?;
28382 }
28383 *self = Use::__SourceBreaking { unknown_ordinal: ordinal };
28384 }
28385 }
28386 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
28387 return Err(fidl::Error::InvalidNumBytesInEnvelope);
28388 }
28389 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
28390 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
28391 }
28392 Ok(())
28393 }
28394 }
28395}