1#![warn(clippy::all)]
7#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
8
9use bitflags::bitflags;
10use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub enum SocketDisposition {
16 NoChange,
17 WriteEnabled,
18 WriteDisabled,
19 #[doc(hidden)]
20 __SourceBreaking {
21 unknown_ordinal: u32,
22 },
23}
24
25#[macro_export]
27macro_rules! SocketDispositionUnknown {
28 () => {
29 _
30 };
31}
32
33impl SocketDisposition {
34 #[inline]
35 pub fn from_primitive(prim: u32) -> Option<Self> {
36 match prim {
37 0 => Some(Self::NoChange),
38 1 => Some(Self::WriteEnabled),
39 2 => Some(Self::WriteDisabled),
40 _ => None,
41 }
42 }
43
44 #[inline]
45 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
46 match prim {
47 0 => Self::NoChange,
48 1 => Self::WriteEnabled,
49 2 => Self::WriteDisabled,
50 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
51 }
52 }
53
54 #[inline]
55 pub fn unknown() -> Self {
56 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
57 }
58
59 #[inline]
60 pub const fn into_primitive(self) -> u32 {
61 match self {
62 Self::NoChange => 0,
63 Self::WriteEnabled => 1,
64 Self::WriteDisabled => 2,
65 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
66 }
67 }
68
69 #[inline]
70 pub fn is_unknown(&self) -> bool {
71 match self {
72 Self::__SourceBreaking { unknown_ordinal: _ } => true,
73 _ => false,
74 }
75 }
76}
77
78#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
79pub enum SocketType {
80 Stream,
81 Datagram,
82 #[doc(hidden)]
83 __SourceBreaking {
84 unknown_ordinal: u32,
85 },
86}
87
88#[macro_export]
90macro_rules! SocketTypeUnknown {
91 () => {
92 _
93 };
94}
95
96impl SocketType {
97 #[inline]
98 pub fn from_primitive(prim: u32) -> Option<Self> {
99 match prim {
100 0 => Some(Self::Stream),
101 1 => Some(Self::Datagram),
102 _ => None,
103 }
104 }
105
106 #[inline]
107 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
108 match prim {
109 0 => Self::Stream,
110 1 => Self::Datagram,
111 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
112 }
113 }
114
115 #[inline]
116 pub fn unknown() -> Self {
117 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
118 }
119
120 #[inline]
121 pub const fn into_primitive(self) -> u32 {
122 match self {
123 Self::Stream => 0,
124 Self::Datagram => 1,
125 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
126 }
127 }
128
129 #[inline]
130 pub fn is_unknown(&self) -> bool {
131 match self {
132 Self::__SourceBreaking { unknown_ordinal: _ } => true,
133 _ => false,
134 }
135 }
136}
137
138#[derive(Clone, Debug, PartialEq)]
139pub struct AioStopped {
140 pub error: Option<Box<Error>>,
141}
142
143impl fidl::Persistable for AioStopped {}
144
145#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146#[repr(C)]
147pub struct BadHandleId {
148 pub id: u32,
149}
150
151impl fidl::Persistable for BadHandleId {}
152
153#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
154#[repr(C)]
155pub struct ChannelCreateChannelRequest {
156 pub handles: [NewHandleId; 2],
157}
158
159impl fidl::Persistable for ChannelCreateChannelRequest {}
160
161#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
162pub struct ChannelMessage {
163 pub data: Vec<u8>,
164 pub handles: Vec<HandleInfo>,
165}
166
167impl fidl::Persistable for ChannelMessage {}
168
169#[derive(Clone, Debug, PartialEq)]
170pub struct ChannelOnChannelStreamingDataRequest {
171 pub handle: HandleId,
172 pub channel_sent: ChannelSent,
173}
174
175impl fidl::Persistable for ChannelOnChannelStreamingDataRequest {}
176
177#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178#[repr(C)]
179pub struct ChannelReadChannelRequest {
180 pub handle: HandleId,
181}
182
183impl fidl::Persistable for ChannelReadChannelRequest {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186#[repr(C)]
187pub struct ChannelReadChannelStreamingStartRequest {
188 pub handle: HandleId,
189}
190
191impl fidl::Persistable for ChannelReadChannelStreamingStartRequest {}
192
193#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
194#[repr(C)]
195pub struct ChannelReadChannelStreamingStopRequest {
196 pub handle: HandleId,
197}
198
199impl fidl::Persistable for ChannelReadChannelStreamingStopRequest {}
200
201#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
202pub struct ChannelWriteChannelRequest {
203 pub handle: HandleId,
204 pub data: Vec<u8>,
205 pub handles: Handles,
206}
207
208impl fidl::Persistable for ChannelWriteChannelRequest {}
209
210#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
211pub struct ClosedDuringRead;
212
213impl fidl::Persistable for ClosedDuringRead {}
214
215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216pub struct ErrorPending;
217
218impl fidl::Persistable for ErrorPending {}
219
220#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221#[repr(C)]
222pub struct EventCreateEventRequest {
223 pub handle: NewHandleId,
224}
225
226impl fidl::Persistable for EventCreateEventRequest {}
227
228#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
229#[repr(C)]
230pub struct EventPairCreateEventPairRequest {
231 pub handles: [NewHandleId; 2],
232}
233
234impl fidl::Persistable for EventPairCreateEventPairRequest {}
235
236#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237#[repr(C)]
238pub struct FDomainAcknowledgeWriteErrorRequest {
239 pub handle: HandleId,
240}
241
242impl fidl::Persistable for FDomainAcknowledgeWriteErrorRequest {}
243
244#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
245pub struct FDomainCloseRequest {
246 pub handles: Vec<HandleId>,
247}
248
249impl fidl::Persistable for FDomainCloseRequest {}
250
251#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
252pub struct FDomainDuplicateRequest {
253 pub handle: HandleId,
254 pub new_handle: NewHandleId,
255 pub rights: fidl::Rights,
256}
257
258impl fidl::Persistable for FDomainDuplicateRequest {}
259
260#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
261#[repr(C)]
262pub struct FDomainGetNamespaceRequest {
263 pub new_handle: NewHandleId,
264}
265
266impl fidl::Persistable for FDomainGetNamespaceRequest {}
267
268#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
269pub struct FDomainReplaceRequest {
270 pub handle: HandleId,
271 pub new_handle: NewHandleId,
272 pub rights: fidl::Rights,
273}
274
275impl fidl::Persistable for FDomainReplaceRequest {}
276
277#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
278#[repr(C)]
279pub struct FDomainSignalPeerRequest {
280 pub handle: HandleId,
281 pub set: u32,
282 pub clear: u32,
283}
284
285impl fidl::Persistable for FDomainSignalPeerRequest {}
286
287#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
288#[repr(C)]
289pub struct FDomainSignalRequest {
290 pub handle: HandleId,
291 pub set: u32,
292 pub clear: u32,
293}
294
295impl fidl::Persistable for FDomainSignalRequest {}
296
297#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
298#[repr(C)]
299pub struct FDomainWaitForSignalsRequest {
300 pub handle: HandleId,
301 pub signals: u32,
302}
303
304impl fidl::Persistable for FDomainWaitForSignalsRequest {}
305
306#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
307#[repr(C)]
308pub struct FDomainWaitForSignalsResponse {
309 pub signals: u32,
310}
311
312impl fidl::Persistable for FDomainWaitForSignalsResponse {}
313
314#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
315pub struct HandleDisposition {
316 pub handle: HandleOp,
317 pub rights: fidl::Rights,
318}
319
320impl fidl::Persistable for HandleDisposition {}
321
322#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
323#[repr(C)]
324pub struct HandleId {
325 pub id: u32,
326}
327
328impl fidl::Persistable for HandleId {}
329
330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
331pub struct HandleInfo {
332 pub handle: HandleId,
333 pub type_: fidl::ObjectType,
334 pub rights: fidl::Rights,
335}
336
337impl fidl::Persistable for HandleInfo {}
338
339#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
340#[repr(C)]
341pub struct NewHandleId {
342 pub id: u32,
343}
344
345impl fidl::Persistable for NewHandleId {}
346
347#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
348#[repr(C)]
349pub struct NewHandleIdOutOfRange {
350 pub id: u32,
351}
352
353impl fidl::Persistable for NewHandleIdOutOfRange {}
354
355#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
356pub struct NewHandleIdReused {
357 pub id: u32,
358 pub same_call: bool,
359}
360
361impl fidl::Persistable for NewHandleIdReused {}
362
363#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
364pub struct NoErrorPending;
365
366impl fidl::Persistable for NoErrorPending {}
367
368#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
369pub struct NoReadInProgress;
370
371impl fidl::Persistable for NoReadInProgress {}
372
373#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
374pub struct RightsUnknown {
375 pub rights: fidl::Rights,
376}
377
378impl fidl::Persistable for RightsUnknown {}
379
380#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
381#[repr(C)]
382pub struct SignalsUnknown {
383 pub signals: u32,
384}
385
386impl fidl::Persistable for SignalsUnknown {}
387
388#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
389pub struct SocketCreateSocketRequest {
390 pub options: SocketType,
391 pub handles: [NewHandleId; 2],
392}
393
394impl fidl::Persistable for SocketCreateSocketRequest {}
395
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397pub struct SocketDispositionUnknown {
398 pub disposition: SocketDisposition,
399}
400
401impl fidl::Persistable for SocketDispositionUnknown {}
402
403#[derive(Clone, Debug, PartialEq)]
404pub struct SocketOnSocketStreamingDataRequest {
405 pub handle: HandleId,
406 pub socket_message: SocketMessage,
407}
408
409impl fidl::Persistable for SocketOnSocketStreamingDataRequest {}
410
411#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
412#[repr(C)]
413pub struct SocketReadSocketRequest {
414 pub handle: HandleId,
415 pub max_bytes: u64,
416}
417
418impl fidl::Persistable for SocketReadSocketRequest {}
419
420#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
421#[repr(C)]
422pub struct SocketReadSocketStreamingStartRequest {
423 pub handle: HandleId,
424}
425
426impl fidl::Persistable for SocketReadSocketStreamingStartRequest {}
427
428#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
429#[repr(C)]
430pub struct SocketReadSocketStreamingStopRequest {
431 pub handle: HandleId,
432}
433
434impl fidl::Persistable for SocketReadSocketStreamingStopRequest {}
435
436#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
437pub struct SocketSetSocketDispositionRequest {
438 pub handle: HandleId,
439 pub disposition: SocketDisposition,
440 pub disposition_peer: SocketDisposition,
441}
442
443impl fidl::Persistable for SocketSetSocketDispositionRequest {}
444
445#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
446pub struct SocketTypeUnknown {
447 pub type_: SocketType,
448}
449
450impl fidl::Persistable for SocketTypeUnknown {}
451
452#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
453pub struct SocketWriteSocketRequest {
454 pub handle: HandleId,
455 pub data: Vec<u8>,
456}
457
458impl fidl::Persistable for SocketWriteSocketRequest {}
459
460#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
461pub struct SocketReadSocketResponse {
462 pub data: Vec<u8>,
463}
464
465impl fidl::Persistable for SocketReadSocketResponse {}
466
467#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
468#[repr(C)]
469pub struct SocketWriteSocketResponse {
470 pub wrote: u64,
471}
472
473impl fidl::Persistable for SocketWriteSocketResponse {}
474
475#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
476pub struct StreamingReadInProgress;
477
478impl fidl::Persistable for StreamingReadInProgress {}
479
480#[derive(Clone, Debug, PartialEq)]
481pub struct WriteSocketError {
482 pub error: Error,
483 pub wrote: u64,
484}
485
486impl fidl::Persistable for WriteSocketError {}
487
488#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
489pub struct WrongHandleType {
490 pub expected: fidl::ObjectType,
491 pub got: fidl::ObjectType,
492}
493
494impl fidl::Persistable for WrongHandleType {}
495
496#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
497pub struct WroteToSelf;
498
499impl fidl::Persistable for WroteToSelf {}
500
501#[derive(Clone, Debug)]
502pub enum ChannelSent {
503 Message(ChannelMessage),
504 Stopped(AioStopped),
505 #[doc(hidden)]
506 __SourceBreaking {
507 unknown_ordinal: u64,
508 },
509}
510
511#[macro_export]
513macro_rules! ChannelSentUnknown {
514 () => {
515 _
516 };
517}
518
519impl PartialEq for ChannelSent {
521 fn eq(&self, other: &Self) -> bool {
522 match (self, other) {
523 (Self::Message(x), Self::Message(y)) => *x == *y,
524 (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
525 _ => false,
526 }
527 }
528}
529
530impl ChannelSent {
531 #[inline]
532 pub fn ordinal(&self) -> u64 {
533 match *self {
534 Self::Message(_) => 1,
535 Self::Stopped(_) => 2,
536 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
537 }
538 }
539
540 #[inline]
541 pub fn unknown_variant_for_testing() -> Self {
542 Self::__SourceBreaking { unknown_ordinal: 0 }
543 }
544
545 #[inline]
546 pub fn is_unknown(&self) -> bool {
547 match self {
548 Self::__SourceBreaking { .. } => true,
549 _ => false,
550 }
551 }
552}
553
554impl fidl::Persistable for ChannelSent {}
555
556#[derive(Clone, Debug)]
557pub enum Error {
558 TargetError(i32),
559 BadHandleId(BadHandleId),
560 NewHandleIdOutOfRange(NewHandleIdOutOfRange),
561 NewHandleIdReused(NewHandleIdReused),
562 WrongHandleType(WrongHandleType),
563 StreamingReadInProgress(StreamingReadInProgress),
564 NoReadInProgress(NoReadInProgress),
565 ErrorPending(ErrorPending),
566 NoErrorPending(NoErrorPending),
567 WroteToSelf(WroteToSelf),
568 ClosedDuringRead(ClosedDuringRead),
569 SignalsUnknown(SignalsUnknown),
570 RightsUnknown(RightsUnknown),
571 SocketDispositionUnknown(SocketDispositionUnknown),
572 SocketTypeUnknown(SocketTypeUnknown),
573 #[doc(hidden)]
574 __SourceBreaking {
575 unknown_ordinal: u64,
576 },
577}
578
579#[macro_export]
581macro_rules! ErrorUnknown {
582 () => {
583 _
584 };
585}
586
587impl PartialEq for Error {
589 fn eq(&self, other: &Self) -> bool {
590 match (self, other) {
591 (Self::TargetError(x), Self::TargetError(y)) => *x == *y,
592 (Self::BadHandleId(x), Self::BadHandleId(y)) => *x == *y,
593 (Self::NewHandleIdOutOfRange(x), Self::NewHandleIdOutOfRange(y)) => *x == *y,
594 (Self::NewHandleIdReused(x), Self::NewHandleIdReused(y)) => *x == *y,
595 (Self::WrongHandleType(x), Self::WrongHandleType(y)) => *x == *y,
596 (Self::StreamingReadInProgress(x), Self::StreamingReadInProgress(y)) => *x == *y,
597 (Self::NoReadInProgress(x), Self::NoReadInProgress(y)) => *x == *y,
598 (Self::ErrorPending(x), Self::ErrorPending(y)) => *x == *y,
599 (Self::NoErrorPending(x), Self::NoErrorPending(y)) => *x == *y,
600 (Self::WroteToSelf(x), Self::WroteToSelf(y)) => *x == *y,
601 (Self::ClosedDuringRead(x), Self::ClosedDuringRead(y)) => *x == *y,
602 (Self::SignalsUnknown(x), Self::SignalsUnknown(y)) => *x == *y,
603 (Self::RightsUnknown(x), Self::RightsUnknown(y)) => *x == *y,
604 (Self::SocketDispositionUnknown(x), Self::SocketDispositionUnknown(y)) => *x == *y,
605 (Self::SocketTypeUnknown(x), Self::SocketTypeUnknown(y)) => *x == *y,
606 _ => false,
607 }
608 }
609}
610
611impl Error {
612 #[inline]
613 pub fn ordinal(&self) -> u64 {
614 match *self {
615 Self::TargetError(_) => 1,
616 Self::BadHandleId(_) => 2,
617 Self::NewHandleIdOutOfRange(_) => 3,
618 Self::NewHandleIdReused(_) => 4,
619 Self::WrongHandleType(_) => 5,
620 Self::StreamingReadInProgress(_) => 6,
621 Self::NoReadInProgress(_) => 7,
622 Self::ErrorPending(_) => 8,
623 Self::NoErrorPending(_) => 9,
624 Self::WroteToSelf(_) => 10,
625 Self::ClosedDuringRead(_) => 11,
626 Self::SignalsUnknown(_) => 12,
627 Self::RightsUnknown(_) => 13,
628 Self::SocketDispositionUnknown(_) => 14,
629 Self::SocketTypeUnknown(_) => 15,
630 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
631 }
632 }
633
634 #[inline]
635 pub fn unknown_variant_for_testing() -> Self {
636 Self::__SourceBreaking { unknown_ordinal: 0 }
637 }
638
639 #[inline]
640 pub fn is_unknown(&self) -> bool {
641 match self {
642 Self::__SourceBreaking { .. } => true,
643 _ => false,
644 }
645 }
646}
647
648impl fidl::Persistable for Error {}
649
650#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
651pub enum HandleOp {
652 Move_(HandleId),
653 Duplicate(HandleId),
654}
655
656impl HandleOp {
657 #[inline]
658 pub fn ordinal(&self) -> u64 {
659 match *self {
660 Self::Move_(_) => 1,
661 Self::Duplicate(_) => 2,
662 }
663 }
664
665 #[deprecated = "Strict unions should not use `is_unknown`"]
666 #[inline]
667 pub fn is_unknown(&self) -> bool {
668 false
669 }
670}
671
672impl fidl::Persistable for HandleOp {}
673
674#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
675pub enum Handles {
676 Handles(Vec<HandleId>),
677 Dispositions(Vec<HandleDisposition>),
678}
679
680impl Handles {
681 #[inline]
682 pub fn ordinal(&self) -> u64 {
683 match *self {
684 Self::Handles(_) => 1,
685 Self::Dispositions(_) => 2,
686 }
687 }
688
689 #[deprecated = "Strict unions should not use `is_unknown`"]
690 #[inline]
691 pub fn is_unknown(&self) -> bool {
692 false
693 }
694}
695
696impl fidl::Persistable for Handles {}
697
698#[derive(Clone, Debug)]
699pub enum SocketMessage {
700 Data(Vec<u8>),
701 Stopped(AioStopped),
702 #[doc(hidden)]
703 __SourceBreaking {
704 unknown_ordinal: u64,
705 },
706}
707
708#[macro_export]
710macro_rules! SocketMessageUnknown {
711 () => {
712 _
713 };
714}
715
716impl PartialEq for SocketMessage {
718 fn eq(&self, other: &Self) -> bool {
719 match (self, other) {
720 (Self::Data(x), Self::Data(y)) => *x == *y,
721 (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
722 _ => false,
723 }
724 }
725}
726
727impl SocketMessage {
728 #[inline]
729 pub fn ordinal(&self) -> u64 {
730 match *self {
731 Self::Data(_) => 1,
732 Self::Stopped(_) => 2,
733 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
734 }
735 }
736
737 #[inline]
738 pub fn unknown_variant_for_testing() -> Self {
739 Self::__SourceBreaking { unknown_ordinal: 0 }
740 }
741
742 #[inline]
743 pub fn is_unknown(&self) -> bool {
744 match self {
745 Self::__SourceBreaking { .. } => true,
746 _ => false,
747 }
748 }
749}
750
751impl fidl::Persistable for SocketMessage {}
752
753#[derive(Clone, Debug, PartialEq)]
754pub enum WriteChannelError {
755 Error(Error),
756 OpErrors(Vec<Option<Box<Error>>>),
757}
758
759impl WriteChannelError {
760 #[inline]
761 pub fn ordinal(&self) -> u64 {
762 match *self {
763 Self::Error(_) => 1,
764 Self::OpErrors(_) => 2,
765 }
766 }
767
768 #[deprecated = "Strict unions should not use `is_unknown`"]
769 #[inline]
770 pub fn is_unknown(&self) -> bool {
771 false
772 }
773}
774
775impl fidl::Persistable for WriteChannelError {}
776
777mod internal {
778 use super::*;
779 unsafe impl fidl::encoding::TypeMarker for SocketDisposition {
780 type Owned = Self;
781
782 #[inline(always)]
783 fn inline_align(_context: fidl::encoding::Context) -> usize {
784 std::mem::align_of::<u32>()
785 }
786
787 #[inline(always)]
788 fn inline_size(_context: fidl::encoding::Context) -> usize {
789 std::mem::size_of::<u32>()
790 }
791
792 #[inline(always)]
793 fn encode_is_copy() -> bool {
794 false
795 }
796
797 #[inline(always)]
798 fn decode_is_copy() -> bool {
799 false
800 }
801 }
802
803 impl fidl::encoding::ValueTypeMarker for SocketDisposition {
804 type Borrowed<'a> = Self;
805 #[inline(always)]
806 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
807 *value
808 }
809 }
810
811 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
812 for SocketDisposition
813 {
814 #[inline]
815 unsafe fn encode(
816 self,
817 encoder: &mut fidl::encoding::Encoder<'_, D>,
818 offset: usize,
819 _depth: fidl::encoding::Depth,
820 ) -> fidl::Result<()> {
821 encoder.debug_check_bounds::<Self>(offset);
822 encoder.write_num(self.into_primitive(), offset);
823 Ok(())
824 }
825 }
826
827 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketDisposition {
828 #[inline(always)]
829 fn new_empty() -> Self {
830 Self::unknown()
831 }
832
833 #[inline]
834 unsafe fn decode(
835 &mut self,
836 decoder: &mut fidl::encoding::Decoder<'_, D>,
837 offset: usize,
838 _depth: fidl::encoding::Depth,
839 ) -> fidl::Result<()> {
840 decoder.debug_check_bounds::<Self>(offset);
841 let prim = decoder.read_num::<u32>(offset);
842
843 *self = Self::from_primitive_allow_unknown(prim);
844 Ok(())
845 }
846 }
847 unsafe impl fidl::encoding::TypeMarker for SocketType {
848 type Owned = Self;
849
850 #[inline(always)]
851 fn inline_align(_context: fidl::encoding::Context) -> usize {
852 std::mem::align_of::<u32>()
853 }
854
855 #[inline(always)]
856 fn inline_size(_context: fidl::encoding::Context) -> usize {
857 std::mem::size_of::<u32>()
858 }
859
860 #[inline(always)]
861 fn encode_is_copy() -> bool {
862 false
863 }
864
865 #[inline(always)]
866 fn decode_is_copy() -> bool {
867 false
868 }
869 }
870
871 impl fidl::encoding::ValueTypeMarker for SocketType {
872 type Borrowed<'a> = Self;
873 #[inline(always)]
874 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
875 *value
876 }
877 }
878
879 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SocketType {
880 #[inline]
881 unsafe fn encode(
882 self,
883 encoder: &mut fidl::encoding::Encoder<'_, D>,
884 offset: usize,
885 _depth: fidl::encoding::Depth,
886 ) -> fidl::Result<()> {
887 encoder.debug_check_bounds::<Self>(offset);
888 encoder.write_num(self.into_primitive(), offset);
889 Ok(())
890 }
891 }
892
893 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketType {
894 #[inline(always)]
895 fn new_empty() -> Self {
896 Self::unknown()
897 }
898
899 #[inline]
900 unsafe fn decode(
901 &mut self,
902 decoder: &mut fidl::encoding::Decoder<'_, D>,
903 offset: usize,
904 _depth: fidl::encoding::Depth,
905 ) -> fidl::Result<()> {
906 decoder.debug_check_bounds::<Self>(offset);
907 let prim = decoder.read_num::<u32>(offset);
908
909 *self = Self::from_primitive_allow_unknown(prim);
910 Ok(())
911 }
912 }
913
914 impl fidl::encoding::ValueTypeMarker for AioStopped {
915 type Borrowed<'a> = &'a Self;
916 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
917 value
918 }
919 }
920
921 unsafe impl fidl::encoding::TypeMarker for AioStopped {
922 type Owned = Self;
923
924 #[inline(always)]
925 fn inline_align(_context: fidl::encoding::Context) -> usize {
926 8
927 }
928
929 #[inline(always)]
930 fn inline_size(_context: fidl::encoding::Context) -> usize {
931 16
932 }
933 }
934
935 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AioStopped, D>
936 for &AioStopped
937 {
938 #[inline]
939 unsafe fn encode(
940 self,
941 encoder: &mut fidl::encoding::Encoder<'_, D>,
942 offset: usize,
943 _depth: fidl::encoding::Depth,
944 ) -> fidl::Result<()> {
945 encoder.debug_check_bounds::<AioStopped>(offset);
946 fidl::encoding::Encode::<AioStopped, D>::encode(
948 (
949 <fidl::encoding::OptionalUnion<Error> as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
950 ),
951 encoder, offset, _depth
952 )
953 }
954 }
955 unsafe impl<
956 D: fidl::encoding::ResourceDialect,
957 T0: fidl::encoding::Encode<fidl::encoding::OptionalUnion<Error>, D>,
958 > fidl::encoding::Encode<AioStopped, D> for (T0,)
959 {
960 #[inline]
961 unsafe fn encode(
962 self,
963 encoder: &mut fidl::encoding::Encoder<'_, D>,
964 offset: usize,
965 depth: fidl::encoding::Depth,
966 ) -> fidl::Result<()> {
967 encoder.debug_check_bounds::<AioStopped>(offset);
968 self.0.encode(encoder, offset + 0, depth)?;
972 Ok(())
973 }
974 }
975
976 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AioStopped {
977 #[inline(always)]
978 fn new_empty() -> Self {
979 Self { error: fidl::new_empty!(fidl::encoding::OptionalUnion<Error>, D) }
980 }
981
982 #[inline]
983 unsafe fn decode(
984 &mut self,
985 decoder: &mut fidl::encoding::Decoder<'_, D>,
986 offset: usize,
987 _depth: fidl::encoding::Depth,
988 ) -> fidl::Result<()> {
989 decoder.debug_check_bounds::<Self>(offset);
990 fidl::decode!(
992 fidl::encoding::OptionalUnion<Error>,
993 D,
994 &mut self.error,
995 decoder,
996 offset + 0,
997 _depth
998 )?;
999 Ok(())
1000 }
1001 }
1002
1003 impl fidl::encoding::ValueTypeMarker for BadHandleId {
1004 type Borrowed<'a> = &'a Self;
1005 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1006 value
1007 }
1008 }
1009
1010 unsafe impl fidl::encoding::TypeMarker for BadHandleId {
1011 type Owned = Self;
1012
1013 #[inline(always)]
1014 fn inline_align(_context: fidl::encoding::Context) -> usize {
1015 4
1016 }
1017
1018 #[inline(always)]
1019 fn inline_size(_context: fidl::encoding::Context) -> usize {
1020 4
1021 }
1022 #[inline(always)]
1023 fn encode_is_copy() -> bool {
1024 true
1025 }
1026
1027 #[inline(always)]
1028 fn decode_is_copy() -> bool {
1029 true
1030 }
1031 }
1032
1033 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BadHandleId, D>
1034 for &BadHandleId
1035 {
1036 #[inline]
1037 unsafe fn encode(
1038 self,
1039 encoder: &mut fidl::encoding::Encoder<'_, D>,
1040 offset: usize,
1041 _depth: fidl::encoding::Depth,
1042 ) -> fidl::Result<()> {
1043 encoder.debug_check_bounds::<BadHandleId>(offset);
1044 unsafe {
1045 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1047 (buf_ptr as *mut BadHandleId).write_unaligned((self as *const BadHandleId).read());
1048 }
1051 Ok(())
1052 }
1053 }
1054 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1055 fidl::encoding::Encode<BadHandleId, D> for (T0,)
1056 {
1057 #[inline]
1058 unsafe fn encode(
1059 self,
1060 encoder: &mut fidl::encoding::Encoder<'_, D>,
1061 offset: usize,
1062 depth: fidl::encoding::Depth,
1063 ) -> fidl::Result<()> {
1064 encoder.debug_check_bounds::<BadHandleId>(offset);
1065 self.0.encode(encoder, offset + 0, depth)?;
1069 Ok(())
1070 }
1071 }
1072
1073 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BadHandleId {
1074 #[inline(always)]
1075 fn new_empty() -> Self {
1076 Self { id: fidl::new_empty!(u32, D) }
1077 }
1078
1079 #[inline]
1080 unsafe fn decode(
1081 &mut self,
1082 decoder: &mut fidl::encoding::Decoder<'_, D>,
1083 offset: usize,
1084 _depth: fidl::encoding::Depth,
1085 ) -> fidl::Result<()> {
1086 decoder.debug_check_bounds::<Self>(offset);
1087 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1088 unsafe {
1091 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1092 }
1093 Ok(())
1094 }
1095 }
1096
1097 impl fidl::encoding::ValueTypeMarker for ChannelCreateChannelRequest {
1098 type Borrowed<'a> = &'a Self;
1099 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1100 value
1101 }
1102 }
1103
1104 unsafe impl fidl::encoding::TypeMarker for ChannelCreateChannelRequest {
1105 type Owned = Self;
1106
1107 #[inline(always)]
1108 fn inline_align(_context: fidl::encoding::Context) -> usize {
1109 4
1110 }
1111
1112 #[inline(always)]
1113 fn inline_size(_context: fidl::encoding::Context) -> usize {
1114 8
1115 }
1116 #[inline(always)]
1117 fn encode_is_copy() -> bool {
1118 true
1119 }
1120
1121 #[inline(always)]
1122 fn decode_is_copy() -> bool {
1123 true
1124 }
1125 }
1126
1127 unsafe impl<D: fidl::encoding::ResourceDialect>
1128 fidl::encoding::Encode<ChannelCreateChannelRequest, D> for &ChannelCreateChannelRequest
1129 {
1130 #[inline]
1131 unsafe fn encode(
1132 self,
1133 encoder: &mut fidl::encoding::Encoder<'_, D>,
1134 offset: usize,
1135 _depth: fidl::encoding::Depth,
1136 ) -> fidl::Result<()> {
1137 encoder.debug_check_bounds::<ChannelCreateChannelRequest>(offset);
1138 unsafe {
1139 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1141 (buf_ptr as *mut ChannelCreateChannelRequest)
1142 .write_unaligned((self as *const ChannelCreateChannelRequest).read());
1143 }
1146 Ok(())
1147 }
1148 }
1149 unsafe impl<
1150 D: fidl::encoding::ResourceDialect,
1151 T0: fidl::encoding::Encode<fidl::encoding::Array<NewHandleId, 2>, D>,
1152 > fidl::encoding::Encode<ChannelCreateChannelRequest, D> for (T0,)
1153 {
1154 #[inline]
1155 unsafe fn encode(
1156 self,
1157 encoder: &mut fidl::encoding::Encoder<'_, D>,
1158 offset: usize,
1159 depth: fidl::encoding::Depth,
1160 ) -> fidl::Result<()> {
1161 encoder.debug_check_bounds::<ChannelCreateChannelRequest>(offset);
1162 self.0.encode(encoder, offset + 0, depth)?;
1166 Ok(())
1167 }
1168 }
1169
1170 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1171 for ChannelCreateChannelRequest
1172 {
1173 #[inline(always)]
1174 fn new_empty() -> Self {
1175 Self { handles: fidl::new_empty!(fidl::encoding::Array<NewHandleId, 2>, D) }
1176 }
1177
1178 #[inline]
1179 unsafe fn decode(
1180 &mut self,
1181 decoder: &mut fidl::encoding::Decoder<'_, D>,
1182 offset: usize,
1183 _depth: fidl::encoding::Depth,
1184 ) -> fidl::Result<()> {
1185 decoder.debug_check_bounds::<Self>(offset);
1186 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1187 unsafe {
1190 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1191 }
1192 Ok(())
1193 }
1194 }
1195
1196 impl fidl::encoding::ValueTypeMarker for ChannelMessage {
1197 type Borrowed<'a> = &'a Self;
1198 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1199 value
1200 }
1201 }
1202
1203 unsafe impl fidl::encoding::TypeMarker for ChannelMessage {
1204 type Owned = Self;
1205
1206 #[inline(always)]
1207 fn inline_align(_context: fidl::encoding::Context) -> usize {
1208 8
1209 }
1210
1211 #[inline(always)]
1212 fn inline_size(_context: fidl::encoding::Context) -> usize {
1213 32
1214 }
1215 }
1216
1217 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelMessage, D>
1218 for &ChannelMessage
1219 {
1220 #[inline]
1221 unsafe fn encode(
1222 self,
1223 encoder: &mut fidl::encoding::Encoder<'_, D>,
1224 offset: usize,
1225 _depth: fidl::encoding::Depth,
1226 ) -> fidl::Result<()> {
1227 encoder.debug_check_bounds::<ChannelMessage>(offset);
1228 fidl::encoding::Encode::<ChannelMessage, D>::encode(
1230 (
1231 <fidl::encoding::Vector<u8, 65536> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1232 <fidl::encoding::Vector<HandleInfo, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
1233 ),
1234 encoder, offset, _depth
1235 )
1236 }
1237 }
1238 unsafe impl<
1239 D: fidl::encoding::ResourceDialect,
1240 T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 65536>, D>,
1241 T1: fidl::encoding::Encode<fidl::encoding::Vector<HandleInfo, 64>, D>,
1242 > fidl::encoding::Encode<ChannelMessage, D> for (T0, T1)
1243 {
1244 #[inline]
1245 unsafe fn encode(
1246 self,
1247 encoder: &mut fidl::encoding::Encoder<'_, D>,
1248 offset: usize,
1249 depth: fidl::encoding::Depth,
1250 ) -> fidl::Result<()> {
1251 encoder.debug_check_bounds::<ChannelMessage>(offset);
1252 self.0.encode(encoder, offset + 0, depth)?;
1256 self.1.encode(encoder, offset + 16, depth)?;
1257 Ok(())
1258 }
1259 }
1260
1261 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelMessage {
1262 #[inline(always)]
1263 fn new_empty() -> Self {
1264 Self {
1265 data: fidl::new_empty!(fidl::encoding::Vector<u8, 65536>, D),
1266 handles: fidl::new_empty!(fidl::encoding::Vector<HandleInfo, 64>, D),
1267 }
1268 }
1269
1270 #[inline]
1271 unsafe fn decode(
1272 &mut self,
1273 decoder: &mut fidl::encoding::Decoder<'_, D>,
1274 offset: usize,
1275 _depth: fidl::encoding::Depth,
1276 ) -> fidl::Result<()> {
1277 decoder.debug_check_bounds::<Self>(offset);
1278 fidl::decode!(fidl::encoding::Vector<u8, 65536>, D, &mut self.data, decoder, offset + 0, _depth)?;
1280 fidl::decode!(fidl::encoding::Vector<HandleInfo, 64>, D, &mut self.handles, decoder, offset + 16, _depth)?;
1281 Ok(())
1282 }
1283 }
1284
1285 impl fidl::encoding::ValueTypeMarker for ChannelOnChannelStreamingDataRequest {
1286 type Borrowed<'a> = &'a Self;
1287 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1288 value
1289 }
1290 }
1291
1292 unsafe impl fidl::encoding::TypeMarker for ChannelOnChannelStreamingDataRequest {
1293 type Owned = Self;
1294
1295 #[inline(always)]
1296 fn inline_align(_context: fidl::encoding::Context) -> usize {
1297 8
1298 }
1299
1300 #[inline(always)]
1301 fn inline_size(_context: fidl::encoding::Context) -> usize {
1302 24
1303 }
1304 }
1305
1306 unsafe impl<D: fidl::encoding::ResourceDialect>
1307 fidl::encoding::Encode<ChannelOnChannelStreamingDataRequest, D>
1308 for &ChannelOnChannelStreamingDataRequest
1309 {
1310 #[inline]
1311 unsafe fn encode(
1312 self,
1313 encoder: &mut fidl::encoding::Encoder<'_, D>,
1314 offset: usize,
1315 _depth: fidl::encoding::Depth,
1316 ) -> fidl::Result<()> {
1317 encoder.debug_check_bounds::<ChannelOnChannelStreamingDataRequest>(offset);
1318 fidl::encoding::Encode::<ChannelOnChannelStreamingDataRequest, D>::encode(
1320 (
1321 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
1322 <ChannelSent as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_sent),
1323 ),
1324 encoder,
1325 offset,
1326 _depth,
1327 )
1328 }
1329 }
1330 unsafe impl<
1331 D: fidl::encoding::ResourceDialect,
1332 T0: fidl::encoding::Encode<HandleId, D>,
1333 T1: fidl::encoding::Encode<ChannelSent, D>,
1334 > fidl::encoding::Encode<ChannelOnChannelStreamingDataRequest, D> for (T0, T1)
1335 {
1336 #[inline]
1337 unsafe fn encode(
1338 self,
1339 encoder: &mut fidl::encoding::Encoder<'_, D>,
1340 offset: usize,
1341 depth: fidl::encoding::Depth,
1342 ) -> fidl::Result<()> {
1343 encoder.debug_check_bounds::<ChannelOnChannelStreamingDataRequest>(offset);
1344 unsafe {
1347 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1348 (ptr as *mut u64).write_unaligned(0);
1349 }
1350 self.0.encode(encoder, offset + 0, depth)?;
1352 self.1.encode(encoder, offset + 8, depth)?;
1353 Ok(())
1354 }
1355 }
1356
1357 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1358 for ChannelOnChannelStreamingDataRequest
1359 {
1360 #[inline(always)]
1361 fn new_empty() -> Self {
1362 Self {
1363 handle: fidl::new_empty!(HandleId, D),
1364 channel_sent: fidl::new_empty!(ChannelSent, D),
1365 }
1366 }
1367
1368 #[inline]
1369 unsafe fn decode(
1370 &mut self,
1371 decoder: &mut fidl::encoding::Decoder<'_, D>,
1372 offset: usize,
1373 _depth: fidl::encoding::Depth,
1374 ) -> fidl::Result<()> {
1375 decoder.debug_check_bounds::<Self>(offset);
1376 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1378 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1379 let mask = 0xffffffff00000000u64;
1380 let maskedval = padval & mask;
1381 if maskedval != 0 {
1382 return Err(fidl::Error::NonZeroPadding {
1383 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1384 });
1385 }
1386 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
1387 fidl::decode!(ChannelSent, D, &mut self.channel_sent, decoder, offset + 8, _depth)?;
1388 Ok(())
1389 }
1390 }
1391
1392 impl fidl::encoding::ValueTypeMarker for ChannelReadChannelRequest {
1393 type Borrowed<'a> = &'a Self;
1394 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1395 value
1396 }
1397 }
1398
1399 unsafe impl fidl::encoding::TypeMarker for ChannelReadChannelRequest {
1400 type Owned = Self;
1401
1402 #[inline(always)]
1403 fn inline_align(_context: fidl::encoding::Context) -> usize {
1404 4
1405 }
1406
1407 #[inline(always)]
1408 fn inline_size(_context: fidl::encoding::Context) -> usize {
1409 4
1410 }
1411 #[inline(always)]
1412 fn encode_is_copy() -> bool {
1413 true
1414 }
1415
1416 #[inline(always)]
1417 fn decode_is_copy() -> bool {
1418 true
1419 }
1420 }
1421
1422 unsafe impl<D: fidl::encoding::ResourceDialect>
1423 fidl::encoding::Encode<ChannelReadChannelRequest, D> for &ChannelReadChannelRequest
1424 {
1425 #[inline]
1426 unsafe fn encode(
1427 self,
1428 encoder: &mut fidl::encoding::Encoder<'_, D>,
1429 offset: usize,
1430 _depth: fidl::encoding::Depth,
1431 ) -> fidl::Result<()> {
1432 encoder.debug_check_bounds::<ChannelReadChannelRequest>(offset);
1433 unsafe {
1434 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1436 (buf_ptr as *mut ChannelReadChannelRequest)
1437 .write_unaligned((self as *const ChannelReadChannelRequest).read());
1438 }
1441 Ok(())
1442 }
1443 }
1444 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
1445 fidl::encoding::Encode<ChannelReadChannelRequest, D> for (T0,)
1446 {
1447 #[inline]
1448 unsafe fn encode(
1449 self,
1450 encoder: &mut fidl::encoding::Encoder<'_, D>,
1451 offset: usize,
1452 depth: fidl::encoding::Depth,
1453 ) -> fidl::Result<()> {
1454 encoder.debug_check_bounds::<ChannelReadChannelRequest>(offset);
1455 self.0.encode(encoder, offset + 0, depth)?;
1459 Ok(())
1460 }
1461 }
1462
1463 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1464 for ChannelReadChannelRequest
1465 {
1466 #[inline(always)]
1467 fn new_empty() -> Self {
1468 Self { handle: fidl::new_empty!(HandleId, D) }
1469 }
1470
1471 #[inline]
1472 unsafe fn decode(
1473 &mut self,
1474 decoder: &mut fidl::encoding::Decoder<'_, D>,
1475 offset: usize,
1476 _depth: fidl::encoding::Depth,
1477 ) -> fidl::Result<()> {
1478 decoder.debug_check_bounds::<Self>(offset);
1479 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1480 unsafe {
1483 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1484 }
1485 Ok(())
1486 }
1487 }
1488
1489 impl fidl::encoding::ValueTypeMarker for ChannelReadChannelStreamingStartRequest {
1490 type Borrowed<'a> = &'a Self;
1491 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1492 value
1493 }
1494 }
1495
1496 unsafe impl fidl::encoding::TypeMarker for ChannelReadChannelStreamingStartRequest {
1497 type Owned = Self;
1498
1499 #[inline(always)]
1500 fn inline_align(_context: fidl::encoding::Context) -> usize {
1501 4
1502 }
1503
1504 #[inline(always)]
1505 fn inline_size(_context: fidl::encoding::Context) -> usize {
1506 4
1507 }
1508 #[inline(always)]
1509 fn encode_is_copy() -> bool {
1510 true
1511 }
1512
1513 #[inline(always)]
1514 fn decode_is_copy() -> bool {
1515 true
1516 }
1517 }
1518
1519 unsafe impl<D: fidl::encoding::ResourceDialect>
1520 fidl::encoding::Encode<ChannelReadChannelStreamingStartRequest, D>
1521 for &ChannelReadChannelStreamingStartRequest
1522 {
1523 #[inline]
1524 unsafe fn encode(
1525 self,
1526 encoder: &mut fidl::encoding::Encoder<'_, D>,
1527 offset: usize,
1528 _depth: fidl::encoding::Depth,
1529 ) -> fidl::Result<()> {
1530 encoder.debug_check_bounds::<ChannelReadChannelStreamingStartRequest>(offset);
1531 unsafe {
1532 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1534 (buf_ptr as *mut ChannelReadChannelStreamingStartRequest).write_unaligned(
1535 (self as *const ChannelReadChannelStreamingStartRequest).read(),
1536 );
1537 }
1540 Ok(())
1541 }
1542 }
1543 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
1544 fidl::encoding::Encode<ChannelReadChannelStreamingStartRequest, D> for (T0,)
1545 {
1546 #[inline]
1547 unsafe fn encode(
1548 self,
1549 encoder: &mut fidl::encoding::Encoder<'_, D>,
1550 offset: usize,
1551 depth: fidl::encoding::Depth,
1552 ) -> fidl::Result<()> {
1553 encoder.debug_check_bounds::<ChannelReadChannelStreamingStartRequest>(offset);
1554 self.0.encode(encoder, offset + 0, depth)?;
1558 Ok(())
1559 }
1560 }
1561
1562 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1563 for ChannelReadChannelStreamingStartRequest
1564 {
1565 #[inline(always)]
1566 fn new_empty() -> Self {
1567 Self { handle: fidl::new_empty!(HandleId, D) }
1568 }
1569
1570 #[inline]
1571 unsafe fn decode(
1572 &mut self,
1573 decoder: &mut fidl::encoding::Decoder<'_, D>,
1574 offset: usize,
1575 _depth: fidl::encoding::Depth,
1576 ) -> fidl::Result<()> {
1577 decoder.debug_check_bounds::<Self>(offset);
1578 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1579 unsafe {
1582 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1583 }
1584 Ok(())
1585 }
1586 }
1587
1588 impl fidl::encoding::ValueTypeMarker for ChannelReadChannelStreamingStopRequest {
1589 type Borrowed<'a> = &'a Self;
1590 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1591 value
1592 }
1593 }
1594
1595 unsafe impl fidl::encoding::TypeMarker for ChannelReadChannelStreamingStopRequest {
1596 type Owned = Self;
1597
1598 #[inline(always)]
1599 fn inline_align(_context: fidl::encoding::Context) -> usize {
1600 4
1601 }
1602
1603 #[inline(always)]
1604 fn inline_size(_context: fidl::encoding::Context) -> usize {
1605 4
1606 }
1607 #[inline(always)]
1608 fn encode_is_copy() -> bool {
1609 true
1610 }
1611
1612 #[inline(always)]
1613 fn decode_is_copy() -> bool {
1614 true
1615 }
1616 }
1617
1618 unsafe impl<D: fidl::encoding::ResourceDialect>
1619 fidl::encoding::Encode<ChannelReadChannelStreamingStopRequest, D>
1620 for &ChannelReadChannelStreamingStopRequest
1621 {
1622 #[inline]
1623 unsafe fn encode(
1624 self,
1625 encoder: &mut fidl::encoding::Encoder<'_, D>,
1626 offset: usize,
1627 _depth: fidl::encoding::Depth,
1628 ) -> fidl::Result<()> {
1629 encoder.debug_check_bounds::<ChannelReadChannelStreamingStopRequest>(offset);
1630 unsafe {
1631 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1633 (buf_ptr as *mut ChannelReadChannelStreamingStopRequest).write_unaligned(
1634 (self as *const ChannelReadChannelStreamingStopRequest).read(),
1635 );
1636 }
1639 Ok(())
1640 }
1641 }
1642 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
1643 fidl::encoding::Encode<ChannelReadChannelStreamingStopRequest, D> for (T0,)
1644 {
1645 #[inline]
1646 unsafe fn encode(
1647 self,
1648 encoder: &mut fidl::encoding::Encoder<'_, D>,
1649 offset: usize,
1650 depth: fidl::encoding::Depth,
1651 ) -> fidl::Result<()> {
1652 encoder.debug_check_bounds::<ChannelReadChannelStreamingStopRequest>(offset);
1653 self.0.encode(encoder, offset + 0, depth)?;
1657 Ok(())
1658 }
1659 }
1660
1661 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1662 for ChannelReadChannelStreamingStopRequest
1663 {
1664 #[inline(always)]
1665 fn new_empty() -> Self {
1666 Self { handle: fidl::new_empty!(HandleId, D) }
1667 }
1668
1669 #[inline]
1670 unsafe fn decode(
1671 &mut self,
1672 decoder: &mut fidl::encoding::Decoder<'_, D>,
1673 offset: usize,
1674 _depth: fidl::encoding::Depth,
1675 ) -> fidl::Result<()> {
1676 decoder.debug_check_bounds::<Self>(offset);
1677 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1678 unsafe {
1681 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1682 }
1683 Ok(())
1684 }
1685 }
1686
1687 impl fidl::encoding::ValueTypeMarker for ChannelWriteChannelRequest {
1688 type Borrowed<'a> = &'a Self;
1689 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1690 value
1691 }
1692 }
1693
1694 unsafe impl fidl::encoding::TypeMarker for ChannelWriteChannelRequest {
1695 type Owned = Self;
1696
1697 #[inline(always)]
1698 fn inline_align(_context: fidl::encoding::Context) -> usize {
1699 8
1700 }
1701
1702 #[inline(always)]
1703 fn inline_size(_context: fidl::encoding::Context) -> usize {
1704 40
1705 }
1706 }
1707
1708 unsafe impl<D: fidl::encoding::ResourceDialect>
1709 fidl::encoding::Encode<ChannelWriteChannelRequest, D> for &ChannelWriteChannelRequest
1710 {
1711 #[inline]
1712 unsafe fn encode(
1713 self,
1714 encoder: &mut fidl::encoding::Encoder<'_, D>,
1715 offset: usize,
1716 _depth: fidl::encoding::Depth,
1717 ) -> fidl::Result<()> {
1718 encoder.debug_check_bounds::<ChannelWriteChannelRequest>(offset);
1719 fidl::encoding::Encode::<ChannelWriteChannelRequest, D>::encode(
1721 (
1722 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
1723 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1724 <Handles as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
1725 ),
1726 encoder, offset, _depth
1727 )
1728 }
1729 }
1730 unsafe impl<
1731 D: fidl::encoding::ResourceDialect,
1732 T0: fidl::encoding::Encode<HandleId, D>,
1733 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1734 T2: fidl::encoding::Encode<Handles, D>,
1735 > fidl::encoding::Encode<ChannelWriteChannelRequest, D> for (T0, T1, T2)
1736 {
1737 #[inline]
1738 unsafe fn encode(
1739 self,
1740 encoder: &mut fidl::encoding::Encoder<'_, D>,
1741 offset: usize,
1742 depth: fidl::encoding::Depth,
1743 ) -> fidl::Result<()> {
1744 encoder.debug_check_bounds::<ChannelWriteChannelRequest>(offset);
1745 unsafe {
1748 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1749 (ptr as *mut u64).write_unaligned(0);
1750 }
1751 self.0.encode(encoder, offset + 0, depth)?;
1753 self.1.encode(encoder, offset + 8, depth)?;
1754 self.2.encode(encoder, offset + 24, depth)?;
1755 Ok(())
1756 }
1757 }
1758
1759 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1760 for ChannelWriteChannelRequest
1761 {
1762 #[inline(always)]
1763 fn new_empty() -> Self {
1764 Self {
1765 handle: fidl::new_empty!(HandleId, D),
1766 data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1767 handles: fidl::new_empty!(Handles, D),
1768 }
1769 }
1770
1771 #[inline]
1772 unsafe fn decode(
1773 &mut self,
1774 decoder: &mut fidl::encoding::Decoder<'_, D>,
1775 offset: usize,
1776 _depth: fidl::encoding::Depth,
1777 ) -> fidl::Result<()> {
1778 decoder.debug_check_bounds::<Self>(offset);
1779 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1781 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1782 let mask = 0xffffffff00000000u64;
1783 let maskedval = padval & mask;
1784 if maskedval != 0 {
1785 return Err(fidl::Error::NonZeroPadding {
1786 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1787 });
1788 }
1789 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
1790 fidl::decode!(
1791 fidl::encoding::UnboundedVector<u8>,
1792 D,
1793 &mut self.data,
1794 decoder,
1795 offset + 8,
1796 _depth
1797 )?;
1798 fidl::decode!(Handles, D, &mut self.handles, decoder, offset + 24, _depth)?;
1799 Ok(())
1800 }
1801 }
1802
1803 impl fidl::encoding::ValueTypeMarker for ClosedDuringRead {
1804 type Borrowed<'a> = &'a Self;
1805 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1806 value
1807 }
1808 }
1809
1810 unsafe impl fidl::encoding::TypeMarker for ClosedDuringRead {
1811 type Owned = Self;
1812
1813 #[inline(always)]
1814 fn inline_align(_context: fidl::encoding::Context) -> usize {
1815 1
1816 }
1817
1818 #[inline(always)]
1819 fn inline_size(_context: fidl::encoding::Context) -> usize {
1820 1
1821 }
1822 }
1823
1824 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClosedDuringRead, D>
1825 for &ClosedDuringRead
1826 {
1827 #[inline]
1828 unsafe fn encode(
1829 self,
1830 encoder: &mut fidl::encoding::Encoder<'_, D>,
1831 offset: usize,
1832 _depth: fidl::encoding::Depth,
1833 ) -> fidl::Result<()> {
1834 encoder.debug_check_bounds::<ClosedDuringRead>(offset);
1835 encoder.write_num(0u8, offset);
1836 Ok(())
1837 }
1838 }
1839
1840 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClosedDuringRead {
1841 #[inline(always)]
1842 fn new_empty() -> Self {
1843 Self
1844 }
1845
1846 #[inline]
1847 unsafe fn decode(
1848 &mut self,
1849 decoder: &mut fidl::encoding::Decoder<'_, D>,
1850 offset: usize,
1851 _depth: fidl::encoding::Depth,
1852 ) -> fidl::Result<()> {
1853 decoder.debug_check_bounds::<Self>(offset);
1854 match decoder.read_num::<u8>(offset) {
1855 0 => Ok(()),
1856 _ => Err(fidl::Error::Invalid),
1857 }
1858 }
1859 }
1860
1861 impl fidl::encoding::ValueTypeMarker for ErrorPending {
1862 type Borrowed<'a> = &'a Self;
1863 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1864 value
1865 }
1866 }
1867
1868 unsafe impl fidl::encoding::TypeMarker for ErrorPending {
1869 type Owned = Self;
1870
1871 #[inline(always)]
1872 fn inline_align(_context: fidl::encoding::Context) -> usize {
1873 1
1874 }
1875
1876 #[inline(always)]
1877 fn inline_size(_context: fidl::encoding::Context) -> usize {
1878 1
1879 }
1880 }
1881
1882 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ErrorPending, D>
1883 for &ErrorPending
1884 {
1885 #[inline]
1886 unsafe fn encode(
1887 self,
1888 encoder: &mut fidl::encoding::Encoder<'_, D>,
1889 offset: usize,
1890 _depth: fidl::encoding::Depth,
1891 ) -> fidl::Result<()> {
1892 encoder.debug_check_bounds::<ErrorPending>(offset);
1893 encoder.write_num(0u8, offset);
1894 Ok(())
1895 }
1896 }
1897
1898 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ErrorPending {
1899 #[inline(always)]
1900 fn new_empty() -> Self {
1901 Self
1902 }
1903
1904 #[inline]
1905 unsafe fn decode(
1906 &mut self,
1907 decoder: &mut fidl::encoding::Decoder<'_, D>,
1908 offset: usize,
1909 _depth: fidl::encoding::Depth,
1910 ) -> fidl::Result<()> {
1911 decoder.debug_check_bounds::<Self>(offset);
1912 match decoder.read_num::<u8>(offset) {
1913 0 => Ok(()),
1914 _ => Err(fidl::Error::Invalid),
1915 }
1916 }
1917 }
1918
1919 impl fidl::encoding::ValueTypeMarker for EventCreateEventRequest {
1920 type Borrowed<'a> = &'a Self;
1921 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1922 value
1923 }
1924 }
1925
1926 unsafe impl fidl::encoding::TypeMarker for EventCreateEventRequest {
1927 type Owned = Self;
1928
1929 #[inline(always)]
1930 fn inline_align(_context: fidl::encoding::Context) -> usize {
1931 4
1932 }
1933
1934 #[inline(always)]
1935 fn inline_size(_context: fidl::encoding::Context) -> usize {
1936 4
1937 }
1938 #[inline(always)]
1939 fn encode_is_copy() -> bool {
1940 true
1941 }
1942
1943 #[inline(always)]
1944 fn decode_is_copy() -> bool {
1945 true
1946 }
1947 }
1948
1949 unsafe impl<D: fidl::encoding::ResourceDialect>
1950 fidl::encoding::Encode<EventCreateEventRequest, D> for &EventCreateEventRequest
1951 {
1952 #[inline]
1953 unsafe fn encode(
1954 self,
1955 encoder: &mut fidl::encoding::Encoder<'_, D>,
1956 offset: usize,
1957 _depth: fidl::encoding::Depth,
1958 ) -> fidl::Result<()> {
1959 encoder.debug_check_bounds::<EventCreateEventRequest>(offset);
1960 unsafe {
1961 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1963 (buf_ptr as *mut EventCreateEventRequest)
1964 .write_unaligned((self as *const EventCreateEventRequest).read());
1965 }
1968 Ok(())
1969 }
1970 }
1971 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NewHandleId, D>>
1972 fidl::encoding::Encode<EventCreateEventRequest, D> for (T0,)
1973 {
1974 #[inline]
1975 unsafe fn encode(
1976 self,
1977 encoder: &mut fidl::encoding::Encoder<'_, D>,
1978 offset: usize,
1979 depth: fidl::encoding::Depth,
1980 ) -> fidl::Result<()> {
1981 encoder.debug_check_bounds::<EventCreateEventRequest>(offset);
1982 self.0.encode(encoder, offset + 0, depth)?;
1986 Ok(())
1987 }
1988 }
1989
1990 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1991 for EventCreateEventRequest
1992 {
1993 #[inline(always)]
1994 fn new_empty() -> Self {
1995 Self { handle: fidl::new_empty!(NewHandleId, D) }
1996 }
1997
1998 #[inline]
1999 unsafe fn decode(
2000 &mut self,
2001 decoder: &mut fidl::encoding::Decoder<'_, D>,
2002 offset: usize,
2003 _depth: fidl::encoding::Depth,
2004 ) -> fidl::Result<()> {
2005 decoder.debug_check_bounds::<Self>(offset);
2006 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2007 unsafe {
2010 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2011 }
2012 Ok(())
2013 }
2014 }
2015
2016 impl fidl::encoding::ValueTypeMarker for EventPairCreateEventPairRequest {
2017 type Borrowed<'a> = &'a Self;
2018 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2019 value
2020 }
2021 }
2022
2023 unsafe impl fidl::encoding::TypeMarker for EventPairCreateEventPairRequest {
2024 type Owned = Self;
2025
2026 #[inline(always)]
2027 fn inline_align(_context: fidl::encoding::Context) -> usize {
2028 4
2029 }
2030
2031 #[inline(always)]
2032 fn inline_size(_context: fidl::encoding::Context) -> usize {
2033 8
2034 }
2035 #[inline(always)]
2036 fn encode_is_copy() -> bool {
2037 true
2038 }
2039
2040 #[inline(always)]
2041 fn decode_is_copy() -> bool {
2042 true
2043 }
2044 }
2045
2046 unsafe impl<D: fidl::encoding::ResourceDialect>
2047 fidl::encoding::Encode<EventPairCreateEventPairRequest, D>
2048 for &EventPairCreateEventPairRequest
2049 {
2050 #[inline]
2051 unsafe fn encode(
2052 self,
2053 encoder: &mut fidl::encoding::Encoder<'_, D>,
2054 offset: usize,
2055 _depth: fidl::encoding::Depth,
2056 ) -> fidl::Result<()> {
2057 encoder.debug_check_bounds::<EventPairCreateEventPairRequest>(offset);
2058 unsafe {
2059 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2061 (buf_ptr as *mut EventPairCreateEventPairRequest)
2062 .write_unaligned((self as *const EventPairCreateEventPairRequest).read());
2063 }
2066 Ok(())
2067 }
2068 }
2069 unsafe impl<
2070 D: fidl::encoding::ResourceDialect,
2071 T0: fidl::encoding::Encode<fidl::encoding::Array<NewHandleId, 2>, D>,
2072 > fidl::encoding::Encode<EventPairCreateEventPairRequest, D> for (T0,)
2073 {
2074 #[inline]
2075 unsafe fn encode(
2076 self,
2077 encoder: &mut fidl::encoding::Encoder<'_, D>,
2078 offset: usize,
2079 depth: fidl::encoding::Depth,
2080 ) -> fidl::Result<()> {
2081 encoder.debug_check_bounds::<EventPairCreateEventPairRequest>(offset);
2082 self.0.encode(encoder, offset + 0, depth)?;
2086 Ok(())
2087 }
2088 }
2089
2090 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2091 for EventPairCreateEventPairRequest
2092 {
2093 #[inline(always)]
2094 fn new_empty() -> Self {
2095 Self { handles: fidl::new_empty!(fidl::encoding::Array<NewHandleId, 2>, D) }
2096 }
2097
2098 #[inline]
2099 unsafe fn decode(
2100 &mut self,
2101 decoder: &mut fidl::encoding::Decoder<'_, D>,
2102 offset: usize,
2103 _depth: fidl::encoding::Depth,
2104 ) -> fidl::Result<()> {
2105 decoder.debug_check_bounds::<Self>(offset);
2106 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2107 unsafe {
2110 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2111 }
2112 Ok(())
2113 }
2114 }
2115
2116 impl fidl::encoding::ValueTypeMarker for FDomainAcknowledgeWriteErrorRequest {
2117 type Borrowed<'a> = &'a Self;
2118 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2119 value
2120 }
2121 }
2122
2123 unsafe impl fidl::encoding::TypeMarker for FDomainAcknowledgeWriteErrorRequest {
2124 type Owned = Self;
2125
2126 #[inline(always)]
2127 fn inline_align(_context: fidl::encoding::Context) -> usize {
2128 4
2129 }
2130
2131 #[inline(always)]
2132 fn inline_size(_context: fidl::encoding::Context) -> usize {
2133 4
2134 }
2135 #[inline(always)]
2136 fn encode_is_copy() -> bool {
2137 true
2138 }
2139
2140 #[inline(always)]
2141 fn decode_is_copy() -> bool {
2142 true
2143 }
2144 }
2145
2146 unsafe impl<D: fidl::encoding::ResourceDialect>
2147 fidl::encoding::Encode<FDomainAcknowledgeWriteErrorRequest, D>
2148 for &FDomainAcknowledgeWriteErrorRequest
2149 {
2150 #[inline]
2151 unsafe fn encode(
2152 self,
2153 encoder: &mut fidl::encoding::Encoder<'_, D>,
2154 offset: usize,
2155 _depth: fidl::encoding::Depth,
2156 ) -> fidl::Result<()> {
2157 encoder.debug_check_bounds::<FDomainAcknowledgeWriteErrorRequest>(offset);
2158 unsafe {
2159 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2161 (buf_ptr as *mut FDomainAcknowledgeWriteErrorRequest)
2162 .write_unaligned((self as *const FDomainAcknowledgeWriteErrorRequest).read());
2163 }
2166 Ok(())
2167 }
2168 }
2169 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
2170 fidl::encoding::Encode<FDomainAcknowledgeWriteErrorRequest, D> for (T0,)
2171 {
2172 #[inline]
2173 unsafe fn encode(
2174 self,
2175 encoder: &mut fidl::encoding::Encoder<'_, D>,
2176 offset: usize,
2177 depth: fidl::encoding::Depth,
2178 ) -> fidl::Result<()> {
2179 encoder.debug_check_bounds::<FDomainAcknowledgeWriteErrorRequest>(offset);
2180 self.0.encode(encoder, offset + 0, depth)?;
2184 Ok(())
2185 }
2186 }
2187
2188 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2189 for FDomainAcknowledgeWriteErrorRequest
2190 {
2191 #[inline(always)]
2192 fn new_empty() -> Self {
2193 Self { handle: fidl::new_empty!(HandleId, D) }
2194 }
2195
2196 #[inline]
2197 unsafe fn decode(
2198 &mut self,
2199 decoder: &mut fidl::encoding::Decoder<'_, D>,
2200 offset: usize,
2201 _depth: fidl::encoding::Depth,
2202 ) -> fidl::Result<()> {
2203 decoder.debug_check_bounds::<Self>(offset);
2204 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2205 unsafe {
2208 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2209 }
2210 Ok(())
2211 }
2212 }
2213
2214 impl fidl::encoding::ValueTypeMarker for FDomainCloseRequest {
2215 type Borrowed<'a> = &'a Self;
2216 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2217 value
2218 }
2219 }
2220
2221 unsafe impl fidl::encoding::TypeMarker for FDomainCloseRequest {
2222 type Owned = Self;
2223
2224 #[inline(always)]
2225 fn inline_align(_context: fidl::encoding::Context) -> usize {
2226 8
2227 }
2228
2229 #[inline(always)]
2230 fn inline_size(_context: fidl::encoding::Context) -> usize {
2231 16
2232 }
2233 }
2234
2235 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainCloseRequest, D>
2236 for &FDomainCloseRequest
2237 {
2238 #[inline]
2239 unsafe fn encode(
2240 self,
2241 encoder: &mut fidl::encoding::Encoder<'_, D>,
2242 offset: usize,
2243 _depth: fidl::encoding::Depth,
2244 ) -> fidl::Result<()> {
2245 encoder.debug_check_bounds::<FDomainCloseRequest>(offset);
2246 fidl::encoding::Encode::<FDomainCloseRequest, D>::encode(
2248 (
2249 <fidl::encoding::UnboundedVector<HandleId> as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
2250 ),
2251 encoder, offset, _depth
2252 )
2253 }
2254 }
2255 unsafe impl<
2256 D: fidl::encoding::ResourceDialect,
2257 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<HandleId>, D>,
2258 > fidl::encoding::Encode<FDomainCloseRequest, D> for (T0,)
2259 {
2260 #[inline]
2261 unsafe fn encode(
2262 self,
2263 encoder: &mut fidl::encoding::Encoder<'_, D>,
2264 offset: usize,
2265 depth: fidl::encoding::Depth,
2266 ) -> fidl::Result<()> {
2267 encoder.debug_check_bounds::<FDomainCloseRequest>(offset);
2268 self.0.encode(encoder, offset + 0, depth)?;
2272 Ok(())
2273 }
2274 }
2275
2276 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainCloseRequest {
2277 #[inline(always)]
2278 fn new_empty() -> Self {
2279 Self { handles: fidl::new_empty!(fidl::encoding::UnboundedVector<HandleId>, D) }
2280 }
2281
2282 #[inline]
2283 unsafe fn decode(
2284 &mut self,
2285 decoder: &mut fidl::encoding::Decoder<'_, D>,
2286 offset: usize,
2287 _depth: fidl::encoding::Depth,
2288 ) -> fidl::Result<()> {
2289 decoder.debug_check_bounds::<Self>(offset);
2290 fidl::decode!(
2292 fidl::encoding::UnboundedVector<HandleId>,
2293 D,
2294 &mut self.handles,
2295 decoder,
2296 offset + 0,
2297 _depth
2298 )?;
2299 Ok(())
2300 }
2301 }
2302
2303 impl fidl::encoding::ValueTypeMarker for FDomainDuplicateRequest {
2304 type Borrowed<'a> = &'a Self;
2305 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2306 value
2307 }
2308 }
2309
2310 unsafe impl fidl::encoding::TypeMarker for FDomainDuplicateRequest {
2311 type Owned = Self;
2312
2313 #[inline(always)]
2314 fn inline_align(_context: fidl::encoding::Context) -> usize {
2315 4
2316 }
2317
2318 #[inline(always)]
2319 fn inline_size(_context: fidl::encoding::Context) -> usize {
2320 12
2321 }
2322 }
2323
2324 unsafe impl<D: fidl::encoding::ResourceDialect>
2325 fidl::encoding::Encode<FDomainDuplicateRequest, D> for &FDomainDuplicateRequest
2326 {
2327 #[inline]
2328 unsafe fn encode(
2329 self,
2330 encoder: &mut fidl::encoding::Encoder<'_, D>,
2331 offset: usize,
2332 _depth: fidl::encoding::Depth,
2333 ) -> fidl::Result<()> {
2334 encoder.debug_check_bounds::<FDomainDuplicateRequest>(offset);
2335 fidl::encoding::Encode::<FDomainDuplicateRequest, D>::encode(
2337 (
2338 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
2339 <NewHandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.new_handle),
2340 <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
2341 ),
2342 encoder,
2343 offset,
2344 _depth,
2345 )
2346 }
2347 }
2348 unsafe impl<
2349 D: fidl::encoding::ResourceDialect,
2350 T0: fidl::encoding::Encode<HandleId, D>,
2351 T1: fidl::encoding::Encode<NewHandleId, D>,
2352 T2: fidl::encoding::Encode<fidl::Rights, D>,
2353 > fidl::encoding::Encode<FDomainDuplicateRequest, D> for (T0, T1, T2)
2354 {
2355 #[inline]
2356 unsafe fn encode(
2357 self,
2358 encoder: &mut fidl::encoding::Encoder<'_, D>,
2359 offset: usize,
2360 depth: fidl::encoding::Depth,
2361 ) -> fidl::Result<()> {
2362 encoder.debug_check_bounds::<FDomainDuplicateRequest>(offset);
2363 self.0.encode(encoder, offset + 0, depth)?;
2367 self.1.encode(encoder, offset + 4, depth)?;
2368 self.2.encode(encoder, offset + 8, depth)?;
2369 Ok(())
2370 }
2371 }
2372
2373 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2374 for FDomainDuplicateRequest
2375 {
2376 #[inline(always)]
2377 fn new_empty() -> Self {
2378 Self {
2379 handle: fidl::new_empty!(HandleId, D),
2380 new_handle: fidl::new_empty!(NewHandleId, D),
2381 rights: fidl::new_empty!(fidl::Rights, D),
2382 }
2383 }
2384
2385 #[inline]
2386 unsafe fn decode(
2387 &mut self,
2388 decoder: &mut fidl::encoding::Decoder<'_, D>,
2389 offset: usize,
2390 _depth: fidl::encoding::Depth,
2391 ) -> fidl::Result<()> {
2392 decoder.debug_check_bounds::<Self>(offset);
2393 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
2395 fidl::decode!(NewHandleId, D, &mut self.new_handle, decoder, offset + 4, _depth)?;
2396 fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 8, _depth)?;
2397 Ok(())
2398 }
2399 }
2400
2401 impl fidl::encoding::ValueTypeMarker for FDomainGetNamespaceRequest {
2402 type Borrowed<'a> = &'a Self;
2403 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2404 value
2405 }
2406 }
2407
2408 unsafe impl fidl::encoding::TypeMarker for FDomainGetNamespaceRequest {
2409 type Owned = Self;
2410
2411 #[inline(always)]
2412 fn inline_align(_context: fidl::encoding::Context) -> usize {
2413 4
2414 }
2415
2416 #[inline(always)]
2417 fn inline_size(_context: fidl::encoding::Context) -> usize {
2418 4
2419 }
2420 #[inline(always)]
2421 fn encode_is_copy() -> bool {
2422 true
2423 }
2424
2425 #[inline(always)]
2426 fn decode_is_copy() -> bool {
2427 true
2428 }
2429 }
2430
2431 unsafe impl<D: fidl::encoding::ResourceDialect>
2432 fidl::encoding::Encode<FDomainGetNamespaceRequest, D> for &FDomainGetNamespaceRequest
2433 {
2434 #[inline]
2435 unsafe fn encode(
2436 self,
2437 encoder: &mut fidl::encoding::Encoder<'_, D>,
2438 offset: usize,
2439 _depth: fidl::encoding::Depth,
2440 ) -> fidl::Result<()> {
2441 encoder.debug_check_bounds::<FDomainGetNamespaceRequest>(offset);
2442 unsafe {
2443 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2445 (buf_ptr as *mut FDomainGetNamespaceRequest)
2446 .write_unaligned((self as *const FDomainGetNamespaceRequest).read());
2447 }
2450 Ok(())
2451 }
2452 }
2453 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NewHandleId, D>>
2454 fidl::encoding::Encode<FDomainGetNamespaceRequest, D> for (T0,)
2455 {
2456 #[inline]
2457 unsafe fn encode(
2458 self,
2459 encoder: &mut fidl::encoding::Encoder<'_, D>,
2460 offset: usize,
2461 depth: fidl::encoding::Depth,
2462 ) -> fidl::Result<()> {
2463 encoder.debug_check_bounds::<FDomainGetNamespaceRequest>(offset);
2464 self.0.encode(encoder, offset + 0, depth)?;
2468 Ok(())
2469 }
2470 }
2471
2472 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2473 for FDomainGetNamespaceRequest
2474 {
2475 #[inline(always)]
2476 fn new_empty() -> Self {
2477 Self { new_handle: fidl::new_empty!(NewHandleId, D) }
2478 }
2479
2480 #[inline]
2481 unsafe fn decode(
2482 &mut self,
2483 decoder: &mut fidl::encoding::Decoder<'_, D>,
2484 offset: usize,
2485 _depth: fidl::encoding::Depth,
2486 ) -> fidl::Result<()> {
2487 decoder.debug_check_bounds::<Self>(offset);
2488 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2489 unsafe {
2492 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2493 }
2494 Ok(())
2495 }
2496 }
2497
2498 impl fidl::encoding::ValueTypeMarker for FDomainReplaceRequest {
2499 type Borrowed<'a> = &'a Self;
2500 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2501 value
2502 }
2503 }
2504
2505 unsafe impl fidl::encoding::TypeMarker for FDomainReplaceRequest {
2506 type Owned = Self;
2507
2508 #[inline(always)]
2509 fn inline_align(_context: fidl::encoding::Context) -> usize {
2510 4
2511 }
2512
2513 #[inline(always)]
2514 fn inline_size(_context: fidl::encoding::Context) -> usize {
2515 12
2516 }
2517 }
2518
2519 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainReplaceRequest, D>
2520 for &FDomainReplaceRequest
2521 {
2522 #[inline]
2523 unsafe fn encode(
2524 self,
2525 encoder: &mut fidl::encoding::Encoder<'_, D>,
2526 offset: usize,
2527 _depth: fidl::encoding::Depth,
2528 ) -> fidl::Result<()> {
2529 encoder.debug_check_bounds::<FDomainReplaceRequest>(offset);
2530 fidl::encoding::Encode::<FDomainReplaceRequest, D>::encode(
2532 (
2533 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
2534 <NewHandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.new_handle),
2535 <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
2536 ),
2537 encoder,
2538 offset,
2539 _depth,
2540 )
2541 }
2542 }
2543 unsafe impl<
2544 D: fidl::encoding::ResourceDialect,
2545 T0: fidl::encoding::Encode<HandleId, D>,
2546 T1: fidl::encoding::Encode<NewHandleId, D>,
2547 T2: fidl::encoding::Encode<fidl::Rights, D>,
2548 > fidl::encoding::Encode<FDomainReplaceRequest, D> for (T0, T1, T2)
2549 {
2550 #[inline]
2551 unsafe fn encode(
2552 self,
2553 encoder: &mut fidl::encoding::Encoder<'_, D>,
2554 offset: usize,
2555 depth: fidl::encoding::Depth,
2556 ) -> fidl::Result<()> {
2557 encoder.debug_check_bounds::<FDomainReplaceRequest>(offset);
2558 self.0.encode(encoder, offset + 0, depth)?;
2562 self.1.encode(encoder, offset + 4, depth)?;
2563 self.2.encode(encoder, offset + 8, depth)?;
2564 Ok(())
2565 }
2566 }
2567
2568 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainReplaceRequest {
2569 #[inline(always)]
2570 fn new_empty() -> Self {
2571 Self {
2572 handle: fidl::new_empty!(HandleId, D),
2573 new_handle: fidl::new_empty!(NewHandleId, D),
2574 rights: fidl::new_empty!(fidl::Rights, D),
2575 }
2576 }
2577
2578 #[inline]
2579 unsafe fn decode(
2580 &mut self,
2581 decoder: &mut fidl::encoding::Decoder<'_, D>,
2582 offset: usize,
2583 _depth: fidl::encoding::Depth,
2584 ) -> fidl::Result<()> {
2585 decoder.debug_check_bounds::<Self>(offset);
2586 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
2588 fidl::decode!(NewHandleId, D, &mut self.new_handle, decoder, offset + 4, _depth)?;
2589 fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 8, _depth)?;
2590 Ok(())
2591 }
2592 }
2593
2594 impl fidl::encoding::ValueTypeMarker for FDomainSignalPeerRequest {
2595 type Borrowed<'a> = &'a Self;
2596 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2597 value
2598 }
2599 }
2600
2601 unsafe impl fidl::encoding::TypeMarker for FDomainSignalPeerRequest {
2602 type Owned = Self;
2603
2604 #[inline(always)]
2605 fn inline_align(_context: fidl::encoding::Context) -> usize {
2606 4
2607 }
2608
2609 #[inline(always)]
2610 fn inline_size(_context: fidl::encoding::Context) -> usize {
2611 12
2612 }
2613 #[inline(always)]
2614 fn encode_is_copy() -> bool {
2615 true
2616 }
2617
2618 #[inline(always)]
2619 fn decode_is_copy() -> bool {
2620 true
2621 }
2622 }
2623
2624 unsafe impl<D: fidl::encoding::ResourceDialect>
2625 fidl::encoding::Encode<FDomainSignalPeerRequest, D> for &FDomainSignalPeerRequest
2626 {
2627 #[inline]
2628 unsafe fn encode(
2629 self,
2630 encoder: &mut fidl::encoding::Encoder<'_, D>,
2631 offset: usize,
2632 _depth: fidl::encoding::Depth,
2633 ) -> fidl::Result<()> {
2634 encoder.debug_check_bounds::<FDomainSignalPeerRequest>(offset);
2635 unsafe {
2636 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2638 (buf_ptr as *mut FDomainSignalPeerRequest)
2639 .write_unaligned((self as *const FDomainSignalPeerRequest).read());
2640 }
2643 Ok(())
2644 }
2645 }
2646 unsafe impl<
2647 D: fidl::encoding::ResourceDialect,
2648 T0: fidl::encoding::Encode<HandleId, D>,
2649 T1: fidl::encoding::Encode<u32, D>,
2650 T2: fidl::encoding::Encode<u32, D>,
2651 > fidl::encoding::Encode<FDomainSignalPeerRequest, D> for (T0, T1, T2)
2652 {
2653 #[inline]
2654 unsafe fn encode(
2655 self,
2656 encoder: &mut fidl::encoding::Encoder<'_, D>,
2657 offset: usize,
2658 depth: fidl::encoding::Depth,
2659 ) -> fidl::Result<()> {
2660 encoder.debug_check_bounds::<FDomainSignalPeerRequest>(offset);
2661 self.0.encode(encoder, offset + 0, depth)?;
2665 self.1.encode(encoder, offset + 4, depth)?;
2666 self.2.encode(encoder, offset + 8, depth)?;
2667 Ok(())
2668 }
2669 }
2670
2671 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2672 for FDomainSignalPeerRequest
2673 {
2674 #[inline(always)]
2675 fn new_empty() -> Self {
2676 Self {
2677 handle: fidl::new_empty!(HandleId, D),
2678 set: fidl::new_empty!(u32, D),
2679 clear: fidl::new_empty!(u32, D),
2680 }
2681 }
2682
2683 #[inline]
2684 unsafe fn decode(
2685 &mut self,
2686 decoder: &mut fidl::encoding::Decoder<'_, D>,
2687 offset: usize,
2688 _depth: fidl::encoding::Depth,
2689 ) -> fidl::Result<()> {
2690 decoder.debug_check_bounds::<Self>(offset);
2691 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2692 unsafe {
2695 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
2696 }
2697 Ok(())
2698 }
2699 }
2700
2701 impl fidl::encoding::ValueTypeMarker for FDomainSignalRequest {
2702 type Borrowed<'a> = &'a Self;
2703 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2704 value
2705 }
2706 }
2707
2708 unsafe impl fidl::encoding::TypeMarker for FDomainSignalRequest {
2709 type Owned = Self;
2710
2711 #[inline(always)]
2712 fn inline_align(_context: fidl::encoding::Context) -> usize {
2713 4
2714 }
2715
2716 #[inline(always)]
2717 fn inline_size(_context: fidl::encoding::Context) -> usize {
2718 12
2719 }
2720 #[inline(always)]
2721 fn encode_is_copy() -> bool {
2722 true
2723 }
2724
2725 #[inline(always)]
2726 fn decode_is_copy() -> bool {
2727 true
2728 }
2729 }
2730
2731 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FDomainSignalRequest, D>
2732 for &FDomainSignalRequest
2733 {
2734 #[inline]
2735 unsafe fn encode(
2736 self,
2737 encoder: &mut fidl::encoding::Encoder<'_, D>,
2738 offset: usize,
2739 _depth: fidl::encoding::Depth,
2740 ) -> fidl::Result<()> {
2741 encoder.debug_check_bounds::<FDomainSignalRequest>(offset);
2742 unsafe {
2743 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2745 (buf_ptr as *mut FDomainSignalRequest)
2746 .write_unaligned((self as *const FDomainSignalRequest).read());
2747 }
2750 Ok(())
2751 }
2752 }
2753 unsafe impl<
2754 D: fidl::encoding::ResourceDialect,
2755 T0: fidl::encoding::Encode<HandleId, D>,
2756 T1: fidl::encoding::Encode<u32, D>,
2757 T2: fidl::encoding::Encode<u32, D>,
2758 > fidl::encoding::Encode<FDomainSignalRequest, D> for (T0, T1, T2)
2759 {
2760 #[inline]
2761 unsafe fn encode(
2762 self,
2763 encoder: &mut fidl::encoding::Encoder<'_, D>,
2764 offset: usize,
2765 depth: fidl::encoding::Depth,
2766 ) -> fidl::Result<()> {
2767 encoder.debug_check_bounds::<FDomainSignalRequest>(offset);
2768 self.0.encode(encoder, offset + 0, depth)?;
2772 self.1.encode(encoder, offset + 4, depth)?;
2773 self.2.encode(encoder, offset + 8, depth)?;
2774 Ok(())
2775 }
2776 }
2777
2778 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FDomainSignalRequest {
2779 #[inline(always)]
2780 fn new_empty() -> Self {
2781 Self {
2782 handle: fidl::new_empty!(HandleId, D),
2783 set: fidl::new_empty!(u32, D),
2784 clear: fidl::new_empty!(u32, D),
2785 }
2786 }
2787
2788 #[inline]
2789 unsafe fn decode(
2790 &mut self,
2791 decoder: &mut fidl::encoding::Decoder<'_, D>,
2792 offset: usize,
2793 _depth: fidl::encoding::Depth,
2794 ) -> fidl::Result<()> {
2795 decoder.debug_check_bounds::<Self>(offset);
2796 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2797 unsafe {
2800 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
2801 }
2802 Ok(())
2803 }
2804 }
2805
2806 impl fidl::encoding::ValueTypeMarker for FDomainWaitForSignalsRequest {
2807 type Borrowed<'a> = &'a Self;
2808 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2809 value
2810 }
2811 }
2812
2813 unsafe impl fidl::encoding::TypeMarker for FDomainWaitForSignalsRequest {
2814 type Owned = Self;
2815
2816 #[inline(always)]
2817 fn inline_align(_context: fidl::encoding::Context) -> usize {
2818 4
2819 }
2820
2821 #[inline(always)]
2822 fn inline_size(_context: fidl::encoding::Context) -> usize {
2823 8
2824 }
2825 #[inline(always)]
2826 fn encode_is_copy() -> bool {
2827 true
2828 }
2829
2830 #[inline(always)]
2831 fn decode_is_copy() -> bool {
2832 true
2833 }
2834 }
2835
2836 unsafe impl<D: fidl::encoding::ResourceDialect>
2837 fidl::encoding::Encode<FDomainWaitForSignalsRequest, D> for &FDomainWaitForSignalsRequest
2838 {
2839 #[inline]
2840 unsafe fn encode(
2841 self,
2842 encoder: &mut fidl::encoding::Encoder<'_, D>,
2843 offset: usize,
2844 _depth: fidl::encoding::Depth,
2845 ) -> fidl::Result<()> {
2846 encoder.debug_check_bounds::<FDomainWaitForSignalsRequest>(offset);
2847 unsafe {
2848 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2850 (buf_ptr as *mut FDomainWaitForSignalsRequest)
2851 .write_unaligned((self as *const FDomainWaitForSignalsRequest).read());
2852 }
2855 Ok(())
2856 }
2857 }
2858 unsafe impl<
2859 D: fidl::encoding::ResourceDialect,
2860 T0: fidl::encoding::Encode<HandleId, D>,
2861 T1: fidl::encoding::Encode<u32, D>,
2862 > fidl::encoding::Encode<FDomainWaitForSignalsRequest, D> for (T0, T1)
2863 {
2864 #[inline]
2865 unsafe fn encode(
2866 self,
2867 encoder: &mut fidl::encoding::Encoder<'_, D>,
2868 offset: usize,
2869 depth: fidl::encoding::Depth,
2870 ) -> fidl::Result<()> {
2871 encoder.debug_check_bounds::<FDomainWaitForSignalsRequest>(offset);
2872 self.0.encode(encoder, offset + 0, depth)?;
2876 self.1.encode(encoder, offset + 4, depth)?;
2877 Ok(())
2878 }
2879 }
2880
2881 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2882 for FDomainWaitForSignalsRequest
2883 {
2884 #[inline(always)]
2885 fn new_empty() -> Self {
2886 Self { handle: fidl::new_empty!(HandleId, D), signals: fidl::new_empty!(u32, D) }
2887 }
2888
2889 #[inline]
2890 unsafe fn decode(
2891 &mut self,
2892 decoder: &mut fidl::encoding::Decoder<'_, D>,
2893 offset: usize,
2894 _depth: fidl::encoding::Depth,
2895 ) -> fidl::Result<()> {
2896 decoder.debug_check_bounds::<Self>(offset);
2897 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2898 unsafe {
2901 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2902 }
2903 Ok(())
2904 }
2905 }
2906
2907 impl fidl::encoding::ValueTypeMarker for FDomainWaitForSignalsResponse {
2908 type Borrowed<'a> = &'a Self;
2909 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2910 value
2911 }
2912 }
2913
2914 unsafe impl fidl::encoding::TypeMarker for FDomainWaitForSignalsResponse {
2915 type Owned = Self;
2916
2917 #[inline(always)]
2918 fn inline_align(_context: fidl::encoding::Context) -> usize {
2919 4
2920 }
2921
2922 #[inline(always)]
2923 fn inline_size(_context: fidl::encoding::Context) -> usize {
2924 4
2925 }
2926 #[inline(always)]
2927 fn encode_is_copy() -> bool {
2928 true
2929 }
2930
2931 #[inline(always)]
2932 fn decode_is_copy() -> bool {
2933 true
2934 }
2935 }
2936
2937 unsafe impl<D: fidl::encoding::ResourceDialect>
2938 fidl::encoding::Encode<FDomainWaitForSignalsResponse, D>
2939 for &FDomainWaitForSignalsResponse
2940 {
2941 #[inline]
2942 unsafe fn encode(
2943 self,
2944 encoder: &mut fidl::encoding::Encoder<'_, D>,
2945 offset: usize,
2946 _depth: fidl::encoding::Depth,
2947 ) -> fidl::Result<()> {
2948 encoder.debug_check_bounds::<FDomainWaitForSignalsResponse>(offset);
2949 unsafe {
2950 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2952 (buf_ptr as *mut FDomainWaitForSignalsResponse)
2953 .write_unaligned((self as *const FDomainWaitForSignalsResponse).read());
2954 }
2957 Ok(())
2958 }
2959 }
2960 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2961 fidl::encoding::Encode<FDomainWaitForSignalsResponse, D> for (T0,)
2962 {
2963 #[inline]
2964 unsafe fn encode(
2965 self,
2966 encoder: &mut fidl::encoding::Encoder<'_, D>,
2967 offset: usize,
2968 depth: fidl::encoding::Depth,
2969 ) -> fidl::Result<()> {
2970 encoder.debug_check_bounds::<FDomainWaitForSignalsResponse>(offset);
2971 self.0.encode(encoder, offset + 0, depth)?;
2975 Ok(())
2976 }
2977 }
2978
2979 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2980 for FDomainWaitForSignalsResponse
2981 {
2982 #[inline(always)]
2983 fn new_empty() -> Self {
2984 Self { signals: fidl::new_empty!(u32, D) }
2985 }
2986
2987 #[inline]
2988 unsafe fn decode(
2989 &mut self,
2990 decoder: &mut fidl::encoding::Decoder<'_, D>,
2991 offset: usize,
2992 _depth: fidl::encoding::Depth,
2993 ) -> fidl::Result<()> {
2994 decoder.debug_check_bounds::<Self>(offset);
2995 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2996 unsafe {
2999 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3000 }
3001 Ok(())
3002 }
3003 }
3004
3005 impl fidl::encoding::ValueTypeMarker for HandleDisposition {
3006 type Borrowed<'a> = &'a Self;
3007 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3008 value
3009 }
3010 }
3011
3012 unsafe impl fidl::encoding::TypeMarker for HandleDisposition {
3013 type Owned = Self;
3014
3015 #[inline(always)]
3016 fn inline_align(_context: fidl::encoding::Context) -> usize {
3017 8
3018 }
3019
3020 #[inline(always)]
3021 fn inline_size(_context: fidl::encoding::Context) -> usize {
3022 24
3023 }
3024 }
3025
3026 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleDisposition, D>
3027 for &HandleDisposition
3028 {
3029 #[inline]
3030 unsafe fn encode(
3031 self,
3032 encoder: &mut fidl::encoding::Encoder<'_, D>,
3033 offset: usize,
3034 _depth: fidl::encoding::Depth,
3035 ) -> fidl::Result<()> {
3036 encoder.debug_check_bounds::<HandleDisposition>(offset);
3037 fidl::encoding::Encode::<HandleDisposition, D>::encode(
3039 (
3040 <HandleOp as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
3041 <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
3042 ),
3043 encoder,
3044 offset,
3045 _depth,
3046 )
3047 }
3048 }
3049 unsafe impl<
3050 D: fidl::encoding::ResourceDialect,
3051 T0: fidl::encoding::Encode<HandleOp, D>,
3052 T1: fidl::encoding::Encode<fidl::Rights, D>,
3053 > fidl::encoding::Encode<HandleDisposition, D> for (T0, T1)
3054 {
3055 #[inline]
3056 unsafe fn encode(
3057 self,
3058 encoder: &mut fidl::encoding::Encoder<'_, D>,
3059 offset: usize,
3060 depth: fidl::encoding::Depth,
3061 ) -> fidl::Result<()> {
3062 encoder.debug_check_bounds::<HandleDisposition>(offset);
3063 unsafe {
3066 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3067 (ptr as *mut u64).write_unaligned(0);
3068 }
3069 self.0.encode(encoder, offset + 0, depth)?;
3071 self.1.encode(encoder, offset + 16, depth)?;
3072 Ok(())
3073 }
3074 }
3075
3076 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleDisposition {
3077 #[inline(always)]
3078 fn new_empty() -> Self {
3079 Self {
3080 handle: fidl::new_empty!(HandleOp, D),
3081 rights: fidl::new_empty!(fidl::Rights, D),
3082 }
3083 }
3084
3085 #[inline]
3086 unsafe fn decode(
3087 &mut self,
3088 decoder: &mut fidl::encoding::Decoder<'_, D>,
3089 offset: usize,
3090 _depth: fidl::encoding::Depth,
3091 ) -> fidl::Result<()> {
3092 decoder.debug_check_bounds::<Self>(offset);
3093 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3095 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3096 let mask = 0xffffffff00000000u64;
3097 let maskedval = padval & mask;
3098 if maskedval != 0 {
3099 return Err(fidl::Error::NonZeroPadding {
3100 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3101 });
3102 }
3103 fidl::decode!(HandleOp, D, &mut self.handle, decoder, offset + 0, _depth)?;
3104 fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 16, _depth)?;
3105 Ok(())
3106 }
3107 }
3108
3109 impl fidl::encoding::ValueTypeMarker for HandleId {
3110 type Borrowed<'a> = &'a Self;
3111 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3112 value
3113 }
3114 }
3115
3116 unsafe impl fidl::encoding::TypeMarker for HandleId {
3117 type Owned = Self;
3118
3119 #[inline(always)]
3120 fn inline_align(_context: fidl::encoding::Context) -> usize {
3121 4
3122 }
3123
3124 #[inline(always)]
3125 fn inline_size(_context: fidl::encoding::Context) -> usize {
3126 4
3127 }
3128 #[inline(always)]
3129 fn encode_is_copy() -> bool {
3130 true
3131 }
3132
3133 #[inline(always)]
3134 fn decode_is_copy() -> bool {
3135 true
3136 }
3137 }
3138
3139 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleId, D> for &HandleId {
3140 #[inline]
3141 unsafe fn encode(
3142 self,
3143 encoder: &mut fidl::encoding::Encoder<'_, D>,
3144 offset: usize,
3145 _depth: fidl::encoding::Depth,
3146 ) -> fidl::Result<()> {
3147 encoder.debug_check_bounds::<HandleId>(offset);
3148 unsafe {
3149 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3151 (buf_ptr as *mut HandleId).write_unaligned((self as *const HandleId).read());
3152 }
3155 Ok(())
3156 }
3157 }
3158 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3159 fidl::encoding::Encode<HandleId, D> for (T0,)
3160 {
3161 #[inline]
3162 unsafe fn encode(
3163 self,
3164 encoder: &mut fidl::encoding::Encoder<'_, D>,
3165 offset: usize,
3166 depth: fidl::encoding::Depth,
3167 ) -> fidl::Result<()> {
3168 encoder.debug_check_bounds::<HandleId>(offset);
3169 self.0.encode(encoder, offset + 0, depth)?;
3173 Ok(())
3174 }
3175 }
3176
3177 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleId {
3178 #[inline(always)]
3179 fn new_empty() -> Self {
3180 Self { id: fidl::new_empty!(u32, D) }
3181 }
3182
3183 #[inline]
3184 unsafe fn decode(
3185 &mut self,
3186 decoder: &mut fidl::encoding::Decoder<'_, D>,
3187 offset: usize,
3188 _depth: fidl::encoding::Depth,
3189 ) -> fidl::Result<()> {
3190 decoder.debug_check_bounds::<Self>(offset);
3191 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3192 unsafe {
3195 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3196 }
3197 Ok(())
3198 }
3199 }
3200
3201 impl fidl::encoding::ValueTypeMarker for HandleInfo {
3202 type Borrowed<'a> = &'a Self;
3203 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3204 value
3205 }
3206 }
3207
3208 unsafe impl fidl::encoding::TypeMarker for HandleInfo {
3209 type Owned = Self;
3210
3211 #[inline(always)]
3212 fn inline_align(_context: fidl::encoding::Context) -> usize {
3213 4
3214 }
3215
3216 #[inline(always)]
3217 fn inline_size(_context: fidl::encoding::Context) -> usize {
3218 12
3219 }
3220 }
3221
3222 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleInfo, D>
3223 for &HandleInfo
3224 {
3225 #[inline]
3226 unsafe fn encode(
3227 self,
3228 encoder: &mut fidl::encoding::Encoder<'_, D>,
3229 offset: usize,
3230 _depth: fidl::encoding::Depth,
3231 ) -> fidl::Result<()> {
3232 encoder.debug_check_bounds::<HandleInfo>(offset);
3233 fidl::encoding::Encode::<HandleInfo, D>::encode(
3235 (
3236 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
3237 <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
3238 <fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
3239 ),
3240 encoder,
3241 offset,
3242 _depth,
3243 )
3244 }
3245 }
3246 unsafe impl<
3247 D: fidl::encoding::ResourceDialect,
3248 T0: fidl::encoding::Encode<HandleId, D>,
3249 T1: fidl::encoding::Encode<fidl::ObjectType, D>,
3250 T2: fidl::encoding::Encode<fidl::Rights, D>,
3251 > fidl::encoding::Encode<HandleInfo, D> for (T0, T1, T2)
3252 {
3253 #[inline]
3254 unsafe fn encode(
3255 self,
3256 encoder: &mut fidl::encoding::Encoder<'_, D>,
3257 offset: usize,
3258 depth: fidl::encoding::Depth,
3259 ) -> fidl::Result<()> {
3260 encoder.debug_check_bounds::<HandleInfo>(offset);
3261 self.0.encode(encoder, offset + 0, depth)?;
3265 self.1.encode(encoder, offset + 4, depth)?;
3266 self.2.encode(encoder, offset + 8, depth)?;
3267 Ok(())
3268 }
3269 }
3270
3271 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleInfo {
3272 #[inline(always)]
3273 fn new_empty() -> Self {
3274 Self {
3275 handle: fidl::new_empty!(HandleId, D),
3276 type_: fidl::new_empty!(fidl::ObjectType, D),
3277 rights: fidl::new_empty!(fidl::Rights, D),
3278 }
3279 }
3280
3281 #[inline]
3282 unsafe fn decode(
3283 &mut self,
3284 decoder: &mut fidl::encoding::Decoder<'_, D>,
3285 offset: usize,
3286 _depth: fidl::encoding::Depth,
3287 ) -> fidl::Result<()> {
3288 decoder.debug_check_bounds::<Self>(offset);
3289 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
3291 fidl::decode!(fidl::ObjectType, D, &mut self.type_, decoder, offset + 4, _depth)?;
3292 fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 8, _depth)?;
3293 Ok(())
3294 }
3295 }
3296
3297 impl fidl::encoding::ValueTypeMarker for NewHandleId {
3298 type Borrowed<'a> = &'a Self;
3299 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3300 value
3301 }
3302 }
3303
3304 unsafe impl fidl::encoding::TypeMarker for NewHandleId {
3305 type Owned = Self;
3306
3307 #[inline(always)]
3308 fn inline_align(_context: fidl::encoding::Context) -> usize {
3309 4
3310 }
3311
3312 #[inline(always)]
3313 fn inline_size(_context: fidl::encoding::Context) -> usize {
3314 4
3315 }
3316 #[inline(always)]
3317 fn encode_is_copy() -> bool {
3318 true
3319 }
3320
3321 #[inline(always)]
3322 fn decode_is_copy() -> bool {
3323 true
3324 }
3325 }
3326
3327 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NewHandleId, D>
3328 for &NewHandleId
3329 {
3330 #[inline]
3331 unsafe fn encode(
3332 self,
3333 encoder: &mut fidl::encoding::Encoder<'_, D>,
3334 offset: usize,
3335 _depth: fidl::encoding::Depth,
3336 ) -> fidl::Result<()> {
3337 encoder.debug_check_bounds::<NewHandleId>(offset);
3338 unsafe {
3339 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3341 (buf_ptr as *mut NewHandleId).write_unaligned((self as *const NewHandleId).read());
3342 }
3345 Ok(())
3346 }
3347 }
3348 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3349 fidl::encoding::Encode<NewHandleId, D> for (T0,)
3350 {
3351 #[inline]
3352 unsafe fn encode(
3353 self,
3354 encoder: &mut fidl::encoding::Encoder<'_, D>,
3355 offset: usize,
3356 depth: fidl::encoding::Depth,
3357 ) -> fidl::Result<()> {
3358 encoder.debug_check_bounds::<NewHandleId>(offset);
3359 self.0.encode(encoder, offset + 0, depth)?;
3363 Ok(())
3364 }
3365 }
3366
3367 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NewHandleId {
3368 #[inline(always)]
3369 fn new_empty() -> Self {
3370 Self { id: fidl::new_empty!(u32, D) }
3371 }
3372
3373 #[inline]
3374 unsafe fn decode(
3375 &mut self,
3376 decoder: &mut fidl::encoding::Decoder<'_, D>,
3377 offset: usize,
3378 _depth: fidl::encoding::Depth,
3379 ) -> fidl::Result<()> {
3380 decoder.debug_check_bounds::<Self>(offset);
3381 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3382 unsafe {
3385 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3386 }
3387 Ok(())
3388 }
3389 }
3390
3391 impl fidl::encoding::ValueTypeMarker for NewHandleIdOutOfRange {
3392 type Borrowed<'a> = &'a Self;
3393 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3394 value
3395 }
3396 }
3397
3398 unsafe impl fidl::encoding::TypeMarker for NewHandleIdOutOfRange {
3399 type Owned = Self;
3400
3401 #[inline(always)]
3402 fn inline_align(_context: fidl::encoding::Context) -> usize {
3403 4
3404 }
3405
3406 #[inline(always)]
3407 fn inline_size(_context: fidl::encoding::Context) -> usize {
3408 4
3409 }
3410 #[inline(always)]
3411 fn encode_is_copy() -> bool {
3412 true
3413 }
3414
3415 #[inline(always)]
3416 fn decode_is_copy() -> bool {
3417 true
3418 }
3419 }
3420
3421 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NewHandleIdOutOfRange, D>
3422 for &NewHandleIdOutOfRange
3423 {
3424 #[inline]
3425 unsafe fn encode(
3426 self,
3427 encoder: &mut fidl::encoding::Encoder<'_, D>,
3428 offset: usize,
3429 _depth: fidl::encoding::Depth,
3430 ) -> fidl::Result<()> {
3431 encoder.debug_check_bounds::<NewHandleIdOutOfRange>(offset);
3432 unsafe {
3433 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3435 (buf_ptr as *mut NewHandleIdOutOfRange)
3436 .write_unaligned((self as *const NewHandleIdOutOfRange).read());
3437 }
3440 Ok(())
3441 }
3442 }
3443 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3444 fidl::encoding::Encode<NewHandleIdOutOfRange, D> for (T0,)
3445 {
3446 #[inline]
3447 unsafe fn encode(
3448 self,
3449 encoder: &mut fidl::encoding::Encoder<'_, D>,
3450 offset: usize,
3451 depth: fidl::encoding::Depth,
3452 ) -> fidl::Result<()> {
3453 encoder.debug_check_bounds::<NewHandleIdOutOfRange>(offset);
3454 self.0.encode(encoder, offset + 0, depth)?;
3458 Ok(())
3459 }
3460 }
3461
3462 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NewHandleIdOutOfRange {
3463 #[inline(always)]
3464 fn new_empty() -> Self {
3465 Self { id: fidl::new_empty!(u32, D) }
3466 }
3467
3468 #[inline]
3469 unsafe fn decode(
3470 &mut self,
3471 decoder: &mut fidl::encoding::Decoder<'_, D>,
3472 offset: usize,
3473 _depth: fidl::encoding::Depth,
3474 ) -> fidl::Result<()> {
3475 decoder.debug_check_bounds::<Self>(offset);
3476 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3477 unsafe {
3480 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3481 }
3482 Ok(())
3483 }
3484 }
3485
3486 impl fidl::encoding::ValueTypeMarker for NewHandleIdReused {
3487 type Borrowed<'a> = &'a Self;
3488 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3489 value
3490 }
3491 }
3492
3493 unsafe impl fidl::encoding::TypeMarker for NewHandleIdReused {
3494 type Owned = Self;
3495
3496 #[inline(always)]
3497 fn inline_align(_context: fidl::encoding::Context) -> usize {
3498 4
3499 }
3500
3501 #[inline(always)]
3502 fn inline_size(_context: fidl::encoding::Context) -> usize {
3503 8
3504 }
3505 }
3506
3507 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NewHandleIdReused, D>
3508 for &NewHandleIdReused
3509 {
3510 #[inline]
3511 unsafe fn encode(
3512 self,
3513 encoder: &mut fidl::encoding::Encoder<'_, D>,
3514 offset: usize,
3515 _depth: fidl::encoding::Depth,
3516 ) -> fidl::Result<()> {
3517 encoder.debug_check_bounds::<NewHandleIdReused>(offset);
3518 fidl::encoding::Encode::<NewHandleIdReused, D>::encode(
3520 (
3521 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3522 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.same_call),
3523 ),
3524 encoder,
3525 offset,
3526 _depth,
3527 )
3528 }
3529 }
3530 unsafe impl<
3531 D: fidl::encoding::ResourceDialect,
3532 T0: fidl::encoding::Encode<u32, D>,
3533 T1: fidl::encoding::Encode<bool, D>,
3534 > fidl::encoding::Encode<NewHandleIdReused, D> for (T0, T1)
3535 {
3536 #[inline]
3537 unsafe fn encode(
3538 self,
3539 encoder: &mut fidl::encoding::Encoder<'_, D>,
3540 offset: usize,
3541 depth: fidl::encoding::Depth,
3542 ) -> fidl::Result<()> {
3543 encoder.debug_check_bounds::<NewHandleIdReused>(offset);
3544 unsafe {
3547 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
3548 (ptr as *mut u32).write_unaligned(0);
3549 }
3550 self.0.encode(encoder, offset + 0, depth)?;
3552 self.1.encode(encoder, offset + 4, depth)?;
3553 Ok(())
3554 }
3555 }
3556
3557 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NewHandleIdReused {
3558 #[inline(always)]
3559 fn new_empty() -> Self {
3560 Self { id: fidl::new_empty!(u32, D), same_call: fidl::new_empty!(bool, D) }
3561 }
3562
3563 #[inline]
3564 unsafe fn decode(
3565 &mut self,
3566 decoder: &mut fidl::encoding::Decoder<'_, D>,
3567 offset: usize,
3568 _depth: fidl::encoding::Depth,
3569 ) -> fidl::Result<()> {
3570 decoder.debug_check_bounds::<Self>(offset);
3571 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
3573 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3574 let mask = 0xffffff00u32;
3575 let maskedval = padval & mask;
3576 if maskedval != 0 {
3577 return Err(fidl::Error::NonZeroPadding {
3578 padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
3579 });
3580 }
3581 fidl::decode!(u32, D, &mut self.id, decoder, offset + 0, _depth)?;
3582 fidl::decode!(bool, D, &mut self.same_call, decoder, offset + 4, _depth)?;
3583 Ok(())
3584 }
3585 }
3586
3587 impl fidl::encoding::ValueTypeMarker for NoErrorPending {
3588 type Borrowed<'a> = &'a Self;
3589 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3590 value
3591 }
3592 }
3593
3594 unsafe impl fidl::encoding::TypeMarker for NoErrorPending {
3595 type Owned = Self;
3596
3597 #[inline(always)]
3598 fn inline_align(_context: fidl::encoding::Context) -> usize {
3599 1
3600 }
3601
3602 #[inline(always)]
3603 fn inline_size(_context: fidl::encoding::Context) -> usize {
3604 1
3605 }
3606 }
3607
3608 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NoErrorPending, D>
3609 for &NoErrorPending
3610 {
3611 #[inline]
3612 unsafe fn encode(
3613 self,
3614 encoder: &mut fidl::encoding::Encoder<'_, D>,
3615 offset: usize,
3616 _depth: fidl::encoding::Depth,
3617 ) -> fidl::Result<()> {
3618 encoder.debug_check_bounds::<NoErrorPending>(offset);
3619 encoder.write_num(0u8, offset);
3620 Ok(())
3621 }
3622 }
3623
3624 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NoErrorPending {
3625 #[inline(always)]
3626 fn new_empty() -> Self {
3627 Self
3628 }
3629
3630 #[inline]
3631 unsafe fn decode(
3632 &mut self,
3633 decoder: &mut fidl::encoding::Decoder<'_, D>,
3634 offset: usize,
3635 _depth: fidl::encoding::Depth,
3636 ) -> fidl::Result<()> {
3637 decoder.debug_check_bounds::<Self>(offset);
3638 match decoder.read_num::<u8>(offset) {
3639 0 => Ok(()),
3640 _ => Err(fidl::Error::Invalid),
3641 }
3642 }
3643 }
3644
3645 impl fidl::encoding::ValueTypeMarker for NoReadInProgress {
3646 type Borrowed<'a> = &'a Self;
3647 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3648 value
3649 }
3650 }
3651
3652 unsafe impl fidl::encoding::TypeMarker for NoReadInProgress {
3653 type Owned = Self;
3654
3655 #[inline(always)]
3656 fn inline_align(_context: fidl::encoding::Context) -> usize {
3657 1
3658 }
3659
3660 #[inline(always)]
3661 fn inline_size(_context: fidl::encoding::Context) -> usize {
3662 1
3663 }
3664 }
3665
3666 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NoReadInProgress, D>
3667 for &NoReadInProgress
3668 {
3669 #[inline]
3670 unsafe fn encode(
3671 self,
3672 encoder: &mut fidl::encoding::Encoder<'_, D>,
3673 offset: usize,
3674 _depth: fidl::encoding::Depth,
3675 ) -> fidl::Result<()> {
3676 encoder.debug_check_bounds::<NoReadInProgress>(offset);
3677 encoder.write_num(0u8, offset);
3678 Ok(())
3679 }
3680 }
3681
3682 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NoReadInProgress {
3683 #[inline(always)]
3684 fn new_empty() -> Self {
3685 Self
3686 }
3687
3688 #[inline]
3689 unsafe fn decode(
3690 &mut self,
3691 decoder: &mut fidl::encoding::Decoder<'_, D>,
3692 offset: usize,
3693 _depth: fidl::encoding::Depth,
3694 ) -> fidl::Result<()> {
3695 decoder.debug_check_bounds::<Self>(offset);
3696 match decoder.read_num::<u8>(offset) {
3697 0 => Ok(()),
3698 _ => Err(fidl::Error::Invalid),
3699 }
3700 }
3701 }
3702
3703 impl fidl::encoding::ValueTypeMarker for RightsUnknown {
3704 type Borrowed<'a> = &'a Self;
3705 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3706 value
3707 }
3708 }
3709
3710 unsafe impl fidl::encoding::TypeMarker for RightsUnknown {
3711 type Owned = Self;
3712
3713 #[inline(always)]
3714 fn inline_align(_context: fidl::encoding::Context) -> usize {
3715 4
3716 }
3717
3718 #[inline(always)]
3719 fn inline_size(_context: fidl::encoding::Context) -> usize {
3720 4
3721 }
3722 }
3723
3724 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RightsUnknown, D>
3725 for &RightsUnknown
3726 {
3727 #[inline]
3728 unsafe fn encode(
3729 self,
3730 encoder: &mut fidl::encoding::Encoder<'_, D>,
3731 offset: usize,
3732 _depth: fidl::encoding::Depth,
3733 ) -> fidl::Result<()> {
3734 encoder.debug_check_bounds::<RightsUnknown>(offset);
3735 fidl::encoding::Encode::<RightsUnknown, D>::encode(
3737 (<fidl::Rights as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),),
3738 encoder,
3739 offset,
3740 _depth,
3741 )
3742 }
3743 }
3744 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<fidl::Rights, D>>
3745 fidl::encoding::Encode<RightsUnknown, D> for (T0,)
3746 {
3747 #[inline]
3748 unsafe fn encode(
3749 self,
3750 encoder: &mut fidl::encoding::Encoder<'_, D>,
3751 offset: usize,
3752 depth: fidl::encoding::Depth,
3753 ) -> fidl::Result<()> {
3754 encoder.debug_check_bounds::<RightsUnknown>(offset);
3755 self.0.encode(encoder, offset + 0, depth)?;
3759 Ok(())
3760 }
3761 }
3762
3763 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RightsUnknown {
3764 #[inline(always)]
3765 fn new_empty() -> Self {
3766 Self { rights: fidl::new_empty!(fidl::Rights, D) }
3767 }
3768
3769 #[inline]
3770 unsafe fn decode(
3771 &mut self,
3772 decoder: &mut fidl::encoding::Decoder<'_, D>,
3773 offset: usize,
3774 _depth: fidl::encoding::Depth,
3775 ) -> fidl::Result<()> {
3776 decoder.debug_check_bounds::<Self>(offset);
3777 fidl::decode!(fidl::Rights, D, &mut self.rights, decoder, offset + 0, _depth)?;
3779 Ok(())
3780 }
3781 }
3782
3783 impl fidl::encoding::ValueTypeMarker for SignalsUnknown {
3784 type Borrowed<'a> = &'a Self;
3785 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3786 value
3787 }
3788 }
3789
3790 unsafe impl fidl::encoding::TypeMarker for SignalsUnknown {
3791 type Owned = Self;
3792
3793 #[inline(always)]
3794 fn inline_align(_context: fidl::encoding::Context) -> usize {
3795 4
3796 }
3797
3798 #[inline(always)]
3799 fn inline_size(_context: fidl::encoding::Context) -> usize {
3800 4
3801 }
3802 #[inline(always)]
3803 fn encode_is_copy() -> bool {
3804 true
3805 }
3806
3807 #[inline(always)]
3808 fn decode_is_copy() -> bool {
3809 true
3810 }
3811 }
3812
3813 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SignalsUnknown, D>
3814 for &SignalsUnknown
3815 {
3816 #[inline]
3817 unsafe fn encode(
3818 self,
3819 encoder: &mut fidl::encoding::Encoder<'_, D>,
3820 offset: usize,
3821 _depth: fidl::encoding::Depth,
3822 ) -> fidl::Result<()> {
3823 encoder.debug_check_bounds::<SignalsUnknown>(offset);
3824 unsafe {
3825 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3827 (buf_ptr as *mut SignalsUnknown)
3828 .write_unaligned((self as *const SignalsUnknown).read());
3829 }
3832 Ok(())
3833 }
3834 }
3835 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
3836 fidl::encoding::Encode<SignalsUnknown, D> for (T0,)
3837 {
3838 #[inline]
3839 unsafe fn encode(
3840 self,
3841 encoder: &mut fidl::encoding::Encoder<'_, D>,
3842 offset: usize,
3843 depth: fidl::encoding::Depth,
3844 ) -> fidl::Result<()> {
3845 encoder.debug_check_bounds::<SignalsUnknown>(offset);
3846 self.0.encode(encoder, offset + 0, depth)?;
3850 Ok(())
3851 }
3852 }
3853
3854 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SignalsUnknown {
3855 #[inline(always)]
3856 fn new_empty() -> Self {
3857 Self { signals: fidl::new_empty!(u32, D) }
3858 }
3859
3860 #[inline]
3861 unsafe fn decode(
3862 &mut self,
3863 decoder: &mut fidl::encoding::Decoder<'_, D>,
3864 offset: usize,
3865 _depth: fidl::encoding::Depth,
3866 ) -> fidl::Result<()> {
3867 decoder.debug_check_bounds::<Self>(offset);
3868 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3869 unsafe {
3872 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3873 }
3874 Ok(())
3875 }
3876 }
3877
3878 impl fidl::encoding::ValueTypeMarker for SocketCreateSocketRequest {
3879 type Borrowed<'a> = &'a Self;
3880 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3881 value
3882 }
3883 }
3884
3885 unsafe impl fidl::encoding::TypeMarker for SocketCreateSocketRequest {
3886 type Owned = Self;
3887
3888 #[inline(always)]
3889 fn inline_align(_context: fidl::encoding::Context) -> usize {
3890 4
3891 }
3892
3893 #[inline(always)]
3894 fn inline_size(_context: fidl::encoding::Context) -> usize {
3895 12
3896 }
3897 }
3898
3899 unsafe impl<D: fidl::encoding::ResourceDialect>
3900 fidl::encoding::Encode<SocketCreateSocketRequest, D> for &SocketCreateSocketRequest
3901 {
3902 #[inline]
3903 unsafe fn encode(
3904 self,
3905 encoder: &mut fidl::encoding::Encoder<'_, D>,
3906 offset: usize,
3907 _depth: fidl::encoding::Depth,
3908 ) -> fidl::Result<()> {
3909 encoder.debug_check_bounds::<SocketCreateSocketRequest>(offset);
3910 fidl::encoding::Encode::<SocketCreateSocketRequest, D>::encode(
3912 (
3913 <SocketType as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3914 <fidl::encoding::Array<NewHandleId, 2> as fidl::encoding::ValueTypeMarker>::borrow(&self.handles),
3915 ),
3916 encoder, offset, _depth
3917 )
3918 }
3919 }
3920 unsafe impl<
3921 D: fidl::encoding::ResourceDialect,
3922 T0: fidl::encoding::Encode<SocketType, D>,
3923 T1: fidl::encoding::Encode<fidl::encoding::Array<NewHandleId, 2>, D>,
3924 > fidl::encoding::Encode<SocketCreateSocketRequest, D> for (T0, T1)
3925 {
3926 #[inline]
3927 unsafe fn encode(
3928 self,
3929 encoder: &mut fidl::encoding::Encoder<'_, D>,
3930 offset: usize,
3931 depth: fidl::encoding::Depth,
3932 ) -> fidl::Result<()> {
3933 encoder.debug_check_bounds::<SocketCreateSocketRequest>(offset);
3934 self.0.encode(encoder, offset + 0, depth)?;
3938 self.1.encode(encoder, offset + 4, depth)?;
3939 Ok(())
3940 }
3941 }
3942
3943 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3944 for SocketCreateSocketRequest
3945 {
3946 #[inline(always)]
3947 fn new_empty() -> Self {
3948 Self {
3949 options: fidl::new_empty!(SocketType, D),
3950 handles: fidl::new_empty!(fidl::encoding::Array<NewHandleId, 2>, D),
3951 }
3952 }
3953
3954 #[inline]
3955 unsafe fn decode(
3956 &mut self,
3957 decoder: &mut fidl::encoding::Decoder<'_, D>,
3958 offset: usize,
3959 _depth: fidl::encoding::Depth,
3960 ) -> fidl::Result<()> {
3961 decoder.debug_check_bounds::<Self>(offset);
3962 fidl::decode!(SocketType, D, &mut self.options, decoder, offset + 0, _depth)?;
3964 fidl::decode!(fidl::encoding::Array<NewHandleId, 2>, D, &mut self.handles, decoder, offset + 4, _depth)?;
3965 Ok(())
3966 }
3967 }
3968
3969 impl fidl::encoding::ValueTypeMarker for SocketDispositionUnknown {
3970 type Borrowed<'a> = &'a Self;
3971 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3972 value
3973 }
3974 }
3975
3976 unsafe impl fidl::encoding::TypeMarker for SocketDispositionUnknown {
3977 type Owned = Self;
3978
3979 #[inline(always)]
3980 fn inline_align(_context: fidl::encoding::Context) -> usize {
3981 4
3982 }
3983
3984 #[inline(always)]
3985 fn inline_size(_context: fidl::encoding::Context) -> usize {
3986 4
3987 }
3988 }
3989
3990 unsafe impl<D: fidl::encoding::ResourceDialect>
3991 fidl::encoding::Encode<SocketDispositionUnknown, D> for &SocketDispositionUnknown
3992 {
3993 #[inline]
3994 unsafe fn encode(
3995 self,
3996 encoder: &mut fidl::encoding::Encoder<'_, D>,
3997 offset: usize,
3998 _depth: fidl::encoding::Depth,
3999 ) -> fidl::Result<()> {
4000 encoder.debug_check_bounds::<SocketDispositionUnknown>(offset);
4001 fidl::encoding::Encode::<SocketDispositionUnknown, D>::encode(
4003 (<SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(&self.disposition),),
4004 encoder,
4005 offset,
4006 _depth,
4007 )
4008 }
4009 }
4010 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SocketDisposition, D>>
4011 fidl::encoding::Encode<SocketDispositionUnknown, D> for (T0,)
4012 {
4013 #[inline]
4014 unsafe fn encode(
4015 self,
4016 encoder: &mut fidl::encoding::Encoder<'_, D>,
4017 offset: usize,
4018 depth: fidl::encoding::Depth,
4019 ) -> fidl::Result<()> {
4020 encoder.debug_check_bounds::<SocketDispositionUnknown>(offset);
4021 self.0.encode(encoder, offset + 0, depth)?;
4025 Ok(())
4026 }
4027 }
4028
4029 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4030 for SocketDispositionUnknown
4031 {
4032 #[inline(always)]
4033 fn new_empty() -> Self {
4034 Self { disposition: fidl::new_empty!(SocketDisposition, D) }
4035 }
4036
4037 #[inline]
4038 unsafe fn decode(
4039 &mut self,
4040 decoder: &mut fidl::encoding::Decoder<'_, D>,
4041 offset: usize,
4042 _depth: fidl::encoding::Depth,
4043 ) -> fidl::Result<()> {
4044 decoder.debug_check_bounds::<Self>(offset);
4045 fidl::decode!(
4047 SocketDisposition,
4048 D,
4049 &mut self.disposition,
4050 decoder,
4051 offset + 0,
4052 _depth
4053 )?;
4054 Ok(())
4055 }
4056 }
4057
4058 impl fidl::encoding::ValueTypeMarker for SocketOnSocketStreamingDataRequest {
4059 type Borrowed<'a> = &'a Self;
4060 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4061 value
4062 }
4063 }
4064
4065 unsafe impl fidl::encoding::TypeMarker for SocketOnSocketStreamingDataRequest {
4066 type Owned = Self;
4067
4068 #[inline(always)]
4069 fn inline_align(_context: fidl::encoding::Context) -> usize {
4070 8
4071 }
4072
4073 #[inline(always)]
4074 fn inline_size(_context: fidl::encoding::Context) -> usize {
4075 24
4076 }
4077 }
4078
4079 unsafe impl<D: fidl::encoding::ResourceDialect>
4080 fidl::encoding::Encode<SocketOnSocketStreamingDataRequest, D>
4081 for &SocketOnSocketStreamingDataRequest
4082 {
4083 #[inline]
4084 unsafe fn encode(
4085 self,
4086 encoder: &mut fidl::encoding::Encoder<'_, D>,
4087 offset: usize,
4088 _depth: fidl::encoding::Depth,
4089 ) -> fidl::Result<()> {
4090 encoder.debug_check_bounds::<SocketOnSocketStreamingDataRequest>(offset);
4091 fidl::encoding::Encode::<SocketOnSocketStreamingDataRequest, D>::encode(
4093 (
4094 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4095 <SocketMessage as fidl::encoding::ValueTypeMarker>::borrow(
4096 &self.socket_message,
4097 ),
4098 ),
4099 encoder,
4100 offset,
4101 _depth,
4102 )
4103 }
4104 }
4105 unsafe impl<
4106 D: fidl::encoding::ResourceDialect,
4107 T0: fidl::encoding::Encode<HandleId, D>,
4108 T1: fidl::encoding::Encode<SocketMessage, D>,
4109 > fidl::encoding::Encode<SocketOnSocketStreamingDataRequest, D> for (T0, T1)
4110 {
4111 #[inline]
4112 unsafe fn encode(
4113 self,
4114 encoder: &mut fidl::encoding::Encoder<'_, D>,
4115 offset: usize,
4116 depth: fidl::encoding::Depth,
4117 ) -> fidl::Result<()> {
4118 encoder.debug_check_bounds::<SocketOnSocketStreamingDataRequest>(offset);
4119 unsafe {
4122 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4123 (ptr as *mut u64).write_unaligned(0);
4124 }
4125 self.0.encode(encoder, offset + 0, depth)?;
4127 self.1.encode(encoder, offset + 8, depth)?;
4128 Ok(())
4129 }
4130 }
4131
4132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4133 for SocketOnSocketStreamingDataRequest
4134 {
4135 #[inline(always)]
4136 fn new_empty() -> Self {
4137 Self {
4138 handle: fidl::new_empty!(HandleId, D),
4139 socket_message: fidl::new_empty!(SocketMessage, D),
4140 }
4141 }
4142
4143 #[inline]
4144 unsafe fn decode(
4145 &mut self,
4146 decoder: &mut fidl::encoding::Decoder<'_, D>,
4147 offset: usize,
4148 _depth: fidl::encoding::Depth,
4149 ) -> fidl::Result<()> {
4150 decoder.debug_check_bounds::<Self>(offset);
4151 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4153 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4154 let mask = 0xffffffff00000000u64;
4155 let maskedval = padval & mask;
4156 if maskedval != 0 {
4157 return Err(fidl::Error::NonZeroPadding {
4158 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4159 });
4160 }
4161 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4162 fidl::decode!(SocketMessage, D, &mut self.socket_message, decoder, offset + 8, _depth)?;
4163 Ok(())
4164 }
4165 }
4166
4167 impl fidl::encoding::ValueTypeMarker for SocketReadSocketRequest {
4168 type Borrowed<'a> = &'a Self;
4169 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4170 value
4171 }
4172 }
4173
4174 unsafe impl fidl::encoding::TypeMarker for SocketReadSocketRequest {
4175 type Owned = Self;
4176
4177 #[inline(always)]
4178 fn inline_align(_context: fidl::encoding::Context) -> usize {
4179 8
4180 }
4181
4182 #[inline(always)]
4183 fn inline_size(_context: fidl::encoding::Context) -> usize {
4184 16
4185 }
4186 }
4187
4188 unsafe impl<D: fidl::encoding::ResourceDialect>
4189 fidl::encoding::Encode<SocketReadSocketRequest, D> for &SocketReadSocketRequest
4190 {
4191 #[inline]
4192 unsafe fn encode(
4193 self,
4194 encoder: &mut fidl::encoding::Encoder<'_, D>,
4195 offset: usize,
4196 _depth: fidl::encoding::Depth,
4197 ) -> fidl::Result<()> {
4198 encoder.debug_check_bounds::<SocketReadSocketRequest>(offset);
4199 unsafe {
4200 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4202 (buf_ptr as *mut SocketReadSocketRequest)
4203 .write_unaligned((self as *const SocketReadSocketRequest).read());
4204 let padding_ptr = buf_ptr.offset(0) as *mut u64;
4207 let padding_mask = 0xffffffff00000000u64;
4208 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
4209 }
4210 Ok(())
4211 }
4212 }
4213 unsafe impl<
4214 D: fidl::encoding::ResourceDialect,
4215 T0: fidl::encoding::Encode<HandleId, D>,
4216 T1: fidl::encoding::Encode<u64, D>,
4217 > fidl::encoding::Encode<SocketReadSocketRequest, D> for (T0, T1)
4218 {
4219 #[inline]
4220 unsafe fn encode(
4221 self,
4222 encoder: &mut fidl::encoding::Encoder<'_, D>,
4223 offset: usize,
4224 depth: fidl::encoding::Depth,
4225 ) -> fidl::Result<()> {
4226 encoder.debug_check_bounds::<SocketReadSocketRequest>(offset);
4227 unsafe {
4230 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4231 (ptr as *mut u64).write_unaligned(0);
4232 }
4233 self.0.encode(encoder, offset + 0, depth)?;
4235 self.1.encode(encoder, offset + 8, depth)?;
4236 Ok(())
4237 }
4238 }
4239
4240 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4241 for SocketReadSocketRequest
4242 {
4243 #[inline(always)]
4244 fn new_empty() -> Self {
4245 Self { handle: fidl::new_empty!(HandleId, D), max_bytes: fidl::new_empty!(u64, D) }
4246 }
4247
4248 #[inline]
4249 unsafe fn decode(
4250 &mut self,
4251 decoder: &mut fidl::encoding::Decoder<'_, D>,
4252 offset: usize,
4253 _depth: fidl::encoding::Depth,
4254 ) -> fidl::Result<()> {
4255 decoder.debug_check_bounds::<Self>(offset);
4256 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4257 let ptr = unsafe { buf_ptr.offset(0) };
4259 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4260 let mask = 0xffffffff00000000u64;
4261 let maskedval = padval & mask;
4262 if maskedval != 0 {
4263 return Err(fidl::Error::NonZeroPadding {
4264 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4265 });
4266 }
4267 unsafe {
4269 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4270 }
4271 Ok(())
4272 }
4273 }
4274
4275 impl fidl::encoding::ValueTypeMarker for SocketReadSocketStreamingStartRequest {
4276 type Borrowed<'a> = &'a Self;
4277 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4278 value
4279 }
4280 }
4281
4282 unsafe impl fidl::encoding::TypeMarker for SocketReadSocketStreamingStartRequest {
4283 type Owned = Self;
4284
4285 #[inline(always)]
4286 fn inline_align(_context: fidl::encoding::Context) -> usize {
4287 4
4288 }
4289
4290 #[inline(always)]
4291 fn inline_size(_context: fidl::encoding::Context) -> usize {
4292 4
4293 }
4294 #[inline(always)]
4295 fn encode_is_copy() -> bool {
4296 true
4297 }
4298
4299 #[inline(always)]
4300 fn decode_is_copy() -> bool {
4301 true
4302 }
4303 }
4304
4305 unsafe impl<D: fidl::encoding::ResourceDialect>
4306 fidl::encoding::Encode<SocketReadSocketStreamingStartRequest, D>
4307 for &SocketReadSocketStreamingStartRequest
4308 {
4309 #[inline]
4310 unsafe fn encode(
4311 self,
4312 encoder: &mut fidl::encoding::Encoder<'_, D>,
4313 offset: usize,
4314 _depth: fidl::encoding::Depth,
4315 ) -> fidl::Result<()> {
4316 encoder.debug_check_bounds::<SocketReadSocketStreamingStartRequest>(offset);
4317 unsafe {
4318 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4320 (buf_ptr as *mut SocketReadSocketStreamingStartRequest)
4321 .write_unaligned((self as *const SocketReadSocketStreamingStartRequest).read());
4322 }
4325 Ok(())
4326 }
4327 }
4328 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
4329 fidl::encoding::Encode<SocketReadSocketStreamingStartRequest, D> for (T0,)
4330 {
4331 #[inline]
4332 unsafe fn encode(
4333 self,
4334 encoder: &mut fidl::encoding::Encoder<'_, D>,
4335 offset: usize,
4336 depth: fidl::encoding::Depth,
4337 ) -> fidl::Result<()> {
4338 encoder.debug_check_bounds::<SocketReadSocketStreamingStartRequest>(offset);
4339 self.0.encode(encoder, offset + 0, depth)?;
4343 Ok(())
4344 }
4345 }
4346
4347 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4348 for SocketReadSocketStreamingStartRequest
4349 {
4350 #[inline(always)]
4351 fn new_empty() -> Self {
4352 Self { handle: fidl::new_empty!(HandleId, D) }
4353 }
4354
4355 #[inline]
4356 unsafe fn decode(
4357 &mut self,
4358 decoder: &mut fidl::encoding::Decoder<'_, D>,
4359 offset: usize,
4360 _depth: fidl::encoding::Depth,
4361 ) -> fidl::Result<()> {
4362 decoder.debug_check_bounds::<Self>(offset);
4363 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4364 unsafe {
4367 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4368 }
4369 Ok(())
4370 }
4371 }
4372
4373 impl fidl::encoding::ValueTypeMarker for SocketReadSocketStreamingStopRequest {
4374 type Borrowed<'a> = &'a Self;
4375 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4376 value
4377 }
4378 }
4379
4380 unsafe impl fidl::encoding::TypeMarker for SocketReadSocketStreamingStopRequest {
4381 type Owned = Self;
4382
4383 #[inline(always)]
4384 fn inline_align(_context: fidl::encoding::Context) -> usize {
4385 4
4386 }
4387
4388 #[inline(always)]
4389 fn inline_size(_context: fidl::encoding::Context) -> usize {
4390 4
4391 }
4392 #[inline(always)]
4393 fn encode_is_copy() -> bool {
4394 true
4395 }
4396
4397 #[inline(always)]
4398 fn decode_is_copy() -> bool {
4399 true
4400 }
4401 }
4402
4403 unsafe impl<D: fidl::encoding::ResourceDialect>
4404 fidl::encoding::Encode<SocketReadSocketStreamingStopRequest, D>
4405 for &SocketReadSocketStreamingStopRequest
4406 {
4407 #[inline]
4408 unsafe fn encode(
4409 self,
4410 encoder: &mut fidl::encoding::Encoder<'_, D>,
4411 offset: usize,
4412 _depth: fidl::encoding::Depth,
4413 ) -> fidl::Result<()> {
4414 encoder.debug_check_bounds::<SocketReadSocketStreamingStopRequest>(offset);
4415 unsafe {
4416 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4418 (buf_ptr as *mut SocketReadSocketStreamingStopRequest)
4419 .write_unaligned((self as *const SocketReadSocketStreamingStopRequest).read());
4420 }
4423 Ok(())
4424 }
4425 }
4426 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HandleId, D>>
4427 fidl::encoding::Encode<SocketReadSocketStreamingStopRequest, D> for (T0,)
4428 {
4429 #[inline]
4430 unsafe fn encode(
4431 self,
4432 encoder: &mut fidl::encoding::Encoder<'_, D>,
4433 offset: usize,
4434 depth: fidl::encoding::Depth,
4435 ) -> fidl::Result<()> {
4436 encoder.debug_check_bounds::<SocketReadSocketStreamingStopRequest>(offset);
4437 self.0.encode(encoder, offset + 0, depth)?;
4441 Ok(())
4442 }
4443 }
4444
4445 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4446 for SocketReadSocketStreamingStopRequest
4447 {
4448 #[inline(always)]
4449 fn new_empty() -> Self {
4450 Self { handle: fidl::new_empty!(HandleId, D) }
4451 }
4452
4453 #[inline]
4454 unsafe fn decode(
4455 &mut self,
4456 decoder: &mut fidl::encoding::Decoder<'_, D>,
4457 offset: usize,
4458 _depth: fidl::encoding::Depth,
4459 ) -> fidl::Result<()> {
4460 decoder.debug_check_bounds::<Self>(offset);
4461 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4462 unsafe {
4465 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4466 }
4467 Ok(())
4468 }
4469 }
4470
4471 impl fidl::encoding::ValueTypeMarker for SocketSetSocketDispositionRequest {
4472 type Borrowed<'a> = &'a Self;
4473 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4474 value
4475 }
4476 }
4477
4478 unsafe impl fidl::encoding::TypeMarker for SocketSetSocketDispositionRequest {
4479 type Owned = Self;
4480
4481 #[inline(always)]
4482 fn inline_align(_context: fidl::encoding::Context) -> usize {
4483 4
4484 }
4485
4486 #[inline(always)]
4487 fn inline_size(_context: fidl::encoding::Context) -> usize {
4488 12
4489 }
4490 }
4491
4492 unsafe impl<D: fidl::encoding::ResourceDialect>
4493 fidl::encoding::Encode<SocketSetSocketDispositionRequest, D>
4494 for &SocketSetSocketDispositionRequest
4495 {
4496 #[inline]
4497 unsafe fn encode(
4498 self,
4499 encoder: &mut fidl::encoding::Encoder<'_, D>,
4500 offset: usize,
4501 _depth: fidl::encoding::Depth,
4502 ) -> fidl::Result<()> {
4503 encoder.debug_check_bounds::<SocketSetSocketDispositionRequest>(offset);
4504 fidl::encoding::Encode::<SocketSetSocketDispositionRequest, D>::encode(
4506 (
4507 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4508 <SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(
4509 &self.disposition,
4510 ),
4511 <SocketDisposition as fidl::encoding::ValueTypeMarker>::borrow(
4512 &self.disposition_peer,
4513 ),
4514 ),
4515 encoder,
4516 offset,
4517 _depth,
4518 )
4519 }
4520 }
4521 unsafe impl<
4522 D: fidl::encoding::ResourceDialect,
4523 T0: fidl::encoding::Encode<HandleId, D>,
4524 T1: fidl::encoding::Encode<SocketDisposition, D>,
4525 T2: fidl::encoding::Encode<SocketDisposition, D>,
4526 > fidl::encoding::Encode<SocketSetSocketDispositionRequest, D> for (T0, T1, T2)
4527 {
4528 #[inline]
4529 unsafe fn encode(
4530 self,
4531 encoder: &mut fidl::encoding::Encoder<'_, D>,
4532 offset: usize,
4533 depth: fidl::encoding::Depth,
4534 ) -> fidl::Result<()> {
4535 encoder.debug_check_bounds::<SocketSetSocketDispositionRequest>(offset);
4536 self.0.encode(encoder, offset + 0, depth)?;
4540 self.1.encode(encoder, offset + 4, depth)?;
4541 self.2.encode(encoder, offset + 8, depth)?;
4542 Ok(())
4543 }
4544 }
4545
4546 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4547 for SocketSetSocketDispositionRequest
4548 {
4549 #[inline(always)]
4550 fn new_empty() -> Self {
4551 Self {
4552 handle: fidl::new_empty!(HandleId, D),
4553 disposition: fidl::new_empty!(SocketDisposition, D),
4554 disposition_peer: fidl::new_empty!(SocketDisposition, D),
4555 }
4556 }
4557
4558 #[inline]
4559 unsafe fn decode(
4560 &mut self,
4561 decoder: &mut fidl::encoding::Decoder<'_, D>,
4562 offset: usize,
4563 _depth: fidl::encoding::Depth,
4564 ) -> fidl::Result<()> {
4565 decoder.debug_check_bounds::<Self>(offset);
4566 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4568 fidl::decode!(
4569 SocketDisposition,
4570 D,
4571 &mut self.disposition,
4572 decoder,
4573 offset + 4,
4574 _depth
4575 )?;
4576 fidl::decode!(
4577 SocketDisposition,
4578 D,
4579 &mut self.disposition_peer,
4580 decoder,
4581 offset + 8,
4582 _depth
4583 )?;
4584 Ok(())
4585 }
4586 }
4587
4588 impl fidl::encoding::ValueTypeMarker for SocketTypeUnknown {
4589 type Borrowed<'a> = &'a Self;
4590 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4591 value
4592 }
4593 }
4594
4595 unsafe impl fidl::encoding::TypeMarker for SocketTypeUnknown {
4596 type Owned = Self;
4597
4598 #[inline(always)]
4599 fn inline_align(_context: fidl::encoding::Context) -> usize {
4600 4
4601 }
4602
4603 #[inline(always)]
4604 fn inline_size(_context: fidl::encoding::Context) -> usize {
4605 4
4606 }
4607 }
4608
4609 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketTypeUnknown, D>
4610 for &SocketTypeUnknown
4611 {
4612 #[inline]
4613 unsafe fn encode(
4614 self,
4615 encoder: &mut fidl::encoding::Encoder<'_, D>,
4616 offset: usize,
4617 _depth: fidl::encoding::Depth,
4618 ) -> fidl::Result<()> {
4619 encoder.debug_check_bounds::<SocketTypeUnknown>(offset);
4620 fidl::encoding::Encode::<SocketTypeUnknown, D>::encode(
4622 (<SocketType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
4623 encoder,
4624 offset,
4625 _depth,
4626 )
4627 }
4628 }
4629 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SocketType, D>>
4630 fidl::encoding::Encode<SocketTypeUnknown, D> for (T0,)
4631 {
4632 #[inline]
4633 unsafe fn encode(
4634 self,
4635 encoder: &mut fidl::encoding::Encoder<'_, D>,
4636 offset: usize,
4637 depth: fidl::encoding::Depth,
4638 ) -> fidl::Result<()> {
4639 encoder.debug_check_bounds::<SocketTypeUnknown>(offset);
4640 self.0.encode(encoder, offset + 0, depth)?;
4644 Ok(())
4645 }
4646 }
4647
4648 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketTypeUnknown {
4649 #[inline(always)]
4650 fn new_empty() -> Self {
4651 Self { type_: fidl::new_empty!(SocketType, D) }
4652 }
4653
4654 #[inline]
4655 unsafe fn decode(
4656 &mut self,
4657 decoder: &mut fidl::encoding::Decoder<'_, D>,
4658 offset: usize,
4659 _depth: fidl::encoding::Depth,
4660 ) -> fidl::Result<()> {
4661 decoder.debug_check_bounds::<Self>(offset);
4662 fidl::decode!(SocketType, D, &mut self.type_, decoder, offset + 0, _depth)?;
4664 Ok(())
4665 }
4666 }
4667
4668 impl fidl::encoding::ValueTypeMarker for SocketWriteSocketRequest {
4669 type Borrowed<'a> = &'a Self;
4670 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4671 value
4672 }
4673 }
4674
4675 unsafe impl fidl::encoding::TypeMarker for SocketWriteSocketRequest {
4676 type Owned = Self;
4677
4678 #[inline(always)]
4679 fn inline_align(_context: fidl::encoding::Context) -> usize {
4680 8
4681 }
4682
4683 #[inline(always)]
4684 fn inline_size(_context: fidl::encoding::Context) -> usize {
4685 24
4686 }
4687 }
4688
4689 unsafe impl<D: fidl::encoding::ResourceDialect>
4690 fidl::encoding::Encode<SocketWriteSocketRequest, D> for &SocketWriteSocketRequest
4691 {
4692 #[inline]
4693 unsafe fn encode(
4694 self,
4695 encoder: &mut fidl::encoding::Encoder<'_, D>,
4696 offset: usize,
4697 _depth: fidl::encoding::Depth,
4698 ) -> fidl::Result<()> {
4699 encoder.debug_check_bounds::<SocketWriteSocketRequest>(offset);
4700 fidl::encoding::Encode::<SocketWriteSocketRequest, D>::encode(
4702 (
4703 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(&self.handle),
4704 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
4705 ),
4706 encoder, offset, _depth
4707 )
4708 }
4709 }
4710 unsafe impl<
4711 D: fidl::encoding::ResourceDialect,
4712 T0: fidl::encoding::Encode<HandleId, D>,
4713 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
4714 > fidl::encoding::Encode<SocketWriteSocketRequest, D> for (T0, T1)
4715 {
4716 #[inline]
4717 unsafe fn encode(
4718 self,
4719 encoder: &mut fidl::encoding::Encoder<'_, D>,
4720 offset: usize,
4721 depth: fidl::encoding::Depth,
4722 ) -> fidl::Result<()> {
4723 encoder.debug_check_bounds::<SocketWriteSocketRequest>(offset);
4724 unsafe {
4727 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4728 (ptr as *mut u64).write_unaligned(0);
4729 }
4730 self.0.encode(encoder, offset + 0, depth)?;
4732 self.1.encode(encoder, offset + 8, depth)?;
4733 Ok(())
4734 }
4735 }
4736
4737 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4738 for SocketWriteSocketRequest
4739 {
4740 #[inline(always)]
4741 fn new_empty() -> Self {
4742 Self {
4743 handle: fidl::new_empty!(HandleId, D),
4744 data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
4745 }
4746 }
4747
4748 #[inline]
4749 unsafe fn decode(
4750 &mut self,
4751 decoder: &mut fidl::encoding::Decoder<'_, D>,
4752 offset: usize,
4753 _depth: fidl::encoding::Depth,
4754 ) -> fidl::Result<()> {
4755 decoder.debug_check_bounds::<Self>(offset);
4756 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4758 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4759 let mask = 0xffffffff00000000u64;
4760 let maskedval = padval & mask;
4761 if maskedval != 0 {
4762 return Err(fidl::Error::NonZeroPadding {
4763 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4764 });
4765 }
4766 fidl::decode!(HandleId, D, &mut self.handle, decoder, offset + 0, _depth)?;
4767 fidl::decode!(
4768 fidl::encoding::UnboundedVector<u8>,
4769 D,
4770 &mut self.data,
4771 decoder,
4772 offset + 8,
4773 _depth
4774 )?;
4775 Ok(())
4776 }
4777 }
4778
4779 impl fidl::encoding::ValueTypeMarker for SocketReadSocketResponse {
4780 type Borrowed<'a> = &'a Self;
4781 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4782 value
4783 }
4784 }
4785
4786 unsafe impl fidl::encoding::TypeMarker for SocketReadSocketResponse {
4787 type Owned = Self;
4788
4789 #[inline(always)]
4790 fn inline_align(_context: fidl::encoding::Context) -> usize {
4791 8
4792 }
4793
4794 #[inline(always)]
4795 fn inline_size(_context: fidl::encoding::Context) -> usize {
4796 16
4797 }
4798 }
4799
4800 unsafe impl<D: fidl::encoding::ResourceDialect>
4801 fidl::encoding::Encode<SocketReadSocketResponse, D> for &SocketReadSocketResponse
4802 {
4803 #[inline]
4804 unsafe fn encode(
4805 self,
4806 encoder: &mut fidl::encoding::Encoder<'_, D>,
4807 offset: usize,
4808 _depth: fidl::encoding::Depth,
4809 ) -> fidl::Result<()> {
4810 encoder.debug_check_bounds::<SocketReadSocketResponse>(offset);
4811 fidl::encoding::Encode::<SocketReadSocketResponse, D>::encode(
4813 (<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
4814 &self.data,
4815 ),),
4816 encoder,
4817 offset,
4818 _depth,
4819 )
4820 }
4821 }
4822 unsafe impl<
4823 D: fidl::encoding::ResourceDialect,
4824 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
4825 > fidl::encoding::Encode<SocketReadSocketResponse, D> for (T0,)
4826 {
4827 #[inline]
4828 unsafe fn encode(
4829 self,
4830 encoder: &mut fidl::encoding::Encoder<'_, D>,
4831 offset: usize,
4832 depth: fidl::encoding::Depth,
4833 ) -> fidl::Result<()> {
4834 encoder.debug_check_bounds::<SocketReadSocketResponse>(offset);
4835 self.0.encode(encoder, offset + 0, depth)?;
4839 Ok(())
4840 }
4841 }
4842
4843 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4844 for SocketReadSocketResponse
4845 {
4846 #[inline(always)]
4847 fn new_empty() -> Self {
4848 Self { data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D) }
4849 }
4850
4851 #[inline]
4852 unsafe fn decode(
4853 &mut self,
4854 decoder: &mut fidl::encoding::Decoder<'_, D>,
4855 offset: usize,
4856 _depth: fidl::encoding::Depth,
4857 ) -> fidl::Result<()> {
4858 decoder.debug_check_bounds::<Self>(offset);
4859 fidl::decode!(
4861 fidl::encoding::UnboundedVector<u8>,
4862 D,
4863 &mut self.data,
4864 decoder,
4865 offset + 0,
4866 _depth
4867 )?;
4868 Ok(())
4869 }
4870 }
4871
4872 impl fidl::encoding::ValueTypeMarker for SocketWriteSocketResponse {
4873 type Borrowed<'a> = &'a Self;
4874 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4875 value
4876 }
4877 }
4878
4879 unsafe impl fidl::encoding::TypeMarker for SocketWriteSocketResponse {
4880 type Owned = Self;
4881
4882 #[inline(always)]
4883 fn inline_align(_context: fidl::encoding::Context) -> usize {
4884 8
4885 }
4886
4887 #[inline(always)]
4888 fn inline_size(_context: fidl::encoding::Context) -> usize {
4889 8
4890 }
4891 #[inline(always)]
4892 fn encode_is_copy() -> bool {
4893 true
4894 }
4895
4896 #[inline(always)]
4897 fn decode_is_copy() -> bool {
4898 true
4899 }
4900 }
4901
4902 unsafe impl<D: fidl::encoding::ResourceDialect>
4903 fidl::encoding::Encode<SocketWriteSocketResponse, D> for &SocketWriteSocketResponse
4904 {
4905 #[inline]
4906 unsafe fn encode(
4907 self,
4908 encoder: &mut fidl::encoding::Encoder<'_, D>,
4909 offset: usize,
4910 _depth: fidl::encoding::Depth,
4911 ) -> fidl::Result<()> {
4912 encoder.debug_check_bounds::<SocketWriteSocketResponse>(offset);
4913 unsafe {
4914 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4916 (buf_ptr as *mut SocketWriteSocketResponse)
4917 .write_unaligned((self as *const SocketWriteSocketResponse).read());
4918 }
4921 Ok(())
4922 }
4923 }
4924 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4925 fidl::encoding::Encode<SocketWriteSocketResponse, D> for (T0,)
4926 {
4927 #[inline]
4928 unsafe fn encode(
4929 self,
4930 encoder: &mut fidl::encoding::Encoder<'_, D>,
4931 offset: usize,
4932 depth: fidl::encoding::Depth,
4933 ) -> fidl::Result<()> {
4934 encoder.debug_check_bounds::<SocketWriteSocketResponse>(offset);
4935 self.0.encode(encoder, offset + 0, depth)?;
4939 Ok(())
4940 }
4941 }
4942
4943 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4944 for SocketWriteSocketResponse
4945 {
4946 #[inline(always)]
4947 fn new_empty() -> Self {
4948 Self { wrote: fidl::new_empty!(u64, D) }
4949 }
4950
4951 #[inline]
4952 unsafe fn decode(
4953 &mut self,
4954 decoder: &mut fidl::encoding::Decoder<'_, D>,
4955 offset: usize,
4956 _depth: fidl::encoding::Depth,
4957 ) -> fidl::Result<()> {
4958 decoder.debug_check_bounds::<Self>(offset);
4959 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4960 unsafe {
4963 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4964 }
4965 Ok(())
4966 }
4967 }
4968
4969 impl fidl::encoding::ValueTypeMarker for StreamingReadInProgress {
4970 type Borrowed<'a> = &'a Self;
4971 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4972 value
4973 }
4974 }
4975
4976 unsafe impl fidl::encoding::TypeMarker for StreamingReadInProgress {
4977 type Owned = Self;
4978
4979 #[inline(always)]
4980 fn inline_align(_context: fidl::encoding::Context) -> usize {
4981 1
4982 }
4983
4984 #[inline(always)]
4985 fn inline_size(_context: fidl::encoding::Context) -> usize {
4986 1
4987 }
4988 }
4989
4990 unsafe impl<D: fidl::encoding::ResourceDialect>
4991 fidl::encoding::Encode<StreamingReadInProgress, D> for &StreamingReadInProgress
4992 {
4993 #[inline]
4994 unsafe fn encode(
4995 self,
4996 encoder: &mut fidl::encoding::Encoder<'_, D>,
4997 offset: usize,
4998 _depth: fidl::encoding::Depth,
4999 ) -> fidl::Result<()> {
5000 encoder.debug_check_bounds::<StreamingReadInProgress>(offset);
5001 encoder.write_num(0u8, offset);
5002 Ok(())
5003 }
5004 }
5005
5006 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5007 for StreamingReadInProgress
5008 {
5009 #[inline(always)]
5010 fn new_empty() -> Self {
5011 Self
5012 }
5013
5014 #[inline]
5015 unsafe fn decode(
5016 &mut self,
5017 decoder: &mut fidl::encoding::Decoder<'_, D>,
5018 offset: usize,
5019 _depth: fidl::encoding::Depth,
5020 ) -> fidl::Result<()> {
5021 decoder.debug_check_bounds::<Self>(offset);
5022 match decoder.read_num::<u8>(offset) {
5023 0 => Ok(()),
5024 _ => Err(fidl::Error::Invalid),
5025 }
5026 }
5027 }
5028
5029 impl fidl::encoding::ValueTypeMarker for WriteSocketError {
5030 type Borrowed<'a> = &'a Self;
5031 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5032 value
5033 }
5034 }
5035
5036 unsafe impl fidl::encoding::TypeMarker for WriteSocketError {
5037 type Owned = Self;
5038
5039 #[inline(always)]
5040 fn inline_align(_context: fidl::encoding::Context) -> usize {
5041 8
5042 }
5043
5044 #[inline(always)]
5045 fn inline_size(_context: fidl::encoding::Context) -> usize {
5046 24
5047 }
5048 }
5049
5050 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteSocketError, D>
5051 for &WriteSocketError
5052 {
5053 #[inline]
5054 unsafe fn encode(
5055 self,
5056 encoder: &mut fidl::encoding::Encoder<'_, D>,
5057 offset: usize,
5058 _depth: fidl::encoding::Depth,
5059 ) -> fidl::Result<()> {
5060 encoder.debug_check_bounds::<WriteSocketError>(offset);
5061 fidl::encoding::Encode::<WriteSocketError, D>::encode(
5063 (
5064 <Error as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
5065 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wrote),
5066 ),
5067 encoder,
5068 offset,
5069 _depth,
5070 )
5071 }
5072 }
5073 unsafe impl<
5074 D: fidl::encoding::ResourceDialect,
5075 T0: fidl::encoding::Encode<Error, D>,
5076 T1: fidl::encoding::Encode<u64, D>,
5077 > fidl::encoding::Encode<WriteSocketError, D> for (T0, T1)
5078 {
5079 #[inline]
5080 unsafe fn encode(
5081 self,
5082 encoder: &mut fidl::encoding::Encoder<'_, D>,
5083 offset: usize,
5084 depth: fidl::encoding::Depth,
5085 ) -> fidl::Result<()> {
5086 encoder.debug_check_bounds::<WriteSocketError>(offset);
5087 self.0.encode(encoder, offset + 0, depth)?;
5091 self.1.encode(encoder, offset + 16, depth)?;
5092 Ok(())
5093 }
5094 }
5095
5096 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteSocketError {
5097 #[inline(always)]
5098 fn new_empty() -> Self {
5099 Self { error: fidl::new_empty!(Error, D), wrote: fidl::new_empty!(u64, D) }
5100 }
5101
5102 #[inline]
5103 unsafe fn decode(
5104 &mut self,
5105 decoder: &mut fidl::encoding::Decoder<'_, D>,
5106 offset: usize,
5107 _depth: fidl::encoding::Depth,
5108 ) -> fidl::Result<()> {
5109 decoder.debug_check_bounds::<Self>(offset);
5110 fidl::decode!(Error, D, &mut self.error, decoder, offset + 0, _depth)?;
5112 fidl::decode!(u64, D, &mut self.wrote, decoder, offset + 16, _depth)?;
5113 Ok(())
5114 }
5115 }
5116
5117 impl fidl::encoding::ValueTypeMarker for WrongHandleType {
5118 type Borrowed<'a> = &'a Self;
5119 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5120 value
5121 }
5122 }
5123
5124 unsafe impl fidl::encoding::TypeMarker for WrongHandleType {
5125 type Owned = Self;
5126
5127 #[inline(always)]
5128 fn inline_align(_context: fidl::encoding::Context) -> usize {
5129 4
5130 }
5131
5132 #[inline(always)]
5133 fn inline_size(_context: fidl::encoding::Context) -> usize {
5134 8
5135 }
5136 }
5137
5138 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WrongHandleType, D>
5139 for &WrongHandleType
5140 {
5141 #[inline]
5142 unsafe fn encode(
5143 self,
5144 encoder: &mut fidl::encoding::Encoder<'_, D>,
5145 offset: usize,
5146 _depth: fidl::encoding::Depth,
5147 ) -> fidl::Result<()> {
5148 encoder.debug_check_bounds::<WrongHandleType>(offset);
5149 fidl::encoding::Encode::<WrongHandleType, D>::encode(
5151 (
5152 <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.expected),
5153 <fidl::ObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.got),
5154 ),
5155 encoder,
5156 offset,
5157 _depth,
5158 )
5159 }
5160 }
5161 unsafe impl<
5162 D: fidl::encoding::ResourceDialect,
5163 T0: fidl::encoding::Encode<fidl::ObjectType, D>,
5164 T1: fidl::encoding::Encode<fidl::ObjectType, D>,
5165 > fidl::encoding::Encode<WrongHandleType, D> for (T0, T1)
5166 {
5167 #[inline]
5168 unsafe fn encode(
5169 self,
5170 encoder: &mut fidl::encoding::Encoder<'_, D>,
5171 offset: usize,
5172 depth: fidl::encoding::Depth,
5173 ) -> fidl::Result<()> {
5174 encoder.debug_check_bounds::<WrongHandleType>(offset);
5175 self.0.encode(encoder, offset + 0, depth)?;
5179 self.1.encode(encoder, offset + 4, depth)?;
5180 Ok(())
5181 }
5182 }
5183
5184 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WrongHandleType {
5185 #[inline(always)]
5186 fn new_empty() -> Self {
5187 Self {
5188 expected: fidl::new_empty!(fidl::ObjectType, D),
5189 got: fidl::new_empty!(fidl::ObjectType, D),
5190 }
5191 }
5192
5193 #[inline]
5194 unsafe fn decode(
5195 &mut self,
5196 decoder: &mut fidl::encoding::Decoder<'_, D>,
5197 offset: usize,
5198 _depth: fidl::encoding::Depth,
5199 ) -> fidl::Result<()> {
5200 decoder.debug_check_bounds::<Self>(offset);
5201 fidl::decode!(fidl::ObjectType, D, &mut self.expected, decoder, offset + 0, _depth)?;
5203 fidl::decode!(fidl::ObjectType, D, &mut self.got, decoder, offset + 4, _depth)?;
5204 Ok(())
5205 }
5206 }
5207
5208 impl fidl::encoding::ValueTypeMarker for WroteToSelf {
5209 type Borrowed<'a> = &'a Self;
5210 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5211 value
5212 }
5213 }
5214
5215 unsafe impl fidl::encoding::TypeMarker for WroteToSelf {
5216 type Owned = Self;
5217
5218 #[inline(always)]
5219 fn inline_align(_context: fidl::encoding::Context) -> usize {
5220 1
5221 }
5222
5223 #[inline(always)]
5224 fn inline_size(_context: fidl::encoding::Context) -> usize {
5225 1
5226 }
5227 }
5228
5229 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WroteToSelf, D>
5230 for &WroteToSelf
5231 {
5232 #[inline]
5233 unsafe fn encode(
5234 self,
5235 encoder: &mut fidl::encoding::Encoder<'_, D>,
5236 offset: usize,
5237 _depth: fidl::encoding::Depth,
5238 ) -> fidl::Result<()> {
5239 encoder.debug_check_bounds::<WroteToSelf>(offset);
5240 encoder.write_num(0u8, offset);
5241 Ok(())
5242 }
5243 }
5244
5245 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WroteToSelf {
5246 #[inline(always)]
5247 fn new_empty() -> Self {
5248 Self
5249 }
5250
5251 #[inline]
5252 unsafe fn decode(
5253 &mut self,
5254 decoder: &mut fidl::encoding::Decoder<'_, D>,
5255 offset: usize,
5256 _depth: fidl::encoding::Depth,
5257 ) -> fidl::Result<()> {
5258 decoder.debug_check_bounds::<Self>(offset);
5259 match decoder.read_num::<u8>(offset) {
5260 0 => Ok(()),
5261 _ => Err(fidl::Error::Invalid),
5262 }
5263 }
5264 }
5265
5266 impl fidl::encoding::ValueTypeMarker for ChannelSent {
5267 type Borrowed<'a> = &'a Self;
5268 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5269 value
5270 }
5271 }
5272
5273 unsafe impl fidl::encoding::TypeMarker for ChannelSent {
5274 type Owned = Self;
5275
5276 #[inline(always)]
5277 fn inline_align(_context: fidl::encoding::Context) -> usize {
5278 8
5279 }
5280
5281 #[inline(always)]
5282 fn inline_size(_context: fidl::encoding::Context) -> usize {
5283 16
5284 }
5285 }
5286
5287 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelSent, D>
5288 for &ChannelSent
5289 {
5290 #[inline]
5291 unsafe fn encode(
5292 self,
5293 encoder: &mut fidl::encoding::Encoder<'_, D>,
5294 offset: usize,
5295 _depth: fidl::encoding::Depth,
5296 ) -> fidl::Result<()> {
5297 encoder.debug_check_bounds::<ChannelSent>(offset);
5298 encoder.write_num::<u64>(self.ordinal(), offset);
5299 match self {
5300 ChannelSent::Message(ref val) => {
5301 fidl::encoding::encode_in_envelope::<ChannelMessage, D>(
5302 <ChannelMessage as fidl::encoding::ValueTypeMarker>::borrow(val),
5303 encoder,
5304 offset + 8,
5305 _depth,
5306 )
5307 }
5308 ChannelSent::Stopped(ref val) => {
5309 fidl::encoding::encode_in_envelope::<AioStopped, D>(
5310 <AioStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
5311 encoder,
5312 offset + 8,
5313 _depth,
5314 )
5315 }
5316 ChannelSent::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5317 }
5318 }
5319 }
5320
5321 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelSent {
5322 #[inline(always)]
5323 fn new_empty() -> Self {
5324 Self::__SourceBreaking { unknown_ordinal: 0 }
5325 }
5326
5327 #[inline]
5328 unsafe fn decode(
5329 &mut self,
5330 decoder: &mut fidl::encoding::Decoder<'_, D>,
5331 offset: usize,
5332 mut depth: fidl::encoding::Depth,
5333 ) -> fidl::Result<()> {
5334 decoder.debug_check_bounds::<Self>(offset);
5335 #[allow(unused_variables)]
5336 let next_out_of_line = decoder.next_out_of_line();
5337 let handles_before = decoder.remaining_handles();
5338 let (ordinal, inlined, num_bytes, num_handles) =
5339 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5340
5341 let member_inline_size = match ordinal {
5342 1 => <ChannelMessage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5343 2 => <AioStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5344 0 => return Err(fidl::Error::UnknownUnionTag),
5345 _ => num_bytes as usize,
5346 };
5347
5348 if inlined != (member_inline_size <= 4) {
5349 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5350 }
5351 let _inner_offset;
5352 if inlined {
5353 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5354 _inner_offset = offset + 8;
5355 } else {
5356 depth.increment()?;
5357 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5358 }
5359 match ordinal {
5360 1 => {
5361 #[allow(irrefutable_let_patterns)]
5362 if let ChannelSent::Message(_) = self {
5363 } else {
5365 *self = ChannelSent::Message(fidl::new_empty!(ChannelMessage, D));
5367 }
5368 #[allow(irrefutable_let_patterns)]
5369 if let ChannelSent::Message(ref mut val) = self {
5370 fidl::decode!(ChannelMessage, D, val, decoder, _inner_offset, depth)?;
5371 } else {
5372 unreachable!()
5373 }
5374 }
5375 2 => {
5376 #[allow(irrefutable_let_patterns)]
5377 if let ChannelSent::Stopped(_) = self {
5378 } else {
5380 *self = ChannelSent::Stopped(fidl::new_empty!(AioStopped, D));
5382 }
5383 #[allow(irrefutable_let_patterns)]
5384 if let ChannelSent::Stopped(ref mut val) = self {
5385 fidl::decode!(AioStopped, D, val, decoder, _inner_offset, depth)?;
5386 } else {
5387 unreachable!()
5388 }
5389 }
5390 #[allow(deprecated)]
5391 ordinal => {
5392 for _ in 0..num_handles {
5393 decoder.drop_next_handle()?;
5394 }
5395 *self = ChannelSent::__SourceBreaking { unknown_ordinal: ordinal };
5396 }
5397 }
5398 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5399 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5400 }
5401 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5402 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5403 }
5404 Ok(())
5405 }
5406 }
5407
5408 impl fidl::encoding::ValueTypeMarker for Error {
5409 type Borrowed<'a> = &'a Self;
5410 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5411 value
5412 }
5413 }
5414
5415 unsafe impl fidl::encoding::TypeMarker for Error {
5416 type Owned = Self;
5417
5418 #[inline(always)]
5419 fn inline_align(_context: fidl::encoding::Context) -> usize {
5420 8
5421 }
5422
5423 #[inline(always)]
5424 fn inline_size(_context: fidl::encoding::Context) -> usize {
5425 16
5426 }
5427 }
5428
5429 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Error, D> for &Error {
5430 #[inline]
5431 unsafe fn encode(
5432 self,
5433 encoder: &mut fidl::encoding::Encoder<'_, D>,
5434 offset: usize,
5435 _depth: fidl::encoding::Depth,
5436 ) -> fidl::Result<()> {
5437 encoder.debug_check_bounds::<Error>(offset);
5438 encoder.write_num::<u64>(self.ordinal(), offset);
5439 match self {
5440 Error::TargetError(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
5441 <i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
5442 encoder,
5443 offset + 8,
5444 _depth,
5445 ),
5446 Error::BadHandleId(ref val) => {
5447 fidl::encoding::encode_in_envelope::<BadHandleId, D>(
5448 <BadHandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
5449 encoder,
5450 offset + 8,
5451 _depth,
5452 )
5453 }
5454 Error::NewHandleIdOutOfRange(ref val) => {
5455 fidl::encoding::encode_in_envelope::<NewHandleIdOutOfRange, D>(
5456 <NewHandleIdOutOfRange as fidl::encoding::ValueTypeMarker>::borrow(val),
5457 encoder,
5458 offset + 8,
5459 _depth,
5460 )
5461 }
5462 Error::NewHandleIdReused(ref val) => {
5463 fidl::encoding::encode_in_envelope::<NewHandleIdReused, D>(
5464 <NewHandleIdReused as fidl::encoding::ValueTypeMarker>::borrow(val),
5465 encoder,
5466 offset + 8,
5467 _depth,
5468 )
5469 }
5470 Error::WrongHandleType(ref val) => {
5471 fidl::encoding::encode_in_envelope::<WrongHandleType, D>(
5472 <WrongHandleType as fidl::encoding::ValueTypeMarker>::borrow(val),
5473 encoder,
5474 offset + 8,
5475 _depth,
5476 )
5477 }
5478 Error::StreamingReadInProgress(ref val) => {
5479 fidl::encoding::encode_in_envelope::<StreamingReadInProgress, D>(
5480 <StreamingReadInProgress as fidl::encoding::ValueTypeMarker>::borrow(val),
5481 encoder,
5482 offset + 8,
5483 _depth,
5484 )
5485 }
5486 Error::NoReadInProgress(ref val) => {
5487 fidl::encoding::encode_in_envelope::<NoReadInProgress, D>(
5488 <NoReadInProgress as fidl::encoding::ValueTypeMarker>::borrow(val),
5489 encoder,
5490 offset + 8,
5491 _depth,
5492 )
5493 }
5494 Error::ErrorPending(ref val) => {
5495 fidl::encoding::encode_in_envelope::<ErrorPending, D>(
5496 <ErrorPending as fidl::encoding::ValueTypeMarker>::borrow(val),
5497 encoder,
5498 offset + 8,
5499 _depth,
5500 )
5501 }
5502 Error::NoErrorPending(ref val) => {
5503 fidl::encoding::encode_in_envelope::<NoErrorPending, D>(
5504 <NoErrorPending as fidl::encoding::ValueTypeMarker>::borrow(val),
5505 encoder,
5506 offset + 8,
5507 _depth,
5508 )
5509 }
5510 Error::WroteToSelf(ref val) => {
5511 fidl::encoding::encode_in_envelope::<WroteToSelf, D>(
5512 <WroteToSelf as fidl::encoding::ValueTypeMarker>::borrow(val),
5513 encoder,
5514 offset + 8,
5515 _depth,
5516 )
5517 }
5518 Error::ClosedDuringRead(ref val) => {
5519 fidl::encoding::encode_in_envelope::<ClosedDuringRead, D>(
5520 <ClosedDuringRead as fidl::encoding::ValueTypeMarker>::borrow(val),
5521 encoder,
5522 offset + 8,
5523 _depth,
5524 )
5525 }
5526 Error::SignalsUnknown(ref val) => {
5527 fidl::encoding::encode_in_envelope::<SignalsUnknown, D>(
5528 <SignalsUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5529 encoder,
5530 offset + 8,
5531 _depth,
5532 )
5533 }
5534 Error::RightsUnknown(ref val) => {
5535 fidl::encoding::encode_in_envelope::<RightsUnknown, D>(
5536 <RightsUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5537 encoder,
5538 offset + 8,
5539 _depth,
5540 )
5541 }
5542 Error::SocketDispositionUnknown(ref val) => {
5543 fidl::encoding::encode_in_envelope::<SocketDispositionUnknown, D>(
5544 <SocketDispositionUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5545 encoder,
5546 offset + 8,
5547 _depth,
5548 )
5549 }
5550 Error::SocketTypeUnknown(ref val) => {
5551 fidl::encoding::encode_in_envelope::<SocketTypeUnknown, D>(
5552 <SocketTypeUnknown as fidl::encoding::ValueTypeMarker>::borrow(val),
5553 encoder,
5554 offset + 8,
5555 _depth,
5556 )
5557 }
5558 Error::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5559 }
5560 }
5561 }
5562
5563 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
5564 #[inline(always)]
5565 fn new_empty() -> Self {
5566 Self::__SourceBreaking { unknown_ordinal: 0 }
5567 }
5568
5569 #[inline]
5570 unsafe fn decode(
5571 &mut self,
5572 decoder: &mut fidl::encoding::Decoder<'_, D>,
5573 offset: usize,
5574 mut depth: fidl::encoding::Depth,
5575 ) -> fidl::Result<()> {
5576 decoder.debug_check_bounds::<Self>(offset);
5577 #[allow(unused_variables)]
5578 let next_out_of_line = decoder.next_out_of_line();
5579 let handles_before = decoder.remaining_handles();
5580 let (ordinal, inlined, num_bytes, num_handles) =
5581 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5582
5583 let member_inline_size = match ordinal {
5584 1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5585 2 => <BadHandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5586 3 => <NewHandleIdOutOfRange as fidl::encoding::TypeMarker>::inline_size(
5587 decoder.context,
5588 ),
5589 4 => {
5590 <NewHandleIdReused as fidl::encoding::TypeMarker>::inline_size(decoder.context)
5591 }
5592 5 => <WrongHandleType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5593 6 => <StreamingReadInProgress as fidl::encoding::TypeMarker>::inline_size(
5594 decoder.context,
5595 ),
5596 7 => <NoReadInProgress as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5597 8 => <ErrorPending as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5598 9 => <NoErrorPending as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5599 10 => <WroteToSelf as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5600 11 => {
5601 <ClosedDuringRead as fidl::encoding::TypeMarker>::inline_size(decoder.context)
5602 }
5603 12 => <SignalsUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5604 13 => <RightsUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5605 14 => <SocketDispositionUnknown as fidl::encoding::TypeMarker>::inline_size(
5606 decoder.context,
5607 ),
5608 15 => {
5609 <SocketTypeUnknown as fidl::encoding::TypeMarker>::inline_size(decoder.context)
5610 }
5611 0 => return Err(fidl::Error::UnknownUnionTag),
5612 _ => num_bytes as usize,
5613 };
5614
5615 if inlined != (member_inline_size <= 4) {
5616 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5617 }
5618 let _inner_offset;
5619 if inlined {
5620 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5621 _inner_offset = offset + 8;
5622 } else {
5623 depth.increment()?;
5624 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5625 }
5626 match ordinal {
5627 1 => {
5628 #[allow(irrefutable_let_patterns)]
5629 if let Error::TargetError(_) = self {
5630 } else {
5632 *self = Error::TargetError(fidl::new_empty!(i32, D));
5634 }
5635 #[allow(irrefutable_let_patterns)]
5636 if let Error::TargetError(ref mut val) = self {
5637 fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
5638 } else {
5639 unreachable!()
5640 }
5641 }
5642 2 => {
5643 #[allow(irrefutable_let_patterns)]
5644 if let Error::BadHandleId(_) = self {
5645 } else {
5647 *self = Error::BadHandleId(fidl::new_empty!(BadHandleId, D));
5649 }
5650 #[allow(irrefutable_let_patterns)]
5651 if let Error::BadHandleId(ref mut val) = self {
5652 fidl::decode!(BadHandleId, D, val, decoder, _inner_offset, depth)?;
5653 } else {
5654 unreachable!()
5655 }
5656 }
5657 3 => {
5658 #[allow(irrefutable_let_patterns)]
5659 if let Error::NewHandleIdOutOfRange(_) = self {
5660 } else {
5662 *self = Error::NewHandleIdOutOfRange(fidl::new_empty!(
5664 NewHandleIdOutOfRange,
5665 D
5666 ));
5667 }
5668 #[allow(irrefutable_let_patterns)]
5669 if let Error::NewHandleIdOutOfRange(ref mut val) = self {
5670 fidl::decode!(
5671 NewHandleIdOutOfRange,
5672 D,
5673 val,
5674 decoder,
5675 _inner_offset,
5676 depth
5677 )?;
5678 } else {
5679 unreachable!()
5680 }
5681 }
5682 4 => {
5683 #[allow(irrefutable_let_patterns)]
5684 if let Error::NewHandleIdReused(_) = self {
5685 } else {
5687 *self = Error::NewHandleIdReused(fidl::new_empty!(NewHandleIdReused, D));
5689 }
5690 #[allow(irrefutable_let_patterns)]
5691 if let Error::NewHandleIdReused(ref mut val) = self {
5692 fidl::decode!(NewHandleIdReused, D, val, decoder, _inner_offset, depth)?;
5693 } else {
5694 unreachable!()
5695 }
5696 }
5697 5 => {
5698 #[allow(irrefutable_let_patterns)]
5699 if let Error::WrongHandleType(_) = self {
5700 } else {
5702 *self = Error::WrongHandleType(fidl::new_empty!(WrongHandleType, D));
5704 }
5705 #[allow(irrefutable_let_patterns)]
5706 if let Error::WrongHandleType(ref mut val) = self {
5707 fidl::decode!(WrongHandleType, D, val, decoder, _inner_offset, depth)?;
5708 } else {
5709 unreachable!()
5710 }
5711 }
5712 6 => {
5713 #[allow(irrefutable_let_patterns)]
5714 if let Error::StreamingReadInProgress(_) = self {
5715 } else {
5717 *self = Error::StreamingReadInProgress(fidl::new_empty!(
5719 StreamingReadInProgress,
5720 D
5721 ));
5722 }
5723 #[allow(irrefutable_let_patterns)]
5724 if let Error::StreamingReadInProgress(ref mut val) = self {
5725 fidl::decode!(
5726 StreamingReadInProgress,
5727 D,
5728 val,
5729 decoder,
5730 _inner_offset,
5731 depth
5732 )?;
5733 } else {
5734 unreachable!()
5735 }
5736 }
5737 7 => {
5738 #[allow(irrefutable_let_patterns)]
5739 if let Error::NoReadInProgress(_) = self {
5740 } else {
5742 *self = Error::NoReadInProgress(fidl::new_empty!(NoReadInProgress, D));
5744 }
5745 #[allow(irrefutable_let_patterns)]
5746 if let Error::NoReadInProgress(ref mut val) = self {
5747 fidl::decode!(NoReadInProgress, D, val, decoder, _inner_offset, depth)?;
5748 } else {
5749 unreachable!()
5750 }
5751 }
5752 8 => {
5753 #[allow(irrefutable_let_patterns)]
5754 if let Error::ErrorPending(_) = self {
5755 } else {
5757 *self = Error::ErrorPending(fidl::new_empty!(ErrorPending, D));
5759 }
5760 #[allow(irrefutable_let_patterns)]
5761 if let Error::ErrorPending(ref mut val) = self {
5762 fidl::decode!(ErrorPending, D, val, decoder, _inner_offset, depth)?;
5763 } else {
5764 unreachable!()
5765 }
5766 }
5767 9 => {
5768 #[allow(irrefutable_let_patterns)]
5769 if let Error::NoErrorPending(_) = self {
5770 } else {
5772 *self = Error::NoErrorPending(fidl::new_empty!(NoErrorPending, D));
5774 }
5775 #[allow(irrefutable_let_patterns)]
5776 if let Error::NoErrorPending(ref mut val) = self {
5777 fidl::decode!(NoErrorPending, D, val, decoder, _inner_offset, depth)?;
5778 } else {
5779 unreachable!()
5780 }
5781 }
5782 10 => {
5783 #[allow(irrefutable_let_patterns)]
5784 if let Error::WroteToSelf(_) = self {
5785 } else {
5787 *self = Error::WroteToSelf(fidl::new_empty!(WroteToSelf, D));
5789 }
5790 #[allow(irrefutable_let_patterns)]
5791 if let Error::WroteToSelf(ref mut val) = self {
5792 fidl::decode!(WroteToSelf, D, val, decoder, _inner_offset, depth)?;
5793 } else {
5794 unreachable!()
5795 }
5796 }
5797 11 => {
5798 #[allow(irrefutable_let_patterns)]
5799 if let Error::ClosedDuringRead(_) = self {
5800 } else {
5802 *self = Error::ClosedDuringRead(fidl::new_empty!(ClosedDuringRead, D));
5804 }
5805 #[allow(irrefutable_let_patterns)]
5806 if let Error::ClosedDuringRead(ref mut val) = self {
5807 fidl::decode!(ClosedDuringRead, D, val, decoder, _inner_offset, depth)?;
5808 } else {
5809 unreachable!()
5810 }
5811 }
5812 12 => {
5813 #[allow(irrefutable_let_patterns)]
5814 if let Error::SignalsUnknown(_) = self {
5815 } else {
5817 *self = Error::SignalsUnknown(fidl::new_empty!(SignalsUnknown, D));
5819 }
5820 #[allow(irrefutable_let_patterns)]
5821 if let Error::SignalsUnknown(ref mut val) = self {
5822 fidl::decode!(SignalsUnknown, D, val, decoder, _inner_offset, depth)?;
5823 } else {
5824 unreachable!()
5825 }
5826 }
5827 13 => {
5828 #[allow(irrefutable_let_patterns)]
5829 if let Error::RightsUnknown(_) = self {
5830 } else {
5832 *self = Error::RightsUnknown(fidl::new_empty!(RightsUnknown, D));
5834 }
5835 #[allow(irrefutable_let_patterns)]
5836 if let Error::RightsUnknown(ref mut val) = self {
5837 fidl::decode!(RightsUnknown, D, val, decoder, _inner_offset, depth)?;
5838 } else {
5839 unreachable!()
5840 }
5841 }
5842 14 => {
5843 #[allow(irrefutable_let_patterns)]
5844 if let Error::SocketDispositionUnknown(_) = self {
5845 } else {
5847 *self = Error::SocketDispositionUnknown(fidl::new_empty!(
5849 SocketDispositionUnknown,
5850 D
5851 ));
5852 }
5853 #[allow(irrefutable_let_patterns)]
5854 if let Error::SocketDispositionUnknown(ref mut val) = self {
5855 fidl::decode!(
5856 SocketDispositionUnknown,
5857 D,
5858 val,
5859 decoder,
5860 _inner_offset,
5861 depth
5862 )?;
5863 } else {
5864 unreachable!()
5865 }
5866 }
5867 15 => {
5868 #[allow(irrefutable_let_patterns)]
5869 if let Error::SocketTypeUnknown(_) = self {
5870 } else {
5872 *self = Error::SocketTypeUnknown(fidl::new_empty!(SocketTypeUnknown, D));
5874 }
5875 #[allow(irrefutable_let_patterns)]
5876 if let Error::SocketTypeUnknown(ref mut val) = self {
5877 fidl::decode!(SocketTypeUnknown, D, val, decoder, _inner_offset, depth)?;
5878 } else {
5879 unreachable!()
5880 }
5881 }
5882 #[allow(deprecated)]
5883 ordinal => {
5884 for _ in 0..num_handles {
5885 decoder.drop_next_handle()?;
5886 }
5887 *self = Error::__SourceBreaking { unknown_ordinal: ordinal };
5888 }
5889 }
5890 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5891 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5892 }
5893 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5894 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5895 }
5896 Ok(())
5897 }
5898 }
5899
5900 impl fidl::encoding::ValueTypeMarker for HandleOp {
5901 type Borrowed<'a> = &'a Self;
5902 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5903 value
5904 }
5905 }
5906
5907 unsafe impl fidl::encoding::TypeMarker for HandleOp {
5908 type Owned = Self;
5909
5910 #[inline(always)]
5911 fn inline_align(_context: fidl::encoding::Context) -> usize {
5912 8
5913 }
5914
5915 #[inline(always)]
5916 fn inline_size(_context: fidl::encoding::Context) -> usize {
5917 16
5918 }
5919 }
5920
5921 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HandleOp, D> for &HandleOp {
5922 #[inline]
5923 unsafe fn encode(
5924 self,
5925 encoder: &mut fidl::encoding::Encoder<'_, D>,
5926 offset: usize,
5927 _depth: fidl::encoding::Depth,
5928 ) -> fidl::Result<()> {
5929 encoder.debug_check_bounds::<HandleOp>(offset);
5930 encoder.write_num::<u64>(self.ordinal(), offset);
5931 match self {
5932 HandleOp::Move_(ref val) => fidl::encoding::encode_in_envelope::<HandleId, D>(
5933 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
5934 encoder,
5935 offset + 8,
5936 _depth,
5937 ),
5938 HandleOp::Duplicate(ref val) => fidl::encoding::encode_in_envelope::<HandleId, D>(
5939 <HandleId as fidl::encoding::ValueTypeMarker>::borrow(val),
5940 encoder,
5941 offset + 8,
5942 _depth,
5943 ),
5944 }
5945 }
5946 }
5947
5948 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HandleOp {
5949 #[inline(always)]
5950 fn new_empty() -> Self {
5951 Self::Move_(fidl::new_empty!(HandleId, D))
5952 }
5953
5954 #[inline]
5955 unsafe fn decode(
5956 &mut self,
5957 decoder: &mut fidl::encoding::Decoder<'_, D>,
5958 offset: usize,
5959 mut depth: fidl::encoding::Depth,
5960 ) -> fidl::Result<()> {
5961 decoder.debug_check_bounds::<Self>(offset);
5962 #[allow(unused_variables)]
5963 let next_out_of_line = decoder.next_out_of_line();
5964 let handles_before = decoder.remaining_handles();
5965 let (ordinal, inlined, num_bytes, num_handles) =
5966 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5967
5968 let member_inline_size = match ordinal {
5969 1 => <HandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5970 2 => <HandleId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5971 _ => return Err(fidl::Error::UnknownUnionTag),
5972 };
5973
5974 if inlined != (member_inline_size <= 4) {
5975 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5976 }
5977 let _inner_offset;
5978 if inlined {
5979 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5980 _inner_offset = offset + 8;
5981 } else {
5982 depth.increment()?;
5983 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5984 }
5985 match ordinal {
5986 1 => {
5987 #[allow(irrefutable_let_patterns)]
5988 if let HandleOp::Move_(_) = self {
5989 } else {
5991 *self = HandleOp::Move_(fidl::new_empty!(HandleId, D));
5993 }
5994 #[allow(irrefutable_let_patterns)]
5995 if let HandleOp::Move_(ref mut val) = self {
5996 fidl::decode!(HandleId, D, val, decoder, _inner_offset, depth)?;
5997 } else {
5998 unreachable!()
5999 }
6000 }
6001 2 => {
6002 #[allow(irrefutable_let_patterns)]
6003 if let HandleOp::Duplicate(_) = self {
6004 } else {
6006 *self = HandleOp::Duplicate(fidl::new_empty!(HandleId, D));
6008 }
6009 #[allow(irrefutable_let_patterns)]
6010 if let HandleOp::Duplicate(ref mut val) = self {
6011 fidl::decode!(HandleId, D, val, decoder, _inner_offset, depth)?;
6012 } else {
6013 unreachable!()
6014 }
6015 }
6016 ordinal => panic!("unexpected ordinal {:?}", ordinal),
6017 }
6018 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6019 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6020 }
6021 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6022 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6023 }
6024 Ok(())
6025 }
6026 }
6027
6028 impl fidl::encoding::ValueTypeMarker for Handles {
6029 type Borrowed<'a> = &'a Self;
6030 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6031 value
6032 }
6033 }
6034
6035 unsafe impl fidl::encoding::TypeMarker for Handles {
6036 type Owned = Self;
6037
6038 #[inline(always)]
6039 fn inline_align(_context: fidl::encoding::Context) -> usize {
6040 8
6041 }
6042
6043 #[inline(always)]
6044 fn inline_size(_context: fidl::encoding::Context) -> usize {
6045 16
6046 }
6047 }
6048
6049 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Handles, D> for &Handles {
6050 #[inline]
6051 unsafe fn encode(
6052 self,
6053 encoder: &mut fidl::encoding::Encoder<'_, D>,
6054 offset: usize,
6055 _depth: fidl::encoding::Depth,
6056 ) -> fidl::Result<()> {
6057 encoder.debug_check_bounds::<Handles>(offset);
6058 encoder.write_num::<u64>(self.ordinal(), offset);
6059 match self {
6060 Handles::Handles(ref val) => {
6061 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<HandleId>, D>(
6062 <fidl::encoding::UnboundedVector<HandleId> as fidl::encoding::ValueTypeMarker>::borrow(val),
6063 encoder, offset + 8, _depth
6064 )
6065 }
6066 Handles::Dispositions(ref val) => {
6067 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<HandleDisposition>, D>(
6068 <fidl::encoding::UnboundedVector<HandleDisposition> as fidl::encoding::ValueTypeMarker>::borrow(val),
6069 encoder, offset + 8, _depth
6070 )
6071 }
6072 }
6073 }
6074 }
6075
6076 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Handles {
6077 #[inline(always)]
6078 fn new_empty() -> Self {
6079 Self::Handles(fidl::new_empty!(fidl::encoding::UnboundedVector<HandleId>, D))
6080 }
6081
6082 #[inline]
6083 unsafe fn decode(
6084 &mut self,
6085 decoder: &mut fidl::encoding::Decoder<'_, D>,
6086 offset: usize,
6087 mut depth: fidl::encoding::Depth,
6088 ) -> fidl::Result<()> {
6089 decoder.debug_check_bounds::<Self>(offset);
6090 #[allow(unused_variables)]
6091 let next_out_of_line = decoder.next_out_of_line();
6092 let handles_before = decoder.remaining_handles();
6093 let (ordinal, inlined, num_bytes, num_handles) =
6094 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6095
6096 let member_inline_size = match ordinal {
6097 1 => <fidl::encoding::UnboundedVector<HandleId> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6098 2 => <fidl::encoding::UnboundedVector<HandleDisposition> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6099 _ => return Err(fidl::Error::UnknownUnionTag),
6100 };
6101
6102 if inlined != (member_inline_size <= 4) {
6103 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6104 }
6105 let _inner_offset;
6106 if inlined {
6107 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6108 _inner_offset = offset + 8;
6109 } else {
6110 depth.increment()?;
6111 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6112 }
6113 match ordinal {
6114 1 => {
6115 #[allow(irrefutable_let_patterns)]
6116 if let Handles::Handles(_) = self {
6117 } else {
6119 *self = Handles::Handles(fidl::new_empty!(
6121 fidl::encoding::UnboundedVector<HandleId>,
6122 D
6123 ));
6124 }
6125 #[allow(irrefutable_let_patterns)]
6126 if let Handles::Handles(ref mut val) = self {
6127 fidl::decode!(
6128 fidl::encoding::UnboundedVector<HandleId>,
6129 D,
6130 val,
6131 decoder,
6132 _inner_offset,
6133 depth
6134 )?;
6135 } else {
6136 unreachable!()
6137 }
6138 }
6139 2 => {
6140 #[allow(irrefutable_let_patterns)]
6141 if let Handles::Dispositions(_) = self {
6142 } else {
6144 *self = Handles::Dispositions(fidl::new_empty!(
6146 fidl::encoding::UnboundedVector<HandleDisposition>,
6147 D
6148 ));
6149 }
6150 #[allow(irrefutable_let_patterns)]
6151 if let Handles::Dispositions(ref mut val) = self {
6152 fidl::decode!(
6153 fidl::encoding::UnboundedVector<HandleDisposition>,
6154 D,
6155 val,
6156 decoder,
6157 _inner_offset,
6158 depth
6159 )?;
6160 } else {
6161 unreachable!()
6162 }
6163 }
6164 ordinal => panic!("unexpected ordinal {:?}", ordinal),
6165 }
6166 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6167 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6168 }
6169 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6170 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6171 }
6172 Ok(())
6173 }
6174 }
6175
6176 impl fidl::encoding::ValueTypeMarker for SocketMessage {
6177 type Borrowed<'a> = &'a Self;
6178 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6179 value
6180 }
6181 }
6182
6183 unsafe impl fidl::encoding::TypeMarker for SocketMessage {
6184 type Owned = Self;
6185
6186 #[inline(always)]
6187 fn inline_align(_context: fidl::encoding::Context) -> usize {
6188 8
6189 }
6190
6191 #[inline(always)]
6192 fn inline_size(_context: fidl::encoding::Context) -> usize {
6193 16
6194 }
6195 }
6196
6197 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketMessage, D>
6198 for &SocketMessage
6199 {
6200 #[inline]
6201 unsafe fn encode(
6202 self,
6203 encoder: &mut fidl::encoding::Encoder<'_, D>,
6204 offset: usize,
6205 _depth: fidl::encoding::Depth,
6206 ) -> fidl::Result<()> {
6207 encoder.debug_check_bounds::<SocketMessage>(offset);
6208 encoder.write_num::<u64>(self.ordinal(), offset);
6209 match self {
6210 SocketMessage::Data(ref val) => {
6211 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
6212 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
6213 encoder, offset + 8, _depth
6214 )
6215 }
6216 SocketMessage::Stopped(ref val) => {
6217 fidl::encoding::encode_in_envelope::<AioStopped, D>(
6218 <AioStopped as fidl::encoding::ValueTypeMarker>::borrow(val),
6219 encoder, offset + 8, _depth
6220 )
6221 }
6222 SocketMessage::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
6223 }
6224 }
6225 }
6226
6227 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketMessage {
6228 #[inline(always)]
6229 fn new_empty() -> Self {
6230 Self::__SourceBreaking { unknown_ordinal: 0 }
6231 }
6232
6233 #[inline]
6234 unsafe fn decode(
6235 &mut self,
6236 decoder: &mut fidl::encoding::Decoder<'_, D>,
6237 offset: usize,
6238 mut depth: fidl::encoding::Depth,
6239 ) -> fidl::Result<()> {
6240 decoder.debug_check_bounds::<Self>(offset);
6241 #[allow(unused_variables)]
6242 let next_out_of_line = decoder.next_out_of_line();
6243 let handles_before = decoder.remaining_handles();
6244 let (ordinal, inlined, num_bytes, num_handles) =
6245 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6246
6247 let member_inline_size = match ordinal {
6248 1 => {
6249 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
6250 decoder.context,
6251 )
6252 }
6253 2 => <AioStopped as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6254 0 => return Err(fidl::Error::UnknownUnionTag),
6255 _ => num_bytes as usize,
6256 };
6257
6258 if inlined != (member_inline_size <= 4) {
6259 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6260 }
6261 let _inner_offset;
6262 if inlined {
6263 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6264 _inner_offset = offset + 8;
6265 } else {
6266 depth.increment()?;
6267 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6268 }
6269 match ordinal {
6270 1 => {
6271 #[allow(irrefutable_let_patterns)]
6272 if let SocketMessage::Data(_) = self {
6273 } else {
6275 *self = SocketMessage::Data(fidl::new_empty!(
6277 fidl::encoding::UnboundedVector<u8>,
6278 D
6279 ));
6280 }
6281 #[allow(irrefutable_let_patterns)]
6282 if let SocketMessage::Data(ref mut val) = self {
6283 fidl::decode!(
6284 fidl::encoding::UnboundedVector<u8>,
6285 D,
6286 val,
6287 decoder,
6288 _inner_offset,
6289 depth
6290 )?;
6291 } else {
6292 unreachable!()
6293 }
6294 }
6295 2 => {
6296 #[allow(irrefutable_let_patterns)]
6297 if let SocketMessage::Stopped(_) = self {
6298 } else {
6300 *self = SocketMessage::Stopped(fidl::new_empty!(AioStopped, D));
6302 }
6303 #[allow(irrefutable_let_patterns)]
6304 if let SocketMessage::Stopped(ref mut val) = self {
6305 fidl::decode!(AioStopped, D, val, decoder, _inner_offset, depth)?;
6306 } else {
6307 unreachable!()
6308 }
6309 }
6310 #[allow(deprecated)]
6311 ordinal => {
6312 for _ in 0..num_handles {
6313 decoder.drop_next_handle()?;
6314 }
6315 *self = SocketMessage::__SourceBreaking { unknown_ordinal: ordinal };
6316 }
6317 }
6318 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6319 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6320 }
6321 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6322 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6323 }
6324 Ok(())
6325 }
6326 }
6327
6328 impl fidl::encoding::ValueTypeMarker for WriteChannelError {
6329 type Borrowed<'a> = &'a Self;
6330 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6331 value
6332 }
6333 }
6334
6335 unsafe impl fidl::encoding::TypeMarker for WriteChannelError {
6336 type Owned = Self;
6337
6338 #[inline(always)]
6339 fn inline_align(_context: fidl::encoding::Context) -> usize {
6340 8
6341 }
6342
6343 #[inline(always)]
6344 fn inline_size(_context: fidl::encoding::Context) -> usize {
6345 16
6346 }
6347 }
6348
6349 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteChannelError, D>
6350 for &WriteChannelError
6351 {
6352 #[inline]
6353 unsafe fn encode(
6354 self,
6355 encoder: &mut fidl::encoding::Encoder<'_, D>,
6356 offset: usize,
6357 _depth: fidl::encoding::Depth,
6358 ) -> fidl::Result<()> {
6359 encoder.debug_check_bounds::<WriteChannelError>(offset);
6360 encoder.write_num::<u64>(self.ordinal(), offset);
6361 match self {
6362 WriteChannelError::Error(ref val) => {
6363 fidl::encoding::encode_in_envelope::<Error, D>(
6364 <Error as fidl::encoding::ValueTypeMarker>::borrow(val),
6365 encoder, offset + 8, _depth
6366 )
6367 }
6368 WriteChannelError::OpErrors(ref val) => {
6369 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>, D>(
6370 <fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>> as fidl::encoding::ValueTypeMarker>::borrow(val),
6371 encoder, offset + 8, _depth
6372 )
6373 }
6374 }
6375 }
6376 }
6377
6378 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteChannelError {
6379 #[inline(always)]
6380 fn new_empty() -> Self {
6381 Self::Error(fidl::new_empty!(Error, D))
6382 }
6383
6384 #[inline]
6385 unsafe fn decode(
6386 &mut self,
6387 decoder: &mut fidl::encoding::Decoder<'_, D>,
6388 offset: usize,
6389 mut depth: fidl::encoding::Depth,
6390 ) -> fidl::Result<()> {
6391 decoder.debug_check_bounds::<Self>(offset);
6392 #[allow(unused_variables)]
6393 let next_out_of_line = decoder.next_out_of_line();
6394 let handles_before = decoder.remaining_handles();
6395 let (ordinal, inlined, num_bytes, num_handles) =
6396 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6397
6398 let member_inline_size = match ordinal {
6399 1 => <Error as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6400 2 => <fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6401 _ => return Err(fidl::Error::UnknownUnionTag),
6402 };
6403
6404 if inlined != (member_inline_size <= 4) {
6405 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6406 }
6407 let _inner_offset;
6408 if inlined {
6409 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6410 _inner_offset = offset + 8;
6411 } else {
6412 depth.increment()?;
6413 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6414 }
6415 match ordinal {
6416 1 => {
6417 #[allow(irrefutable_let_patterns)]
6418 if let WriteChannelError::Error(_) = self {
6419 } else {
6421 *self = WriteChannelError::Error(fidl::new_empty!(Error, D));
6423 }
6424 #[allow(irrefutable_let_patterns)]
6425 if let WriteChannelError::Error(ref mut val) = self {
6426 fidl::decode!(Error, D, val, decoder, _inner_offset, depth)?;
6427 } else {
6428 unreachable!()
6429 }
6430 }
6431 2 => {
6432 #[allow(irrefutable_let_patterns)]
6433 if let WriteChannelError::OpErrors(_) = self {
6434 } else {
6436 *self = WriteChannelError::OpErrors(fidl::new_empty!(
6438 fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>,
6439 D
6440 ));
6441 }
6442 #[allow(irrefutable_let_patterns)]
6443 if let WriteChannelError::OpErrors(ref mut val) = self {
6444 fidl::decode!(
6445 fidl::encoding::UnboundedVector<fidl::encoding::OptionalUnion<Error>>,
6446 D,
6447 val,
6448 decoder,
6449 _inner_offset,
6450 depth
6451 )?;
6452 } else {
6453 unreachable!()
6454 }
6455 }
6456 ordinal => panic!("unexpected ordinal {:?}", ordinal),
6457 }
6458 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6459 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6460 }
6461 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6462 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6463 }
6464 Ok(())
6465 }
6466 }
6467}