1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12pub enum FilterError {
13 NoPattern,
15 UnknownType,
17 InvalidOptions,
19 #[doc(hidden)]
20 __SourceBreaking { unknown_ordinal: u32 },
21}
22
23#[macro_export]
25macro_rules! FilterErrorUnknown {
26 () => {
27 _
28 };
29}
30
31impl FilterError {
32 #[inline]
33 pub fn from_primitive(prim: u32) -> Option<Self> {
34 match prim {
35 1 => Some(Self::NoPattern),
36 2 => Some(Self::UnknownType),
37 3 => Some(Self::InvalidOptions),
38 _ => None,
39 }
40 }
41
42 #[inline]
43 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
44 match prim {
45 1 => Self::NoPattern,
46 2 => Self::UnknownType,
47 3 => Self::InvalidOptions,
48 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
49 }
50 }
51
52 #[inline]
53 pub fn unknown() -> Self {
54 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
55 }
56
57 #[inline]
58 pub const fn into_primitive(self) -> u32 {
59 match self {
60 Self::NoPattern => 1,
61 Self::UnknownType => 2,
62 Self::InvalidOptions => 3,
63 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
64 }
65 }
66
67 #[inline]
68 pub fn is_unknown(&self) -> bool {
69 match self {
70 Self::__SourceBreaking { unknown_ordinal: _ } => true,
71 _ => false,
72 }
73 }
74}
75
76#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
77pub enum FilterType {
78 Url,
82 Moniker,
84 MonikerPrefix,
86 MonikerSuffix,
88 #[doc(hidden)]
89 __SourceBreaking { unknown_ordinal: u8 },
90}
91
92#[macro_export]
94macro_rules! FilterTypeUnknown {
95 () => {
96 _
97 };
98}
99
100impl FilterType {
101 #[inline]
102 pub fn from_primitive(prim: u8) -> Option<Self> {
103 match prim {
104 0 => Some(Self::Url),
105 1 => Some(Self::Moniker),
106 2 => Some(Self::MonikerPrefix),
107 3 => Some(Self::MonikerSuffix),
108 _ => None,
109 }
110 }
111
112 #[inline]
113 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
114 match prim {
115 0 => Self::Url,
116 1 => Self::Moniker,
117 2 => Self::MonikerPrefix,
118 3 => Self::MonikerSuffix,
119 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
120 }
121 }
122
123 #[inline]
124 pub fn unknown() -> Self {
125 Self::__SourceBreaking { unknown_ordinal: 0xff }
126 }
127
128 #[inline]
129 pub const fn into_primitive(self) -> u8 {
130 match self {
131 Self::Url => 0,
132 Self::Moniker => 1,
133 Self::MonikerPrefix => 2,
134 Self::MonikerSuffix => 3,
135 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
136 }
137 }
138
139 #[inline]
140 pub fn is_unknown(&self) -> bool {
141 match self {
142 Self::__SourceBreaking { unknown_ordinal: _ } => true,
143 _ => false,
144 }
145 }
146}
147
148#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
149pub enum MinidumpError {
150 NoProcesses,
154 InternalError,
157 #[doc(hidden)]
158 __SourceBreaking { unknown_ordinal: u32 },
159}
160
161#[macro_export]
163macro_rules! MinidumpErrorUnknown {
164 () => {
165 _
166 };
167}
168
169impl MinidumpError {
170 #[inline]
171 pub fn from_primitive(prim: u32) -> Option<Self> {
172 match prim {
173 1 => Some(Self::NoProcesses),
174 2 => Some(Self::InternalError),
175 _ => None,
176 }
177 }
178
179 #[inline]
180 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
181 match prim {
182 1 => Self::NoProcesses,
183 2 => Self::InternalError,
184 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
185 }
186 }
187
188 #[inline]
189 pub fn unknown() -> Self {
190 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
191 }
192
193 #[inline]
194 pub const fn into_primitive(self) -> u32 {
195 match self {
196 Self::NoProcesses => 1,
197 Self::InternalError => 2,
198 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
199 }
200 }
201
202 #[inline]
203 pub fn is_unknown(&self) -> bool {
204 match self {
205 Self::__SourceBreaking { unknown_ordinal: _ } => true,
206 _ => false,
207 }
208 }
209}
210
211#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
212pub enum ProcessInfoError {
213 NoProcesses,
215 ProcessGone,
217 ThreadGone,
219 #[doc(hidden)]
220 __SourceBreaking { unknown_ordinal: u32 },
221}
222
223#[macro_export]
225macro_rules! ProcessInfoErrorUnknown {
226 () => {
227 _
228 };
229}
230
231impl ProcessInfoError {
232 #[inline]
233 pub fn from_primitive(prim: u32) -> Option<Self> {
234 match prim {
235 1 => Some(Self::NoProcesses),
236 2 => Some(Self::ProcessGone),
237 3 => Some(Self::ThreadGone),
238 _ => None,
239 }
240 }
241
242 #[inline]
243 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
244 match prim {
245 1 => Self::NoProcesses,
246 2 => Self::ProcessGone,
247 3 => Self::ThreadGone,
248 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
249 }
250 }
251
252 #[inline]
253 pub fn unknown() -> Self {
254 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
255 }
256
257 #[inline]
258 pub const fn into_primitive(self) -> u32 {
259 match self {
260 Self::NoProcesses => 1,
261 Self::ProcessGone => 2,
262 Self::ThreadGone => 3,
263 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
264 }
265 }
266
267 #[inline]
268 pub fn is_unknown(&self) -> bool {
269 match self {
270 Self::__SourceBreaking { unknown_ordinal: _ } => true,
271 _ => false,
272 }
273 }
274}
275
276#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
277pub struct AttachedProcessIteratorGetNextResponse {
278 pub process_names: Vec<String>,
279}
280
281impl fidl::Persistable for AttachedProcessIteratorGetNextResponse {}
282
283#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
284#[repr(C)]
285pub struct DebugAgentAttachToResponse {
286 pub num_matches: u32,
287}
288
289impl fidl::Persistable for DebugAgentAttachToResponse {}
290
291#[derive(Clone, Debug, PartialEq)]
298pub struct Filter {
299 pub pattern: String,
302 pub type_: FilterType,
304 pub options: FilterOptions,
306}
307
308impl fidl::Persistable for Filter {}
309
310#[derive(Clone, Debug, PartialEq)]
311pub struct ProcessInfo {
312 pub process: u64,
313 pub moniker: String,
314 pub thread: u64,
316 pub details: ThreadDetails,
319}
320
321impl fidl::Persistable for ProcessInfo {}
322
323#[derive(Clone, Debug, PartialEq)]
324pub struct ProcessInfoIteratorGetNextResponse {
325 pub info: Vec<ProcessInfo>,
326}
327
328impl fidl::Persistable for ProcessInfoIteratorGetNextResponse {}
329
330#[derive(Clone, Debug, Default, PartialEq)]
331pub struct DebugAgentOnFatalExceptionRequest {
332 pub thread: Option<u64>,
334 pub backtrace: Option<String>,
336 #[doc(hidden)]
337 pub __source_breaking: fidl::marker::SourceBreaking,
338}
339
340impl fidl::Persistable for DebugAgentOnFatalExceptionRequest {}
341
342#[derive(Clone, Debug, Default, PartialEq)]
343pub struct FilterOptions {
344 pub recursive: Option<bool>,
350 pub job_only: Option<bool>,
359 #[doc(hidden)]
360 pub __source_breaking: fidl::marker::SourceBreaking,
361}
362
363impl fidl::Persistable for FilterOptions {}
364
365#[derive(Clone, Debug, Default, PartialEq)]
366pub struct GetProcessInfoOptions {
367 pub filter: Option<Filter>,
373 pub interest: Option<ThreadDetailsInterest>,
377 #[doc(hidden)]
378 pub __source_breaking: fidl::marker::SourceBreaking,
379}
380
381impl fidl::Persistable for GetProcessInfoOptions {}
382
383#[derive(Clone, Debug, Default, PartialEq)]
384pub struct MinidumpOptions {
385 pub filter: Option<Filter>,
389 #[doc(hidden)]
390 pub __source_breaking: fidl::marker::SourceBreaking,
391}
392
393impl fidl::Persistable for MinidumpOptions {}
394
395#[derive(Clone, Debug, Default, PartialEq)]
399pub struct ThreadDetails {
400 pub backtrace: Option<String>,
402 #[doc(hidden)]
403 pub __source_breaking: fidl::marker::SourceBreaking,
404}
405
406impl fidl::Persistable for ThreadDetails {}
407
408#[derive(Clone, Debug, Default, PartialEq)]
409pub struct ThreadDetailsInterest {
410 pub backtrace: Option<bool>,
414 #[doc(hidden)]
415 pub __source_breaking: fidl::marker::SourceBreaking,
416}
417
418impl fidl::Persistable for ThreadDetailsInterest {}
419
420mod internal {
421 use super::*;
422 unsafe impl fidl::encoding::TypeMarker for FilterError {
423 type Owned = Self;
424
425 #[inline(always)]
426 fn inline_align(_context: fidl::encoding::Context) -> usize {
427 std::mem::align_of::<u32>()
428 }
429
430 #[inline(always)]
431 fn inline_size(_context: fidl::encoding::Context) -> usize {
432 std::mem::size_of::<u32>()
433 }
434
435 #[inline(always)]
436 fn encode_is_copy() -> bool {
437 false
438 }
439
440 #[inline(always)]
441 fn decode_is_copy() -> bool {
442 false
443 }
444 }
445
446 impl fidl::encoding::ValueTypeMarker for FilterError {
447 type Borrowed<'a> = Self;
448 #[inline(always)]
449 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
450 *value
451 }
452 }
453
454 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilterError {
455 #[inline]
456 unsafe fn encode(
457 self,
458 encoder: &mut fidl::encoding::Encoder<'_, D>,
459 offset: usize,
460 _depth: fidl::encoding::Depth,
461 ) -> fidl::Result<()> {
462 encoder.debug_check_bounds::<Self>(offset);
463 encoder.write_num(self.into_primitive(), offset);
464 Ok(())
465 }
466 }
467
468 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterError {
469 #[inline(always)]
470 fn new_empty() -> Self {
471 Self::unknown()
472 }
473
474 #[inline]
475 unsafe fn decode(
476 &mut self,
477 decoder: &mut fidl::encoding::Decoder<'_, D>,
478 offset: usize,
479 _depth: fidl::encoding::Depth,
480 ) -> fidl::Result<()> {
481 decoder.debug_check_bounds::<Self>(offset);
482 let prim = decoder.read_num::<u32>(offset);
483
484 *self = Self::from_primitive_allow_unknown(prim);
485 Ok(())
486 }
487 }
488 unsafe impl fidl::encoding::TypeMarker for FilterType {
489 type Owned = Self;
490
491 #[inline(always)]
492 fn inline_align(_context: fidl::encoding::Context) -> usize {
493 std::mem::align_of::<u8>()
494 }
495
496 #[inline(always)]
497 fn inline_size(_context: fidl::encoding::Context) -> usize {
498 std::mem::size_of::<u8>()
499 }
500
501 #[inline(always)]
502 fn encode_is_copy() -> bool {
503 false
504 }
505
506 #[inline(always)]
507 fn decode_is_copy() -> bool {
508 false
509 }
510 }
511
512 impl fidl::encoding::ValueTypeMarker for FilterType {
513 type Borrowed<'a> = Self;
514 #[inline(always)]
515 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
516 *value
517 }
518 }
519
520 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilterType {
521 #[inline]
522 unsafe fn encode(
523 self,
524 encoder: &mut fidl::encoding::Encoder<'_, D>,
525 offset: usize,
526 _depth: fidl::encoding::Depth,
527 ) -> fidl::Result<()> {
528 encoder.debug_check_bounds::<Self>(offset);
529 encoder.write_num(self.into_primitive(), offset);
530 Ok(())
531 }
532 }
533
534 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterType {
535 #[inline(always)]
536 fn new_empty() -> Self {
537 Self::unknown()
538 }
539
540 #[inline]
541 unsafe fn decode(
542 &mut self,
543 decoder: &mut fidl::encoding::Decoder<'_, D>,
544 offset: usize,
545 _depth: fidl::encoding::Depth,
546 ) -> fidl::Result<()> {
547 decoder.debug_check_bounds::<Self>(offset);
548 let prim = decoder.read_num::<u8>(offset);
549
550 *self = Self::from_primitive_allow_unknown(prim);
551 Ok(())
552 }
553 }
554 unsafe impl fidl::encoding::TypeMarker for MinidumpError {
555 type Owned = Self;
556
557 #[inline(always)]
558 fn inline_align(_context: fidl::encoding::Context) -> usize {
559 std::mem::align_of::<u32>()
560 }
561
562 #[inline(always)]
563 fn inline_size(_context: fidl::encoding::Context) -> usize {
564 std::mem::size_of::<u32>()
565 }
566
567 #[inline(always)]
568 fn encode_is_copy() -> bool {
569 false
570 }
571
572 #[inline(always)]
573 fn decode_is_copy() -> bool {
574 false
575 }
576 }
577
578 impl fidl::encoding::ValueTypeMarker for MinidumpError {
579 type Borrowed<'a> = Self;
580 #[inline(always)]
581 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
582 *value
583 }
584 }
585
586 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MinidumpError {
587 #[inline]
588 unsafe fn encode(
589 self,
590 encoder: &mut fidl::encoding::Encoder<'_, D>,
591 offset: usize,
592 _depth: fidl::encoding::Depth,
593 ) -> fidl::Result<()> {
594 encoder.debug_check_bounds::<Self>(offset);
595 encoder.write_num(self.into_primitive(), offset);
596 Ok(())
597 }
598 }
599
600 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpError {
601 #[inline(always)]
602 fn new_empty() -> Self {
603 Self::unknown()
604 }
605
606 #[inline]
607 unsafe fn decode(
608 &mut self,
609 decoder: &mut fidl::encoding::Decoder<'_, D>,
610 offset: usize,
611 _depth: fidl::encoding::Depth,
612 ) -> fidl::Result<()> {
613 decoder.debug_check_bounds::<Self>(offset);
614 let prim = decoder.read_num::<u32>(offset);
615
616 *self = Self::from_primitive_allow_unknown(prim);
617 Ok(())
618 }
619 }
620 unsafe impl fidl::encoding::TypeMarker for ProcessInfoError {
621 type Owned = Self;
622
623 #[inline(always)]
624 fn inline_align(_context: fidl::encoding::Context) -> usize {
625 std::mem::align_of::<u32>()
626 }
627
628 #[inline(always)]
629 fn inline_size(_context: fidl::encoding::Context) -> usize {
630 std::mem::size_of::<u32>()
631 }
632
633 #[inline(always)]
634 fn encode_is_copy() -> bool {
635 false
636 }
637
638 #[inline(always)]
639 fn decode_is_copy() -> bool {
640 false
641 }
642 }
643
644 impl fidl::encoding::ValueTypeMarker for ProcessInfoError {
645 type Borrowed<'a> = Self;
646 #[inline(always)]
647 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
648 *value
649 }
650 }
651
652 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
653 for ProcessInfoError
654 {
655 #[inline]
656 unsafe fn encode(
657 self,
658 encoder: &mut fidl::encoding::Encoder<'_, D>,
659 offset: usize,
660 _depth: fidl::encoding::Depth,
661 ) -> fidl::Result<()> {
662 encoder.debug_check_bounds::<Self>(offset);
663 encoder.write_num(self.into_primitive(), offset);
664 Ok(())
665 }
666 }
667
668 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfoError {
669 #[inline(always)]
670 fn new_empty() -> Self {
671 Self::unknown()
672 }
673
674 #[inline]
675 unsafe fn decode(
676 &mut self,
677 decoder: &mut fidl::encoding::Decoder<'_, D>,
678 offset: usize,
679 _depth: fidl::encoding::Depth,
680 ) -> fidl::Result<()> {
681 decoder.debug_check_bounds::<Self>(offset);
682 let prim = decoder.read_num::<u32>(offset);
683
684 *self = Self::from_primitive_allow_unknown(prim);
685 Ok(())
686 }
687 }
688
689 impl fidl::encoding::ValueTypeMarker for AttachedProcessIteratorGetNextResponse {
690 type Borrowed<'a> = &'a Self;
691 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
692 value
693 }
694 }
695
696 unsafe impl fidl::encoding::TypeMarker for AttachedProcessIteratorGetNextResponse {
697 type Owned = Self;
698
699 #[inline(always)]
700 fn inline_align(_context: fidl::encoding::Context) -> usize {
701 8
702 }
703
704 #[inline(always)]
705 fn inline_size(_context: fidl::encoding::Context) -> usize {
706 16
707 }
708 }
709
710 unsafe impl<D: fidl::encoding::ResourceDialect>
711 fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D>
712 for &AttachedProcessIteratorGetNextResponse
713 {
714 #[inline]
715 unsafe fn encode(
716 self,
717 encoder: &mut fidl::encoding::Encoder<'_, D>,
718 offset: usize,
719 _depth: fidl::encoding::Depth,
720 ) -> fidl::Result<()> {
721 encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
722 fidl::encoding::Encode::<AttachedProcessIteratorGetNextResponse, D>::encode(
724 (
725 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.process_names),
726 ),
727 encoder, offset, _depth
728 )
729 }
730 }
731 unsafe impl<
732 D: fidl::encoding::ResourceDialect,
733 T0: fidl::encoding::Encode<
734 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
735 D,
736 >,
737 > fidl::encoding::Encode<AttachedProcessIteratorGetNextResponse, D> for (T0,)
738 {
739 #[inline]
740 unsafe fn encode(
741 self,
742 encoder: &mut fidl::encoding::Encoder<'_, D>,
743 offset: usize,
744 depth: fidl::encoding::Depth,
745 ) -> fidl::Result<()> {
746 encoder.debug_check_bounds::<AttachedProcessIteratorGetNextResponse>(offset);
747 self.0.encode(encoder, offset + 0, depth)?;
751 Ok(())
752 }
753 }
754
755 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
756 for AttachedProcessIteratorGetNextResponse
757 {
758 #[inline(always)]
759 fn new_empty() -> Self {
760 Self {
761 process_names: fidl::new_empty!(
762 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
763 D
764 ),
765 }
766 }
767
768 #[inline]
769 unsafe fn decode(
770 &mut self,
771 decoder: &mut fidl::encoding::Decoder<'_, D>,
772 offset: usize,
773 _depth: fidl::encoding::Depth,
774 ) -> fidl::Result<()> {
775 decoder.debug_check_bounds::<Self>(offset);
776 fidl::decode!(
778 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<32>>,
779 D,
780 &mut self.process_names,
781 decoder,
782 offset + 0,
783 _depth
784 )?;
785 Ok(())
786 }
787 }
788
789 impl fidl::encoding::ValueTypeMarker for DebugAgentAttachToResponse {
790 type Borrowed<'a> = &'a Self;
791 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
792 value
793 }
794 }
795
796 unsafe impl fidl::encoding::TypeMarker for DebugAgentAttachToResponse {
797 type Owned = Self;
798
799 #[inline(always)]
800 fn inline_align(_context: fidl::encoding::Context) -> usize {
801 4
802 }
803
804 #[inline(always)]
805 fn inline_size(_context: fidl::encoding::Context) -> usize {
806 4
807 }
808 #[inline(always)]
809 fn encode_is_copy() -> bool {
810 true
811 }
812
813 #[inline(always)]
814 fn decode_is_copy() -> bool {
815 true
816 }
817 }
818
819 unsafe impl<D: fidl::encoding::ResourceDialect>
820 fidl::encoding::Encode<DebugAgentAttachToResponse, D> for &DebugAgentAttachToResponse
821 {
822 #[inline]
823 unsafe fn encode(
824 self,
825 encoder: &mut fidl::encoding::Encoder<'_, D>,
826 offset: usize,
827 _depth: fidl::encoding::Depth,
828 ) -> fidl::Result<()> {
829 encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
830 unsafe {
831 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
833 (buf_ptr as *mut DebugAgentAttachToResponse)
834 .write_unaligned((self as *const DebugAgentAttachToResponse).read());
835 }
838 Ok(())
839 }
840 }
841 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
842 fidl::encoding::Encode<DebugAgentAttachToResponse, D> for (T0,)
843 {
844 #[inline]
845 unsafe fn encode(
846 self,
847 encoder: &mut fidl::encoding::Encoder<'_, D>,
848 offset: usize,
849 depth: fidl::encoding::Depth,
850 ) -> fidl::Result<()> {
851 encoder.debug_check_bounds::<DebugAgentAttachToResponse>(offset);
852 self.0.encode(encoder, offset + 0, depth)?;
856 Ok(())
857 }
858 }
859
860 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
861 for DebugAgentAttachToResponse
862 {
863 #[inline(always)]
864 fn new_empty() -> Self {
865 Self { num_matches: fidl::new_empty!(u32, D) }
866 }
867
868 #[inline]
869 unsafe fn decode(
870 &mut self,
871 decoder: &mut fidl::encoding::Decoder<'_, D>,
872 offset: usize,
873 _depth: fidl::encoding::Depth,
874 ) -> fidl::Result<()> {
875 decoder.debug_check_bounds::<Self>(offset);
876 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
877 unsafe {
880 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
881 }
882 Ok(())
883 }
884 }
885
886 impl fidl::encoding::ValueTypeMarker for Filter {
887 type Borrowed<'a> = &'a Self;
888 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
889 value
890 }
891 }
892
893 unsafe impl fidl::encoding::TypeMarker for Filter {
894 type Owned = Self;
895
896 #[inline(always)]
897 fn inline_align(_context: fidl::encoding::Context) -> usize {
898 8
899 }
900
901 #[inline(always)]
902 fn inline_size(_context: fidl::encoding::Context) -> usize {
903 40
904 }
905 }
906
907 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Filter, D> for &Filter {
908 #[inline]
909 unsafe fn encode(
910 self,
911 encoder: &mut fidl::encoding::Encoder<'_, D>,
912 offset: usize,
913 _depth: fidl::encoding::Depth,
914 ) -> fidl::Result<()> {
915 encoder.debug_check_bounds::<Filter>(offset);
916 fidl::encoding::Encode::<Filter, D>::encode(
918 (
919 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
920 &self.pattern,
921 ),
922 <FilterType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
923 <FilterOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
924 ),
925 encoder,
926 offset,
927 _depth,
928 )
929 }
930 }
931 unsafe impl<
932 D: fidl::encoding::ResourceDialect,
933 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
934 T1: fidl::encoding::Encode<FilterType, D>,
935 T2: fidl::encoding::Encode<FilterOptions, D>,
936 > fidl::encoding::Encode<Filter, D> for (T0, T1, T2)
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::<Filter>(offset);
946 unsafe {
949 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
950 (ptr as *mut u64).write_unaligned(0);
951 }
952 self.0.encode(encoder, offset + 0, depth)?;
954 self.1.encode(encoder, offset + 16, depth)?;
955 self.2.encode(encoder, offset + 24, depth)?;
956 Ok(())
957 }
958 }
959
960 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Filter {
961 #[inline(always)]
962 fn new_empty() -> Self {
963 Self {
964 pattern: fidl::new_empty!(fidl::encoding::UnboundedString, D),
965 type_: fidl::new_empty!(FilterType, D),
966 options: fidl::new_empty!(FilterOptions, D),
967 }
968 }
969
970 #[inline]
971 unsafe fn decode(
972 &mut self,
973 decoder: &mut fidl::encoding::Decoder<'_, D>,
974 offset: usize,
975 _depth: fidl::encoding::Depth,
976 ) -> fidl::Result<()> {
977 decoder.debug_check_bounds::<Self>(offset);
978 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
980 let padval = unsafe { (ptr as *const u64).read_unaligned() };
981 let mask = 0xffffffffffffff00u64;
982 let maskedval = padval & mask;
983 if maskedval != 0 {
984 return Err(fidl::Error::NonZeroPadding {
985 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
986 });
987 }
988 fidl::decode!(
989 fidl::encoding::UnboundedString,
990 D,
991 &mut self.pattern,
992 decoder,
993 offset + 0,
994 _depth
995 )?;
996 fidl::decode!(FilterType, D, &mut self.type_, decoder, offset + 16, _depth)?;
997 fidl::decode!(FilterOptions, D, &mut self.options, decoder, offset + 24, _depth)?;
998 Ok(())
999 }
1000 }
1001
1002 impl fidl::encoding::ValueTypeMarker for ProcessInfo {
1003 type Borrowed<'a> = &'a Self;
1004 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1005 value
1006 }
1007 }
1008
1009 unsafe impl fidl::encoding::TypeMarker for ProcessInfo {
1010 type Owned = Self;
1011
1012 #[inline(always)]
1013 fn inline_align(_context: fidl::encoding::Context) -> usize {
1014 8
1015 }
1016
1017 #[inline(always)]
1018 fn inline_size(_context: fidl::encoding::Context) -> usize {
1019 48
1020 }
1021 }
1022
1023 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProcessInfo, D>
1024 for &ProcessInfo
1025 {
1026 #[inline]
1027 unsafe fn encode(
1028 self,
1029 encoder: &mut fidl::encoding::Encoder<'_, D>,
1030 offset: usize,
1031 _depth: fidl::encoding::Depth,
1032 ) -> fidl::Result<()> {
1033 encoder.debug_check_bounds::<ProcessInfo>(offset);
1034 fidl::encoding::Encode::<ProcessInfo, D>::encode(
1036 (
1037 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.process),
1038 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1039 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.thread),
1040 <ThreadDetails as fidl::encoding::ValueTypeMarker>::borrow(&self.details),
1041 ),
1042 encoder, offset, _depth
1043 )
1044 }
1045 }
1046 unsafe impl<
1047 D: fidl::encoding::ResourceDialect,
1048 T0: fidl::encoding::Encode<u64, D>,
1049 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1050 T2: fidl::encoding::Encode<u64, D>,
1051 T3: fidl::encoding::Encode<ThreadDetails, D>,
1052 > fidl::encoding::Encode<ProcessInfo, D> for (T0, T1, T2, T3)
1053 {
1054 #[inline]
1055 unsafe fn encode(
1056 self,
1057 encoder: &mut fidl::encoding::Encoder<'_, D>,
1058 offset: usize,
1059 depth: fidl::encoding::Depth,
1060 ) -> fidl::Result<()> {
1061 encoder.debug_check_bounds::<ProcessInfo>(offset);
1062 self.0.encode(encoder, offset + 0, depth)?;
1066 self.1.encode(encoder, offset + 8, depth)?;
1067 self.2.encode(encoder, offset + 24, depth)?;
1068 self.3.encode(encoder, offset + 32, depth)?;
1069 Ok(())
1070 }
1071 }
1072
1073 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProcessInfo {
1074 #[inline(always)]
1075 fn new_empty() -> Self {
1076 Self {
1077 process: fidl::new_empty!(u64, D),
1078 moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
1079 thread: fidl::new_empty!(u64, D),
1080 details: fidl::new_empty!(ThreadDetails, D),
1081 }
1082 }
1083
1084 #[inline]
1085 unsafe fn decode(
1086 &mut self,
1087 decoder: &mut fidl::encoding::Decoder<'_, D>,
1088 offset: usize,
1089 _depth: fidl::encoding::Depth,
1090 ) -> fidl::Result<()> {
1091 decoder.debug_check_bounds::<Self>(offset);
1092 fidl::decode!(u64, D, &mut self.process, decoder, offset + 0, _depth)?;
1094 fidl::decode!(
1095 fidl::encoding::BoundedString<4096>,
1096 D,
1097 &mut self.moniker,
1098 decoder,
1099 offset + 8,
1100 _depth
1101 )?;
1102 fidl::decode!(u64, D, &mut self.thread, decoder, offset + 24, _depth)?;
1103 fidl::decode!(ThreadDetails, D, &mut self.details, decoder, offset + 32, _depth)?;
1104 Ok(())
1105 }
1106 }
1107
1108 impl fidl::encoding::ValueTypeMarker for ProcessInfoIteratorGetNextResponse {
1109 type Borrowed<'a> = &'a Self;
1110 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1111 value
1112 }
1113 }
1114
1115 unsafe impl fidl::encoding::TypeMarker for ProcessInfoIteratorGetNextResponse {
1116 type Owned = Self;
1117
1118 #[inline(always)]
1119 fn inline_align(_context: fidl::encoding::Context) -> usize {
1120 8
1121 }
1122
1123 #[inline(always)]
1124 fn inline_size(_context: fidl::encoding::Context) -> usize {
1125 16
1126 }
1127 }
1128
1129 unsafe impl<D: fidl::encoding::ResourceDialect>
1130 fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D>
1131 for &ProcessInfoIteratorGetNextResponse
1132 {
1133 #[inline]
1134 unsafe fn encode(
1135 self,
1136 encoder: &mut fidl::encoding::Encoder<'_, D>,
1137 offset: usize,
1138 _depth: fidl::encoding::Depth,
1139 ) -> fidl::Result<()> {
1140 encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
1141 fidl::encoding::Encode::<ProcessInfoIteratorGetNextResponse, D>::encode(
1143 (
1144 <fidl::encoding::UnboundedVector<ProcessInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1145 ),
1146 encoder, offset, _depth
1147 )
1148 }
1149 }
1150 unsafe impl<
1151 D: fidl::encoding::ResourceDialect,
1152 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ProcessInfo>, D>,
1153 > fidl::encoding::Encode<ProcessInfoIteratorGetNextResponse, D> for (T0,)
1154 {
1155 #[inline]
1156 unsafe fn encode(
1157 self,
1158 encoder: &mut fidl::encoding::Encoder<'_, D>,
1159 offset: usize,
1160 depth: fidl::encoding::Depth,
1161 ) -> fidl::Result<()> {
1162 encoder.debug_check_bounds::<ProcessInfoIteratorGetNextResponse>(offset);
1163 self.0.encode(encoder, offset + 0, depth)?;
1167 Ok(())
1168 }
1169 }
1170
1171 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1172 for ProcessInfoIteratorGetNextResponse
1173 {
1174 #[inline(always)]
1175 fn new_empty() -> Self {
1176 Self { info: fidl::new_empty!(fidl::encoding::UnboundedVector<ProcessInfo>, D) }
1177 }
1178
1179 #[inline]
1180 unsafe fn decode(
1181 &mut self,
1182 decoder: &mut fidl::encoding::Decoder<'_, D>,
1183 offset: usize,
1184 _depth: fidl::encoding::Depth,
1185 ) -> fidl::Result<()> {
1186 decoder.debug_check_bounds::<Self>(offset);
1187 fidl::decode!(
1189 fidl::encoding::UnboundedVector<ProcessInfo>,
1190 D,
1191 &mut self.info,
1192 decoder,
1193 offset + 0,
1194 _depth
1195 )?;
1196 Ok(())
1197 }
1198 }
1199
1200 impl DebugAgentOnFatalExceptionRequest {
1201 #[inline(always)]
1202 fn max_ordinal_present(&self) -> u64 {
1203 if let Some(_) = self.backtrace {
1204 return 2;
1205 }
1206 if let Some(_) = self.thread {
1207 return 1;
1208 }
1209 0
1210 }
1211 }
1212
1213 impl fidl::encoding::ValueTypeMarker for DebugAgentOnFatalExceptionRequest {
1214 type Borrowed<'a> = &'a Self;
1215 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1216 value
1217 }
1218 }
1219
1220 unsafe impl fidl::encoding::TypeMarker for DebugAgentOnFatalExceptionRequest {
1221 type Owned = Self;
1222
1223 #[inline(always)]
1224 fn inline_align(_context: fidl::encoding::Context) -> usize {
1225 8
1226 }
1227
1228 #[inline(always)]
1229 fn inline_size(_context: fidl::encoding::Context) -> usize {
1230 16
1231 }
1232 }
1233
1234 unsafe impl<D: fidl::encoding::ResourceDialect>
1235 fidl::encoding::Encode<DebugAgentOnFatalExceptionRequest, D>
1236 for &DebugAgentOnFatalExceptionRequest
1237 {
1238 unsafe fn encode(
1239 self,
1240 encoder: &mut fidl::encoding::Encoder<'_, D>,
1241 offset: usize,
1242 mut depth: fidl::encoding::Depth,
1243 ) -> fidl::Result<()> {
1244 encoder.debug_check_bounds::<DebugAgentOnFatalExceptionRequest>(offset);
1245 let max_ordinal: u64 = self.max_ordinal_present();
1247 encoder.write_num(max_ordinal, offset);
1248 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1249 if max_ordinal == 0 {
1251 return Ok(());
1252 }
1253 depth.increment()?;
1254 let envelope_size = 8;
1255 let bytes_len = max_ordinal as usize * envelope_size;
1256 #[allow(unused_variables)]
1257 let offset = encoder.out_of_line_offset(bytes_len);
1258 let mut _prev_end_offset: usize = 0;
1259 if 1 > max_ordinal {
1260 return Ok(());
1261 }
1262
1263 let cur_offset: usize = (1 - 1) * envelope_size;
1266
1267 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1269
1270 fidl::encoding::encode_in_envelope_optional::<u64, D>(
1275 self.thread.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1276 encoder,
1277 offset + cur_offset,
1278 depth,
1279 )?;
1280
1281 _prev_end_offset = cur_offset + envelope_size;
1282 if 2 > max_ordinal {
1283 return Ok(());
1284 }
1285
1286 let cur_offset: usize = (2 - 1) * envelope_size;
1289
1290 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1292
1293 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
1298 self.backtrace.as_ref().map(
1299 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
1300 ),
1301 encoder,
1302 offset + cur_offset,
1303 depth,
1304 )?;
1305
1306 _prev_end_offset = cur_offset + envelope_size;
1307
1308 Ok(())
1309 }
1310 }
1311
1312 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1313 for DebugAgentOnFatalExceptionRequest
1314 {
1315 #[inline(always)]
1316 fn new_empty() -> Self {
1317 Self::default()
1318 }
1319
1320 unsafe fn decode(
1321 &mut self,
1322 decoder: &mut fidl::encoding::Decoder<'_, D>,
1323 offset: usize,
1324 mut depth: fidl::encoding::Depth,
1325 ) -> fidl::Result<()> {
1326 decoder.debug_check_bounds::<Self>(offset);
1327 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1328 None => return Err(fidl::Error::NotNullable),
1329 Some(len) => len,
1330 };
1331 if len == 0 {
1333 return Ok(());
1334 };
1335 depth.increment()?;
1336 let envelope_size = 8;
1337 let bytes_len = len * envelope_size;
1338 let offset = decoder.out_of_line_offset(bytes_len)?;
1339 let mut _next_ordinal_to_read = 0;
1341 let mut next_offset = offset;
1342 let end_offset = offset + bytes_len;
1343 _next_ordinal_to_read += 1;
1344 if next_offset >= end_offset {
1345 return Ok(());
1346 }
1347
1348 while _next_ordinal_to_read < 1 {
1350 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1351 _next_ordinal_to_read += 1;
1352 next_offset += envelope_size;
1353 }
1354
1355 let next_out_of_line = decoder.next_out_of_line();
1356 let handles_before = decoder.remaining_handles();
1357 if let Some((inlined, num_bytes, num_handles)) =
1358 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1359 {
1360 let member_inline_size =
1361 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1362 if inlined != (member_inline_size <= 4) {
1363 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1364 }
1365 let inner_offset;
1366 let mut inner_depth = depth.clone();
1367 if inlined {
1368 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1369 inner_offset = next_offset;
1370 } else {
1371 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1372 inner_depth.increment()?;
1373 }
1374 let val_ref = self.thread.get_or_insert_with(|| fidl::new_empty!(u64, D));
1375 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1376 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1377 {
1378 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1379 }
1380 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1381 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1382 }
1383 }
1384
1385 next_offset += envelope_size;
1386 _next_ordinal_to_read += 1;
1387 if next_offset >= end_offset {
1388 return Ok(());
1389 }
1390
1391 while _next_ordinal_to_read < 2 {
1393 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1394 _next_ordinal_to_read += 1;
1395 next_offset += envelope_size;
1396 }
1397
1398 let next_out_of_line = decoder.next_out_of_line();
1399 let handles_before = decoder.remaining_handles();
1400 if let Some((inlined, num_bytes, num_handles)) =
1401 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1402 {
1403 let member_inline_size =
1404 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
1405 decoder.context,
1406 );
1407 if inlined != (member_inline_size <= 4) {
1408 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1409 }
1410 let inner_offset;
1411 let mut inner_depth = depth.clone();
1412 if inlined {
1413 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1414 inner_offset = next_offset;
1415 } else {
1416 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1417 inner_depth.increment()?;
1418 }
1419 let val_ref = self
1420 .backtrace
1421 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
1422 fidl::decode!(
1423 fidl::encoding::UnboundedString,
1424 D,
1425 val_ref,
1426 decoder,
1427 inner_offset,
1428 inner_depth
1429 )?;
1430 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1431 {
1432 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1433 }
1434 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1435 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1436 }
1437 }
1438
1439 next_offset += envelope_size;
1440
1441 while next_offset < end_offset {
1443 _next_ordinal_to_read += 1;
1444 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1445 next_offset += envelope_size;
1446 }
1447
1448 Ok(())
1449 }
1450 }
1451
1452 impl FilterOptions {
1453 #[inline(always)]
1454 fn max_ordinal_present(&self) -> u64 {
1455 if let Some(_) = self.job_only {
1456 return 2;
1457 }
1458 if let Some(_) = self.recursive {
1459 return 1;
1460 }
1461 0
1462 }
1463 }
1464
1465 impl fidl::encoding::ValueTypeMarker for FilterOptions {
1466 type Borrowed<'a> = &'a Self;
1467 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1468 value
1469 }
1470 }
1471
1472 unsafe impl fidl::encoding::TypeMarker for FilterOptions {
1473 type Owned = Self;
1474
1475 #[inline(always)]
1476 fn inline_align(_context: fidl::encoding::Context) -> usize {
1477 8
1478 }
1479
1480 #[inline(always)]
1481 fn inline_size(_context: fidl::encoding::Context) -> usize {
1482 16
1483 }
1484 }
1485
1486 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilterOptions, D>
1487 for &FilterOptions
1488 {
1489 unsafe fn encode(
1490 self,
1491 encoder: &mut fidl::encoding::Encoder<'_, D>,
1492 offset: usize,
1493 mut depth: fidl::encoding::Depth,
1494 ) -> fidl::Result<()> {
1495 encoder.debug_check_bounds::<FilterOptions>(offset);
1496 let max_ordinal: u64 = self.max_ordinal_present();
1498 encoder.write_num(max_ordinal, offset);
1499 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1500 if max_ordinal == 0 {
1502 return Ok(());
1503 }
1504 depth.increment()?;
1505 let envelope_size = 8;
1506 let bytes_len = max_ordinal as usize * envelope_size;
1507 #[allow(unused_variables)]
1508 let offset = encoder.out_of_line_offset(bytes_len);
1509 let mut _prev_end_offset: usize = 0;
1510 if 1 > max_ordinal {
1511 return Ok(());
1512 }
1513
1514 let cur_offset: usize = (1 - 1) * envelope_size;
1517
1518 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1520
1521 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1526 self.recursive.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1527 encoder,
1528 offset + cur_offset,
1529 depth,
1530 )?;
1531
1532 _prev_end_offset = cur_offset + envelope_size;
1533 if 2 > max_ordinal {
1534 return Ok(());
1535 }
1536
1537 let cur_offset: usize = (2 - 1) * envelope_size;
1540
1541 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1543
1544 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1549 self.job_only.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1550 encoder,
1551 offset + cur_offset,
1552 depth,
1553 )?;
1554
1555 _prev_end_offset = cur_offset + envelope_size;
1556
1557 Ok(())
1558 }
1559 }
1560
1561 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilterOptions {
1562 #[inline(always)]
1563 fn new_empty() -> Self {
1564 Self::default()
1565 }
1566
1567 unsafe fn decode(
1568 &mut self,
1569 decoder: &mut fidl::encoding::Decoder<'_, D>,
1570 offset: usize,
1571 mut depth: fidl::encoding::Depth,
1572 ) -> fidl::Result<()> {
1573 decoder.debug_check_bounds::<Self>(offset);
1574 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1575 None => return Err(fidl::Error::NotNullable),
1576 Some(len) => len,
1577 };
1578 if len == 0 {
1580 return Ok(());
1581 };
1582 depth.increment()?;
1583 let envelope_size = 8;
1584 let bytes_len = len * envelope_size;
1585 let offset = decoder.out_of_line_offset(bytes_len)?;
1586 let mut _next_ordinal_to_read = 0;
1588 let mut next_offset = offset;
1589 let end_offset = offset + bytes_len;
1590 _next_ordinal_to_read += 1;
1591 if next_offset >= end_offset {
1592 return Ok(());
1593 }
1594
1595 while _next_ordinal_to_read < 1 {
1597 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1598 _next_ordinal_to_read += 1;
1599 next_offset += envelope_size;
1600 }
1601
1602 let next_out_of_line = decoder.next_out_of_line();
1603 let handles_before = decoder.remaining_handles();
1604 if let Some((inlined, num_bytes, num_handles)) =
1605 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1606 {
1607 let member_inline_size =
1608 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1609 if inlined != (member_inline_size <= 4) {
1610 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1611 }
1612 let inner_offset;
1613 let mut inner_depth = depth.clone();
1614 if inlined {
1615 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1616 inner_offset = next_offset;
1617 } else {
1618 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1619 inner_depth.increment()?;
1620 }
1621 let val_ref = self.recursive.get_or_insert_with(|| fidl::new_empty!(bool, D));
1622 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1623 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1624 {
1625 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1626 }
1627 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1628 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1629 }
1630 }
1631
1632 next_offset += envelope_size;
1633 _next_ordinal_to_read += 1;
1634 if next_offset >= end_offset {
1635 return Ok(());
1636 }
1637
1638 while _next_ordinal_to_read < 2 {
1640 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1641 _next_ordinal_to_read += 1;
1642 next_offset += envelope_size;
1643 }
1644
1645 let next_out_of_line = decoder.next_out_of_line();
1646 let handles_before = decoder.remaining_handles();
1647 if let Some((inlined, num_bytes, num_handles)) =
1648 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1649 {
1650 let member_inline_size =
1651 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1652 if inlined != (member_inline_size <= 4) {
1653 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1654 }
1655 let inner_offset;
1656 let mut inner_depth = depth.clone();
1657 if inlined {
1658 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1659 inner_offset = next_offset;
1660 } else {
1661 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1662 inner_depth.increment()?;
1663 }
1664 let val_ref = self.job_only.get_or_insert_with(|| fidl::new_empty!(bool, D));
1665 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1666 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1667 {
1668 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1669 }
1670 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1671 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1672 }
1673 }
1674
1675 next_offset += envelope_size;
1676
1677 while next_offset < end_offset {
1679 _next_ordinal_to_read += 1;
1680 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1681 next_offset += envelope_size;
1682 }
1683
1684 Ok(())
1685 }
1686 }
1687
1688 impl GetProcessInfoOptions {
1689 #[inline(always)]
1690 fn max_ordinal_present(&self) -> u64 {
1691 if let Some(_) = self.interest {
1692 return 2;
1693 }
1694 if let Some(_) = self.filter {
1695 return 1;
1696 }
1697 0
1698 }
1699 }
1700
1701 impl fidl::encoding::ValueTypeMarker for GetProcessInfoOptions {
1702 type Borrowed<'a> = &'a Self;
1703 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1704 value
1705 }
1706 }
1707
1708 unsafe impl fidl::encoding::TypeMarker for GetProcessInfoOptions {
1709 type Owned = Self;
1710
1711 #[inline(always)]
1712 fn inline_align(_context: fidl::encoding::Context) -> usize {
1713 8
1714 }
1715
1716 #[inline(always)]
1717 fn inline_size(_context: fidl::encoding::Context) -> usize {
1718 16
1719 }
1720 }
1721
1722 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GetProcessInfoOptions, D>
1723 for &GetProcessInfoOptions
1724 {
1725 unsafe fn encode(
1726 self,
1727 encoder: &mut fidl::encoding::Encoder<'_, D>,
1728 offset: usize,
1729 mut depth: fidl::encoding::Depth,
1730 ) -> fidl::Result<()> {
1731 encoder.debug_check_bounds::<GetProcessInfoOptions>(offset);
1732 let max_ordinal: u64 = self.max_ordinal_present();
1734 encoder.write_num(max_ordinal, offset);
1735 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1736 if max_ordinal == 0 {
1738 return Ok(());
1739 }
1740 depth.increment()?;
1741 let envelope_size = 8;
1742 let bytes_len = max_ordinal as usize * envelope_size;
1743 #[allow(unused_variables)]
1744 let offset = encoder.out_of_line_offset(bytes_len);
1745 let mut _prev_end_offset: usize = 0;
1746 if 1 > max_ordinal {
1747 return Ok(());
1748 }
1749
1750 let cur_offset: usize = (1 - 1) * envelope_size;
1753
1754 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1756
1757 fidl::encoding::encode_in_envelope_optional::<Filter, D>(
1762 self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
1763 encoder,
1764 offset + cur_offset,
1765 depth,
1766 )?;
1767
1768 _prev_end_offset = cur_offset + envelope_size;
1769 if 2 > max_ordinal {
1770 return Ok(());
1771 }
1772
1773 let cur_offset: usize = (2 - 1) * envelope_size;
1776
1777 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1779
1780 fidl::encoding::encode_in_envelope_optional::<ThreadDetailsInterest, D>(
1785 self.interest
1786 .as_ref()
1787 .map(<ThreadDetailsInterest as fidl::encoding::ValueTypeMarker>::borrow),
1788 encoder,
1789 offset + cur_offset,
1790 depth,
1791 )?;
1792
1793 _prev_end_offset = cur_offset + envelope_size;
1794
1795 Ok(())
1796 }
1797 }
1798
1799 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetProcessInfoOptions {
1800 #[inline(always)]
1801 fn new_empty() -> Self {
1802 Self::default()
1803 }
1804
1805 unsafe fn decode(
1806 &mut self,
1807 decoder: &mut fidl::encoding::Decoder<'_, D>,
1808 offset: usize,
1809 mut depth: fidl::encoding::Depth,
1810 ) -> fidl::Result<()> {
1811 decoder.debug_check_bounds::<Self>(offset);
1812 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1813 None => return Err(fidl::Error::NotNullable),
1814 Some(len) => len,
1815 };
1816 if len == 0 {
1818 return Ok(());
1819 };
1820 depth.increment()?;
1821 let envelope_size = 8;
1822 let bytes_len = len * envelope_size;
1823 let offset = decoder.out_of_line_offset(bytes_len)?;
1824 let mut _next_ordinal_to_read = 0;
1826 let mut next_offset = offset;
1827 let end_offset = offset + bytes_len;
1828 _next_ordinal_to_read += 1;
1829 if next_offset >= end_offset {
1830 return Ok(());
1831 }
1832
1833 while _next_ordinal_to_read < 1 {
1835 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1836 _next_ordinal_to_read += 1;
1837 next_offset += envelope_size;
1838 }
1839
1840 let next_out_of_line = decoder.next_out_of_line();
1841 let handles_before = decoder.remaining_handles();
1842 if let Some((inlined, num_bytes, num_handles)) =
1843 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1844 {
1845 let member_inline_size =
1846 <Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1847 if inlined != (member_inline_size <= 4) {
1848 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1849 }
1850 let inner_offset;
1851 let mut inner_depth = depth.clone();
1852 if inlined {
1853 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1854 inner_offset = next_offset;
1855 } else {
1856 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1857 inner_depth.increment()?;
1858 }
1859 let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
1860 fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
1861 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1862 {
1863 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1864 }
1865 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1866 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1867 }
1868 }
1869
1870 next_offset += envelope_size;
1871 _next_ordinal_to_read += 1;
1872 if next_offset >= end_offset {
1873 return Ok(());
1874 }
1875
1876 while _next_ordinal_to_read < 2 {
1878 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1879 _next_ordinal_to_read += 1;
1880 next_offset += envelope_size;
1881 }
1882
1883 let next_out_of_line = decoder.next_out_of_line();
1884 let handles_before = decoder.remaining_handles();
1885 if let Some((inlined, num_bytes, num_handles)) =
1886 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1887 {
1888 let member_inline_size =
1889 <ThreadDetailsInterest as fidl::encoding::TypeMarker>::inline_size(
1890 decoder.context,
1891 );
1892 if inlined != (member_inline_size <= 4) {
1893 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1894 }
1895 let inner_offset;
1896 let mut inner_depth = depth.clone();
1897 if inlined {
1898 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1899 inner_offset = next_offset;
1900 } else {
1901 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1902 inner_depth.increment()?;
1903 }
1904 let val_ref =
1905 self.interest.get_or_insert_with(|| fidl::new_empty!(ThreadDetailsInterest, D));
1906 fidl::decode!(
1907 ThreadDetailsInterest,
1908 D,
1909 val_ref,
1910 decoder,
1911 inner_offset,
1912 inner_depth
1913 )?;
1914 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1915 {
1916 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1917 }
1918 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1919 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1920 }
1921 }
1922
1923 next_offset += envelope_size;
1924
1925 while next_offset < end_offset {
1927 _next_ordinal_to_read += 1;
1928 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1929 next_offset += envelope_size;
1930 }
1931
1932 Ok(())
1933 }
1934 }
1935
1936 impl MinidumpOptions {
1937 #[inline(always)]
1938 fn max_ordinal_present(&self) -> u64 {
1939 if let Some(_) = self.filter {
1940 return 1;
1941 }
1942 0
1943 }
1944 }
1945
1946 impl fidl::encoding::ValueTypeMarker for MinidumpOptions {
1947 type Borrowed<'a> = &'a Self;
1948 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1949 value
1950 }
1951 }
1952
1953 unsafe impl fidl::encoding::TypeMarker for MinidumpOptions {
1954 type Owned = Self;
1955
1956 #[inline(always)]
1957 fn inline_align(_context: fidl::encoding::Context) -> usize {
1958 8
1959 }
1960
1961 #[inline(always)]
1962 fn inline_size(_context: fidl::encoding::Context) -> usize {
1963 16
1964 }
1965 }
1966
1967 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MinidumpOptions, D>
1968 for &MinidumpOptions
1969 {
1970 unsafe fn encode(
1971 self,
1972 encoder: &mut fidl::encoding::Encoder<'_, D>,
1973 offset: usize,
1974 mut depth: fidl::encoding::Depth,
1975 ) -> fidl::Result<()> {
1976 encoder.debug_check_bounds::<MinidumpOptions>(offset);
1977 let max_ordinal: u64 = self.max_ordinal_present();
1979 encoder.write_num(max_ordinal, offset);
1980 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1981 if max_ordinal == 0 {
1983 return Ok(());
1984 }
1985 depth.increment()?;
1986 let envelope_size = 8;
1987 let bytes_len = max_ordinal as usize * envelope_size;
1988 #[allow(unused_variables)]
1989 let offset = encoder.out_of_line_offset(bytes_len);
1990 let mut _prev_end_offset: usize = 0;
1991 if 1 > max_ordinal {
1992 return Ok(());
1993 }
1994
1995 let cur_offset: usize = (1 - 1) * envelope_size;
1998
1999 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2001
2002 fidl::encoding::encode_in_envelope_optional::<Filter, D>(
2007 self.filter.as_ref().map(<Filter as fidl::encoding::ValueTypeMarker>::borrow),
2008 encoder,
2009 offset + cur_offset,
2010 depth,
2011 )?;
2012
2013 _prev_end_offset = cur_offset + envelope_size;
2014
2015 Ok(())
2016 }
2017 }
2018
2019 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MinidumpOptions {
2020 #[inline(always)]
2021 fn new_empty() -> Self {
2022 Self::default()
2023 }
2024
2025 unsafe fn decode(
2026 &mut self,
2027 decoder: &mut fidl::encoding::Decoder<'_, D>,
2028 offset: usize,
2029 mut depth: fidl::encoding::Depth,
2030 ) -> fidl::Result<()> {
2031 decoder.debug_check_bounds::<Self>(offset);
2032 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2033 None => return Err(fidl::Error::NotNullable),
2034 Some(len) => len,
2035 };
2036 if len == 0 {
2038 return Ok(());
2039 };
2040 depth.increment()?;
2041 let envelope_size = 8;
2042 let bytes_len = len * envelope_size;
2043 let offset = decoder.out_of_line_offset(bytes_len)?;
2044 let mut _next_ordinal_to_read = 0;
2046 let mut next_offset = offset;
2047 let end_offset = offset + bytes_len;
2048 _next_ordinal_to_read += 1;
2049 if next_offset >= end_offset {
2050 return Ok(());
2051 }
2052
2053 while _next_ordinal_to_read < 1 {
2055 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2056 _next_ordinal_to_read += 1;
2057 next_offset += envelope_size;
2058 }
2059
2060 let next_out_of_line = decoder.next_out_of_line();
2061 let handles_before = decoder.remaining_handles();
2062 if let Some((inlined, num_bytes, num_handles)) =
2063 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2064 {
2065 let member_inline_size =
2066 <Filter as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2067 if inlined != (member_inline_size <= 4) {
2068 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2069 }
2070 let inner_offset;
2071 let mut inner_depth = depth.clone();
2072 if inlined {
2073 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2074 inner_offset = next_offset;
2075 } else {
2076 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2077 inner_depth.increment()?;
2078 }
2079 let val_ref = self.filter.get_or_insert_with(|| fidl::new_empty!(Filter, D));
2080 fidl::decode!(Filter, D, val_ref, decoder, inner_offset, inner_depth)?;
2081 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2082 {
2083 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2084 }
2085 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2086 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2087 }
2088 }
2089
2090 next_offset += envelope_size;
2091
2092 while next_offset < end_offset {
2094 _next_ordinal_to_read += 1;
2095 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2096 next_offset += envelope_size;
2097 }
2098
2099 Ok(())
2100 }
2101 }
2102
2103 impl ThreadDetails {
2104 #[inline(always)]
2105 fn max_ordinal_present(&self) -> u64 {
2106 if let Some(_) = self.backtrace {
2107 return 1;
2108 }
2109 0
2110 }
2111 }
2112
2113 impl fidl::encoding::ValueTypeMarker for ThreadDetails {
2114 type Borrowed<'a> = &'a Self;
2115 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2116 value
2117 }
2118 }
2119
2120 unsafe impl fidl::encoding::TypeMarker for ThreadDetails {
2121 type Owned = Self;
2122
2123 #[inline(always)]
2124 fn inline_align(_context: fidl::encoding::Context) -> usize {
2125 8
2126 }
2127
2128 #[inline(always)]
2129 fn inline_size(_context: fidl::encoding::Context) -> usize {
2130 16
2131 }
2132 }
2133
2134 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetails, D>
2135 for &ThreadDetails
2136 {
2137 unsafe fn encode(
2138 self,
2139 encoder: &mut fidl::encoding::Encoder<'_, D>,
2140 offset: usize,
2141 mut depth: fidl::encoding::Depth,
2142 ) -> fidl::Result<()> {
2143 encoder.debug_check_bounds::<ThreadDetails>(offset);
2144 let max_ordinal: u64 = self.max_ordinal_present();
2146 encoder.write_num(max_ordinal, offset);
2147 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2148 if max_ordinal == 0 {
2150 return Ok(());
2151 }
2152 depth.increment()?;
2153 let envelope_size = 8;
2154 let bytes_len = max_ordinal as usize * envelope_size;
2155 #[allow(unused_variables)]
2156 let offset = encoder.out_of_line_offset(bytes_len);
2157 let mut _prev_end_offset: usize = 0;
2158 if 1 > max_ordinal {
2159 return Ok(());
2160 }
2161
2162 let cur_offset: usize = (1 - 1) * envelope_size;
2165
2166 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2168
2169 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2174 self.backtrace.as_ref().map(
2175 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2176 ),
2177 encoder,
2178 offset + cur_offset,
2179 depth,
2180 )?;
2181
2182 _prev_end_offset = cur_offset + envelope_size;
2183
2184 Ok(())
2185 }
2186 }
2187
2188 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetails {
2189 #[inline(always)]
2190 fn new_empty() -> Self {
2191 Self::default()
2192 }
2193
2194 unsafe fn decode(
2195 &mut self,
2196 decoder: &mut fidl::encoding::Decoder<'_, D>,
2197 offset: usize,
2198 mut depth: fidl::encoding::Depth,
2199 ) -> fidl::Result<()> {
2200 decoder.debug_check_bounds::<Self>(offset);
2201 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2202 None => return Err(fidl::Error::NotNullable),
2203 Some(len) => len,
2204 };
2205 if len == 0 {
2207 return Ok(());
2208 };
2209 depth.increment()?;
2210 let envelope_size = 8;
2211 let bytes_len = len * envelope_size;
2212 let offset = decoder.out_of_line_offset(bytes_len)?;
2213 let mut _next_ordinal_to_read = 0;
2215 let mut next_offset = offset;
2216 let end_offset = offset + bytes_len;
2217 _next_ordinal_to_read += 1;
2218 if next_offset >= end_offset {
2219 return Ok(());
2220 }
2221
2222 while _next_ordinal_to_read < 1 {
2224 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2225 _next_ordinal_to_read += 1;
2226 next_offset += envelope_size;
2227 }
2228
2229 let next_out_of_line = decoder.next_out_of_line();
2230 let handles_before = decoder.remaining_handles();
2231 if let Some((inlined, num_bytes, num_handles)) =
2232 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2233 {
2234 let member_inline_size =
2235 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2236 decoder.context,
2237 );
2238 if inlined != (member_inline_size <= 4) {
2239 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2240 }
2241 let inner_offset;
2242 let mut inner_depth = depth.clone();
2243 if inlined {
2244 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2245 inner_offset = next_offset;
2246 } else {
2247 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2248 inner_depth.increment()?;
2249 }
2250 let val_ref = self
2251 .backtrace
2252 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2253 fidl::decode!(
2254 fidl::encoding::UnboundedString,
2255 D,
2256 val_ref,
2257 decoder,
2258 inner_offset,
2259 inner_depth
2260 )?;
2261 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2262 {
2263 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2264 }
2265 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2266 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2267 }
2268 }
2269
2270 next_offset += envelope_size;
2271
2272 while next_offset < end_offset {
2274 _next_ordinal_to_read += 1;
2275 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2276 next_offset += envelope_size;
2277 }
2278
2279 Ok(())
2280 }
2281 }
2282
2283 impl ThreadDetailsInterest {
2284 #[inline(always)]
2285 fn max_ordinal_present(&self) -> u64 {
2286 if let Some(_) = self.backtrace {
2287 return 1;
2288 }
2289 0
2290 }
2291 }
2292
2293 impl fidl::encoding::ValueTypeMarker for ThreadDetailsInterest {
2294 type Borrowed<'a> = &'a Self;
2295 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2296 value
2297 }
2298 }
2299
2300 unsafe impl fidl::encoding::TypeMarker for ThreadDetailsInterest {
2301 type Owned = Self;
2302
2303 #[inline(always)]
2304 fn inline_align(_context: fidl::encoding::Context) -> usize {
2305 8
2306 }
2307
2308 #[inline(always)]
2309 fn inline_size(_context: fidl::encoding::Context) -> usize {
2310 16
2311 }
2312 }
2313
2314 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ThreadDetailsInterest, D>
2315 for &ThreadDetailsInterest
2316 {
2317 unsafe fn encode(
2318 self,
2319 encoder: &mut fidl::encoding::Encoder<'_, D>,
2320 offset: usize,
2321 mut depth: fidl::encoding::Depth,
2322 ) -> fidl::Result<()> {
2323 encoder.debug_check_bounds::<ThreadDetailsInterest>(offset);
2324 let max_ordinal: u64 = self.max_ordinal_present();
2326 encoder.write_num(max_ordinal, offset);
2327 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2328 if max_ordinal == 0 {
2330 return Ok(());
2331 }
2332 depth.increment()?;
2333 let envelope_size = 8;
2334 let bytes_len = max_ordinal as usize * envelope_size;
2335 #[allow(unused_variables)]
2336 let offset = encoder.out_of_line_offset(bytes_len);
2337 let mut _prev_end_offset: usize = 0;
2338 if 1 > max_ordinal {
2339 return Ok(());
2340 }
2341
2342 let cur_offset: usize = (1 - 1) * envelope_size;
2345
2346 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2348
2349 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2354 self.backtrace.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2355 encoder,
2356 offset + cur_offset,
2357 depth,
2358 )?;
2359
2360 _prev_end_offset = cur_offset + envelope_size;
2361
2362 Ok(())
2363 }
2364 }
2365
2366 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThreadDetailsInterest {
2367 #[inline(always)]
2368 fn new_empty() -> Self {
2369 Self::default()
2370 }
2371
2372 unsafe fn decode(
2373 &mut self,
2374 decoder: &mut fidl::encoding::Decoder<'_, D>,
2375 offset: usize,
2376 mut depth: fidl::encoding::Depth,
2377 ) -> fidl::Result<()> {
2378 decoder.debug_check_bounds::<Self>(offset);
2379 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2380 None => return Err(fidl::Error::NotNullable),
2381 Some(len) => len,
2382 };
2383 if len == 0 {
2385 return Ok(());
2386 };
2387 depth.increment()?;
2388 let envelope_size = 8;
2389 let bytes_len = len * envelope_size;
2390 let offset = decoder.out_of_line_offset(bytes_len)?;
2391 let mut _next_ordinal_to_read = 0;
2393 let mut next_offset = offset;
2394 let end_offset = offset + bytes_len;
2395 _next_ordinal_to_read += 1;
2396 if next_offset >= end_offset {
2397 return Ok(());
2398 }
2399
2400 while _next_ordinal_to_read < 1 {
2402 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2403 _next_ordinal_to_read += 1;
2404 next_offset += envelope_size;
2405 }
2406
2407 let next_out_of_line = decoder.next_out_of_line();
2408 let handles_before = decoder.remaining_handles();
2409 if let Some((inlined, num_bytes, num_handles)) =
2410 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2411 {
2412 let member_inline_size =
2413 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2414 if inlined != (member_inline_size <= 4) {
2415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2416 }
2417 let inner_offset;
2418 let mut inner_depth = depth.clone();
2419 if inlined {
2420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2421 inner_offset = next_offset;
2422 } else {
2423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2424 inner_depth.increment()?;
2425 }
2426 let val_ref = self.backtrace.get_or_insert_with(|| fidl::new_empty!(bool, D));
2427 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2429 {
2430 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2431 }
2432 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2433 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2434 }
2435 }
2436
2437 next_offset += envelope_size;
2438
2439 while next_offset < end_offset {
2441 _next_ordinal_to_read += 1;
2442 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2443 next_offset += envelope_size;
2444 }
2445
2446 Ok(())
2447 }
2448 }
2449}