1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_test_conformance_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct AlternatingHandlesAndFailures {
16 pub h1: fidl::Handle,
17 pub failure_trigger1: String,
18 pub h2: fidl::Handle,
19 pub failure_trigger2: String,
20 pub h3: fidl::Handle,
21}
22
23impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
24 for AlternatingHandlesAndFailures
25{
26}
27
28#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub struct ArrayOfArrayOfNonnullableHandles {
30 pub handles: [[fidl::Handle; 3]; 4],
31}
32
33impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
34 for ArrayOfArrayOfNonnullableHandles
35{
36}
37
38#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39pub struct ArrayOfHandles {
40 pub a: [fidl::Handle; 3],
41}
42
43impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ArrayOfHandles {}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct ArrayOfNonnullableHandles {
47 pub handles: [fidl::Handle; 4],
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ArrayOfNonnullableHandles {}
51
52#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
53pub struct ArrayOfNullableHandles {
54 pub handles: [Option<fidl::Handle>; 5],
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ArrayOfNullableHandles {}
58
59#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct ArrayOfOptionalHandles {
61 pub a: [Option<fidl::Handle>; 3],
62}
63
64impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ArrayOfOptionalHandles {}
65
66#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67pub struct ArrayOfVectorOfEventInStructWithDefaultRights {
68 pub h: [Vec<fidl::Event>; 1],
69}
70
71impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
72 for ArrayOfVectorOfEventInStructWithDefaultRights
73{
74}
75
76#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
77pub struct ArrayOfVectorOfEventInStructWithReducedRights {
78 pub h: [Vec<fidl::Event>; 1],
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
82 for ArrayOfVectorOfEventInStructWithReducedRights
83{
84}
85
86#[derive(Debug, PartialEq)]
87pub struct ArrayOfVectorOfEventInTableWithDefaultRightsStruct {
88 pub t: ArrayOfVectorOfEventInTableWithDefaultRights,
89}
90
91impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
92 for ArrayOfVectorOfEventInTableWithDefaultRightsStruct
93{
94}
95
96#[derive(Debug, PartialEq)]
97pub struct ArrayOfVectorOfEventInTableWithReducedRightsStruct {
98 pub t: ArrayOfVectorOfEventInTableWithReducedRights,
99}
100
101impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
102 for ArrayOfVectorOfEventInTableWithReducedRightsStruct
103{
104}
105
106#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
107pub struct ArrayOfVectorOfEventInUnionWithDefaultRightsStruct {
108 pub u: ArrayOfVectorOfEventInUnionWithDefaultRights,
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
112 for ArrayOfVectorOfEventInUnionWithDefaultRightsStruct
113{
114}
115
116#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117pub struct ArrayOfVectorOfEventInUnionWithReducedRightsStruct {
118 pub u: ArrayOfVectorOfEventInUnionWithReducedRights,
119}
120
121impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
122 for ArrayOfVectorOfEventInUnionWithReducedRightsStruct
123{
124}
125
126#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct Bounded32NonnullableVectorOfHandles {
128 pub vh0: Vec<fidl::Handle>,
129}
130
131impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
132 for Bounded32NonnullableVectorOfHandles
133{
134}
135
136#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137pub struct Bounded32NullableVectorOfHandles {
138 pub vh0: Option<Vec<fidl::Handle>>,
139}
140
141impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
142 for Bounded32NullableVectorOfHandles
143{
144}
145
146#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147pub struct BoxOfSingleHandle {
148 pub b: Option<Box<SingleHandle>>,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BoxOfSingleHandle {}
152
153#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
154pub struct BoxOfSingleOptionalHandle {
155 pub b: Option<Box<SingleOptionalHandle>>,
156}
157
158impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BoxOfSingleOptionalHandle {}
159
160#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
161pub struct CreateComponentRequest {
162 pub launch_info: LaunchInfo,
163 pub controller: Option<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
164}
165
166impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateComponentRequest {}
167
168#[derive(Debug, PartialEq)]
169pub struct EmptyResourceTableStruct {
170 pub table: EmptyResourceTable,
171}
172
173impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EmptyResourceTableStruct {}
174
175#[derive(Debug, PartialEq)]
176pub struct EnvelopeInliningTestUnionStruct {
177 pub u: EnvelopeInliningTestUnion,
178}
179
180impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
181 for EnvelopeInliningTestUnionStruct
182{
183}
184
185#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct EventWithDefaultRights {
187 pub h: fidl::Event,
188}
189
190impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventWithDefaultRights {}
191
192#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
193pub struct EventWithReducedRights {
194 pub h: fidl::Event,
195}
196
197impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventWithReducedRights {}
198
199#[derive(Debug, PartialEq)]
200pub struct FidlvizDemo {
201 pub f1: u8,
202 pub f2: i8,
203 pub f3: u16,
204 pub f4: u32,
205 pub f5: u64,
206 pub f6: u8,
207 pub f7: u8,
208 pub f8: u16,
209 pub f9: f32,
210 pub f10: f64,
211 pub f11: bool,
212 pub f12: bool,
213 pub f13: String,
214 pub f14: Option<String>,
215 pub f15: String,
216 pub f16: Option<fidl::Handle>,
217 pub f17: fidl::Handle,
218 pub f18: [u8; 3],
219 pub f19: Vec<f64>,
220 pub f20: Option<Vec<u8>>,
221 pub f21: Vec<u8>,
222 pub f22: FidlvizBits,
223 pub f23: FidlvizEnum,
224 pub f24: FidlvizStruct1,
225 pub f25: FidlvizStruct2,
226 pub f26: Option<Box<FidlvizStruct1>>,
227 pub f27: Option<Box<FidlvizStruct2>>,
228 pub f28: FidlvizTable,
229 pub f29: FidlvizTable,
230 pub f30: Option<Box<FidlvizUnion>>,
231 pub f31: FidlvizUnion,
232}
233
234impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FidlvizDemo {}
235
236#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237pub struct GoldenHandleBasicRightsStruct {
238 pub v: fidl::Event,
239}
240
241impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
242 for GoldenHandleBasicRightsStruct
243{
244}
245
246#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
247pub struct GoldenNullableHandleStruct {
248 pub v: Option<fidl::Handle>,
249}
250
251impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
252 for GoldenNullableHandleStruct
253{
254}
255
256#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
257pub struct LaunchInfo {
258 pub url: String,
259 pub arguments: Option<Vec<String>>,
260 pub out: Option<Box<TransformerEmptyStruct>>,
261 pub err: Option<Box<TransformerEmptyStruct>>,
262 pub directory_request: Option<fidl::Channel>,
263 pub flat_namespace: Option<Box<TransformerEmptyStruct>>,
264 pub additional_services: Option<Box<TransformerEmptyStruct>>,
265}
266
267impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LaunchInfo {}
268
269#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
270pub struct MultipleBoundedNonnullableVectorsOfHandles {
271 pub vh0: Vec<fidl::Handle>,
272 pub vh1: Vec<fidl::Handle>,
273}
274
275impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
276 for MultipleBoundedNonnullableVectorsOfHandles
277{
278}
279
280#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
281pub struct MultipleBoundedNullableVectorsOfHandles {
282 pub vh0: Option<Vec<fidl::Handle>>,
283 pub vh1: Option<Vec<fidl::Handle>>,
284}
285
286impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
287 for MultipleBoundedNullableVectorsOfHandles
288{
289}
290
291#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
292pub struct MultipleHandleSubtypes {
293 pub untyped: fidl::Handle,
294 pub event: fidl::Event,
295 pub channel: fidl::Channel,
296}
297
298impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MultipleHandleSubtypes {}
299
300#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
301pub struct MultipleNonnullableHandles {
302 pub data0: u32,
303 pub handle0: fidl::Handle,
304 pub data1: u64,
305 pub handle1: fidl::Channel,
306 pub handle2: fidl::Event,
307 pub data2: u64,
308}
309
310impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
311 for MultipleNonnullableHandles
312{
313}
314
315#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
316pub struct MultipleNullableHandles {
317 pub data0: u32,
318 pub handle0: Option<fidl::Handle>,
319 pub data1: u64,
320 pub handle1: Option<fidl::Channel>,
321 pub handle2: Option<fidl::Event>,
322 pub data2: u64,
323}
324
325impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MultipleNullableHandles {}
326
327#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
328pub struct NonnullableHandle {
329 pub h: fidl::Handle,
330}
331
332impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NonnullableHandle {}
333
334#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
335pub struct NonnullableHandleArray {
336 pub handles: [fidl::Handle; 4],
337}
338
339impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NonnullableHandleArray {}
340
341#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
342pub struct NullableHandle {
343 pub h: Option<fidl::Handle>,
344}
345
346impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NullableHandle {}
347
348#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
349pub struct OutOfLineArrayOfNonnullableHandles {
350 pub handles: Option<Box<NonnullableHandleArray>>,
351}
352
353impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
354 for OutOfLineArrayOfNonnullableHandles
355{
356}
357
358#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
359pub struct Sandwich6 {
360 pub before: u32,
361 pub the_union: UnionWithVector,
362 pub after: u32,
363}
364
365impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Sandwich6 {}
366
367#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
368pub struct ShortStringThenHandle {
369 pub s: String,
370 pub h: fidl::Handle,
371}
372
373impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ShortStringThenHandle {}
374
375#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
376pub struct SingleHandle {
377 pub h: fidl::Handle,
378}
379
380impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SingleHandle {}
381
382#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
383pub struct SingleOptionalHandle {
384 pub h: Option<fidl::Handle>,
385}
386
387impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SingleOptionalHandle {}
388
389#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
390pub struct StructOfEndpoints {
391 pub client_end: fidl::endpoints::ClientEnd<ProtocolMarker>,
392 pub optional_client_end: Option<fidl::endpoints::ClientEnd<ProtocolMarker>>,
393 pub server_end: fidl::endpoints::ServerEnd<ProtocolMarker>,
394 pub optional_server_end: Option<fidl::endpoints::ServerEnd<ProtocolMarker>>,
395}
396
397impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StructOfEndpoints {}
398
399#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
400pub struct StructOfOptionalUnionOfHandle {
401 pub u: Option<Box<UnionOfHandle>>,
402}
403
404impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
405 for StructOfOptionalUnionOfHandle
406{
407}
408
409#[derive(Debug, PartialEq)]
410pub struct StructOfSimpleResourceTable {
411 pub table: SimpleResourceTable,
412}
413
414impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
415 for StructOfSimpleResourceTable
416{
417}
418
419#[derive(Debug, PartialEq)]
420pub struct TableFieldInlinedHandleStruct {
421 pub t: TableFieldInlinedHandle,
422}
423
424impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
425 for TableFieldInlinedHandleStruct
426{
427}
428
429#[derive(Debug, PartialEq)]
430pub struct TableFieldUnknownResourceStruct {
431 pub t: TableFieldUnknownResource,
432}
433
434impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
435 for TableFieldUnknownResourceStruct
436{
437}
438
439#[derive(Debug, PartialEq)]
440pub struct TableOfEndpoints {
441 pub t: TableOfEndpointsTable,
442}
443
444impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for TableOfEndpoints {}
445
446#[derive(Debug, PartialEq)]
447pub struct TableUnionWithVectorReservedSandwichStruct {
448 pub table: TableUnionWithVectorReservedSandwich,
449}
450
451impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
452 for TableUnionWithVectorReservedSandwichStruct
453{
454}
455
456#[derive(Debug, PartialEq)]
457pub struct TableUnionWithVectorStructSandwichStruct {
458 pub table: TableUnionWithVectorStructSandwich,
459}
460
461impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
462 for TableUnionWithVectorStructSandwichStruct
463{
464}
465
466#[derive(Debug, PartialEq)]
467pub struct TestFlexibleResourceXUnionInStruct {
468 pub xu: SampleResourceXUnion,
469}
470
471impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
472 for TestFlexibleResourceXUnionInStruct
473{
474}
475
476#[derive(Debug, PartialEq)]
477pub struct TestOptionalFlexibleResourceXUnionInStruct {
478 pub xu: Option<Box<SampleResourceXUnion>>,
479}
480
481impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
482 for TestOptionalFlexibleResourceXUnionInStruct
483{
484}
485
486#[derive(Debug, PartialEq)]
487pub struct TestOptionalStrictResourceXUnionInStruct {
488 pub xu: Option<Box<SampleStrictResourceXUnion>>,
489}
490
491impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
492 for TestOptionalStrictResourceXUnionInStruct
493{
494}
495
496#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
497pub struct TestPackageResolverResolveRequest {
498 pub package_url: String,
499 pub selectors: Vec<String>,
500 pub update_policy: UpdatePolicy,
501 pub this_should_be_a_handle: u32,
502}
503
504impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
505 for TestPackageResolverResolveRequest
506{
507}
508
509#[derive(Debug, PartialEq)]
510pub struct TestStrictResourceXUnionInStruct {
511 pub xu: SampleStrictResourceXUnion,
512}
513
514impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
515 for TestStrictResourceXUnionInStruct
516{
517}
518
519#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
520pub struct UnboundedNonnullableVectorOfHandles {
521 pub vh0: Vec<fidl::Handle>,
522}
523
524impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
525 for UnboundedNonnullableVectorOfHandles
526{
527}
528
529#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
530pub struct UnboundedNullableVectorOfHandles {
531 pub vh0: Option<Vec<fidl::Handle>>,
532}
533
534impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
535 for UnboundedNullableVectorOfHandles
536{
537}
538
539#[derive(Debug, PartialEq)]
540pub struct UnionOfEndpoints {
541 pub u: UnionOfEndpointsUnion,
542}
543
544impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for UnionOfEndpoints {}
545
546#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
547pub struct VectorOfArrayOfEventInStructWithDefaultRights {
548 pub h: Vec<[fidl::Event; 1]>,
549}
550
551impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
552 for VectorOfArrayOfEventInStructWithDefaultRights
553{
554}
555
556#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
557pub struct VectorOfArrayOfEventInStructWithReducedRights {
558 pub h: Vec<[fidl::Event; 1]>,
559}
560
561impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
562 for VectorOfArrayOfEventInStructWithReducedRights
563{
564}
565
566#[derive(Debug, PartialEq)]
567pub struct VectorOfArrayOfEventInTableWithReducedRightsStruct {
568 pub t: VectorOfArrayOfEventInTableWithReducedRights,
569}
570
571impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
572 for VectorOfArrayOfEventInTableWithReducedRightsStruct
573{
574}
575
576#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
577pub struct VectorOfArrayOfEventInUnionWithReducedRightsStruct {
578 pub u: VectorOfArrayOfEventInUnionWithReducedRights,
579}
580
581impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
582 for VectorOfArrayOfEventInUnionWithReducedRightsStruct
583{
584}
585
586#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
587pub struct VectorOfHandles {
588 pub v: Vec<fidl::Handle>,
589}
590
591impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VectorOfHandles {}
592
593#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
594pub struct VectorOfOptionalHandles {
595 pub v: Vec<Option<fidl::Handle>>,
596}
597
598impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VectorOfOptionalHandles {}
599
600#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
601pub struct VectorOfUpTo2Handles {
602 pub v: Vec<fidl::Handle>,
603}
604
605impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VectorOfUpTo2Handles {}
606
607#[derive(Debug, Default, PartialEq)]
608pub struct ArrayOfVectorOfEventInTableWithDefaultRights {
609 pub h: Option<[Vec<fidl::Event>; 1]>,
610 #[doc(hidden)]
611 pub __source_breaking: fidl::marker::SourceBreaking,
612}
613
614impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
615 for ArrayOfVectorOfEventInTableWithDefaultRights
616{
617}
618
619#[derive(Debug, Default, PartialEq)]
620pub struct ArrayOfVectorOfEventInTableWithReducedRights {
621 pub h: Option<[Vec<fidl::Event>; 1]>,
622 #[doc(hidden)]
623 pub __source_breaking: fidl::marker::SourceBreaking,
624}
625
626impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
627 for ArrayOfVectorOfEventInTableWithReducedRights
628{
629}
630
631#[derive(Debug, Default, PartialEq)]
632pub struct EmptyResourceTable {
633 #[doc(hidden)]
634 pub __source_breaking: fidl::marker::SourceBreaking,
635}
636
637impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EmptyResourceTable {}
638
639#[derive(Debug, Default, PartialEq)]
640pub struct SimpleResourceTable {
641 pub x: Option<i64>,
642 pub y: Option<i64>,
643 #[doc(hidden)]
644 pub __source_breaking: fidl::marker::SourceBreaking,
645}
646
647impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SimpleResourceTable {}
648
649#[derive(Debug, Default, PartialEq)]
650pub struct TableFieldInlinedHandle {
651 pub f: Option<fidl::Channel>,
652 #[doc(hidden)]
653 pub __source_breaking: fidl::marker::SourceBreaking,
654}
655
656impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for TableFieldInlinedHandle {}
657
658#[derive(Debug, Default, PartialEq)]
659pub struct TableFieldUnknownResource {
660 #[doc(hidden)]
661 pub __source_breaking: fidl::marker::SourceBreaking,
662}
663
664impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for TableFieldUnknownResource {}
665
666#[derive(Debug, Default, PartialEq)]
667pub struct TableOfEndpointsTable {
668 pub client_end: Option<fidl::endpoints::ClientEnd<ProtocolMarker>>,
669 pub server_end: Option<fidl::endpoints::ServerEnd<ProtocolMarker>>,
670 #[doc(hidden)]
671 pub __source_breaking: fidl::marker::SourceBreaking,
672}
673
674impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for TableOfEndpointsTable {}
675
676#[derive(Debug, Default, PartialEq)]
677pub struct TableUnionWithVectorReservedSandwich {
678 pub uv: Option<UnionWithVector>,
679 #[doc(hidden)]
680 pub __source_breaking: fidl::marker::SourceBreaking,
681}
682
683impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
684 for TableUnionWithVectorReservedSandwich
685{
686}
687
688#[derive(Debug, Default, PartialEq)]
689pub struct TableUnionWithVectorStructSandwich {
690 pub s1: Option<StructSize3Align1>,
691 pub uv: Option<UnionWithVector>,
692 pub s2: Option<StructSize3Align1>,
693 #[doc(hidden)]
694 pub __source_breaking: fidl::marker::SourceBreaking,
695}
696
697impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
698 for TableUnionWithVectorStructSandwich
699{
700}
701
702#[derive(Debug, Default, PartialEq)]
703pub struct VectorOfArrayOfEventInTableWithReducedRights {
704 pub h: Option<Vec<[fidl::Event; 1]>>,
705 #[doc(hidden)]
706 pub __source_breaking: fidl::marker::SourceBreaking,
707}
708
709impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
710 for VectorOfArrayOfEventInTableWithReducedRights
711{
712}
713
714#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
715pub enum ArrayOfVectorOfEventInUnionWithDefaultRights {
716 H([Vec<fidl::Event>; 1]),
717}
718
719impl ArrayOfVectorOfEventInUnionWithDefaultRights {
720 #[inline]
721 pub fn ordinal(&self) -> u64 {
722 match *self {
723 Self::H(_) => 1,
724 }
725 }
726}
727
728impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
729 for ArrayOfVectorOfEventInUnionWithDefaultRights
730{
731}
732
733#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
734pub enum ArrayOfVectorOfEventInUnionWithReducedRights {
735 H([Vec<fidl::Event>; 1]),
736}
737
738impl ArrayOfVectorOfEventInUnionWithReducedRights {
739 #[inline]
740 pub fn ordinal(&self) -> u64 {
741 match *self {
742 Self::H(_) => 1,
743 }
744 }
745}
746
747impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
748 for ArrayOfVectorOfEventInUnionWithReducedRights
749{
750}
751
752#[derive(Debug)]
753pub enum EnvelopeInliningTestUnion {
754 Small(u32),
755 Large(u64),
756 Handle(fidl::Handle),
757 #[doc(hidden)]
758 __SourceBreaking {
759 unknown_ordinal: u64,
760 },
761}
762
763#[macro_export]
765macro_rules! EnvelopeInliningTestUnionUnknown {
766 () => {
767 _
768 };
769}
770
771impl PartialEq for EnvelopeInliningTestUnion {
773 fn eq(&self, other: &Self) -> bool {
774 match (self, other) {
775 (Self::Small(x), Self::Small(y)) => *x == *y,
776 (Self::Large(x), Self::Large(y)) => *x == *y,
777 (Self::Handle(x), Self::Handle(y)) => *x == *y,
778 _ => false,
779 }
780 }
781}
782
783impl EnvelopeInliningTestUnion {
784 #[inline]
785 pub fn ordinal(&self) -> u64 {
786 match *self {
787 Self::Small(_) => 1,
788 Self::Large(_) => 2,
789 Self::Handle(_) => 3,
790 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
791 }
792 }
793
794 #[inline]
795 pub fn unknown_variant_for_testing() -> Self {
796 Self::__SourceBreaking { unknown_ordinal: 0 }
797 }
798
799 #[inline]
800 pub fn is_unknown(&self) -> bool {
801 match self {
802 Self::__SourceBreaking { .. } => true,
803 _ => false,
804 }
805 }
806}
807
808impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EnvelopeInliningTestUnion {}
809
810#[derive(Debug)]
811pub enum SampleResourceXUnion {
812 U(u32),
813 Su(SimpleUnion),
814 St(SimpleTable),
815 #[doc(hidden)]
816 __SourceBreaking {
817 unknown_ordinal: u64,
818 },
819}
820
821#[macro_export]
823macro_rules! SampleResourceXUnionUnknown {
824 () => {
825 _
826 };
827}
828
829impl PartialEq for SampleResourceXUnion {
831 fn eq(&self, other: &Self) -> bool {
832 match (self, other) {
833 (Self::U(x), Self::U(y)) => *x == *y,
834 (Self::Su(x), Self::Su(y)) => *x == *y,
835 (Self::St(x), Self::St(y)) => *x == *y,
836 _ => false,
837 }
838 }
839}
840
841impl SampleResourceXUnion {
842 #[inline]
843 pub fn ordinal(&self) -> u64 {
844 match *self {
845 Self::U(_) => 1,
846 Self::Su(_) => 2,
847 Self::St(_) => 3,
848 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
849 }
850 }
851
852 #[inline]
853 pub fn unknown_variant_for_testing() -> Self {
854 Self::__SourceBreaking { unknown_ordinal: 0 }
855 }
856
857 #[inline]
858 pub fn is_unknown(&self) -> bool {
859 match self {
860 Self::__SourceBreaking { .. } => true,
861 _ => false,
862 }
863 }
864}
865
866impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SampleResourceXUnion {}
867
868#[derive(Debug, PartialEq)]
869pub enum SampleStrictResourceXUnion {
870 U(u32),
871 Su(SimpleUnion),
872 St(SimpleTable),
873}
874
875impl SampleStrictResourceXUnion {
876 #[inline]
877 pub fn ordinal(&self) -> u64 {
878 match *self {
879 Self::U(_) => 1,
880 Self::Su(_) => 2,
881 Self::St(_) => 3,
882 }
883 }
884}
885
886impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
887 for SampleStrictResourceXUnion
888{
889}
890
891#[derive(Debug)]
892pub enum UnionOfEndpointsUnion {
893 ClientEnd(fidl::endpoints::ClientEnd<ProtocolMarker>),
894 ServerEnd(fidl::endpoints::ServerEnd<ProtocolMarker>),
895 #[doc(hidden)]
896 __SourceBreaking {
897 unknown_ordinal: u64,
898 },
899}
900
901#[macro_export]
903macro_rules! UnionOfEndpointsUnionUnknown {
904 () => {
905 _
906 };
907}
908
909impl PartialEq for UnionOfEndpointsUnion {
911 fn eq(&self, other: &Self) -> bool {
912 match (self, other) {
913 (Self::ClientEnd(x), Self::ClientEnd(y)) => *x == *y,
914 (Self::ServerEnd(x), Self::ServerEnd(y)) => *x == *y,
915 _ => false,
916 }
917 }
918}
919
920impl UnionOfEndpointsUnion {
921 #[inline]
922 pub fn ordinal(&self) -> u64 {
923 match *self {
924 Self::ClientEnd(_) => 1,
925 Self::ServerEnd(_) => 2,
926 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
927 }
928 }
929
930 #[inline]
931 pub fn unknown_variant_for_testing() -> Self {
932 Self::__SourceBreaking { unknown_ordinal: 0 }
933 }
934
935 #[inline]
936 pub fn is_unknown(&self) -> bool {
937 match self {
938 Self::__SourceBreaking { .. } => true,
939 _ => false,
940 }
941 }
942}
943
944impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for UnionOfEndpointsUnion {}
945
946#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
947pub enum UnionOfHandle {
948 H(fidl::Handle),
949}
950
951impl UnionOfHandle {
952 #[inline]
953 pub fn ordinal(&self) -> u64 {
954 match *self {
955 Self::H(_) => 1,
956 }
957 }
958}
959
960impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for UnionOfHandle {}
961
962#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
963pub enum UnionWithVector {
964 Unused(u8),
965 VectorOfUint8(Vec<u8>),
966 S(String),
967 VectorS3A1(Vec<StructSize3Align1>),
968 VectorS3A2(Vec<StructSize3Align2>),
969 Handles(Vec<fidl::Handle>),
970 ArrayS3A1([StructSize3Align1; 2]),
971 ArrayS3A2([StructSize3Align2; 2]),
972 VectorUnion(Vec<UnionSize8Align4>),
973}
974
975impl UnionWithVector {
976 #[inline]
977 pub fn ordinal(&self) -> u64 {
978 match *self {
979 Self::Unused(_) => 1,
980 Self::VectorOfUint8(_) => 2,
981 Self::S(_) => 3,
982 Self::VectorS3A1(_) => 4,
983 Self::VectorS3A2(_) => 5,
984 Self::Handles(_) => 6,
985 Self::ArrayS3A1(_) => 7,
986 Self::ArrayS3A2(_) => 8,
987 Self::VectorUnion(_) => 9,
988 }
989 }
990}
991
992impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for UnionWithVector {}
993
994#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
995pub enum VectorOfArrayOfEventInUnionWithReducedRights {
996 H(Vec<[fidl::Event; 1]>),
997}
998
999impl VectorOfArrayOfEventInUnionWithReducedRights {
1000 #[inline]
1001 pub fn ordinal(&self) -> u64 {
1002 match *self {
1003 Self::H(_) => 1,
1004 }
1005 }
1006}
1007
1008impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
1009 for VectorOfArrayOfEventInUnionWithReducedRights
1010{
1011}
1012
1013#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1014pub struct ComponentControllerMarker;
1015
1016impl fidl::endpoints::ProtocolMarker for ComponentControllerMarker {
1017 type Proxy = ComponentControllerProxy;
1018 type RequestStream = ComponentControllerRequestStream;
1019 #[cfg(target_os = "fuchsia")]
1020 type SynchronousProxy = ComponentControllerSynchronousProxy;
1021
1022 const DEBUG_NAME: &'static str = "(anonymous) ComponentController";
1023}
1024
1025pub trait ComponentControllerProxyInterface: Send + Sync {}
1026#[derive(Debug)]
1027#[cfg(target_os = "fuchsia")]
1028pub struct ComponentControllerSynchronousProxy {
1029 client: fidl::client::sync::Client,
1030}
1031
1032#[cfg(target_os = "fuchsia")]
1033impl fidl::endpoints::SynchronousProxy for ComponentControllerSynchronousProxy {
1034 type Proxy = ComponentControllerProxy;
1035 type Protocol = ComponentControllerMarker;
1036
1037 fn from_channel(inner: fidl::Channel) -> Self {
1038 Self::new(inner)
1039 }
1040
1041 fn into_channel(self) -> fidl::Channel {
1042 self.client.into_channel()
1043 }
1044
1045 fn as_channel(&self) -> &fidl::Channel {
1046 self.client.as_channel()
1047 }
1048}
1049
1050#[cfg(target_os = "fuchsia")]
1051impl ComponentControllerSynchronousProxy {
1052 pub fn new(channel: fidl::Channel) -> Self {
1053 let protocol_name =
1054 <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1055 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1056 }
1057
1058 pub fn into_channel(self) -> fidl::Channel {
1059 self.client.into_channel()
1060 }
1061
1062 pub fn wait_for_event(
1065 &self,
1066 deadline: zx::MonotonicInstant,
1067 ) -> Result<ComponentControllerEvent, fidl::Error> {
1068 ComponentControllerEvent::decode(self.client.wait_for_event(deadline)?)
1069 }
1070}
1071
1072#[cfg(target_os = "fuchsia")]
1073impl From<ComponentControllerSynchronousProxy> for zx::Handle {
1074 fn from(value: ComponentControllerSynchronousProxy) -> Self {
1075 value.into_channel().into()
1076 }
1077}
1078
1079#[cfg(target_os = "fuchsia")]
1080impl From<fidl::Channel> for ComponentControllerSynchronousProxy {
1081 fn from(value: fidl::Channel) -> Self {
1082 Self::new(value)
1083 }
1084}
1085
1086#[derive(Debug, Clone)]
1087pub struct ComponentControllerProxy {
1088 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1089}
1090
1091impl fidl::endpoints::Proxy for ComponentControllerProxy {
1092 type Protocol = ComponentControllerMarker;
1093
1094 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1095 Self::new(inner)
1096 }
1097
1098 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1099 self.client.into_channel().map_err(|client| Self { client })
1100 }
1101
1102 fn as_channel(&self) -> &::fidl::AsyncChannel {
1103 self.client.as_channel()
1104 }
1105}
1106
1107impl ComponentControllerProxy {
1108 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1110 let protocol_name =
1111 <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1112 Self { client: fidl::client::Client::new(channel, protocol_name) }
1113 }
1114
1115 pub fn take_event_stream(&self) -> ComponentControllerEventStream {
1121 ComponentControllerEventStream { event_receiver: self.client.take_event_receiver() }
1122 }
1123}
1124
1125impl ComponentControllerProxyInterface for ComponentControllerProxy {}
1126
1127pub struct ComponentControllerEventStream {
1128 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1129}
1130
1131impl std::marker::Unpin for ComponentControllerEventStream {}
1132
1133impl futures::stream::FusedStream for ComponentControllerEventStream {
1134 fn is_terminated(&self) -> bool {
1135 self.event_receiver.is_terminated()
1136 }
1137}
1138
1139impl futures::Stream for ComponentControllerEventStream {
1140 type Item = Result<ComponentControllerEvent, fidl::Error>;
1141
1142 fn poll_next(
1143 mut self: std::pin::Pin<&mut Self>,
1144 cx: &mut std::task::Context<'_>,
1145 ) -> std::task::Poll<Option<Self::Item>> {
1146 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1147 &mut self.event_receiver,
1148 cx
1149 )?) {
1150 Some(buf) => std::task::Poll::Ready(Some(ComponentControllerEvent::decode(buf))),
1151 None => std::task::Poll::Ready(None),
1152 }
1153 }
1154}
1155
1156#[derive(Debug)]
1157pub enum ComponentControllerEvent {}
1158
1159impl ComponentControllerEvent {
1160 fn decode(
1162 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1163 ) -> Result<ComponentControllerEvent, fidl::Error> {
1164 let (bytes, _handles) = buf.split_mut();
1165 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1166 debug_assert_eq!(tx_header.tx_id, 0);
1167 match tx_header.ordinal {
1168 _ => Err(fidl::Error::UnknownOrdinal {
1169 ordinal: tx_header.ordinal,
1170 protocol_name:
1171 <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1172 }),
1173 }
1174 }
1175}
1176
1177pub struct ComponentControllerRequestStream {
1179 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1180 is_terminated: bool,
1181}
1182
1183impl std::marker::Unpin for ComponentControllerRequestStream {}
1184
1185impl futures::stream::FusedStream for ComponentControllerRequestStream {
1186 fn is_terminated(&self) -> bool {
1187 self.is_terminated
1188 }
1189}
1190
1191impl fidl::endpoints::RequestStream for ComponentControllerRequestStream {
1192 type Protocol = ComponentControllerMarker;
1193 type ControlHandle = ComponentControllerControlHandle;
1194
1195 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1196 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1197 }
1198
1199 fn control_handle(&self) -> Self::ControlHandle {
1200 ComponentControllerControlHandle { inner: self.inner.clone() }
1201 }
1202
1203 fn into_inner(
1204 self,
1205 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1206 {
1207 (self.inner, self.is_terminated)
1208 }
1209
1210 fn from_inner(
1211 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1212 is_terminated: bool,
1213 ) -> Self {
1214 Self { inner, is_terminated }
1215 }
1216}
1217
1218impl futures::Stream for ComponentControllerRequestStream {
1219 type Item = Result<ComponentControllerRequest, fidl::Error>;
1220
1221 fn poll_next(
1222 mut self: std::pin::Pin<&mut Self>,
1223 cx: &mut std::task::Context<'_>,
1224 ) -> std::task::Poll<Option<Self::Item>> {
1225 let this = &mut *self;
1226 if this.inner.check_shutdown(cx) {
1227 this.is_terminated = true;
1228 return std::task::Poll::Ready(None);
1229 }
1230 if this.is_terminated {
1231 panic!("polled ComponentControllerRequestStream after completion");
1232 }
1233 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1234 |bytes, handles| {
1235 match this.inner.channel().read_etc(cx, bytes, handles) {
1236 std::task::Poll::Ready(Ok(())) => {}
1237 std::task::Poll::Pending => return std::task::Poll::Pending,
1238 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1239 this.is_terminated = true;
1240 return std::task::Poll::Ready(None);
1241 }
1242 std::task::Poll::Ready(Err(e)) => {
1243 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1244 e.into(),
1245 ))))
1246 }
1247 }
1248
1249 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1251
1252 std::task::Poll::Ready(Some(match header.ordinal {
1253 _ => Err(fidl::Error::UnknownOrdinal {
1254 ordinal: header.ordinal,
1255 protocol_name: <ComponentControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1256 }),
1257 }))
1258 },
1259 )
1260 }
1261}
1262
1263#[derive(Debug)]
1264pub enum ComponentControllerRequest {}
1265
1266impl ComponentControllerRequest {
1267 pub fn method_name(&self) -> &'static str {
1269 match *self {}
1270 }
1271}
1272
1273#[derive(Debug, Clone)]
1274pub struct ComponentControllerControlHandle {
1275 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1276}
1277
1278impl fidl::endpoints::ControlHandle for ComponentControllerControlHandle {
1279 fn shutdown(&self) {
1280 self.inner.shutdown()
1281 }
1282 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1283 self.inner.shutdown_with_epitaph(status)
1284 }
1285
1286 fn is_closed(&self) -> bool {
1287 self.inner.channel().is_closed()
1288 }
1289 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1290 self.inner.channel().on_closed()
1291 }
1292
1293 #[cfg(target_os = "fuchsia")]
1294 fn signal_peer(
1295 &self,
1296 clear_mask: zx::Signals,
1297 set_mask: zx::Signals,
1298 ) -> Result<(), zx_status::Status> {
1299 use fidl::Peered;
1300 self.inner.channel().signal_peer(clear_mask, set_mask)
1301 }
1302}
1303
1304impl ComponentControllerControlHandle {}
1305
1306#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1307pub struct ProtocolMarker;
1308
1309impl fidl::endpoints::ProtocolMarker for ProtocolMarker {
1310 type Proxy = ProtocolProxy;
1311 type RequestStream = ProtocolRequestStream;
1312 #[cfg(target_os = "fuchsia")]
1313 type SynchronousProxy = ProtocolSynchronousProxy;
1314
1315 const DEBUG_NAME: &'static str = "(anonymous) Protocol";
1316}
1317
1318pub trait ProtocolProxyInterface: Send + Sync {}
1319#[derive(Debug)]
1320#[cfg(target_os = "fuchsia")]
1321pub struct ProtocolSynchronousProxy {
1322 client: fidl::client::sync::Client,
1323}
1324
1325#[cfg(target_os = "fuchsia")]
1326impl fidl::endpoints::SynchronousProxy for ProtocolSynchronousProxy {
1327 type Proxy = ProtocolProxy;
1328 type Protocol = ProtocolMarker;
1329
1330 fn from_channel(inner: fidl::Channel) -> Self {
1331 Self::new(inner)
1332 }
1333
1334 fn into_channel(self) -> fidl::Channel {
1335 self.client.into_channel()
1336 }
1337
1338 fn as_channel(&self) -> &fidl::Channel {
1339 self.client.as_channel()
1340 }
1341}
1342
1343#[cfg(target_os = "fuchsia")]
1344impl ProtocolSynchronousProxy {
1345 pub fn new(channel: fidl::Channel) -> Self {
1346 let protocol_name = <ProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1347 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1348 }
1349
1350 pub fn into_channel(self) -> fidl::Channel {
1351 self.client.into_channel()
1352 }
1353
1354 pub fn wait_for_event(
1357 &self,
1358 deadline: zx::MonotonicInstant,
1359 ) -> Result<ProtocolEvent, fidl::Error> {
1360 ProtocolEvent::decode(self.client.wait_for_event(deadline)?)
1361 }
1362}
1363
1364#[cfg(target_os = "fuchsia")]
1365impl From<ProtocolSynchronousProxy> for zx::Handle {
1366 fn from(value: ProtocolSynchronousProxy) -> Self {
1367 value.into_channel().into()
1368 }
1369}
1370
1371#[cfg(target_os = "fuchsia")]
1372impl From<fidl::Channel> for ProtocolSynchronousProxy {
1373 fn from(value: fidl::Channel) -> Self {
1374 Self::new(value)
1375 }
1376}
1377
1378#[derive(Debug, Clone)]
1379pub struct ProtocolProxy {
1380 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1381}
1382
1383impl fidl::endpoints::Proxy for ProtocolProxy {
1384 type Protocol = ProtocolMarker;
1385
1386 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1387 Self::new(inner)
1388 }
1389
1390 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1391 self.client.into_channel().map_err(|client| Self { client })
1392 }
1393
1394 fn as_channel(&self) -> &::fidl::AsyncChannel {
1395 self.client.as_channel()
1396 }
1397}
1398
1399impl ProtocolProxy {
1400 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1402 let protocol_name = <ProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1403 Self { client: fidl::client::Client::new(channel, protocol_name) }
1404 }
1405
1406 pub fn take_event_stream(&self) -> ProtocolEventStream {
1412 ProtocolEventStream { event_receiver: self.client.take_event_receiver() }
1413 }
1414}
1415
1416impl ProtocolProxyInterface for ProtocolProxy {}
1417
1418pub struct ProtocolEventStream {
1419 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1420}
1421
1422impl std::marker::Unpin for ProtocolEventStream {}
1423
1424impl futures::stream::FusedStream for ProtocolEventStream {
1425 fn is_terminated(&self) -> bool {
1426 self.event_receiver.is_terminated()
1427 }
1428}
1429
1430impl futures::Stream for ProtocolEventStream {
1431 type Item = Result<ProtocolEvent, fidl::Error>;
1432
1433 fn poll_next(
1434 mut self: std::pin::Pin<&mut Self>,
1435 cx: &mut std::task::Context<'_>,
1436 ) -> std::task::Poll<Option<Self::Item>> {
1437 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1438 &mut self.event_receiver,
1439 cx
1440 )?) {
1441 Some(buf) => std::task::Poll::Ready(Some(ProtocolEvent::decode(buf))),
1442 None => std::task::Poll::Ready(None),
1443 }
1444 }
1445}
1446
1447#[derive(Debug)]
1448pub enum ProtocolEvent {}
1449
1450impl ProtocolEvent {
1451 fn decode(
1453 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1454 ) -> Result<ProtocolEvent, fidl::Error> {
1455 let (bytes, _handles) = buf.split_mut();
1456 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1457 debug_assert_eq!(tx_header.tx_id, 0);
1458 match tx_header.ordinal {
1459 _ => Err(fidl::Error::UnknownOrdinal {
1460 ordinal: tx_header.ordinal,
1461 protocol_name: <ProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1462 }),
1463 }
1464 }
1465}
1466
1467pub struct ProtocolRequestStream {
1469 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1470 is_terminated: bool,
1471}
1472
1473impl std::marker::Unpin for ProtocolRequestStream {}
1474
1475impl futures::stream::FusedStream for ProtocolRequestStream {
1476 fn is_terminated(&self) -> bool {
1477 self.is_terminated
1478 }
1479}
1480
1481impl fidl::endpoints::RequestStream for ProtocolRequestStream {
1482 type Protocol = ProtocolMarker;
1483 type ControlHandle = ProtocolControlHandle;
1484
1485 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1486 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1487 }
1488
1489 fn control_handle(&self) -> Self::ControlHandle {
1490 ProtocolControlHandle { inner: self.inner.clone() }
1491 }
1492
1493 fn into_inner(
1494 self,
1495 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1496 {
1497 (self.inner, self.is_terminated)
1498 }
1499
1500 fn from_inner(
1501 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1502 is_terminated: bool,
1503 ) -> Self {
1504 Self { inner, is_terminated }
1505 }
1506}
1507
1508impl futures::Stream for ProtocolRequestStream {
1509 type Item = Result<ProtocolRequest, fidl::Error>;
1510
1511 fn poll_next(
1512 mut self: std::pin::Pin<&mut Self>,
1513 cx: &mut std::task::Context<'_>,
1514 ) -> std::task::Poll<Option<Self::Item>> {
1515 let this = &mut *self;
1516 if this.inner.check_shutdown(cx) {
1517 this.is_terminated = true;
1518 return std::task::Poll::Ready(None);
1519 }
1520 if this.is_terminated {
1521 panic!("polled ProtocolRequestStream after completion");
1522 }
1523 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1524 |bytes, handles| {
1525 match this.inner.channel().read_etc(cx, bytes, handles) {
1526 std::task::Poll::Ready(Ok(())) => {}
1527 std::task::Poll::Pending => return std::task::Poll::Pending,
1528 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1529 this.is_terminated = true;
1530 return std::task::Poll::Ready(None);
1531 }
1532 std::task::Poll::Ready(Err(e)) => {
1533 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1534 e.into(),
1535 ))))
1536 }
1537 }
1538
1539 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1541
1542 std::task::Poll::Ready(Some(match header.ordinal {
1543 _ => Err(fidl::Error::UnknownOrdinal {
1544 ordinal: header.ordinal,
1545 protocol_name:
1546 <ProtocolMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1547 }),
1548 }))
1549 },
1550 )
1551 }
1552}
1553
1554#[derive(Debug)]
1555pub enum ProtocolRequest {}
1556
1557impl ProtocolRequest {
1558 pub fn method_name(&self) -> &'static str {
1560 match *self {}
1561 }
1562}
1563
1564#[derive(Debug, Clone)]
1565pub struct ProtocolControlHandle {
1566 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1567}
1568
1569impl fidl::endpoints::ControlHandle for ProtocolControlHandle {
1570 fn shutdown(&self) {
1571 self.inner.shutdown()
1572 }
1573 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1574 self.inner.shutdown_with_epitaph(status)
1575 }
1576
1577 fn is_closed(&self) -> bool {
1578 self.inner.channel().is_closed()
1579 }
1580 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1581 self.inner.channel().on_closed()
1582 }
1583
1584 #[cfg(target_os = "fuchsia")]
1585 fn signal_peer(
1586 &self,
1587 clear_mask: zx::Signals,
1588 set_mask: zx::Signals,
1589 ) -> Result<(), zx_status::Status> {
1590 use fidl::Peered;
1591 self.inner.channel().signal_peer(clear_mask, set_mask)
1592 }
1593}
1594
1595impl ProtocolControlHandle {}
1596
1597mod internal {
1598 use super::*;
1599
1600 impl fidl::encoding::ResourceTypeMarker for AlternatingHandlesAndFailures {
1601 type Borrowed<'a> = &'a mut Self;
1602 fn take_or_borrow<'a>(
1603 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1604 ) -> Self::Borrowed<'a> {
1605 value
1606 }
1607 }
1608
1609 unsafe impl fidl::encoding::TypeMarker for AlternatingHandlesAndFailures {
1610 type Owned = Self;
1611
1612 #[inline(always)]
1613 fn inline_align(_context: fidl::encoding::Context) -> usize {
1614 8
1615 }
1616
1617 #[inline(always)]
1618 fn inline_size(_context: fidl::encoding::Context) -> usize {
1619 56
1620 }
1621 }
1622
1623 unsafe impl
1624 fidl::encoding::Encode<
1625 AlternatingHandlesAndFailures,
1626 fidl::encoding::DefaultFuchsiaResourceDialect,
1627 > for &mut AlternatingHandlesAndFailures
1628 {
1629 #[inline]
1630 unsafe fn encode(
1631 self,
1632 encoder: &mut fidl::encoding::Encoder<
1633 '_,
1634 fidl::encoding::DefaultFuchsiaResourceDialect,
1635 >,
1636 offset: usize,
1637 _depth: fidl::encoding::Depth,
1638 ) -> fidl::Result<()> {
1639 encoder.debug_check_bounds::<AlternatingHandlesAndFailures>(offset);
1640 fidl::encoding::Encode::<
1642 AlternatingHandlesAndFailures,
1643 fidl::encoding::DefaultFuchsiaResourceDialect,
1644 >::encode(
1645 (
1646 <fidl::encoding::HandleType<
1647 fidl::Handle,
1648 { fidl::ObjectType::NONE.into_raw() },
1649 2147483648,
1650 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1651 &mut self.h1
1652 ),
1653 <fidl::encoding::BoundedString<1> as fidl::encoding::ValueTypeMarker>::borrow(
1654 &self.failure_trigger1,
1655 ),
1656 <fidl::encoding::HandleType<
1657 fidl::Handle,
1658 { fidl::ObjectType::NONE.into_raw() },
1659 2147483648,
1660 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1661 &mut self.h2
1662 ),
1663 <fidl::encoding::BoundedString<1> as fidl::encoding::ValueTypeMarker>::borrow(
1664 &self.failure_trigger2,
1665 ),
1666 <fidl::encoding::HandleType<
1667 fidl::Handle,
1668 { fidl::ObjectType::NONE.into_raw() },
1669 2147483648,
1670 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1671 &mut self.h3
1672 ),
1673 ),
1674 encoder,
1675 offset,
1676 _depth,
1677 )
1678 }
1679 }
1680 unsafe impl<
1681 T0: fidl::encoding::Encode<
1682 fidl::encoding::HandleType<
1683 fidl::Handle,
1684 { fidl::ObjectType::NONE.into_raw() },
1685 2147483648,
1686 >,
1687 fidl::encoding::DefaultFuchsiaResourceDialect,
1688 >,
1689 T1: fidl::encoding::Encode<
1690 fidl::encoding::BoundedString<1>,
1691 fidl::encoding::DefaultFuchsiaResourceDialect,
1692 >,
1693 T2: fidl::encoding::Encode<
1694 fidl::encoding::HandleType<
1695 fidl::Handle,
1696 { fidl::ObjectType::NONE.into_raw() },
1697 2147483648,
1698 >,
1699 fidl::encoding::DefaultFuchsiaResourceDialect,
1700 >,
1701 T3: fidl::encoding::Encode<
1702 fidl::encoding::BoundedString<1>,
1703 fidl::encoding::DefaultFuchsiaResourceDialect,
1704 >,
1705 T4: fidl::encoding::Encode<
1706 fidl::encoding::HandleType<
1707 fidl::Handle,
1708 { fidl::ObjectType::NONE.into_raw() },
1709 2147483648,
1710 >,
1711 fidl::encoding::DefaultFuchsiaResourceDialect,
1712 >,
1713 >
1714 fidl::encoding::Encode<
1715 AlternatingHandlesAndFailures,
1716 fidl::encoding::DefaultFuchsiaResourceDialect,
1717 > for (T0, T1, T2, T3, T4)
1718 {
1719 #[inline]
1720 unsafe fn encode(
1721 self,
1722 encoder: &mut fidl::encoding::Encoder<
1723 '_,
1724 fidl::encoding::DefaultFuchsiaResourceDialect,
1725 >,
1726 offset: usize,
1727 depth: fidl::encoding::Depth,
1728 ) -> fidl::Result<()> {
1729 encoder.debug_check_bounds::<AlternatingHandlesAndFailures>(offset);
1730 unsafe {
1733 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1734 (ptr as *mut u64).write_unaligned(0);
1735 }
1736 unsafe {
1737 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1738 (ptr as *mut u64).write_unaligned(0);
1739 }
1740 unsafe {
1741 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
1742 (ptr as *mut u64).write_unaligned(0);
1743 }
1744 self.0.encode(encoder, offset + 0, depth)?;
1746 self.1.encode(encoder, offset + 8, depth)?;
1747 self.2.encode(encoder, offset + 24, depth)?;
1748 self.3.encode(encoder, offset + 32, depth)?;
1749 self.4.encode(encoder, offset + 48, depth)?;
1750 Ok(())
1751 }
1752 }
1753
1754 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1755 for AlternatingHandlesAndFailures
1756 {
1757 #[inline(always)]
1758 fn new_empty() -> Self {
1759 Self {
1760 h1: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1761 failure_trigger1: fidl::new_empty!(
1762 fidl::encoding::BoundedString<1>,
1763 fidl::encoding::DefaultFuchsiaResourceDialect
1764 ),
1765 h2: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1766 failure_trigger2: fidl::new_empty!(
1767 fidl::encoding::BoundedString<1>,
1768 fidl::encoding::DefaultFuchsiaResourceDialect
1769 ),
1770 h3: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1771 }
1772 }
1773
1774 #[inline]
1775 unsafe fn decode(
1776 &mut self,
1777 decoder: &mut fidl::encoding::Decoder<
1778 '_,
1779 fidl::encoding::DefaultFuchsiaResourceDialect,
1780 >,
1781 offset: usize,
1782 _depth: fidl::encoding::Depth,
1783 ) -> fidl::Result<()> {
1784 decoder.debug_check_bounds::<Self>(offset);
1785 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1787 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1788 let mask = 0xffffffff00000000u64;
1789 let maskedval = padval & mask;
1790 if maskedval != 0 {
1791 return Err(fidl::Error::NonZeroPadding {
1792 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1793 });
1794 }
1795 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1796 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1797 let mask = 0xffffffff00000000u64;
1798 let maskedval = padval & mask;
1799 if maskedval != 0 {
1800 return Err(fidl::Error::NonZeroPadding {
1801 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1802 });
1803 }
1804 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
1805 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1806 let mask = 0xffffffff00000000u64;
1807 let maskedval = padval & mask;
1808 if maskedval != 0 {
1809 return Err(fidl::Error::NonZeroPadding {
1810 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
1811 });
1812 }
1813 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h1, decoder, offset + 0, _depth)?;
1814 fidl::decode!(
1815 fidl::encoding::BoundedString<1>,
1816 fidl::encoding::DefaultFuchsiaResourceDialect,
1817 &mut self.failure_trigger1,
1818 decoder,
1819 offset + 8,
1820 _depth
1821 )?;
1822 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h2, decoder, offset + 24, _depth)?;
1823 fidl::decode!(
1824 fidl::encoding::BoundedString<1>,
1825 fidl::encoding::DefaultFuchsiaResourceDialect,
1826 &mut self.failure_trigger2,
1827 decoder,
1828 offset + 32,
1829 _depth
1830 )?;
1831 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h3, decoder, offset + 48, _depth)?;
1832 Ok(())
1833 }
1834 }
1835
1836 impl fidl::encoding::ResourceTypeMarker for ArrayOfArrayOfNonnullableHandles {
1837 type Borrowed<'a> = &'a mut Self;
1838 fn take_or_borrow<'a>(
1839 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1840 ) -> Self::Borrowed<'a> {
1841 value
1842 }
1843 }
1844
1845 unsafe impl fidl::encoding::TypeMarker for ArrayOfArrayOfNonnullableHandles {
1846 type Owned = Self;
1847
1848 #[inline(always)]
1849 fn inline_align(_context: fidl::encoding::Context) -> usize {
1850 4
1851 }
1852
1853 #[inline(always)]
1854 fn inline_size(_context: fidl::encoding::Context) -> usize {
1855 48
1856 }
1857 }
1858
1859 unsafe impl
1860 fidl::encoding::Encode<
1861 ArrayOfArrayOfNonnullableHandles,
1862 fidl::encoding::DefaultFuchsiaResourceDialect,
1863 > for &mut ArrayOfArrayOfNonnullableHandles
1864 {
1865 #[inline]
1866 unsafe fn encode(
1867 self,
1868 encoder: &mut fidl::encoding::Encoder<
1869 '_,
1870 fidl::encoding::DefaultFuchsiaResourceDialect,
1871 >,
1872 offset: usize,
1873 _depth: fidl::encoding::Depth,
1874 ) -> fidl::Result<()> {
1875 encoder.debug_check_bounds::<ArrayOfArrayOfNonnullableHandles>(offset);
1876 fidl::encoding::Encode::<
1878 ArrayOfArrayOfNonnullableHandles,
1879 fidl::encoding::DefaultFuchsiaResourceDialect,
1880 >::encode(
1881 (<fidl::encoding::Array<
1882 fidl::encoding::Array<
1883 fidl::encoding::HandleType<
1884 fidl::Handle,
1885 { fidl::ObjectType::NONE.into_raw() },
1886 2147483648,
1887 >,
1888 3,
1889 >,
1890 4,
1891 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1892 &mut self.handles
1893 ),),
1894 encoder,
1895 offset,
1896 _depth,
1897 )
1898 }
1899 }
1900 unsafe impl<
1901 T0: fidl::encoding::Encode<
1902 fidl::encoding::Array<
1903 fidl::encoding::Array<
1904 fidl::encoding::HandleType<
1905 fidl::Handle,
1906 { fidl::ObjectType::NONE.into_raw() },
1907 2147483648,
1908 >,
1909 3,
1910 >,
1911 4,
1912 >,
1913 fidl::encoding::DefaultFuchsiaResourceDialect,
1914 >,
1915 >
1916 fidl::encoding::Encode<
1917 ArrayOfArrayOfNonnullableHandles,
1918 fidl::encoding::DefaultFuchsiaResourceDialect,
1919 > for (T0,)
1920 {
1921 #[inline]
1922 unsafe fn encode(
1923 self,
1924 encoder: &mut fidl::encoding::Encoder<
1925 '_,
1926 fidl::encoding::DefaultFuchsiaResourceDialect,
1927 >,
1928 offset: usize,
1929 depth: fidl::encoding::Depth,
1930 ) -> fidl::Result<()> {
1931 encoder.debug_check_bounds::<ArrayOfArrayOfNonnullableHandles>(offset);
1932 self.0.encode(encoder, offset + 0, depth)?;
1936 Ok(())
1937 }
1938 }
1939
1940 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1941 for ArrayOfArrayOfNonnullableHandles
1942 {
1943 #[inline(always)]
1944 fn new_empty() -> Self {
1945 Self {
1946 handles: fidl::new_empty!(
1947 fidl::encoding::Array<
1948 fidl::encoding::Array<
1949 fidl::encoding::HandleType<
1950 fidl::Handle,
1951 { fidl::ObjectType::NONE.into_raw() },
1952 2147483648,
1953 >,
1954 3,
1955 >,
1956 4,
1957 >,
1958 fidl::encoding::DefaultFuchsiaResourceDialect
1959 ),
1960 }
1961 }
1962
1963 #[inline]
1964 unsafe fn decode(
1965 &mut self,
1966 decoder: &mut fidl::encoding::Decoder<
1967 '_,
1968 fidl::encoding::DefaultFuchsiaResourceDialect,
1969 >,
1970 offset: usize,
1971 _depth: fidl::encoding::Depth,
1972 ) -> fidl::Result<()> {
1973 decoder.debug_check_bounds::<Self>(offset);
1974 fidl::decode!(
1976 fidl::encoding::Array<
1977 fidl::encoding::Array<
1978 fidl::encoding::HandleType<
1979 fidl::Handle,
1980 { fidl::ObjectType::NONE.into_raw() },
1981 2147483648,
1982 >,
1983 3,
1984 >,
1985 4,
1986 >,
1987 fidl::encoding::DefaultFuchsiaResourceDialect,
1988 &mut self.handles,
1989 decoder,
1990 offset + 0,
1991 _depth
1992 )?;
1993 Ok(())
1994 }
1995 }
1996
1997 impl fidl::encoding::ResourceTypeMarker for ArrayOfHandles {
1998 type Borrowed<'a> = &'a mut Self;
1999 fn take_or_borrow<'a>(
2000 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2001 ) -> Self::Borrowed<'a> {
2002 value
2003 }
2004 }
2005
2006 unsafe impl fidl::encoding::TypeMarker for ArrayOfHandles {
2007 type Owned = Self;
2008
2009 #[inline(always)]
2010 fn inline_align(_context: fidl::encoding::Context) -> usize {
2011 4
2012 }
2013
2014 #[inline(always)]
2015 fn inline_size(_context: fidl::encoding::Context) -> usize {
2016 12
2017 }
2018 }
2019
2020 unsafe impl
2021 fidl::encoding::Encode<ArrayOfHandles, fidl::encoding::DefaultFuchsiaResourceDialect>
2022 for &mut ArrayOfHandles
2023 {
2024 #[inline]
2025 unsafe fn encode(
2026 self,
2027 encoder: &mut fidl::encoding::Encoder<
2028 '_,
2029 fidl::encoding::DefaultFuchsiaResourceDialect,
2030 >,
2031 offset: usize,
2032 _depth: fidl::encoding::Depth,
2033 ) -> fidl::Result<()> {
2034 encoder.debug_check_bounds::<ArrayOfHandles>(offset);
2035 fidl::encoding::Encode::<ArrayOfHandles, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2037 (
2038 <fidl::encoding::Array<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, 3> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.a),
2039 ),
2040 encoder, offset, _depth
2041 )
2042 }
2043 }
2044 unsafe impl<
2045 T0: fidl::encoding::Encode<
2046 fidl::encoding::Array<
2047 fidl::encoding::HandleType<
2048 fidl::Handle,
2049 { fidl::ObjectType::NONE.into_raw() },
2050 2147483648,
2051 >,
2052 3,
2053 >,
2054 fidl::encoding::DefaultFuchsiaResourceDialect,
2055 >,
2056 > fidl::encoding::Encode<ArrayOfHandles, fidl::encoding::DefaultFuchsiaResourceDialect>
2057 for (T0,)
2058 {
2059 #[inline]
2060 unsafe fn encode(
2061 self,
2062 encoder: &mut fidl::encoding::Encoder<
2063 '_,
2064 fidl::encoding::DefaultFuchsiaResourceDialect,
2065 >,
2066 offset: usize,
2067 depth: fidl::encoding::Depth,
2068 ) -> fidl::Result<()> {
2069 encoder.debug_check_bounds::<ArrayOfHandles>(offset);
2070 self.0.encode(encoder, offset + 0, depth)?;
2074 Ok(())
2075 }
2076 }
2077
2078 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2079 for ArrayOfHandles
2080 {
2081 #[inline(always)]
2082 fn new_empty() -> Self {
2083 Self {
2084 a: fidl::new_empty!(
2085 fidl::encoding::Array<
2086 fidl::encoding::HandleType<
2087 fidl::Handle,
2088 { fidl::ObjectType::NONE.into_raw() },
2089 2147483648,
2090 >,
2091 3,
2092 >,
2093 fidl::encoding::DefaultFuchsiaResourceDialect
2094 ),
2095 }
2096 }
2097
2098 #[inline]
2099 unsafe fn decode(
2100 &mut self,
2101 decoder: &mut fidl::encoding::Decoder<
2102 '_,
2103 fidl::encoding::DefaultFuchsiaResourceDialect,
2104 >,
2105 offset: usize,
2106 _depth: fidl::encoding::Depth,
2107 ) -> fidl::Result<()> {
2108 decoder.debug_check_bounds::<Self>(offset);
2109 fidl::decode!(
2111 fidl::encoding::Array<
2112 fidl::encoding::HandleType<
2113 fidl::Handle,
2114 { fidl::ObjectType::NONE.into_raw() },
2115 2147483648,
2116 >,
2117 3,
2118 >,
2119 fidl::encoding::DefaultFuchsiaResourceDialect,
2120 &mut self.a,
2121 decoder,
2122 offset + 0,
2123 _depth
2124 )?;
2125 Ok(())
2126 }
2127 }
2128
2129 impl fidl::encoding::ResourceTypeMarker for ArrayOfNonnullableHandles {
2130 type Borrowed<'a> = &'a mut Self;
2131 fn take_or_borrow<'a>(
2132 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2133 ) -> Self::Borrowed<'a> {
2134 value
2135 }
2136 }
2137
2138 unsafe impl fidl::encoding::TypeMarker for ArrayOfNonnullableHandles {
2139 type Owned = Self;
2140
2141 #[inline(always)]
2142 fn inline_align(_context: fidl::encoding::Context) -> usize {
2143 4
2144 }
2145
2146 #[inline(always)]
2147 fn inline_size(_context: fidl::encoding::Context) -> usize {
2148 16
2149 }
2150 }
2151
2152 unsafe impl
2153 fidl::encoding::Encode<
2154 ArrayOfNonnullableHandles,
2155 fidl::encoding::DefaultFuchsiaResourceDialect,
2156 > for &mut ArrayOfNonnullableHandles
2157 {
2158 #[inline]
2159 unsafe fn encode(
2160 self,
2161 encoder: &mut fidl::encoding::Encoder<
2162 '_,
2163 fidl::encoding::DefaultFuchsiaResourceDialect,
2164 >,
2165 offset: usize,
2166 _depth: fidl::encoding::Depth,
2167 ) -> fidl::Result<()> {
2168 encoder.debug_check_bounds::<ArrayOfNonnullableHandles>(offset);
2169 fidl::encoding::Encode::<
2171 ArrayOfNonnullableHandles,
2172 fidl::encoding::DefaultFuchsiaResourceDialect,
2173 >::encode(
2174 (<fidl::encoding::Array<
2175 fidl::encoding::HandleType<
2176 fidl::Handle,
2177 { fidl::ObjectType::NONE.into_raw() },
2178 2147483648,
2179 >,
2180 4,
2181 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2182 &mut self.handles
2183 ),),
2184 encoder,
2185 offset,
2186 _depth,
2187 )
2188 }
2189 }
2190 unsafe impl<
2191 T0: fidl::encoding::Encode<
2192 fidl::encoding::Array<
2193 fidl::encoding::HandleType<
2194 fidl::Handle,
2195 { fidl::ObjectType::NONE.into_raw() },
2196 2147483648,
2197 >,
2198 4,
2199 >,
2200 fidl::encoding::DefaultFuchsiaResourceDialect,
2201 >,
2202 >
2203 fidl::encoding::Encode<
2204 ArrayOfNonnullableHandles,
2205 fidl::encoding::DefaultFuchsiaResourceDialect,
2206 > for (T0,)
2207 {
2208 #[inline]
2209 unsafe fn encode(
2210 self,
2211 encoder: &mut fidl::encoding::Encoder<
2212 '_,
2213 fidl::encoding::DefaultFuchsiaResourceDialect,
2214 >,
2215 offset: usize,
2216 depth: fidl::encoding::Depth,
2217 ) -> fidl::Result<()> {
2218 encoder.debug_check_bounds::<ArrayOfNonnullableHandles>(offset);
2219 self.0.encode(encoder, offset + 0, depth)?;
2223 Ok(())
2224 }
2225 }
2226
2227 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2228 for ArrayOfNonnullableHandles
2229 {
2230 #[inline(always)]
2231 fn new_empty() -> Self {
2232 Self {
2233 handles: fidl::new_empty!(
2234 fidl::encoding::Array<
2235 fidl::encoding::HandleType<
2236 fidl::Handle,
2237 { fidl::ObjectType::NONE.into_raw() },
2238 2147483648,
2239 >,
2240 4,
2241 >,
2242 fidl::encoding::DefaultFuchsiaResourceDialect
2243 ),
2244 }
2245 }
2246
2247 #[inline]
2248 unsafe fn decode(
2249 &mut self,
2250 decoder: &mut fidl::encoding::Decoder<
2251 '_,
2252 fidl::encoding::DefaultFuchsiaResourceDialect,
2253 >,
2254 offset: usize,
2255 _depth: fidl::encoding::Depth,
2256 ) -> fidl::Result<()> {
2257 decoder.debug_check_bounds::<Self>(offset);
2258 fidl::decode!(
2260 fidl::encoding::Array<
2261 fidl::encoding::HandleType<
2262 fidl::Handle,
2263 { fidl::ObjectType::NONE.into_raw() },
2264 2147483648,
2265 >,
2266 4,
2267 >,
2268 fidl::encoding::DefaultFuchsiaResourceDialect,
2269 &mut self.handles,
2270 decoder,
2271 offset + 0,
2272 _depth
2273 )?;
2274 Ok(())
2275 }
2276 }
2277
2278 impl fidl::encoding::ResourceTypeMarker for ArrayOfNullableHandles {
2279 type Borrowed<'a> = &'a mut Self;
2280 fn take_or_borrow<'a>(
2281 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2282 ) -> Self::Borrowed<'a> {
2283 value
2284 }
2285 }
2286
2287 unsafe impl fidl::encoding::TypeMarker for ArrayOfNullableHandles {
2288 type Owned = Self;
2289
2290 #[inline(always)]
2291 fn inline_align(_context: fidl::encoding::Context) -> usize {
2292 4
2293 }
2294
2295 #[inline(always)]
2296 fn inline_size(_context: fidl::encoding::Context) -> usize {
2297 20
2298 }
2299 }
2300
2301 unsafe impl
2302 fidl::encoding::Encode<
2303 ArrayOfNullableHandles,
2304 fidl::encoding::DefaultFuchsiaResourceDialect,
2305 > for &mut ArrayOfNullableHandles
2306 {
2307 #[inline]
2308 unsafe fn encode(
2309 self,
2310 encoder: &mut fidl::encoding::Encoder<
2311 '_,
2312 fidl::encoding::DefaultFuchsiaResourceDialect,
2313 >,
2314 offset: usize,
2315 _depth: fidl::encoding::Depth,
2316 ) -> fidl::Result<()> {
2317 encoder.debug_check_bounds::<ArrayOfNullableHandles>(offset);
2318 fidl::encoding::Encode::<
2320 ArrayOfNullableHandles,
2321 fidl::encoding::DefaultFuchsiaResourceDialect,
2322 >::encode(
2323 (<fidl::encoding::Array<
2324 fidl::encoding::Optional<
2325 fidl::encoding::HandleType<
2326 fidl::Handle,
2327 { fidl::ObjectType::NONE.into_raw() },
2328 2147483648,
2329 >,
2330 >,
2331 5,
2332 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2333 &mut self.handles
2334 ),),
2335 encoder,
2336 offset,
2337 _depth,
2338 )
2339 }
2340 }
2341 unsafe impl<
2342 T0: fidl::encoding::Encode<
2343 fidl::encoding::Array<
2344 fidl::encoding::Optional<
2345 fidl::encoding::HandleType<
2346 fidl::Handle,
2347 { fidl::ObjectType::NONE.into_raw() },
2348 2147483648,
2349 >,
2350 >,
2351 5,
2352 >,
2353 fidl::encoding::DefaultFuchsiaResourceDialect,
2354 >,
2355 >
2356 fidl::encoding::Encode<
2357 ArrayOfNullableHandles,
2358 fidl::encoding::DefaultFuchsiaResourceDialect,
2359 > for (T0,)
2360 {
2361 #[inline]
2362 unsafe fn encode(
2363 self,
2364 encoder: &mut fidl::encoding::Encoder<
2365 '_,
2366 fidl::encoding::DefaultFuchsiaResourceDialect,
2367 >,
2368 offset: usize,
2369 depth: fidl::encoding::Depth,
2370 ) -> fidl::Result<()> {
2371 encoder.debug_check_bounds::<ArrayOfNullableHandles>(offset);
2372 self.0.encode(encoder, offset + 0, depth)?;
2376 Ok(())
2377 }
2378 }
2379
2380 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2381 for ArrayOfNullableHandles
2382 {
2383 #[inline(always)]
2384 fn new_empty() -> Self {
2385 Self {
2386 handles: fidl::new_empty!(
2387 fidl::encoding::Array<
2388 fidl::encoding::Optional<
2389 fidl::encoding::HandleType<
2390 fidl::Handle,
2391 { fidl::ObjectType::NONE.into_raw() },
2392 2147483648,
2393 >,
2394 >,
2395 5,
2396 >,
2397 fidl::encoding::DefaultFuchsiaResourceDialect
2398 ),
2399 }
2400 }
2401
2402 #[inline]
2403 unsafe fn decode(
2404 &mut self,
2405 decoder: &mut fidl::encoding::Decoder<
2406 '_,
2407 fidl::encoding::DefaultFuchsiaResourceDialect,
2408 >,
2409 offset: usize,
2410 _depth: fidl::encoding::Depth,
2411 ) -> fidl::Result<()> {
2412 decoder.debug_check_bounds::<Self>(offset);
2413 fidl::decode!(
2415 fidl::encoding::Array<
2416 fidl::encoding::Optional<
2417 fidl::encoding::HandleType<
2418 fidl::Handle,
2419 { fidl::ObjectType::NONE.into_raw() },
2420 2147483648,
2421 >,
2422 >,
2423 5,
2424 >,
2425 fidl::encoding::DefaultFuchsiaResourceDialect,
2426 &mut self.handles,
2427 decoder,
2428 offset + 0,
2429 _depth
2430 )?;
2431 Ok(())
2432 }
2433 }
2434
2435 impl fidl::encoding::ResourceTypeMarker for ArrayOfOptionalHandles {
2436 type Borrowed<'a> = &'a mut Self;
2437 fn take_or_borrow<'a>(
2438 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2439 ) -> Self::Borrowed<'a> {
2440 value
2441 }
2442 }
2443
2444 unsafe impl fidl::encoding::TypeMarker for ArrayOfOptionalHandles {
2445 type Owned = Self;
2446
2447 #[inline(always)]
2448 fn inline_align(_context: fidl::encoding::Context) -> usize {
2449 4
2450 }
2451
2452 #[inline(always)]
2453 fn inline_size(_context: fidl::encoding::Context) -> usize {
2454 12
2455 }
2456 }
2457
2458 unsafe impl
2459 fidl::encoding::Encode<
2460 ArrayOfOptionalHandles,
2461 fidl::encoding::DefaultFuchsiaResourceDialect,
2462 > for &mut ArrayOfOptionalHandles
2463 {
2464 #[inline]
2465 unsafe fn encode(
2466 self,
2467 encoder: &mut fidl::encoding::Encoder<
2468 '_,
2469 fidl::encoding::DefaultFuchsiaResourceDialect,
2470 >,
2471 offset: usize,
2472 _depth: fidl::encoding::Depth,
2473 ) -> fidl::Result<()> {
2474 encoder.debug_check_bounds::<ArrayOfOptionalHandles>(offset);
2475 fidl::encoding::Encode::<
2477 ArrayOfOptionalHandles,
2478 fidl::encoding::DefaultFuchsiaResourceDialect,
2479 >::encode(
2480 (<fidl::encoding::Array<
2481 fidl::encoding::Optional<
2482 fidl::encoding::HandleType<
2483 fidl::Handle,
2484 { fidl::ObjectType::NONE.into_raw() },
2485 2147483648,
2486 >,
2487 >,
2488 3,
2489 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2490 &mut self.a
2491 ),),
2492 encoder,
2493 offset,
2494 _depth,
2495 )
2496 }
2497 }
2498 unsafe impl<
2499 T0: fidl::encoding::Encode<
2500 fidl::encoding::Array<
2501 fidl::encoding::Optional<
2502 fidl::encoding::HandleType<
2503 fidl::Handle,
2504 { fidl::ObjectType::NONE.into_raw() },
2505 2147483648,
2506 >,
2507 >,
2508 3,
2509 >,
2510 fidl::encoding::DefaultFuchsiaResourceDialect,
2511 >,
2512 >
2513 fidl::encoding::Encode<
2514 ArrayOfOptionalHandles,
2515 fidl::encoding::DefaultFuchsiaResourceDialect,
2516 > for (T0,)
2517 {
2518 #[inline]
2519 unsafe fn encode(
2520 self,
2521 encoder: &mut fidl::encoding::Encoder<
2522 '_,
2523 fidl::encoding::DefaultFuchsiaResourceDialect,
2524 >,
2525 offset: usize,
2526 depth: fidl::encoding::Depth,
2527 ) -> fidl::Result<()> {
2528 encoder.debug_check_bounds::<ArrayOfOptionalHandles>(offset);
2529 self.0.encode(encoder, offset + 0, depth)?;
2533 Ok(())
2534 }
2535 }
2536
2537 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2538 for ArrayOfOptionalHandles
2539 {
2540 #[inline(always)]
2541 fn new_empty() -> Self {
2542 Self {
2543 a: fidl::new_empty!(
2544 fidl::encoding::Array<
2545 fidl::encoding::Optional<
2546 fidl::encoding::HandleType<
2547 fidl::Handle,
2548 { fidl::ObjectType::NONE.into_raw() },
2549 2147483648,
2550 >,
2551 >,
2552 3,
2553 >,
2554 fidl::encoding::DefaultFuchsiaResourceDialect
2555 ),
2556 }
2557 }
2558
2559 #[inline]
2560 unsafe fn decode(
2561 &mut self,
2562 decoder: &mut fidl::encoding::Decoder<
2563 '_,
2564 fidl::encoding::DefaultFuchsiaResourceDialect,
2565 >,
2566 offset: usize,
2567 _depth: fidl::encoding::Depth,
2568 ) -> fidl::Result<()> {
2569 decoder.debug_check_bounds::<Self>(offset);
2570 fidl::decode!(
2572 fidl::encoding::Array<
2573 fidl::encoding::Optional<
2574 fidl::encoding::HandleType<
2575 fidl::Handle,
2576 { fidl::ObjectType::NONE.into_raw() },
2577 2147483648,
2578 >,
2579 >,
2580 3,
2581 >,
2582 fidl::encoding::DefaultFuchsiaResourceDialect,
2583 &mut self.a,
2584 decoder,
2585 offset + 0,
2586 _depth
2587 )?;
2588 Ok(())
2589 }
2590 }
2591
2592 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInStructWithDefaultRights {
2593 type Borrowed<'a> = &'a mut Self;
2594 fn take_or_borrow<'a>(
2595 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2596 ) -> Self::Borrowed<'a> {
2597 value
2598 }
2599 }
2600
2601 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInStructWithDefaultRights {
2602 type Owned = Self;
2603
2604 #[inline(always)]
2605 fn inline_align(_context: fidl::encoding::Context) -> usize {
2606 8
2607 }
2608
2609 #[inline(always)]
2610 fn inline_size(_context: fidl::encoding::Context) -> usize {
2611 16
2612 }
2613 }
2614
2615 unsafe impl
2616 fidl::encoding::Encode<
2617 ArrayOfVectorOfEventInStructWithDefaultRights,
2618 fidl::encoding::DefaultFuchsiaResourceDialect,
2619 > for &mut ArrayOfVectorOfEventInStructWithDefaultRights
2620 {
2621 #[inline]
2622 unsafe fn encode(
2623 self,
2624 encoder: &mut fidl::encoding::Encoder<
2625 '_,
2626 fidl::encoding::DefaultFuchsiaResourceDialect,
2627 >,
2628 offset: usize,
2629 _depth: fidl::encoding::Depth,
2630 ) -> fidl::Result<()> {
2631 encoder.debug_check_bounds::<ArrayOfVectorOfEventInStructWithDefaultRights>(offset);
2632 fidl::encoding::Encode::<
2634 ArrayOfVectorOfEventInStructWithDefaultRights,
2635 fidl::encoding::DefaultFuchsiaResourceDialect,
2636 >::encode(
2637 (<fidl::encoding::Array<
2638 fidl::encoding::Vector<
2639 fidl::encoding::HandleType<
2640 fidl::Event,
2641 { fidl::ObjectType::EVENT.into_raw() },
2642 53251,
2643 >,
2644 1,
2645 >,
2646 1,
2647 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2648 &mut self.h
2649 ),),
2650 encoder,
2651 offset,
2652 _depth,
2653 )
2654 }
2655 }
2656 unsafe impl<
2657 T0: fidl::encoding::Encode<
2658 fidl::encoding::Array<
2659 fidl::encoding::Vector<
2660 fidl::encoding::HandleType<
2661 fidl::Event,
2662 { fidl::ObjectType::EVENT.into_raw() },
2663 53251,
2664 >,
2665 1,
2666 >,
2667 1,
2668 >,
2669 fidl::encoding::DefaultFuchsiaResourceDialect,
2670 >,
2671 >
2672 fidl::encoding::Encode<
2673 ArrayOfVectorOfEventInStructWithDefaultRights,
2674 fidl::encoding::DefaultFuchsiaResourceDialect,
2675 > for (T0,)
2676 {
2677 #[inline]
2678 unsafe fn encode(
2679 self,
2680 encoder: &mut fidl::encoding::Encoder<
2681 '_,
2682 fidl::encoding::DefaultFuchsiaResourceDialect,
2683 >,
2684 offset: usize,
2685 depth: fidl::encoding::Depth,
2686 ) -> fidl::Result<()> {
2687 encoder.debug_check_bounds::<ArrayOfVectorOfEventInStructWithDefaultRights>(offset);
2688 self.0.encode(encoder, offset + 0, depth)?;
2692 Ok(())
2693 }
2694 }
2695
2696 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2697 for ArrayOfVectorOfEventInStructWithDefaultRights
2698 {
2699 #[inline(always)]
2700 fn new_empty() -> Self {
2701 Self {
2702 h: fidl::new_empty!(
2703 fidl::encoding::Array<
2704 fidl::encoding::Vector<
2705 fidl::encoding::HandleType<
2706 fidl::Event,
2707 { fidl::ObjectType::EVENT.into_raw() },
2708 53251,
2709 >,
2710 1,
2711 >,
2712 1,
2713 >,
2714 fidl::encoding::DefaultFuchsiaResourceDialect
2715 ),
2716 }
2717 }
2718
2719 #[inline]
2720 unsafe fn decode(
2721 &mut self,
2722 decoder: &mut fidl::encoding::Decoder<
2723 '_,
2724 fidl::encoding::DefaultFuchsiaResourceDialect,
2725 >,
2726 offset: usize,
2727 _depth: fidl::encoding::Depth,
2728 ) -> fidl::Result<()> {
2729 decoder.debug_check_bounds::<Self>(offset);
2730 fidl::decode!(
2732 fidl::encoding::Array<
2733 fidl::encoding::Vector<
2734 fidl::encoding::HandleType<
2735 fidl::Event,
2736 { fidl::ObjectType::EVENT.into_raw() },
2737 53251,
2738 >,
2739 1,
2740 >,
2741 1,
2742 >,
2743 fidl::encoding::DefaultFuchsiaResourceDialect,
2744 &mut self.h,
2745 decoder,
2746 offset + 0,
2747 _depth
2748 )?;
2749 Ok(())
2750 }
2751 }
2752
2753 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInStructWithReducedRights {
2754 type Borrowed<'a> = &'a mut Self;
2755 fn take_or_borrow<'a>(
2756 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2757 ) -> Self::Borrowed<'a> {
2758 value
2759 }
2760 }
2761
2762 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInStructWithReducedRights {
2763 type Owned = Self;
2764
2765 #[inline(always)]
2766 fn inline_align(_context: fidl::encoding::Context) -> usize {
2767 8
2768 }
2769
2770 #[inline(always)]
2771 fn inline_size(_context: fidl::encoding::Context) -> usize {
2772 16
2773 }
2774 }
2775
2776 unsafe impl
2777 fidl::encoding::Encode<
2778 ArrayOfVectorOfEventInStructWithReducedRights,
2779 fidl::encoding::DefaultFuchsiaResourceDialect,
2780 > for &mut ArrayOfVectorOfEventInStructWithReducedRights
2781 {
2782 #[inline]
2783 unsafe fn encode(
2784 self,
2785 encoder: &mut fidl::encoding::Encoder<
2786 '_,
2787 fidl::encoding::DefaultFuchsiaResourceDialect,
2788 >,
2789 offset: usize,
2790 _depth: fidl::encoding::Depth,
2791 ) -> fidl::Result<()> {
2792 encoder.debug_check_bounds::<ArrayOfVectorOfEventInStructWithReducedRights>(offset);
2793 fidl::encoding::Encode::<
2795 ArrayOfVectorOfEventInStructWithReducedRights,
2796 fidl::encoding::DefaultFuchsiaResourceDialect,
2797 >::encode(
2798 (<fidl::encoding::Array<
2799 fidl::encoding::Vector<
2800 fidl::encoding::HandleType<
2801 fidl::Event,
2802 { fidl::ObjectType::EVENT.into_raw() },
2803 49155,
2804 >,
2805 1,
2806 >,
2807 1,
2808 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2809 &mut self.h
2810 ),),
2811 encoder,
2812 offset,
2813 _depth,
2814 )
2815 }
2816 }
2817 unsafe impl<
2818 T0: fidl::encoding::Encode<
2819 fidl::encoding::Array<
2820 fidl::encoding::Vector<
2821 fidl::encoding::HandleType<
2822 fidl::Event,
2823 { fidl::ObjectType::EVENT.into_raw() },
2824 49155,
2825 >,
2826 1,
2827 >,
2828 1,
2829 >,
2830 fidl::encoding::DefaultFuchsiaResourceDialect,
2831 >,
2832 >
2833 fidl::encoding::Encode<
2834 ArrayOfVectorOfEventInStructWithReducedRights,
2835 fidl::encoding::DefaultFuchsiaResourceDialect,
2836 > for (T0,)
2837 {
2838 #[inline]
2839 unsafe fn encode(
2840 self,
2841 encoder: &mut fidl::encoding::Encoder<
2842 '_,
2843 fidl::encoding::DefaultFuchsiaResourceDialect,
2844 >,
2845 offset: usize,
2846 depth: fidl::encoding::Depth,
2847 ) -> fidl::Result<()> {
2848 encoder.debug_check_bounds::<ArrayOfVectorOfEventInStructWithReducedRights>(offset);
2849 self.0.encode(encoder, offset + 0, depth)?;
2853 Ok(())
2854 }
2855 }
2856
2857 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2858 for ArrayOfVectorOfEventInStructWithReducedRights
2859 {
2860 #[inline(always)]
2861 fn new_empty() -> Self {
2862 Self {
2863 h: fidl::new_empty!(
2864 fidl::encoding::Array<
2865 fidl::encoding::Vector<
2866 fidl::encoding::HandleType<
2867 fidl::Event,
2868 { fidl::ObjectType::EVENT.into_raw() },
2869 49155,
2870 >,
2871 1,
2872 >,
2873 1,
2874 >,
2875 fidl::encoding::DefaultFuchsiaResourceDialect
2876 ),
2877 }
2878 }
2879
2880 #[inline]
2881 unsafe fn decode(
2882 &mut self,
2883 decoder: &mut fidl::encoding::Decoder<
2884 '_,
2885 fidl::encoding::DefaultFuchsiaResourceDialect,
2886 >,
2887 offset: usize,
2888 _depth: fidl::encoding::Depth,
2889 ) -> fidl::Result<()> {
2890 decoder.debug_check_bounds::<Self>(offset);
2891 fidl::decode!(
2893 fidl::encoding::Array<
2894 fidl::encoding::Vector<
2895 fidl::encoding::HandleType<
2896 fidl::Event,
2897 { fidl::ObjectType::EVENT.into_raw() },
2898 49155,
2899 >,
2900 1,
2901 >,
2902 1,
2903 >,
2904 fidl::encoding::DefaultFuchsiaResourceDialect,
2905 &mut self.h,
2906 decoder,
2907 offset + 0,
2908 _depth
2909 )?;
2910 Ok(())
2911 }
2912 }
2913
2914 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInTableWithDefaultRightsStruct {
2915 type Borrowed<'a> = &'a mut Self;
2916 fn take_or_borrow<'a>(
2917 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2918 ) -> Self::Borrowed<'a> {
2919 value
2920 }
2921 }
2922
2923 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInTableWithDefaultRightsStruct {
2924 type Owned = Self;
2925
2926 #[inline(always)]
2927 fn inline_align(_context: fidl::encoding::Context) -> usize {
2928 8
2929 }
2930
2931 #[inline(always)]
2932 fn inline_size(_context: fidl::encoding::Context) -> usize {
2933 16
2934 }
2935 }
2936
2937 unsafe impl
2938 fidl::encoding::Encode<
2939 ArrayOfVectorOfEventInTableWithDefaultRightsStruct,
2940 fidl::encoding::DefaultFuchsiaResourceDialect,
2941 > for &mut ArrayOfVectorOfEventInTableWithDefaultRightsStruct
2942 {
2943 #[inline]
2944 unsafe fn encode(
2945 self,
2946 encoder: &mut fidl::encoding::Encoder<
2947 '_,
2948 fidl::encoding::DefaultFuchsiaResourceDialect,
2949 >,
2950 offset: usize,
2951 _depth: fidl::encoding::Depth,
2952 ) -> fidl::Result<()> {
2953 encoder
2954 .debug_check_bounds::<ArrayOfVectorOfEventInTableWithDefaultRightsStruct>(offset);
2955 fidl::encoding::Encode::<ArrayOfVectorOfEventInTableWithDefaultRightsStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2957 (
2958 <ArrayOfVectorOfEventInTableWithDefaultRights as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.t),
2959 ),
2960 encoder, offset, _depth
2961 )
2962 }
2963 }
2964 unsafe impl<
2965 T0: fidl::encoding::Encode<
2966 ArrayOfVectorOfEventInTableWithDefaultRights,
2967 fidl::encoding::DefaultFuchsiaResourceDialect,
2968 >,
2969 >
2970 fidl::encoding::Encode<
2971 ArrayOfVectorOfEventInTableWithDefaultRightsStruct,
2972 fidl::encoding::DefaultFuchsiaResourceDialect,
2973 > for (T0,)
2974 {
2975 #[inline]
2976 unsafe fn encode(
2977 self,
2978 encoder: &mut fidl::encoding::Encoder<
2979 '_,
2980 fidl::encoding::DefaultFuchsiaResourceDialect,
2981 >,
2982 offset: usize,
2983 depth: fidl::encoding::Depth,
2984 ) -> fidl::Result<()> {
2985 encoder
2986 .debug_check_bounds::<ArrayOfVectorOfEventInTableWithDefaultRightsStruct>(offset);
2987 self.0.encode(encoder, offset + 0, depth)?;
2991 Ok(())
2992 }
2993 }
2994
2995 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2996 for ArrayOfVectorOfEventInTableWithDefaultRightsStruct
2997 {
2998 #[inline(always)]
2999 fn new_empty() -> Self {
3000 Self {
3001 t: fidl::new_empty!(
3002 ArrayOfVectorOfEventInTableWithDefaultRights,
3003 fidl::encoding::DefaultFuchsiaResourceDialect
3004 ),
3005 }
3006 }
3007
3008 #[inline]
3009 unsafe fn decode(
3010 &mut self,
3011 decoder: &mut fidl::encoding::Decoder<
3012 '_,
3013 fidl::encoding::DefaultFuchsiaResourceDialect,
3014 >,
3015 offset: usize,
3016 _depth: fidl::encoding::Depth,
3017 ) -> fidl::Result<()> {
3018 decoder.debug_check_bounds::<Self>(offset);
3019 fidl::decode!(
3021 ArrayOfVectorOfEventInTableWithDefaultRights,
3022 fidl::encoding::DefaultFuchsiaResourceDialect,
3023 &mut self.t,
3024 decoder,
3025 offset + 0,
3026 _depth
3027 )?;
3028 Ok(())
3029 }
3030 }
3031
3032 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInTableWithReducedRightsStruct {
3033 type Borrowed<'a> = &'a mut Self;
3034 fn take_or_borrow<'a>(
3035 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3036 ) -> Self::Borrowed<'a> {
3037 value
3038 }
3039 }
3040
3041 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInTableWithReducedRightsStruct {
3042 type Owned = Self;
3043
3044 #[inline(always)]
3045 fn inline_align(_context: fidl::encoding::Context) -> usize {
3046 8
3047 }
3048
3049 #[inline(always)]
3050 fn inline_size(_context: fidl::encoding::Context) -> usize {
3051 16
3052 }
3053 }
3054
3055 unsafe impl
3056 fidl::encoding::Encode<
3057 ArrayOfVectorOfEventInTableWithReducedRightsStruct,
3058 fidl::encoding::DefaultFuchsiaResourceDialect,
3059 > for &mut ArrayOfVectorOfEventInTableWithReducedRightsStruct
3060 {
3061 #[inline]
3062 unsafe fn encode(
3063 self,
3064 encoder: &mut fidl::encoding::Encoder<
3065 '_,
3066 fidl::encoding::DefaultFuchsiaResourceDialect,
3067 >,
3068 offset: usize,
3069 _depth: fidl::encoding::Depth,
3070 ) -> fidl::Result<()> {
3071 encoder
3072 .debug_check_bounds::<ArrayOfVectorOfEventInTableWithReducedRightsStruct>(offset);
3073 fidl::encoding::Encode::<ArrayOfVectorOfEventInTableWithReducedRightsStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3075 (
3076 <ArrayOfVectorOfEventInTableWithReducedRights as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.t),
3077 ),
3078 encoder, offset, _depth
3079 )
3080 }
3081 }
3082 unsafe impl<
3083 T0: fidl::encoding::Encode<
3084 ArrayOfVectorOfEventInTableWithReducedRights,
3085 fidl::encoding::DefaultFuchsiaResourceDialect,
3086 >,
3087 >
3088 fidl::encoding::Encode<
3089 ArrayOfVectorOfEventInTableWithReducedRightsStruct,
3090 fidl::encoding::DefaultFuchsiaResourceDialect,
3091 > for (T0,)
3092 {
3093 #[inline]
3094 unsafe fn encode(
3095 self,
3096 encoder: &mut fidl::encoding::Encoder<
3097 '_,
3098 fidl::encoding::DefaultFuchsiaResourceDialect,
3099 >,
3100 offset: usize,
3101 depth: fidl::encoding::Depth,
3102 ) -> fidl::Result<()> {
3103 encoder
3104 .debug_check_bounds::<ArrayOfVectorOfEventInTableWithReducedRightsStruct>(offset);
3105 self.0.encode(encoder, offset + 0, depth)?;
3109 Ok(())
3110 }
3111 }
3112
3113 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3114 for ArrayOfVectorOfEventInTableWithReducedRightsStruct
3115 {
3116 #[inline(always)]
3117 fn new_empty() -> Self {
3118 Self {
3119 t: fidl::new_empty!(
3120 ArrayOfVectorOfEventInTableWithReducedRights,
3121 fidl::encoding::DefaultFuchsiaResourceDialect
3122 ),
3123 }
3124 }
3125
3126 #[inline]
3127 unsafe fn decode(
3128 &mut self,
3129 decoder: &mut fidl::encoding::Decoder<
3130 '_,
3131 fidl::encoding::DefaultFuchsiaResourceDialect,
3132 >,
3133 offset: usize,
3134 _depth: fidl::encoding::Depth,
3135 ) -> fidl::Result<()> {
3136 decoder.debug_check_bounds::<Self>(offset);
3137 fidl::decode!(
3139 ArrayOfVectorOfEventInTableWithReducedRights,
3140 fidl::encoding::DefaultFuchsiaResourceDialect,
3141 &mut self.t,
3142 decoder,
3143 offset + 0,
3144 _depth
3145 )?;
3146 Ok(())
3147 }
3148 }
3149
3150 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInUnionWithDefaultRightsStruct {
3151 type Borrowed<'a> = &'a mut Self;
3152 fn take_or_borrow<'a>(
3153 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3154 ) -> Self::Borrowed<'a> {
3155 value
3156 }
3157 }
3158
3159 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInUnionWithDefaultRightsStruct {
3160 type Owned = Self;
3161
3162 #[inline(always)]
3163 fn inline_align(_context: fidl::encoding::Context) -> usize {
3164 8
3165 }
3166
3167 #[inline(always)]
3168 fn inline_size(_context: fidl::encoding::Context) -> usize {
3169 16
3170 }
3171 }
3172
3173 unsafe impl
3174 fidl::encoding::Encode<
3175 ArrayOfVectorOfEventInUnionWithDefaultRightsStruct,
3176 fidl::encoding::DefaultFuchsiaResourceDialect,
3177 > for &mut ArrayOfVectorOfEventInUnionWithDefaultRightsStruct
3178 {
3179 #[inline]
3180 unsafe fn encode(
3181 self,
3182 encoder: &mut fidl::encoding::Encoder<
3183 '_,
3184 fidl::encoding::DefaultFuchsiaResourceDialect,
3185 >,
3186 offset: usize,
3187 _depth: fidl::encoding::Depth,
3188 ) -> fidl::Result<()> {
3189 encoder
3190 .debug_check_bounds::<ArrayOfVectorOfEventInUnionWithDefaultRightsStruct>(offset);
3191 fidl::encoding::Encode::<ArrayOfVectorOfEventInUnionWithDefaultRightsStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3193 (
3194 <ArrayOfVectorOfEventInUnionWithDefaultRights as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.u),
3195 ),
3196 encoder, offset, _depth
3197 )
3198 }
3199 }
3200 unsafe impl<
3201 T0: fidl::encoding::Encode<
3202 ArrayOfVectorOfEventInUnionWithDefaultRights,
3203 fidl::encoding::DefaultFuchsiaResourceDialect,
3204 >,
3205 >
3206 fidl::encoding::Encode<
3207 ArrayOfVectorOfEventInUnionWithDefaultRightsStruct,
3208 fidl::encoding::DefaultFuchsiaResourceDialect,
3209 > for (T0,)
3210 {
3211 #[inline]
3212 unsafe fn encode(
3213 self,
3214 encoder: &mut fidl::encoding::Encoder<
3215 '_,
3216 fidl::encoding::DefaultFuchsiaResourceDialect,
3217 >,
3218 offset: usize,
3219 depth: fidl::encoding::Depth,
3220 ) -> fidl::Result<()> {
3221 encoder
3222 .debug_check_bounds::<ArrayOfVectorOfEventInUnionWithDefaultRightsStruct>(offset);
3223 self.0.encode(encoder, offset + 0, depth)?;
3227 Ok(())
3228 }
3229 }
3230
3231 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3232 for ArrayOfVectorOfEventInUnionWithDefaultRightsStruct
3233 {
3234 #[inline(always)]
3235 fn new_empty() -> Self {
3236 Self {
3237 u: fidl::new_empty!(
3238 ArrayOfVectorOfEventInUnionWithDefaultRights,
3239 fidl::encoding::DefaultFuchsiaResourceDialect
3240 ),
3241 }
3242 }
3243
3244 #[inline]
3245 unsafe fn decode(
3246 &mut self,
3247 decoder: &mut fidl::encoding::Decoder<
3248 '_,
3249 fidl::encoding::DefaultFuchsiaResourceDialect,
3250 >,
3251 offset: usize,
3252 _depth: fidl::encoding::Depth,
3253 ) -> fidl::Result<()> {
3254 decoder.debug_check_bounds::<Self>(offset);
3255 fidl::decode!(
3257 ArrayOfVectorOfEventInUnionWithDefaultRights,
3258 fidl::encoding::DefaultFuchsiaResourceDialect,
3259 &mut self.u,
3260 decoder,
3261 offset + 0,
3262 _depth
3263 )?;
3264 Ok(())
3265 }
3266 }
3267
3268 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInUnionWithReducedRightsStruct {
3269 type Borrowed<'a> = &'a mut Self;
3270 fn take_or_borrow<'a>(
3271 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3272 ) -> Self::Borrowed<'a> {
3273 value
3274 }
3275 }
3276
3277 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInUnionWithReducedRightsStruct {
3278 type Owned = Self;
3279
3280 #[inline(always)]
3281 fn inline_align(_context: fidl::encoding::Context) -> usize {
3282 8
3283 }
3284
3285 #[inline(always)]
3286 fn inline_size(_context: fidl::encoding::Context) -> usize {
3287 16
3288 }
3289 }
3290
3291 unsafe impl
3292 fidl::encoding::Encode<
3293 ArrayOfVectorOfEventInUnionWithReducedRightsStruct,
3294 fidl::encoding::DefaultFuchsiaResourceDialect,
3295 > for &mut ArrayOfVectorOfEventInUnionWithReducedRightsStruct
3296 {
3297 #[inline]
3298 unsafe fn encode(
3299 self,
3300 encoder: &mut fidl::encoding::Encoder<
3301 '_,
3302 fidl::encoding::DefaultFuchsiaResourceDialect,
3303 >,
3304 offset: usize,
3305 _depth: fidl::encoding::Depth,
3306 ) -> fidl::Result<()> {
3307 encoder
3308 .debug_check_bounds::<ArrayOfVectorOfEventInUnionWithReducedRightsStruct>(offset);
3309 fidl::encoding::Encode::<ArrayOfVectorOfEventInUnionWithReducedRightsStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3311 (
3312 <ArrayOfVectorOfEventInUnionWithReducedRights as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.u),
3313 ),
3314 encoder, offset, _depth
3315 )
3316 }
3317 }
3318 unsafe impl<
3319 T0: fidl::encoding::Encode<
3320 ArrayOfVectorOfEventInUnionWithReducedRights,
3321 fidl::encoding::DefaultFuchsiaResourceDialect,
3322 >,
3323 >
3324 fidl::encoding::Encode<
3325 ArrayOfVectorOfEventInUnionWithReducedRightsStruct,
3326 fidl::encoding::DefaultFuchsiaResourceDialect,
3327 > for (T0,)
3328 {
3329 #[inline]
3330 unsafe fn encode(
3331 self,
3332 encoder: &mut fidl::encoding::Encoder<
3333 '_,
3334 fidl::encoding::DefaultFuchsiaResourceDialect,
3335 >,
3336 offset: usize,
3337 depth: fidl::encoding::Depth,
3338 ) -> fidl::Result<()> {
3339 encoder
3340 .debug_check_bounds::<ArrayOfVectorOfEventInUnionWithReducedRightsStruct>(offset);
3341 self.0.encode(encoder, offset + 0, depth)?;
3345 Ok(())
3346 }
3347 }
3348
3349 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3350 for ArrayOfVectorOfEventInUnionWithReducedRightsStruct
3351 {
3352 #[inline(always)]
3353 fn new_empty() -> Self {
3354 Self {
3355 u: fidl::new_empty!(
3356 ArrayOfVectorOfEventInUnionWithReducedRights,
3357 fidl::encoding::DefaultFuchsiaResourceDialect
3358 ),
3359 }
3360 }
3361
3362 #[inline]
3363 unsafe fn decode(
3364 &mut self,
3365 decoder: &mut fidl::encoding::Decoder<
3366 '_,
3367 fidl::encoding::DefaultFuchsiaResourceDialect,
3368 >,
3369 offset: usize,
3370 _depth: fidl::encoding::Depth,
3371 ) -> fidl::Result<()> {
3372 decoder.debug_check_bounds::<Self>(offset);
3373 fidl::decode!(
3375 ArrayOfVectorOfEventInUnionWithReducedRights,
3376 fidl::encoding::DefaultFuchsiaResourceDialect,
3377 &mut self.u,
3378 decoder,
3379 offset + 0,
3380 _depth
3381 )?;
3382 Ok(())
3383 }
3384 }
3385
3386 impl fidl::encoding::ResourceTypeMarker for Bounded32NonnullableVectorOfHandles {
3387 type Borrowed<'a> = &'a mut Self;
3388 fn take_or_borrow<'a>(
3389 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3390 ) -> Self::Borrowed<'a> {
3391 value
3392 }
3393 }
3394
3395 unsafe impl fidl::encoding::TypeMarker for Bounded32NonnullableVectorOfHandles {
3396 type Owned = Self;
3397
3398 #[inline(always)]
3399 fn inline_align(_context: fidl::encoding::Context) -> usize {
3400 8
3401 }
3402
3403 #[inline(always)]
3404 fn inline_size(_context: fidl::encoding::Context) -> usize {
3405 16
3406 }
3407 }
3408
3409 unsafe impl
3410 fidl::encoding::Encode<
3411 Bounded32NonnullableVectorOfHandles,
3412 fidl::encoding::DefaultFuchsiaResourceDialect,
3413 > for &mut Bounded32NonnullableVectorOfHandles
3414 {
3415 #[inline]
3416 unsafe fn encode(
3417 self,
3418 encoder: &mut fidl::encoding::Encoder<
3419 '_,
3420 fidl::encoding::DefaultFuchsiaResourceDialect,
3421 >,
3422 offset: usize,
3423 _depth: fidl::encoding::Depth,
3424 ) -> fidl::Result<()> {
3425 encoder.debug_check_bounds::<Bounded32NonnullableVectorOfHandles>(offset);
3426 fidl::encoding::Encode::<
3428 Bounded32NonnullableVectorOfHandles,
3429 fidl::encoding::DefaultFuchsiaResourceDialect,
3430 >::encode(
3431 (<fidl::encoding::Vector<
3432 fidl::encoding::HandleType<
3433 fidl::Handle,
3434 { fidl::ObjectType::NONE.into_raw() },
3435 2147483648,
3436 >,
3437 32,
3438 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3439 &mut self.vh0
3440 ),),
3441 encoder,
3442 offset,
3443 _depth,
3444 )
3445 }
3446 }
3447 unsafe impl<
3448 T0: fidl::encoding::Encode<
3449 fidl::encoding::Vector<
3450 fidl::encoding::HandleType<
3451 fidl::Handle,
3452 { fidl::ObjectType::NONE.into_raw() },
3453 2147483648,
3454 >,
3455 32,
3456 >,
3457 fidl::encoding::DefaultFuchsiaResourceDialect,
3458 >,
3459 >
3460 fidl::encoding::Encode<
3461 Bounded32NonnullableVectorOfHandles,
3462 fidl::encoding::DefaultFuchsiaResourceDialect,
3463 > for (T0,)
3464 {
3465 #[inline]
3466 unsafe fn encode(
3467 self,
3468 encoder: &mut fidl::encoding::Encoder<
3469 '_,
3470 fidl::encoding::DefaultFuchsiaResourceDialect,
3471 >,
3472 offset: usize,
3473 depth: fidl::encoding::Depth,
3474 ) -> fidl::Result<()> {
3475 encoder.debug_check_bounds::<Bounded32NonnullableVectorOfHandles>(offset);
3476 self.0.encode(encoder, offset + 0, depth)?;
3480 Ok(())
3481 }
3482 }
3483
3484 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3485 for Bounded32NonnullableVectorOfHandles
3486 {
3487 #[inline(always)]
3488 fn new_empty() -> Self {
3489 Self {
3490 vh0: fidl::new_empty!(
3491 fidl::encoding::Vector<
3492 fidl::encoding::HandleType<
3493 fidl::Handle,
3494 { fidl::ObjectType::NONE.into_raw() },
3495 2147483648,
3496 >,
3497 32,
3498 >,
3499 fidl::encoding::DefaultFuchsiaResourceDialect
3500 ),
3501 }
3502 }
3503
3504 #[inline]
3505 unsafe fn decode(
3506 &mut self,
3507 decoder: &mut fidl::encoding::Decoder<
3508 '_,
3509 fidl::encoding::DefaultFuchsiaResourceDialect,
3510 >,
3511 offset: usize,
3512 _depth: fidl::encoding::Depth,
3513 ) -> fidl::Result<()> {
3514 decoder.debug_check_bounds::<Self>(offset);
3515 fidl::decode!(
3517 fidl::encoding::Vector<
3518 fidl::encoding::HandleType<
3519 fidl::Handle,
3520 { fidl::ObjectType::NONE.into_raw() },
3521 2147483648,
3522 >,
3523 32,
3524 >,
3525 fidl::encoding::DefaultFuchsiaResourceDialect,
3526 &mut self.vh0,
3527 decoder,
3528 offset + 0,
3529 _depth
3530 )?;
3531 Ok(())
3532 }
3533 }
3534
3535 impl fidl::encoding::ResourceTypeMarker for Bounded32NullableVectorOfHandles {
3536 type Borrowed<'a> = &'a mut Self;
3537 fn take_or_borrow<'a>(
3538 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3539 ) -> Self::Borrowed<'a> {
3540 value
3541 }
3542 }
3543
3544 unsafe impl fidl::encoding::TypeMarker for Bounded32NullableVectorOfHandles {
3545 type Owned = Self;
3546
3547 #[inline(always)]
3548 fn inline_align(_context: fidl::encoding::Context) -> usize {
3549 8
3550 }
3551
3552 #[inline(always)]
3553 fn inline_size(_context: fidl::encoding::Context) -> usize {
3554 16
3555 }
3556 }
3557
3558 unsafe impl
3559 fidl::encoding::Encode<
3560 Bounded32NullableVectorOfHandles,
3561 fidl::encoding::DefaultFuchsiaResourceDialect,
3562 > for &mut Bounded32NullableVectorOfHandles
3563 {
3564 #[inline]
3565 unsafe fn encode(
3566 self,
3567 encoder: &mut fidl::encoding::Encoder<
3568 '_,
3569 fidl::encoding::DefaultFuchsiaResourceDialect,
3570 >,
3571 offset: usize,
3572 _depth: fidl::encoding::Depth,
3573 ) -> fidl::Result<()> {
3574 encoder.debug_check_bounds::<Bounded32NullableVectorOfHandles>(offset);
3575 fidl::encoding::Encode::<
3577 Bounded32NullableVectorOfHandles,
3578 fidl::encoding::DefaultFuchsiaResourceDialect,
3579 >::encode(
3580 (<fidl::encoding::Optional<
3581 fidl::encoding::Vector<
3582 fidl::encoding::HandleType<
3583 fidl::Handle,
3584 { fidl::ObjectType::NONE.into_raw() },
3585 2147483648,
3586 >,
3587 32,
3588 >,
3589 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3590 &mut self.vh0
3591 ),),
3592 encoder,
3593 offset,
3594 _depth,
3595 )
3596 }
3597 }
3598 unsafe impl<
3599 T0: fidl::encoding::Encode<
3600 fidl::encoding::Optional<
3601 fidl::encoding::Vector<
3602 fidl::encoding::HandleType<
3603 fidl::Handle,
3604 { fidl::ObjectType::NONE.into_raw() },
3605 2147483648,
3606 >,
3607 32,
3608 >,
3609 >,
3610 fidl::encoding::DefaultFuchsiaResourceDialect,
3611 >,
3612 >
3613 fidl::encoding::Encode<
3614 Bounded32NullableVectorOfHandles,
3615 fidl::encoding::DefaultFuchsiaResourceDialect,
3616 > for (T0,)
3617 {
3618 #[inline]
3619 unsafe fn encode(
3620 self,
3621 encoder: &mut fidl::encoding::Encoder<
3622 '_,
3623 fidl::encoding::DefaultFuchsiaResourceDialect,
3624 >,
3625 offset: usize,
3626 depth: fidl::encoding::Depth,
3627 ) -> fidl::Result<()> {
3628 encoder.debug_check_bounds::<Bounded32NullableVectorOfHandles>(offset);
3629 self.0.encode(encoder, offset + 0, depth)?;
3633 Ok(())
3634 }
3635 }
3636
3637 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3638 for Bounded32NullableVectorOfHandles
3639 {
3640 #[inline(always)]
3641 fn new_empty() -> Self {
3642 Self {
3643 vh0: fidl::new_empty!(
3644 fidl::encoding::Optional<
3645 fidl::encoding::Vector<
3646 fidl::encoding::HandleType<
3647 fidl::Handle,
3648 { fidl::ObjectType::NONE.into_raw() },
3649 2147483648,
3650 >,
3651 32,
3652 >,
3653 >,
3654 fidl::encoding::DefaultFuchsiaResourceDialect
3655 ),
3656 }
3657 }
3658
3659 #[inline]
3660 unsafe fn decode(
3661 &mut self,
3662 decoder: &mut fidl::encoding::Decoder<
3663 '_,
3664 fidl::encoding::DefaultFuchsiaResourceDialect,
3665 >,
3666 offset: usize,
3667 _depth: fidl::encoding::Depth,
3668 ) -> fidl::Result<()> {
3669 decoder.debug_check_bounds::<Self>(offset);
3670 fidl::decode!(
3672 fidl::encoding::Optional<
3673 fidl::encoding::Vector<
3674 fidl::encoding::HandleType<
3675 fidl::Handle,
3676 { fidl::ObjectType::NONE.into_raw() },
3677 2147483648,
3678 >,
3679 32,
3680 >,
3681 >,
3682 fidl::encoding::DefaultFuchsiaResourceDialect,
3683 &mut self.vh0,
3684 decoder,
3685 offset + 0,
3686 _depth
3687 )?;
3688 Ok(())
3689 }
3690 }
3691
3692 impl fidl::encoding::ResourceTypeMarker for BoxOfSingleHandle {
3693 type Borrowed<'a> = &'a mut Self;
3694 fn take_or_borrow<'a>(
3695 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3696 ) -> Self::Borrowed<'a> {
3697 value
3698 }
3699 }
3700
3701 unsafe impl fidl::encoding::TypeMarker for BoxOfSingleHandle {
3702 type Owned = Self;
3703
3704 #[inline(always)]
3705 fn inline_align(_context: fidl::encoding::Context) -> usize {
3706 8
3707 }
3708
3709 #[inline(always)]
3710 fn inline_size(_context: fidl::encoding::Context) -> usize {
3711 8
3712 }
3713 }
3714
3715 unsafe impl
3716 fidl::encoding::Encode<BoxOfSingleHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
3717 for &mut BoxOfSingleHandle
3718 {
3719 #[inline]
3720 unsafe fn encode(
3721 self,
3722 encoder: &mut fidl::encoding::Encoder<
3723 '_,
3724 fidl::encoding::DefaultFuchsiaResourceDialect,
3725 >,
3726 offset: usize,
3727 _depth: fidl::encoding::Depth,
3728 ) -> fidl::Result<()> {
3729 encoder.debug_check_bounds::<BoxOfSingleHandle>(offset);
3730 fidl::encoding::Encode::<BoxOfSingleHandle, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3732 (
3733 <fidl::encoding::Boxed<SingleHandle> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.b),
3734 ),
3735 encoder, offset, _depth
3736 )
3737 }
3738 }
3739 unsafe impl<
3740 T0: fidl::encoding::Encode<
3741 fidl::encoding::Boxed<SingleHandle>,
3742 fidl::encoding::DefaultFuchsiaResourceDialect,
3743 >,
3744 >
3745 fidl::encoding::Encode<BoxOfSingleHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
3746 for (T0,)
3747 {
3748 #[inline]
3749 unsafe fn encode(
3750 self,
3751 encoder: &mut fidl::encoding::Encoder<
3752 '_,
3753 fidl::encoding::DefaultFuchsiaResourceDialect,
3754 >,
3755 offset: usize,
3756 depth: fidl::encoding::Depth,
3757 ) -> fidl::Result<()> {
3758 encoder.debug_check_bounds::<BoxOfSingleHandle>(offset);
3759 self.0.encode(encoder, offset + 0, depth)?;
3763 Ok(())
3764 }
3765 }
3766
3767 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3768 for BoxOfSingleHandle
3769 {
3770 #[inline(always)]
3771 fn new_empty() -> Self {
3772 Self {
3773 b: fidl::new_empty!(
3774 fidl::encoding::Boxed<SingleHandle>,
3775 fidl::encoding::DefaultFuchsiaResourceDialect
3776 ),
3777 }
3778 }
3779
3780 #[inline]
3781 unsafe fn decode(
3782 &mut self,
3783 decoder: &mut fidl::encoding::Decoder<
3784 '_,
3785 fidl::encoding::DefaultFuchsiaResourceDialect,
3786 >,
3787 offset: usize,
3788 _depth: fidl::encoding::Depth,
3789 ) -> fidl::Result<()> {
3790 decoder.debug_check_bounds::<Self>(offset);
3791 fidl::decode!(
3793 fidl::encoding::Boxed<SingleHandle>,
3794 fidl::encoding::DefaultFuchsiaResourceDialect,
3795 &mut self.b,
3796 decoder,
3797 offset + 0,
3798 _depth
3799 )?;
3800 Ok(())
3801 }
3802 }
3803
3804 impl fidl::encoding::ResourceTypeMarker for BoxOfSingleOptionalHandle {
3805 type Borrowed<'a> = &'a mut Self;
3806 fn take_or_borrow<'a>(
3807 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3808 ) -> Self::Borrowed<'a> {
3809 value
3810 }
3811 }
3812
3813 unsafe impl fidl::encoding::TypeMarker for BoxOfSingleOptionalHandle {
3814 type Owned = Self;
3815
3816 #[inline(always)]
3817 fn inline_align(_context: fidl::encoding::Context) -> usize {
3818 8
3819 }
3820
3821 #[inline(always)]
3822 fn inline_size(_context: fidl::encoding::Context) -> usize {
3823 8
3824 }
3825 }
3826
3827 unsafe impl
3828 fidl::encoding::Encode<
3829 BoxOfSingleOptionalHandle,
3830 fidl::encoding::DefaultFuchsiaResourceDialect,
3831 > for &mut BoxOfSingleOptionalHandle
3832 {
3833 #[inline]
3834 unsafe fn encode(
3835 self,
3836 encoder: &mut fidl::encoding::Encoder<
3837 '_,
3838 fidl::encoding::DefaultFuchsiaResourceDialect,
3839 >,
3840 offset: usize,
3841 _depth: fidl::encoding::Depth,
3842 ) -> fidl::Result<()> {
3843 encoder.debug_check_bounds::<BoxOfSingleOptionalHandle>(offset);
3844 fidl::encoding::Encode::<BoxOfSingleOptionalHandle, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3846 (
3847 <fidl::encoding::Boxed<SingleOptionalHandle> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.b),
3848 ),
3849 encoder, offset, _depth
3850 )
3851 }
3852 }
3853 unsafe impl<
3854 T0: fidl::encoding::Encode<
3855 fidl::encoding::Boxed<SingleOptionalHandle>,
3856 fidl::encoding::DefaultFuchsiaResourceDialect,
3857 >,
3858 >
3859 fidl::encoding::Encode<
3860 BoxOfSingleOptionalHandle,
3861 fidl::encoding::DefaultFuchsiaResourceDialect,
3862 > for (T0,)
3863 {
3864 #[inline]
3865 unsafe fn encode(
3866 self,
3867 encoder: &mut fidl::encoding::Encoder<
3868 '_,
3869 fidl::encoding::DefaultFuchsiaResourceDialect,
3870 >,
3871 offset: usize,
3872 depth: fidl::encoding::Depth,
3873 ) -> fidl::Result<()> {
3874 encoder.debug_check_bounds::<BoxOfSingleOptionalHandle>(offset);
3875 self.0.encode(encoder, offset + 0, depth)?;
3879 Ok(())
3880 }
3881 }
3882
3883 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3884 for BoxOfSingleOptionalHandle
3885 {
3886 #[inline(always)]
3887 fn new_empty() -> Self {
3888 Self {
3889 b: fidl::new_empty!(
3890 fidl::encoding::Boxed<SingleOptionalHandle>,
3891 fidl::encoding::DefaultFuchsiaResourceDialect
3892 ),
3893 }
3894 }
3895
3896 #[inline]
3897 unsafe fn decode(
3898 &mut self,
3899 decoder: &mut fidl::encoding::Decoder<
3900 '_,
3901 fidl::encoding::DefaultFuchsiaResourceDialect,
3902 >,
3903 offset: usize,
3904 _depth: fidl::encoding::Depth,
3905 ) -> fidl::Result<()> {
3906 decoder.debug_check_bounds::<Self>(offset);
3907 fidl::decode!(
3909 fidl::encoding::Boxed<SingleOptionalHandle>,
3910 fidl::encoding::DefaultFuchsiaResourceDialect,
3911 &mut self.b,
3912 decoder,
3913 offset + 0,
3914 _depth
3915 )?;
3916 Ok(())
3917 }
3918 }
3919
3920 impl fidl::encoding::ResourceTypeMarker for CreateComponentRequest {
3921 type Borrowed<'a> = &'a mut Self;
3922 fn take_or_borrow<'a>(
3923 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3924 ) -> Self::Borrowed<'a> {
3925 value
3926 }
3927 }
3928
3929 unsafe impl fidl::encoding::TypeMarker for CreateComponentRequest {
3930 type Owned = Self;
3931
3932 #[inline(always)]
3933 fn inline_align(_context: fidl::encoding::Context) -> usize {
3934 8
3935 }
3936
3937 #[inline(always)]
3938 fn inline_size(_context: fidl::encoding::Context) -> usize {
3939 80
3940 }
3941 }
3942
3943 unsafe impl
3944 fidl::encoding::Encode<
3945 CreateComponentRequest,
3946 fidl::encoding::DefaultFuchsiaResourceDialect,
3947 > for &mut CreateComponentRequest
3948 {
3949 #[inline]
3950 unsafe fn encode(
3951 self,
3952 encoder: &mut fidl::encoding::Encoder<
3953 '_,
3954 fidl::encoding::DefaultFuchsiaResourceDialect,
3955 >,
3956 offset: usize,
3957 _depth: fidl::encoding::Depth,
3958 ) -> fidl::Result<()> {
3959 encoder.debug_check_bounds::<CreateComponentRequest>(offset);
3960 fidl::encoding::Encode::<
3962 CreateComponentRequest,
3963 fidl::encoding::DefaultFuchsiaResourceDialect,
3964 >::encode(
3965 (
3966 <LaunchInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3967 &mut self.launch_info,
3968 ),
3969 <fidl::encoding::Optional<
3970 fidl::encoding::Endpoint<
3971 fidl::endpoints::ServerEnd<ComponentControllerMarker>,
3972 >,
3973 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3974 &mut self.controller
3975 ),
3976 ),
3977 encoder,
3978 offset,
3979 _depth,
3980 )
3981 }
3982 }
3983 unsafe impl<
3984 T0: fidl::encoding::Encode<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>,
3985 T1: fidl::encoding::Encode<
3986 fidl::encoding::Optional<
3987 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
3988 >,
3989 fidl::encoding::DefaultFuchsiaResourceDialect,
3990 >,
3991 >
3992 fidl::encoding::Encode<
3993 CreateComponentRequest,
3994 fidl::encoding::DefaultFuchsiaResourceDialect,
3995 > for (T0, T1)
3996 {
3997 #[inline]
3998 unsafe fn encode(
3999 self,
4000 encoder: &mut fidl::encoding::Encoder<
4001 '_,
4002 fidl::encoding::DefaultFuchsiaResourceDialect,
4003 >,
4004 offset: usize,
4005 depth: fidl::encoding::Depth,
4006 ) -> fidl::Result<()> {
4007 encoder.debug_check_bounds::<CreateComponentRequest>(offset);
4008 unsafe {
4011 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(72);
4012 (ptr as *mut u64).write_unaligned(0);
4013 }
4014 self.0.encode(encoder, offset + 0, depth)?;
4016 self.1.encode(encoder, offset + 72, depth)?;
4017 Ok(())
4018 }
4019 }
4020
4021 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4022 for CreateComponentRequest
4023 {
4024 #[inline(always)]
4025 fn new_empty() -> Self {
4026 Self {
4027 launch_info: fidl::new_empty!(
4028 LaunchInfo,
4029 fidl::encoding::DefaultFuchsiaResourceDialect
4030 ),
4031 controller: fidl::new_empty!(
4032 fidl::encoding::Optional<
4033 fidl::encoding::Endpoint<
4034 fidl::endpoints::ServerEnd<ComponentControllerMarker>,
4035 >,
4036 >,
4037 fidl::encoding::DefaultFuchsiaResourceDialect
4038 ),
4039 }
4040 }
4041
4042 #[inline]
4043 unsafe fn decode(
4044 &mut self,
4045 decoder: &mut fidl::encoding::Decoder<
4046 '_,
4047 fidl::encoding::DefaultFuchsiaResourceDialect,
4048 >,
4049 offset: usize,
4050 _depth: fidl::encoding::Depth,
4051 ) -> fidl::Result<()> {
4052 decoder.debug_check_bounds::<Self>(offset);
4053 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(72) };
4055 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4056 let mask = 0xffffffff00000000u64;
4057 let maskedval = padval & mask;
4058 if maskedval != 0 {
4059 return Err(fidl::Error::NonZeroPadding {
4060 padding_start: offset + 72 + ((mask as u64).trailing_zeros() / 8) as usize,
4061 });
4062 }
4063 fidl::decode!(
4064 LaunchInfo,
4065 fidl::encoding::DefaultFuchsiaResourceDialect,
4066 &mut self.launch_info,
4067 decoder,
4068 offset + 0,
4069 _depth
4070 )?;
4071 fidl::decode!(
4072 fidl::encoding::Optional<
4073 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ComponentControllerMarker>>,
4074 >,
4075 fidl::encoding::DefaultFuchsiaResourceDialect,
4076 &mut self.controller,
4077 decoder,
4078 offset + 72,
4079 _depth
4080 )?;
4081 Ok(())
4082 }
4083 }
4084
4085 impl fidl::encoding::ResourceTypeMarker for EmptyResourceTableStruct {
4086 type Borrowed<'a> = &'a mut Self;
4087 fn take_or_borrow<'a>(
4088 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4089 ) -> Self::Borrowed<'a> {
4090 value
4091 }
4092 }
4093
4094 unsafe impl fidl::encoding::TypeMarker for EmptyResourceTableStruct {
4095 type Owned = Self;
4096
4097 #[inline(always)]
4098 fn inline_align(_context: fidl::encoding::Context) -> usize {
4099 8
4100 }
4101
4102 #[inline(always)]
4103 fn inline_size(_context: fidl::encoding::Context) -> usize {
4104 16
4105 }
4106 }
4107
4108 unsafe impl
4109 fidl::encoding::Encode<
4110 EmptyResourceTableStruct,
4111 fidl::encoding::DefaultFuchsiaResourceDialect,
4112 > for &mut EmptyResourceTableStruct
4113 {
4114 #[inline]
4115 unsafe fn encode(
4116 self,
4117 encoder: &mut fidl::encoding::Encoder<
4118 '_,
4119 fidl::encoding::DefaultFuchsiaResourceDialect,
4120 >,
4121 offset: usize,
4122 _depth: fidl::encoding::Depth,
4123 ) -> fidl::Result<()> {
4124 encoder.debug_check_bounds::<EmptyResourceTableStruct>(offset);
4125 fidl::encoding::Encode::<
4127 EmptyResourceTableStruct,
4128 fidl::encoding::DefaultFuchsiaResourceDialect,
4129 >::encode(
4130 (<EmptyResourceTable as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4131 &mut self.table,
4132 ),),
4133 encoder,
4134 offset,
4135 _depth,
4136 )
4137 }
4138 }
4139 unsafe impl<
4140 T0: fidl::encoding::Encode<
4141 EmptyResourceTable,
4142 fidl::encoding::DefaultFuchsiaResourceDialect,
4143 >,
4144 >
4145 fidl::encoding::Encode<
4146 EmptyResourceTableStruct,
4147 fidl::encoding::DefaultFuchsiaResourceDialect,
4148 > for (T0,)
4149 {
4150 #[inline]
4151 unsafe fn encode(
4152 self,
4153 encoder: &mut fidl::encoding::Encoder<
4154 '_,
4155 fidl::encoding::DefaultFuchsiaResourceDialect,
4156 >,
4157 offset: usize,
4158 depth: fidl::encoding::Depth,
4159 ) -> fidl::Result<()> {
4160 encoder.debug_check_bounds::<EmptyResourceTableStruct>(offset);
4161 self.0.encode(encoder, offset + 0, depth)?;
4165 Ok(())
4166 }
4167 }
4168
4169 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4170 for EmptyResourceTableStruct
4171 {
4172 #[inline(always)]
4173 fn new_empty() -> Self {
4174 Self {
4175 table: fidl::new_empty!(
4176 EmptyResourceTable,
4177 fidl::encoding::DefaultFuchsiaResourceDialect
4178 ),
4179 }
4180 }
4181
4182 #[inline]
4183 unsafe fn decode(
4184 &mut self,
4185 decoder: &mut fidl::encoding::Decoder<
4186 '_,
4187 fidl::encoding::DefaultFuchsiaResourceDialect,
4188 >,
4189 offset: usize,
4190 _depth: fidl::encoding::Depth,
4191 ) -> fidl::Result<()> {
4192 decoder.debug_check_bounds::<Self>(offset);
4193 fidl::decode!(
4195 EmptyResourceTable,
4196 fidl::encoding::DefaultFuchsiaResourceDialect,
4197 &mut self.table,
4198 decoder,
4199 offset + 0,
4200 _depth
4201 )?;
4202 Ok(())
4203 }
4204 }
4205
4206 impl fidl::encoding::ResourceTypeMarker for EnvelopeInliningTestUnionStruct {
4207 type Borrowed<'a> = &'a mut Self;
4208 fn take_or_borrow<'a>(
4209 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4210 ) -> Self::Borrowed<'a> {
4211 value
4212 }
4213 }
4214
4215 unsafe impl fidl::encoding::TypeMarker for EnvelopeInliningTestUnionStruct {
4216 type Owned = Self;
4217
4218 #[inline(always)]
4219 fn inline_align(_context: fidl::encoding::Context) -> usize {
4220 8
4221 }
4222
4223 #[inline(always)]
4224 fn inline_size(_context: fidl::encoding::Context) -> usize {
4225 16
4226 }
4227 }
4228
4229 unsafe impl
4230 fidl::encoding::Encode<
4231 EnvelopeInliningTestUnionStruct,
4232 fidl::encoding::DefaultFuchsiaResourceDialect,
4233 > for &mut EnvelopeInliningTestUnionStruct
4234 {
4235 #[inline]
4236 unsafe fn encode(
4237 self,
4238 encoder: &mut fidl::encoding::Encoder<
4239 '_,
4240 fidl::encoding::DefaultFuchsiaResourceDialect,
4241 >,
4242 offset: usize,
4243 _depth: fidl::encoding::Depth,
4244 ) -> fidl::Result<()> {
4245 encoder.debug_check_bounds::<EnvelopeInliningTestUnionStruct>(offset);
4246 fidl::encoding::Encode::<EnvelopeInliningTestUnionStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4248 (
4249 <EnvelopeInliningTestUnion as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.u),
4250 ),
4251 encoder, offset, _depth
4252 )
4253 }
4254 }
4255 unsafe impl<
4256 T0: fidl::encoding::Encode<
4257 EnvelopeInliningTestUnion,
4258 fidl::encoding::DefaultFuchsiaResourceDialect,
4259 >,
4260 >
4261 fidl::encoding::Encode<
4262 EnvelopeInliningTestUnionStruct,
4263 fidl::encoding::DefaultFuchsiaResourceDialect,
4264 > for (T0,)
4265 {
4266 #[inline]
4267 unsafe fn encode(
4268 self,
4269 encoder: &mut fidl::encoding::Encoder<
4270 '_,
4271 fidl::encoding::DefaultFuchsiaResourceDialect,
4272 >,
4273 offset: usize,
4274 depth: fidl::encoding::Depth,
4275 ) -> fidl::Result<()> {
4276 encoder.debug_check_bounds::<EnvelopeInliningTestUnionStruct>(offset);
4277 self.0.encode(encoder, offset + 0, depth)?;
4281 Ok(())
4282 }
4283 }
4284
4285 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4286 for EnvelopeInliningTestUnionStruct
4287 {
4288 #[inline(always)]
4289 fn new_empty() -> Self {
4290 Self {
4291 u: fidl::new_empty!(
4292 EnvelopeInliningTestUnion,
4293 fidl::encoding::DefaultFuchsiaResourceDialect
4294 ),
4295 }
4296 }
4297
4298 #[inline]
4299 unsafe fn decode(
4300 &mut self,
4301 decoder: &mut fidl::encoding::Decoder<
4302 '_,
4303 fidl::encoding::DefaultFuchsiaResourceDialect,
4304 >,
4305 offset: usize,
4306 _depth: fidl::encoding::Depth,
4307 ) -> fidl::Result<()> {
4308 decoder.debug_check_bounds::<Self>(offset);
4309 fidl::decode!(
4311 EnvelopeInliningTestUnion,
4312 fidl::encoding::DefaultFuchsiaResourceDialect,
4313 &mut self.u,
4314 decoder,
4315 offset + 0,
4316 _depth
4317 )?;
4318 Ok(())
4319 }
4320 }
4321
4322 impl fidl::encoding::ResourceTypeMarker for EventWithDefaultRights {
4323 type Borrowed<'a> = &'a mut Self;
4324 fn take_or_borrow<'a>(
4325 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4326 ) -> Self::Borrowed<'a> {
4327 value
4328 }
4329 }
4330
4331 unsafe impl fidl::encoding::TypeMarker for EventWithDefaultRights {
4332 type Owned = Self;
4333
4334 #[inline(always)]
4335 fn inline_align(_context: fidl::encoding::Context) -> usize {
4336 4
4337 }
4338
4339 #[inline(always)]
4340 fn inline_size(_context: fidl::encoding::Context) -> usize {
4341 4
4342 }
4343 }
4344
4345 unsafe impl
4346 fidl::encoding::Encode<
4347 EventWithDefaultRights,
4348 fidl::encoding::DefaultFuchsiaResourceDialect,
4349 > for &mut EventWithDefaultRights
4350 {
4351 #[inline]
4352 unsafe fn encode(
4353 self,
4354 encoder: &mut fidl::encoding::Encoder<
4355 '_,
4356 fidl::encoding::DefaultFuchsiaResourceDialect,
4357 >,
4358 offset: usize,
4359 _depth: fidl::encoding::Depth,
4360 ) -> fidl::Result<()> {
4361 encoder.debug_check_bounds::<EventWithDefaultRights>(offset);
4362 fidl::encoding::Encode::<
4364 EventWithDefaultRights,
4365 fidl::encoding::DefaultFuchsiaResourceDialect,
4366 >::encode(
4367 (<fidl::encoding::HandleType<
4368 fidl::Event,
4369 { fidl::ObjectType::EVENT.into_raw() },
4370 53251,
4371 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4372 &mut self.h
4373 ),),
4374 encoder,
4375 offset,
4376 _depth,
4377 )
4378 }
4379 }
4380 unsafe impl<
4381 T0: fidl::encoding::Encode<
4382 fidl::encoding::HandleType<
4383 fidl::Event,
4384 { fidl::ObjectType::EVENT.into_raw() },
4385 53251,
4386 >,
4387 fidl::encoding::DefaultFuchsiaResourceDialect,
4388 >,
4389 >
4390 fidl::encoding::Encode<
4391 EventWithDefaultRights,
4392 fidl::encoding::DefaultFuchsiaResourceDialect,
4393 > for (T0,)
4394 {
4395 #[inline]
4396 unsafe fn encode(
4397 self,
4398 encoder: &mut fidl::encoding::Encoder<
4399 '_,
4400 fidl::encoding::DefaultFuchsiaResourceDialect,
4401 >,
4402 offset: usize,
4403 depth: fidl::encoding::Depth,
4404 ) -> fidl::Result<()> {
4405 encoder.debug_check_bounds::<EventWithDefaultRights>(offset);
4406 self.0.encode(encoder, offset + 0, depth)?;
4410 Ok(())
4411 }
4412 }
4413
4414 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4415 for EventWithDefaultRights
4416 {
4417 #[inline(always)]
4418 fn new_empty() -> Self {
4419 Self {
4420 h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 53251>, fidl::encoding::DefaultFuchsiaResourceDialect),
4421 }
4422 }
4423
4424 #[inline]
4425 unsafe fn decode(
4426 &mut self,
4427 decoder: &mut fidl::encoding::Decoder<
4428 '_,
4429 fidl::encoding::DefaultFuchsiaResourceDialect,
4430 >,
4431 offset: usize,
4432 _depth: fidl::encoding::Depth,
4433 ) -> fidl::Result<()> {
4434 decoder.debug_check_bounds::<Self>(offset);
4435 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 53251>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
4437 Ok(())
4438 }
4439 }
4440
4441 impl fidl::encoding::ResourceTypeMarker for EventWithReducedRights {
4442 type Borrowed<'a> = &'a mut Self;
4443 fn take_or_borrow<'a>(
4444 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4445 ) -> Self::Borrowed<'a> {
4446 value
4447 }
4448 }
4449
4450 unsafe impl fidl::encoding::TypeMarker for EventWithReducedRights {
4451 type Owned = Self;
4452
4453 #[inline(always)]
4454 fn inline_align(_context: fidl::encoding::Context) -> usize {
4455 4
4456 }
4457
4458 #[inline(always)]
4459 fn inline_size(_context: fidl::encoding::Context) -> usize {
4460 4
4461 }
4462 }
4463
4464 unsafe impl
4465 fidl::encoding::Encode<
4466 EventWithReducedRights,
4467 fidl::encoding::DefaultFuchsiaResourceDialect,
4468 > for &mut EventWithReducedRights
4469 {
4470 #[inline]
4471 unsafe fn encode(
4472 self,
4473 encoder: &mut fidl::encoding::Encoder<
4474 '_,
4475 fidl::encoding::DefaultFuchsiaResourceDialect,
4476 >,
4477 offset: usize,
4478 _depth: fidl::encoding::Depth,
4479 ) -> fidl::Result<()> {
4480 encoder.debug_check_bounds::<EventWithReducedRights>(offset);
4481 fidl::encoding::Encode::<
4483 EventWithReducedRights,
4484 fidl::encoding::DefaultFuchsiaResourceDialect,
4485 >::encode(
4486 (<fidl::encoding::HandleType<
4487 fidl::Event,
4488 { fidl::ObjectType::EVENT.into_raw() },
4489 49155,
4490 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4491 &mut self.h
4492 ),),
4493 encoder,
4494 offset,
4495 _depth,
4496 )
4497 }
4498 }
4499 unsafe impl<
4500 T0: fidl::encoding::Encode<
4501 fidl::encoding::HandleType<
4502 fidl::Event,
4503 { fidl::ObjectType::EVENT.into_raw() },
4504 49155,
4505 >,
4506 fidl::encoding::DefaultFuchsiaResourceDialect,
4507 >,
4508 >
4509 fidl::encoding::Encode<
4510 EventWithReducedRights,
4511 fidl::encoding::DefaultFuchsiaResourceDialect,
4512 > for (T0,)
4513 {
4514 #[inline]
4515 unsafe fn encode(
4516 self,
4517 encoder: &mut fidl::encoding::Encoder<
4518 '_,
4519 fidl::encoding::DefaultFuchsiaResourceDialect,
4520 >,
4521 offset: usize,
4522 depth: fidl::encoding::Depth,
4523 ) -> fidl::Result<()> {
4524 encoder.debug_check_bounds::<EventWithReducedRights>(offset);
4525 self.0.encode(encoder, offset + 0, depth)?;
4529 Ok(())
4530 }
4531 }
4532
4533 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4534 for EventWithReducedRights
4535 {
4536 #[inline(always)]
4537 fn new_empty() -> Self {
4538 Self {
4539 h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 49155>, fidl::encoding::DefaultFuchsiaResourceDialect),
4540 }
4541 }
4542
4543 #[inline]
4544 unsafe fn decode(
4545 &mut self,
4546 decoder: &mut fidl::encoding::Decoder<
4547 '_,
4548 fidl::encoding::DefaultFuchsiaResourceDialect,
4549 >,
4550 offset: usize,
4551 _depth: fidl::encoding::Depth,
4552 ) -> fidl::Result<()> {
4553 decoder.debug_check_bounds::<Self>(offset);
4554 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 49155>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
4556 Ok(())
4557 }
4558 }
4559
4560 impl fidl::encoding::ResourceTypeMarker for FidlvizDemo {
4561 type Borrowed<'a> = &'a mut Self;
4562 fn take_or_borrow<'a>(
4563 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4564 ) -> Self::Borrowed<'a> {
4565 value
4566 }
4567 }
4568
4569 unsafe impl fidl::encoding::TypeMarker for FidlvizDemo {
4570 type Owned = Self;
4571
4572 #[inline(always)]
4573 fn inline_align(_context: fidl::encoding::Context) -> usize {
4574 8
4575 }
4576
4577 #[inline(always)]
4578 fn inline_size(_context: fidl::encoding::Context) -> usize {
4579 248
4580 }
4581 }
4582
4583 unsafe impl fidl::encoding::Encode<FidlvizDemo, fidl::encoding::DefaultFuchsiaResourceDialect>
4584 for &mut FidlvizDemo
4585 {
4586 #[inline]
4587 unsafe fn encode(
4588 self,
4589 encoder: &mut fidl::encoding::Encoder<
4590 '_,
4591 fidl::encoding::DefaultFuchsiaResourceDialect,
4592 >,
4593 offset: usize,
4594 _depth: fidl::encoding::Depth,
4595 ) -> fidl::Result<()> {
4596 encoder.debug_check_bounds::<FidlvizDemo>(offset);
4597 fidl::encoding::Encode::<FidlvizDemo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4599 (
4600 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.f1),
4601 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.f2),
4602 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.f3),
4603 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.f4),
4604 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.f5),
4605 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.f6),
4606 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.f7),
4607 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.f8),
4608 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.f9),
4609 <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.f10),
4610 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.f11),
4611 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.f12),
4612 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.f13),
4613 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.f14),
4614 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.f15),
4615 <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.f16),
4616 <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.f17),
4617 <fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.f18),
4618 <fidl::encoding::UnboundedVector<f64> as fidl::encoding::ValueTypeMarker>::borrow(&self.f19),
4619 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow(&self.f20),
4620 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.f21),
4621 <FidlvizBits as fidl::encoding::ValueTypeMarker>::borrow(&self.f22),
4622 <FidlvizEnum as fidl::encoding::ValueTypeMarker>::borrow(&self.f23),
4623 <FidlvizStruct1 as fidl::encoding::ValueTypeMarker>::borrow(&self.f24),
4624 <FidlvizStruct2 as fidl::encoding::ValueTypeMarker>::borrow(&self.f25),
4625 <fidl::encoding::Boxed<FidlvizStruct1> as fidl::encoding::ValueTypeMarker>::borrow(&self.f26),
4626 <fidl::encoding::Boxed<FidlvizStruct2> as fidl::encoding::ValueTypeMarker>::borrow(&self.f27),
4627 <FidlvizTable as fidl::encoding::ValueTypeMarker>::borrow(&self.f28),
4628 <FidlvizTable as fidl::encoding::ValueTypeMarker>::borrow(&self.f29),
4629 <fidl::encoding::OptionalUnion<FidlvizUnion> as fidl::encoding::ValueTypeMarker>::borrow(&self.f30),
4630 <FidlvizUnion as fidl::encoding::ValueTypeMarker>::borrow(&self.f31),
4631 ),
4632 encoder, offset, _depth
4633 )
4634 }
4635 }
4636 unsafe impl<
4637 T0: fidl::encoding::Encode<u8, fidl::encoding::DefaultFuchsiaResourceDialect>,
4638 T1: fidl::encoding::Encode<i8, fidl::encoding::DefaultFuchsiaResourceDialect>,
4639 T2: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
4640 T3: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4641 T4: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4642 T5: fidl::encoding::Encode<u8, fidl::encoding::DefaultFuchsiaResourceDialect>,
4643 T6: fidl::encoding::Encode<u8, fidl::encoding::DefaultFuchsiaResourceDialect>,
4644 T7: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
4645 T8: fidl::encoding::Encode<f32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4646 T9: fidl::encoding::Encode<f64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4647 T10: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
4648 T11: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
4649 T12: fidl::encoding::Encode<
4650 fidl::encoding::UnboundedString,
4651 fidl::encoding::DefaultFuchsiaResourceDialect,
4652 >,
4653 T13: fidl::encoding::Encode<
4654 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
4655 fidl::encoding::DefaultFuchsiaResourceDialect,
4656 >,
4657 T14: fidl::encoding::Encode<
4658 fidl::encoding::UnboundedString,
4659 fidl::encoding::DefaultFuchsiaResourceDialect,
4660 >,
4661 T15: fidl::encoding::Encode<
4662 fidl::encoding::Optional<
4663 fidl::encoding::HandleType<
4664 fidl::Handle,
4665 { fidl::ObjectType::NONE.into_raw() },
4666 2147483648,
4667 >,
4668 >,
4669 fidl::encoding::DefaultFuchsiaResourceDialect,
4670 >,
4671 T16: fidl::encoding::Encode<
4672 fidl::encoding::HandleType<
4673 fidl::Handle,
4674 { fidl::ObjectType::NONE.into_raw() },
4675 2147483648,
4676 >,
4677 fidl::encoding::DefaultFuchsiaResourceDialect,
4678 >,
4679 T17: fidl::encoding::Encode<
4680 fidl::encoding::Array<u8, 3>,
4681 fidl::encoding::DefaultFuchsiaResourceDialect,
4682 >,
4683 T18: fidl::encoding::Encode<
4684 fidl::encoding::UnboundedVector<f64>,
4685 fidl::encoding::DefaultFuchsiaResourceDialect,
4686 >,
4687 T19: fidl::encoding::Encode<
4688 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
4689 fidl::encoding::DefaultFuchsiaResourceDialect,
4690 >,
4691 T20: fidl::encoding::Encode<
4692 fidl::encoding::UnboundedVector<u8>,
4693 fidl::encoding::DefaultFuchsiaResourceDialect,
4694 >,
4695 T21: fidl::encoding::Encode<FidlvizBits, fidl::encoding::DefaultFuchsiaResourceDialect>,
4696 T22: fidl::encoding::Encode<FidlvizEnum, fidl::encoding::DefaultFuchsiaResourceDialect>,
4697 T23: fidl::encoding::Encode<FidlvizStruct1, fidl::encoding::DefaultFuchsiaResourceDialect>,
4698 T24: fidl::encoding::Encode<FidlvizStruct2, fidl::encoding::DefaultFuchsiaResourceDialect>,
4699 T25: fidl::encoding::Encode<
4700 fidl::encoding::Boxed<FidlvizStruct1>,
4701 fidl::encoding::DefaultFuchsiaResourceDialect,
4702 >,
4703 T26: fidl::encoding::Encode<
4704 fidl::encoding::Boxed<FidlvizStruct2>,
4705 fidl::encoding::DefaultFuchsiaResourceDialect,
4706 >,
4707 T27: fidl::encoding::Encode<FidlvizTable, fidl::encoding::DefaultFuchsiaResourceDialect>,
4708 T28: fidl::encoding::Encode<FidlvizTable, fidl::encoding::DefaultFuchsiaResourceDialect>,
4709 T29: fidl::encoding::Encode<
4710 fidl::encoding::OptionalUnion<FidlvizUnion>,
4711 fidl::encoding::DefaultFuchsiaResourceDialect,
4712 >,
4713 T30: fidl::encoding::Encode<FidlvizUnion, fidl::encoding::DefaultFuchsiaResourceDialect>,
4714 > fidl::encoding::Encode<FidlvizDemo, fidl::encoding::DefaultFuchsiaResourceDialect>
4715 for (
4716 T0,
4717 T1,
4718 T2,
4719 T3,
4720 T4,
4721 T5,
4722 T6,
4723 T7,
4724 T8,
4725 T9,
4726 T10,
4727 T11,
4728 T12,
4729 T13,
4730 T14,
4731 T15,
4732 T16,
4733 T17,
4734 T18,
4735 T19,
4736 T20,
4737 T21,
4738 T22,
4739 T23,
4740 T24,
4741 T25,
4742 T26,
4743 T27,
4744 T28,
4745 T29,
4746 T30,
4747 )
4748 {
4749 #[inline]
4750 unsafe fn encode(
4751 self,
4752 encoder: &mut fidl::encoding::Encoder<
4753 '_,
4754 fidl::encoding::DefaultFuchsiaResourceDialect,
4755 >,
4756 offset: usize,
4757 depth: fidl::encoding::Depth,
4758 ) -> fidl::Result<()> {
4759 encoder.debug_check_bounds::<FidlvizDemo>(offset);
4760 unsafe {
4763 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
4764 (ptr as *mut u64).write_unaligned(0);
4765 }
4766 unsafe {
4767 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(96);
4768 (ptr as *mut u64).write_unaligned(0);
4769 }
4770 unsafe {
4771 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(152);
4772 (ptr as *mut u64).write_unaligned(0);
4773 }
4774 self.0.encode(encoder, offset + 0, depth)?;
4776 self.1.encode(encoder, offset + 1, depth)?;
4777 self.2.encode(encoder, offset + 2, depth)?;
4778 self.3.encode(encoder, offset + 4, depth)?;
4779 self.4.encode(encoder, offset + 8, depth)?;
4780 self.5.encode(encoder, offset + 16, depth)?;
4781 self.6.encode(encoder, offset + 17, depth)?;
4782 self.7.encode(encoder, offset + 18, depth)?;
4783 self.8.encode(encoder, offset + 20, depth)?;
4784 self.9.encode(encoder, offset + 24, depth)?;
4785 self.10.encode(encoder, offset + 32, depth)?;
4786 self.11.encode(encoder, offset + 33, depth)?;
4787 self.12.encode(encoder, offset + 40, depth)?;
4788 self.13.encode(encoder, offset + 56, depth)?;
4789 self.14.encode(encoder, offset + 72, depth)?;
4790 self.15.encode(encoder, offset + 88, depth)?;
4791 self.16.encode(encoder, offset + 92, depth)?;
4792 self.17.encode(encoder, offset + 96, depth)?;
4793 self.18.encode(encoder, offset + 104, depth)?;
4794 self.19.encode(encoder, offset + 120, depth)?;
4795 self.20.encode(encoder, offset + 136, depth)?;
4796 self.21.encode(encoder, offset + 152, depth)?;
4797 self.22.encode(encoder, offset + 153, depth)?;
4798 self.23.encode(encoder, offset + 154, depth)?;
4799 self.24.encode(encoder, offset + 160, depth)?;
4800 self.25.encode(encoder, offset + 168, depth)?;
4801 self.26.encode(encoder, offset + 176, depth)?;
4802 self.27.encode(encoder, offset + 184, depth)?;
4803 self.28.encode(encoder, offset + 200, depth)?;
4804 self.29.encode(encoder, offset + 216, depth)?;
4805 self.30.encode(encoder, offset + 232, depth)?;
4806 Ok(())
4807 }
4808 }
4809
4810 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FidlvizDemo {
4811 #[inline(always)]
4812 fn new_empty() -> Self {
4813 Self {
4814 f1: fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect),
4815 f2: fidl::new_empty!(i8, fidl::encoding::DefaultFuchsiaResourceDialect),
4816 f3: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
4817 f4: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
4818 f5: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
4819 f6: fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect),
4820 f7: fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect),
4821 f8: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
4822 f9: fidl::new_empty!(f32, fidl::encoding::DefaultFuchsiaResourceDialect),
4823 f10: fidl::new_empty!(f64, fidl::encoding::DefaultFuchsiaResourceDialect),
4824 f11: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
4825 f12: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
4826 f13: fidl::new_empty!(
4827 fidl::encoding::UnboundedString,
4828 fidl::encoding::DefaultFuchsiaResourceDialect
4829 ),
4830 f14: fidl::new_empty!(
4831 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
4832 fidl::encoding::DefaultFuchsiaResourceDialect
4833 ),
4834 f15: fidl::new_empty!(
4835 fidl::encoding::UnboundedString,
4836 fidl::encoding::DefaultFuchsiaResourceDialect
4837 ),
4838 f16: fidl::new_empty!(
4839 fidl::encoding::Optional<
4840 fidl::encoding::HandleType<
4841 fidl::Handle,
4842 { fidl::ObjectType::NONE.into_raw() },
4843 2147483648,
4844 >,
4845 >,
4846 fidl::encoding::DefaultFuchsiaResourceDialect
4847 ),
4848 f17: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4849 f18: fidl::new_empty!(fidl::encoding::Array<u8, 3>, fidl::encoding::DefaultFuchsiaResourceDialect),
4850 f19: fidl::new_empty!(
4851 fidl::encoding::UnboundedVector<f64>,
4852 fidl::encoding::DefaultFuchsiaResourceDialect
4853 ),
4854 f20: fidl::new_empty!(
4855 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
4856 fidl::encoding::DefaultFuchsiaResourceDialect
4857 ),
4858 f21: fidl::new_empty!(
4859 fidl::encoding::UnboundedVector<u8>,
4860 fidl::encoding::DefaultFuchsiaResourceDialect
4861 ),
4862 f22: fidl::new_empty!(FidlvizBits, fidl::encoding::DefaultFuchsiaResourceDialect),
4863 f23: fidl::new_empty!(FidlvizEnum, fidl::encoding::DefaultFuchsiaResourceDialect),
4864 f24: fidl::new_empty!(
4865 FidlvizStruct1,
4866 fidl::encoding::DefaultFuchsiaResourceDialect
4867 ),
4868 f25: fidl::new_empty!(
4869 FidlvizStruct2,
4870 fidl::encoding::DefaultFuchsiaResourceDialect
4871 ),
4872 f26: fidl::new_empty!(
4873 fidl::encoding::Boxed<FidlvizStruct1>,
4874 fidl::encoding::DefaultFuchsiaResourceDialect
4875 ),
4876 f27: fidl::new_empty!(
4877 fidl::encoding::Boxed<FidlvizStruct2>,
4878 fidl::encoding::DefaultFuchsiaResourceDialect
4879 ),
4880 f28: fidl::new_empty!(FidlvizTable, fidl::encoding::DefaultFuchsiaResourceDialect),
4881 f29: fidl::new_empty!(FidlvizTable, fidl::encoding::DefaultFuchsiaResourceDialect),
4882 f30: fidl::new_empty!(
4883 fidl::encoding::OptionalUnion<FidlvizUnion>,
4884 fidl::encoding::DefaultFuchsiaResourceDialect
4885 ),
4886 f31: fidl::new_empty!(FidlvizUnion, fidl::encoding::DefaultFuchsiaResourceDialect),
4887 }
4888 }
4889
4890 #[inline]
4891 unsafe fn decode(
4892 &mut self,
4893 decoder: &mut fidl::encoding::Decoder<
4894 '_,
4895 fidl::encoding::DefaultFuchsiaResourceDialect,
4896 >,
4897 offset: usize,
4898 _depth: fidl::encoding::Depth,
4899 ) -> fidl::Result<()> {
4900 decoder.debug_check_bounds::<Self>(offset);
4901 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
4903 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4904 let mask = 0xffffffffffff0000u64;
4905 let maskedval = padval & mask;
4906 if maskedval != 0 {
4907 return Err(fidl::Error::NonZeroPadding {
4908 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
4909 });
4910 }
4911 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(96) };
4912 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4913 let mask = 0xffffffffff000000u64;
4914 let maskedval = padval & mask;
4915 if maskedval != 0 {
4916 return Err(fidl::Error::NonZeroPadding {
4917 padding_start: offset + 96 + ((mask as u64).trailing_zeros() / 8) as usize,
4918 });
4919 }
4920 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(152) };
4921 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4922 let mask = 0xffffffffff000000u64;
4923 let maskedval = padval & mask;
4924 if maskedval != 0 {
4925 return Err(fidl::Error::NonZeroPadding {
4926 padding_start: offset + 152 + ((mask as u64).trailing_zeros() / 8) as usize,
4927 });
4928 }
4929 fidl::decode!(
4930 u8,
4931 fidl::encoding::DefaultFuchsiaResourceDialect,
4932 &mut self.f1,
4933 decoder,
4934 offset + 0,
4935 _depth
4936 )?;
4937 fidl::decode!(
4938 i8,
4939 fidl::encoding::DefaultFuchsiaResourceDialect,
4940 &mut self.f2,
4941 decoder,
4942 offset + 1,
4943 _depth
4944 )?;
4945 fidl::decode!(
4946 u16,
4947 fidl::encoding::DefaultFuchsiaResourceDialect,
4948 &mut self.f3,
4949 decoder,
4950 offset + 2,
4951 _depth
4952 )?;
4953 fidl::decode!(
4954 u32,
4955 fidl::encoding::DefaultFuchsiaResourceDialect,
4956 &mut self.f4,
4957 decoder,
4958 offset + 4,
4959 _depth
4960 )?;
4961 fidl::decode!(
4962 u64,
4963 fidl::encoding::DefaultFuchsiaResourceDialect,
4964 &mut self.f5,
4965 decoder,
4966 offset + 8,
4967 _depth
4968 )?;
4969 fidl::decode!(
4970 u8,
4971 fidl::encoding::DefaultFuchsiaResourceDialect,
4972 &mut self.f6,
4973 decoder,
4974 offset + 16,
4975 _depth
4976 )?;
4977 fidl::decode!(
4978 u8,
4979 fidl::encoding::DefaultFuchsiaResourceDialect,
4980 &mut self.f7,
4981 decoder,
4982 offset + 17,
4983 _depth
4984 )?;
4985 fidl::decode!(
4986 u16,
4987 fidl::encoding::DefaultFuchsiaResourceDialect,
4988 &mut self.f8,
4989 decoder,
4990 offset + 18,
4991 _depth
4992 )?;
4993 fidl::decode!(
4994 f32,
4995 fidl::encoding::DefaultFuchsiaResourceDialect,
4996 &mut self.f9,
4997 decoder,
4998 offset + 20,
4999 _depth
5000 )?;
5001 fidl::decode!(
5002 f64,
5003 fidl::encoding::DefaultFuchsiaResourceDialect,
5004 &mut self.f10,
5005 decoder,
5006 offset + 24,
5007 _depth
5008 )?;
5009 fidl::decode!(
5010 bool,
5011 fidl::encoding::DefaultFuchsiaResourceDialect,
5012 &mut self.f11,
5013 decoder,
5014 offset + 32,
5015 _depth
5016 )?;
5017 fidl::decode!(
5018 bool,
5019 fidl::encoding::DefaultFuchsiaResourceDialect,
5020 &mut self.f12,
5021 decoder,
5022 offset + 33,
5023 _depth
5024 )?;
5025 fidl::decode!(
5026 fidl::encoding::UnboundedString,
5027 fidl::encoding::DefaultFuchsiaResourceDialect,
5028 &mut self.f13,
5029 decoder,
5030 offset + 40,
5031 _depth
5032 )?;
5033 fidl::decode!(
5034 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
5035 fidl::encoding::DefaultFuchsiaResourceDialect,
5036 &mut self.f14,
5037 decoder,
5038 offset + 56,
5039 _depth
5040 )?;
5041 fidl::decode!(
5042 fidl::encoding::UnboundedString,
5043 fidl::encoding::DefaultFuchsiaResourceDialect,
5044 &mut self.f15,
5045 decoder,
5046 offset + 72,
5047 _depth
5048 )?;
5049 fidl::decode!(
5050 fidl::encoding::Optional<
5051 fidl::encoding::HandleType<
5052 fidl::Handle,
5053 { fidl::ObjectType::NONE.into_raw() },
5054 2147483648,
5055 >,
5056 >,
5057 fidl::encoding::DefaultFuchsiaResourceDialect,
5058 &mut self.f16,
5059 decoder,
5060 offset + 88,
5061 _depth
5062 )?;
5063 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.f17, decoder, offset + 92, _depth)?;
5064 fidl::decode!(fidl::encoding::Array<u8, 3>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.f18, decoder, offset + 96, _depth)?;
5065 fidl::decode!(
5066 fidl::encoding::UnboundedVector<f64>,
5067 fidl::encoding::DefaultFuchsiaResourceDialect,
5068 &mut self.f19,
5069 decoder,
5070 offset + 104,
5071 _depth
5072 )?;
5073 fidl::decode!(
5074 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
5075 fidl::encoding::DefaultFuchsiaResourceDialect,
5076 &mut self.f20,
5077 decoder,
5078 offset + 120,
5079 _depth
5080 )?;
5081 fidl::decode!(
5082 fidl::encoding::UnboundedVector<u8>,
5083 fidl::encoding::DefaultFuchsiaResourceDialect,
5084 &mut self.f21,
5085 decoder,
5086 offset + 136,
5087 _depth
5088 )?;
5089 fidl::decode!(
5090 FidlvizBits,
5091 fidl::encoding::DefaultFuchsiaResourceDialect,
5092 &mut self.f22,
5093 decoder,
5094 offset + 152,
5095 _depth
5096 )?;
5097 fidl::decode!(
5098 FidlvizEnum,
5099 fidl::encoding::DefaultFuchsiaResourceDialect,
5100 &mut self.f23,
5101 decoder,
5102 offset + 153,
5103 _depth
5104 )?;
5105 fidl::decode!(
5106 FidlvizStruct1,
5107 fidl::encoding::DefaultFuchsiaResourceDialect,
5108 &mut self.f24,
5109 decoder,
5110 offset + 154,
5111 _depth
5112 )?;
5113 fidl::decode!(
5114 FidlvizStruct2,
5115 fidl::encoding::DefaultFuchsiaResourceDialect,
5116 &mut self.f25,
5117 decoder,
5118 offset + 160,
5119 _depth
5120 )?;
5121 fidl::decode!(
5122 fidl::encoding::Boxed<FidlvizStruct1>,
5123 fidl::encoding::DefaultFuchsiaResourceDialect,
5124 &mut self.f26,
5125 decoder,
5126 offset + 168,
5127 _depth
5128 )?;
5129 fidl::decode!(
5130 fidl::encoding::Boxed<FidlvizStruct2>,
5131 fidl::encoding::DefaultFuchsiaResourceDialect,
5132 &mut self.f27,
5133 decoder,
5134 offset + 176,
5135 _depth
5136 )?;
5137 fidl::decode!(
5138 FidlvizTable,
5139 fidl::encoding::DefaultFuchsiaResourceDialect,
5140 &mut self.f28,
5141 decoder,
5142 offset + 184,
5143 _depth
5144 )?;
5145 fidl::decode!(
5146 FidlvizTable,
5147 fidl::encoding::DefaultFuchsiaResourceDialect,
5148 &mut self.f29,
5149 decoder,
5150 offset + 200,
5151 _depth
5152 )?;
5153 fidl::decode!(
5154 fidl::encoding::OptionalUnion<FidlvizUnion>,
5155 fidl::encoding::DefaultFuchsiaResourceDialect,
5156 &mut self.f30,
5157 decoder,
5158 offset + 216,
5159 _depth
5160 )?;
5161 fidl::decode!(
5162 FidlvizUnion,
5163 fidl::encoding::DefaultFuchsiaResourceDialect,
5164 &mut self.f31,
5165 decoder,
5166 offset + 232,
5167 _depth
5168 )?;
5169 Ok(())
5170 }
5171 }
5172
5173 impl fidl::encoding::ResourceTypeMarker for GoldenHandleBasicRightsStruct {
5174 type Borrowed<'a> = &'a mut Self;
5175 fn take_or_borrow<'a>(
5176 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5177 ) -> Self::Borrowed<'a> {
5178 value
5179 }
5180 }
5181
5182 unsafe impl fidl::encoding::TypeMarker for GoldenHandleBasicRightsStruct {
5183 type Owned = Self;
5184
5185 #[inline(always)]
5186 fn inline_align(_context: fidl::encoding::Context) -> usize {
5187 4
5188 }
5189
5190 #[inline(always)]
5191 fn inline_size(_context: fidl::encoding::Context) -> usize {
5192 4
5193 }
5194 }
5195
5196 unsafe impl
5197 fidl::encoding::Encode<
5198 GoldenHandleBasicRightsStruct,
5199 fidl::encoding::DefaultFuchsiaResourceDialect,
5200 > for &mut GoldenHandleBasicRightsStruct
5201 {
5202 #[inline]
5203 unsafe fn encode(
5204 self,
5205 encoder: &mut fidl::encoding::Encoder<
5206 '_,
5207 fidl::encoding::DefaultFuchsiaResourceDialect,
5208 >,
5209 offset: usize,
5210 _depth: fidl::encoding::Depth,
5211 ) -> fidl::Result<()> {
5212 encoder.debug_check_bounds::<GoldenHandleBasicRightsStruct>(offset);
5213 fidl::encoding::Encode::<
5215 GoldenHandleBasicRightsStruct,
5216 fidl::encoding::DefaultFuchsiaResourceDialect,
5217 >::encode(
5218 (<fidl::encoding::HandleType<
5219 fidl::Event,
5220 { fidl::ObjectType::EVENT.into_raw() },
5221 49155,
5222 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5223 &mut self.v
5224 ),),
5225 encoder,
5226 offset,
5227 _depth,
5228 )
5229 }
5230 }
5231 unsafe impl<
5232 T0: fidl::encoding::Encode<
5233 fidl::encoding::HandleType<
5234 fidl::Event,
5235 { fidl::ObjectType::EVENT.into_raw() },
5236 49155,
5237 >,
5238 fidl::encoding::DefaultFuchsiaResourceDialect,
5239 >,
5240 >
5241 fidl::encoding::Encode<
5242 GoldenHandleBasicRightsStruct,
5243 fidl::encoding::DefaultFuchsiaResourceDialect,
5244 > for (T0,)
5245 {
5246 #[inline]
5247 unsafe fn encode(
5248 self,
5249 encoder: &mut fidl::encoding::Encoder<
5250 '_,
5251 fidl::encoding::DefaultFuchsiaResourceDialect,
5252 >,
5253 offset: usize,
5254 depth: fidl::encoding::Depth,
5255 ) -> fidl::Result<()> {
5256 encoder.debug_check_bounds::<GoldenHandleBasicRightsStruct>(offset);
5257 self.0.encode(encoder, offset + 0, depth)?;
5261 Ok(())
5262 }
5263 }
5264
5265 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5266 for GoldenHandleBasicRightsStruct
5267 {
5268 #[inline(always)]
5269 fn new_empty() -> Self {
5270 Self {
5271 v: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 49155>, fidl::encoding::DefaultFuchsiaResourceDialect),
5272 }
5273 }
5274
5275 #[inline]
5276 unsafe fn decode(
5277 &mut self,
5278 decoder: &mut fidl::encoding::Decoder<
5279 '_,
5280 fidl::encoding::DefaultFuchsiaResourceDialect,
5281 >,
5282 offset: usize,
5283 _depth: fidl::encoding::Depth,
5284 ) -> fidl::Result<()> {
5285 decoder.debug_check_bounds::<Self>(offset);
5286 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 49155>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.v, decoder, offset + 0, _depth)?;
5288 Ok(())
5289 }
5290 }
5291
5292 impl fidl::encoding::ResourceTypeMarker for GoldenNullableHandleStruct {
5293 type Borrowed<'a> = &'a mut Self;
5294 fn take_or_borrow<'a>(
5295 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5296 ) -> Self::Borrowed<'a> {
5297 value
5298 }
5299 }
5300
5301 unsafe impl fidl::encoding::TypeMarker for GoldenNullableHandleStruct {
5302 type Owned = Self;
5303
5304 #[inline(always)]
5305 fn inline_align(_context: fidl::encoding::Context) -> usize {
5306 4
5307 }
5308
5309 #[inline(always)]
5310 fn inline_size(_context: fidl::encoding::Context) -> usize {
5311 4
5312 }
5313 }
5314
5315 unsafe impl
5316 fidl::encoding::Encode<
5317 GoldenNullableHandleStruct,
5318 fidl::encoding::DefaultFuchsiaResourceDialect,
5319 > for &mut GoldenNullableHandleStruct
5320 {
5321 #[inline]
5322 unsafe fn encode(
5323 self,
5324 encoder: &mut fidl::encoding::Encoder<
5325 '_,
5326 fidl::encoding::DefaultFuchsiaResourceDialect,
5327 >,
5328 offset: usize,
5329 _depth: fidl::encoding::Depth,
5330 ) -> fidl::Result<()> {
5331 encoder.debug_check_bounds::<GoldenNullableHandleStruct>(offset);
5332 fidl::encoding::Encode::<
5334 GoldenNullableHandleStruct,
5335 fidl::encoding::DefaultFuchsiaResourceDialect,
5336 >::encode(
5337 (<fidl::encoding::Optional<
5338 fidl::encoding::HandleType<
5339 fidl::Handle,
5340 { fidl::ObjectType::NONE.into_raw() },
5341 2147483648,
5342 >,
5343 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5344 &mut self.v
5345 ),),
5346 encoder,
5347 offset,
5348 _depth,
5349 )
5350 }
5351 }
5352 unsafe impl<
5353 T0: fidl::encoding::Encode<
5354 fidl::encoding::Optional<
5355 fidl::encoding::HandleType<
5356 fidl::Handle,
5357 { fidl::ObjectType::NONE.into_raw() },
5358 2147483648,
5359 >,
5360 >,
5361 fidl::encoding::DefaultFuchsiaResourceDialect,
5362 >,
5363 >
5364 fidl::encoding::Encode<
5365 GoldenNullableHandleStruct,
5366 fidl::encoding::DefaultFuchsiaResourceDialect,
5367 > for (T0,)
5368 {
5369 #[inline]
5370 unsafe fn encode(
5371 self,
5372 encoder: &mut fidl::encoding::Encoder<
5373 '_,
5374 fidl::encoding::DefaultFuchsiaResourceDialect,
5375 >,
5376 offset: usize,
5377 depth: fidl::encoding::Depth,
5378 ) -> fidl::Result<()> {
5379 encoder.debug_check_bounds::<GoldenNullableHandleStruct>(offset);
5380 self.0.encode(encoder, offset + 0, depth)?;
5384 Ok(())
5385 }
5386 }
5387
5388 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5389 for GoldenNullableHandleStruct
5390 {
5391 #[inline(always)]
5392 fn new_empty() -> Self {
5393 Self {
5394 v: fidl::new_empty!(
5395 fidl::encoding::Optional<
5396 fidl::encoding::HandleType<
5397 fidl::Handle,
5398 { fidl::ObjectType::NONE.into_raw() },
5399 2147483648,
5400 >,
5401 >,
5402 fidl::encoding::DefaultFuchsiaResourceDialect
5403 ),
5404 }
5405 }
5406
5407 #[inline]
5408 unsafe fn decode(
5409 &mut self,
5410 decoder: &mut fidl::encoding::Decoder<
5411 '_,
5412 fidl::encoding::DefaultFuchsiaResourceDialect,
5413 >,
5414 offset: usize,
5415 _depth: fidl::encoding::Depth,
5416 ) -> fidl::Result<()> {
5417 decoder.debug_check_bounds::<Self>(offset);
5418 fidl::decode!(
5420 fidl::encoding::Optional<
5421 fidl::encoding::HandleType<
5422 fidl::Handle,
5423 { fidl::ObjectType::NONE.into_raw() },
5424 2147483648,
5425 >,
5426 >,
5427 fidl::encoding::DefaultFuchsiaResourceDialect,
5428 &mut self.v,
5429 decoder,
5430 offset + 0,
5431 _depth
5432 )?;
5433 Ok(())
5434 }
5435 }
5436
5437 impl fidl::encoding::ResourceTypeMarker for LaunchInfo {
5438 type Borrowed<'a> = &'a mut Self;
5439 fn take_or_borrow<'a>(
5440 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5441 ) -> Self::Borrowed<'a> {
5442 value
5443 }
5444 }
5445
5446 unsafe impl fidl::encoding::TypeMarker for LaunchInfo {
5447 type Owned = Self;
5448
5449 #[inline(always)]
5450 fn inline_align(_context: fidl::encoding::Context) -> usize {
5451 8
5452 }
5453
5454 #[inline(always)]
5455 fn inline_size(_context: fidl::encoding::Context) -> usize {
5456 72
5457 }
5458 }
5459
5460 unsafe impl fidl::encoding::Encode<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
5461 for &mut LaunchInfo
5462 {
5463 #[inline]
5464 unsafe fn encode(
5465 self,
5466 encoder: &mut fidl::encoding::Encoder<
5467 '_,
5468 fidl::encoding::DefaultFuchsiaResourceDialect,
5469 >,
5470 offset: usize,
5471 _depth: fidl::encoding::Depth,
5472 ) -> fidl::Result<()> {
5473 encoder.debug_check_bounds::<LaunchInfo>(offset);
5474 fidl::encoding::Encode::<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5476 (
5477 <fidl::encoding::BoundedString<200> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
5478 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>> as fidl::encoding::ValueTypeMarker>::borrow(&self.arguments),
5479 <fidl::encoding::Boxed<TransformerEmptyStruct> as fidl::encoding::ValueTypeMarker>::borrow(&self.out),
5480 <fidl::encoding::Boxed<TransformerEmptyStruct> as fidl::encoding::ValueTypeMarker>::borrow(&self.err),
5481 <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory_request),
5482 <fidl::encoding::Boxed<TransformerEmptyStruct> as fidl::encoding::ValueTypeMarker>::borrow(&self.flat_namespace),
5483 <fidl::encoding::Boxed<TransformerEmptyStruct> as fidl::encoding::ValueTypeMarker>::borrow(&self.additional_services),
5484 ),
5485 encoder, offset, _depth
5486 )
5487 }
5488 }
5489 unsafe impl<
5490 T0: fidl::encoding::Encode<
5491 fidl::encoding::BoundedString<200>,
5492 fidl::encoding::DefaultFuchsiaResourceDialect,
5493 >,
5494 T1: fidl::encoding::Encode<
5495 fidl::encoding::Optional<
5496 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5497 >,
5498 fidl::encoding::DefaultFuchsiaResourceDialect,
5499 >,
5500 T2: fidl::encoding::Encode<
5501 fidl::encoding::Boxed<TransformerEmptyStruct>,
5502 fidl::encoding::DefaultFuchsiaResourceDialect,
5503 >,
5504 T3: fidl::encoding::Encode<
5505 fidl::encoding::Boxed<TransformerEmptyStruct>,
5506 fidl::encoding::DefaultFuchsiaResourceDialect,
5507 >,
5508 T4: fidl::encoding::Encode<
5509 fidl::encoding::Optional<
5510 fidl::encoding::HandleType<
5511 fidl::Channel,
5512 { fidl::ObjectType::CHANNEL.into_raw() },
5513 2147483648,
5514 >,
5515 >,
5516 fidl::encoding::DefaultFuchsiaResourceDialect,
5517 >,
5518 T5: fidl::encoding::Encode<
5519 fidl::encoding::Boxed<TransformerEmptyStruct>,
5520 fidl::encoding::DefaultFuchsiaResourceDialect,
5521 >,
5522 T6: fidl::encoding::Encode<
5523 fidl::encoding::Boxed<TransformerEmptyStruct>,
5524 fidl::encoding::DefaultFuchsiaResourceDialect,
5525 >,
5526 > fidl::encoding::Encode<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
5527 for (T0, T1, T2, T3, T4, T5, T6)
5528 {
5529 #[inline]
5530 unsafe fn encode(
5531 self,
5532 encoder: &mut fidl::encoding::Encoder<
5533 '_,
5534 fidl::encoding::DefaultFuchsiaResourceDialect,
5535 >,
5536 offset: usize,
5537 depth: fidl::encoding::Depth,
5538 ) -> fidl::Result<()> {
5539 encoder.debug_check_bounds::<LaunchInfo>(offset);
5540 unsafe {
5543 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
5544 (ptr as *mut u64).write_unaligned(0);
5545 }
5546 self.0.encode(encoder, offset + 0, depth)?;
5548 self.1.encode(encoder, offset + 16, depth)?;
5549 self.2.encode(encoder, offset + 32, depth)?;
5550 self.3.encode(encoder, offset + 40, depth)?;
5551 self.4.encode(encoder, offset + 48, depth)?;
5552 self.5.encode(encoder, offset + 56, depth)?;
5553 self.6.encode(encoder, offset + 64, depth)?;
5554 Ok(())
5555 }
5556 }
5557
5558 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for LaunchInfo {
5559 #[inline(always)]
5560 fn new_empty() -> Self {
5561 Self {
5562 url: fidl::new_empty!(
5563 fidl::encoding::BoundedString<200>,
5564 fidl::encoding::DefaultFuchsiaResourceDialect
5565 ),
5566 arguments: fidl::new_empty!(
5567 fidl::encoding::Optional<
5568 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5569 >,
5570 fidl::encoding::DefaultFuchsiaResourceDialect
5571 ),
5572 out: fidl::new_empty!(
5573 fidl::encoding::Boxed<TransformerEmptyStruct>,
5574 fidl::encoding::DefaultFuchsiaResourceDialect
5575 ),
5576 err: fidl::new_empty!(
5577 fidl::encoding::Boxed<TransformerEmptyStruct>,
5578 fidl::encoding::DefaultFuchsiaResourceDialect
5579 ),
5580 directory_request: fidl::new_empty!(
5581 fidl::encoding::Optional<
5582 fidl::encoding::HandleType<
5583 fidl::Channel,
5584 { fidl::ObjectType::CHANNEL.into_raw() },
5585 2147483648,
5586 >,
5587 >,
5588 fidl::encoding::DefaultFuchsiaResourceDialect
5589 ),
5590 flat_namespace: fidl::new_empty!(
5591 fidl::encoding::Boxed<TransformerEmptyStruct>,
5592 fidl::encoding::DefaultFuchsiaResourceDialect
5593 ),
5594 additional_services: fidl::new_empty!(
5595 fidl::encoding::Boxed<TransformerEmptyStruct>,
5596 fidl::encoding::DefaultFuchsiaResourceDialect
5597 ),
5598 }
5599 }
5600
5601 #[inline]
5602 unsafe fn decode(
5603 &mut self,
5604 decoder: &mut fidl::encoding::Decoder<
5605 '_,
5606 fidl::encoding::DefaultFuchsiaResourceDialect,
5607 >,
5608 offset: usize,
5609 _depth: fidl::encoding::Depth,
5610 ) -> fidl::Result<()> {
5611 decoder.debug_check_bounds::<Self>(offset);
5612 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
5614 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5615 let mask = 0xffffffff00000000u64;
5616 let maskedval = padval & mask;
5617 if maskedval != 0 {
5618 return Err(fidl::Error::NonZeroPadding {
5619 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
5620 });
5621 }
5622 fidl::decode!(
5623 fidl::encoding::BoundedString<200>,
5624 fidl::encoding::DefaultFuchsiaResourceDialect,
5625 &mut self.url,
5626 decoder,
5627 offset + 0,
5628 _depth
5629 )?;
5630 fidl::decode!(
5631 fidl::encoding::Optional<
5632 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
5633 >,
5634 fidl::encoding::DefaultFuchsiaResourceDialect,
5635 &mut self.arguments,
5636 decoder,
5637 offset + 16,
5638 _depth
5639 )?;
5640 fidl::decode!(
5641 fidl::encoding::Boxed<TransformerEmptyStruct>,
5642 fidl::encoding::DefaultFuchsiaResourceDialect,
5643 &mut self.out,
5644 decoder,
5645 offset + 32,
5646 _depth
5647 )?;
5648 fidl::decode!(
5649 fidl::encoding::Boxed<TransformerEmptyStruct>,
5650 fidl::encoding::DefaultFuchsiaResourceDialect,
5651 &mut self.err,
5652 decoder,
5653 offset + 40,
5654 _depth
5655 )?;
5656 fidl::decode!(
5657 fidl::encoding::Optional<
5658 fidl::encoding::HandleType<
5659 fidl::Channel,
5660 { fidl::ObjectType::CHANNEL.into_raw() },
5661 2147483648,
5662 >,
5663 >,
5664 fidl::encoding::DefaultFuchsiaResourceDialect,
5665 &mut self.directory_request,
5666 decoder,
5667 offset + 48,
5668 _depth
5669 )?;
5670 fidl::decode!(
5671 fidl::encoding::Boxed<TransformerEmptyStruct>,
5672 fidl::encoding::DefaultFuchsiaResourceDialect,
5673 &mut self.flat_namespace,
5674 decoder,
5675 offset + 56,
5676 _depth
5677 )?;
5678 fidl::decode!(
5679 fidl::encoding::Boxed<TransformerEmptyStruct>,
5680 fidl::encoding::DefaultFuchsiaResourceDialect,
5681 &mut self.additional_services,
5682 decoder,
5683 offset + 64,
5684 _depth
5685 )?;
5686 Ok(())
5687 }
5688 }
5689
5690 impl fidl::encoding::ResourceTypeMarker for MultipleBoundedNonnullableVectorsOfHandles {
5691 type Borrowed<'a> = &'a mut Self;
5692 fn take_or_borrow<'a>(
5693 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5694 ) -> Self::Borrowed<'a> {
5695 value
5696 }
5697 }
5698
5699 unsafe impl fidl::encoding::TypeMarker for MultipleBoundedNonnullableVectorsOfHandles {
5700 type Owned = Self;
5701
5702 #[inline(always)]
5703 fn inline_align(_context: fidl::encoding::Context) -> usize {
5704 8
5705 }
5706
5707 #[inline(always)]
5708 fn inline_size(_context: fidl::encoding::Context) -> usize {
5709 32
5710 }
5711 }
5712
5713 unsafe impl
5714 fidl::encoding::Encode<
5715 MultipleBoundedNonnullableVectorsOfHandles,
5716 fidl::encoding::DefaultFuchsiaResourceDialect,
5717 > for &mut MultipleBoundedNonnullableVectorsOfHandles
5718 {
5719 #[inline]
5720 unsafe fn encode(
5721 self,
5722 encoder: &mut fidl::encoding::Encoder<
5723 '_,
5724 fidl::encoding::DefaultFuchsiaResourceDialect,
5725 >,
5726 offset: usize,
5727 _depth: fidl::encoding::Depth,
5728 ) -> fidl::Result<()> {
5729 encoder.debug_check_bounds::<MultipleBoundedNonnullableVectorsOfHandles>(offset);
5730 fidl::encoding::Encode::<
5732 MultipleBoundedNonnullableVectorsOfHandles,
5733 fidl::encoding::DefaultFuchsiaResourceDialect,
5734 >::encode(
5735 (
5736 <fidl::encoding::Vector<
5737 fidl::encoding::HandleType<
5738 fidl::Handle,
5739 { fidl::ObjectType::NONE.into_raw() },
5740 2147483648,
5741 >,
5742 2,
5743 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5744 &mut self.vh0
5745 ),
5746 <fidl::encoding::Vector<
5747 fidl::encoding::HandleType<
5748 fidl::Handle,
5749 { fidl::ObjectType::NONE.into_raw() },
5750 2147483648,
5751 >,
5752 32,
5753 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5754 &mut self.vh1
5755 ),
5756 ),
5757 encoder,
5758 offset,
5759 _depth,
5760 )
5761 }
5762 }
5763 unsafe impl<
5764 T0: fidl::encoding::Encode<
5765 fidl::encoding::Vector<
5766 fidl::encoding::HandleType<
5767 fidl::Handle,
5768 { fidl::ObjectType::NONE.into_raw() },
5769 2147483648,
5770 >,
5771 2,
5772 >,
5773 fidl::encoding::DefaultFuchsiaResourceDialect,
5774 >,
5775 T1: fidl::encoding::Encode<
5776 fidl::encoding::Vector<
5777 fidl::encoding::HandleType<
5778 fidl::Handle,
5779 { fidl::ObjectType::NONE.into_raw() },
5780 2147483648,
5781 >,
5782 32,
5783 >,
5784 fidl::encoding::DefaultFuchsiaResourceDialect,
5785 >,
5786 >
5787 fidl::encoding::Encode<
5788 MultipleBoundedNonnullableVectorsOfHandles,
5789 fidl::encoding::DefaultFuchsiaResourceDialect,
5790 > for (T0, T1)
5791 {
5792 #[inline]
5793 unsafe fn encode(
5794 self,
5795 encoder: &mut fidl::encoding::Encoder<
5796 '_,
5797 fidl::encoding::DefaultFuchsiaResourceDialect,
5798 >,
5799 offset: usize,
5800 depth: fidl::encoding::Depth,
5801 ) -> fidl::Result<()> {
5802 encoder.debug_check_bounds::<MultipleBoundedNonnullableVectorsOfHandles>(offset);
5803 self.0.encode(encoder, offset + 0, depth)?;
5807 self.1.encode(encoder, offset + 16, depth)?;
5808 Ok(())
5809 }
5810 }
5811
5812 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5813 for MultipleBoundedNonnullableVectorsOfHandles
5814 {
5815 #[inline(always)]
5816 fn new_empty() -> Self {
5817 Self {
5818 vh0: fidl::new_empty!(
5819 fidl::encoding::Vector<
5820 fidl::encoding::HandleType<
5821 fidl::Handle,
5822 { fidl::ObjectType::NONE.into_raw() },
5823 2147483648,
5824 >,
5825 2,
5826 >,
5827 fidl::encoding::DefaultFuchsiaResourceDialect
5828 ),
5829 vh1: fidl::new_empty!(
5830 fidl::encoding::Vector<
5831 fidl::encoding::HandleType<
5832 fidl::Handle,
5833 { fidl::ObjectType::NONE.into_raw() },
5834 2147483648,
5835 >,
5836 32,
5837 >,
5838 fidl::encoding::DefaultFuchsiaResourceDialect
5839 ),
5840 }
5841 }
5842
5843 #[inline]
5844 unsafe fn decode(
5845 &mut self,
5846 decoder: &mut fidl::encoding::Decoder<
5847 '_,
5848 fidl::encoding::DefaultFuchsiaResourceDialect,
5849 >,
5850 offset: usize,
5851 _depth: fidl::encoding::Depth,
5852 ) -> fidl::Result<()> {
5853 decoder.debug_check_bounds::<Self>(offset);
5854 fidl::decode!(
5856 fidl::encoding::Vector<
5857 fidl::encoding::HandleType<
5858 fidl::Handle,
5859 { fidl::ObjectType::NONE.into_raw() },
5860 2147483648,
5861 >,
5862 2,
5863 >,
5864 fidl::encoding::DefaultFuchsiaResourceDialect,
5865 &mut self.vh0,
5866 decoder,
5867 offset + 0,
5868 _depth
5869 )?;
5870 fidl::decode!(
5871 fidl::encoding::Vector<
5872 fidl::encoding::HandleType<
5873 fidl::Handle,
5874 { fidl::ObjectType::NONE.into_raw() },
5875 2147483648,
5876 >,
5877 32,
5878 >,
5879 fidl::encoding::DefaultFuchsiaResourceDialect,
5880 &mut self.vh1,
5881 decoder,
5882 offset + 16,
5883 _depth
5884 )?;
5885 Ok(())
5886 }
5887 }
5888
5889 impl fidl::encoding::ResourceTypeMarker for MultipleBoundedNullableVectorsOfHandles {
5890 type Borrowed<'a> = &'a mut Self;
5891 fn take_or_borrow<'a>(
5892 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5893 ) -> Self::Borrowed<'a> {
5894 value
5895 }
5896 }
5897
5898 unsafe impl fidl::encoding::TypeMarker for MultipleBoundedNullableVectorsOfHandles {
5899 type Owned = Self;
5900
5901 #[inline(always)]
5902 fn inline_align(_context: fidl::encoding::Context) -> usize {
5903 8
5904 }
5905
5906 #[inline(always)]
5907 fn inline_size(_context: fidl::encoding::Context) -> usize {
5908 32
5909 }
5910 }
5911
5912 unsafe impl
5913 fidl::encoding::Encode<
5914 MultipleBoundedNullableVectorsOfHandles,
5915 fidl::encoding::DefaultFuchsiaResourceDialect,
5916 > for &mut MultipleBoundedNullableVectorsOfHandles
5917 {
5918 #[inline]
5919 unsafe fn encode(
5920 self,
5921 encoder: &mut fidl::encoding::Encoder<
5922 '_,
5923 fidl::encoding::DefaultFuchsiaResourceDialect,
5924 >,
5925 offset: usize,
5926 _depth: fidl::encoding::Depth,
5927 ) -> fidl::Result<()> {
5928 encoder.debug_check_bounds::<MultipleBoundedNullableVectorsOfHandles>(offset);
5929 fidl::encoding::Encode::<
5931 MultipleBoundedNullableVectorsOfHandles,
5932 fidl::encoding::DefaultFuchsiaResourceDialect,
5933 >::encode(
5934 (
5935 <fidl::encoding::Optional<
5936 fidl::encoding::Vector<
5937 fidl::encoding::HandleType<
5938 fidl::Handle,
5939 { fidl::ObjectType::NONE.into_raw() },
5940 2147483648,
5941 >,
5942 2,
5943 >,
5944 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5945 &mut self.vh0
5946 ),
5947 <fidl::encoding::Optional<
5948 fidl::encoding::Vector<
5949 fidl::encoding::HandleType<
5950 fidl::Handle,
5951 { fidl::ObjectType::NONE.into_raw() },
5952 2147483648,
5953 >,
5954 32,
5955 >,
5956 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5957 &mut self.vh1
5958 ),
5959 ),
5960 encoder,
5961 offset,
5962 _depth,
5963 )
5964 }
5965 }
5966 unsafe impl<
5967 T0: fidl::encoding::Encode<
5968 fidl::encoding::Optional<
5969 fidl::encoding::Vector<
5970 fidl::encoding::HandleType<
5971 fidl::Handle,
5972 { fidl::ObjectType::NONE.into_raw() },
5973 2147483648,
5974 >,
5975 2,
5976 >,
5977 >,
5978 fidl::encoding::DefaultFuchsiaResourceDialect,
5979 >,
5980 T1: fidl::encoding::Encode<
5981 fidl::encoding::Optional<
5982 fidl::encoding::Vector<
5983 fidl::encoding::HandleType<
5984 fidl::Handle,
5985 { fidl::ObjectType::NONE.into_raw() },
5986 2147483648,
5987 >,
5988 32,
5989 >,
5990 >,
5991 fidl::encoding::DefaultFuchsiaResourceDialect,
5992 >,
5993 >
5994 fidl::encoding::Encode<
5995 MultipleBoundedNullableVectorsOfHandles,
5996 fidl::encoding::DefaultFuchsiaResourceDialect,
5997 > for (T0, T1)
5998 {
5999 #[inline]
6000 unsafe fn encode(
6001 self,
6002 encoder: &mut fidl::encoding::Encoder<
6003 '_,
6004 fidl::encoding::DefaultFuchsiaResourceDialect,
6005 >,
6006 offset: usize,
6007 depth: fidl::encoding::Depth,
6008 ) -> fidl::Result<()> {
6009 encoder.debug_check_bounds::<MultipleBoundedNullableVectorsOfHandles>(offset);
6010 self.0.encode(encoder, offset + 0, depth)?;
6014 self.1.encode(encoder, offset + 16, depth)?;
6015 Ok(())
6016 }
6017 }
6018
6019 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6020 for MultipleBoundedNullableVectorsOfHandles
6021 {
6022 #[inline(always)]
6023 fn new_empty() -> Self {
6024 Self {
6025 vh0: fidl::new_empty!(
6026 fidl::encoding::Optional<
6027 fidl::encoding::Vector<
6028 fidl::encoding::HandleType<
6029 fidl::Handle,
6030 { fidl::ObjectType::NONE.into_raw() },
6031 2147483648,
6032 >,
6033 2,
6034 >,
6035 >,
6036 fidl::encoding::DefaultFuchsiaResourceDialect
6037 ),
6038 vh1: fidl::new_empty!(
6039 fidl::encoding::Optional<
6040 fidl::encoding::Vector<
6041 fidl::encoding::HandleType<
6042 fidl::Handle,
6043 { fidl::ObjectType::NONE.into_raw() },
6044 2147483648,
6045 >,
6046 32,
6047 >,
6048 >,
6049 fidl::encoding::DefaultFuchsiaResourceDialect
6050 ),
6051 }
6052 }
6053
6054 #[inline]
6055 unsafe fn decode(
6056 &mut self,
6057 decoder: &mut fidl::encoding::Decoder<
6058 '_,
6059 fidl::encoding::DefaultFuchsiaResourceDialect,
6060 >,
6061 offset: usize,
6062 _depth: fidl::encoding::Depth,
6063 ) -> fidl::Result<()> {
6064 decoder.debug_check_bounds::<Self>(offset);
6065 fidl::decode!(
6067 fidl::encoding::Optional<
6068 fidl::encoding::Vector<
6069 fidl::encoding::HandleType<
6070 fidl::Handle,
6071 { fidl::ObjectType::NONE.into_raw() },
6072 2147483648,
6073 >,
6074 2,
6075 >,
6076 >,
6077 fidl::encoding::DefaultFuchsiaResourceDialect,
6078 &mut self.vh0,
6079 decoder,
6080 offset + 0,
6081 _depth
6082 )?;
6083 fidl::decode!(
6084 fidl::encoding::Optional<
6085 fidl::encoding::Vector<
6086 fidl::encoding::HandleType<
6087 fidl::Handle,
6088 { fidl::ObjectType::NONE.into_raw() },
6089 2147483648,
6090 >,
6091 32,
6092 >,
6093 >,
6094 fidl::encoding::DefaultFuchsiaResourceDialect,
6095 &mut self.vh1,
6096 decoder,
6097 offset + 16,
6098 _depth
6099 )?;
6100 Ok(())
6101 }
6102 }
6103
6104 impl fidl::encoding::ResourceTypeMarker for MultipleHandleSubtypes {
6105 type Borrowed<'a> = &'a mut Self;
6106 fn take_or_borrow<'a>(
6107 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6108 ) -> Self::Borrowed<'a> {
6109 value
6110 }
6111 }
6112
6113 unsafe impl fidl::encoding::TypeMarker for MultipleHandleSubtypes {
6114 type Owned = Self;
6115
6116 #[inline(always)]
6117 fn inline_align(_context: fidl::encoding::Context) -> usize {
6118 4
6119 }
6120
6121 #[inline(always)]
6122 fn inline_size(_context: fidl::encoding::Context) -> usize {
6123 12
6124 }
6125 }
6126
6127 unsafe impl
6128 fidl::encoding::Encode<
6129 MultipleHandleSubtypes,
6130 fidl::encoding::DefaultFuchsiaResourceDialect,
6131 > for &mut MultipleHandleSubtypes
6132 {
6133 #[inline]
6134 unsafe fn encode(
6135 self,
6136 encoder: &mut fidl::encoding::Encoder<
6137 '_,
6138 fidl::encoding::DefaultFuchsiaResourceDialect,
6139 >,
6140 offset: usize,
6141 _depth: fidl::encoding::Depth,
6142 ) -> fidl::Result<()> {
6143 encoder.debug_check_bounds::<MultipleHandleSubtypes>(offset);
6144 fidl::encoding::Encode::<
6146 MultipleHandleSubtypes,
6147 fidl::encoding::DefaultFuchsiaResourceDialect,
6148 >::encode(
6149 (
6150 <fidl::encoding::HandleType<
6151 fidl::Handle,
6152 { fidl::ObjectType::NONE.into_raw() },
6153 2147483648,
6154 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6155 &mut self.untyped
6156 ),
6157 <fidl::encoding::HandleType<
6158 fidl::Event,
6159 { fidl::ObjectType::EVENT.into_raw() },
6160 2147483648,
6161 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6162 &mut self.event
6163 ),
6164 <fidl::encoding::HandleType<
6165 fidl::Channel,
6166 { fidl::ObjectType::CHANNEL.into_raw() },
6167 2147483648,
6168 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6169 &mut self.channel
6170 ),
6171 ),
6172 encoder,
6173 offset,
6174 _depth,
6175 )
6176 }
6177 }
6178 unsafe impl<
6179 T0: fidl::encoding::Encode<
6180 fidl::encoding::HandleType<
6181 fidl::Handle,
6182 { fidl::ObjectType::NONE.into_raw() },
6183 2147483648,
6184 >,
6185 fidl::encoding::DefaultFuchsiaResourceDialect,
6186 >,
6187 T1: fidl::encoding::Encode<
6188 fidl::encoding::HandleType<
6189 fidl::Event,
6190 { fidl::ObjectType::EVENT.into_raw() },
6191 2147483648,
6192 >,
6193 fidl::encoding::DefaultFuchsiaResourceDialect,
6194 >,
6195 T2: fidl::encoding::Encode<
6196 fidl::encoding::HandleType<
6197 fidl::Channel,
6198 { fidl::ObjectType::CHANNEL.into_raw() },
6199 2147483648,
6200 >,
6201 fidl::encoding::DefaultFuchsiaResourceDialect,
6202 >,
6203 >
6204 fidl::encoding::Encode<
6205 MultipleHandleSubtypes,
6206 fidl::encoding::DefaultFuchsiaResourceDialect,
6207 > for (T0, T1, T2)
6208 {
6209 #[inline]
6210 unsafe fn encode(
6211 self,
6212 encoder: &mut fidl::encoding::Encoder<
6213 '_,
6214 fidl::encoding::DefaultFuchsiaResourceDialect,
6215 >,
6216 offset: usize,
6217 depth: fidl::encoding::Depth,
6218 ) -> fidl::Result<()> {
6219 encoder.debug_check_bounds::<MultipleHandleSubtypes>(offset);
6220 self.0.encode(encoder, offset + 0, depth)?;
6224 self.1.encode(encoder, offset + 4, depth)?;
6225 self.2.encode(encoder, offset + 8, depth)?;
6226 Ok(())
6227 }
6228 }
6229
6230 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6231 for MultipleHandleSubtypes
6232 {
6233 #[inline(always)]
6234 fn new_empty() -> Self {
6235 Self {
6236 untyped: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6237 event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6238 channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6239 }
6240 }
6241
6242 #[inline]
6243 unsafe fn decode(
6244 &mut self,
6245 decoder: &mut fidl::encoding::Decoder<
6246 '_,
6247 fidl::encoding::DefaultFuchsiaResourceDialect,
6248 >,
6249 offset: usize,
6250 _depth: fidl::encoding::Depth,
6251 ) -> fidl::Result<()> {
6252 decoder.debug_check_bounds::<Self>(offset);
6253 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.untyped, decoder, offset + 0, _depth)?;
6255 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 4, _depth)?;
6256 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 8, _depth)?;
6257 Ok(())
6258 }
6259 }
6260
6261 impl fidl::encoding::ResourceTypeMarker for MultipleNonnullableHandles {
6262 type Borrowed<'a> = &'a mut Self;
6263 fn take_or_borrow<'a>(
6264 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6265 ) -> Self::Borrowed<'a> {
6266 value
6267 }
6268 }
6269
6270 unsafe impl fidl::encoding::TypeMarker for MultipleNonnullableHandles {
6271 type Owned = Self;
6272
6273 #[inline(always)]
6274 fn inline_align(_context: fidl::encoding::Context) -> usize {
6275 8
6276 }
6277
6278 #[inline(always)]
6279 fn inline_size(_context: fidl::encoding::Context) -> usize {
6280 32
6281 }
6282 }
6283
6284 unsafe impl
6285 fidl::encoding::Encode<
6286 MultipleNonnullableHandles,
6287 fidl::encoding::DefaultFuchsiaResourceDialect,
6288 > for &mut MultipleNonnullableHandles
6289 {
6290 #[inline]
6291 unsafe fn encode(
6292 self,
6293 encoder: &mut fidl::encoding::Encoder<
6294 '_,
6295 fidl::encoding::DefaultFuchsiaResourceDialect,
6296 >,
6297 offset: usize,
6298 _depth: fidl::encoding::Depth,
6299 ) -> fidl::Result<()> {
6300 encoder.debug_check_bounds::<MultipleNonnullableHandles>(offset);
6301 fidl::encoding::Encode::<
6303 MultipleNonnullableHandles,
6304 fidl::encoding::DefaultFuchsiaResourceDialect,
6305 >::encode(
6306 (
6307 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data0),
6308 <fidl::encoding::HandleType<
6309 fidl::Handle,
6310 { fidl::ObjectType::NONE.into_raw() },
6311 2147483648,
6312 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6313 &mut self.handle0
6314 ),
6315 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.data1),
6316 <fidl::encoding::HandleType<
6317 fidl::Channel,
6318 { fidl::ObjectType::CHANNEL.into_raw() },
6319 2147483648,
6320 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6321 &mut self.handle1
6322 ),
6323 <fidl::encoding::HandleType<
6324 fidl::Event,
6325 { fidl::ObjectType::EVENT.into_raw() },
6326 2147483648,
6327 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6328 &mut self.handle2
6329 ),
6330 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.data2),
6331 ),
6332 encoder,
6333 offset,
6334 _depth,
6335 )
6336 }
6337 }
6338 unsafe impl<
6339 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
6340 T1: fidl::encoding::Encode<
6341 fidl::encoding::HandleType<
6342 fidl::Handle,
6343 { fidl::ObjectType::NONE.into_raw() },
6344 2147483648,
6345 >,
6346 fidl::encoding::DefaultFuchsiaResourceDialect,
6347 >,
6348 T2: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
6349 T3: fidl::encoding::Encode<
6350 fidl::encoding::HandleType<
6351 fidl::Channel,
6352 { fidl::ObjectType::CHANNEL.into_raw() },
6353 2147483648,
6354 >,
6355 fidl::encoding::DefaultFuchsiaResourceDialect,
6356 >,
6357 T4: fidl::encoding::Encode<
6358 fidl::encoding::HandleType<
6359 fidl::Event,
6360 { fidl::ObjectType::EVENT.into_raw() },
6361 2147483648,
6362 >,
6363 fidl::encoding::DefaultFuchsiaResourceDialect,
6364 >,
6365 T5: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
6366 >
6367 fidl::encoding::Encode<
6368 MultipleNonnullableHandles,
6369 fidl::encoding::DefaultFuchsiaResourceDialect,
6370 > for (T0, T1, T2, T3, T4, T5)
6371 {
6372 #[inline]
6373 unsafe fn encode(
6374 self,
6375 encoder: &mut fidl::encoding::Encoder<
6376 '_,
6377 fidl::encoding::DefaultFuchsiaResourceDialect,
6378 >,
6379 offset: usize,
6380 depth: fidl::encoding::Depth,
6381 ) -> fidl::Result<()> {
6382 encoder.debug_check_bounds::<MultipleNonnullableHandles>(offset);
6383 self.0.encode(encoder, offset + 0, depth)?;
6387 self.1.encode(encoder, offset + 4, depth)?;
6388 self.2.encode(encoder, offset + 8, depth)?;
6389 self.3.encode(encoder, offset + 16, depth)?;
6390 self.4.encode(encoder, offset + 20, depth)?;
6391 self.5.encode(encoder, offset + 24, depth)?;
6392 Ok(())
6393 }
6394 }
6395
6396 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6397 for MultipleNonnullableHandles
6398 {
6399 #[inline(always)]
6400 fn new_empty() -> Self {
6401 Self {
6402 data0: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
6403 handle0: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6404 data1: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
6405 handle1: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6406 handle2: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6407 data2: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
6408 }
6409 }
6410
6411 #[inline]
6412 unsafe fn decode(
6413 &mut self,
6414 decoder: &mut fidl::encoding::Decoder<
6415 '_,
6416 fidl::encoding::DefaultFuchsiaResourceDialect,
6417 >,
6418 offset: usize,
6419 _depth: fidl::encoding::Depth,
6420 ) -> fidl::Result<()> {
6421 decoder.debug_check_bounds::<Self>(offset);
6422 fidl::decode!(
6424 u32,
6425 fidl::encoding::DefaultFuchsiaResourceDialect,
6426 &mut self.data0,
6427 decoder,
6428 offset + 0,
6429 _depth
6430 )?;
6431 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle0, decoder, offset + 4, _depth)?;
6432 fidl::decode!(
6433 u64,
6434 fidl::encoding::DefaultFuchsiaResourceDialect,
6435 &mut self.data1,
6436 decoder,
6437 offset + 8,
6438 _depth
6439 )?;
6440 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle1, decoder, offset + 16, _depth)?;
6441 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle2, decoder, offset + 20, _depth)?;
6442 fidl::decode!(
6443 u64,
6444 fidl::encoding::DefaultFuchsiaResourceDialect,
6445 &mut self.data2,
6446 decoder,
6447 offset + 24,
6448 _depth
6449 )?;
6450 Ok(())
6451 }
6452 }
6453
6454 impl fidl::encoding::ResourceTypeMarker for MultipleNullableHandles {
6455 type Borrowed<'a> = &'a mut Self;
6456 fn take_or_borrow<'a>(
6457 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6458 ) -> Self::Borrowed<'a> {
6459 value
6460 }
6461 }
6462
6463 unsafe impl fidl::encoding::TypeMarker for MultipleNullableHandles {
6464 type Owned = Self;
6465
6466 #[inline(always)]
6467 fn inline_align(_context: fidl::encoding::Context) -> usize {
6468 8
6469 }
6470
6471 #[inline(always)]
6472 fn inline_size(_context: fidl::encoding::Context) -> usize {
6473 32
6474 }
6475 }
6476
6477 unsafe impl
6478 fidl::encoding::Encode<
6479 MultipleNullableHandles,
6480 fidl::encoding::DefaultFuchsiaResourceDialect,
6481 > for &mut MultipleNullableHandles
6482 {
6483 #[inline]
6484 unsafe fn encode(
6485 self,
6486 encoder: &mut fidl::encoding::Encoder<
6487 '_,
6488 fidl::encoding::DefaultFuchsiaResourceDialect,
6489 >,
6490 offset: usize,
6491 _depth: fidl::encoding::Depth,
6492 ) -> fidl::Result<()> {
6493 encoder.debug_check_bounds::<MultipleNullableHandles>(offset);
6494 fidl::encoding::Encode::<
6496 MultipleNullableHandles,
6497 fidl::encoding::DefaultFuchsiaResourceDialect,
6498 >::encode(
6499 (
6500 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data0),
6501 <fidl::encoding::Optional<
6502 fidl::encoding::HandleType<
6503 fidl::Handle,
6504 { fidl::ObjectType::NONE.into_raw() },
6505 2147483648,
6506 >,
6507 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6508 &mut self.handle0
6509 ),
6510 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.data1),
6511 <fidl::encoding::Optional<
6512 fidl::encoding::HandleType<
6513 fidl::Channel,
6514 { fidl::ObjectType::CHANNEL.into_raw() },
6515 2147483648,
6516 >,
6517 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6518 &mut self.handle1
6519 ),
6520 <fidl::encoding::Optional<
6521 fidl::encoding::HandleType<
6522 fidl::Event,
6523 { fidl::ObjectType::EVENT.into_raw() },
6524 2147483648,
6525 >,
6526 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6527 &mut self.handle2
6528 ),
6529 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.data2),
6530 ),
6531 encoder,
6532 offset,
6533 _depth,
6534 )
6535 }
6536 }
6537 unsafe impl<
6538 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
6539 T1: fidl::encoding::Encode<
6540 fidl::encoding::Optional<
6541 fidl::encoding::HandleType<
6542 fidl::Handle,
6543 { fidl::ObjectType::NONE.into_raw() },
6544 2147483648,
6545 >,
6546 >,
6547 fidl::encoding::DefaultFuchsiaResourceDialect,
6548 >,
6549 T2: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
6550 T3: fidl::encoding::Encode<
6551 fidl::encoding::Optional<
6552 fidl::encoding::HandleType<
6553 fidl::Channel,
6554 { fidl::ObjectType::CHANNEL.into_raw() },
6555 2147483648,
6556 >,
6557 >,
6558 fidl::encoding::DefaultFuchsiaResourceDialect,
6559 >,
6560 T4: fidl::encoding::Encode<
6561 fidl::encoding::Optional<
6562 fidl::encoding::HandleType<
6563 fidl::Event,
6564 { fidl::ObjectType::EVENT.into_raw() },
6565 2147483648,
6566 >,
6567 >,
6568 fidl::encoding::DefaultFuchsiaResourceDialect,
6569 >,
6570 T5: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
6571 >
6572 fidl::encoding::Encode<
6573 MultipleNullableHandles,
6574 fidl::encoding::DefaultFuchsiaResourceDialect,
6575 > for (T0, T1, T2, T3, T4, T5)
6576 {
6577 #[inline]
6578 unsafe fn encode(
6579 self,
6580 encoder: &mut fidl::encoding::Encoder<
6581 '_,
6582 fidl::encoding::DefaultFuchsiaResourceDialect,
6583 >,
6584 offset: usize,
6585 depth: fidl::encoding::Depth,
6586 ) -> fidl::Result<()> {
6587 encoder.debug_check_bounds::<MultipleNullableHandles>(offset);
6588 self.0.encode(encoder, offset + 0, depth)?;
6592 self.1.encode(encoder, offset + 4, depth)?;
6593 self.2.encode(encoder, offset + 8, depth)?;
6594 self.3.encode(encoder, offset + 16, depth)?;
6595 self.4.encode(encoder, offset + 20, depth)?;
6596 self.5.encode(encoder, offset + 24, depth)?;
6597 Ok(())
6598 }
6599 }
6600
6601 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6602 for MultipleNullableHandles
6603 {
6604 #[inline(always)]
6605 fn new_empty() -> Self {
6606 Self {
6607 data0: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
6608 handle0: fidl::new_empty!(
6609 fidl::encoding::Optional<
6610 fidl::encoding::HandleType<
6611 fidl::Handle,
6612 { fidl::ObjectType::NONE.into_raw() },
6613 2147483648,
6614 >,
6615 >,
6616 fidl::encoding::DefaultFuchsiaResourceDialect
6617 ),
6618 data1: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
6619 handle1: fidl::new_empty!(
6620 fidl::encoding::Optional<
6621 fidl::encoding::HandleType<
6622 fidl::Channel,
6623 { fidl::ObjectType::CHANNEL.into_raw() },
6624 2147483648,
6625 >,
6626 >,
6627 fidl::encoding::DefaultFuchsiaResourceDialect
6628 ),
6629 handle2: fidl::new_empty!(
6630 fidl::encoding::Optional<
6631 fidl::encoding::HandleType<
6632 fidl::Event,
6633 { fidl::ObjectType::EVENT.into_raw() },
6634 2147483648,
6635 >,
6636 >,
6637 fidl::encoding::DefaultFuchsiaResourceDialect
6638 ),
6639 data2: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
6640 }
6641 }
6642
6643 #[inline]
6644 unsafe fn decode(
6645 &mut self,
6646 decoder: &mut fidl::encoding::Decoder<
6647 '_,
6648 fidl::encoding::DefaultFuchsiaResourceDialect,
6649 >,
6650 offset: usize,
6651 _depth: fidl::encoding::Depth,
6652 ) -> fidl::Result<()> {
6653 decoder.debug_check_bounds::<Self>(offset);
6654 fidl::decode!(
6656 u32,
6657 fidl::encoding::DefaultFuchsiaResourceDialect,
6658 &mut self.data0,
6659 decoder,
6660 offset + 0,
6661 _depth
6662 )?;
6663 fidl::decode!(
6664 fidl::encoding::Optional<
6665 fidl::encoding::HandleType<
6666 fidl::Handle,
6667 { fidl::ObjectType::NONE.into_raw() },
6668 2147483648,
6669 >,
6670 >,
6671 fidl::encoding::DefaultFuchsiaResourceDialect,
6672 &mut self.handle0,
6673 decoder,
6674 offset + 4,
6675 _depth
6676 )?;
6677 fidl::decode!(
6678 u64,
6679 fidl::encoding::DefaultFuchsiaResourceDialect,
6680 &mut self.data1,
6681 decoder,
6682 offset + 8,
6683 _depth
6684 )?;
6685 fidl::decode!(
6686 fidl::encoding::Optional<
6687 fidl::encoding::HandleType<
6688 fidl::Channel,
6689 { fidl::ObjectType::CHANNEL.into_raw() },
6690 2147483648,
6691 >,
6692 >,
6693 fidl::encoding::DefaultFuchsiaResourceDialect,
6694 &mut self.handle1,
6695 decoder,
6696 offset + 16,
6697 _depth
6698 )?;
6699 fidl::decode!(
6700 fidl::encoding::Optional<
6701 fidl::encoding::HandleType<
6702 fidl::Event,
6703 { fidl::ObjectType::EVENT.into_raw() },
6704 2147483648,
6705 >,
6706 >,
6707 fidl::encoding::DefaultFuchsiaResourceDialect,
6708 &mut self.handle2,
6709 decoder,
6710 offset + 20,
6711 _depth
6712 )?;
6713 fidl::decode!(
6714 u64,
6715 fidl::encoding::DefaultFuchsiaResourceDialect,
6716 &mut self.data2,
6717 decoder,
6718 offset + 24,
6719 _depth
6720 )?;
6721 Ok(())
6722 }
6723 }
6724
6725 impl fidl::encoding::ResourceTypeMarker for NonnullableHandle {
6726 type Borrowed<'a> = &'a mut Self;
6727 fn take_or_borrow<'a>(
6728 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6729 ) -> Self::Borrowed<'a> {
6730 value
6731 }
6732 }
6733
6734 unsafe impl fidl::encoding::TypeMarker for NonnullableHandle {
6735 type Owned = Self;
6736
6737 #[inline(always)]
6738 fn inline_align(_context: fidl::encoding::Context) -> usize {
6739 4
6740 }
6741
6742 #[inline(always)]
6743 fn inline_size(_context: fidl::encoding::Context) -> usize {
6744 4
6745 }
6746 }
6747
6748 unsafe impl
6749 fidl::encoding::Encode<NonnullableHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
6750 for &mut NonnullableHandle
6751 {
6752 #[inline]
6753 unsafe fn encode(
6754 self,
6755 encoder: &mut fidl::encoding::Encoder<
6756 '_,
6757 fidl::encoding::DefaultFuchsiaResourceDialect,
6758 >,
6759 offset: usize,
6760 _depth: fidl::encoding::Depth,
6761 ) -> fidl::Result<()> {
6762 encoder.debug_check_bounds::<NonnullableHandle>(offset);
6763 fidl::encoding::Encode::<NonnullableHandle, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6765 (
6766 <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.h),
6767 ),
6768 encoder, offset, _depth
6769 )
6770 }
6771 }
6772 unsafe impl<
6773 T0: fidl::encoding::Encode<
6774 fidl::encoding::HandleType<
6775 fidl::Handle,
6776 { fidl::ObjectType::NONE.into_raw() },
6777 2147483648,
6778 >,
6779 fidl::encoding::DefaultFuchsiaResourceDialect,
6780 >,
6781 >
6782 fidl::encoding::Encode<NonnullableHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
6783 for (T0,)
6784 {
6785 #[inline]
6786 unsafe fn encode(
6787 self,
6788 encoder: &mut fidl::encoding::Encoder<
6789 '_,
6790 fidl::encoding::DefaultFuchsiaResourceDialect,
6791 >,
6792 offset: usize,
6793 depth: fidl::encoding::Depth,
6794 ) -> fidl::Result<()> {
6795 encoder.debug_check_bounds::<NonnullableHandle>(offset);
6796 self.0.encode(encoder, offset + 0, depth)?;
6800 Ok(())
6801 }
6802 }
6803
6804 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6805 for NonnullableHandle
6806 {
6807 #[inline(always)]
6808 fn new_empty() -> Self {
6809 Self {
6810 h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6811 }
6812 }
6813
6814 #[inline]
6815 unsafe fn decode(
6816 &mut self,
6817 decoder: &mut fidl::encoding::Decoder<
6818 '_,
6819 fidl::encoding::DefaultFuchsiaResourceDialect,
6820 >,
6821 offset: usize,
6822 _depth: fidl::encoding::Depth,
6823 ) -> fidl::Result<()> {
6824 decoder.debug_check_bounds::<Self>(offset);
6825 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
6827 Ok(())
6828 }
6829 }
6830
6831 impl fidl::encoding::ResourceTypeMarker for NonnullableHandleArray {
6832 type Borrowed<'a> = &'a mut Self;
6833 fn take_or_borrow<'a>(
6834 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6835 ) -> Self::Borrowed<'a> {
6836 value
6837 }
6838 }
6839
6840 unsafe impl fidl::encoding::TypeMarker for NonnullableHandleArray {
6841 type Owned = Self;
6842
6843 #[inline(always)]
6844 fn inline_align(_context: fidl::encoding::Context) -> usize {
6845 4
6846 }
6847
6848 #[inline(always)]
6849 fn inline_size(_context: fidl::encoding::Context) -> usize {
6850 16
6851 }
6852 }
6853
6854 unsafe impl
6855 fidl::encoding::Encode<
6856 NonnullableHandleArray,
6857 fidl::encoding::DefaultFuchsiaResourceDialect,
6858 > for &mut NonnullableHandleArray
6859 {
6860 #[inline]
6861 unsafe fn encode(
6862 self,
6863 encoder: &mut fidl::encoding::Encoder<
6864 '_,
6865 fidl::encoding::DefaultFuchsiaResourceDialect,
6866 >,
6867 offset: usize,
6868 _depth: fidl::encoding::Depth,
6869 ) -> fidl::Result<()> {
6870 encoder.debug_check_bounds::<NonnullableHandleArray>(offset);
6871 fidl::encoding::Encode::<
6873 NonnullableHandleArray,
6874 fidl::encoding::DefaultFuchsiaResourceDialect,
6875 >::encode(
6876 (<fidl::encoding::Array<
6877 fidl::encoding::HandleType<
6878 fidl::Handle,
6879 { fidl::ObjectType::NONE.into_raw() },
6880 2147483648,
6881 >,
6882 4,
6883 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6884 &mut self.handles
6885 ),),
6886 encoder,
6887 offset,
6888 _depth,
6889 )
6890 }
6891 }
6892 unsafe impl<
6893 T0: fidl::encoding::Encode<
6894 fidl::encoding::Array<
6895 fidl::encoding::HandleType<
6896 fidl::Handle,
6897 { fidl::ObjectType::NONE.into_raw() },
6898 2147483648,
6899 >,
6900 4,
6901 >,
6902 fidl::encoding::DefaultFuchsiaResourceDialect,
6903 >,
6904 >
6905 fidl::encoding::Encode<
6906 NonnullableHandleArray,
6907 fidl::encoding::DefaultFuchsiaResourceDialect,
6908 > for (T0,)
6909 {
6910 #[inline]
6911 unsafe fn encode(
6912 self,
6913 encoder: &mut fidl::encoding::Encoder<
6914 '_,
6915 fidl::encoding::DefaultFuchsiaResourceDialect,
6916 >,
6917 offset: usize,
6918 depth: fidl::encoding::Depth,
6919 ) -> fidl::Result<()> {
6920 encoder.debug_check_bounds::<NonnullableHandleArray>(offset);
6921 self.0.encode(encoder, offset + 0, depth)?;
6925 Ok(())
6926 }
6927 }
6928
6929 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6930 for NonnullableHandleArray
6931 {
6932 #[inline(always)]
6933 fn new_empty() -> Self {
6934 Self {
6935 handles: fidl::new_empty!(
6936 fidl::encoding::Array<
6937 fidl::encoding::HandleType<
6938 fidl::Handle,
6939 { fidl::ObjectType::NONE.into_raw() },
6940 2147483648,
6941 >,
6942 4,
6943 >,
6944 fidl::encoding::DefaultFuchsiaResourceDialect
6945 ),
6946 }
6947 }
6948
6949 #[inline]
6950 unsafe fn decode(
6951 &mut self,
6952 decoder: &mut fidl::encoding::Decoder<
6953 '_,
6954 fidl::encoding::DefaultFuchsiaResourceDialect,
6955 >,
6956 offset: usize,
6957 _depth: fidl::encoding::Depth,
6958 ) -> fidl::Result<()> {
6959 decoder.debug_check_bounds::<Self>(offset);
6960 fidl::decode!(
6962 fidl::encoding::Array<
6963 fidl::encoding::HandleType<
6964 fidl::Handle,
6965 { fidl::ObjectType::NONE.into_raw() },
6966 2147483648,
6967 >,
6968 4,
6969 >,
6970 fidl::encoding::DefaultFuchsiaResourceDialect,
6971 &mut self.handles,
6972 decoder,
6973 offset + 0,
6974 _depth
6975 )?;
6976 Ok(())
6977 }
6978 }
6979
6980 impl fidl::encoding::ResourceTypeMarker for NullableHandle {
6981 type Borrowed<'a> = &'a mut Self;
6982 fn take_or_borrow<'a>(
6983 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6984 ) -> Self::Borrowed<'a> {
6985 value
6986 }
6987 }
6988
6989 unsafe impl fidl::encoding::TypeMarker for NullableHandle {
6990 type Owned = Self;
6991
6992 #[inline(always)]
6993 fn inline_align(_context: fidl::encoding::Context) -> usize {
6994 4
6995 }
6996
6997 #[inline(always)]
6998 fn inline_size(_context: fidl::encoding::Context) -> usize {
6999 4
7000 }
7001 }
7002
7003 unsafe impl
7004 fidl::encoding::Encode<NullableHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7005 for &mut NullableHandle
7006 {
7007 #[inline]
7008 unsafe fn encode(
7009 self,
7010 encoder: &mut fidl::encoding::Encoder<
7011 '_,
7012 fidl::encoding::DefaultFuchsiaResourceDialect,
7013 >,
7014 offset: usize,
7015 _depth: fidl::encoding::Depth,
7016 ) -> fidl::Result<()> {
7017 encoder.debug_check_bounds::<NullableHandle>(offset);
7018 fidl::encoding::Encode::<NullableHandle, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7020 (
7021 <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.h),
7022 ),
7023 encoder, offset, _depth
7024 )
7025 }
7026 }
7027 unsafe impl<
7028 T0: fidl::encoding::Encode<
7029 fidl::encoding::Optional<
7030 fidl::encoding::HandleType<
7031 fidl::Handle,
7032 { fidl::ObjectType::NONE.into_raw() },
7033 2147483648,
7034 >,
7035 >,
7036 fidl::encoding::DefaultFuchsiaResourceDialect,
7037 >,
7038 > fidl::encoding::Encode<NullableHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7039 for (T0,)
7040 {
7041 #[inline]
7042 unsafe fn encode(
7043 self,
7044 encoder: &mut fidl::encoding::Encoder<
7045 '_,
7046 fidl::encoding::DefaultFuchsiaResourceDialect,
7047 >,
7048 offset: usize,
7049 depth: fidl::encoding::Depth,
7050 ) -> fidl::Result<()> {
7051 encoder.debug_check_bounds::<NullableHandle>(offset);
7052 self.0.encode(encoder, offset + 0, depth)?;
7056 Ok(())
7057 }
7058 }
7059
7060 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7061 for NullableHandle
7062 {
7063 #[inline(always)]
7064 fn new_empty() -> Self {
7065 Self {
7066 h: fidl::new_empty!(
7067 fidl::encoding::Optional<
7068 fidl::encoding::HandleType<
7069 fidl::Handle,
7070 { fidl::ObjectType::NONE.into_raw() },
7071 2147483648,
7072 >,
7073 >,
7074 fidl::encoding::DefaultFuchsiaResourceDialect
7075 ),
7076 }
7077 }
7078
7079 #[inline]
7080 unsafe fn decode(
7081 &mut self,
7082 decoder: &mut fidl::encoding::Decoder<
7083 '_,
7084 fidl::encoding::DefaultFuchsiaResourceDialect,
7085 >,
7086 offset: usize,
7087 _depth: fidl::encoding::Depth,
7088 ) -> fidl::Result<()> {
7089 decoder.debug_check_bounds::<Self>(offset);
7090 fidl::decode!(
7092 fidl::encoding::Optional<
7093 fidl::encoding::HandleType<
7094 fidl::Handle,
7095 { fidl::ObjectType::NONE.into_raw() },
7096 2147483648,
7097 >,
7098 >,
7099 fidl::encoding::DefaultFuchsiaResourceDialect,
7100 &mut self.h,
7101 decoder,
7102 offset + 0,
7103 _depth
7104 )?;
7105 Ok(())
7106 }
7107 }
7108
7109 impl fidl::encoding::ResourceTypeMarker for OutOfLineArrayOfNonnullableHandles {
7110 type Borrowed<'a> = &'a mut Self;
7111 fn take_or_borrow<'a>(
7112 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7113 ) -> Self::Borrowed<'a> {
7114 value
7115 }
7116 }
7117
7118 unsafe impl fidl::encoding::TypeMarker for OutOfLineArrayOfNonnullableHandles {
7119 type Owned = Self;
7120
7121 #[inline(always)]
7122 fn inline_align(_context: fidl::encoding::Context) -> usize {
7123 8
7124 }
7125
7126 #[inline(always)]
7127 fn inline_size(_context: fidl::encoding::Context) -> usize {
7128 8
7129 }
7130 }
7131
7132 unsafe impl
7133 fidl::encoding::Encode<
7134 OutOfLineArrayOfNonnullableHandles,
7135 fidl::encoding::DefaultFuchsiaResourceDialect,
7136 > for &mut OutOfLineArrayOfNonnullableHandles
7137 {
7138 #[inline]
7139 unsafe fn encode(
7140 self,
7141 encoder: &mut fidl::encoding::Encoder<
7142 '_,
7143 fidl::encoding::DefaultFuchsiaResourceDialect,
7144 >,
7145 offset: usize,
7146 _depth: fidl::encoding::Depth,
7147 ) -> fidl::Result<()> {
7148 encoder.debug_check_bounds::<OutOfLineArrayOfNonnullableHandles>(offset);
7149 fidl::encoding::Encode::<OutOfLineArrayOfNonnullableHandles, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7151 (
7152 <fidl::encoding::Boxed<NonnullableHandleArray> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.handles),
7153 ),
7154 encoder, offset, _depth
7155 )
7156 }
7157 }
7158 unsafe impl<
7159 T0: fidl::encoding::Encode<
7160 fidl::encoding::Boxed<NonnullableHandleArray>,
7161 fidl::encoding::DefaultFuchsiaResourceDialect,
7162 >,
7163 >
7164 fidl::encoding::Encode<
7165 OutOfLineArrayOfNonnullableHandles,
7166 fidl::encoding::DefaultFuchsiaResourceDialect,
7167 > for (T0,)
7168 {
7169 #[inline]
7170 unsafe fn encode(
7171 self,
7172 encoder: &mut fidl::encoding::Encoder<
7173 '_,
7174 fidl::encoding::DefaultFuchsiaResourceDialect,
7175 >,
7176 offset: usize,
7177 depth: fidl::encoding::Depth,
7178 ) -> fidl::Result<()> {
7179 encoder.debug_check_bounds::<OutOfLineArrayOfNonnullableHandles>(offset);
7180 self.0.encode(encoder, offset + 0, depth)?;
7184 Ok(())
7185 }
7186 }
7187
7188 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7189 for OutOfLineArrayOfNonnullableHandles
7190 {
7191 #[inline(always)]
7192 fn new_empty() -> Self {
7193 Self {
7194 handles: fidl::new_empty!(
7195 fidl::encoding::Boxed<NonnullableHandleArray>,
7196 fidl::encoding::DefaultFuchsiaResourceDialect
7197 ),
7198 }
7199 }
7200
7201 #[inline]
7202 unsafe fn decode(
7203 &mut self,
7204 decoder: &mut fidl::encoding::Decoder<
7205 '_,
7206 fidl::encoding::DefaultFuchsiaResourceDialect,
7207 >,
7208 offset: usize,
7209 _depth: fidl::encoding::Depth,
7210 ) -> fidl::Result<()> {
7211 decoder.debug_check_bounds::<Self>(offset);
7212 fidl::decode!(
7214 fidl::encoding::Boxed<NonnullableHandleArray>,
7215 fidl::encoding::DefaultFuchsiaResourceDialect,
7216 &mut self.handles,
7217 decoder,
7218 offset + 0,
7219 _depth
7220 )?;
7221 Ok(())
7222 }
7223 }
7224
7225 impl fidl::encoding::ResourceTypeMarker for Sandwich6 {
7226 type Borrowed<'a> = &'a mut Self;
7227 fn take_or_borrow<'a>(
7228 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7229 ) -> Self::Borrowed<'a> {
7230 value
7231 }
7232 }
7233
7234 unsafe impl fidl::encoding::TypeMarker for Sandwich6 {
7235 type Owned = Self;
7236
7237 #[inline(always)]
7238 fn inline_align(_context: fidl::encoding::Context) -> usize {
7239 8
7240 }
7241
7242 #[inline(always)]
7243 fn inline_size(_context: fidl::encoding::Context) -> usize {
7244 32
7245 }
7246 }
7247
7248 unsafe impl fidl::encoding::Encode<Sandwich6, fidl::encoding::DefaultFuchsiaResourceDialect>
7249 for &mut Sandwich6
7250 {
7251 #[inline]
7252 unsafe fn encode(
7253 self,
7254 encoder: &mut fidl::encoding::Encoder<
7255 '_,
7256 fidl::encoding::DefaultFuchsiaResourceDialect,
7257 >,
7258 offset: usize,
7259 _depth: fidl::encoding::Depth,
7260 ) -> fidl::Result<()> {
7261 encoder.debug_check_bounds::<Sandwich6>(offset);
7262 fidl::encoding::Encode::<Sandwich6, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7264 (
7265 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.before),
7266 <UnionWithVector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.the_union),
7267 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.after),
7268 ),
7269 encoder, offset, _depth
7270 )
7271 }
7272 }
7273 unsafe impl<
7274 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
7275 T1: fidl::encoding::Encode<UnionWithVector, fidl::encoding::DefaultFuchsiaResourceDialect>,
7276 T2: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
7277 > fidl::encoding::Encode<Sandwich6, fidl::encoding::DefaultFuchsiaResourceDialect>
7278 for (T0, T1, T2)
7279 {
7280 #[inline]
7281 unsafe fn encode(
7282 self,
7283 encoder: &mut fidl::encoding::Encoder<
7284 '_,
7285 fidl::encoding::DefaultFuchsiaResourceDialect,
7286 >,
7287 offset: usize,
7288 depth: fidl::encoding::Depth,
7289 ) -> fidl::Result<()> {
7290 encoder.debug_check_bounds::<Sandwich6>(offset);
7291 unsafe {
7294 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7295 (ptr as *mut u64).write_unaligned(0);
7296 }
7297 unsafe {
7298 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
7299 (ptr as *mut u64).write_unaligned(0);
7300 }
7301 self.0.encode(encoder, offset + 0, depth)?;
7303 self.1.encode(encoder, offset + 8, depth)?;
7304 self.2.encode(encoder, offset + 24, depth)?;
7305 Ok(())
7306 }
7307 }
7308
7309 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Sandwich6 {
7310 #[inline(always)]
7311 fn new_empty() -> Self {
7312 Self {
7313 before: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
7314 the_union: fidl::new_empty!(
7315 UnionWithVector,
7316 fidl::encoding::DefaultFuchsiaResourceDialect
7317 ),
7318 after: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
7319 }
7320 }
7321
7322 #[inline]
7323 unsafe fn decode(
7324 &mut self,
7325 decoder: &mut fidl::encoding::Decoder<
7326 '_,
7327 fidl::encoding::DefaultFuchsiaResourceDialect,
7328 >,
7329 offset: usize,
7330 _depth: fidl::encoding::Depth,
7331 ) -> fidl::Result<()> {
7332 decoder.debug_check_bounds::<Self>(offset);
7333 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7335 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7336 let mask = 0xffffffff00000000u64;
7337 let maskedval = padval & mask;
7338 if maskedval != 0 {
7339 return Err(fidl::Error::NonZeroPadding {
7340 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7341 });
7342 }
7343 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
7344 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7345 let mask = 0xffffffff00000000u64;
7346 let maskedval = padval & mask;
7347 if maskedval != 0 {
7348 return Err(fidl::Error::NonZeroPadding {
7349 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
7350 });
7351 }
7352 fidl::decode!(
7353 u32,
7354 fidl::encoding::DefaultFuchsiaResourceDialect,
7355 &mut self.before,
7356 decoder,
7357 offset + 0,
7358 _depth
7359 )?;
7360 fidl::decode!(
7361 UnionWithVector,
7362 fidl::encoding::DefaultFuchsiaResourceDialect,
7363 &mut self.the_union,
7364 decoder,
7365 offset + 8,
7366 _depth
7367 )?;
7368 fidl::decode!(
7369 u32,
7370 fidl::encoding::DefaultFuchsiaResourceDialect,
7371 &mut self.after,
7372 decoder,
7373 offset + 24,
7374 _depth
7375 )?;
7376 Ok(())
7377 }
7378 }
7379
7380 impl fidl::encoding::ResourceTypeMarker for ShortStringThenHandle {
7381 type Borrowed<'a> = &'a mut Self;
7382 fn take_or_borrow<'a>(
7383 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7384 ) -> Self::Borrowed<'a> {
7385 value
7386 }
7387 }
7388
7389 unsafe impl fidl::encoding::TypeMarker for ShortStringThenHandle {
7390 type Owned = Self;
7391
7392 #[inline(always)]
7393 fn inline_align(_context: fidl::encoding::Context) -> usize {
7394 8
7395 }
7396
7397 #[inline(always)]
7398 fn inline_size(_context: fidl::encoding::Context) -> usize {
7399 24
7400 }
7401 }
7402
7403 unsafe impl
7404 fidl::encoding::Encode<ShortStringThenHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7405 for &mut ShortStringThenHandle
7406 {
7407 #[inline]
7408 unsafe fn encode(
7409 self,
7410 encoder: &mut fidl::encoding::Encoder<
7411 '_,
7412 fidl::encoding::DefaultFuchsiaResourceDialect,
7413 >,
7414 offset: usize,
7415 _depth: fidl::encoding::Depth,
7416 ) -> fidl::Result<()> {
7417 encoder.debug_check_bounds::<ShortStringThenHandle>(offset);
7418 fidl::encoding::Encode::<
7420 ShortStringThenHandle,
7421 fidl::encoding::DefaultFuchsiaResourceDialect,
7422 >::encode(
7423 (
7424 <fidl::encoding::BoundedString<1> as fidl::encoding::ValueTypeMarker>::borrow(
7425 &self.s,
7426 ),
7427 <fidl::encoding::HandleType<
7428 fidl::Handle,
7429 { fidl::ObjectType::NONE.into_raw() },
7430 2147483648,
7431 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7432 &mut self.h
7433 ),
7434 ),
7435 encoder,
7436 offset,
7437 _depth,
7438 )
7439 }
7440 }
7441 unsafe impl<
7442 T0: fidl::encoding::Encode<
7443 fidl::encoding::BoundedString<1>,
7444 fidl::encoding::DefaultFuchsiaResourceDialect,
7445 >,
7446 T1: fidl::encoding::Encode<
7447 fidl::encoding::HandleType<
7448 fidl::Handle,
7449 { fidl::ObjectType::NONE.into_raw() },
7450 2147483648,
7451 >,
7452 fidl::encoding::DefaultFuchsiaResourceDialect,
7453 >,
7454 >
7455 fidl::encoding::Encode<ShortStringThenHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7456 for (T0, T1)
7457 {
7458 #[inline]
7459 unsafe fn encode(
7460 self,
7461 encoder: &mut fidl::encoding::Encoder<
7462 '_,
7463 fidl::encoding::DefaultFuchsiaResourceDialect,
7464 >,
7465 offset: usize,
7466 depth: fidl::encoding::Depth,
7467 ) -> fidl::Result<()> {
7468 encoder.debug_check_bounds::<ShortStringThenHandle>(offset);
7469 unsafe {
7472 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7473 (ptr as *mut u64).write_unaligned(0);
7474 }
7475 self.0.encode(encoder, offset + 0, depth)?;
7477 self.1.encode(encoder, offset + 16, depth)?;
7478 Ok(())
7479 }
7480 }
7481
7482 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7483 for ShortStringThenHandle
7484 {
7485 #[inline(always)]
7486 fn new_empty() -> Self {
7487 Self {
7488 s: fidl::new_empty!(
7489 fidl::encoding::BoundedString<1>,
7490 fidl::encoding::DefaultFuchsiaResourceDialect
7491 ),
7492 h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7493 }
7494 }
7495
7496 #[inline]
7497 unsafe fn decode(
7498 &mut self,
7499 decoder: &mut fidl::encoding::Decoder<
7500 '_,
7501 fidl::encoding::DefaultFuchsiaResourceDialect,
7502 >,
7503 offset: usize,
7504 _depth: fidl::encoding::Depth,
7505 ) -> fidl::Result<()> {
7506 decoder.debug_check_bounds::<Self>(offset);
7507 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7509 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7510 let mask = 0xffffffff00000000u64;
7511 let maskedval = padval & mask;
7512 if maskedval != 0 {
7513 return Err(fidl::Error::NonZeroPadding {
7514 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7515 });
7516 }
7517 fidl::decode!(
7518 fidl::encoding::BoundedString<1>,
7519 fidl::encoding::DefaultFuchsiaResourceDialect,
7520 &mut self.s,
7521 decoder,
7522 offset + 0,
7523 _depth
7524 )?;
7525 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 16, _depth)?;
7526 Ok(())
7527 }
7528 }
7529
7530 impl fidl::encoding::ResourceTypeMarker for SingleHandle {
7531 type Borrowed<'a> = &'a mut Self;
7532 fn take_or_borrow<'a>(
7533 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7534 ) -> Self::Borrowed<'a> {
7535 value
7536 }
7537 }
7538
7539 unsafe impl fidl::encoding::TypeMarker for SingleHandle {
7540 type Owned = Self;
7541
7542 #[inline(always)]
7543 fn inline_align(_context: fidl::encoding::Context) -> usize {
7544 4
7545 }
7546
7547 #[inline(always)]
7548 fn inline_size(_context: fidl::encoding::Context) -> usize {
7549 4
7550 }
7551 }
7552
7553 unsafe impl fidl::encoding::Encode<SingleHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7554 for &mut SingleHandle
7555 {
7556 #[inline]
7557 unsafe fn encode(
7558 self,
7559 encoder: &mut fidl::encoding::Encoder<
7560 '_,
7561 fidl::encoding::DefaultFuchsiaResourceDialect,
7562 >,
7563 offset: usize,
7564 _depth: fidl::encoding::Depth,
7565 ) -> fidl::Result<()> {
7566 encoder.debug_check_bounds::<SingleHandle>(offset);
7567 fidl::encoding::Encode::<SingleHandle, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7569 (
7570 <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.h),
7571 ),
7572 encoder, offset, _depth
7573 )
7574 }
7575 }
7576 unsafe impl<
7577 T0: fidl::encoding::Encode<
7578 fidl::encoding::HandleType<
7579 fidl::Handle,
7580 { fidl::ObjectType::NONE.into_raw() },
7581 2147483648,
7582 >,
7583 fidl::encoding::DefaultFuchsiaResourceDialect,
7584 >,
7585 > fidl::encoding::Encode<SingleHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7586 for (T0,)
7587 {
7588 #[inline]
7589 unsafe fn encode(
7590 self,
7591 encoder: &mut fidl::encoding::Encoder<
7592 '_,
7593 fidl::encoding::DefaultFuchsiaResourceDialect,
7594 >,
7595 offset: usize,
7596 depth: fidl::encoding::Depth,
7597 ) -> fidl::Result<()> {
7598 encoder.debug_check_bounds::<SingleHandle>(offset);
7599 self.0.encode(encoder, offset + 0, depth)?;
7603 Ok(())
7604 }
7605 }
7606
7607 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for SingleHandle {
7608 #[inline(always)]
7609 fn new_empty() -> Self {
7610 Self {
7611 h: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7612 }
7613 }
7614
7615 #[inline]
7616 unsafe fn decode(
7617 &mut self,
7618 decoder: &mut fidl::encoding::Decoder<
7619 '_,
7620 fidl::encoding::DefaultFuchsiaResourceDialect,
7621 >,
7622 offset: usize,
7623 _depth: fidl::encoding::Depth,
7624 ) -> fidl::Result<()> {
7625 decoder.debug_check_bounds::<Self>(offset);
7626 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.h, decoder, offset + 0, _depth)?;
7628 Ok(())
7629 }
7630 }
7631
7632 impl fidl::encoding::ResourceTypeMarker for SingleOptionalHandle {
7633 type Borrowed<'a> = &'a mut Self;
7634 fn take_or_borrow<'a>(
7635 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7636 ) -> Self::Borrowed<'a> {
7637 value
7638 }
7639 }
7640
7641 unsafe impl fidl::encoding::TypeMarker for SingleOptionalHandle {
7642 type Owned = Self;
7643
7644 #[inline(always)]
7645 fn inline_align(_context: fidl::encoding::Context) -> usize {
7646 4
7647 }
7648
7649 #[inline(always)]
7650 fn inline_size(_context: fidl::encoding::Context) -> usize {
7651 4
7652 }
7653 }
7654
7655 unsafe impl
7656 fidl::encoding::Encode<SingleOptionalHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7657 for &mut SingleOptionalHandle
7658 {
7659 #[inline]
7660 unsafe fn encode(
7661 self,
7662 encoder: &mut fidl::encoding::Encoder<
7663 '_,
7664 fidl::encoding::DefaultFuchsiaResourceDialect,
7665 >,
7666 offset: usize,
7667 _depth: fidl::encoding::Depth,
7668 ) -> fidl::Result<()> {
7669 encoder.debug_check_bounds::<SingleOptionalHandle>(offset);
7670 fidl::encoding::Encode::<
7672 SingleOptionalHandle,
7673 fidl::encoding::DefaultFuchsiaResourceDialect,
7674 >::encode(
7675 (<fidl::encoding::Optional<
7676 fidl::encoding::HandleType<
7677 fidl::Handle,
7678 { fidl::ObjectType::NONE.into_raw() },
7679 2147483648,
7680 >,
7681 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7682 &mut self.h
7683 ),),
7684 encoder,
7685 offset,
7686 _depth,
7687 )
7688 }
7689 }
7690 unsafe impl<
7691 T0: fidl::encoding::Encode<
7692 fidl::encoding::Optional<
7693 fidl::encoding::HandleType<
7694 fidl::Handle,
7695 { fidl::ObjectType::NONE.into_raw() },
7696 2147483648,
7697 >,
7698 >,
7699 fidl::encoding::DefaultFuchsiaResourceDialect,
7700 >,
7701 >
7702 fidl::encoding::Encode<SingleOptionalHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
7703 for (T0,)
7704 {
7705 #[inline]
7706 unsafe fn encode(
7707 self,
7708 encoder: &mut fidl::encoding::Encoder<
7709 '_,
7710 fidl::encoding::DefaultFuchsiaResourceDialect,
7711 >,
7712 offset: usize,
7713 depth: fidl::encoding::Depth,
7714 ) -> fidl::Result<()> {
7715 encoder.debug_check_bounds::<SingleOptionalHandle>(offset);
7716 self.0.encode(encoder, offset + 0, depth)?;
7720 Ok(())
7721 }
7722 }
7723
7724 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7725 for SingleOptionalHandle
7726 {
7727 #[inline(always)]
7728 fn new_empty() -> Self {
7729 Self {
7730 h: fidl::new_empty!(
7731 fidl::encoding::Optional<
7732 fidl::encoding::HandleType<
7733 fidl::Handle,
7734 { fidl::ObjectType::NONE.into_raw() },
7735 2147483648,
7736 >,
7737 >,
7738 fidl::encoding::DefaultFuchsiaResourceDialect
7739 ),
7740 }
7741 }
7742
7743 #[inline]
7744 unsafe fn decode(
7745 &mut self,
7746 decoder: &mut fidl::encoding::Decoder<
7747 '_,
7748 fidl::encoding::DefaultFuchsiaResourceDialect,
7749 >,
7750 offset: usize,
7751 _depth: fidl::encoding::Depth,
7752 ) -> fidl::Result<()> {
7753 decoder.debug_check_bounds::<Self>(offset);
7754 fidl::decode!(
7756 fidl::encoding::Optional<
7757 fidl::encoding::HandleType<
7758 fidl::Handle,
7759 { fidl::ObjectType::NONE.into_raw() },
7760 2147483648,
7761 >,
7762 >,
7763 fidl::encoding::DefaultFuchsiaResourceDialect,
7764 &mut self.h,
7765 decoder,
7766 offset + 0,
7767 _depth
7768 )?;
7769 Ok(())
7770 }
7771 }
7772
7773 impl fidl::encoding::ResourceTypeMarker for StructOfEndpoints {
7774 type Borrowed<'a> = &'a mut Self;
7775 fn take_or_borrow<'a>(
7776 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7777 ) -> Self::Borrowed<'a> {
7778 value
7779 }
7780 }
7781
7782 unsafe impl fidl::encoding::TypeMarker for StructOfEndpoints {
7783 type Owned = Self;
7784
7785 #[inline(always)]
7786 fn inline_align(_context: fidl::encoding::Context) -> usize {
7787 4
7788 }
7789
7790 #[inline(always)]
7791 fn inline_size(_context: fidl::encoding::Context) -> usize {
7792 16
7793 }
7794 }
7795
7796 unsafe impl
7797 fidl::encoding::Encode<StructOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
7798 for &mut StructOfEndpoints
7799 {
7800 #[inline]
7801 unsafe fn encode(
7802 self,
7803 encoder: &mut fidl::encoding::Encoder<
7804 '_,
7805 fidl::encoding::DefaultFuchsiaResourceDialect,
7806 >,
7807 offset: usize,
7808 _depth: fidl::encoding::Depth,
7809 ) -> fidl::Result<()> {
7810 encoder.debug_check_bounds::<StructOfEndpoints>(offset);
7811 fidl::encoding::Encode::<StructOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7813 (
7814 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client_end),
7815 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.optional_client_end),
7816 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
7817 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.optional_server_end),
7818 ),
7819 encoder, offset, _depth
7820 )
7821 }
7822 }
7823 unsafe impl<
7824 T0: fidl::encoding::Encode<
7825 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
7826 fidl::encoding::DefaultFuchsiaResourceDialect,
7827 >,
7828 T1: fidl::encoding::Encode<
7829 fidl::encoding::Optional<
7830 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
7831 >,
7832 fidl::encoding::DefaultFuchsiaResourceDialect,
7833 >,
7834 T2: fidl::encoding::Encode<
7835 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
7836 fidl::encoding::DefaultFuchsiaResourceDialect,
7837 >,
7838 T3: fidl::encoding::Encode<
7839 fidl::encoding::Optional<
7840 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
7841 >,
7842 fidl::encoding::DefaultFuchsiaResourceDialect,
7843 >,
7844 >
7845 fidl::encoding::Encode<StructOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
7846 for (T0, T1, T2, T3)
7847 {
7848 #[inline]
7849 unsafe fn encode(
7850 self,
7851 encoder: &mut fidl::encoding::Encoder<
7852 '_,
7853 fidl::encoding::DefaultFuchsiaResourceDialect,
7854 >,
7855 offset: usize,
7856 depth: fidl::encoding::Depth,
7857 ) -> fidl::Result<()> {
7858 encoder.debug_check_bounds::<StructOfEndpoints>(offset);
7859 self.0.encode(encoder, offset + 0, depth)?;
7863 self.1.encode(encoder, offset + 4, depth)?;
7864 self.2.encode(encoder, offset + 8, depth)?;
7865 self.3.encode(encoder, offset + 12, depth)?;
7866 Ok(())
7867 }
7868 }
7869
7870 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7871 for StructOfEndpoints
7872 {
7873 #[inline(always)]
7874 fn new_empty() -> Self {
7875 Self {
7876 client_end: fidl::new_empty!(
7877 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
7878 fidl::encoding::DefaultFuchsiaResourceDialect
7879 ),
7880 optional_client_end: fidl::new_empty!(
7881 fidl::encoding::Optional<
7882 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
7883 >,
7884 fidl::encoding::DefaultFuchsiaResourceDialect
7885 ),
7886 server_end: fidl::new_empty!(
7887 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
7888 fidl::encoding::DefaultFuchsiaResourceDialect
7889 ),
7890 optional_server_end: fidl::new_empty!(
7891 fidl::encoding::Optional<
7892 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
7893 >,
7894 fidl::encoding::DefaultFuchsiaResourceDialect
7895 ),
7896 }
7897 }
7898
7899 #[inline]
7900 unsafe fn decode(
7901 &mut self,
7902 decoder: &mut fidl::encoding::Decoder<
7903 '_,
7904 fidl::encoding::DefaultFuchsiaResourceDialect,
7905 >,
7906 offset: usize,
7907 _depth: fidl::encoding::Depth,
7908 ) -> fidl::Result<()> {
7909 decoder.debug_check_bounds::<Self>(offset);
7910 fidl::decode!(
7912 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
7913 fidl::encoding::DefaultFuchsiaResourceDialect,
7914 &mut self.client_end,
7915 decoder,
7916 offset + 0,
7917 _depth
7918 )?;
7919 fidl::decode!(
7920 fidl::encoding::Optional<
7921 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
7922 >,
7923 fidl::encoding::DefaultFuchsiaResourceDialect,
7924 &mut self.optional_client_end,
7925 decoder,
7926 offset + 4,
7927 _depth
7928 )?;
7929 fidl::decode!(
7930 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
7931 fidl::encoding::DefaultFuchsiaResourceDialect,
7932 &mut self.server_end,
7933 decoder,
7934 offset + 8,
7935 _depth
7936 )?;
7937 fidl::decode!(
7938 fidl::encoding::Optional<
7939 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
7940 >,
7941 fidl::encoding::DefaultFuchsiaResourceDialect,
7942 &mut self.optional_server_end,
7943 decoder,
7944 offset + 12,
7945 _depth
7946 )?;
7947 Ok(())
7948 }
7949 }
7950
7951 impl fidl::encoding::ResourceTypeMarker for StructOfOptionalUnionOfHandle {
7952 type Borrowed<'a> = &'a mut Self;
7953 fn take_or_borrow<'a>(
7954 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7955 ) -> Self::Borrowed<'a> {
7956 value
7957 }
7958 }
7959
7960 unsafe impl fidl::encoding::TypeMarker for StructOfOptionalUnionOfHandle {
7961 type Owned = Self;
7962
7963 #[inline(always)]
7964 fn inline_align(_context: fidl::encoding::Context) -> usize {
7965 8
7966 }
7967
7968 #[inline(always)]
7969 fn inline_size(_context: fidl::encoding::Context) -> usize {
7970 16
7971 }
7972 }
7973
7974 unsafe impl
7975 fidl::encoding::Encode<
7976 StructOfOptionalUnionOfHandle,
7977 fidl::encoding::DefaultFuchsiaResourceDialect,
7978 > for &mut StructOfOptionalUnionOfHandle
7979 {
7980 #[inline]
7981 unsafe fn encode(
7982 self,
7983 encoder: &mut fidl::encoding::Encoder<
7984 '_,
7985 fidl::encoding::DefaultFuchsiaResourceDialect,
7986 >,
7987 offset: usize,
7988 _depth: fidl::encoding::Depth,
7989 ) -> fidl::Result<()> {
7990 encoder.debug_check_bounds::<StructOfOptionalUnionOfHandle>(offset);
7991 fidl::encoding::Encode::<StructOfOptionalUnionOfHandle, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7993 (
7994 <fidl::encoding::OptionalUnion<UnionOfHandle> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.u),
7995 ),
7996 encoder, offset, _depth
7997 )
7998 }
7999 }
8000 unsafe impl<
8001 T0: fidl::encoding::Encode<
8002 fidl::encoding::OptionalUnion<UnionOfHandle>,
8003 fidl::encoding::DefaultFuchsiaResourceDialect,
8004 >,
8005 >
8006 fidl::encoding::Encode<
8007 StructOfOptionalUnionOfHandle,
8008 fidl::encoding::DefaultFuchsiaResourceDialect,
8009 > for (T0,)
8010 {
8011 #[inline]
8012 unsafe fn encode(
8013 self,
8014 encoder: &mut fidl::encoding::Encoder<
8015 '_,
8016 fidl::encoding::DefaultFuchsiaResourceDialect,
8017 >,
8018 offset: usize,
8019 depth: fidl::encoding::Depth,
8020 ) -> fidl::Result<()> {
8021 encoder.debug_check_bounds::<StructOfOptionalUnionOfHandle>(offset);
8022 self.0.encode(encoder, offset + 0, depth)?;
8026 Ok(())
8027 }
8028 }
8029
8030 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8031 for StructOfOptionalUnionOfHandle
8032 {
8033 #[inline(always)]
8034 fn new_empty() -> Self {
8035 Self {
8036 u: fidl::new_empty!(
8037 fidl::encoding::OptionalUnion<UnionOfHandle>,
8038 fidl::encoding::DefaultFuchsiaResourceDialect
8039 ),
8040 }
8041 }
8042
8043 #[inline]
8044 unsafe fn decode(
8045 &mut self,
8046 decoder: &mut fidl::encoding::Decoder<
8047 '_,
8048 fidl::encoding::DefaultFuchsiaResourceDialect,
8049 >,
8050 offset: usize,
8051 _depth: fidl::encoding::Depth,
8052 ) -> fidl::Result<()> {
8053 decoder.debug_check_bounds::<Self>(offset);
8054 fidl::decode!(
8056 fidl::encoding::OptionalUnion<UnionOfHandle>,
8057 fidl::encoding::DefaultFuchsiaResourceDialect,
8058 &mut self.u,
8059 decoder,
8060 offset + 0,
8061 _depth
8062 )?;
8063 Ok(())
8064 }
8065 }
8066
8067 impl fidl::encoding::ResourceTypeMarker for StructOfSimpleResourceTable {
8068 type Borrowed<'a> = &'a mut Self;
8069 fn take_or_borrow<'a>(
8070 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8071 ) -> Self::Borrowed<'a> {
8072 value
8073 }
8074 }
8075
8076 unsafe impl fidl::encoding::TypeMarker for StructOfSimpleResourceTable {
8077 type Owned = Self;
8078
8079 #[inline(always)]
8080 fn inline_align(_context: fidl::encoding::Context) -> usize {
8081 8
8082 }
8083
8084 #[inline(always)]
8085 fn inline_size(_context: fidl::encoding::Context) -> usize {
8086 16
8087 }
8088 }
8089
8090 unsafe impl
8091 fidl::encoding::Encode<
8092 StructOfSimpleResourceTable,
8093 fidl::encoding::DefaultFuchsiaResourceDialect,
8094 > for &mut StructOfSimpleResourceTable
8095 {
8096 #[inline]
8097 unsafe fn encode(
8098 self,
8099 encoder: &mut fidl::encoding::Encoder<
8100 '_,
8101 fidl::encoding::DefaultFuchsiaResourceDialect,
8102 >,
8103 offset: usize,
8104 _depth: fidl::encoding::Depth,
8105 ) -> fidl::Result<()> {
8106 encoder.debug_check_bounds::<StructOfSimpleResourceTable>(offset);
8107 fidl::encoding::Encode::<
8109 StructOfSimpleResourceTable,
8110 fidl::encoding::DefaultFuchsiaResourceDialect,
8111 >::encode(
8112 (<SimpleResourceTable as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8113 &mut self.table,
8114 ),),
8115 encoder,
8116 offset,
8117 _depth,
8118 )
8119 }
8120 }
8121 unsafe impl<
8122 T0: fidl::encoding::Encode<
8123 SimpleResourceTable,
8124 fidl::encoding::DefaultFuchsiaResourceDialect,
8125 >,
8126 >
8127 fidl::encoding::Encode<
8128 StructOfSimpleResourceTable,
8129 fidl::encoding::DefaultFuchsiaResourceDialect,
8130 > for (T0,)
8131 {
8132 #[inline]
8133 unsafe fn encode(
8134 self,
8135 encoder: &mut fidl::encoding::Encoder<
8136 '_,
8137 fidl::encoding::DefaultFuchsiaResourceDialect,
8138 >,
8139 offset: usize,
8140 depth: fidl::encoding::Depth,
8141 ) -> fidl::Result<()> {
8142 encoder.debug_check_bounds::<StructOfSimpleResourceTable>(offset);
8143 self.0.encode(encoder, offset + 0, depth)?;
8147 Ok(())
8148 }
8149 }
8150
8151 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8152 for StructOfSimpleResourceTable
8153 {
8154 #[inline(always)]
8155 fn new_empty() -> Self {
8156 Self {
8157 table: fidl::new_empty!(
8158 SimpleResourceTable,
8159 fidl::encoding::DefaultFuchsiaResourceDialect
8160 ),
8161 }
8162 }
8163
8164 #[inline]
8165 unsafe fn decode(
8166 &mut self,
8167 decoder: &mut fidl::encoding::Decoder<
8168 '_,
8169 fidl::encoding::DefaultFuchsiaResourceDialect,
8170 >,
8171 offset: usize,
8172 _depth: fidl::encoding::Depth,
8173 ) -> fidl::Result<()> {
8174 decoder.debug_check_bounds::<Self>(offset);
8175 fidl::decode!(
8177 SimpleResourceTable,
8178 fidl::encoding::DefaultFuchsiaResourceDialect,
8179 &mut self.table,
8180 decoder,
8181 offset + 0,
8182 _depth
8183 )?;
8184 Ok(())
8185 }
8186 }
8187
8188 impl fidl::encoding::ResourceTypeMarker for TableFieldInlinedHandleStruct {
8189 type Borrowed<'a> = &'a mut Self;
8190 fn take_or_borrow<'a>(
8191 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8192 ) -> Self::Borrowed<'a> {
8193 value
8194 }
8195 }
8196
8197 unsafe impl fidl::encoding::TypeMarker for TableFieldInlinedHandleStruct {
8198 type Owned = Self;
8199
8200 #[inline(always)]
8201 fn inline_align(_context: fidl::encoding::Context) -> usize {
8202 8
8203 }
8204
8205 #[inline(always)]
8206 fn inline_size(_context: fidl::encoding::Context) -> usize {
8207 16
8208 }
8209 }
8210
8211 unsafe impl
8212 fidl::encoding::Encode<
8213 TableFieldInlinedHandleStruct,
8214 fidl::encoding::DefaultFuchsiaResourceDialect,
8215 > for &mut TableFieldInlinedHandleStruct
8216 {
8217 #[inline]
8218 unsafe fn encode(
8219 self,
8220 encoder: &mut fidl::encoding::Encoder<
8221 '_,
8222 fidl::encoding::DefaultFuchsiaResourceDialect,
8223 >,
8224 offset: usize,
8225 _depth: fidl::encoding::Depth,
8226 ) -> fidl::Result<()> {
8227 encoder.debug_check_bounds::<TableFieldInlinedHandleStruct>(offset);
8228 fidl::encoding::Encode::<
8230 TableFieldInlinedHandleStruct,
8231 fidl::encoding::DefaultFuchsiaResourceDialect,
8232 >::encode(
8233 (<TableFieldInlinedHandle as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8234 &mut self.t,
8235 ),),
8236 encoder,
8237 offset,
8238 _depth,
8239 )
8240 }
8241 }
8242 unsafe impl<
8243 T0: fidl::encoding::Encode<
8244 TableFieldInlinedHandle,
8245 fidl::encoding::DefaultFuchsiaResourceDialect,
8246 >,
8247 >
8248 fidl::encoding::Encode<
8249 TableFieldInlinedHandleStruct,
8250 fidl::encoding::DefaultFuchsiaResourceDialect,
8251 > for (T0,)
8252 {
8253 #[inline]
8254 unsafe fn encode(
8255 self,
8256 encoder: &mut fidl::encoding::Encoder<
8257 '_,
8258 fidl::encoding::DefaultFuchsiaResourceDialect,
8259 >,
8260 offset: usize,
8261 depth: fidl::encoding::Depth,
8262 ) -> fidl::Result<()> {
8263 encoder.debug_check_bounds::<TableFieldInlinedHandleStruct>(offset);
8264 self.0.encode(encoder, offset + 0, depth)?;
8268 Ok(())
8269 }
8270 }
8271
8272 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8273 for TableFieldInlinedHandleStruct
8274 {
8275 #[inline(always)]
8276 fn new_empty() -> Self {
8277 Self {
8278 t: fidl::new_empty!(
8279 TableFieldInlinedHandle,
8280 fidl::encoding::DefaultFuchsiaResourceDialect
8281 ),
8282 }
8283 }
8284
8285 #[inline]
8286 unsafe fn decode(
8287 &mut self,
8288 decoder: &mut fidl::encoding::Decoder<
8289 '_,
8290 fidl::encoding::DefaultFuchsiaResourceDialect,
8291 >,
8292 offset: usize,
8293 _depth: fidl::encoding::Depth,
8294 ) -> fidl::Result<()> {
8295 decoder.debug_check_bounds::<Self>(offset);
8296 fidl::decode!(
8298 TableFieldInlinedHandle,
8299 fidl::encoding::DefaultFuchsiaResourceDialect,
8300 &mut self.t,
8301 decoder,
8302 offset + 0,
8303 _depth
8304 )?;
8305 Ok(())
8306 }
8307 }
8308
8309 impl fidl::encoding::ResourceTypeMarker for TableFieldUnknownResourceStruct {
8310 type Borrowed<'a> = &'a mut Self;
8311 fn take_or_borrow<'a>(
8312 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8313 ) -> Self::Borrowed<'a> {
8314 value
8315 }
8316 }
8317
8318 unsafe impl fidl::encoding::TypeMarker for TableFieldUnknownResourceStruct {
8319 type Owned = Self;
8320
8321 #[inline(always)]
8322 fn inline_align(_context: fidl::encoding::Context) -> usize {
8323 8
8324 }
8325
8326 #[inline(always)]
8327 fn inline_size(_context: fidl::encoding::Context) -> usize {
8328 16
8329 }
8330 }
8331
8332 unsafe impl
8333 fidl::encoding::Encode<
8334 TableFieldUnknownResourceStruct,
8335 fidl::encoding::DefaultFuchsiaResourceDialect,
8336 > for &mut TableFieldUnknownResourceStruct
8337 {
8338 #[inline]
8339 unsafe fn encode(
8340 self,
8341 encoder: &mut fidl::encoding::Encoder<
8342 '_,
8343 fidl::encoding::DefaultFuchsiaResourceDialect,
8344 >,
8345 offset: usize,
8346 _depth: fidl::encoding::Depth,
8347 ) -> fidl::Result<()> {
8348 encoder.debug_check_bounds::<TableFieldUnknownResourceStruct>(offset);
8349 fidl::encoding::Encode::<TableFieldUnknownResourceStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8351 (
8352 <TableFieldUnknownResource as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.t),
8353 ),
8354 encoder, offset, _depth
8355 )
8356 }
8357 }
8358 unsafe impl<
8359 T0: fidl::encoding::Encode<
8360 TableFieldUnknownResource,
8361 fidl::encoding::DefaultFuchsiaResourceDialect,
8362 >,
8363 >
8364 fidl::encoding::Encode<
8365 TableFieldUnknownResourceStruct,
8366 fidl::encoding::DefaultFuchsiaResourceDialect,
8367 > for (T0,)
8368 {
8369 #[inline]
8370 unsafe fn encode(
8371 self,
8372 encoder: &mut fidl::encoding::Encoder<
8373 '_,
8374 fidl::encoding::DefaultFuchsiaResourceDialect,
8375 >,
8376 offset: usize,
8377 depth: fidl::encoding::Depth,
8378 ) -> fidl::Result<()> {
8379 encoder.debug_check_bounds::<TableFieldUnknownResourceStruct>(offset);
8380 self.0.encode(encoder, offset + 0, depth)?;
8384 Ok(())
8385 }
8386 }
8387
8388 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8389 for TableFieldUnknownResourceStruct
8390 {
8391 #[inline(always)]
8392 fn new_empty() -> Self {
8393 Self {
8394 t: fidl::new_empty!(
8395 TableFieldUnknownResource,
8396 fidl::encoding::DefaultFuchsiaResourceDialect
8397 ),
8398 }
8399 }
8400
8401 #[inline]
8402 unsafe fn decode(
8403 &mut self,
8404 decoder: &mut fidl::encoding::Decoder<
8405 '_,
8406 fidl::encoding::DefaultFuchsiaResourceDialect,
8407 >,
8408 offset: usize,
8409 _depth: fidl::encoding::Depth,
8410 ) -> fidl::Result<()> {
8411 decoder.debug_check_bounds::<Self>(offset);
8412 fidl::decode!(
8414 TableFieldUnknownResource,
8415 fidl::encoding::DefaultFuchsiaResourceDialect,
8416 &mut self.t,
8417 decoder,
8418 offset + 0,
8419 _depth
8420 )?;
8421 Ok(())
8422 }
8423 }
8424
8425 impl fidl::encoding::ResourceTypeMarker for TableOfEndpoints {
8426 type Borrowed<'a> = &'a mut Self;
8427 fn take_or_borrow<'a>(
8428 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8429 ) -> Self::Borrowed<'a> {
8430 value
8431 }
8432 }
8433
8434 unsafe impl fidl::encoding::TypeMarker for TableOfEndpoints {
8435 type Owned = Self;
8436
8437 #[inline(always)]
8438 fn inline_align(_context: fidl::encoding::Context) -> usize {
8439 8
8440 }
8441
8442 #[inline(always)]
8443 fn inline_size(_context: fidl::encoding::Context) -> usize {
8444 16
8445 }
8446 }
8447
8448 unsafe impl
8449 fidl::encoding::Encode<TableOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
8450 for &mut TableOfEndpoints
8451 {
8452 #[inline]
8453 unsafe fn encode(
8454 self,
8455 encoder: &mut fidl::encoding::Encoder<
8456 '_,
8457 fidl::encoding::DefaultFuchsiaResourceDialect,
8458 >,
8459 offset: usize,
8460 _depth: fidl::encoding::Depth,
8461 ) -> fidl::Result<()> {
8462 encoder.debug_check_bounds::<TableOfEndpoints>(offset);
8463 fidl::encoding::Encode::<TableOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8465 (
8466 <TableOfEndpointsTable as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.t),
8467 ),
8468 encoder, offset, _depth
8469 )
8470 }
8471 }
8472 unsafe impl<
8473 T0: fidl::encoding::Encode<
8474 TableOfEndpointsTable,
8475 fidl::encoding::DefaultFuchsiaResourceDialect,
8476 >,
8477 >
8478 fidl::encoding::Encode<TableOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
8479 for (T0,)
8480 {
8481 #[inline]
8482 unsafe fn encode(
8483 self,
8484 encoder: &mut fidl::encoding::Encoder<
8485 '_,
8486 fidl::encoding::DefaultFuchsiaResourceDialect,
8487 >,
8488 offset: usize,
8489 depth: fidl::encoding::Depth,
8490 ) -> fidl::Result<()> {
8491 encoder.debug_check_bounds::<TableOfEndpoints>(offset);
8492 self.0.encode(encoder, offset + 0, depth)?;
8496 Ok(())
8497 }
8498 }
8499
8500 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8501 for TableOfEndpoints
8502 {
8503 #[inline(always)]
8504 fn new_empty() -> Self {
8505 Self {
8506 t: fidl::new_empty!(
8507 TableOfEndpointsTable,
8508 fidl::encoding::DefaultFuchsiaResourceDialect
8509 ),
8510 }
8511 }
8512
8513 #[inline]
8514 unsafe fn decode(
8515 &mut self,
8516 decoder: &mut fidl::encoding::Decoder<
8517 '_,
8518 fidl::encoding::DefaultFuchsiaResourceDialect,
8519 >,
8520 offset: usize,
8521 _depth: fidl::encoding::Depth,
8522 ) -> fidl::Result<()> {
8523 decoder.debug_check_bounds::<Self>(offset);
8524 fidl::decode!(
8526 TableOfEndpointsTable,
8527 fidl::encoding::DefaultFuchsiaResourceDialect,
8528 &mut self.t,
8529 decoder,
8530 offset + 0,
8531 _depth
8532 )?;
8533 Ok(())
8534 }
8535 }
8536
8537 impl fidl::encoding::ResourceTypeMarker for TableUnionWithVectorReservedSandwichStruct {
8538 type Borrowed<'a> = &'a mut Self;
8539 fn take_or_borrow<'a>(
8540 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8541 ) -> Self::Borrowed<'a> {
8542 value
8543 }
8544 }
8545
8546 unsafe impl fidl::encoding::TypeMarker for TableUnionWithVectorReservedSandwichStruct {
8547 type Owned = Self;
8548
8549 #[inline(always)]
8550 fn inline_align(_context: fidl::encoding::Context) -> usize {
8551 8
8552 }
8553
8554 #[inline(always)]
8555 fn inline_size(_context: fidl::encoding::Context) -> usize {
8556 16
8557 }
8558 }
8559
8560 unsafe impl
8561 fidl::encoding::Encode<
8562 TableUnionWithVectorReservedSandwichStruct,
8563 fidl::encoding::DefaultFuchsiaResourceDialect,
8564 > for &mut TableUnionWithVectorReservedSandwichStruct
8565 {
8566 #[inline]
8567 unsafe fn encode(
8568 self,
8569 encoder: &mut fidl::encoding::Encoder<
8570 '_,
8571 fidl::encoding::DefaultFuchsiaResourceDialect,
8572 >,
8573 offset: usize,
8574 _depth: fidl::encoding::Depth,
8575 ) -> fidl::Result<()> {
8576 encoder.debug_check_bounds::<TableUnionWithVectorReservedSandwichStruct>(offset);
8577 fidl::encoding::Encode::<TableUnionWithVectorReservedSandwichStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8579 (
8580 <TableUnionWithVectorReservedSandwich as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.table),
8581 ),
8582 encoder, offset, _depth
8583 )
8584 }
8585 }
8586 unsafe impl<
8587 T0: fidl::encoding::Encode<
8588 TableUnionWithVectorReservedSandwich,
8589 fidl::encoding::DefaultFuchsiaResourceDialect,
8590 >,
8591 >
8592 fidl::encoding::Encode<
8593 TableUnionWithVectorReservedSandwichStruct,
8594 fidl::encoding::DefaultFuchsiaResourceDialect,
8595 > for (T0,)
8596 {
8597 #[inline]
8598 unsafe fn encode(
8599 self,
8600 encoder: &mut fidl::encoding::Encoder<
8601 '_,
8602 fidl::encoding::DefaultFuchsiaResourceDialect,
8603 >,
8604 offset: usize,
8605 depth: fidl::encoding::Depth,
8606 ) -> fidl::Result<()> {
8607 encoder.debug_check_bounds::<TableUnionWithVectorReservedSandwichStruct>(offset);
8608 self.0.encode(encoder, offset + 0, depth)?;
8612 Ok(())
8613 }
8614 }
8615
8616 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8617 for TableUnionWithVectorReservedSandwichStruct
8618 {
8619 #[inline(always)]
8620 fn new_empty() -> Self {
8621 Self {
8622 table: fidl::new_empty!(
8623 TableUnionWithVectorReservedSandwich,
8624 fidl::encoding::DefaultFuchsiaResourceDialect
8625 ),
8626 }
8627 }
8628
8629 #[inline]
8630 unsafe fn decode(
8631 &mut self,
8632 decoder: &mut fidl::encoding::Decoder<
8633 '_,
8634 fidl::encoding::DefaultFuchsiaResourceDialect,
8635 >,
8636 offset: usize,
8637 _depth: fidl::encoding::Depth,
8638 ) -> fidl::Result<()> {
8639 decoder.debug_check_bounds::<Self>(offset);
8640 fidl::decode!(
8642 TableUnionWithVectorReservedSandwich,
8643 fidl::encoding::DefaultFuchsiaResourceDialect,
8644 &mut self.table,
8645 decoder,
8646 offset + 0,
8647 _depth
8648 )?;
8649 Ok(())
8650 }
8651 }
8652
8653 impl fidl::encoding::ResourceTypeMarker for TableUnionWithVectorStructSandwichStruct {
8654 type Borrowed<'a> = &'a mut Self;
8655 fn take_or_borrow<'a>(
8656 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8657 ) -> Self::Borrowed<'a> {
8658 value
8659 }
8660 }
8661
8662 unsafe impl fidl::encoding::TypeMarker for TableUnionWithVectorStructSandwichStruct {
8663 type Owned = Self;
8664
8665 #[inline(always)]
8666 fn inline_align(_context: fidl::encoding::Context) -> usize {
8667 8
8668 }
8669
8670 #[inline(always)]
8671 fn inline_size(_context: fidl::encoding::Context) -> usize {
8672 16
8673 }
8674 }
8675
8676 unsafe impl
8677 fidl::encoding::Encode<
8678 TableUnionWithVectorStructSandwichStruct,
8679 fidl::encoding::DefaultFuchsiaResourceDialect,
8680 > for &mut TableUnionWithVectorStructSandwichStruct
8681 {
8682 #[inline]
8683 unsafe fn encode(
8684 self,
8685 encoder: &mut fidl::encoding::Encoder<
8686 '_,
8687 fidl::encoding::DefaultFuchsiaResourceDialect,
8688 >,
8689 offset: usize,
8690 _depth: fidl::encoding::Depth,
8691 ) -> fidl::Result<()> {
8692 encoder.debug_check_bounds::<TableUnionWithVectorStructSandwichStruct>(offset);
8693 fidl::encoding::Encode::<TableUnionWithVectorStructSandwichStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8695 (
8696 <TableUnionWithVectorStructSandwich as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.table),
8697 ),
8698 encoder, offset, _depth
8699 )
8700 }
8701 }
8702 unsafe impl<
8703 T0: fidl::encoding::Encode<
8704 TableUnionWithVectorStructSandwich,
8705 fidl::encoding::DefaultFuchsiaResourceDialect,
8706 >,
8707 >
8708 fidl::encoding::Encode<
8709 TableUnionWithVectorStructSandwichStruct,
8710 fidl::encoding::DefaultFuchsiaResourceDialect,
8711 > for (T0,)
8712 {
8713 #[inline]
8714 unsafe fn encode(
8715 self,
8716 encoder: &mut fidl::encoding::Encoder<
8717 '_,
8718 fidl::encoding::DefaultFuchsiaResourceDialect,
8719 >,
8720 offset: usize,
8721 depth: fidl::encoding::Depth,
8722 ) -> fidl::Result<()> {
8723 encoder.debug_check_bounds::<TableUnionWithVectorStructSandwichStruct>(offset);
8724 self.0.encode(encoder, offset + 0, depth)?;
8728 Ok(())
8729 }
8730 }
8731
8732 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8733 for TableUnionWithVectorStructSandwichStruct
8734 {
8735 #[inline(always)]
8736 fn new_empty() -> Self {
8737 Self {
8738 table: fidl::new_empty!(
8739 TableUnionWithVectorStructSandwich,
8740 fidl::encoding::DefaultFuchsiaResourceDialect
8741 ),
8742 }
8743 }
8744
8745 #[inline]
8746 unsafe fn decode(
8747 &mut self,
8748 decoder: &mut fidl::encoding::Decoder<
8749 '_,
8750 fidl::encoding::DefaultFuchsiaResourceDialect,
8751 >,
8752 offset: usize,
8753 _depth: fidl::encoding::Depth,
8754 ) -> fidl::Result<()> {
8755 decoder.debug_check_bounds::<Self>(offset);
8756 fidl::decode!(
8758 TableUnionWithVectorStructSandwich,
8759 fidl::encoding::DefaultFuchsiaResourceDialect,
8760 &mut self.table,
8761 decoder,
8762 offset + 0,
8763 _depth
8764 )?;
8765 Ok(())
8766 }
8767 }
8768
8769 impl fidl::encoding::ResourceTypeMarker for TestFlexibleResourceXUnionInStruct {
8770 type Borrowed<'a> = &'a mut Self;
8771 fn take_or_borrow<'a>(
8772 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8773 ) -> Self::Borrowed<'a> {
8774 value
8775 }
8776 }
8777
8778 unsafe impl fidl::encoding::TypeMarker for TestFlexibleResourceXUnionInStruct {
8779 type Owned = Self;
8780
8781 #[inline(always)]
8782 fn inline_align(_context: fidl::encoding::Context) -> usize {
8783 8
8784 }
8785
8786 #[inline(always)]
8787 fn inline_size(_context: fidl::encoding::Context) -> usize {
8788 16
8789 }
8790 }
8791
8792 unsafe impl
8793 fidl::encoding::Encode<
8794 TestFlexibleResourceXUnionInStruct,
8795 fidl::encoding::DefaultFuchsiaResourceDialect,
8796 > for &mut TestFlexibleResourceXUnionInStruct
8797 {
8798 #[inline]
8799 unsafe fn encode(
8800 self,
8801 encoder: &mut fidl::encoding::Encoder<
8802 '_,
8803 fidl::encoding::DefaultFuchsiaResourceDialect,
8804 >,
8805 offset: usize,
8806 _depth: fidl::encoding::Depth,
8807 ) -> fidl::Result<()> {
8808 encoder.debug_check_bounds::<TestFlexibleResourceXUnionInStruct>(offset);
8809 fidl::encoding::Encode::<
8811 TestFlexibleResourceXUnionInStruct,
8812 fidl::encoding::DefaultFuchsiaResourceDialect,
8813 >::encode(
8814 (<SampleResourceXUnion as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8815 &mut self.xu,
8816 ),),
8817 encoder,
8818 offset,
8819 _depth,
8820 )
8821 }
8822 }
8823 unsafe impl<
8824 T0: fidl::encoding::Encode<
8825 SampleResourceXUnion,
8826 fidl::encoding::DefaultFuchsiaResourceDialect,
8827 >,
8828 >
8829 fidl::encoding::Encode<
8830 TestFlexibleResourceXUnionInStruct,
8831 fidl::encoding::DefaultFuchsiaResourceDialect,
8832 > for (T0,)
8833 {
8834 #[inline]
8835 unsafe fn encode(
8836 self,
8837 encoder: &mut fidl::encoding::Encoder<
8838 '_,
8839 fidl::encoding::DefaultFuchsiaResourceDialect,
8840 >,
8841 offset: usize,
8842 depth: fidl::encoding::Depth,
8843 ) -> fidl::Result<()> {
8844 encoder.debug_check_bounds::<TestFlexibleResourceXUnionInStruct>(offset);
8845 self.0.encode(encoder, offset + 0, depth)?;
8849 Ok(())
8850 }
8851 }
8852
8853 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8854 for TestFlexibleResourceXUnionInStruct
8855 {
8856 #[inline(always)]
8857 fn new_empty() -> Self {
8858 Self {
8859 xu: fidl::new_empty!(
8860 SampleResourceXUnion,
8861 fidl::encoding::DefaultFuchsiaResourceDialect
8862 ),
8863 }
8864 }
8865
8866 #[inline]
8867 unsafe fn decode(
8868 &mut self,
8869 decoder: &mut fidl::encoding::Decoder<
8870 '_,
8871 fidl::encoding::DefaultFuchsiaResourceDialect,
8872 >,
8873 offset: usize,
8874 _depth: fidl::encoding::Depth,
8875 ) -> fidl::Result<()> {
8876 decoder.debug_check_bounds::<Self>(offset);
8877 fidl::decode!(
8879 SampleResourceXUnion,
8880 fidl::encoding::DefaultFuchsiaResourceDialect,
8881 &mut self.xu,
8882 decoder,
8883 offset + 0,
8884 _depth
8885 )?;
8886 Ok(())
8887 }
8888 }
8889
8890 impl fidl::encoding::ResourceTypeMarker for TestOptionalFlexibleResourceXUnionInStruct {
8891 type Borrowed<'a> = &'a mut Self;
8892 fn take_or_borrow<'a>(
8893 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8894 ) -> Self::Borrowed<'a> {
8895 value
8896 }
8897 }
8898
8899 unsafe impl fidl::encoding::TypeMarker for TestOptionalFlexibleResourceXUnionInStruct {
8900 type Owned = Self;
8901
8902 #[inline(always)]
8903 fn inline_align(_context: fidl::encoding::Context) -> usize {
8904 8
8905 }
8906
8907 #[inline(always)]
8908 fn inline_size(_context: fidl::encoding::Context) -> usize {
8909 16
8910 }
8911 }
8912
8913 unsafe impl
8914 fidl::encoding::Encode<
8915 TestOptionalFlexibleResourceXUnionInStruct,
8916 fidl::encoding::DefaultFuchsiaResourceDialect,
8917 > for &mut TestOptionalFlexibleResourceXUnionInStruct
8918 {
8919 #[inline]
8920 unsafe fn encode(
8921 self,
8922 encoder: &mut fidl::encoding::Encoder<
8923 '_,
8924 fidl::encoding::DefaultFuchsiaResourceDialect,
8925 >,
8926 offset: usize,
8927 _depth: fidl::encoding::Depth,
8928 ) -> fidl::Result<()> {
8929 encoder.debug_check_bounds::<TestOptionalFlexibleResourceXUnionInStruct>(offset);
8930 fidl::encoding::Encode::<TestOptionalFlexibleResourceXUnionInStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8932 (
8933 <fidl::encoding::OptionalUnion<SampleResourceXUnion> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.xu),
8934 ),
8935 encoder, offset, _depth
8936 )
8937 }
8938 }
8939 unsafe impl<
8940 T0: fidl::encoding::Encode<
8941 fidl::encoding::OptionalUnion<SampleResourceXUnion>,
8942 fidl::encoding::DefaultFuchsiaResourceDialect,
8943 >,
8944 >
8945 fidl::encoding::Encode<
8946 TestOptionalFlexibleResourceXUnionInStruct,
8947 fidl::encoding::DefaultFuchsiaResourceDialect,
8948 > for (T0,)
8949 {
8950 #[inline]
8951 unsafe fn encode(
8952 self,
8953 encoder: &mut fidl::encoding::Encoder<
8954 '_,
8955 fidl::encoding::DefaultFuchsiaResourceDialect,
8956 >,
8957 offset: usize,
8958 depth: fidl::encoding::Depth,
8959 ) -> fidl::Result<()> {
8960 encoder.debug_check_bounds::<TestOptionalFlexibleResourceXUnionInStruct>(offset);
8961 self.0.encode(encoder, offset + 0, depth)?;
8965 Ok(())
8966 }
8967 }
8968
8969 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8970 for TestOptionalFlexibleResourceXUnionInStruct
8971 {
8972 #[inline(always)]
8973 fn new_empty() -> Self {
8974 Self {
8975 xu: fidl::new_empty!(
8976 fidl::encoding::OptionalUnion<SampleResourceXUnion>,
8977 fidl::encoding::DefaultFuchsiaResourceDialect
8978 ),
8979 }
8980 }
8981
8982 #[inline]
8983 unsafe fn decode(
8984 &mut self,
8985 decoder: &mut fidl::encoding::Decoder<
8986 '_,
8987 fidl::encoding::DefaultFuchsiaResourceDialect,
8988 >,
8989 offset: usize,
8990 _depth: fidl::encoding::Depth,
8991 ) -> fidl::Result<()> {
8992 decoder.debug_check_bounds::<Self>(offset);
8993 fidl::decode!(
8995 fidl::encoding::OptionalUnion<SampleResourceXUnion>,
8996 fidl::encoding::DefaultFuchsiaResourceDialect,
8997 &mut self.xu,
8998 decoder,
8999 offset + 0,
9000 _depth
9001 )?;
9002 Ok(())
9003 }
9004 }
9005
9006 impl fidl::encoding::ResourceTypeMarker for TestOptionalStrictResourceXUnionInStruct {
9007 type Borrowed<'a> = &'a mut Self;
9008 fn take_or_borrow<'a>(
9009 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9010 ) -> Self::Borrowed<'a> {
9011 value
9012 }
9013 }
9014
9015 unsafe impl fidl::encoding::TypeMarker for TestOptionalStrictResourceXUnionInStruct {
9016 type Owned = Self;
9017
9018 #[inline(always)]
9019 fn inline_align(_context: fidl::encoding::Context) -> usize {
9020 8
9021 }
9022
9023 #[inline(always)]
9024 fn inline_size(_context: fidl::encoding::Context) -> usize {
9025 16
9026 }
9027 }
9028
9029 unsafe impl
9030 fidl::encoding::Encode<
9031 TestOptionalStrictResourceXUnionInStruct,
9032 fidl::encoding::DefaultFuchsiaResourceDialect,
9033 > for &mut TestOptionalStrictResourceXUnionInStruct
9034 {
9035 #[inline]
9036 unsafe fn encode(
9037 self,
9038 encoder: &mut fidl::encoding::Encoder<
9039 '_,
9040 fidl::encoding::DefaultFuchsiaResourceDialect,
9041 >,
9042 offset: usize,
9043 _depth: fidl::encoding::Depth,
9044 ) -> fidl::Result<()> {
9045 encoder.debug_check_bounds::<TestOptionalStrictResourceXUnionInStruct>(offset);
9046 fidl::encoding::Encode::<TestOptionalStrictResourceXUnionInStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9048 (
9049 <fidl::encoding::OptionalUnion<SampleStrictResourceXUnion> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.xu),
9050 ),
9051 encoder, offset, _depth
9052 )
9053 }
9054 }
9055 unsafe impl<
9056 T0: fidl::encoding::Encode<
9057 fidl::encoding::OptionalUnion<SampleStrictResourceXUnion>,
9058 fidl::encoding::DefaultFuchsiaResourceDialect,
9059 >,
9060 >
9061 fidl::encoding::Encode<
9062 TestOptionalStrictResourceXUnionInStruct,
9063 fidl::encoding::DefaultFuchsiaResourceDialect,
9064 > for (T0,)
9065 {
9066 #[inline]
9067 unsafe fn encode(
9068 self,
9069 encoder: &mut fidl::encoding::Encoder<
9070 '_,
9071 fidl::encoding::DefaultFuchsiaResourceDialect,
9072 >,
9073 offset: usize,
9074 depth: fidl::encoding::Depth,
9075 ) -> fidl::Result<()> {
9076 encoder.debug_check_bounds::<TestOptionalStrictResourceXUnionInStruct>(offset);
9077 self.0.encode(encoder, offset + 0, depth)?;
9081 Ok(())
9082 }
9083 }
9084
9085 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9086 for TestOptionalStrictResourceXUnionInStruct
9087 {
9088 #[inline(always)]
9089 fn new_empty() -> Self {
9090 Self {
9091 xu: fidl::new_empty!(
9092 fidl::encoding::OptionalUnion<SampleStrictResourceXUnion>,
9093 fidl::encoding::DefaultFuchsiaResourceDialect
9094 ),
9095 }
9096 }
9097
9098 #[inline]
9099 unsafe fn decode(
9100 &mut self,
9101 decoder: &mut fidl::encoding::Decoder<
9102 '_,
9103 fidl::encoding::DefaultFuchsiaResourceDialect,
9104 >,
9105 offset: usize,
9106 _depth: fidl::encoding::Depth,
9107 ) -> fidl::Result<()> {
9108 decoder.debug_check_bounds::<Self>(offset);
9109 fidl::decode!(
9111 fidl::encoding::OptionalUnion<SampleStrictResourceXUnion>,
9112 fidl::encoding::DefaultFuchsiaResourceDialect,
9113 &mut self.xu,
9114 decoder,
9115 offset + 0,
9116 _depth
9117 )?;
9118 Ok(())
9119 }
9120 }
9121
9122 impl fidl::encoding::ResourceTypeMarker for TestPackageResolverResolveRequest {
9123 type Borrowed<'a> = &'a mut Self;
9124 fn take_or_borrow<'a>(
9125 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9126 ) -> Self::Borrowed<'a> {
9127 value
9128 }
9129 }
9130
9131 unsafe impl fidl::encoding::TypeMarker for TestPackageResolverResolveRequest {
9132 type Owned = Self;
9133
9134 #[inline(always)]
9135 fn inline_align(_context: fidl::encoding::Context) -> usize {
9136 8
9137 }
9138
9139 #[inline(always)]
9140 fn inline_size(_context: fidl::encoding::Context) -> usize {
9141 40
9142 }
9143 }
9144
9145 unsafe impl
9146 fidl::encoding::Encode<
9147 TestPackageResolverResolveRequest,
9148 fidl::encoding::DefaultFuchsiaResourceDialect,
9149 > for &mut TestPackageResolverResolveRequest
9150 {
9151 #[inline]
9152 unsafe fn encode(
9153 self,
9154 encoder: &mut fidl::encoding::Encoder<
9155 '_,
9156 fidl::encoding::DefaultFuchsiaResourceDialect,
9157 >,
9158 offset: usize,
9159 _depth: fidl::encoding::Depth,
9160 ) -> fidl::Result<()> {
9161 encoder.debug_check_bounds::<TestPackageResolverResolveRequest>(offset);
9162 fidl::encoding::Encode::<TestPackageResolverResolveRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9164 (
9165 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.package_url),
9166 <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.selectors),
9167 <UpdatePolicy as fidl::encoding::ValueTypeMarker>::borrow(&self.update_policy),
9168 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.this_should_be_a_handle),
9169 ),
9170 encoder, offset, _depth
9171 )
9172 }
9173 }
9174 unsafe impl<
9175 T0: fidl::encoding::Encode<
9176 fidl::encoding::UnboundedString,
9177 fidl::encoding::DefaultFuchsiaResourceDialect,
9178 >,
9179 T1: fidl::encoding::Encode<
9180 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
9181 fidl::encoding::DefaultFuchsiaResourceDialect,
9182 >,
9183 T2: fidl::encoding::Encode<UpdatePolicy, fidl::encoding::DefaultFuchsiaResourceDialect>,
9184 T3: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
9185 >
9186 fidl::encoding::Encode<
9187 TestPackageResolverResolveRequest,
9188 fidl::encoding::DefaultFuchsiaResourceDialect,
9189 > for (T0, T1, T2, T3)
9190 {
9191 #[inline]
9192 unsafe fn encode(
9193 self,
9194 encoder: &mut fidl::encoding::Encoder<
9195 '_,
9196 fidl::encoding::DefaultFuchsiaResourceDialect,
9197 >,
9198 offset: usize,
9199 depth: fidl::encoding::Depth,
9200 ) -> fidl::Result<()> {
9201 encoder.debug_check_bounds::<TestPackageResolverResolveRequest>(offset);
9202 unsafe {
9205 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
9206 (ptr as *mut u64).write_unaligned(0);
9207 }
9208 self.0.encode(encoder, offset + 0, depth)?;
9210 self.1.encode(encoder, offset + 16, depth)?;
9211 self.2.encode(encoder, offset + 32, depth)?;
9212 self.3.encode(encoder, offset + 36, depth)?;
9213 Ok(())
9214 }
9215 }
9216
9217 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9218 for TestPackageResolverResolveRequest
9219 {
9220 #[inline(always)]
9221 fn new_empty() -> Self {
9222 Self {
9223 package_url: fidl::new_empty!(
9224 fidl::encoding::UnboundedString,
9225 fidl::encoding::DefaultFuchsiaResourceDialect
9226 ),
9227 selectors: fidl::new_empty!(
9228 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
9229 fidl::encoding::DefaultFuchsiaResourceDialect
9230 ),
9231 update_policy: fidl::new_empty!(
9232 UpdatePolicy,
9233 fidl::encoding::DefaultFuchsiaResourceDialect
9234 ),
9235 this_should_be_a_handle: fidl::new_empty!(
9236 u32,
9237 fidl::encoding::DefaultFuchsiaResourceDialect
9238 ),
9239 }
9240 }
9241
9242 #[inline]
9243 unsafe fn decode(
9244 &mut self,
9245 decoder: &mut fidl::encoding::Decoder<
9246 '_,
9247 fidl::encoding::DefaultFuchsiaResourceDialect,
9248 >,
9249 offset: usize,
9250 _depth: fidl::encoding::Depth,
9251 ) -> fidl::Result<()> {
9252 decoder.debug_check_bounds::<Self>(offset);
9253 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9255 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9256 let mask = 0xffff0000u64;
9257 let maskedval = padval & mask;
9258 if maskedval != 0 {
9259 return Err(fidl::Error::NonZeroPadding {
9260 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9261 });
9262 }
9263 fidl::decode!(
9264 fidl::encoding::UnboundedString,
9265 fidl::encoding::DefaultFuchsiaResourceDialect,
9266 &mut self.package_url,
9267 decoder,
9268 offset + 0,
9269 _depth
9270 )?;
9271 fidl::decode!(
9272 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
9273 fidl::encoding::DefaultFuchsiaResourceDialect,
9274 &mut self.selectors,
9275 decoder,
9276 offset + 16,
9277 _depth
9278 )?;
9279 fidl::decode!(
9280 UpdatePolicy,
9281 fidl::encoding::DefaultFuchsiaResourceDialect,
9282 &mut self.update_policy,
9283 decoder,
9284 offset + 32,
9285 _depth
9286 )?;
9287 fidl::decode!(
9288 u32,
9289 fidl::encoding::DefaultFuchsiaResourceDialect,
9290 &mut self.this_should_be_a_handle,
9291 decoder,
9292 offset + 36,
9293 _depth
9294 )?;
9295 Ok(())
9296 }
9297 }
9298
9299 impl fidl::encoding::ResourceTypeMarker for TestStrictResourceXUnionInStruct {
9300 type Borrowed<'a> = &'a mut Self;
9301 fn take_or_borrow<'a>(
9302 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9303 ) -> Self::Borrowed<'a> {
9304 value
9305 }
9306 }
9307
9308 unsafe impl fidl::encoding::TypeMarker for TestStrictResourceXUnionInStruct {
9309 type Owned = Self;
9310
9311 #[inline(always)]
9312 fn inline_align(_context: fidl::encoding::Context) -> usize {
9313 8
9314 }
9315
9316 #[inline(always)]
9317 fn inline_size(_context: fidl::encoding::Context) -> usize {
9318 16
9319 }
9320 }
9321
9322 unsafe impl
9323 fidl::encoding::Encode<
9324 TestStrictResourceXUnionInStruct,
9325 fidl::encoding::DefaultFuchsiaResourceDialect,
9326 > for &mut TestStrictResourceXUnionInStruct
9327 {
9328 #[inline]
9329 unsafe fn encode(
9330 self,
9331 encoder: &mut fidl::encoding::Encoder<
9332 '_,
9333 fidl::encoding::DefaultFuchsiaResourceDialect,
9334 >,
9335 offset: usize,
9336 _depth: fidl::encoding::Depth,
9337 ) -> fidl::Result<()> {
9338 encoder.debug_check_bounds::<TestStrictResourceXUnionInStruct>(offset);
9339 fidl::encoding::Encode::<TestStrictResourceXUnionInStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9341 (
9342 <SampleStrictResourceXUnion as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.xu),
9343 ),
9344 encoder, offset, _depth
9345 )
9346 }
9347 }
9348 unsafe impl<
9349 T0: fidl::encoding::Encode<
9350 SampleStrictResourceXUnion,
9351 fidl::encoding::DefaultFuchsiaResourceDialect,
9352 >,
9353 >
9354 fidl::encoding::Encode<
9355 TestStrictResourceXUnionInStruct,
9356 fidl::encoding::DefaultFuchsiaResourceDialect,
9357 > for (T0,)
9358 {
9359 #[inline]
9360 unsafe fn encode(
9361 self,
9362 encoder: &mut fidl::encoding::Encoder<
9363 '_,
9364 fidl::encoding::DefaultFuchsiaResourceDialect,
9365 >,
9366 offset: usize,
9367 depth: fidl::encoding::Depth,
9368 ) -> fidl::Result<()> {
9369 encoder.debug_check_bounds::<TestStrictResourceXUnionInStruct>(offset);
9370 self.0.encode(encoder, offset + 0, depth)?;
9374 Ok(())
9375 }
9376 }
9377
9378 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9379 for TestStrictResourceXUnionInStruct
9380 {
9381 #[inline(always)]
9382 fn new_empty() -> Self {
9383 Self {
9384 xu: fidl::new_empty!(
9385 SampleStrictResourceXUnion,
9386 fidl::encoding::DefaultFuchsiaResourceDialect
9387 ),
9388 }
9389 }
9390
9391 #[inline]
9392 unsafe fn decode(
9393 &mut self,
9394 decoder: &mut fidl::encoding::Decoder<
9395 '_,
9396 fidl::encoding::DefaultFuchsiaResourceDialect,
9397 >,
9398 offset: usize,
9399 _depth: fidl::encoding::Depth,
9400 ) -> fidl::Result<()> {
9401 decoder.debug_check_bounds::<Self>(offset);
9402 fidl::decode!(
9404 SampleStrictResourceXUnion,
9405 fidl::encoding::DefaultFuchsiaResourceDialect,
9406 &mut self.xu,
9407 decoder,
9408 offset + 0,
9409 _depth
9410 )?;
9411 Ok(())
9412 }
9413 }
9414
9415 impl fidl::encoding::ResourceTypeMarker for UnboundedNonnullableVectorOfHandles {
9416 type Borrowed<'a> = &'a mut Self;
9417 fn take_or_borrow<'a>(
9418 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9419 ) -> Self::Borrowed<'a> {
9420 value
9421 }
9422 }
9423
9424 unsafe impl fidl::encoding::TypeMarker for UnboundedNonnullableVectorOfHandles {
9425 type Owned = Self;
9426
9427 #[inline(always)]
9428 fn inline_align(_context: fidl::encoding::Context) -> usize {
9429 8
9430 }
9431
9432 #[inline(always)]
9433 fn inline_size(_context: fidl::encoding::Context) -> usize {
9434 16
9435 }
9436 }
9437
9438 unsafe impl
9439 fidl::encoding::Encode<
9440 UnboundedNonnullableVectorOfHandles,
9441 fidl::encoding::DefaultFuchsiaResourceDialect,
9442 > for &mut UnboundedNonnullableVectorOfHandles
9443 {
9444 #[inline]
9445 unsafe fn encode(
9446 self,
9447 encoder: &mut fidl::encoding::Encoder<
9448 '_,
9449 fidl::encoding::DefaultFuchsiaResourceDialect,
9450 >,
9451 offset: usize,
9452 _depth: fidl::encoding::Depth,
9453 ) -> fidl::Result<()> {
9454 encoder.debug_check_bounds::<UnboundedNonnullableVectorOfHandles>(offset);
9455 fidl::encoding::Encode::<
9457 UnboundedNonnullableVectorOfHandles,
9458 fidl::encoding::DefaultFuchsiaResourceDialect,
9459 >::encode(
9460 (<fidl::encoding::UnboundedVector<
9461 fidl::encoding::HandleType<
9462 fidl::Handle,
9463 { fidl::ObjectType::NONE.into_raw() },
9464 2147483648,
9465 >,
9466 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9467 &mut self.vh0
9468 ),),
9469 encoder,
9470 offset,
9471 _depth,
9472 )
9473 }
9474 }
9475 unsafe impl<
9476 T0: fidl::encoding::Encode<
9477 fidl::encoding::UnboundedVector<
9478 fidl::encoding::HandleType<
9479 fidl::Handle,
9480 { fidl::ObjectType::NONE.into_raw() },
9481 2147483648,
9482 >,
9483 >,
9484 fidl::encoding::DefaultFuchsiaResourceDialect,
9485 >,
9486 >
9487 fidl::encoding::Encode<
9488 UnboundedNonnullableVectorOfHandles,
9489 fidl::encoding::DefaultFuchsiaResourceDialect,
9490 > for (T0,)
9491 {
9492 #[inline]
9493 unsafe fn encode(
9494 self,
9495 encoder: &mut fidl::encoding::Encoder<
9496 '_,
9497 fidl::encoding::DefaultFuchsiaResourceDialect,
9498 >,
9499 offset: usize,
9500 depth: fidl::encoding::Depth,
9501 ) -> fidl::Result<()> {
9502 encoder.debug_check_bounds::<UnboundedNonnullableVectorOfHandles>(offset);
9503 self.0.encode(encoder, offset + 0, depth)?;
9507 Ok(())
9508 }
9509 }
9510
9511 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9512 for UnboundedNonnullableVectorOfHandles
9513 {
9514 #[inline(always)]
9515 fn new_empty() -> Self {
9516 Self {
9517 vh0: fidl::new_empty!(
9518 fidl::encoding::UnboundedVector<
9519 fidl::encoding::HandleType<
9520 fidl::Handle,
9521 { fidl::ObjectType::NONE.into_raw() },
9522 2147483648,
9523 >,
9524 >,
9525 fidl::encoding::DefaultFuchsiaResourceDialect
9526 ),
9527 }
9528 }
9529
9530 #[inline]
9531 unsafe fn decode(
9532 &mut self,
9533 decoder: &mut fidl::encoding::Decoder<
9534 '_,
9535 fidl::encoding::DefaultFuchsiaResourceDialect,
9536 >,
9537 offset: usize,
9538 _depth: fidl::encoding::Depth,
9539 ) -> fidl::Result<()> {
9540 decoder.debug_check_bounds::<Self>(offset);
9541 fidl::decode!(
9543 fidl::encoding::UnboundedVector<
9544 fidl::encoding::HandleType<
9545 fidl::Handle,
9546 { fidl::ObjectType::NONE.into_raw() },
9547 2147483648,
9548 >,
9549 >,
9550 fidl::encoding::DefaultFuchsiaResourceDialect,
9551 &mut self.vh0,
9552 decoder,
9553 offset + 0,
9554 _depth
9555 )?;
9556 Ok(())
9557 }
9558 }
9559
9560 impl fidl::encoding::ResourceTypeMarker for UnboundedNullableVectorOfHandles {
9561 type Borrowed<'a> = &'a mut Self;
9562 fn take_or_borrow<'a>(
9563 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9564 ) -> Self::Borrowed<'a> {
9565 value
9566 }
9567 }
9568
9569 unsafe impl fidl::encoding::TypeMarker for UnboundedNullableVectorOfHandles {
9570 type Owned = Self;
9571
9572 #[inline(always)]
9573 fn inline_align(_context: fidl::encoding::Context) -> usize {
9574 8
9575 }
9576
9577 #[inline(always)]
9578 fn inline_size(_context: fidl::encoding::Context) -> usize {
9579 16
9580 }
9581 }
9582
9583 unsafe impl
9584 fidl::encoding::Encode<
9585 UnboundedNullableVectorOfHandles,
9586 fidl::encoding::DefaultFuchsiaResourceDialect,
9587 > for &mut UnboundedNullableVectorOfHandles
9588 {
9589 #[inline]
9590 unsafe fn encode(
9591 self,
9592 encoder: &mut fidl::encoding::Encoder<
9593 '_,
9594 fidl::encoding::DefaultFuchsiaResourceDialect,
9595 >,
9596 offset: usize,
9597 _depth: fidl::encoding::Depth,
9598 ) -> fidl::Result<()> {
9599 encoder.debug_check_bounds::<UnboundedNullableVectorOfHandles>(offset);
9600 fidl::encoding::Encode::<
9602 UnboundedNullableVectorOfHandles,
9603 fidl::encoding::DefaultFuchsiaResourceDialect,
9604 >::encode(
9605 (<fidl::encoding::Optional<
9606 fidl::encoding::UnboundedVector<
9607 fidl::encoding::HandleType<
9608 fidl::Handle,
9609 { fidl::ObjectType::NONE.into_raw() },
9610 2147483648,
9611 >,
9612 >,
9613 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9614 &mut self.vh0
9615 ),),
9616 encoder,
9617 offset,
9618 _depth,
9619 )
9620 }
9621 }
9622 unsafe impl<
9623 T0: fidl::encoding::Encode<
9624 fidl::encoding::Optional<
9625 fidl::encoding::UnboundedVector<
9626 fidl::encoding::HandleType<
9627 fidl::Handle,
9628 { fidl::ObjectType::NONE.into_raw() },
9629 2147483648,
9630 >,
9631 >,
9632 >,
9633 fidl::encoding::DefaultFuchsiaResourceDialect,
9634 >,
9635 >
9636 fidl::encoding::Encode<
9637 UnboundedNullableVectorOfHandles,
9638 fidl::encoding::DefaultFuchsiaResourceDialect,
9639 > for (T0,)
9640 {
9641 #[inline]
9642 unsafe fn encode(
9643 self,
9644 encoder: &mut fidl::encoding::Encoder<
9645 '_,
9646 fidl::encoding::DefaultFuchsiaResourceDialect,
9647 >,
9648 offset: usize,
9649 depth: fidl::encoding::Depth,
9650 ) -> fidl::Result<()> {
9651 encoder.debug_check_bounds::<UnboundedNullableVectorOfHandles>(offset);
9652 self.0.encode(encoder, offset + 0, depth)?;
9656 Ok(())
9657 }
9658 }
9659
9660 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9661 for UnboundedNullableVectorOfHandles
9662 {
9663 #[inline(always)]
9664 fn new_empty() -> Self {
9665 Self {
9666 vh0: fidl::new_empty!(
9667 fidl::encoding::Optional<
9668 fidl::encoding::UnboundedVector<
9669 fidl::encoding::HandleType<
9670 fidl::Handle,
9671 { fidl::ObjectType::NONE.into_raw() },
9672 2147483648,
9673 >,
9674 >,
9675 >,
9676 fidl::encoding::DefaultFuchsiaResourceDialect
9677 ),
9678 }
9679 }
9680
9681 #[inline]
9682 unsafe fn decode(
9683 &mut self,
9684 decoder: &mut fidl::encoding::Decoder<
9685 '_,
9686 fidl::encoding::DefaultFuchsiaResourceDialect,
9687 >,
9688 offset: usize,
9689 _depth: fidl::encoding::Depth,
9690 ) -> fidl::Result<()> {
9691 decoder.debug_check_bounds::<Self>(offset);
9692 fidl::decode!(
9694 fidl::encoding::Optional<
9695 fidl::encoding::UnboundedVector<
9696 fidl::encoding::HandleType<
9697 fidl::Handle,
9698 { fidl::ObjectType::NONE.into_raw() },
9699 2147483648,
9700 >,
9701 >,
9702 >,
9703 fidl::encoding::DefaultFuchsiaResourceDialect,
9704 &mut self.vh0,
9705 decoder,
9706 offset + 0,
9707 _depth
9708 )?;
9709 Ok(())
9710 }
9711 }
9712
9713 impl fidl::encoding::ResourceTypeMarker for UnionOfEndpoints {
9714 type Borrowed<'a> = &'a mut Self;
9715 fn take_or_borrow<'a>(
9716 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9717 ) -> Self::Borrowed<'a> {
9718 value
9719 }
9720 }
9721
9722 unsafe impl fidl::encoding::TypeMarker for UnionOfEndpoints {
9723 type Owned = Self;
9724
9725 #[inline(always)]
9726 fn inline_align(_context: fidl::encoding::Context) -> usize {
9727 8
9728 }
9729
9730 #[inline(always)]
9731 fn inline_size(_context: fidl::encoding::Context) -> usize {
9732 16
9733 }
9734 }
9735
9736 unsafe impl
9737 fidl::encoding::Encode<UnionOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
9738 for &mut UnionOfEndpoints
9739 {
9740 #[inline]
9741 unsafe fn encode(
9742 self,
9743 encoder: &mut fidl::encoding::Encoder<
9744 '_,
9745 fidl::encoding::DefaultFuchsiaResourceDialect,
9746 >,
9747 offset: usize,
9748 _depth: fidl::encoding::Depth,
9749 ) -> fidl::Result<()> {
9750 encoder.debug_check_bounds::<UnionOfEndpoints>(offset);
9751 fidl::encoding::Encode::<UnionOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9753 (
9754 <UnionOfEndpointsUnion as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.u),
9755 ),
9756 encoder, offset, _depth
9757 )
9758 }
9759 }
9760 unsafe impl<
9761 T0: fidl::encoding::Encode<
9762 UnionOfEndpointsUnion,
9763 fidl::encoding::DefaultFuchsiaResourceDialect,
9764 >,
9765 >
9766 fidl::encoding::Encode<UnionOfEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
9767 for (T0,)
9768 {
9769 #[inline]
9770 unsafe fn encode(
9771 self,
9772 encoder: &mut fidl::encoding::Encoder<
9773 '_,
9774 fidl::encoding::DefaultFuchsiaResourceDialect,
9775 >,
9776 offset: usize,
9777 depth: fidl::encoding::Depth,
9778 ) -> fidl::Result<()> {
9779 encoder.debug_check_bounds::<UnionOfEndpoints>(offset);
9780 self.0.encode(encoder, offset + 0, depth)?;
9784 Ok(())
9785 }
9786 }
9787
9788 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9789 for UnionOfEndpoints
9790 {
9791 #[inline(always)]
9792 fn new_empty() -> Self {
9793 Self {
9794 u: fidl::new_empty!(
9795 UnionOfEndpointsUnion,
9796 fidl::encoding::DefaultFuchsiaResourceDialect
9797 ),
9798 }
9799 }
9800
9801 #[inline]
9802 unsafe fn decode(
9803 &mut self,
9804 decoder: &mut fidl::encoding::Decoder<
9805 '_,
9806 fidl::encoding::DefaultFuchsiaResourceDialect,
9807 >,
9808 offset: usize,
9809 _depth: fidl::encoding::Depth,
9810 ) -> fidl::Result<()> {
9811 decoder.debug_check_bounds::<Self>(offset);
9812 fidl::decode!(
9814 UnionOfEndpointsUnion,
9815 fidl::encoding::DefaultFuchsiaResourceDialect,
9816 &mut self.u,
9817 decoder,
9818 offset + 0,
9819 _depth
9820 )?;
9821 Ok(())
9822 }
9823 }
9824
9825 impl fidl::encoding::ResourceTypeMarker for VectorOfArrayOfEventInStructWithDefaultRights {
9826 type Borrowed<'a> = &'a mut Self;
9827 fn take_or_borrow<'a>(
9828 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9829 ) -> Self::Borrowed<'a> {
9830 value
9831 }
9832 }
9833
9834 unsafe impl fidl::encoding::TypeMarker for VectorOfArrayOfEventInStructWithDefaultRights {
9835 type Owned = Self;
9836
9837 #[inline(always)]
9838 fn inline_align(_context: fidl::encoding::Context) -> usize {
9839 8
9840 }
9841
9842 #[inline(always)]
9843 fn inline_size(_context: fidl::encoding::Context) -> usize {
9844 16
9845 }
9846 }
9847
9848 unsafe impl
9849 fidl::encoding::Encode<
9850 VectorOfArrayOfEventInStructWithDefaultRights,
9851 fidl::encoding::DefaultFuchsiaResourceDialect,
9852 > for &mut VectorOfArrayOfEventInStructWithDefaultRights
9853 {
9854 #[inline]
9855 unsafe fn encode(
9856 self,
9857 encoder: &mut fidl::encoding::Encoder<
9858 '_,
9859 fidl::encoding::DefaultFuchsiaResourceDialect,
9860 >,
9861 offset: usize,
9862 _depth: fidl::encoding::Depth,
9863 ) -> fidl::Result<()> {
9864 encoder.debug_check_bounds::<VectorOfArrayOfEventInStructWithDefaultRights>(offset);
9865 fidl::encoding::Encode::<
9867 VectorOfArrayOfEventInStructWithDefaultRights,
9868 fidl::encoding::DefaultFuchsiaResourceDialect,
9869 >::encode(
9870 (<fidl::encoding::Vector<
9871 fidl::encoding::Array<
9872 fidl::encoding::HandleType<
9873 fidl::Event,
9874 { fidl::ObjectType::EVENT.into_raw() },
9875 53251,
9876 >,
9877 1,
9878 >,
9879 1,
9880 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9881 &mut self.h
9882 ),),
9883 encoder,
9884 offset,
9885 _depth,
9886 )
9887 }
9888 }
9889 unsafe impl<
9890 T0: fidl::encoding::Encode<
9891 fidl::encoding::Vector<
9892 fidl::encoding::Array<
9893 fidl::encoding::HandleType<
9894 fidl::Event,
9895 { fidl::ObjectType::EVENT.into_raw() },
9896 53251,
9897 >,
9898 1,
9899 >,
9900 1,
9901 >,
9902 fidl::encoding::DefaultFuchsiaResourceDialect,
9903 >,
9904 >
9905 fidl::encoding::Encode<
9906 VectorOfArrayOfEventInStructWithDefaultRights,
9907 fidl::encoding::DefaultFuchsiaResourceDialect,
9908 > for (T0,)
9909 {
9910 #[inline]
9911 unsafe fn encode(
9912 self,
9913 encoder: &mut fidl::encoding::Encoder<
9914 '_,
9915 fidl::encoding::DefaultFuchsiaResourceDialect,
9916 >,
9917 offset: usize,
9918 depth: fidl::encoding::Depth,
9919 ) -> fidl::Result<()> {
9920 encoder.debug_check_bounds::<VectorOfArrayOfEventInStructWithDefaultRights>(offset);
9921 self.0.encode(encoder, offset + 0, depth)?;
9925 Ok(())
9926 }
9927 }
9928
9929 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9930 for VectorOfArrayOfEventInStructWithDefaultRights
9931 {
9932 #[inline(always)]
9933 fn new_empty() -> Self {
9934 Self {
9935 h: fidl::new_empty!(
9936 fidl::encoding::Vector<
9937 fidl::encoding::Array<
9938 fidl::encoding::HandleType<
9939 fidl::Event,
9940 { fidl::ObjectType::EVENT.into_raw() },
9941 53251,
9942 >,
9943 1,
9944 >,
9945 1,
9946 >,
9947 fidl::encoding::DefaultFuchsiaResourceDialect
9948 ),
9949 }
9950 }
9951
9952 #[inline]
9953 unsafe fn decode(
9954 &mut self,
9955 decoder: &mut fidl::encoding::Decoder<
9956 '_,
9957 fidl::encoding::DefaultFuchsiaResourceDialect,
9958 >,
9959 offset: usize,
9960 _depth: fidl::encoding::Depth,
9961 ) -> fidl::Result<()> {
9962 decoder.debug_check_bounds::<Self>(offset);
9963 fidl::decode!(
9965 fidl::encoding::Vector<
9966 fidl::encoding::Array<
9967 fidl::encoding::HandleType<
9968 fidl::Event,
9969 { fidl::ObjectType::EVENT.into_raw() },
9970 53251,
9971 >,
9972 1,
9973 >,
9974 1,
9975 >,
9976 fidl::encoding::DefaultFuchsiaResourceDialect,
9977 &mut self.h,
9978 decoder,
9979 offset + 0,
9980 _depth
9981 )?;
9982 Ok(())
9983 }
9984 }
9985
9986 impl fidl::encoding::ResourceTypeMarker for VectorOfArrayOfEventInStructWithReducedRights {
9987 type Borrowed<'a> = &'a mut Self;
9988 fn take_or_borrow<'a>(
9989 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9990 ) -> Self::Borrowed<'a> {
9991 value
9992 }
9993 }
9994
9995 unsafe impl fidl::encoding::TypeMarker for VectorOfArrayOfEventInStructWithReducedRights {
9996 type Owned = Self;
9997
9998 #[inline(always)]
9999 fn inline_align(_context: fidl::encoding::Context) -> usize {
10000 8
10001 }
10002
10003 #[inline(always)]
10004 fn inline_size(_context: fidl::encoding::Context) -> usize {
10005 16
10006 }
10007 }
10008
10009 unsafe impl
10010 fidl::encoding::Encode<
10011 VectorOfArrayOfEventInStructWithReducedRights,
10012 fidl::encoding::DefaultFuchsiaResourceDialect,
10013 > for &mut VectorOfArrayOfEventInStructWithReducedRights
10014 {
10015 #[inline]
10016 unsafe fn encode(
10017 self,
10018 encoder: &mut fidl::encoding::Encoder<
10019 '_,
10020 fidl::encoding::DefaultFuchsiaResourceDialect,
10021 >,
10022 offset: usize,
10023 _depth: fidl::encoding::Depth,
10024 ) -> fidl::Result<()> {
10025 encoder.debug_check_bounds::<VectorOfArrayOfEventInStructWithReducedRights>(offset);
10026 fidl::encoding::Encode::<
10028 VectorOfArrayOfEventInStructWithReducedRights,
10029 fidl::encoding::DefaultFuchsiaResourceDialect,
10030 >::encode(
10031 (<fidl::encoding::Vector<
10032 fidl::encoding::Array<
10033 fidl::encoding::HandleType<
10034 fidl::Event,
10035 { fidl::ObjectType::EVENT.into_raw() },
10036 49155,
10037 >,
10038 1,
10039 >,
10040 1,
10041 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10042 &mut self.h
10043 ),),
10044 encoder,
10045 offset,
10046 _depth,
10047 )
10048 }
10049 }
10050 unsafe impl<
10051 T0: fidl::encoding::Encode<
10052 fidl::encoding::Vector<
10053 fidl::encoding::Array<
10054 fidl::encoding::HandleType<
10055 fidl::Event,
10056 { fidl::ObjectType::EVENT.into_raw() },
10057 49155,
10058 >,
10059 1,
10060 >,
10061 1,
10062 >,
10063 fidl::encoding::DefaultFuchsiaResourceDialect,
10064 >,
10065 >
10066 fidl::encoding::Encode<
10067 VectorOfArrayOfEventInStructWithReducedRights,
10068 fidl::encoding::DefaultFuchsiaResourceDialect,
10069 > for (T0,)
10070 {
10071 #[inline]
10072 unsafe fn encode(
10073 self,
10074 encoder: &mut fidl::encoding::Encoder<
10075 '_,
10076 fidl::encoding::DefaultFuchsiaResourceDialect,
10077 >,
10078 offset: usize,
10079 depth: fidl::encoding::Depth,
10080 ) -> fidl::Result<()> {
10081 encoder.debug_check_bounds::<VectorOfArrayOfEventInStructWithReducedRights>(offset);
10082 self.0.encode(encoder, offset + 0, depth)?;
10086 Ok(())
10087 }
10088 }
10089
10090 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10091 for VectorOfArrayOfEventInStructWithReducedRights
10092 {
10093 #[inline(always)]
10094 fn new_empty() -> Self {
10095 Self {
10096 h: fidl::new_empty!(
10097 fidl::encoding::Vector<
10098 fidl::encoding::Array<
10099 fidl::encoding::HandleType<
10100 fidl::Event,
10101 { fidl::ObjectType::EVENT.into_raw() },
10102 49155,
10103 >,
10104 1,
10105 >,
10106 1,
10107 >,
10108 fidl::encoding::DefaultFuchsiaResourceDialect
10109 ),
10110 }
10111 }
10112
10113 #[inline]
10114 unsafe fn decode(
10115 &mut self,
10116 decoder: &mut fidl::encoding::Decoder<
10117 '_,
10118 fidl::encoding::DefaultFuchsiaResourceDialect,
10119 >,
10120 offset: usize,
10121 _depth: fidl::encoding::Depth,
10122 ) -> fidl::Result<()> {
10123 decoder.debug_check_bounds::<Self>(offset);
10124 fidl::decode!(
10126 fidl::encoding::Vector<
10127 fidl::encoding::Array<
10128 fidl::encoding::HandleType<
10129 fidl::Event,
10130 { fidl::ObjectType::EVENT.into_raw() },
10131 49155,
10132 >,
10133 1,
10134 >,
10135 1,
10136 >,
10137 fidl::encoding::DefaultFuchsiaResourceDialect,
10138 &mut self.h,
10139 decoder,
10140 offset + 0,
10141 _depth
10142 )?;
10143 Ok(())
10144 }
10145 }
10146
10147 impl fidl::encoding::ResourceTypeMarker for VectorOfArrayOfEventInTableWithReducedRightsStruct {
10148 type Borrowed<'a> = &'a mut Self;
10149 fn take_or_borrow<'a>(
10150 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10151 ) -> Self::Borrowed<'a> {
10152 value
10153 }
10154 }
10155
10156 unsafe impl fidl::encoding::TypeMarker for VectorOfArrayOfEventInTableWithReducedRightsStruct {
10157 type Owned = Self;
10158
10159 #[inline(always)]
10160 fn inline_align(_context: fidl::encoding::Context) -> usize {
10161 8
10162 }
10163
10164 #[inline(always)]
10165 fn inline_size(_context: fidl::encoding::Context) -> usize {
10166 16
10167 }
10168 }
10169
10170 unsafe impl
10171 fidl::encoding::Encode<
10172 VectorOfArrayOfEventInTableWithReducedRightsStruct,
10173 fidl::encoding::DefaultFuchsiaResourceDialect,
10174 > for &mut VectorOfArrayOfEventInTableWithReducedRightsStruct
10175 {
10176 #[inline]
10177 unsafe fn encode(
10178 self,
10179 encoder: &mut fidl::encoding::Encoder<
10180 '_,
10181 fidl::encoding::DefaultFuchsiaResourceDialect,
10182 >,
10183 offset: usize,
10184 _depth: fidl::encoding::Depth,
10185 ) -> fidl::Result<()> {
10186 encoder
10187 .debug_check_bounds::<VectorOfArrayOfEventInTableWithReducedRightsStruct>(offset);
10188 fidl::encoding::Encode::<VectorOfArrayOfEventInTableWithReducedRightsStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10190 (
10191 <VectorOfArrayOfEventInTableWithReducedRights as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.t),
10192 ),
10193 encoder, offset, _depth
10194 )
10195 }
10196 }
10197 unsafe impl<
10198 T0: fidl::encoding::Encode<
10199 VectorOfArrayOfEventInTableWithReducedRights,
10200 fidl::encoding::DefaultFuchsiaResourceDialect,
10201 >,
10202 >
10203 fidl::encoding::Encode<
10204 VectorOfArrayOfEventInTableWithReducedRightsStruct,
10205 fidl::encoding::DefaultFuchsiaResourceDialect,
10206 > for (T0,)
10207 {
10208 #[inline]
10209 unsafe fn encode(
10210 self,
10211 encoder: &mut fidl::encoding::Encoder<
10212 '_,
10213 fidl::encoding::DefaultFuchsiaResourceDialect,
10214 >,
10215 offset: usize,
10216 depth: fidl::encoding::Depth,
10217 ) -> fidl::Result<()> {
10218 encoder
10219 .debug_check_bounds::<VectorOfArrayOfEventInTableWithReducedRightsStruct>(offset);
10220 self.0.encode(encoder, offset + 0, depth)?;
10224 Ok(())
10225 }
10226 }
10227
10228 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10229 for VectorOfArrayOfEventInTableWithReducedRightsStruct
10230 {
10231 #[inline(always)]
10232 fn new_empty() -> Self {
10233 Self {
10234 t: fidl::new_empty!(
10235 VectorOfArrayOfEventInTableWithReducedRights,
10236 fidl::encoding::DefaultFuchsiaResourceDialect
10237 ),
10238 }
10239 }
10240
10241 #[inline]
10242 unsafe fn decode(
10243 &mut self,
10244 decoder: &mut fidl::encoding::Decoder<
10245 '_,
10246 fidl::encoding::DefaultFuchsiaResourceDialect,
10247 >,
10248 offset: usize,
10249 _depth: fidl::encoding::Depth,
10250 ) -> fidl::Result<()> {
10251 decoder.debug_check_bounds::<Self>(offset);
10252 fidl::decode!(
10254 VectorOfArrayOfEventInTableWithReducedRights,
10255 fidl::encoding::DefaultFuchsiaResourceDialect,
10256 &mut self.t,
10257 decoder,
10258 offset + 0,
10259 _depth
10260 )?;
10261 Ok(())
10262 }
10263 }
10264
10265 impl fidl::encoding::ResourceTypeMarker for VectorOfArrayOfEventInUnionWithReducedRightsStruct {
10266 type Borrowed<'a> = &'a mut Self;
10267 fn take_or_borrow<'a>(
10268 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10269 ) -> Self::Borrowed<'a> {
10270 value
10271 }
10272 }
10273
10274 unsafe impl fidl::encoding::TypeMarker for VectorOfArrayOfEventInUnionWithReducedRightsStruct {
10275 type Owned = Self;
10276
10277 #[inline(always)]
10278 fn inline_align(_context: fidl::encoding::Context) -> usize {
10279 8
10280 }
10281
10282 #[inline(always)]
10283 fn inline_size(_context: fidl::encoding::Context) -> usize {
10284 16
10285 }
10286 }
10287
10288 unsafe impl
10289 fidl::encoding::Encode<
10290 VectorOfArrayOfEventInUnionWithReducedRightsStruct,
10291 fidl::encoding::DefaultFuchsiaResourceDialect,
10292 > for &mut VectorOfArrayOfEventInUnionWithReducedRightsStruct
10293 {
10294 #[inline]
10295 unsafe fn encode(
10296 self,
10297 encoder: &mut fidl::encoding::Encoder<
10298 '_,
10299 fidl::encoding::DefaultFuchsiaResourceDialect,
10300 >,
10301 offset: usize,
10302 _depth: fidl::encoding::Depth,
10303 ) -> fidl::Result<()> {
10304 encoder
10305 .debug_check_bounds::<VectorOfArrayOfEventInUnionWithReducedRightsStruct>(offset);
10306 fidl::encoding::Encode::<VectorOfArrayOfEventInUnionWithReducedRightsStruct, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10308 (
10309 <VectorOfArrayOfEventInUnionWithReducedRights as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.u),
10310 ),
10311 encoder, offset, _depth
10312 )
10313 }
10314 }
10315 unsafe impl<
10316 T0: fidl::encoding::Encode<
10317 VectorOfArrayOfEventInUnionWithReducedRights,
10318 fidl::encoding::DefaultFuchsiaResourceDialect,
10319 >,
10320 >
10321 fidl::encoding::Encode<
10322 VectorOfArrayOfEventInUnionWithReducedRightsStruct,
10323 fidl::encoding::DefaultFuchsiaResourceDialect,
10324 > for (T0,)
10325 {
10326 #[inline]
10327 unsafe fn encode(
10328 self,
10329 encoder: &mut fidl::encoding::Encoder<
10330 '_,
10331 fidl::encoding::DefaultFuchsiaResourceDialect,
10332 >,
10333 offset: usize,
10334 depth: fidl::encoding::Depth,
10335 ) -> fidl::Result<()> {
10336 encoder
10337 .debug_check_bounds::<VectorOfArrayOfEventInUnionWithReducedRightsStruct>(offset);
10338 self.0.encode(encoder, offset + 0, depth)?;
10342 Ok(())
10343 }
10344 }
10345
10346 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10347 for VectorOfArrayOfEventInUnionWithReducedRightsStruct
10348 {
10349 #[inline(always)]
10350 fn new_empty() -> Self {
10351 Self {
10352 u: fidl::new_empty!(
10353 VectorOfArrayOfEventInUnionWithReducedRights,
10354 fidl::encoding::DefaultFuchsiaResourceDialect
10355 ),
10356 }
10357 }
10358
10359 #[inline]
10360 unsafe fn decode(
10361 &mut self,
10362 decoder: &mut fidl::encoding::Decoder<
10363 '_,
10364 fidl::encoding::DefaultFuchsiaResourceDialect,
10365 >,
10366 offset: usize,
10367 _depth: fidl::encoding::Depth,
10368 ) -> fidl::Result<()> {
10369 decoder.debug_check_bounds::<Self>(offset);
10370 fidl::decode!(
10372 VectorOfArrayOfEventInUnionWithReducedRights,
10373 fidl::encoding::DefaultFuchsiaResourceDialect,
10374 &mut self.u,
10375 decoder,
10376 offset + 0,
10377 _depth
10378 )?;
10379 Ok(())
10380 }
10381 }
10382
10383 impl fidl::encoding::ResourceTypeMarker for VectorOfHandles {
10384 type Borrowed<'a> = &'a mut Self;
10385 fn take_or_borrow<'a>(
10386 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10387 ) -> Self::Borrowed<'a> {
10388 value
10389 }
10390 }
10391
10392 unsafe impl fidl::encoding::TypeMarker for VectorOfHandles {
10393 type Owned = Self;
10394
10395 #[inline(always)]
10396 fn inline_align(_context: fidl::encoding::Context) -> usize {
10397 8
10398 }
10399
10400 #[inline(always)]
10401 fn inline_size(_context: fidl::encoding::Context) -> usize {
10402 16
10403 }
10404 }
10405
10406 unsafe impl
10407 fidl::encoding::Encode<VectorOfHandles, fidl::encoding::DefaultFuchsiaResourceDialect>
10408 for &mut VectorOfHandles
10409 {
10410 #[inline]
10411 unsafe fn encode(
10412 self,
10413 encoder: &mut fidl::encoding::Encoder<
10414 '_,
10415 fidl::encoding::DefaultFuchsiaResourceDialect,
10416 >,
10417 offset: usize,
10418 _depth: fidl::encoding::Depth,
10419 ) -> fidl::Result<()> {
10420 encoder.debug_check_bounds::<VectorOfHandles>(offset);
10421 fidl::encoding::Encode::<VectorOfHandles, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10423 (
10424 <fidl::encoding::UnboundedVector<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.v),
10425 ),
10426 encoder, offset, _depth
10427 )
10428 }
10429 }
10430 unsafe impl<
10431 T0: fidl::encoding::Encode<
10432 fidl::encoding::UnboundedVector<
10433 fidl::encoding::HandleType<
10434 fidl::Handle,
10435 { fidl::ObjectType::NONE.into_raw() },
10436 2147483648,
10437 >,
10438 >,
10439 fidl::encoding::DefaultFuchsiaResourceDialect,
10440 >,
10441 > fidl::encoding::Encode<VectorOfHandles, fidl::encoding::DefaultFuchsiaResourceDialect>
10442 for (T0,)
10443 {
10444 #[inline]
10445 unsafe fn encode(
10446 self,
10447 encoder: &mut fidl::encoding::Encoder<
10448 '_,
10449 fidl::encoding::DefaultFuchsiaResourceDialect,
10450 >,
10451 offset: usize,
10452 depth: fidl::encoding::Depth,
10453 ) -> fidl::Result<()> {
10454 encoder.debug_check_bounds::<VectorOfHandles>(offset);
10455 self.0.encode(encoder, offset + 0, depth)?;
10459 Ok(())
10460 }
10461 }
10462
10463 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10464 for VectorOfHandles
10465 {
10466 #[inline(always)]
10467 fn new_empty() -> Self {
10468 Self {
10469 v: fidl::new_empty!(
10470 fidl::encoding::UnboundedVector<
10471 fidl::encoding::HandleType<
10472 fidl::Handle,
10473 { fidl::ObjectType::NONE.into_raw() },
10474 2147483648,
10475 >,
10476 >,
10477 fidl::encoding::DefaultFuchsiaResourceDialect
10478 ),
10479 }
10480 }
10481
10482 #[inline]
10483 unsafe fn decode(
10484 &mut self,
10485 decoder: &mut fidl::encoding::Decoder<
10486 '_,
10487 fidl::encoding::DefaultFuchsiaResourceDialect,
10488 >,
10489 offset: usize,
10490 _depth: fidl::encoding::Depth,
10491 ) -> fidl::Result<()> {
10492 decoder.debug_check_bounds::<Self>(offset);
10493 fidl::decode!(
10495 fidl::encoding::UnboundedVector<
10496 fidl::encoding::HandleType<
10497 fidl::Handle,
10498 { fidl::ObjectType::NONE.into_raw() },
10499 2147483648,
10500 >,
10501 >,
10502 fidl::encoding::DefaultFuchsiaResourceDialect,
10503 &mut self.v,
10504 decoder,
10505 offset + 0,
10506 _depth
10507 )?;
10508 Ok(())
10509 }
10510 }
10511
10512 impl fidl::encoding::ResourceTypeMarker for VectorOfOptionalHandles {
10513 type Borrowed<'a> = &'a mut Self;
10514 fn take_or_borrow<'a>(
10515 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10516 ) -> Self::Borrowed<'a> {
10517 value
10518 }
10519 }
10520
10521 unsafe impl fidl::encoding::TypeMarker for VectorOfOptionalHandles {
10522 type Owned = Self;
10523
10524 #[inline(always)]
10525 fn inline_align(_context: fidl::encoding::Context) -> usize {
10526 8
10527 }
10528
10529 #[inline(always)]
10530 fn inline_size(_context: fidl::encoding::Context) -> usize {
10531 16
10532 }
10533 }
10534
10535 unsafe impl
10536 fidl::encoding::Encode<
10537 VectorOfOptionalHandles,
10538 fidl::encoding::DefaultFuchsiaResourceDialect,
10539 > for &mut VectorOfOptionalHandles
10540 {
10541 #[inline]
10542 unsafe fn encode(
10543 self,
10544 encoder: &mut fidl::encoding::Encoder<
10545 '_,
10546 fidl::encoding::DefaultFuchsiaResourceDialect,
10547 >,
10548 offset: usize,
10549 _depth: fidl::encoding::Depth,
10550 ) -> fidl::Result<()> {
10551 encoder.debug_check_bounds::<VectorOfOptionalHandles>(offset);
10552 fidl::encoding::Encode::<
10554 VectorOfOptionalHandles,
10555 fidl::encoding::DefaultFuchsiaResourceDialect,
10556 >::encode(
10557 (<fidl::encoding::UnboundedVector<
10558 fidl::encoding::Optional<
10559 fidl::encoding::HandleType<
10560 fidl::Handle,
10561 { fidl::ObjectType::NONE.into_raw() },
10562 2147483648,
10563 >,
10564 >,
10565 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10566 &mut self.v
10567 ),),
10568 encoder,
10569 offset,
10570 _depth,
10571 )
10572 }
10573 }
10574 unsafe impl<
10575 T0: fidl::encoding::Encode<
10576 fidl::encoding::UnboundedVector<
10577 fidl::encoding::Optional<
10578 fidl::encoding::HandleType<
10579 fidl::Handle,
10580 { fidl::ObjectType::NONE.into_raw() },
10581 2147483648,
10582 >,
10583 >,
10584 >,
10585 fidl::encoding::DefaultFuchsiaResourceDialect,
10586 >,
10587 >
10588 fidl::encoding::Encode<
10589 VectorOfOptionalHandles,
10590 fidl::encoding::DefaultFuchsiaResourceDialect,
10591 > for (T0,)
10592 {
10593 #[inline]
10594 unsafe fn encode(
10595 self,
10596 encoder: &mut fidl::encoding::Encoder<
10597 '_,
10598 fidl::encoding::DefaultFuchsiaResourceDialect,
10599 >,
10600 offset: usize,
10601 depth: fidl::encoding::Depth,
10602 ) -> fidl::Result<()> {
10603 encoder.debug_check_bounds::<VectorOfOptionalHandles>(offset);
10604 self.0.encode(encoder, offset + 0, depth)?;
10608 Ok(())
10609 }
10610 }
10611
10612 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10613 for VectorOfOptionalHandles
10614 {
10615 #[inline(always)]
10616 fn new_empty() -> Self {
10617 Self {
10618 v: fidl::new_empty!(
10619 fidl::encoding::UnboundedVector<
10620 fidl::encoding::Optional<
10621 fidl::encoding::HandleType<
10622 fidl::Handle,
10623 { fidl::ObjectType::NONE.into_raw() },
10624 2147483648,
10625 >,
10626 >,
10627 >,
10628 fidl::encoding::DefaultFuchsiaResourceDialect
10629 ),
10630 }
10631 }
10632
10633 #[inline]
10634 unsafe fn decode(
10635 &mut self,
10636 decoder: &mut fidl::encoding::Decoder<
10637 '_,
10638 fidl::encoding::DefaultFuchsiaResourceDialect,
10639 >,
10640 offset: usize,
10641 _depth: fidl::encoding::Depth,
10642 ) -> fidl::Result<()> {
10643 decoder.debug_check_bounds::<Self>(offset);
10644 fidl::decode!(
10646 fidl::encoding::UnboundedVector<
10647 fidl::encoding::Optional<
10648 fidl::encoding::HandleType<
10649 fidl::Handle,
10650 { fidl::ObjectType::NONE.into_raw() },
10651 2147483648,
10652 >,
10653 >,
10654 >,
10655 fidl::encoding::DefaultFuchsiaResourceDialect,
10656 &mut self.v,
10657 decoder,
10658 offset + 0,
10659 _depth
10660 )?;
10661 Ok(())
10662 }
10663 }
10664
10665 impl fidl::encoding::ResourceTypeMarker for VectorOfUpTo2Handles {
10666 type Borrowed<'a> = &'a mut Self;
10667 fn take_or_borrow<'a>(
10668 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10669 ) -> Self::Borrowed<'a> {
10670 value
10671 }
10672 }
10673
10674 unsafe impl fidl::encoding::TypeMarker for VectorOfUpTo2Handles {
10675 type Owned = Self;
10676
10677 #[inline(always)]
10678 fn inline_align(_context: fidl::encoding::Context) -> usize {
10679 8
10680 }
10681
10682 #[inline(always)]
10683 fn inline_size(_context: fidl::encoding::Context) -> usize {
10684 16
10685 }
10686 }
10687
10688 unsafe impl
10689 fidl::encoding::Encode<VectorOfUpTo2Handles, fidl::encoding::DefaultFuchsiaResourceDialect>
10690 for &mut VectorOfUpTo2Handles
10691 {
10692 #[inline]
10693 unsafe fn encode(
10694 self,
10695 encoder: &mut fidl::encoding::Encoder<
10696 '_,
10697 fidl::encoding::DefaultFuchsiaResourceDialect,
10698 >,
10699 offset: usize,
10700 _depth: fidl::encoding::Depth,
10701 ) -> fidl::Result<()> {
10702 encoder.debug_check_bounds::<VectorOfUpTo2Handles>(offset);
10703 fidl::encoding::Encode::<
10705 VectorOfUpTo2Handles,
10706 fidl::encoding::DefaultFuchsiaResourceDialect,
10707 >::encode(
10708 (<fidl::encoding::Vector<
10709 fidl::encoding::HandleType<
10710 fidl::Handle,
10711 { fidl::ObjectType::NONE.into_raw() },
10712 2147483648,
10713 >,
10714 2,
10715 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10716 &mut self.v
10717 ),),
10718 encoder,
10719 offset,
10720 _depth,
10721 )
10722 }
10723 }
10724 unsafe impl<
10725 T0: fidl::encoding::Encode<
10726 fidl::encoding::Vector<
10727 fidl::encoding::HandleType<
10728 fidl::Handle,
10729 { fidl::ObjectType::NONE.into_raw() },
10730 2147483648,
10731 >,
10732 2,
10733 >,
10734 fidl::encoding::DefaultFuchsiaResourceDialect,
10735 >,
10736 >
10737 fidl::encoding::Encode<VectorOfUpTo2Handles, fidl::encoding::DefaultFuchsiaResourceDialect>
10738 for (T0,)
10739 {
10740 #[inline]
10741 unsafe fn encode(
10742 self,
10743 encoder: &mut fidl::encoding::Encoder<
10744 '_,
10745 fidl::encoding::DefaultFuchsiaResourceDialect,
10746 >,
10747 offset: usize,
10748 depth: fidl::encoding::Depth,
10749 ) -> fidl::Result<()> {
10750 encoder.debug_check_bounds::<VectorOfUpTo2Handles>(offset);
10751 self.0.encode(encoder, offset + 0, depth)?;
10755 Ok(())
10756 }
10757 }
10758
10759 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10760 for VectorOfUpTo2Handles
10761 {
10762 #[inline(always)]
10763 fn new_empty() -> Self {
10764 Self {
10765 v: fidl::new_empty!(
10766 fidl::encoding::Vector<
10767 fidl::encoding::HandleType<
10768 fidl::Handle,
10769 { fidl::ObjectType::NONE.into_raw() },
10770 2147483648,
10771 >,
10772 2,
10773 >,
10774 fidl::encoding::DefaultFuchsiaResourceDialect
10775 ),
10776 }
10777 }
10778
10779 #[inline]
10780 unsafe fn decode(
10781 &mut self,
10782 decoder: &mut fidl::encoding::Decoder<
10783 '_,
10784 fidl::encoding::DefaultFuchsiaResourceDialect,
10785 >,
10786 offset: usize,
10787 _depth: fidl::encoding::Depth,
10788 ) -> fidl::Result<()> {
10789 decoder.debug_check_bounds::<Self>(offset);
10790 fidl::decode!(
10792 fidl::encoding::Vector<
10793 fidl::encoding::HandleType<
10794 fidl::Handle,
10795 { fidl::ObjectType::NONE.into_raw() },
10796 2147483648,
10797 >,
10798 2,
10799 >,
10800 fidl::encoding::DefaultFuchsiaResourceDialect,
10801 &mut self.v,
10802 decoder,
10803 offset + 0,
10804 _depth
10805 )?;
10806 Ok(())
10807 }
10808 }
10809
10810 impl ArrayOfVectorOfEventInTableWithDefaultRights {
10811 #[inline(always)]
10812 fn max_ordinal_present(&self) -> u64 {
10813 if let Some(_) = self.h {
10814 return 1;
10815 }
10816 0
10817 }
10818 }
10819
10820 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInTableWithDefaultRights {
10821 type Borrowed<'a> = &'a mut Self;
10822 fn take_or_borrow<'a>(
10823 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10824 ) -> Self::Borrowed<'a> {
10825 value
10826 }
10827 }
10828
10829 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInTableWithDefaultRights {
10830 type Owned = Self;
10831
10832 #[inline(always)]
10833 fn inline_align(_context: fidl::encoding::Context) -> usize {
10834 8
10835 }
10836
10837 #[inline(always)]
10838 fn inline_size(_context: fidl::encoding::Context) -> usize {
10839 16
10840 }
10841 }
10842
10843 unsafe impl
10844 fidl::encoding::Encode<
10845 ArrayOfVectorOfEventInTableWithDefaultRights,
10846 fidl::encoding::DefaultFuchsiaResourceDialect,
10847 > for &mut ArrayOfVectorOfEventInTableWithDefaultRights
10848 {
10849 unsafe fn encode(
10850 self,
10851 encoder: &mut fidl::encoding::Encoder<
10852 '_,
10853 fidl::encoding::DefaultFuchsiaResourceDialect,
10854 >,
10855 offset: usize,
10856 mut depth: fidl::encoding::Depth,
10857 ) -> fidl::Result<()> {
10858 encoder.debug_check_bounds::<ArrayOfVectorOfEventInTableWithDefaultRights>(offset);
10859 let max_ordinal: u64 = self.max_ordinal_present();
10861 encoder.write_num(max_ordinal, offset);
10862 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10863 if max_ordinal == 0 {
10865 return Ok(());
10866 }
10867 depth.increment()?;
10868 let envelope_size = 8;
10869 let bytes_len = max_ordinal as usize * envelope_size;
10870 #[allow(unused_variables)]
10871 let offset = encoder.out_of_line_offset(bytes_len);
10872 let mut _prev_end_offset: usize = 0;
10873 if 1 > max_ordinal {
10874 return Ok(());
10875 }
10876
10877 let cur_offset: usize = (1 - 1) * envelope_size;
10880
10881 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10883
10884 fidl::encoding::encode_in_envelope_optional::<
10889 fidl::encoding::Array<
10890 fidl::encoding::Vector<
10891 fidl::encoding::HandleType<
10892 fidl::Event,
10893 { fidl::ObjectType::EVENT.into_raw() },
10894 53251,
10895 >,
10896 1,
10897 >,
10898 1,
10899 >,
10900 fidl::encoding::DefaultFuchsiaResourceDialect,
10901 >(
10902 self.h.as_mut().map(
10903 <fidl::encoding::Array<
10904 fidl::encoding::Vector<
10905 fidl::encoding::HandleType<
10906 fidl::Event,
10907 { fidl::ObjectType::EVENT.into_raw() },
10908 53251,
10909 >,
10910 1,
10911 >,
10912 1,
10913 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10914 ),
10915 encoder,
10916 offset + cur_offset,
10917 depth,
10918 )?;
10919
10920 _prev_end_offset = cur_offset + envelope_size;
10921
10922 Ok(())
10923 }
10924 }
10925
10926 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10927 for ArrayOfVectorOfEventInTableWithDefaultRights
10928 {
10929 #[inline(always)]
10930 fn new_empty() -> Self {
10931 Self::default()
10932 }
10933
10934 unsafe fn decode(
10935 &mut self,
10936 decoder: &mut fidl::encoding::Decoder<
10937 '_,
10938 fidl::encoding::DefaultFuchsiaResourceDialect,
10939 >,
10940 offset: usize,
10941 mut depth: fidl::encoding::Depth,
10942 ) -> fidl::Result<()> {
10943 decoder.debug_check_bounds::<Self>(offset);
10944 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10945 None => return Err(fidl::Error::NotNullable),
10946 Some(len) => len,
10947 };
10948 if len == 0 {
10950 return Ok(());
10951 };
10952 depth.increment()?;
10953 let envelope_size = 8;
10954 let bytes_len = len * envelope_size;
10955 let offset = decoder.out_of_line_offset(bytes_len)?;
10956 let mut _next_ordinal_to_read = 0;
10958 let mut next_offset = offset;
10959 let end_offset = offset + bytes_len;
10960 _next_ordinal_to_read += 1;
10961 if next_offset >= end_offset {
10962 return Ok(());
10963 }
10964
10965 while _next_ordinal_to_read < 1 {
10967 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10968 _next_ordinal_to_read += 1;
10969 next_offset += envelope_size;
10970 }
10971
10972 let next_out_of_line = decoder.next_out_of_line();
10973 let handles_before = decoder.remaining_handles();
10974 if let Some((inlined, num_bytes, num_handles)) =
10975 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10976 {
10977 let member_inline_size = <fidl::encoding::Array<
10978 fidl::encoding::Vector<
10979 fidl::encoding::HandleType<
10980 fidl::Event,
10981 { fidl::ObjectType::EVENT.into_raw() },
10982 53251,
10983 >,
10984 1,
10985 >,
10986 1,
10987 > as fidl::encoding::TypeMarker>::inline_size(
10988 decoder.context
10989 );
10990 if inlined != (member_inline_size <= 4) {
10991 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10992 }
10993 let inner_offset;
10994 let mut inner_depth = depth.clone();
10995 if inlined {
10996 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10997 inner_offset = next_offset;
10998 } else {
10999 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11000 inner_depth.increment()?;
11001 }
11002 let val_ref = self.h.get_or_insert_with(|| {
11003 fidl::new_empty!(
11004 fidl::encoding::Array<
11005 fidl::encoding::Vector<
11006 fidl::encoding::HandleType<
11007 fidl::Event,
11008 { fidl::ObjectType::EVENT.into_raw() },
11009 53251,
11010 >,
11011 1,
11012 >,
11013 1,
11014 >,
11015 fidl::encoding::DefaultFuchsiaResourceDialect
11016 )
11017 });
11018 fidl::decode!(
11019 fidl::encoding::Array<
11020 fidl::encoding::Vector<
11021 fidl::encoding::HandleType<
11022 fidl::Event,
11023 { fidl::ObjectType::EVENT.into_raw() },
11024 53251,
11025 >,
11026 1,
11027 >,
11028 1,
11029 >,
11030 fidl::encoding::DefaultFuchsiaResourceDialect,
11031 val_ref,
11032 decoder,
11033 inner_offset,
11034 inner_depth
11035 )?;
11036 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11037 {
11038 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11039 }
11040 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11041 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11042 }
11043 }
11044
11045 next_offset += envelope_size;
11046
11047 while next_offset < end_offset {
11049 _next_ordinal_to_read += 1;
11050 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11051 next_offset += envelope_size;
11052 }
11053
11054 Ok(())
11055 }
11056 }
11057
11058 impl ArrayOfVectorOfEventInTableWithReducedRights {
11059 #[inline(always)]
11060 fn max_ordinal_present(&self) -> u64 {
11061 if let Some(_) = self.h {
11062 return 1;
11063 }
11064 0
11065 }
11066 }
11067
11068 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInTableWithReducedRights {
11069 type Borrowed<'a> = &'a mut Self;
11070 fn take_or_borrow<'a>(
11071 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11072 ) -> Self::Borrowed<'a> {
11073 value
11074 }
11075 }
11076
11077 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInTableWithReducedRights {
11078 type Owned = Self;
11079
11080 #[inline(always)]
11081 fn inline_align(_context: fidl::encoding::Context) -> usize {
11082 8
11083 }
11084
11085 #[inline(always)]
11086 fn inline_size(_context: fidl::encoding::Context) -> usize {
11087 16
11088 }
11089 }
11090
11091 unsafe impl
11092 fidl::encoding::Encode<
11093 ArrayOfVectorOfEventInTableWithReducedRights,
11094 fidl::encoding::DefaultFuchsiaResourceDialect,
11095 > for &mut ArrayOfVectorOfEventInTableWithReducedRights
11096 {
11097 unsafe fn encode(
11098 self,
11099 encoder: &mut fidl::encoding::Encoder<
11100 '_,
11101 fidl::encoding::DefaultFuchsiaResourceDialect,
11102 >,
11103 offset: usize,
11104 mut depth: fidl::encoding::Depth,
11105 ) -> fidl::Result<()> {
11106 encoder.debug_check_bounds::<ArrayOfVectorOfEventInTableWithReducedRights>(offset);
11107 let max_ordinal: u64 = self.max_ordinal_present();
11109 encoder.write_num(max_ordinal, offset);
11110 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11111 if max_ordinal == 0 {
11113 return Ok(());
11114 }
11115 depth.increment()?;
11116 let envelope_size = 8;
11117 let bytes_len = max_ordinal as usize * envelope_size;
11118 #[allow(unused_variables)]
11119 let offset = encoder.out_of_line_offset(bytes_len);
11120 let mut _prev_end_offset: usize = 0;
11121 if 1 > max_ordinal {
11122 return Ok(());
11123 }
11124
11125 let cur_offset: usize = (1 - 1) * envelope_size;
11128
11129 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11131
11132 fidl::encoding::encode_in_envelope_optional::<
11137 fidl::encoding::Array<
11138 fidl::encoding::Vector<
11139 fidl::encoding::HandleType<
11140 fidl::Event,
11141 { fidl::ObjectType::EVENT.into_raw() },
11142 49155,
11143 >,
11144 1,
11145 >,
11146 1,
11147 >,
11148 fidl::encoding::DefaultFuchsiaResourceDialect,
11149 >(
11150 self.h.as_mut().map(
11151 <fidl::encoding::Array<
11152 fidl::encoding::Vector<
11153 fidl::encoding::HandleType<
11154 fidl::Event,
11155 { fidl::ObjectType::EVENT.into_raw() },
11156 49155,
11157 >,
11158 1,
11159 >,
11160 1,
11161 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11162 ),
11163 encoder,
11164 offset + cur_offset,
11165 depth,
11166 )?;
11167
11168 _prev_end_offset = cur_offset + envelope_size;
11169
11170 Ok(())
11171 }
11172 }
11173
11174 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11175 for ArrayOfVectorOfEventInTableWithReducedRights
11176 {
11177 #[inline(always)]
11178 fn new_empty() -> Self {
11179 Self::default()
11180 }
11181
11182 unsafe fn decode(
11183 &mut self,
11184 decoder: &mut fidl::encoding::Decoder<
11185 '_,
11186 fidl::encoding::DefaultFuchsiaResourceDialect,
11187 >,
11188 offset: usize,
11189 mut depth: fidl::encoding::Depth,
11190 ) -> fidl::Result<()> {
11191 decoder.debug_check_bounds::<Self>(offset);
11192 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11193 None => return Err(fidl::Error::NotNullable),
11194 Some(len) => len,
11195 };
11196 if len == 0 {
11198 return Ok(());
11199 };
11200 depth.increment()?;
11201 let envelope_size = 8;
11202 let bytes_len = len * envelope_size;
11203 let offset = decoder.out_of_line_offset(bytes_len)?;
11204 let mut _next_ordinal_to_read = 0;
11206 let mut next_offset = offset;
11207 let end_offset = offset + bytes_len;
11208 _next_ordinal_to_read += 1;
11209 if next_offset >= end_offset {
11210 return Ok(());
11211 }
11212
11213 while _next_ordinal_to_read < 1 {
11215 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11216 _next_ordinal_to_read += 1;
11217 next_offset += envelope_size;
11218 }
11219
11220 let next_out_of_line = decoder.next_out_of_line();
11221 let handles_before = decoder.remaining_handles();
11222 if let Some((inlined, num_bytes, num_handles)) =
11223 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11224 {
11225 let member_inline_size = <fidl::encoding::Array<
11226 fidl::encoding::Vector<
11227 fidl::encoding::HandleType<
11228 fidl::Event,
11229 { fidl::ObjectType::EVENT.into_raw() },
11230 49155,
11231 >,
11232 1,
11233 >,
11234 1,
11235 > as fidl::encoding::TypeMarker>::inline_size(
11236 decoder.context
11237 );
11238 if inlined != (member_inline_size <= 4) {
11239 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11240 }
11241 let inner_offset;
11242 let mut inner_depth = depth.clone();
11243 if inlined {
11244 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11245 inner_offset = next_offset;
11246 } else {
11247 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11248 inner_depth.increment()?;
11249 }
11250 let val_ref = self.h.get_or_insert_with(|| {
11251 fidl::new_empty!(
11252 fidl::encoding::Array<
11253 fidl::encoding::Vector<
11254 fidl::encoding::HandleType<
11255 fidl::Event,
11256 { fidl::ObjectType::EVENT.into_raw() },
11257 49155,
11258 >,
11259 1,
11260 >,
11261 1,
11262 >,
11263 fidl::encoding::DefaultFuchsiaResourceDialect
11264 )
11265 });
11266 fidl::decode!(
11267 fidl::encoding::Array<
11268 fidl::encoding::Vector<
11269 fidl::encoding::HandleType<
11270 fidl::Event,
11271 { fidl::ObjectType::EVENT.into_raw() },
11272 49155,
11273 >,
11274 1,
11275 >,
11276 1,
11277 >,
11278 fidl::encoding::DefaultFuchsiaResourceDialect,
11279 val_ref,
11280 decoder,
11281 inner_offset,
11282 inner_depth
11283 )?;
11284 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11285 {
11286 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11287 }
11288 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11289 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11290 }
11291 }
11292
11293 next_offset += envelope_size;
11294
11295 while next_offset < end_offset {
11297 _next_ordinal_to_read += 1;
11298 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11299 next_offset += envelope_size;
11300 }
11301
11302 Ok(())
11303 }
11304 }
11305
11306 impl EmptyResourceTable {
11307 #[inline(always)]
11308 fn max_ordinal_present(&self) -> u64 {
11309 0
11310 }
11311 }
11312
11313 impl fidl::encoding::ResourceTypeMarker for EmptyResourceTable {
11314 type Borrowed<'a> = &'a mut Self;
11315 fn take_or_borrow<'a>(
11316 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11317 ) -> Self::Borrowed<'a> {
11318 value
11319 }
11320 }
11321
11322 unsafe impl fidl::encoding::TypeMarker for EmptyResourceTable {
11323 type Owned = Self;
11324
11325 #[inline(always)]
11326 fn inline_align(_context: fidl::encoding::Context) -> usize {
11327 8
11328 }
11329
11330 #[inline(always)]
11331 fn inline_size(_context: fidl::encoding::Context) -> usize {
11332 16
11333 }
11334 }
11335
11336 unsafe impl
11337 fidl::encoding::Encode<EmptyResourceTable, fidl::encoding::DefaultFuchsiaResourceDialect>
11338 for &mut EmptyResourceTable
11339 {
11340 unsafe fn encode(
11341 self,
11342 encoder: &mut fidl::encoding::Encoder<
11343 '_,
11344 fidl::encoding::DefaultFuchsiaResourceDialect,
11345 >,
11346 offset: usize,
11347 mut depth: fidl::encoding::Depth,
11348 ) -> fidl::Result<()> {
11349 encoder.debug_check_bounds::<EmptyResourceTable>(offset);
11350 let max_ordinal: u64 = self.max_ordinal_present();
11352 encoder.write_num(max_ordinal, offset);
11353 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11354 if max_ordinal == 0 {
11356 return Ok(());
11357 }
11358 depth.increment()?;
11359 let envelope_size = 8;
11360 let bytes_len = max_ordinal as usize * envelope_size;
11361 #[allow(unused_variables)]
11362 let offset = encoder.out_of_line_offset(bytes_len);
11363 let mut _prev_end_offset: usize = 0;
11364
11365 Ok(())
11366 }
11367 }
11368
11369 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11370 for EmptyResourceTable
11371 {
11372 #[inline(always)]
11373 fn new_empty() -> Self {
11374 Self::default()
11375 }
11376
11377 unsafe fn decode(
11378 &mut self,
11379 decoder: &mut fidl::encoding::Decoder<
11380 '_,
11381 fidl::encoding::DefaultFuchsiaResourceDialect,
11382 >,
11383 offset: usize,
11384 mut depth: fidl::encoding::Depth,
11385 ) -> fidl::Result<()> {
11386 decoder.debug_check_bounds::<Self>(offset);
11387 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11388 None => return Err(fidl::Error::NotNullable),
11389 Some(len) => len,
11390 };
11391 if len == 0 {
11393 return Ok(());
11394 };
11395 depth.increment()?;
11396 let envelope_size = 8;
11397 let bytes_len = len * envelope_size;
11398 let offset = decoder.out_of_line_offset(bytes_len)?;
11399 let mut _next_ordinal_to_read = 0;
11401 let mut next_offset = offset;
11402 let end_offset = offset + bytes_len;
11403
11404 while next_offset < end_offset {
11406 _next_ordinal_to_read += 1;
11407 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11408 next_offset += envelope_size;
11409 }
11410
11411 Ok(())
11412 }
11413 }
11414
11415 impl SimpleResourceTable {
11416 #[inline(always)]
11417 fn max_ordinal_present(&self) -> u64 {
11418 if let Some(_) = self.y {
11419 return 5;
11420 }
11421 if let Some(_) = self.x {
11422 return 1;
11423 }
11424 0
11425 }
11426 }
11427
11428 impl fidl::encoding::ResourceTypeMarker for SimpleResourceTable {
11429 type Borrowed<'a> = &'a mut Self;
11430 fn take_or_borrow<'a>(
11431 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11432 ) -> Self::Borrowed<'a> {
11433 value
11434 }
11435 }
11436
11437 unsafe impl fidl::encoding::TypeMarker for SimpleResourceTable {
11438 type Owned = Self;
11439
11440 #[inline(always)]
11441 fn inline_align(_context: fidl::encoding::Context) -> usize {
11442 8
11443 }
11444
11445 #[inline(always)]
11446 fn inline_size(_context: fidl::encoding::Context) -> usize {
11447 16
11448 }
11449 }
11450
11451 unsafe impl
11452 fidl::encoding::Encode<SimpleResourceTable, fidl::encoding::DefaultFuchsiaResourceDialect>
11453 for &mut SimpleResourceTable
11454 {
11455 unsafe fn encode(
11456 self,
11457 encoder: &mut fidl::encoding::Encoder<
11458 '_,
11459 fidl::encoding::DefaultFuchsiaResourceDialect,
11460 >,
11461 offset: usize,
11462 mut depth: fidl::encoding::Depth,
11463 ) -> fidl::Result<()> {
11464 encoder.debug_check_bounds::<SimpleResourceTable>(offset);
11465 let max_ordinal: u64 = self.max_ordinal_present();
11467 encoder.write_num(max_ordinal, offset);
11468 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11469 if max_ordinal == 0 {
11471 return Ok(());
11472 }
11473 depth.increment()?;
11474 let envelope_size = 8;
11475 let bytes_len = max_ordinal as usize * envelope_size;
11476 #[allow(unused_variables)]
11477 let offset = encoder.out_of_line_offset(bytes_len);
11478 let mut _prev_end_offset: usize = 0;
11479 if 1 > max_ordinal {
11480 return Ok(());
11481 }
11482
11483 let cur_offset: usize = (1 - 1) * envelope_size;
11486
11487 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11489
11490 fidl::encoding::encode_in_envelope_optional::<
11495 i64,
11496 fidl::encoding::DefaultFuchsiaResourceDialect,
11497 >(
11498 self.x.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
11499 encoder,
11500 offset + cur_offset,
11501 depth,
11502 )?;
11503
11504 _prev_end_offset = cur_offset + envelope_size;
11505 if 5 > max_ordinal {
11506 return Ok(());
11507 }
11508
11509 let cur_offset: usize = (5 - 1) * envelope_size;
11512
11513 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11515
11516 fidl::encoding::encode_in_envelope_optional::<
11521 i64,
11522 fidl::encoding::DefaultFuchsiaResourceDialect,
11523 >(
11524 self.y.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
11525 encoder,
11526 offset + cur_offset,
11527 depth,
11528 )?;
11529
11530 _prev_end_offset = cur_offset + envelope_size;
11531
11532 Ok(())
11533 }
11534 }
11535
11536 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11537 for SimpleResourceTable
11538 {
11539 #[inline(always)]
11540 fn new_empty() -> Self {
11541 Self::default()
11542 }
11543
11544 unsafe fn decode(
11545 &mut self,
11546 decoder: &mut fidl::encoding::Decoder<
11547 '_,
11548 fidl::encoding::DefaultFuchsiaResourceDialect,
11549 >,
11550 offset: usize,
11551 mut depth: fidl::encoding::Depth,
11552 ) -> fidl::Result<()> {
11553 decoder.debug_check_bounds::<Self>(offset);
11554 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11555 None => return Err(fidl::Error::NotNullable),
11556 Some(len) => len,
11557 };
11558 if len == 0 {
11560 return Ok(());
11561 };
11562 depth.increment()?;
11563 let envelope_size = 8;
11564 let bytes_len = len * envelope_size;
11565 let offset = decoder.out_of_line_offset(bytes_len)?;
11566 let mut _next_ordinal_to_read = 0;
11568 let mut next_offset = offset;
11569 let end_offset = offset + bytes_len;
11570 _next_ordinal_to_read += 1;
11571 if next_offset >= end_offset {
11572 return Ok(());
11573 }
11574
11575 while _next_ordinal_to_read < 1 {
11577 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11578 _next_ordinal_to_read += 1;
11579 next_offset += envelope_size;
11580 }
11581
11582 let next_out_of_line = decoder.next_out_of_line();
11583 let handles_before = decoder.remaining_handles();
11584 if let Some((inlined, num_bytes, num_handles)) =
11585 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11586 {
11587 let member_inline_size =
11588 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11589 if inlined != (member_inline_size <= 4) {
11590 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11591 }
11592 let inner_offset;
11593 let mut inner_depth = depth.clone();
11594 if inlined {
11595 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11596 inner_offset = next_offset;
11597 } else {
11598 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11599 inner_depth.increment()?;
11600 }
11601 let val_ref = self.x.get_or_insert_with(|| {
11602 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
11603 });
11604 fidl::decode!(
11605 i64,
11606 fidl::encoding::DefaultFuchsiaResourceDialect,
11607 val_ref,
11608 decoder,
11609 inner_offset,
11610 inner_depth
11611 )?;
11612 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11613 {
11614 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11615 }
11616 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11617 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11618 }
11619 }
11620
11621 next_offset += envelope_size;
11622 _next_ordinal_to_read += 1;
11623 if next_offset >= end_offset {
11624 return Ok(());
11625 }
11626
11627 while _next_ordinal_to_read < 5 {
11629 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11630 _next_ordinal_to_read += 1;
11631 next_offset += envelope_size;
11632 }
11633
11634 let next_out_of_line = decoder.next_out_of_line();
11635 let handles_before = decoder.remaining_handles();
11636 if let Some((inlined, num_bytes, num_handles)) =
11637 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11638 {
11639 let member_inline_size =
11640 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11641 if inlined != (member_inline_size <= 4) {
11642 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11643 }
11644 let inner_offset;
11645 let mut inner_depth = depth.clone();
11646 if inlined {
11647 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11648 inner_offset = next_offset;
11649 } else {
11650 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11651 inner_depth.increment()?;
11652 }
11653 let val_ref = self.y.get_or_insert_with(|| {
11654 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
11655 });
11656 fidl::decode!(
11657 i64,
11658 fidl::encoding::DefaultFuchsiaResourceDialect,
11659 val_ref,
11660 decoder,
11661 inner_offset,
11662 inner_depth
11663 )?;
11664 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11665 {
11666 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11667 }
11668 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11669 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11670 }
11671 }
11672
11673 next_offset += envelope_size;
11674
11675 while next_offset < end_offset {
11677 _next_ordinal_to_read += 1;
11678 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11679 next_offset += envelope_size;
11680 }
11681
11682 Ok(())
11683 }
11684 }
11685
11686 impl TableFieldInlinedHandle {
11687 #[inline(always)]
11688 fn max_ordinal_present(&self) -> u64 {
11689 if let Some(_) = self.f {
11690 return 1;
11691 }
11692 0
11693 }
11694 }
11695
11696 impl fidl::encoding::ResourceTypeMarker for TableFieldInlinedHandle {
11697 type Borrowed<'a> = &'a mut Self;
11698 fn take_or_borrow<'a>(
11699 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11700 ) -> Self::Borrowed<'a> {
11701 value
11702 }
11703 }
11704
11705 unsafe impl fidl::encoding::TypeMarker for TableFieldInlinedHandle {
11706 type Owned = Self;
11707
11708 #[inline(always)]
11709 fn inline_align(_context: fidl::encoding::Context) -> usize {
11710 8
11711 }
11712
11713 #[inline(always)]
11714 fn inline_size(_context: fidl::encoding::Context) -> usize {
11715 16
11716 }
11717 }
11718
11719 unsafe impl
11720 fidl::encoding::Encode<
11721 TableFieldInlinedHandle,
11722 fidl::encoding::DefaultFuchsiaResourceDialect,
11723 > for &mut TableFieldInlinedHandle
11724 {
11725 unsafe fn encode(
11726 self,
11727 encoder: &mut fidl::encoding::Encoder<
11728 '_,
11729 fidl::encoding::DefaultFuchsiaResourceDialect,
11730 >,
11731 offset: usize,
11732 mut depth: fidl::encoding::Depth,
11733 ) -> fidl::Result<()> {
11734 encoder.debug_check_bounds::<TableFieldInlinedHandle>(offset);
11735 let max_ordinal: u64 = self.max_ordinal_present();
11737 encoder.write_num(max_ordinal, offset);
11738 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11739 if max_ordinal == 0 {
11741 return Ok(());
11742 }
11743 depth.increment()?;
11744 let envelope_size = 8;
11745 let bytes_len = max_ordinal as usize * envelope_size;
11746 #[allow(unused_variables)]
11747 let offset = encoder.out_of_line_offset(bytes_len);
11748 let mut _prev_end_offset: usize = 0;
11749 if 1 > max_ordinal {
11750 return Ok(());
11751 }
11752
11753 let cur_offset: usize = (1 - 1) * envelope_size;
11756
11757 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11759
11760 fidl::encoding::encode_in_envelope_optional::<
11765 fidl::encoding::HandleType<
11766 fidl::Channel,
11767 { fidl::ObjectType::CHANNEL.into_raw() },
11768 2147483648,
11769 >,
11770 fidl::encoding::DefaultFuchsiaResourceDialect,
11771 >(
11772 self.f.as_mut().map(
11773 <fidl::encoding::HandleType<
11774 fidl::Channel,
11775 { fidl::ObjectType::CHANNEL.into_raw() },
11776 2147483648,
11777 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11778 ),
11779 encoder,
11780 offset + cur_offset,
11781 depth,
11782 )?;
11783
11784 _prev_end_offset = cur_offset + envelope_size;
11785
11786 Ok(())
11787 }
11788 }
11789
11790 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11791 for TableFieldInlinedHandle
11792 {
11793 #[inline(always)]
11794 fn new_empty() -> Self {
11795 Self::default()
11796 }
11797
11798 unsafe fn decode(
11799 &mut self,
11800 decoder: &mut fidl::encoding::Decoder<
11801 '_,
11802 fidl::encoding::DefaultFuchsiaResourceDialect,
11803 >,
11804 offset: usize,
11805 mut depth: fidl::encoding::Depth,
11806 ) -> fidl::Result<()> {
11807 decoder.debug_check_bounds::<Self>(offset);
11808 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11809 None => return Err(fidl::Error::NotNullable),
11810 Some(len) => len,
11811 };
11812 if len == 0 {
11814 return Ok(());
11815 };
11816 depth.increment()?;
11817 let envelope_size = 8;
11818 let bytes_len = len * envelope_size;
11819 let offset = decoder.out_of_line_offset(bytes_len)?;
11820 let mut _next_ordinal_to_read = 0;
11822 let mut next_offset = offset;
11823 let end_offset = offset + bytes_len;
11824 _next_ordinal_to_read += 1;
11825 if next_offset >= end_offset {
11826 return Ok(());
11827 }
11828
11829 while _next_ordinal_to_read < 1 {
11831 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11832 _next_ordinal_to_read += 1;
11833 next_offset += envelope_size;
11834 }
11835
11836 let next_out_of_line = decoder.next_out_of_line();
11837 let handles_before = decoder.remaining_handles();
11838 if let Some((inlined, num_bytes, num_handles)) =
11839 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11840 {
11841 let member_inline_size = <fidl::encoding::HandleType<
11842 fidl::Channel,
11843 { fidl::ObjectType::CHANNEL.into_raw() },
11844 2147483648,
11845 > as fidl::encoding::TypeMarker>::inline_size(
11846 decoder.context
11847 );
11848 if inlined != (member_inline_size <= 4) {
11849 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11850 }
11851 let inner_offset;
11852 let mut inner_depth = depth.clone();
11853 if inlined {
11854 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11855 inner_offset = next_offset;
11856 } else {
11857 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11858 inner_depth.increment()?;
11859 }
11860 let val_ref =
11861 self.f.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
11862 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11863 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11864 {
11865 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11866 }
11867 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11868 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11869 }
11870 }
11871
11872 next_offset += envelope_size;
11873
11874 while next_offset < end_offset {
11876 _next_ordinal_to_read += 1;
11877 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11878 next_offset += envelope_size;
11879 }
11880
11881 Ok(())
11882 }
11883 }
11884
11885 impl TableFieldUnknownResource {
11886 #[inline(always)]
11887 fn max_ordinal_present(&self) -> u64 {
11888 0
11889 }
11890 }
11891
11892 impl fidl::encoding::ResourceTypeMarker for TableFieldUnknownResource {
11893 type Borrowed<'a> = &'a mut Self;
11894 fn take_or_borrow<'a>(
11895 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11896 ) -> Self::Borrowed<'a> {
11897 value
11898 }
11899 }
11900
11901 unsafe impl fidl::encoding::TypeMarker for TableFieldUnknownResource {
11902 type Owned = Self;
11903
11904 #[inline(always)]
11905 fn inline_align(_context: fidl::encoding::Context) -> usize {
11906 8
11907 }
11908
11909 #[inline(always)]
11910 fn inline_size(_context: fidl::encoding::Context) -> usize {
11911 16
11912 }
11913 }
11914
11915 unsafe impl
11916 fidl::encoding::Encode<
11917 TableFieldUnknownResource,
11918 fidl::encoding::DefaultFuchsiaResourceDialect,
11919 > for &mut TableFieldUnknownResource
11920 {
11921 unsafe fn encode(
11922 self,
11923 encoder: &mut fidl::encoding::Encoder<
11924 '_,
11925 fidl::encoding::DefaultFuchsiaResourceDialect,
11926 >,
11927 offset: usize,
11928 mut depth: fidl::encoding::Depth,
11929 ) -> fidl::Result<()> {
11930 encoder.debug_check_bounds::<TableFieldUnknownResource>(offset);
11931 let max_ordinal: u64 = self.max_ordinal_present();
11933 encoder.write_num(max_ordinal, offset);
11934 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11935 if max_ordinal == 0 {
11937 return Ok(());
11938 }
11939 depth.increment()?;
11940 let envelope_size = 8;
11941 let bytes_len = max_ordinal as usize * envelope_size;
11942 #[allow(unused_variables)]
11943 let offset = encoder.out_of_line_offset(bytes_len);
11944 let mut _prev_end_offset: usize = 0;
11945
11946 Ok(())
11947 }
11948 }
11949
11950 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11951 for TableFieldUnknownResource
11952 {
11953 #[inline(always)]
11954 fn new_empty() -> Self {
11955 Self::default()
11956 }
11957
11958 unsafe fn decode(
11959 &mut self,
11960 decoder: &mut fidl::encoding::Decoder<
11961 '_,
11962 fidl::encoding::DefaultFuchsiaResourceDialect,
11963 >,
11964 offset: usize,
11965 mut depth: fidl::encoding::Depth,
11966 ) -> fidl::Result<()> {
11967 decoder.debug_check_bounds::<Self>(offset);
11968 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11969 None => return Err(fidl::Error::NotNullable),
11970 Some(len) => len,
11971 };
11972 if len == 0 {
11974 return Ok(());
11975 };
11976 depth.increment()?;
11977 let envelope_size = 8;
11978 let bytes_len = len * envelope_size;
11979 let offset = decoder.out_of_line_offset(bytes_len)?;
11980 let mut _next_ordinal_to_read = 0;
11982 let mut next_offset = offset;
11983 let end_offset = offset + bytes_len;
11984
11985 while next_offset < end_offset {
11987 _next_ordinal_to_read += 1;
11988 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11989 next_offset += envelope_size;
11990 }
11991
11992 Ok(())
11993 }
11994 }
11995
11996 impl TableOfEndpointsTable {
11997 #[inline(always)]
11998 fn max_ordinal_present(&self) -> u64 {
11999 if let Some(_) = self.server_end {
12000 return 2;
12001 }
12002 if let Some(_) = self.client_end {
12003 return 1;
12004 }
12005 0
12006 }
12007 }
12008
12009 impl fidl::encoding::ResourceTypeMarker for TableOfEndpointsTable {
12010 type Borrowed<'a> = &'a mut Self;
12011 fn take_or_borrow<'a>(
12012 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12013 ) -> Self::Borrowed<'a> {
12014 value
12015 }
12016 }
12017
12018 unsafe impl fidl::encoding::TypeMarker for TableOfEndpointsTable {
12019 type Owned = Self;
12020
12021 #[inline(always)]
12022 fn inline_align(_context: fidl::encoding::Context) -> usize {
12023 8
12024 }
12025
12026 #[inline(always)]
12027 fn inline_size(_context: fidl::encoding::Context) -> usize {
12028 16
12029 }
12030 }
12031
12032 unsafe impl
12033 fidl::encoding::Encode<TableOfEndpointsTable, fidl::encoding::DefaultFuchsiaResourceDialect>
12034 for &mut TableOfEndpointsTable
12035 {
12036 unsafe fn encode(
12037 self,
12038 encoder: &mut fidl::encoding::Encoder<
12039 '_,
12040 fidl::encoding::DefaultFuchsiaResourceDialect,
12041 >,
12042 offset: usize,
12043 mut depth: fidl::encoding::Depth,
12044 ) -> fidl::Result<()> {
12045 encoder.debug_check_bounds::<TableOfEndpointsTable>(offset);
12046 let max_ordinal: u64 = self.max_ordinal_present();
12048 encoder.write_num(max_ordinal, offset);
12049 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12050 if max_ordinal == 0 {
12052 return Ok(());
12053 }
12054 depth.increment()?;
12055 let envelope_size = 8;
12056 let bytes_len = max_ordinal as usize * envelope_size;
12057 #[allow(unused_variables)]
12058 let offset = encoder.out_of_line_offset(bytes_len);
12059 let mut _prev_end_offset: usize = 0;
12060 if 1 > max_ordinal {
12061 return Ok(());
12062 }
12063
12064 let cur_offset: usize = (1 - 1) * envelope_size;
12067
12068 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12070
12071 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12076 self.client_end.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12077 encoder, offset + cur_offset, depth
12078 )?;
12079
12080 _prev_end_offset = cur_offset + envelope_size;
12081 if 2 > max_ordinal {
12082 return Ok(());
12083 }
12084
12085 let cur_offset: usize = (2 - 1) * envelope_size;
12088
12089 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12091
12092 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12097 self.server_end.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12098 encoder, offset + cur_offset, depth
12099 )?;
12100
12101 _prev_end_offset = cur_offset + envelope_size;
12102
12103 Ok(())
12104 }
12105 }
12106
12107 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12108 for TableOfEndpointsTable
12109 {
12110 #[inline(always)]
12111 fn new_empty() -> Self {
12112 Self::default()
12113 }
12114
12115 unsafe fn decode(
12116 &mut self,
12117 decoder: &mut fidl::encoding::Decoder<
12118 '_,
12119 fidl::encoding::DefaultFuchsiaResourceDialect,
12120 >,
12121 offset: usize,
12122 mut depth: fidl::encoding::Depth,
12123 ) -> fidl::Result<()> {
12124 decoder.debug_check_bounds::<Self>(offset);
12125 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12126 None => return Err(fidl::Error::NotNullable),
12127 Some(len) => len,
12128 };
12129 if len == 0 {
12131 return Ok(());
12132 };
12133 depth.increment()?;
12134 let envelope_size = 8;
12135 let bytes_len = len * envelope_size;
12136 let offset = decoder.out_of_line_offset(bytes_len)?;
12137 let mut _next_ordinal_to_read = 0;
12139 let mut next_offset = offset;
12140 let end_offset = offset + bytes_len;
12141 _next_ordinal_to_read += 1;
12142 if next_offset >= end_offset {
12143 return Ok(());
12144 }
12145
12146 while _next_ordinal_to_read < 1 {
12148 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12149 _next_ordinal_to_read += 1;
12150 next_offset += envelope_size;
12151 }
12152
12153 let next_out_of_line = decoder.next_out_of_line();
12154 let handles_before = decoder.remaining_handles();
12155 if let Some((inlined, num_bytes, num_handles)) =
12156 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12157 {
12158 let member_inline_size = <fidl::encoding::Endpoint<
12159 fidl::endpoints::ClientEnd<ProtocolMarker>,
12160 > as fidl::encoding::TypeMarker>::inline_size(
12161 decoder.context
12162 );
12163 if inlined != (member_inline_size <= 4) {
12164 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12165 }
12166 let inner_offset;
12167 let mut inner_depth = depth.clone();
12168 if inlined {
12169 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12170 inner_offset = next_offset;
12171 } else {
12172 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12173 inner_depth.increment()?;
12174 }
12175 let val_ref = self.client_end.get_or_insert_with(|| {
12176 fidl::new_empty!(
12177 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
12178 fidl::encoding::DefaultFuchsiaResourceDialect
12179 )
12180 });
12181 fidl::decode!(
12182 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
12183 fidl::encoding::DefaultFuchsiaResourceDialect,
12184 val_ref,
12185 decoder,
12186 inner_offset,
12187 inner_depth
12188 )?;
12189 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12190 {
12191 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12192 }
12193 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12194 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12195 }
12196 }
12197
12198 next_offset += envelope_size;
12199 _next_ordinal_to_read += 1;
12200 if next_offset >= end_offset {
12201 return Ok(());
12202 }
12203
12204 while _next_ordinal_to_read < 2 {
12206 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12207 _next_ordinal_to_read += 1;
12208 next_offset += envelope_size;
12209 }
12210
12211 let next_out_of_line = decoder.next_out_of_line();
12212 let handles_before = decoder.remaining_handles();
12213 if let Some((inlined, num_bytes, num_handles)) =
12214 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12215 {
12216 let member_inline_size = <fidl::encoding::Endpoint<
12217 fidl::endpoints::ServerEnd<ProtocolMarker>,
12218 > as fidl::encoding::TypeMarker>::inline_size(
12219 decoder.context
12220 );
12221 if inlined != (member_inline_size <= 4) {
12222 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12223 }
12224 let inner_offset;
12225 let mut inner_depth = depth.clone();
12226 if inlined {
12227 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12228 inner_offset = next_offset;
12229 } else {
12230 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12231 inner_depth.increment()?;
12232 }
12233 let val_ref = self.server_end.get_or_insert_with(|| {
12234 fidl::new_empty!(
12235 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
12236 fidl::encoding::DefaultFuchsiaResourceDialect
12237 )
12238 });
12239 fidl::decode!(
12240 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
12241 fidl::encoding::DefaultFuchsiaResourceDialect,
12242 val_ref,
12243 decoder,
12244 inner_offset,
12245 inner_depth
12246 )?;
12247 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12248 {
12249 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12250 }
12251 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12252 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12253 }
12254 }
12255
12256 next_offset += envelope_size;
12257
12258 while next_offset < end_offset {
12260 _next_ordinal_to_read += 1;
12261 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12262 next_offset += envelope_size;
12263 }
12264
12265 Ok(())
12266 }
12267 }
12268
12269 impl TableUnionWithVectorReservedSandwich {
12270 #[inline(always)]
12271 fn max_ordinal_present(&self) -> u64 {
12272 if let Some(_) = self.uv {
12273 return 2;
12274 }
12275 0
12276 }
12277 }
12278
12279 impl fidl::encoding::ResourceTypeMarker for TableUnionWithVectorReservedSandwich {
12280 type Borrowed<'a> = &'a mut Self;
12281 fn take_or_borrow<'a>(
12282 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12283 ) -> Self::Borrowed<'a> {
12284 value
12285 }
12286 }
12287
12288 unsafe impl fidl::encoding::TypeMarker for TableUnionWithVectorReservedSandwich {
12289 type Owned = Self;
12290
12291 #[inline(always)]
12292 fn inline_align(_context: fidl::encoding::Context) -> usize {
12293 8
12294 }
12295
12296 #[inline(always)]
12297 fn inline_size(_context: fidl::encoding::Context) -> usize {
12298 16
12299 }
12300 }
12301
12302 unsafe impl
12303 fidl::encoding::Encode<
12304 TableUnionWithVectorReservedSandwich,
12305 fidl::encoding::DefaultFuchsiaResourceDialect,
12306 > for &mut TableUnionWithVectorReservedSandwich
12307 {
12308 unsafe fn encode(
12309 self,
12310 encoder: &mut fidl::encoding::Encoder<
12311 '_,
12312 fidl::encoding::DefaultFuchsiaResourceDialect,
12313 >,
12314 offset: usize,
12315 mut depth: fidl::encoding::Depth,
12316 ) -> fidl::Result<()> {
12317 encoder.debug_check_bounds::<TableUnionWithVectorReservedSandwich>(offset);
12318 let max_ordinal: u64 = self.max_ordinal_present();
12320 encoder.write_num(max_ordinal, offset);
12321 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12322 if max_ordinal == 0 {
12324 return Ok(());
12325 }
12326 depth.increment()?;
12327 let envelope_size = 8;
12328 let bytes_len = max_ordinal as usize * envelope_size;
12329 #[allow(unused_variables)]
12330 let offset = encoder.out_of_line_offset(bytes_len);
12331 let mut _prev_end_offset: usize = 0;
12332 if 2 > max_ordinal {
12333 return Ok(());
12334 }
12335
12336 let cur_offset: usize = (2 - 1) * envelope_size;
12339
12340 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12342
12343 fidl::encoding::encode_in_envelope_optional::<
12348 UnionWithVector,
12349 fidl::encoding::DefaultFuchsiaResourceDialect,
12350 >(
12351 self.uv
12352 .as_mut()
12353 .map(<UnionWithVector as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12354 encoder,
12355 offset + cur_offset,
12356 depth,
12357 )?;
12358
12359 _prev_end_offset = cur_offset + envelope_size;
12360
12361 Ok(())
12362 }
12363 }
12364
12365 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12366 for TableUnionWithVectorReservedSandwich
12367 {
12368 #[inline(always)]
12369 fn new_empty() -> Self {
12370 Self::default()
12371 }
12372
12373 unsafe fn decode(
12374 &mut self,
12375 decoder: &mut fidl::encoding::Decoder<
12376 '_,
12377 fidl::encoding::DefaultFuchsiaResourceDialect,
12378 >,
12379 offset: usize,
12380 mut depth: fidl::encoding::Depth,
12381 ) -> fidl::Result<()> {
12382 decoder.debug_check_bounds::<Self>(offset);
12383 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12384 None => return Err(fidl::Error::NotNullable),
12385 Some(len) => len,
12386 };
12387 if len == 0 {
12389 return Ok(());
12390 };
12391 depth.increment()?;
12392 let envelope_size = 8;
12393 let bytes_len = len * envelope_size;
12394 let offset = decoder.out_of_line_offset(bytes_len)?;
12395 let mut _next_ordinal_to_read = 0;
12397 let mut next_offset = offset;
12398 let end_offset = offset + bytes_len;
12399 _next_ordinal_to_read += 1;
12400 if next_offset >= end_offset {
12401 return Ok(());
12402 }
12403
12404 while _next_ordinal_to_read < 2 {
12406 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12407 _next_ordinal_to_read += 1;
12408 next_offset += envelope_size;
12409 }
12410
12411 let next_out_of_line = decoder.next_out_of_line();
12412 let handles_before = decoder.remaining_handles();
12413 if let Some((inlined, num_bytes, num_handles)) =
12414 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12415 {
12416 let member_inline_size =
12417 <UnionWithVector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12418 if inlined != (member_inline_size <= 4) {
12419 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12420 }
12421 let inner_offset;
12422 let mut inner_depth = depth.clone();
12423 if inlined {
12424 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12425 inner_offset = next_offset;
12426 } else {
12427 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12428 inner_depth.increment()?;
12429 }
12430 let val_ref = self.uv.get_or_insert_with(|| {
12431 fidl::new_empty!(UnionWithVector, fidl::encoding::DefaultFuchsiaResourceDialect)
12432 });
12433 fidl::decode!(
12434 UnionWithVector,
12435 fidl::encoding::DefaultFuchsiaResourceDialect,
12436 val_ref,
12437 decoder,
12438 inner_offset,
12439 inner_depth
12440 )?;
12441 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12442 {
12443 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12444 }
12445 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12446 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12447 }
12448 }
12449
12450 next_offset += envelope_size;
12451
12452 while next_offset < end_offset {
12454 _next_ordinal_to_read += 1;
12455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12456 next_offset += envelope_size;
12457 }
12458
12459 Ok(())
12460 }
12461 }
12462
12463 impl TableUnionWithVectorStructSandwich {
12464 #[inline(always)]
12465 fn max_ordinal_present(&self) -> u64 {
12466 if let Some(_) = self.s2 {
12467 return 3;
12468 }
12469 if let Some(_) = self.uv {
12470 return 2;
12471 }
12472 if let Some(_) = self.s1 {
12473 return 1;
12474 }
12475 0
12476 }
12477 }
12478
12479 impl fidl::encoding::ResourceTypeMarker for TableUnionWithVectorStructSandwich {
12480 type Borrowed<'a> = &'a mut Self;
12481 fn take_or_borrow<'a>(
12482 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12483 ) -> Self::Borrowed<'a> {
12484 value
12485 }
12486 }
12487
12488 unsafe impl fidl::encoding::TypeMarker for TableUnionWithVectorStructSandwich {
12489 type Owned = Self;
12490
12491 #[inline(always)]
12492 fn inline_align(_context: fidl::encoding::Context) -> usize {
12493 8
12494 }
12495
12496 #[inline(always)]
12497 fn inline_size(_context: fidl::encoding::Context) -> usize {
12498 16
12499 }
12500 }
12501
12502 unsafe impl
12503 fidl::encoding::Encode<
12504 TableUnionWithVectorStructSandwich,
12505 fidl::encoding::DefaultFuchsiaResourceDialect,
12506 > for &mut TableUnionWithVectorStructSandwich
12507 {
12508 unsafe fn encode(
12509 self,
12510 encoder: &mut fidl::encoding::Encoder<
12511 '_,
12512 fidl::encoding::DefaultFuchsiaResourceDialect,
12513 >,
12514 offset: usize,
12515 mut depth: fidl::encoding::Depth,
12516 ) -> fidl::Result<()> {
12517 encoder.debug_check_bounds::<TableUnionWithVectorStructSandwich>(offset);
12518 let max_ordinal: u64 = self.max_ordinal_present();
12520 encoder.write_num(max_ordinal, offset);
12521 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12522 if max_ordinal == 0 {
12524 return Ok(());
12525 }
12526 depth.increment()?;
12527 let envelope_size = 8;
12528 let bytes_len = max_ordinal as usize * envelope_size;
12529 #[allow(unused_variables)]
12530 let offset = encoder.out_of_line_offset(bytes_len);
12531 let mut _prev_end_offset: usize = 0;
12532 if 1 > max_ordinal {
12533 return Ok(());
12534 }
12535
12536 let cur_offset: usize = (1 - 1) * envelope_size;
12539
12540 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12542
12543 fidl::encoding::encode_in_envelope_optional::<
12548 StructSize3Align1,
12549 fidl::encoding::DefaultFuchsiaResourceDialect,
12550 >(
12551 self.s1
12552 .as_ref()
12553 .map(<StructSize3Align1 as fidl::encoding::ValueTypeMarker>::borrow),
12554 encoder,
12555 offset + cur_offset,
12556 depth,
12557 )?;
12558
12559 _prev_end_offset = cur_offset + envelope_size;
12560 if 2 > max_ordinal {
12561 return Ok(());
12562 }
12563
12564 let cur_offset: usize = (2 - 1) * envelope_size;
12567
12568 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12570
12571 fidl::encoding::encode_in_envelope_optional::<
12576 UnionWithVector,
12577 fidl::encoding::DefaultFuchsiaResourceDialect,
12578 >(
12579 self.uv
12580 .as_mut()
12581 .map(<UnionWithVector as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12582 encoder,
12583 offset + cur_offset,
12584 depth,
12585 )?;
12586
12587 _prev_end_offset = cur_offset + envelope_size;
12588 if 3 > max_ordinal {
12589 return Ok(());
12590 }
12591
12592 let cur_offset: usize = (3 - 1) * envelope_size;
12595
12596 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12598
12599 fidl::encoding::encode_in_envelope_optional::<
12604 StructSize3Align1,
12605 fidl::encoding::DefaultFuchsiaResourceDialect,
12606 >(
12607 self.s2
12608 .as_ref()
12609 .map(<StructSize3Align1 as fidl::encoding::ValueTypeMarker>::borrow),
12610 encoder,
12611 offset + cur_offset,
12612 depth,
12613 )?;
12614
12615 _prev_end_offset = cur_offset + envelope_size;
12616
12617 Ok(())
12618 }
12619 }
12620
12621 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12622 for TableUnionWithVectorStructSandwich
12623 {
12624 #[inline(always)]
12625 fn new_empty() -> Self {
12626 Self::default()
12627 }
12628
12629 unsafe fn decode(
12630 &mut self,
12631 decoder: &mut fidl::encoding::Decoder<
12632 '_,
12633 fidl::encoding::DefaultFuchsiaResourceDialect,
12634 >,
12635 offset: usize,
12636 mut depth: fidl::encoding::Depth,
12637 ) -> fidl::Result<()> {
12638 decoder.debug_check_bounds::<Self>(offset);
12639 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12640 None => return Err(fidl::Error::NotNullable),
12641 Some(len) => len,
12642 };
12643 if len == 0 {
12645 return Ok(());
12646 };
12647 depth.increment()?;
12648 let envelope_size = 8;
12649 let bytes_len = len * envelope_size;
12650 let offset = decoder.out_of_line_offset(bytes_len)?;
12651 let mut _next_ordinal_to_read = 0;
12653 let mut next_offset = offset;
12654 let end_offset = offset + bytes_len;
12655 _next_ordinal_to_read += 1;
12656 if next_offset >= end_offset {
12657 return Ok(());
12658 }
12659
12660 while _next_ordinal_to_read < 1 {
12662 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12663 _next_ordinal_to_read += 1;
12664 next_offset += envelope_size;
12665 }
12666
12667 let next_out_of_line = decoder.next_out_of_line();
12668 let handles_before = decoder.remaining_handles();
12669 if let Some((inlined, num_bytes, num_handles)) =
12670 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12671 {
12672 let member_inline_size =
12673 <StructSize3Align1 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12674 if inlined != (member_inline_size <= 4) {
12675 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12676 }
12677 let inner_offset;
12678 let mut inner_depth = depth.clone();
12679 if inlined {
12680 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12681 inner_offset = next_offset;
12682 } else {
12683 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12684 inner_depth.increment()?;
12685 }
12686 let val_ref = self.s1.get_or_insert_with(|| {
12687 fidl::new_empty!(
12688 StructSize3Align1,
12689 fidl::encoding::DefaultFuchsiaResourceDialect
12690 )
12691 });
12692 fidl::decode!(
12693 StructSize3Align1,
12694 fidl::encoding::DefaultFuchsiaResourceDialect,
12695 val_ref,
12696 decoder,
12697 inner_offset,
12698 inner_depth
12699 )?;
12700 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12701 {
12702 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12703 }
12704 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12705 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12706 }
12707 }
12708
12709 next_offset += envelope_size;
12710 _next_ordinal_to_read += 1;
12711 if next_offset >= end_offset {
12712 return Ok(());
12713 }
12714
12715 while _next_ordinal_to_read < 2 {
12717 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12718 _next_ordinal_to_read += 1;
12719 next_offset += envelope_size;
12720 }
12721
12722 let next_out_of_line = decoder.next_out_of_line();
12723 let handles_before = decoder.remaining_handles();
12724 if let Some((inlined, num_bytes, num_handles)) =
12725 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12726 {
12727 let member_inline_size =
12728 <UnionWithVector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12729 if inlined != (member_inline_size <= 4) {
12730 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12731 }
12732 let inner_offset;
12733 let mut inner_depth = depth.clone();
12734 if inlined {
12735 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12736 inner_offset = next_offset;
12737 } else {
12738 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12739 inner_depth.increment()?;
12740 }
12741 let val_ref = self.uv.get_or_insert_with(|| {
12742 fidl::new_empty!(UnionWithVector, fidl::encoding::DefaultFuchsiaResourceDialect)
12743 });
12744 fidl::decode!(
12745 UnionWithVector,
12746 fidl::encoding::DefaultFuchsiaResourceDialect,
12747 val_ref,
12748 decoder,
12749 inner_offset,
12750 inner_depth
12751 )?;
12752 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12753 {
12754 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12755 }
12756 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12757 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12758 }
12759 }
12760
12761 next_offset += envelope_size;
12762 _next_ordinal_to_read += 1;
12763 if next_offset >= end_offset {
12764 return Ok(());
12765 }
12766
12767 while _next_ordinal_to_read < 3 {
12769 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12770 _next_ordinal_to_read += 1;
12771 next_offset += envelope_size;
12772 }
12773
12774 let next_out_of_line = decoder.next_out_of_line();
12775 let handles_before = decoder.remaining_handles();
12776 if let Some((inlined, num_bytes, num_handles)) =
12777 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12778 {
12779 let member_inline_size =
12780 <StructSize3Align1 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12781 if inlined != (member_inline_size <= 4) {
12782 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12783 }
12784 let inner_offset;
12785 let mut inner_depth = depth.clone();
12786 if inlined {
12787 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12788 inner_offset = next_offset;
12789 } else {
12790 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12791 inner_depth.increment()?;
12792 }
12793 let val_ref = self.s2.get_or_insert_with(|| {
12794 fidl::new_empty!(
12795 StructSize3Align1,
12796 fidl::encoding::DefaultFuchsiaResourceDialect
12797 )
12798 });
12799 fidl::decode!(
12800 StructSize3Align1,
12801 fidl::encoding::DefaultFuchsiaResourceDialect,
12802 val_ref,
12803 decoder,
12804 inner_offset,
12805 inner_depth
12806 )?;
12807 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12808 {
12809 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12810 }
12811 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12812 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12813 }
12814 }
12815
12816 next_offset += envelope_size;
12817
12818 while next_offset < end_offset {
12820 _next_ordinal_to_read += 1;
12821 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12822 next_offset += envelope_size;
12823 }
12824
12825 Ok(())
12826 }
12827 }
12828
12829 impl VectorOfArrayOfEventInTableWithReducedRights {
12830 #[inline(always)]
12831 fn max_ordinal_present(&self) -> u64 {
12832 if let Some(_) = self.h {
12833 return 1;
12834 }
12835 0
12836 }
12837 }
12838
12839 impl fidl::encoding::ResourceTypeMarker for VectorOfArrayOfEventInTableWithReducedRights {
12840 type Borrowed<'a> = &'a mut Self;
12841 fn take_or_borrow<'a>(
12842 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12843 ) -> Self::Borrowed<'a> {
12844 value
12845 }
12846 }
12847
12848 unsafe impl fidl::encoding::TypeMarker for VectorOfArrayOfEventInTableWithReducedRights {
12849 type Owned = Self;
12850
12851 #[inline(always)]
12852 fn inline_align(_context: fidl::encoding::Context) -> usize {
12853 8
12854 }
12855
12856 #[inline(always)]
12857 fn inline_size(_context: fidl::encoding::Context) -> usize {
12858 16
12859 }
12860 }
12861
12862 unsafe impl
12863 fidl::encoding::Encode<
12864 VectorOfArrayOfEventInTableWithReducedRights,
12865 fidl::encoding::DefaultFuchsiaResourceDialect,
12866 > for &mut VectorOfArrayOfEventInTableWithReducedRights
12867 {
12868 unsafe fn encode(
12869 self,
12870 encoder: &mut fidl::encoding::Encoder<
12871 '_,
12872 fidl::encoding::DefaultFuchsiaResourceDialect,
12873 >,
12874 offset: usize,
12875 mut depth: fidl::encoding::Depth,
12876 ) -> fidl::Result<()> {
12877 encoder.debug_check_bounds::<VectorOfArrayOfEventInTableWithReducedRights>(offset);
12878 let max_ordinal: u64 = self.max_ordinal_present();
12880 encoder.write_num(max_ordinal, offset);
12881 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12882 if max_ordinal == 0 {
12884 return Ok(());
12885 }
12886 depth.increment()?;
12887 let envelope_size = 8;
12888 let bytes_len = max_ordinal as usize * envelope_size;
12889 #[allow(unused_variables)]
12890 let offset = encoder.out_of_line_offset(bytes_len);
12891 let mut _prev_end_offset: usize = 0;
12892 if 1 > max_ordinal {
12893 return Ok(());
12894 }
12895
12896 let cur_offset: usize = (1 - 1) * envelope_size;
12899
12900 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12902
12903 fidl::encoding::encode_in_envelope_optional::<
12908 fidl::encoding::Vector<
12909 fidl::encoding::Array<
12910 fidl::encoding::HandleType<
12911 fidl::Event,
12912 { fidl::ObjectType::EVENT.into_raw() },
12913 49155,
12914 >,
12915 1,
12916 >,
12917 1,
12918 >,
12919 fidl::encoding::DefaultFuchsiaResourceDialect,
12920 >(
12921 self.h.as_mut().map(
12922 <fidl::encoding::Vector<
12923 fidl::encoding::Array<
12924 fidl::encoding::HandleType<
12925 fidl::Event,
12926 { fidl::ObjectType::EVENT.into_raw() },
12927 49155,
12928 >,
12929 1,
12930 >,
12931 1,
12932 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12933 ),
12934 encoder,
12935 offset + cur_offset,
12936 depth,
12937 )?;
12938
12939 _prev_end_offset = cur_offset + envelope_size;
12940
12941 Ok(())
12942 }
12943 }
12944
12945 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12946 for VectorOfArrayOfEventInTableWithReducedRights
12947 {
12948 #[inline(always)]
12949 fn new_empty() -> Self {
12950 Self::default()
12951 }
12952
12953 unsafe fn decode(
12954 &mut self,
12955 decoder: &mut fidl::encoding::Decoder<
12956 '_,
12957 fidl::encoding::DefaultFuchsiaResourceDialect,
12958 >,
12959 offset: usize,
12960 mut depth: fidl::encoding::Depth,
12961 ) -> fidl::Result<()> {
12962 decoder.debug_check_bounds::<Self>(offset);
12963 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12964 None => return Err(fidl::Error::NotNullable),
12965 Some(len) => len,
12966 };
12967 if len == 0 {
12969 return Ok(());
12970 };
12971 depth.increment()?;
12972 let envelope_size = 8;
12973 let bytes_len = len * envelope_size;
12974 let offset = decoder.out_of_line_offset(bytes_len)?;
12975 let mut _next_ordinal_to_read = 0;
12977 let mut next_offset = offset;
12978 let end_offset = offset + bytes_len;
12979 _next_ordinal_to_read += 1;
12980 if next_offset >= end_offset {
12981 return Ok(());
12982 }
12983
12984 while _next_ordinal_to_read < 1 {
12986 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12987 _next_ordinal_to_read += 1;
12988 next_offset += envelope_size;
12989 }
12990
12991 let next_out_of_line = decoder.next_out_of_line();
12992 let handles_before = decoder.remaining_handles();
12993 if let Some((inlined, num_bytes, num_handles)) =
12994 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12995 {
12996 let member_inline_size = <fidl::encoding::Vector<
12997 fidl::encoding::Array<
12998 fidl::encoding::HandleType<
12999 fidl::Event,
13000 { fidl::ObjectType::EVENT.into_raw() },
13001 49155,
13002 >,
13003 1,
13004 >,
13005 1,
13006 > as fidl::encoding::TypeMarker>::inline_size(
13007 decoder.context
13008 );
13009 if inlined != (member_inline_size <= 4) {
13010 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13011 }
13012 let inner_offset;
13013 let mut inner_depth = depth.clone();
13014 if inlined {
13015 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13016 inner_offset = next_offset;
13017 } else {
13018 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13019 inner_depth.increment()?;
13020 }
13021 let val_ref = self.h.get_or_insert_with(|| {
13022 fidl::new_empty!(
13023 fidl::encoding::Vector<
13024 fidl::encoding::Array<
13025 fidl::encoding::HandleType<
13026 fidl::Event,
13027 { fidl::ObjectType::EVENT.into_raw() },
13028 49155,
13029 >,
13030 1,
13031 >,
13032 1,
13033 >,
13034 fidl::encoding::DefaultFuchsiaResourceDialect
13035 )
13036 });
13037 fidl::decode!(
13038 fidl::encoding::Vector<
13039 fidl::encoding::Array<
13040 fidl::encoding::HandleType<
13041 fidl::Event,
13042 { fidl::ObjectType::EVENT.into_raw() },
13043 49155,
13044 >,
13045 1,
13046 >,
13047 1,
13048 >,
13049 fidl::encoding::DefaultFuchsiaResourceDialect,
13050 val_ref,
13051 decoder,
13052 inner_offset,
13053 inner_depth
13054 )?;
13055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13056 {
13057 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13058 }
13059 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13060 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13061 }
13062 }
13063
13064 next_offset += envelope_size;
13065
13066 while next_offset < end_offset {
13068 _next_ordinal_to_read += 1;
13069 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13070 next_offset += envelope_size;
13071 }
13072
13073 Ok(())
13074 }
13075 }
13076
13077 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInUnionWithDefaultRights {
13078 type Borrowed<'a> = &'a mut Self;
13079 fn take_or_borrow<'a>(
13080 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13081 ) -> Self::Borrowed<'a> {
13082 value
13083 }
13084 }
13085
13086 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInUnionWithDefaultRights {
13087 type Owned = Self;
13088
13089 #[inline(always)]
13090 fn inline_align(_context: fidl::encoding::Context) -> usize {
13091 8
13092 }
13093
13094 #[inline(always)]
13095 fn inline_size(_context: fidl::encoding::Context) -> usize {
13096 16
13097 }
13098 }
13099
13100 unsafe impl
13101 fidl::encoding::Encode<
13102 ArrayOfVectorOfEventInUnionWithDefaultRights,
13103 fidl::encoding::DefaultFuchsiaResourceDialect,
13104 > for &mut ArrayOfVectorOfEventInUnionWithDefaultRights
13105 {
13106 #[inline]
13107 unsafe fn encode(
13108 self,
13109 encoder: &mut fidl::encoding::Encoder<
13110 '_,
13111 fidl::encoding::DefaultFuchsiaResourceDialect,
13112 >,
13113 offset: usize,
13114 _depth: fidl::encoding::Depth,
13115 ) -> fidl::Result<()> {
13116 encoder.debug_check_bounds::<ArrayOfVectorOfEventInUnionWithDefaultRights>(offset);
13117 encoder.write_num::<u64>(self.ordinal(), offset);
13118 match self {
13119 ArrayOfVectorOfEventInUnionWithDefaultRights::H(ref mut val) => {
13120 fidl::encoding::encode_in_envelope::<
13121 fidl::encoding::Array<
13122 fidl::encoding::Vector<
13123 fidl::encoding::HandleType<
13124 fidl::Event,
13125 { fidl::ObjectType::EVENT.into_raw() },
13126 53251,
13127 >,
13128 1,
13129 >,
13130 1,
13131 >,
13132 fidl::encoding::DefaultFuchsiaResourceDialect,
13133 >(
13134 <fidl::encoding::Array<
13135 fidl::encoding::Vector<
13136 fidl::encoding::HandleType<
13137 fidl::Event,
13138 { fidl::ObjectType::EVENT.into_raw() },
13139 53251,
13140 >,
13141 1,
13142 >,
13143 1,
13144 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13145 val
13146 ),
13147 encoder,
13148 offset + 8,
13149 _depth,
13150 )
13151 }
13152 }
13153 }
13154 }
13155
13156 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13157 for ArrayOfVectorOfEventInUnionWithDefaultRights
13158 {
13159 #[inline(always)]
13160 fn new_empty() -> Self {
13161 Self::H(fidl::new_empty!(
13162 fidl::encoding::Array<
13163 fidl::encoding::Vector<
13164 fidl::encoding::HandleType<
13165 fidl::Event,
13166 { fidl::ObjectType::EVENT.into_raw() },
13167 53251,
13168 >,
13169 1,
13170 >,
13171 1,
13172 >,
13173 fidl::encoding::DefaultFuchsiaResourceDialect
13174 ))
13175 }
13176
13177 #[inline]
13178 unsafe fn decode(
13179 &mut self,
13180 decoder: &mut fidl::encoding::Decoder<
13181 '_,
13182 fidl::encoding::DefaultFuchsiaResourceDialect,
13183 >,
13184 offset: usize,
13185 mut depth: fidl::encoding::Depth,
13186 ) -> fidl::Result<()> {
13187 decoder.debug_check_bounds::<Self>(offset);
13188 #[allow(unused_variables)]
13189 let next_out_of_line = decoder.next_out_of_line();
13190 let handles_before = decoder.remaining_handles();
13191 let (ordinal, inlined, num_bytes, num_handles) =
13192 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13193
13194 let member_inline_size = match ordinal {
13195 1 => <fidl::encoding::Array<
13196 fidl::encoding::Vector<
13197 fidl::encoding::HandleType<
13198 fidl::Event,
13199 { fidl::ObjectType::EVENT.into_raw() },
13200 53251,
13201 >,
13202 1,
13203 >,
13204 1,
13205 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13206 _ => return Err(fidl::Error::UnknownUnionTag),
13207 };
13208
13209 if inlined != (member_inline_size <= 4) {
13210 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13211 }
13212 let _inner_offset;
13213 if inlined {
13214 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13215 _inner_offset = offset + 8;
13216 } else {
13217 depth.increment()?;
13218 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13219 }
13220 match ordinal {
13221 1 => {
13222 #[allow(irrefutable_let_patterns)]
13223 if let ArrayOfVectorOfEventInUnionWithDefaultRights::H(_) = self {
13224 } else {
13226 *self = ArrayOfVectorOfEventInUnionWithDefaultRights::H(fidl::new_empty!(
13228 fidl::encoding::Array<
13229 fidl::encoding::Vector<
13230 fidl::encoding::HandleType<
13231 fidl::Event,
13232 { fidl::ObjectType::EVENT.into_raw() },
13233 53251,
13234 >,
13235 1,
13236 >,
13237 1,
13238 >,
13239 fidl::encoding::DefaultFuchsiaResourceDialect
13240 ));
13241 }
13242 #[allow(irrefutable_let_patterns)]
13243 if let ArrayOfVectorOfEventInUnionWithDefaultRights::H(ref mut val) = self {
13244 fidl::decode!(
13245 fidl::encoding::Array<
13246 fidl::encoding::Vector<
13247 fidl::encoding::HandleType<
13248 fidl::Event,
13249 { fidl::ObjectType::EVENT.into_raw() },
13250 53251,
13251 >,
13252 1,
13253 >,
13254 1,
13255 >,
13256 fidl::encoding::DefaultFuchsiaResourceDialect,
13257 val,
13258 decoder,
13259 _inner_offset,
13260 depth
13261 )?;
13262 } else {
13263 unreachable!()
13264 }
13265 }
13266 ordinal => panic!("unexpected ordinal {:?}", ordinal),
13267 }
13268 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13269 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13270 }
13271 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13272 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13273 }
13274 Ok(())
13275 }
13276 }
13277
13278 impl fidl::encoding::ResourceTypeMarker for ArrayOfVectorOfEventInUnionWithReducedRights {
13279 type Borrowed<'a> = &'a mut Self;
13280 fn take_or_borrow<'a>(
13281 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13282 ) -> Self::Borrowed<'a> {
13283 value
13284 }
13285 }
13286
13287 unsafe impl fidl::encoding::TypeMarker for ArrayOfVectorOfEventInUnionWithReducedRights {
13288 type Owned = Self;
13289
13290 #[inline(always)]
13291 fn inline_align(_context: fidl::encoding::Context) -> usize {
13292 8
13293 }
13294
13295 #[inline(always)]
13296 fn inline_size(_context: fidl::encoding::Context) -> usize {
13297 16
13298 }
13299 }
13300
13301 unsafe impl
13302 fidl::encoding::Encode<
13303 ArrayOfVectorOfEventInUnionWithReducedRights,
13304 fidl::encoding::DefaultFuchsiaResourceDialect,
13305 > for &mut ArrayOfVectorOfEventInUnionWithReducedRights
13306 {
13307 #[inline]
13308 unsafe fn encode(
13309 self,
13310 encoder: &mut fidl::encoding::Encoder<
13311 '_,
13312 fidl::encoding::DefaultFuchsiaResourceDialect,
13313 >,
13314 offset: usize,
13315 _depth: fidl::encoding::Depth,
13316 ) -> fidl::Result<()> {
13317 encoder.debug_check_bounds::<ArrayOfVectorOfEventInUnionWithReducedRights>(offset);
13318 encoder.write_num::<u64>(self.ordinal(), offset);
13319 match self {
13320 ArrayOfVectorOfEventInUnionWithReducedRights::H(ref mut val) => {
13321 fidl::encoding::encode_in_envelope::<
13322 fidl::encoding::Array<
13323 fidl::encoding::Vector<
13324 fidl::encoding::HandleType<
13325 fidl::Event,
13326 { fidl::ObjectType::EVENT.into_raw() },
13327 49155,
13328 >,
13329 1,
13330 >,
13331 1,
13332 >,
13333 fidl::encoding::DefaultFuchsiaResourceDialect,
13334 >(
13335 <fidl::encoding::Array<
13336 fidl::encoding::Vector<
13337 fidl::encoding::HandleType<
13338 fidl::Event,
13339 { fidl::ObjectType::EVENT.into_raw() },
13340 49155,
13341 >,
13342 1,
13343 >,
13344 1,
13345 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13346 val
13347 ),
13348 encoder,
13349 offset + 8,
13350 _depth,
13351 )
13352 }
13353 }
13354 }
13355 }
13356
13357 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13358 for ArrayOfVectorOfEventInUnionWithReducedRights
13359 {
13360 #[inline(always)]
13361 fn new_empty() -> Self {
13362 Self::H(fidl::new_empty!(
13363 fidl::encoding::Array<
13364 fidl::encoding::Vector<
13365 fidl::encoding::HandleType<
13366 fidl::Event,
13367 { fidl::ObjectType::EVENT.into_raw() },
13368 49155,
13369 >,
13370 1,
13371 >,
13372 1,
13373 >,
13374 fidl::encoding::DefaultFuchsiaResourceDialect
13375 ))
13376 }
13377
13378 #[inline]
13379 unsafe fn decode(
13380 &mut self,
13381 decoder: &mut fidl::encoding::Decoder<
13382 '_,
13383 fidl::encoding::DefaultFuchsiaResourceDialect,
13384 >,
13385 offset: usize,
13386 mut depth: fidl::encoding::Depth,
13387 ) -> fidl::Result<()> {
13388 decoder.debug_check_bounds::<Self>(offset);
13389 #[allow(unused_variables)]
13390 let next_out_of_line = decoder.next_out_of_line();
13391 let handles_before = decoder.remaining_handles();
13392 let (ordinal, inlined, num_bytes, num_handles) =
13393 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13394
13395 let member_inline_size = match ordinal {
13396 1 => <fidl::encoding::Array<
13397 fidl::encoding::Vector<
13398 fidl::encoding::HandleType<
13399 fidl::Event,
13400 { fidl::ObjectType::EVENT.into_raw() },
13401 49155,
13402 >,
13403 1,
13404 >,
13405 1,
13406 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13407 _ => return Err(fidl::Error::UnknownUnionTag),
13408 };
13409
13410 if inlined != (member_inline_size <= 4) {
13411 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13412 }
13413 let _inner_offset;
13414 if inlined {
13415 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13416 _inner_offset = offset + 8;
13417 } else {
13418 depth.increment()?;
13419 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13420 }
13421 match ordinal {
13422 1 => {
13423 #[allow(irrefutable_let_patterns)]
13424 if let ArrayOfVectorOfEventInUnionWithReducedRights::H(_) = self {
13425 } else {
13427 *self = ArrayOfVectorOfEventInUnionWithReducedRights::H(fidl::new_empty!(
13429 fidl::encoding::Array<
13430 fidl::encoding::Vector<
13431 fidl::encoding::HandleType<
13432 fidl::Event,
13433 { fidl::ObjectType::EVENT.into_raw() },
13434 49155,
13435 >,
13436 1,
13437 >,
13438 1,
13439 >,
13440 fidl::encoding::DefaultFuchsiaResourceDialect
13441 ));
13442 }
13443 #[allow(irrefutable_let_patterns)]
13444 if let ArrayOfVectorOfEventInUnionWithReducedRights::H(ref mut val) = self {
13445 fidl::decode!(
13446 fidl::encoding::Array<
13447 fidl::encoding::Vector<
13448 fidl::encoding::HandleType<
13449 fidl::Event,
13450 { fidl::ObjectType::EVENT.into_raw() },
13451 49155,
13452 >,
13453 1,
13454 >,
13455 1,
13456 >,
13457 fidl::encoding::DefaultFuchsiaResourceDialect,
13458 val,
13459 decoder,
13460 _inner_offset,
13461 depth
13462 )?;
13463 } else {
13464 unreachable!()
13465 }
13466 }
13467 ordinal => panic!("unexpected ordinal {:?}", ordinal),
13468 }
13469 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13470 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13471 }
13472 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13473 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13474 }
13475 Ok(())
13476 }
13477 }
13478
13479 impl fidl::encoding::ResourceTypeMarker for EnvelopeInliningTestUnion {
13480 type Borrowed<'a> = &'a mut Self;
13481 fn take_or_borrow<'a>(
13482 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13483 ) -> Self::Borrowed<'a> {
13484 value
13485 }
13486 }
13487
13488 unsafe impl fidl::encoding::TypeMarker for EnvelopeInliningTestUnion {
13489 type Owned = Self;
13490
13491 #[inline(always)]
13492 fn inline_align(_context: fidl::encoding::Context) -> usize {
13493 8
13494 }
13495
13496 #[inline(always)]
13497 fn inline_size(_context: fidl::encoding::Context) -> usize {
13498 16
13499 }
13500 }
13501
13502 unsafe impl
13503 fidl::encoding::Encode<
13504 EnvelopeInliningTestUnion,
13505 fidl::encoding::DefaultFuchsiaResourceDialect,
13506 > for &mut EnvelopeInliningTestUnion
13507 {
13508 #[inline]
13509 unsafe fn encode(
13510 self,
13511 encoder: &mut fidl::encoding::Encoder<
13512 '_,
13513 fidl::encoding::DefaultFuchsiaResourceDialect,
13514 >,
13515 offset: usize,
13516 _depth: fidl::encoding::Depth,
13517 ) -> fidl::Result<()> {
13518 encoder.debug_check_bounds::<EnvelopeInliningTestUnion>(offset);
13519 encoder.write_num::<u64>(self.ordinal(), offset);
13520 match self {
13521 EnvelopeInliningTestUnion::Small(ref val) => fidl::encoding::encode_in_envelope::<
13522 u32,
13523 fidl::encoding::DefaultFuchsiaResourceDialect,
13524 >(
13525 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13526 encoder,
13527 offset + 8,
13528 _depth,
13529 ),
13530 EnvelopeInliningTestUnion::Large(ref val) => fidl::encoding::encode_in_envelope::<
13531 u64,
13532 fidl::encoding::DefaultFuchsiaResourceDialect,
13533 >(
13534 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
13535 encoder,
13536 offset + 8,
13537 _depth,
13538 ),
13539 EnvelopeInliningTestUnion::Handle(ref mut val) => {
13540 fidl::encoding::encode_in_envelope::<
13541 fidl::encoding::HandleType<
13542 fidl::Handle,
13543 { fidl::ObjectType::NONE.into_raw() },
13544 2147483648,
13545 >,
13546 fidl::encoding::DefaultFuchsiaResourceDialect,
13547 >(
13548 <fidl::encoding::HandleType<
13549 fidl::Handle,
13550 { fidl::ObjectType::NONE.into_raw() },
13551 2147483648,
13552 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13553 val
13554 ),
13555 encoder,
13556 offset + 8,
13557 _depth,
13558 )
13559 }
13560 EnvelopeInliningTestUnion::__SourceBreaking { .. } => {
13561 Err(fidl::Error::UnknownUnionTag)
13562 }
13563 }
13564 }
13565 }
13566
13567 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13568 for EnvelopeInliningTestUnion
13569 {
13570 #[inline(always)]
13571 fn new_empty() -> Self {
13572 Self::__SourceBreaking { unknown_ordinal: 0 }
13573 }
13574
13575 #[inline]
13576 unsafe fn decode(
13577 &mut self,
13578 decoder: &mut fidl::encoding::Decoder<
13579 '_,
13580 fidl::encoding::DefaultFuchsiaResourceDialect,
13581 >,
13582 offset: usize,
13583 mut depth: fidl::encoding::Depth,
13584 ) -> fidl::Result<()> {
13585 decoder.debug_check_bounds::<Self>(offset);
13586 #[allow(unused_variables)]
13587 let next_out_of_line = decoder.next_out_of_line();
13588 let handles_before = decoder.remaining_handles();
13589 let (ordinal, inlined, num_bytes, num_handles) =
13590 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13591
13592 let member_inline_size = match ordinal {
13593 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13594 2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13595 3 => <fidl::encoding::HandleType<
13596 fidl::Handle,
13597 { fidl::ObjectType::NONE.into_raw() },
13598 2147483648,
13599 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13600 0 => return Err(fidl::Error::UnknownUnionTag),
13601 _ => num_bytes as usize,
13602 };
13603
13604 if inlined != (member_inline_size <= 4) {
13605 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13606 }
13607 let _inner_offset;
13608 if inlined {
13609 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13610 _inner_offset = offset + 8;
13611 } else {
13612 depth.increment()?;
13613 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13614 }
13615 match ordinal {
13616 1 => {
13617 #[allow(irrefutable_let_patterns)]
13618 if let EnvelopeInliningTestUnion::Small(_) = self {
13619 } else {
13621 *self = EnvelopeInliningTestUnion::Small(fidl::new_empty!(
13623 u32,
13624 fidl::encoding::DefaultFuchsiaResourceDialect
13625 ));
13626 }
13627 #[allow(irrefutable_let_patterns)]
13628 if let EnvelopeInliningTestUnion::Small(ref mut val) = self {
13629 fidl::decode!(
13630 u32,
13631 fidl::encoding::DefaultFuchsiaResourceDialect,
13632 val,
13633 decoder,
13634 _inner_offset,
13635 depth
13636 )?;
13637 } else {
13638 unreachable!()
13639 }
13640 }
13641 2 => {
13642 #[allow(irrefutable_let_patterns)]
13643 if let EnvelopeInliningTestUnion::Large(_) = self {
13644 } else {
13646 *self = EnvelopeInliningTestUnion::Large(fidl::new_empty!(
13648 u64,
13649 fidl::encoding::DefaultFuchsiaResourceDialect
13650 ));
13651 }
13652 #[allow(irrefutable_let_patterns)]
13653 if let EnvelopeInliningTestUnion::Large(ref mut val) = self {
13654 fidl::decode!(
13655 u64,
13656 fidl::encoding::DefaultFuchsiaResourceDialect,
13657 val,
13658 decoder,
13659 _inner_offset,
13660 depth
13661 )?;
13662 } else {
13663 unreachable!()
13664 }
13665 }
13666 3 => {
13667 #[allow(irrefutable_let_patterns)]
13668 if let EnvelopeInliningTestUnion::Handle(_) = self {
13669 } else {
13671 *self = EnvelopeInliningTestUnion::Handle(
13673 fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13674 );
13675 }
13676 #[allow(irrefutable_let_patterns)]
13677 if let EnvelopeInliningTestUnion::Handle(ref mut val) = self {
13678 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
13679 } else {
13680 unreachable!()
13681 }
13682 }
13683 #[allow(deprecated)]
13684 ordinal => {
13685 for _ in 0..num_handles {
13686 decoder.drop_next_handle()?;
13687 }
13688 *self =
13689 EnvelopeInliningTestUnion::__SourceBreaking { unknown_ordinal: ordinal };
13690 }
13691 }
13692 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13693 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13694 }
13695 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13696 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13697 }
13698 Ok(())
13699 }
13700 }
13701
13702 impl fidl::encoding::ResourceTypeMarker for SampleResourceXUnion {
13703 type Borrowed<'a> = &'a mut Self;
13704 fn take_or_borrow<'a>(
13705 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13706 ) -> Self::Borrowed<'a> {
13707 value
13708 }
13709 }
13710
13711 unsafe impl fidl::encoding::TypeMarker for SampleResourceXUnion {
13712 type Owned = Self;
13713
13714 #[inline(always)]
13715 fn inline_align(_context: fidl::encoding::Context) -> usize {
13716 8
13717 }
13718
13719 #[inline(always)]
13720 fn inline_size(_context: fidl::encoding::Context) -> usize {
13721 16
13722 }
13723 }
13724
13725 unsafe impl
13726 fidl::encoding::Encode<SampleResourceXUnion, fidl::encoding::DefaultFuchsiaResourceDialect>
13727 for &mut SampleResourceXUnion
13728 {
13729 #[inline]
13730 unsafe fn encode(
13731 self,
13732 encoder: &mut fidl::encoding::Encoder<
13733 '_,
13734 fidl::encoding::DefaultFuchsiaResourceDialect,
13735 >,
13736 offset: usize,
13737 _depth: fidl::encoding::Depth,
13738 ) -> fidl::Result<()> {
13739 encoder.debug_check_bounds::<SampleResourceXUnion>(offset);
13740 encoder.write_num::<u64>(self.ordinal(), offset);
13741 match self {
13742 SampleResourceXUnion::U(ref val) => fidl::encoding::encode_in_envelope::<
13743 u32,
13744 fidl::encoding::DefaultFuchsiaResourceDialect,
13745 >(
13746 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13747 encoder,
13748 offset + 8,
13749 _depth,
13750 ),
13751 SampleResourceXUnion::Su(ref val) => fidl::encoding::encode_in_envelope::<
13752 SimpleUnion,
13753 fidl::encoding::DefaultFuchsiaResourceDialect,
13754 >(
13755 <SimpleUnion as fidl::encoding::ValueTypeMarker>::borrow(val),
13756 encoder,
13757 offset + 8,
13758 _depth,
13759 ),
13760 SampleResourceXUnion::St(ref val) => fidl::encoding::encode_in_envelope::<
13761 SimpleTable,
13762 fidl::encoding::DefaultFuchsiaResourceDialect,
13763 >(
13764 <SimpleTable as fidl::encoding::ValueTypeMarker>::borrow(val),
13765 encoder,
13766 offset + 8,
13767 _depth,
13768 ),
13769 SampleResourceXUnion::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13770 }
13771 }
13772 }
13773
13774 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13775 for SampleResourceXUnion
13776 {
13777 #[inline(always)]
13778 fn new_empty() -> Self {
13779 Self::__SourceBreaking { unknown_ordinal: 0 }
13780 }
13781
13782 #[inline]
13783 unsafe fn decode(
13784 &mut self,
13785 decoder: &mut fidl::encoding::Decoder<
13786 '_,
13787 fidl::encoding::DefaultFuchsiaResourceDialect,
13788 >,
13789 offset: usize,
13790 mut depth: fidl::encoding::Depth,
13791 ) -> fidl::Result<()> {
13792 decoder.debug_check_bounds::<Self>(offset);
13793 #[allow(unused_variables)]
13794 let next_out_of_line = decoder.next_out_of_line();
13795 let handles_before = decoder.remaining_handles();
13796 let (ordinal, inlined, num_bytes, num_handles) =
13797 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13798
13799 let member_inline_size = match ordinal {
13800 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13801 2 => <SimpleUnion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13802 3 => <SimpleTable as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13803 0 => return Err(fidl::Error::UnknownUnionTag),
13804 _ => num_bytes as usize,
13805 };
13806
13807 if inlined != (member_inline_size <= 4) {
13808 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13809 }
13810 let _inner_offset;
13811 if inlined {
13812 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13813 _inner_offset = offset + 8;
13814 } else {
13815 depth.increment()?;
13816 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13817 }
13818 match ordinal {
13819 1 => {
13820 #[allow(irrefutable_let_patterns)]
13821 if let SampleResourceXUnion::U(_) = self {
13822 } else {
13824 *self = SampleResourceXUnion::U(fidl::new_empty!(
13826 u32,
13827 fidl::encoding::DefaultFuchsiaResourceDialect
13828 ));
13829 }
13830 #[allow(irrefutable_let_patterns)]
13831 if let SampleResourceXUnion::U(ref mut val) = self {
13832 fidl::decode!(
13833 u32,
13834 fidl::encoding::DefaultFuchsiaResourceDialect,
13835 val,
13836 decoder,
13837 _inner_offset,
13838 depth
13839 )?;
13840 } else {
13841 unreachable!()
13842 }
13843 }
13844 2 => {
13845 #[allow(irrefutable_let_patterns)]
13846 if let SampleResourceXUnion::Su(_) = self {
13847 } else {
13849 *self = SampleResourceXUnion::Su(fidl::new_empty!(
13851 SimpleUnion,
13852 fidl::encoding::DefaultFuchsiaResourceDialect
13853 ));
13854 }
13855 #[allow(irrefutable_let_patterns)]
13856 if let SampleResourceXUnion::Su(ref mut val) = self {
13857 fidl::decode!(
13858 SimpleUnion,
13859 fidl::encoding::DefaultFuchsiaResourceDialect,
13860 val,
13861 decoder,
13862 _inner_offset,
13863 depth
13864 )?;
13865 } else {
13866 unreachable!()
13867 }
13868 }
13869 3 => {
13870 #[allow(irrefutable_let_patterns)]
13871 if let SampleResourceXUnion::St(_) = self {
13872 } else {
13874 *self = SampleResourceXUnion::St(fidl::new_empty!(
13876 SimpleTable,
13877 fidl::encoding::DefaultFuchsiaResourceDialect
13878 ));
13879 }
13880 #[allow(irrefutable_let_patterns)]
13881 if let SampleResourceXUnion::St(ref mut val) = self {
13882 fidl::decode!(
13883 SimpleTable,
13884 fidl::encoding::DefaultFuchsiaResourceDialect,
13885 val,
13886 decoder,
13887 _inner_offset,
13888 depth
13889 )?;
13890 } else {
13891 unreachable!()
13892 }
13893 }
13894 #[allow(deprecated)]
13895 ordinal => {
13896 for _ in 0..num_handles {
13897 decoder.drop_next_handle()?;
13898 }
13899 *self = SampleResourceXUnion::__SourceBreaking { unknown_ordinal: ordinal };
13900 }
13901 }
13902 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13903 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13904 }
13905 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13906 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13907 }
13908 Ok(())
13909 }
13910 }
13911
13912 impl fidl::encoding::ResourceTypeMarker for SampleStrictResourceXUnion {
13913 type Borrowed<'a> = &'a mut Self;
13914 fn take_or_borrow<'a>(
13915 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13916 ) -> Self::Borrowed<'a> {
13917 value
13918 }
13919 }
13920
13921 unsafe impl fidl::encoding::TypeMarker for SampleStrictResourceXUnion {
13922 type Owned = Self;
13923
13924 #[inline(always)]
13925 fn inline_align(_context: fidl::encoding::Context) -> usize {
13926 8
13927 }
13928
13929 #[inline(always)]
13930 fn inline_size(_context: fidl::encoding::Context) -> usize {
13931 16
13932 }
13933 }
13934
13935 unsafe impl
13936 fidl::encoding::Encode<
13937 SampleStrictResourceXUnion,
13938 fidl::encoding::DefaultFuchsiaResourceDialect,
13939 > for &mut SampleStrictResourceXUnion
13940 {
13941 #[inline]
13942 unsafe fn encode(
13943 self,
13944 encoder: &mut fidl::encoding::Encoder<
13945 '_,
13946 fidl::encoding::DefaultFuchsiaResourceDialect,
13947 >,
13948 offset: usize,
13949 _depth: fidl::encoding::Depth,
13950 ) -> fidl::Result<()> {
13951 encoder.debug_check_bounds::<SampleStrictResourceXUnion>(offset);
13952 encoder.write_num::<u64>(self.ordinal(), offset);
13953 match self {
13954 SampleStrictResourceXUnion::U(ref val) => fidl::encoding::encode_in_envelope::<
13955 u32,
13956 fidl::encoding::DefaultFuchsiaResourceDialect,
13957 >(
13958 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
13959 encoder,
13960 offset + 8,
13961 _depth,
13962 ),
13963 SampleStrictResourceXUnion::Su(ref val) => fidl::encoding::encode_in_envelope::<
13964 SimpleUnion,
13965 fidl::encoding::DefaultFuchsiaResourceDialect,
13966 >(
13967 <SimpleUnion as fidl::encoding::ValueTypeMarker>::borrow(val),
13968 encoder,
13969 offset + 8,
13970 _depth,
13971 ),
13972 SampleStrictResourceXUnion::St(ref val) => fidl::encoding::encode_in_envelope::<
13973 SimpleTable,
13974 fidl::encoding::DefaultFuchsiaResourceDialect,
13975 >(
13976 <SimpleTable as fidl::encoding::ValueTypeMarker>::borrow(val),
13977 encoder,
13978 offset + 8,
13979 _depth,
13980 ),
13981 }
13982 }
13983 }
13984
13985 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13986 for SampleStrictResourceXUnion
13987 {
13988 #[inline(always)]
13989 fn new_empty() -> Self {
13990 Self::U(fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect))
13991 }
13992
13993 #[inline]
13994 unsafe fn decode(
13995 &mut self,
13996 decoder: &mut fidl::encoding::Decoder<
13997 '_,
13998 fidl::encoding::DefaultFuchsiaResourceDialect,
13999 >,
14000 offset: usize,
14001 mut depth: fidl::encoding::Depth,
14002 ) -> fidl::Result<()> {
14003 decoder.debug_check_bounds::<Self>(offset);
14004 #[allow(unused_variables)]
14005 let next_out_of_line = decoder.next_out_of_line();
14006 let handles_before = decoder.remaining_handles();
14007 let (ordinal, inlined, num_bytes, num_handles) =
14008 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14009
14010 let member_inline_size = match ordinal {
14011 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14012 2 => <SimpleUnion as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14013 3 => <SimpleTable as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14014 _ => return Err(fidl::Error::UnknownUnionTag),
14015 };
14016
14017 if inlined != (member_inline_size <= 4) {
14018 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14019 }
14020 let _inner_offset;
14021 if inlined {
14022 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14023 _inner_offset = offset + 8;
14024 } else {
14025 depth.increment()?;
14026 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14027 }
14028 match ordinal {
14029 1 => {
14030 #[allow(irrefutable_let_patterns)]
14031 if let SampleStrictResourceXUnion::U(_) = self {
14032 } else {
14034 *self = SampleStrictResourceXUnion::U(fidl::new_empty!(
14036 u32,
14037 fidl::encoding::DefaultFuchsiaResourceDialect
14038 ));
14039 }
14040 #[allow(irrefutable_let_patterns)]
14041 if let SampleStrictResourceXUnion::U(ref mut val) = self {
14042 fidl::decode!(
14043 u32,
14044 fidl::encoding::DefaultFuchsiaResourceDialect,
14045 val,
14046 decoder,
14047 _inner_offset,
14048 depth
14049 )?;
14050 } else {
14051 unreachable!()
14052 }
14053 }
14054 2 => {
14055 #[allow(irrefutable_let_patterns)]
14056 if let SampleStrictResourceXUnion::Su(_) = self {
14057 } else {
14059 *self = SampleStrictResourceXUnion::Su(fidl::new_empty!(
14061 SimpleUnion,
14062 fidl::encoding::DefaultFuchsiaResourceDialect
14063 ));
14064 }
14065 #[allow(irrefutable_let_patterns)]
14066 if let SampleStrictResourceXUnion::Su(ref mut val) = self {
14067 fidl::decode!(
14068 SimpleUnion,
14069 fidl::encoding::DefaultFuchsiaResourceDialect,
14070 val,
14071 decoder,
14072 _inner_offset,
14073 depth
14074 )?;
14075 } else {
14076 unreachable!()
14077 }
14078 }
14079 3 => {
14080 #[allow(irrefutable_let_patterns)]
14081 if let SampleStrictResourceXUnion::St(_) = self {
14082 } else {
14084 *self = SampleStrictResourceXUnion::St(fidl::new_empty!(
14086 SimpleTable,
14087 fidl::encoding::DefaultFuchsiaResourceDialect
14088 ));
14089 }
14090 #[allow(irrefutable_let_patterns)]
14091 if let SampleStrictResourceXUnion::St(ref mut val) = self {
14092 fidl::decode!(
14093 SimpleTable,
14094 fidl::encoding::DefaultFuchsiaResourceDialect,
14095 val,
14096 decoder,
14097 _inner_offset,
14098 depth
14099 )?;
14100 } else {
14101 unreachable!()
14102 }
14103 }
14104 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14105 }
14106 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14107 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14108 }
14109 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14110 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14111 }
14112 Ok(())
14113 }
14114 }
14115
14116 impl fidl::encoding::ResourceTypeMarker for UnionOfEndpointsUnion {
14117 type Borrowed<'a> = &'a mut Self;
14118 fn take_or_borrow<'a>(
14119 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14120 ) -> Self::Borrowed<'a> {
14121 value
14122 }
14123 }
14124
14125 unsafe impl fidl::encoding::TypeMarker for UnionOfEndpointsUnion {
14126 type Owned = Self;
14127
14128 #[inline(always)]
14129 fn inline_align(_context: fidl::encoding::Context) -> usize {
14130 8
14131 }
14132
14133 #[inline(always)]
14134 fn inline_size(_context: fidl::encoding::Context) -> usize {
14135 16
14136 }
14137 }
14138
14139 unsafe impl
14140 fidl::encoding::Encode<UnionOfEndpointsUnion, fidl::encoding::DefaultFuchsiaResourceDialect>
14141 for &mut UnionOfEndpointsUnion
14142 {
14143 #[inline]
14144 unsafe fn encode(
14145 self,
14146 encoder: &mut fidl::encoding::Encoder<
14147 '_,
14148 fidl::encoding::DefaultFuchsiaResourceDialect,
14149 >,
14150 offset: usize,
14151 _depth: fidl::encoding::Depth,
14152 ) -> fidl::Result<()> {
14153 encoder.debug_check_bounds::<UnionOfEndpointsUnion>(offset);
14154 encoder.write_num::<u64>(self.ordinal(), offset);
14155 match self {
14156 UnionOfEndpointsUnion::ClientEnd(ref mut val) => {
14157 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14158 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14159 encoder, offset + 8, _depth
14160 )
14161 }
14162 UnionOfEndpointsUnion::ServerEnd(ref mut val) => {
14163 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14164 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14165 encoder, offset + 8, _depth
14166 )
14167 }
14168 UnionOfEndpointsUnion::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14169 }
14170 }
14171 }
14172
14173 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14174 for UnionOfEndpointsUnion
14175 {
14176 #[inline(always)]
14177 fn new_empty() -> Self {
14178 Self::__SourceBreaking { unknown_ordinal: 0 }
14179 }
14180
14181 #[inline]
14182 unsafe fn decode(
14183 &mut self,
14184 decoder: &mut fidl::encoding::Decoder<
14185 '_,
14186 fidl::encoding::DefaultFuchsiaResourceDialect,
14187 >,
14188 offset: usize,
14189 mut depth: fidl::encoding::Depth,
14190 ) -> fidl::Result<()> {
14191 decoder.debug_check_bounds::<Self>(offset);
14192 #[allow(unused_variables)]
14193 let next_out_of_line = decoder.next_out_of_line();
14194 let handles_before = decoder.remaining_handles();
14195 let (ordinal, inlined, num_bytes, num_handles) =
14196 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14197
14198 let member_inline_size = match ordinal {
14199 1 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14200 2 => <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14201 0 => return Err(fidl::Error::UnknownUnionTag),
14202 _ => num_bytes as usize,
14203 };
14204
14205 if inlined != (member_inline_size <= 4) {
14206 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14207 }
14208 let _inner_offset;
14209 if inlined {
14210 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14211 _inner_offset = offset + 8;
14212 } else {
14213 depth.increment()?;
14214 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14215 }
14216 match ordinal {
14217 1 => {
14218 #[allow(irrefutable_let_patterns)]
14219 if let UnionOfEndpointsUnion::ClientEnd(_) = self {
14220 } else {
14222 *self = UnionOfEndpointsUnion::ClientEnd(fidl::new_empty!(
14224 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
14225 fidl::encoding::DefaultFuchsiaResourceDialect
14226 ));
14227 }
14228 #[allow(irrefutable_let_patterns)]
14229 if let UnionOfEndpointsUnion::ClientEnd(ref mut val) = self {
14230 fidl::decode!(
14231 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ProtocolMarker>>,
14232 fidl::encoding::DefaultFuchsiaResourceDialect,
14233 val,
14234 decoder,
14235 _inner_offset,
14236 depth
14237 )?;
14238 } else {
14239 unreachable!()
14240 }
14241 }
14242 2 => {
14243 #[allow(irrefutable_let_patterns)]
14244 if let UnionOfEndpointsUnion::ServerEnd(_) = self {
14245 } else {
14247 *self = UnionOfEndpointsUnion::ServerEnd(fidl::new_empty!(
14249 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
14250 fidl::encoding::DefaultFuchsiaResourceDialect
14251 ));
14252 }
14253 #[allow(irrefutable_let_patterns)]
14254 if let UnionOfEndpointsUnion::ServerEnd(ref mut val) = self {
14255 fidl::decode!(
14256 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ProtocolMarker>>,
14257 fidl::encoding::DefaultFuchsiaResourceDialect,
14258 val,
14259 decoder,
14260 _inner_offset,
14261 depth
14262 )?;
14263 } else {
14264 unreachable!()
14265 }
14266 }
14267 #[allow(deprecated)]
14268 ordinal => {
14269 for _ in 0..num_handles {
14270 decoder.drop_next_handle()?;
14271 }
14272 *self = UnionOfEndpointsUnion::__SourceBreaking { unknown_ordinal: ordinal };
14273 }
14274 }
14275 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14276 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14277 }
14278 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14279 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14280 }
14281 Ok(())
14282 }
14283 }
14284
14285 impl fidl::encoding::ResourceTypeMarker for UnionOfHandle {
14286 type Borrowed<'a> = &'a mut Self;
14287 fn take_or_borrow<'a>(
14288 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14289 ) -> Self::Borrowed<'a> {
14290 value
14291 }
14292 }
14293
14294 unsafe impl fidl::encoding::TypeMarker for UnionOfHandle {
14295 type Owned = Self;
14296
14297 #[inline(always)]
14298 fn inline_align(_context: fidl::encoding::Context) -> usize {
14299 8
14300 }
14301
14302 #[inline(always)]
14303 fn inline_size(_context: fidl::encoding::Context) -> usize {
14304 16
14305 }
14306 }
14307
14308 unsafe impl fidl::encoding::Encode<UnionOfHandle, fidl::encoding::DefaultFuchsiaResourceDialect>
14309 for &mut UnionOfHandle
14310 {
14311 #[inline]
14312 unsafe fn encode(
14313 self,
14314 encoder: &mut fidl::encoding::Encoder<
14315 '_,
14316 fidl::encoding::DefaultFuchsiaResourceDialect,
14317 >,
14318 offset: usize,
14319 _depth: fidl::encoding::Depth,
14320 ) -> fidl::Result<()> {
14321 encoder.debug_check_bounds::<UnionOfHandle>(offset);
14322 encoder.write_num::<u64>(self.ordinal(), offset);
14323 match self {
14324 UnionOfHandle::H(ref mut val) => fidl::encoding::encode_in_envelope::<
14325 fidl::encoding::HandleType<
14326 fidl::Handle,
14327 { fidl::ObjectType::NONE.into_raw() },
14328 2147483648,
14329 >,
14330 fidl::encoding::DefaultFuchsiaResourceDialect,
14331 >(
14332 <fidl::encoding::HandleType<
14333 fidl::Handle,
14334 { fidl::ObjectType::NONE.into_raw() },
14335 2147483648,
14336 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14337 val
14338 ),
14339 encoder,
14340 offset + 8,
14341 _depth,
14342 ),
14343 }
14344 }
14345 }
14346
14347 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for UnionOfHandle {
14348 #[inline(always)]
14349 fn new_empty() -> Self {
14350 Self::H(
14351 fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14352 )
14353 }
14354
14355 #[inline]
14356 unsafe fn decode(
14357 &mut self,
14358 decoder: &mut fidl::encoding::Decoder<
14359 '_,
14360 fidl::encoding::DefaultFuchsiaResourceDialect,
14361 >,
14362 offset: usize,
14363 mut depth: fidl::encoding::Depth,
14364 ) -> fidl::Result<()> {
14365 decoder.debug_check_bounds::<Self>(offset);
14366 #[allow(unused_variables)]
14367 let next_out_of_line = decoder.next_out_of_line();
14368 let handles_before = decoder.remaining_handles();
14369 let (ordinal, inlined, num_bytes, num_handles) =
14370 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14371
14372 let member_inline_size = match ordinal {
14373 1 => <fidl::encoding::HandleType<
14374 fidl::Handle,
14375 { fidl::ObjectType::NONE.into_raw() },
14376 2147483648,
14377 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14378 _ => return Err(fidl::Error::UnknownUnionTag),
14379 };
14380
14381 if inlined != (member_inline_size <= 4) {
14382 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14383 }
14384 let _inner_offset;
14385 if inlined {
14386 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14387 _inner_offset = offset + 8;
14388 } else {
14389 depth.increment()?;
14390 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14391 }
14392 match ordinal {
14393 1 => {
14394 #[allow(irrefutable_let_patterns)]
14395 if let UnionOfHandle::H(_) = self {
14396 } else {
14398 *self = UnionOfHandle::H(
14400 fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14401 );
14402 }
14403 #[allow(irrefutable_let_patterns)]
14404 if let UnionOfHandle::H(ref mut val) = self {
14405 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14406 } else {
14407 unreachable!()
14408 }
14409 }
14410 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14411 }
14412 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14413 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14414 }
14415 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14416 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14417 }
14418 Ok(())
14419 }
14420 }
14421
14422 impl fidl::encoding::ResourceTypeMarker for UnionWithVector {
14423 type Borrowed<'a> = &'a mut Self;
14424 fn take_or_borrow<'a>(
14425 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14426 ) -> Self::Borrowed<'a> {
14427 value
14428 }
14429 }
14430
14431 unsafe impl fidl::encoding::TypeMarker for UnionWithVector {
14432 type Owned = Self;
14433
14434 #[inline(always)]
14435 fn inline_align(_context: fidl::encoding::Context) -> usize {
14436 8
14437 }
14438
14439 #[inline(always)]
14440 fn inline_size(_context: fidl::encoding::Context) -> usize {
14441 16
14442 }
14443 }
14444
14445 unsafe impl
14446 fidl::encoding::Encode<UnionWithVector, fidl::encoding::DefaultFuchsiaResourceDialect>
14447 for &mut UnionWithVector
14448 {
14449 #[inline]
14450 unsafe fn encode(
14451 self,
14452 encoder: &mut fidl::encoding::Encoder<
14453 '_,
14454 fidl::encoding::DefaultFuchsiaResourceDialect,
14455 >,
14456 offset: usize,
14457 _depth: fidl::encoding::Depth,
14458 ) -> fidl::Result<()> {
14459 encoder.debug_check_bounds::<UnionWithVector>(offset);
14460 encoder.write_num::<u64>(self.ordinal(), offset);
14461 match self {
14462 UnionWithVector::Unused(ref val) => {
14463 fidl::encoding::encode_in_envelope::<u8, fidl::encoding::DefaultFuchsiaResourceDialect>(
14464 <u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
14465 encoder, offset + 8, _depth
14466 )
14467 }
14468 UnionWithVector::VectorOfUint8(ref val) => {
14469 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14470 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
14471 encoder, offset + 8, _depth
14472 )
14473 }
14474 UnionWithVector::S(ref val) => {
14475 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedString, fidl::encoding::DefaultFuchsiaResourceDialect>(
14476 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(val),
14477 encoder, offset + 8, _depth
14478 )
14479 }
14480 UnionWithVector::VectorS3A1(ref val) => {
14481 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<StructSize3Align1>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14482 <fidl::encoding::UnboundedVector<StructSize3Align1> as fidl::encoding::ValueTypeMarker>::borrow(val),
14483 encoder, offset + 8, _depth
14484 )
14485 }
14486 UnionWithVector::VectorS3A2(ref val) => {
14487 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<StructSize3Align2>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14488 <fidl::encoding::UnboundedVector<StructSize3Align2> as fidl::encoding::ValueTypeMarker>::borrow(val),
14489 encoder, offset + 8, _depth
14490 )
14491 }
14492 UnionWithVector::Handles(ref mut val) => {
14493 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14494 <fidl::encoding::UnboundedVector<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14495 encoder, offset + 8, _depth
14496 )
14497 }
14498 UnionWithVector::ArrayS3A1(ref val) => {
14499 fidl::encoding::encode_in_envelope::<fidl::encoding::Array<StructSize3Align1, 2>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14500 <fidl::encoding::Array<StructSize3Align1, 2> as fidl::encoding::ValueTypeMarker>::borrow(val),
14501 encoder, offset + 8, _depth
14502 )
14503 }
14504 UnionWithVector::ArrayS3A2(ref val) => {
14505 fidl::encoding::encode_in_envelope::<fidl::encoding::Array<StructSize3Align2, 2>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14506 <fidl::encoding::Array<StructSize3Align2, 2> as fidl::encoding::ValueTypeMarker>::borrow(val),
14507 encoder, offset + 8, _depth
14508 )
14509 }
14510 UnionWithVector::VectorUnion(ref val) => {
14511 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<UnionSize8Align4>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14512 <fidl::encoding::UnboundedVector<UnionSize8Align4> as fidl::encoding::ValueTypeMarker>::borrow(val),
14513 encoder, offset + 8, _depth
14514 )
14515 }
14516 }
14517 }
14518 }
14519
14520 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14521 for UnionWithVector
14522 {
14523 #[inline(always)]
14524 fn new_empty() -> Self {
14525 Self::Unused(fidl::new_empty!(u8, fidl::encoding::DefaultFuchsiaResourceDialect))
14526 }
14527
14528 #[inline]
14529 unsafe fn decode(
14530 &mut self,
14531 decoder: &mut fidl::encoding::Decoder<
14532 '_,
14533 fidl::encoding::DefaultFuchsiaResourceDialect,
14534 >,
14535 offset: usize,
14536 mut depth: fidl::encoding::Depth,
14537 ) -> fidl::Result<()> {
14538 decoder.debug_check_bounds::<Self>(offset);
14539 #[allow(unused_variables)]
14540 let next_out_of_line = decoder.next_out_of_line();
14541 let handles_before = decoder.remaining_handles();
14542 let (ordinal, inlined, num_bytes, num_handles) =
14543 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14544
14545 let member_inline_size = match ordinal {
14546 1 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14547 2 => <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14548 3 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14549 4 => <fidl::encoding::UnboundedVector<StructSize3Align1> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14550 5 => <fidl::encoding::UnboundedVector<StructSize3Align2> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14551 6 => <fidl::encoding::UnboundedVector<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14552 7 => <fidl::encoding::Array<StructSize3Align1, 2> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14553 8 => <fidl::encoding::Array<StructSize3Align2, 2> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14554 9 => <fidl::encoding::UnboundedVector<UnionSize8Align4> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14555 _ => return Err(fidl::Error::UnknownUnionTag),
14556 };
14557
14558 if inlined != (member_inline_size <= 4) {
14559 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14560 }
14561 let _inner_offset;
14562 if inlined {
14563 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14564 _inner_offset = offset + 8;
14565 } else {
14566 depth.increment()?;
14567 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14568 }
14569 match ordinal {
14570 1 => {
14571 #[allow(irrefutable_let_patterns)]
14572 if let UnionWithVector::Unused(_) = self {
14573 } else {
14575 *self = UnionWithVector::Unused(fidl::new_empty!(
14577 u8,
14578 fidl::encoding::DefaultFuchsiaResourceDialect
14579 ));
14580 }
14581 #[allow(irrefutable_let_patterns)]
14582 if let UnionWithVector::Unused(ref mut val) = self {
14583 fidl::decode!(
14584 u8,
14585 fidl::encoding::DefaultFuchsiaResourceDialect,
14586 val,
14587 decoder,
14588 _inner_offset,
14589 depth
14590 )?;
14591 } else {
14592 unreachable!()
14593 }
14594 }
14595 2 => {
14596 #[allow(irrefutable_let_patterns)]
14597 if let UnionWithVector::VectorOfUint8(_) = self {
14598 } else {
14600 *self = UnionWithVector::VectorOfUint8(fidl::new_empty!(
14602 fidl::encoding::UnboundedVector<u8>,
14603 fidl::encoding::DefaultFuchsiaResourceDialect
14604 ));
14605 }
14606 #[allow(irrefutable_let_patterns)]
14607 if let UnionWithVector::VectorOfUint8(ref mut val) = self {
14608 fidl::decode!(
14609 fidl::encoding::UnboundedVector<u8>,
14610 fidl::encoding::DefaultFuchsiaResourceDialect,
14611 val,
14612 decoder,
14613 _inner_offset,
14614 depth
14615 )?;
14616 } else {
14617 unreachable!()
14618 }
14619 }
14620 3 => {
14621 #[allow(irrefutable_let_patterns)]
14622 if let UnionWithVector::S(_) = self {
14623 } else {
14625 *self = UnionWithVector::S(fidl::new_empty!(
14627 fidl::encoding::UnboundedString,
14628 fidl::encoding::DefaultFuchsiaResourceDialect
14629 ));
14630 }
14631 #[allow(irrefutable_let_patterns)]
14632 if let UnionWithVector::S(ref mut val) = self {
14633 fidl::decode!(
14634 fidl::encoding::UnboundedString,
14635 fidl::encoding::DefaultFuchsiaResourceDialect,
14636 val,
14637 decoder,
14638 _inner_offset,
14639 depth
14640 )?;
14641 } else {
14642 unreachable!()
14643 }
14644 }
14645 4 => {
14646 #[allow(irrefutable_let_patterns)]
14647 if let UnionWithVector::VectorS3A1(_) = self {
14648 } else {
14650 *self = UnionWithVector::VectorS3A1(fidl::new_empty!(
14652 fidl::encoding::UnboundedVector<StructSize3Align1>,
14653 fidl::encoding::DefaultFuchsiaResourceDialect
14654 ));
14655 }
14656 #[allow(irrefutable_let_patterns)]
14657 if let UnionWithVector::VectorS3A1(ref mut val) = self {
14658 fidl::decode!(
14659 fidl::encoding::UnboundedVector<StructSize3Align1>,
14660 fidl::encoding::DefaultFuchsiaResourceDialect,
14661 val,
14662 decoder,
14663 _inner_offset,
14664 depth
14665 )?;
14666 } else {
14667 unreachable!()
14668 }
14669 }
14670 5 => {
14671 #[allow(irrefutable_let_patterns)]
14672 if let UnionWithVector::VectorS3A2(_) = self {
14673 } else {
14675 *self = UnionWithVector::VectorS3A2(fidl::new_empty!(
14677 fidl::encoding::UnboundedVector<StructSize3Align2>,
14678 fidl::encoding::DefaultFuchsiaResourceDialect
14679 ));
14680 }
14681 #[allow(irrefutable_let_patterns)]
14682 if let UnionWithVector::VectorS3A2(ref mut val) = self {
14683 fidl::decode!(
14684 fidl::encoding::UnboundedVector<StructSize3Align2>,
14685 fidl::encoding::DefaultFuchsiaResourceDialect,
14686 val,
14687 decoder,
14688 _inner_offset,
14689 depth
14690 )?;
14691 } else {
14692 unreachable!()
14693 }
14694 }
14695 6 => {
14696 #[allow(irrefutable_let_patterns)]
14697 if let UnionWithVector::Handles(_) = self {
14698 } else {
14700 *self = UnionWithVector::Handles(fidl::new_empty!(
14702 fidl::encoding::UnboundedVector<
14703 fidl::encoding::HandleType<
14704 fidl::Handle,
14705 { fidl::ObjectType::NONE.into_raw() },
14706 2147483648,
14707 >,
14708 >,
14709 fidl::encoding::DefaultFuchsiaResourceDialect
14710 ));
14711 }
14712 #[allow(irrefutable_let_patterns)]
14713 if let UnionWithVector::Handles(ref mut val) = self {
14714 fidl::decode!(
14715 fidl::encoding::UnboundedVector<
14716 fidl::encoding::HandleType<
14717 fidl::Handle,
14718 { fidl::ObjectType::NONE.into_raw() },
14719 2147483648,
14720 >,
14721 >,
14722 fidl::encoding::DefaultFuchsiaResourceDialect,
14723 val,
14724 decoder,
14725 _inner_offset,
14726 depth
14727 )?;
14728 } else {
14729 unreachable!()
14730 }
14731 }
14732 7 => {
14733 #[allow(irrefutable_let_patterns)]
14734 if let UnionWithVector::ArrayS3A1(_) = self {
14735 } else {
14737 *self = UnionWithVector::ArrayS3A1(
14739 fidl::new_empty!(fidl::encoding::Array<StructSize3Align1, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
14740 );
14741 }
14742 #[allow(irrefutable_let_patterns)]
14743 if let UnionWithVector::ArrayS3A1(ref mut val) = self {
14744 fidl::decode!(fidl::encoding::Array<StructSize3Align1, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14745 } else {
14746 unreachable!()
14747 }
14748 }
14749 8 => {
14750 #[allow(irrefutable_let_patterns)]
14751 if let UnionWithVector::ArrayS3A2(_) = self {
14752 } else {
14754 *self = UnionWithVector::ArrayS3A2(
14756 fidl::new_empty!(fidl::encoding::Array<StructSize3Align2, 2>, fidl::encoding::DefaultFuchsiaResourceDialect),
14757 );
14758 }
14759 #[allow(irrefutable_let_patterns)]
14760 if let UnionWithVector::ArrayS3A2(ref mut val) = self {
14761 fidl::decode!(fidl::encoding::Array<StructSize3Align2, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14762 } else {
14763 unreachable!()
14764 }
14765 }
14766 9 => {
14767 #[allow(irrefutable_let_patterns)]
14768 if let UnionWithVector::VectorUnion(_) = self {
14769 } else {
14771 *self = UnionWithVector::VectorUnion(fidl::new_empty!(
14773 fidl::encoding::UnboundedVector<UnionSize8Align4>,
14774 fidl::encoding::DefaultFuchsiaResourceDialect
14775 ));
14776 }
14777 #[allow(irrefutable_let_patterns)]
14778 if let UnionWithVector::VectorUnion(ref mut val) = self {
14779 fidl::decode!(
14780 fidl::encoding::UnboundedVector<UnionSize8Align4>,
14781 fidl::encoding::DefaultFuchsiaResourceDialect,
14782 val,
14783 decoder,
14784 _inner_offset,
14785 depth
14786 )?;
14787 } else {
14788 unreachable!()
14789 }
14790 }
14791 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14792 }
14793 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14794 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14795 }
14796 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14797 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14798 }
14799 Ok(())
14800 }
14801 }
14802
14803 impl fidl::encoding::ResourceTypeMarker for VectorOfArrayOfEventInUnionWithReducedRights {
14804 type Borrowed<'a> = &'a mut Self;
14805 fn take_or_borrow<'a>(
14806 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14807 ) -> Self::Borrowed<'a> {
14808 value
14809 }
14810 }
14811
14812 unsafe impl fidl::encoding::TypeMarker for VectorOfArrayOfEventInUnionWithReducedRights {
14813 type Owned = Self;
14814
14815 #[inline(always)]
14816 fn inline_align(_context: fidl::encoding::Context) -> usize {
14817 8
14818 }
14819
14820 #[inline(always)]
14821 fn inline_size(_context: fidl::encoding::Context) -> usize {
14822 16
14823 }
14824 }
14825
14826 unsafe impl
14827 fidl::encoding::Encode<
14828 VectorOfArrayOfEventInUnionWithReducedRights,
14829 fidl::encoding::DefaultFuchsiaResourceDialect,
14830 > for &mut VectorOfArrayOfEventInUnionWithReducedRights
14831 {
14832 #[inline]
14833 unsafe fn encode(
14834 self,
14835 encoder: &mut fidl::encoding::Encoder<
14836 '_,
14837 fidl::encoding::DefaultFuchsiaResourceDialect,
14838 >,
14839 offset: usize,
14840 _depth: fidl::encoding::Depth,
14841 ) -> fidl::Result<()> {
14842 encoder.debug_check_bounds::<VectorOfArrayOfEventInUnionWithReducedRights>(offset);
14843 encoder.write_num::<u64>(self.ordinal(), offset);
14844 match self {
14845 VectorOfArrayOfEventInUnionWithReducedRights::H(ref mut val) => {
14846 fidl::encoding::encode_in_envelope::<
14847 fidl::encoding::Vector<
14848 fidl::encoding::Array<
14849 fidl::encoding::HandleType<
14850 fidl::Event,
14851 { fidl::ObjectType::EVENT.into_raw() },
14852 49155,
14853 >,
14854 1,
14855 >,
14856 1,
14857 >,
14858 fidl::encoding::DefaultFuchsiaResourceDialect,
14859 >(
14860 <fidl::encoding::Vector<
14861 fidl::encoding::Array<
14862 fidl::encoding::HandleType<
14863 fidl::Event,
14864 { fidl::ObjectType::EVENT.into_raw() },
14865 49155,
14866 >,
14867 1,
14868 >,
14869 1,
14870 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14871 val
14872 ),
14873 encoder,
14874 offset + 8,
14875 _depth,
14876 )
14877 }
14878 }
14879 }
14880 }
14881
14882 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14883 for VectorOfArrayOfEventInUnionWithReducedRights
14884 {
14885 #[inline(always)]
14886 fn new_empty() -> Self {
14887 Self::H(fidl::new_empty!(
14888 fidl::encoding::Vector<
14889 fidl::encoding::Array<
14890 fidl::encoding::HandleType<
14891 fidl::Event,
14892 { fidl::ObjectType::EVENT.into_raw() },
14893 49155,
14894 >,
14895 1,
14896 >,
14897 1,
14898 >,
14899 fidl::encoding::DefaultFuchsiaResourceDialect
14900 ))
14901 }
14902
14903 #[inline]
14904 unsafe fn decode(
14905 &mut self,
14906 decoder: &mut fidl::encoding::Decoder<
14907 '_,
14908 fidl::encoding::DefaultFuchsiaResourceDialect,
14909 >,
14910 offset: usize,
14911 mut depth: fidl::encoding::Depth,
14912 ) -> fidl::Result<()> {
14913 decoder.debug_check_bounds::<Self>(offset);
14914 #[allow(unused_variables)]
14915 let next_out_of_line = decoder.next_out_of_line();
14916 let handles_before = decoder.remaining_handles();
14917 let (ordinal, inlined, num_bytes, num_handles) =
14918 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14919
14920 let member_inline_size = match ordinal {
14921 1 => <fidl::encoding::Vector<
14922 fidl::encoding::Array<
14923 fidl::encoding::HandleType<
14924 fidl::Event,
14925 { fidl::ObjectType::EVENT.into_raw() },
14926 49155,
14927 >,
14928 1,
14929 >,
14930 1,
14931 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14932 _ => return Err(fidl::Error::UnknownUnionTag),
14933 };
14934
14935 if inlined != (member_inline_size <= 4) {
14936 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14937 }
14938 let _inner_offset;
14939 if inlined {
14940 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14941 _inner_offset = offset + 8;
14942 } else {
14943 depth.increment()?;
14944 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14945 }
14946 match ordinal {
14947 1 => {
14948 #[allow(irrefutable_let_patterns)]
14949 if let VectorOfArrayOfEventInUnionWithReducedRights::H(_) = self {
14950 } else {
14952 *self = VectorOfArrayOfEventInUnionWithReducedRights::H(fidl::new_empty!(
14954 fidl::encoding::Vector<
14955 fidl::encoding::Array<
14956 fidl::encoding::HandleType<
14957 fidl::Event,
14958 { fidl::ObjectType::EVENT.into_raw() },
14959 49155,
14960 >,
14961 1,
14962 >,
14963 1,
14964 >,
14965 fidl::encoding::DefaultFuchsiaResourceDialect
14966 ));
14967 }
14968 #[allow(irrefutable_let_patterns)]
14969 if let VectorOfArrayOfEventInUnionWithReducedRights::H(ref mut val) = self {
14970 fidl::decode!(
14971 fidl::encoding::Vector<
14972 fidl::encoding::Array<
14973 fidl::encoding::HandleType<
14974 fidl::Event,
14975 { fidl::ObjectType::EVENT.into_raw() },
14976 49155,
14977 >,
14978 1,
14979 >,
14980 1,
14981 >,
14982 fidl::encoding::DefaultFuchsiaResourceDialect,
14983 val,
14984 decoder,
14985 _inner_offset,
14986 depth
14987 )?;
14988 } else {
14989 unreachable!()
14990 }
14991 }
14992 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14993 }
14994 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14995 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14996 }
14997 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14998 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14999 }
15000 Ok(())
15001 }
15002 }
15003}