1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const COMPONENT_URL_ARG_NAME: &str = "$__url";
12
13pub const MAXIMUM_ENTRIES_PER_BATCH: u16 = 64;
16
17pub const MAXIMUM_RAW_SELECTOR_LENGTH: u16 = 1024;
20
21pub const MAX_DATA_HIERARCHY_DEPTH: u16 = 100;
22
23pub const MAX_LOG_SELECTORS: u8 = 64;
25
26pub const MAX_MONIKER_SEGMENTS: u16 = 25;
27
28pub const MAX_STRING_SELECTOR_LENGTH: u16 = 1024;
29
30pub const MONIKER_ARG_NAME: &str = "$__moniker";
31
32pub const ROLLED_OUT_ARG_NAME: &str = "$__rolled_out";
33
34#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
35#[repr(u8)]
36pub enum DataType {
37 Inspect = 1,
39 Logs = 3,
41}
42
43impl DataType {
44 #[inline]
45 pub fn from_primitive(prim: u8) -> Option<Self> {
46 match prim {
47 1 => Some(Self::Inspect),
48 3 => Some(Self::Logs),
49 _ => None,
50 }
51 }
52
53 #[inline]
54 pub const fn into_primitive(self) -> u8 {
55 self as u8
56 }
57
58 #[deprecated = "Strict enums should not use `is_unknown`"]
59 #[inline]
60 pub fn is_unknown(&self) -> bool {
61 false
62 }
63}
64
65#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
68#[repr(u32)]
69pub enum Format {
70 Json = 1,
73 Text = 2,
75 Cbor = 3,
78 Fxt = 4,
82}
83
84impl Format {
85 #[inline]
86 pub fn from_primitive(prim: u32) -> Option<Self> {
87 match prim {
88 1 => Some(Self::Json),
89 2 => Some(Self::Text),
90 3 => Some(Self::Cbor),
91 4 => Some(Self::Fxt),
92 _ => None,
93 }
94 }
95
96 #[inline]
97 pub const fn into_primitive(self) -> u32 {
98 self as u32
99 }
100
101 #[deprecated = "Strict enums should not use `is_unknown`"]
102 #[inline]
103 pub fn is_unknown(&self) -> bool {
104 false
105 }
106}
107
108#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
111#[repr(u32)]
112pub enum ReaderError {
113 Io = 1,
114}
115
116impl ReaderError {
117 #[inline]
118 pub fn from_primitive(prim: u32) -> Option<Self> {
119 match prim {
120 1 => Some(Self::Io),
121 _ => None,
122 }
123 }
124
125 #[inline]
126 pub const fn into_primitive(self) -> u32 {
127 self as u32
128 }
129
130 #[deprecated = "Strict enums should not use `is_unknown`"]
131 #[inline]
132 pub fn is_unknown(&self) -> bool {
133 false
134 }
135}
136
137#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
139#[repr(u8)]
140pub enum Severity {
141 Trace = 16,
143 Debug = 32,
145 Info = 48,
147 Warn = 64,
149 Error = 80,
151 Fatal = 96,
153}
154
155impl Severity {
156 #[inline]
157 pub fn from_primitive(prim: u8) -> Option<Self> {
158 match prim {
159 16 => Some(Self::Trace),
160 32 => Some(Self::Debug),
161 48 => Some(Self::Info),
162 64 => Some(Self::Warn),
163 80 => Some(Self::Error),
164 96 => Some(Self::Fatal),
165 _ => None,
166 }
167 }
168
169 #[inline]
170 pub const fn into_primitive(self) -> u8 {
171 self as u8
172 }
173
174 #[deprecated = "Strict enums should not use `is_unknown`"]
175 #[inline]
176 pub fn is_unknown(&self) -> bool {
177 false
178 }
179}
180
181#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
183#[repr(u8)]
184pub enum StreamMode {
185 Snapshot = 1,
188 SnapshotThenSubscribe = 2,
192 Subscribe = 3,
195}
196
197impl StreamMode {
198 #[inline]
199 pub fn from_primitive(prim: u8) -> Option<Self> {
200 match prim {
201 1 => Some(Self::Snapshot),
202 2 => Some(Self::SnapshotThenSubscribe),
203 3 => Some(Self::Subscribe),
204 _ => None,
205 }
206 }
207
208 #[inline]
209 pub const fn into_primitive(self) -> u8 {
210 self as u8
211 }
212
213 #[deprecated = "Strict enums should not use `is_unknown`"]
214 #[inline]
215 pub fn is_unknown(&self) -> bool {
216 false
217 }
218}
219
220#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct All;
222
223impl fidl::Persistable for All {}
224
225#[derive(Clone, Debug, PartialEq)]
226pub struct LogInterestSelector {
227 pub selector: ComponentSelector,
229 pub interest: fidl_fuchsia_diagnostics_types::Interest,
231}
232
233impl fidl::Persistable for LogInterestSelector {}
234
235#[derive(Clone, Debug, PartialEq)]
236pub struct LogSettingsRegisterInterestRequest {
237 pub selectors: Vec<LogInterestSelector>,
238}
239
240impl fidl::Persistable for LogSettingsRegisterInterestRequest {}
241
242#[derive(Clone, Debug, PartialEq)]
243pub struct LogSettingsSetInterestRequest {
244 pub selectors: Vec<LogInterestSelector>,
245}
246
247impl fidl::Persistable for LogSettingsSetInterestRequest {}
248
249#[derive(Clone, Debug, PartialEq)]
252pub struct PropertySelector {
253 pub node_path: Vec<StringSelector>,
266 pub target_properties: StringSelector,
272}
273
274impl fidl::Persistable for PropertySelector {}
275
276#[derive(Clone, Debug, PartialEq)]
279pub struct SubtreeSelector {
280 pub node_path: Vec<StringSelector>,
293}
294
295impl fidl::Persistable for SubtreeSelector {}
296
297#[derive(Clone, Debug, Default, PartialEq)]
316pub struct ComponentSelector {
317 pub moniker_segments: Option<Vec<StringSelector>>,
325 #[doc(hidden)]
326 pub __source_breaking: fidl::marker::SourceBreaking,
327}
328
329impl fidl::Persistable for ComponentSelector {}
330
331#[derive(Clone, Debug, Default, PartialEq)]
334pub struct Interest {
335 pub min_severity: Option<Severity>,
340 #[doc(hidden)]
341 pub __source_breaking: fidl::marker::SourceBreaking,
342}
343
344impl fidl::Persistable for Interest {}
345
346#[derive(Clone, Debug, Default, PartialEq)]
347pub struct LogSettingsSetComponentInterestRequest {
348 pub selectors: Option<Vec<LogInterestSelector>>,
350 pub persist: Option<bool>,
353 #[doc(hidden)]
354 pub __source_breaking: fidl::marker::SourceBreaking,
355}
356
357impl fidl::Persistable for LogSettingsSetComponentInterestRequest {}
358
359#[derive(Clone, Debug, Default, PartialEq)]
360pub struct LogStreamOptions {
361 pub mode: Option<StreamMode>,
363 pub include_moniker: Option<bool>,
366 pub include_component_url: Option<bool>,
369 pub include_rolled_out: Option<bool>,
373 #[doc(hidden)]
374 pub __source_breaking: fidl::marker::SourceBreaking,
375}
376
377impl fidl::Persistable for LogStreamOptions {}
378
379#[derive(Clone, Debug, Default, PartialEq)]
381pub struct PerformanceConfiguration {
382 pub max_aggregate_content_size_bytes: Option<u64>,
388 pub batch_retrieval_timeout_seconds: Option<i64>,
397 #[doc(hidden)]
398 pub __source_breaking: fidl::marker::SourceBreaking,
399}
400
401impl fidl::Persistable for PerformanceConfiguration {}
402
403#[derive(Clone, Debug, Default, PartialEq)]
417pub struct Selector {
418 pub component_selector: Option<ComponentSelector>,
421 pub tree_selector: Option<TreeSelector>,
425 pub tree_names: Option<TreeNames>,
431 #[doc(hidden)]
432 pub __source_breaking: fidl::marker::SourceBreaking,
433}
434
435impl fidl::Persistable for Selector {}
436
437#[derive(Clone, Debug, Default, PartialEq)]
439pub struct StreamParameters {
440 pub data_type: Option<DataType>,
444 pub stream_mode: Option<StreamMode>,
448 pub format: Option<Format>,
452 pub client_selector_configuration: Option<ClientSelectorConfiguration>,
457 pub batch_retrieval_timeout_seconds: Option<i64>,
466 pub performance_configuration: Option<PerformanceConfiguration>,
469 #[doc(hidden)]
470 pub __source_breaking: fidl::marker::SourceBreaking,
471}
472
473impl fidl::Persistable for StreamParameters {}
474
475#[derive(Clone, Debug)]
476pub enum ClientSelectorConfiguration {
477 Selectors(Vec<SelectorArgument>),
481 SelectAll(bool),
484 #[doc(hidden)]
485 __SourceBreaking { unknown_ordinal: u64 },
486}
487
488#[macro_export]
490macro_rules! ClientSelectorConfigurationUnknown {
491 () => {
492 _
493 };
494}
495
496impl PartialEq for ClientSelectorConfiguration {
498 fn eq(&self, other: &Self) -> bool {
499 match (self, other) {
500 (Self::Selectors(x), Self::Selectors(y)) => *x == *y,
501 (Self::SelectAll(x), Self::SelectAll(y)) => *x == *y,
502 _ => false,
503 }
504 }
505}
506
507impl ClientSelectorConfiguration {
508 #[inline]
509 pub fn ordinal(&self) -> u64 {
510 match *self {
511 Self::Selectors(_) => 1,
512 Self::SelectAll(_) => 2,
513 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
514 }
515 }
516
517 #[inline]
518 pub fn unknown_variant_for_testing() -> Self {
519 Self::__SourceBreaking { unknown_ordinal: 0 }
520 }
521
522 #[inline]
523 pub fn is_unknown(&self) -> bool {
524 match self {
525 Self::__SourceBreaking { .. } => true,
526 _ => false,
527 }
528 }
529}
530
531impl fidl::Persistable for ClientSelectorConfiguration {}
532
533#[derive(Clone, Debug)]
536pub enum SelectorArgument {
537 StructuredSelector(Selector),
540 RawSelector(String),
547 #[doc(hidden)]
548 __SourceBreaking { unknown_ordinal: u64 },
549}
550
551#[macro_export]
553macro_rules! SelectorArgumentUnknown {
554 () => {
555 _
556 };
557}
558
559impl PartialEq for SelectorArgument {
561 fn eq(&self, other: &Self) -> bool {
562 match (self, other) {
563 (Self::StructuredSelector(x), Self::StructuredSelector(y)) => *x == *y,
564 (Self::RawSelector(x), Self::RawSelector(y)) => *x == *y,
565 _ => false,
566 }
567 }
568}
569
570impl SelectorArgument {
571 #[inline]
572 pub fn ordinal(&self) -> u64 {
573 match *self {
574 Self::StructuredSelector(_) => 1,
575 Self::RawSelector(_) => 2,
576 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
577 }
578 }
579
580 #[inline]
581 pub fn unknown_variant_for_testing() -> Self {
582 Self::__SourceBreaking { unknown_ordinal: 0 }
583 }
584
585 #[inline]
586 pub fn is_unknown(&self) -> bool {
587 match self {
588 Self::__SourceBreaking { .. } => true,
589 _ => false,
590 }
591 }
592}
593
594impl fidl::Persistable for SelectorArgument {}
595
596#[derive(Clone, Debug)]
599pub enum StringSelector {
600 StringPattern(String),
620 ExactMatch(String),
621 #[doc(hidden)]
622 __SourceBreaking {
623 unknown_ordinal: u64,
624 },
625}
626
627#[macro_export]
629macro_rules! StringSelectorUnknown {
630 () => {
631 _
632 };
633}
634
635impl PartialEq for StringSelector {
637 fn eq(&self, other: &Self) -> bool {
638 match (self, other) {
639 (Self::StringPattern(x), Self::StringPattern(y)) => *x == *y,
640 (Self::ExactMatch(x), Self::ExactMatch(y)) => *x == *y,
641 _ => false,
642 }
643 }
644}
645
646impl StringSelector {
647 #[inline]
648 pub fn ordinal(&self) -> u64 {
649 match *self {
650 Self::StringPattern(_) => 1,
651 Self::ExactMatch(_) => 2,
652 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
653 }
654 }
655
656 #[inline]
657 pub fn unknown_variant_for_testing() -> Self {
658 Self::__SourceBreaking { unknown_ordinal: 0 }
659 }
660
661 #[inline]
662 pub fn is_unknown(&self) -> bool {
663 match self {
664 Self::__SourceBreaking { .. } => true,
665 _ => false,
666 }
667 }
668}
669
670impl fidl::Persistable for StringSelector {}
671
672#[derive(Clone, Debug)]
676pub enum TreeNames {
677 Some(Vec<String>),
679 All(All),
682 #[doc(hidden)]
683 __SourceBreaking { unknown_ordinal: u64 },
684}
685
686#[macro_export]
688macro_rules! TreeNamesUnknown {
689 () => {
690 _
691 };
692}
693
694impl PartialEq for TreeNames {
696 fn eq(&self, other: &Self) -> bool {
697 match (self, other) {
698 (Self::Some(x), Self::Some(y)) => *x == *y,
699 (Self::All(x), Self::All(y)) => *x == *y,
700 _ => false,
701 }
702 }
703}
704
705impl TreeNames {
706 #[inline]
707 pub fn ordinal(&self) -> u64 {
708 match *self {
709 Self::Some(_) => 1,
710 Self::All(_) => 2,
711 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
712 }
713 }
714
715 #[inline]
716 pub fn unknown_variant_for_testing() -> Self {
717 Self::__SourceBreaking { unknown_ordinal: 0 }
718 }
719
720 #[inline]
721 pub fn is_unknown(&self) -> bool {
722 match self {
723 Self::__SourceBreaking { .. } => true,
724 _ => false,
725 }
726 }
727}
728
729impl fidl::Persistable for TreeNames {}
730
731#[derive(Clone, Debug)]
734pub enum TreeSelector {
735 SubtreeSelector(SubtreeSelector),
738 PropertySelector(PropertySelector),
741 #[doc(hidden)]
742 __SourceBreaking { unknown_ordinal: u64 },
743}
744
745#[macro_export]
747macro_rules! TreeSelectorUnknown {
748 () => {
749 _
750 };
751}
752
753impl PartialEq for TreeSelector {
755 fn eq(&self, other: &Self) -> bool {
756 match (self, other) {
757 (Self::SubtreeSelector(x), Self::SubtreeSelector(y)) => *x == *y,
758 (Self::PropertySelector(x), Self::PropertySelector(y)) => *x == *y,
759 _ => false,
760 }
761 }
762}
763
764impl TreeSelector {
765 #[inline]
766 pub fn ordinal(&self) -> u64 {
767 match *self {
768 Self::SubtreeSelector(_) => 1,
769 Self::PropertySelector(_) => 2,
770 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
771 }
772 }
773
774 #[inline]
775 pub fn unknown_variant_for_testing() -> Self {
776 Self::__SourceBreaking { unknown_ordinal: 0 }
777 }
778
779 #[inline]
780 pub fn is_unknown(&self) -> bool {
781 match self {
782 Self::__SourceBreaking { .. } => true,
783 _ => false,
784 }
785 }
786}
787
788impl fidl::Persistable for TreeSelector {}
789
790mod internal {
791 use super::*;
792 unsafe impl fidl::encoding::TypeMarker for DataType {
793 type Owned = Self;
794
795 #[inline(always)]
796 fn inline_align(_context: fidl::encoding::Context) -> usize {
797 std::mem::align_of::<u8>()
798 }
799
800 #[inline(always)]
801 fn inline_size(_context: fidl::encoding::Context) -> usize {
802 std::mem::size_of::<u8>()
803 }
804
805 #[inline(always)]
806 fn encode_is_copy() -> bool {
807 true
808 }
809
810 #[inline(always)]
811 fn decode_is_copy() -> bool {
812 false
813 }
814 }
815
816 impl fidl::encoding::ValueTypeMarker for DataType {
817 type Borrowed<'a> = Self;
818 #[inline(always)]
819 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
820 *value
821 }
822 }
823
824 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DataType {
825 #[inline]
826 unsafe fn encode(
827 self,
828 encoder: &mut fidl::encoding::Encoder<'_, D>,
829 offset: usize,
830 _depth: fidl::encoding::Depth,
831 ) -> fidl::Result<()> {
832 encoder.debug_check_bounds::<Self>(offset);
833 encoder.write_num(self.into_primitive(), offset);
834 Ok(())
835 }
836 }
837
838 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataType {
839 #[inline(always)]
840 fn new_empty() -> Self {
841 Self::Inspect
842 }
843
844 #[inline]
845 unsafe fn decode(
846 &mut self,
847 decoder: &mut fidl::encoding::Decoder<'_, D>,
848 offset: usize,
849 _depth: fidl::encoding::Depth,
850 ) -> fidl::Result<()> {
851 decoder.debug_check_bounds::<Self>(offset);
852 let prim = decoder.read_num::<u8>(offset);
853
854 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
855 Ok(())
856 }
857 }
858 unsafe impl fidl::encoding::TypeMarker for Format {
859 type Owned = Self;
860
861 #[inline(always)]
862 fn inline_align(_context: fidl::encoding::Context) -> usize {
863 std::mem::align_of::<u32>()
864 }
865
866 #[inline(always)]
867 fn inline_size(_context: fidl::encoding::Context) -> usize {
868 std::mem::size_of::<u32>()
869 }
870
871 #[inline(always)]
872 fn encode_is_copy() -> bool {
873 true
874 }
875
876 #[inline(always)]
877 fn decode_is_copy() -> bool {
878 false
879 }
880 }
881
882 impl fidl::encoding::ValueTypeMarker for Format {
883 type Borrowed<'a> = Self;
884 #[inline(always)]
885 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
886 *value
887 }
888 }
889
890 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Format {
891 #[inline]
892 unsafe fn encode(
893 self,
894 encoder: &mut fidl::encoding::Encoder<'_, D>,
895 offset: usize,
896 _depth: fidl::encoding::Depth,
897 ) -> fidl::Result<()> {
898 encoder.debug_check_bounds::<Self>(offset);
899 encoder.write_num(self.into_primitive(), offset);
900 Ok(())
901 }
902 }
903
904 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Format {
905 #[inline(always)]
906 fn new_empty() -> Self {
907 Self::Json
908 }
909
910 #[inline]
911 unsafe fn decode(
912 &mut self,
913 decoder: &mut fidl::encoding::Decoder<'_, D>,
914 offset: usize,
915 _depth: fidl::encoding::Depth,
916 ) -> fidl::Result<()> {
917 decoder.debug_check_bounds::<Self>(offset);
918 let prim = decoder.read_num::<u32>(offset);
919
920 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
921 Ok(())
922 }
923 }
924 unsafe impl fidl::encoding::TypeMarker for ReaderError {
925 type Owned = Self;
926
927 #[inline(always)]
928 fn inline_align(_context: fidl::encoding::Context) -> usize {
929 std::mem::align_of::<u32>()
930 }
931
932 #[inline(always)]
933 fn inline_size(_context: fidl::encoding::Context) -> usize {
934 std::mem::size_of::<u32>()
935 }
936
937 #[inline(always)]
938 fn encode_is_copy() -> bool {
939 true
940 }
941
942 #[inline(always)]
943 fn decode_is_copy() -> bool {
944 false
945 }
946 }
947
948 impl fidl::encoding::ValueTypeMarker for ReaderError {
949 type Borrowed<'a> = Self;
950 #[inline(always)]
951 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
952 *value
953 }
954 }
955
956 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ReaderError {
957 #[inline]
958 unsafe fn encode(
959 self,
960 encoder: &mut fidl::encoding::Encoder<'_, D>,
961 offset: usize,
962 _depth: fidl::encoding::Depth,
963 ) -> fidl::Result<()> {
964 encoder.debug_check_bounds::<Self>(offset);
965 encoder.write_num(self.into_primitive(), offset);
966 Ok(())
967 }
968 }
969
970 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReaderError {
971 #[inline(always)]
972 fn new_empty() -> Self {
973 Self::Io
974 }
975
976 #[inline]
977 unsafe fn decode(
978 &mut self,
979 decoder: &mut fidl::encoding::Decoder<'_, D>,
980 offset: usize,
981 _depth: fidl::encoding::Depth,
982 ) -> fidl::Result<()> {
983 decoder.debug_check_bounds::<Self>(offset);
984 let prim = decoder.read_num::<u32>(offset);
985
986 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
987 Ok(())
988 }
989 }
990 unsafe impl fidl::encoding::TypeMarker for Severity {
991 type Owned = Self;
992
993 #[inline(always)]
994 fn inline_align(_context: fidl::encoding::Context) -> usize {
995 std::mem::align_of::<u8>()
996 }
997
998 #[inline(always)]
999 fn inline_size(_context: fidl::encoding::Context) -> usize {
1000 std::mem::size_of::<u8>()
1001 }
1002
1003 #[inline(always)]
1004 fn encode_is_copy() -> bool {
1005 true
1006 }
1007
1008 #[inline(always)]
1009 fn decode_is_copy() -> bool {
1010 false
1011 }
1012 }
1013
1014 impl fidl::encoding::ValueTypeMarker for Severity {
1015 type Borrowed<'a> = Self;
1016 #[inline(always)]
1017 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1018 *value
1019 }
1020 }
1021
1022 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Severity {
1023 #[inline]
1024 unsafe fn encode(
1025 self,
1026 encoder: &mut fidl::encoding::Encoder<'_, D>,
1027 offset: usize,
1028 _depth: fidl::encoding::Depth,
1029 ) -> fidl::Result<()> {
1030 encoder.debug_check_bounds::<Self>(offset);
1031 encoder.write_num(self.into_primitive(), offset);
1032 Ok(())
1033 }
1034 }
1035
1036 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Severity {
1037 #[inline(always)]
1038 fn new_empty() -> Self {
1039 Self::Trace
1040 }
1041
1042 #[inline]
1043 unsafe fn decode(
1044 &mut self,
1045 decoder: &mut fidl::encoding::Decoder<'_, D>,
1046 offset: usize,
1047 _depth: fidl::encoding::Depth,
1048 ) -> fidl::Result<()> {
1049 decoder.debug_check_bounds::<Self>(offset);
1050 let prim = decoder.read_num::<u8>(offset);
1051
1052 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1053 Ok(())
1054 }
1055 }
1056 unsafe impl fidl::encoding::TypeMarker for StreamMode {
1057 type Owned = Self;
1058
1059 #[inline(always)]
1060 fn inline_align(_context: fidl::encoding::Context) -> usize {
1061 std::mem::align_of::<u8>()
1062 }
1063
1064 #[inline(always)]
1065 fn inline_size(_context: fidl::encoding::Context) -> usize {
1066 std::mem::size_of::<u8>()
1067 }
1068
1069 #[inline(always)]
1070 fn encode_is_copy() -> bool {
1071 true
1072 }
1073
1074 #[inline(always)]
1075 fn decode_is_copy() -> bool {
1076 false
1077 }
1078 }
1079
1080 impl fidl::encoding::ValueTypeMarker for StreamMode {
1081 type Borrowed<'a> = Self;
1082 #[inline(always)]
1083 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1084 *value
1085 }
1086 }
1087
1088 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StreamMode {
1089 #[inline]
1090 unsafe fn encode(
1091 self,
1092 encoder: &mut fidl::encoding::Encoder<'_, D>,
1093 offset: usize,
1094 _depth: fidl::encoding::Depth,
1095 ) -> fidl::Result<()> {
1096 encoder.debug_check_bounds::<Self>(offset);
1097 encoder.write_num(self.into_primitive(), offset);
1098 Ok(())
1099 }
1100 }
1101
1102 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamMode {
1103 #[inline(always)]
1104 fn new_empty() -> Self {
1105 Self::Snapshot
1106 }
1107
1108 #[inline]
1109 unsafe fn decode(
1110 &mut self,
1111 decoder: &mut fidl::encoding::Decoder<'_, D>,
1112 offset: usize,
1113 _depth: fidl::encoding::Depth,
1114 ) -> fidl::Result<()> {
1115 decoder.debug_check_bounds::<Self>(offset);
1116 let prim = decoder.read_num::<u8>(offset);
1117
1118 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1119 Ok(())
1120 }
1121 }
1122
1123 impl fidl::encoding::ValueTypeMarker for All {
1124 type Borrowed<'a> = &'a Self;
1125 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1126 value
1127 }
1128 }
1129
1130 unsafe impl fidl::encoding::TypeMarker for All {
1131 type Owned = Self;
1132
1133 #[inline(always)]
1134 fn inline_align(_context: fidl::encoding::Context) -> usize {
1135 1
1136 }
1137
1138 #[inline(always)]
1139 fn inline_size(_context: fidl::encoding::Context) -> usize {
1140 1
1141 }
1142 }
1143
1144 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<All, D> for &All {
1145 #[inline]
1146 unsafe fn encode(
1147 self,
1148 encoder: &mut fidl::encoding::Encoder<'_, D>,
1149 offset: usize,
1150 _depth: fidl::encoding::Depth,
1151 ) -> fidl::Result<()> {
1152 encoder.debug_check_bounds::<All>(offset);
1153 encoder.write_num(0u8, offset);
1154 Ok(())
1155 }
1156 }
1157
1158 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for All {
1159 #[inline(always)]
1160 fn new_empty() -> Self {
1161 Self
1162 }
1163
1164 #[inline]
1165 unsafe fn decode(
1166 &mut self,
1167 decoder: &mut fidl::encoding::Decoder<'_, D>,
1168 offset: usize,
1169 _depth: fidl::encoding::Depth,
1170 ) -> fidl::Result<()> {
1171 decoder.debug_check_bounds::<Self>(offset);
1172 match decoder.read_num::<u8>(offset) {
1173 0 => Ok(()),
1174 _ => Err(fidl::Error::Invalid),
1175 }
1176 }
1177 }
1178
1179 impl fidl::encoding::ValueTypeMarker for LogInterestSelector {
1180 type Borrowed<'a> = &'a Self;
1181 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1182 value
1183 }
1184 }
1185
1186 unsafe impl fidl::encoding::TypeMarker for LogInterestSelector {
1187 type Owned = Self;
1188
1189 #[inline(always)]
1190 fn inline_align(_context: fidl::encoding::Context) -> usize {
1191 8
1192 }
1193
1194 #[inline(always)]
1195 fn inline_size(_context: fidl::encoding::Context) -> usize {
1196 32
1197 }
1198 }
1199
1200 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogInterestSelector, D>
1201 for &LogInterestSelector
1202 {
1203 #[inline]
1204 unsafe fn encode(
1205 self,
1206 encoder: &mut fidl::encoding::Encoder<'_, D>,
1207 offset: usize,
1208 _depth: fidl::encoding::Depth,
1209 ) -> fidl::Result<()> {
1210 encoder.debug_check_bounds::<LogInterestSelector>(offset);
1211 fidl::encoding::Encode::<LogInterestSelector, D>::encode(
1213 (
1214 <ComponentSelector as fidl::encoding::ValueTypeMarker>::borrow(&self.selector),
1215 <fidl_fuchsia_diagnostics_types::Interest as fidl::encoding::ValueTypeMarker>::borrow(&self.interest),
1216 ),
1217 encoder, offset, _depth
1218 )
1219 }
1220 }
1221 unsafe impl<
1222 D: fidl::encoding::ResourceDialect,
1223 T0: fidl::encoding::Encode<ComponentSelector, D>,
1224 T1: fidl::encoding::Encode<fidl_fuchsia_diagnostics_types::Interest, D>,
1225 > fidl::encoding::Encode<LogInterestSelector, D> for (T0, T1)
1226 {
1227 #[inline]
1228 unsafe fn encode(
1229 self,
1230 encoder: &mut fidl::encoding::Encoder<'_, D>,
1231 offset: usize,
1232 depth: fidl::encoding::Depth,
1233 ) -> fidl::Result<()> {
1234 encoder.debug_check_bounds::<LogInterestSelector>(offset);
1235 self.0.encode(encoder, offset + 0, depth)?;
1239 self.1.encode(encoder, offset + 16, depth)?;
1240 Ok(())
1241 }
1242 }
1243
1244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogInterestSelector {
1245 #[inline(always)]
1246 fn new_empty() -> Self {
1247 Self {
1248 selector: fidl::new_empty!(ComponentSelector, D),
1249 interest: fidl::new_empty!(fidl_fuchsia_diagnostics_types::Interest, D),
1250 }
1251 }
1252
1253 #[inline]
1254 unsafe fn decode(
1255 &mut self,
1256 decoder: &mut fidl::encoding::Decoder<'_, D>,
1257 offset: usize,
1258 _depth: fidl::encoding::Depth,
1259 ) -> fidl::Result<()> {
1260 decoder.debug_check_bounds::<Self>(offset);
1261 fidl::decode!(ComponentSelector, D, &mut self.selector, decoder, offset + 0, _depth)?;
1263 fidl::decode!(
1264 fidl_fuchsia_diagnostics_types::Interest,
1265 D,
1266 &mut self.interest,
1267 decoder,
1268 offset + 16,
1269 _depth
1270 )?;
1271 Ok(())
1272 }
1273 }
1274
1275 impl fidl::encoding::ValueTypeMarker for LogSettingsRegisterInterestRequest {
1276 type Borrowed<'a> = &'a Self;
1277 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1278 value
1279 }
1280 }
1281
1282 unsafe impl fidl::encoding::TypeMarker for LogSettingsRegisterInterestRequest {
1283 type Owned = Self;
1284
1285 #[inline(always)]
1286 fn inline_align(_context: fidl::encoding::Context) -> usize {
1287 8
1288 }
1289
1290 #[inline(always)]
1291 fn inline_size(_context: fidl::encoding::Context) -> usize {
1292 16
1293 }
1294 }
1295
1296 unsafe impl<D: fidl::encoding::ResourceDialect>
1297 fidl::encoding::Encode<LogSettingsRegisterInterestRequest, D>
1298 for &LogSettingsRegisterInterestRequest
1299 {
1300 #[inline]
1301 unsafe fn encode(
1302 self,
1303 encoder: &mut fidl::encoding::Encoder<'_, D>,
1304 offset: usize,
1305 _depth: fidl::encoding::Depth,
1306 ) -> fidl::Result<()> {
1307 encoder.debug_check_bounds::<LogSettingsRegisterInterestRequest>(offset);
1308 fidl::encoding::Encode::<LogSettingsRegisterInterestRequest, D>::encode(
1310 (
1311 <fidl::encoding::Vector<LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.selectors),
1312 ),
1313 encoder, offset, _depth
1314 )
1315 }
1316 }
1317 unsafe impl<
1318 D: fidl::encoding::ResourceDialect,
1319 T0: fidl::encoding::Encode<fidl::encoding::Vector<LogInterestSelector, 64>, D>,
1320 > fidl::encoding::Encode<LogSettingsRegisterInterestRequest, D> for (T0,)
1321 {
1322 #[inline]
1323 unsafe fn encode(
1324 self,
1325 encoder: &mut fidl::encoding::Encoder<'_, D>,
1326 offset: usize,
1327 depth: fidl::encoding::Depth,
1328 ) -> fidl::Result<()> {
1329 encoder.debug_check_bounds::<LogSettingsRegisterInterestRequest>(offset);
1330 self.0.encode(encoder, offset + 0, depth)?;
1334 Ok(())
1335 }
1336 }
1337
1338 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1339 for LogSettingsRegisterInterestRequest
1340 {
1341 #[inline(always)]
1342 fn new_empty() -> Self {
1343 Self { selectors: fidl::new_empty!(fidl::encoding::Vector<LogInterestSelector, 64>, D) }
1344 }
1345
1346 #[inline]
1347 unsafe fn decode(
1348 &mut self,
1349 decoder: &mut fidl::encoding::Decoder<'_, D>,
1350 offset: usize,
1351 _depth: fidl::encoding::Depth,
1352 ) -> fidl::Result<()> {
1353 decoder.debug_check_bounds::<Self>(offset);
1354 fidl::decode!(fidl::encoding::Vector<LogInterestSelector, 64>, D, &mut self.selectors, decoder, offset + 0, _depth)?;
1356 Ok(())
1357 }
1358 }
1359
1360 impl fidl::encoding::ValueTypeMarker for LogSettingsSetInterestRequest {
1361 type Borrowed<'a> = &'a Self;
1362 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1363 value
1364 }
1365 }
1366
1367 unsafe impl fidl::encoding::TypeMarker for LogSettingsSetInterestRequest {
1368 type Owned = Self;
1369
1370 #[inline(always)]
1371 fn inline_align(_context: fidl::encoding::Context) -> usize {
1372 8
1373 }
1374
1375 #[inline(always)]
1376 fn inline_size(_context: fidl::encoding::Context) -> usize {
1377 16
1378 }
1379 }
1380
1381 unsafe impl<D: fidl::encoding::ResourceDialect>
1382 fidl::encoding::Encode<LogSettingsSetInterestRequest, D>
1383 for &LogSettingsSetInterestRequest
1384 {
1385 #[inline]
1386 unsafe fn encode(
1387 self,
1388 encoder: &mut fidl::encoding::Encoder<'_, D>,
1389 offset: usize,
1390 _depth: fidl::encoding::Depth,
1391 ) -> fidl::Result<()> {
1392 encoder.debug_check_bounds::<LogSettingsSetInterestRequest>(offset);
1393 fidl::encoding::Encode::<LogSettingsSetInterestRequest, D>::encode(
1395 (
1396 <fidl::encoding::Vector<LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.selectors),
1397 ),
1398 encoder, offset, _depth
1399 )
1400 }
1401 }
1402 unsafe impl<
1403 D: fidl::encoding::ResourceDialect,
1404 T0: fidl::encoding::Encode<fidl::encoding::Vector<LogInterestSelector, 64>, D>,
1405 > fidl::encoding::Encode<LogSettingsSetInterestRequest, D> for (T0,)
1406 {
1407 #[inline]
1408 unsafe fn encode(
1409 self,
1410 encoder: &mut fidl::encoding::Encoder<'_, D>,
1411 offset: usize,
1412 depth: fidl::encoding::Depth,
1413 ) -> fidl::Result<()> {
1414 encoder.debug_check_bounds::<LogSettingsSetInterestRequest>(offset);
1415 self.0.encode(encoder, offset + 0, depth)?;
1419 Ok(())
1420 }
1421 }
1422
1423 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1424 for LogSettingsSetInterestRequest
1425 {
1426 #[inline(always)]
1427 fn new_empty() -> Self {
1428 Self { selectors: fidl::new_empty!(fidl::encoding::Vector<LogInterestSelector, 64>, D) }
1429 }
1430
1431 #[inline]
1432 unsafe fn decode(
1433 &mut self,
1434 decoder: &mut fidl::encoding::Decoder<'_, D>,
1435 offset: usize,
1436 _depth: fidl::encoding::Depth,
1437 ) -> fidl::Result<()> {
1438 decoder.debug_check_bounds::<Self>(offset);
1439 fidl::decode!(fidl::encoding::Vector<LogInterestSelector, 64>, D, &mut self.selectors, decoder, offset + 0, _depth)?;
1441 Ok(())
1442 }
1443 }
1444
1445 impl fidl::encoding::ValueTypeMarker for PropertySelector {
1446 type Borrowed<'a> = &'a Self;
1447 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1448 value
1449 }
1450 }
1451
1452 unsafe impl fidl::encoding::TypeMarker for PropertySelector {
1453 type Owned = Self;
1454
1455 #[inline(always)]
1456 fn inline_align(_context: fidl::encoding::Context) -> usize {
1457 8
1458 }
1459
1460 #[inline(always)]
1461 fn inline_size(_context: fidl::encoding::Context) -> usize {
1462 32
1463 }
1464 }
1465
1466 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PropertySelector, D>
1467 for &PropertySelector
1468 {
1469 #[inline]
1470 unsafe fn encode(
1471 self,
1472 encoder: &mut fidl::encoding::Encoder<'_, D>,
1473 offset: usize,
1474 _depth: fidl::encoding::Depth,
1475 ) -> fidl::Result<()> {
1476 encoder.debug_check_bounds::<PropertySelector>(offset);
1477 fidl::encoding::Encode::<PropertySelector, D>::encode(
1479 (
1480 <fidl::encoding::Vector<StringSelector, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.node_path),
1481 <StringSelector as fidl::encoding::ValueTypeMarker>::borrow(&self.target_properties),
1482 ),
1483 encoder, offset, _depth
1484 )
1485 }
1486 }
1487 unsafe impl<
1488 D: fidl::encoding::ResourceDialect,
1489 T0: fidl::encoding::Encode<fidl::encoding::Vector<StringSelector, 100>, D>,
1490 T1: fidl::encoding::Encode<StringSelector, D>,
1491 > fidl::encoding::Encode<PropertySelector, D> for (T0, T1)
1492 {
1493 #[inline]
1494 unsafe fn encode(
1495 self,
1496 encoder: &mut fidl::encoding::Encoder<'_, D>,
1497 offset: usize,
1498 depth: fidl::encoding::Depth,
1499 ) -> fidl::Result<()> {
1500 encoder.debug_check_bounds::<PropertySelector>(offset);
1501 self.0.encode(encoder, offset + 0, depth)?;
1505 self.1.encode(encoder, offset + 16, depth)?;
1506 Ok(())
1507 }
1508 }
1509
1510 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PropertySelector {
1511 #[inline(always)]
1512 fn new_empty() -> Self {
1513 Self {
1514 node_path: fidl::new_empty!(fidl::encoding::Vector<StringSelector, 100>, D),
1515 target_properties: fidl::new_empty!(StringSelector, D),
1516 }
1517 }
1518
1519 #[inline]
1520 unsafe fn decode(
1521 &mut self,
1522 decoder: &mut fidl::encoding::Decoder<'_, D>,
1523 offset: usize,
1524 _depth: fidl::encoding::Depth,
1525 ) -> fidl::Result<()> {
1526 decoder.debug_check_bounds::<Self>(offset);
1527 fidl::decode!(fidl::encoding::Vector<StringSelector, 100>, D, &mut self.node_path, decoder, offset + 0, _depth)?;
1529 fidl::decode!(
1530 StringSelector,
1531 D,
1532 &mut self.target_properties,
1533 decoder,
1534 offset + 16,
1535 _depth
1536 )?;
1537 Ok(())
1538 }
1539 }
1540
1541 impl fidl::encoding::ValueTypeMarker for SubtreeSelector {
1542 type Borrowed<'a> = &'a Self;
1543 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1544 value
1545 }
1546 }
1547
1548 unsafe impl fidl::encoding::TypeMarker for SubtreeSelector {
1549 type Owned = Self;
1550
1551 #[inline(always)]
1552 fn inline_align(_context: fidl::encoding::Context) -> usize {
1553 8
1554 }
1555
1556 #[inline(always)]
1557 fn inline_size(_context: fidl::encoding::Context) -> usize {
1558 16
1559 }
1560 }
1561
1562 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SubtreeSelector, D>
1563 for &SubtreeSelector
1564 {
1565 #[inline]
1566 unsafe fn encode(
1567 self,
1568 encoder: &mut fidl::encoding::Encoder<'_, D>,
1569 offset: usize,
1570 _depth: fidl::encoding::Depth,
1571 ) -> fidl::Result<()> {
1572 encoder.debug_check_bounds::<SubtreeSelector>(offset);
1573 fidl::encoding::Encode::<SubtreeSelector, D>::encode(
1575 (
1576 <fidl::encoding::Vector<StringSelector, 100> as fidl::encoding::ValueTypeMarker>::borrow(&self.node_path),
1577 ),
1578 encoder, offset, _depth
1579 )
1580 }
1581 }
1582 unsafe impl<
1583 D: fidl::encoding::ResourceDialect,
1584 T0: fidl::encoding::Encode<fidl::encoding::Vector<StringSelector, 100>, D>,
1585 > fidl::encoding::Encode<SubtreeSelector, D> for (T0,)
1586 {
1587 #[inline]
1588 unsafe fn encode(
1589 self,
1590 encoder: &mut fidl::encoding::Encoder<'_, D>,
1591 offset: usize,
1592 depth: fidl::encoding::Depth,
1593 ) -> fidl::Result<()> {
1594 encoder.debug_check_bounds::<SubtreeSelector>(offset);
1595 self.0.encode(encoder, offset + 0, depth)?;
1599 Ok(())
1600 }
1601 }
1602
1603 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SubtreeSelector {
1604 #[inline(always)]
1605 fn new_empty() -> Self {
1606 Self { node_path: fidl::new_empty!(fidl::encoding::Vector<StringSelector, 100>, D) }
1607 }
1608
1609 #[inline]
1610 unsafe fn decode(
1611 &mut self,
1612 decoder: &mut fidl::encoding::Decoder<'_, D>,
1613 offset: usize,
1614 _depth: fidl::encoding::Depth,
1615 ) -> fidl::Result<()> {
1616 decoder.debug_check_bounds::<Self>(offset);
1617 fidl::decode!(fidl::encoding::Vector<StringSelector, 100>, D, &mut self.node_path, decoder, offset + 0, _depth)?;
1619 Ok(())
1620 }
1621 }
1622
1623 impl ComponentSelector {
1624 #[inline(always)]
1625 fn max_ordinal_present(&self) -> u64 {
1626 if let Some(_) = self.moniker_segments {
1627 return 1;
1628 }
1629 0
1630 }
1631 }
1632
1633 impl fidl::encoding::ValueTypeMarker for ComponentSelector {
1634 type Borrowed<'a> = &'a Self;
1635 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1636 value
1637 }
1638 }
1639
1640 unsafe impl fidl::encoding::TypeMarker for ComponentSelector {
1641 type Owned = Self;
1642
1643 #[inline(always)]
1644 fn inline_align(_context: fidl::encoding::Context) -> usize {
1645 8
1646 }
1647
1648 #[inline(always)]
1649 fn inline_size(_context: fidl::encoding::Context) -> usize {
1650 16
1651 }
1652 }
1653
1654 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentSelector, D>
1655 for &ComponentSelector
1656 {
1657 unsafe fn encode(
1658 self,
1659 encoder: &mut fidl::encoding::Encoder<'_, D>,
1660 offset: usize,
1661 mut depth: fidl::encoding::Depth,
1662 ) -> fidl::Result<()> {
1663 encoder.debug_check_bounds::<ComponentSelector>(offset);
1664 let max_ordinal: u64 = self.max_ordinal_present();
1666 encoder.write_num(max_ordinal, offset);
1667 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1668 if max_ordinal == 0 {
1670 return Ok(());
1671 }
1672 depth.increment()?;
1673 let envelope_size = 8;
1674 let bytes_len = max_ordinal as usize * envelope_size;
1675 #[allow(unused_variables)]
1676 let offset = encoder.out_of_line_offset(bytes_len);
1677 let mut _prev_end_offset: usize = 0;
1678 if 1 > max_ordinal {
1679 return Ok(());
1680 }
1681
1682 let cur_offset: usize = (1 - 1) * envelope_size;
1685
1686 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1688
1689 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<StringSelector, 25>, D>(
1694 self.moniker_segments.as_ref().map(<fidl::encoding::Vector<StringSelector, 25> as fidl::encoding::ValueTypeMarker>::borrow),
1695 encoder, offset + cur_offset, depth
1696 )?;
1697
1698 _prev_end_offset = cur_offset + envelope_size;
1699
1700 Ok(())
1701 }
1702 }
1703
1704 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentSelector {
1705 #[inline(always)]
1706 fn new_empty() -> Self {
1707 Self::default()
1708 }
1709
1710 unsafe fn decode(
1711 &mut self,
1712 decoder: &mut fidl::encoding::Decoder<'_, D>,
1713 offset: usize,
1714 mut depth: fidl::encoding::Depth,
1715 ) -> fidl::Result<()> {
1716 decoder.debug_check_bounds::<Self>(offset);
1717 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1718 None => return Err(fidl::Error::NotNullable),
1719 Some(len) => len,
1720 };
1721 if len == 0 {
1723 return Ok(());
1724 };
1725 depth.increment()?;
1726 let envelope_size = 8;
1727 let bytes_len = len * envelope_size;
1728 let offset = decoder.out_of_line_offset(bytes_len)?;
1729 let mut _next_ordinal_to_read = 0;
1731 let mut next_offset = offset;
1732 let end_offset = offset + bytes_len;
1733 _next_ordinal_to_read += 1;
1734 if next_offset >= end_offset {
1735 return Ok(());
1736 }
1737
1738 while _next_ordinal_to_read < 1 {
1740 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1741 _next_ordinal_to_read += 1;
1742 next_offset += envelope_size;
1743 }
1744
1745 let next_out_of_line = decoder.next_out_of_line();
1746 let handles_before = decoder.remaining_handles();
1747 if let Some((inlined, num_bytes, num_handles)) =
1748 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1749 {
1750 let member_inline_size = <fidl::encoding::Vector<StringSelector, 25> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1751 if inlined != (member_inline_size <= 4) {
1752 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1753 }
1754 let inner_offset;
1755 let mut inner_depth = depth.clone();
1756 if inlined {
1757 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1758 inner_offset = next_offset;
1759 } else {
1760 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1761 inner_depth.increment()?;
1762 }
1763 let val_ref = self.moniker_segments.get_or_insert_with(
1764 || fidl::new_empty!(fidl::encoding::Vector<StringSelector, 25>, D),
1765 );
1766 fidl::decode!(fidl::encoding::Vector<StringSelector, 25>, D, val_ref, decoder, inner_offset, inner_depth)?;
1767 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1768 {
1769 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1770 }
1771 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1772 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1773 }
1774 }
1775
1776 next_offset += envelope_size;
1777
1778 while next_offset < end_offset {
1780 _next_ordinal_to_read += 1;
1781 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1782 next_offset += envelope_size;
1783 }
1784
1785 Ok(())
1786 }
1787 }
1788
1789 impl Interest {
1790 #[inline(always)]
1791 fn max_ordinal_present(&self) -> u64 {
1792 if let Some(_) = self.min_severity {
1793 return 1;
1794 }
1795 0
1796 }
1797 }
1798
1799 impl fidl::encoding::ValueTypeMarker for Interest {
1800 type Borrowed<'a> = &'a Self;
1801 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1802 value
1803 }
1804 }
1805
1806 unsafe impl fidl::encoding::TypeMarker for Interest {
1807 type Owned = Self;
1808
1809 #[inline(always)]
1810 fn inline_align(_context: fidl::encoding::Context) -> usize {
1811 8
1812 }
1813
1814 #[inline(always)]
1815 fn inline_size(_context: fidl::encoding::Context) -> usize {
1816 16
1817 }
1818 }
1819
1820 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Interest, D> for &Interest {
1821 unsafe fn encode(
1822 self,
1823 encoder: &mut fidl::encoding::Encoder<'_, D>,
1824 offset: usize,
1825 mut depth: fidl::encoding::Depth,
1826 ) -> fidl::Result<()> {
1827 encoder.debug_check_bounds::<Interest>(offset);
1828 let max_ordinal: u64 = self.max_ordinal_present();
1830 encoder.write_num(max_ordinal, offset);
1831 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1832 if max_ordinal == 0 {
1834 return Ok(());
1835 }
1836 depth.increment()?;
1837 let envelope_size = 8;
1838 let bytes_len = max_ordinal as usize * envelope_size;
1839 #[allow(unused_variables)]
1840 let offset = encoder.out_of_line_offset(bytes_len);
1841 let mut _prev_end_offset: usize = 0;
1842 if 1 > max_ordinal {
1843 return Ok(());
1844 }
1845
1846 let cur_offset: usize = (1 - 1) * envelope_size;
1849
1850 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1852
1853 fidl::encoding::encode_in_envelope_optional::<Severity, D>(
1858 self.min_severity
1859 .as_ref()
1860 .map(<Severity as fidl::encoding::ValueTypeMarker>::borrow),
1861 encoder,
1862 offset + cur_offset,
1863 depth,
1864 )?;
1865
1866 _prev_end_offset = cur_offset + envelope_size;
1867
1868 Ok(())
1869 }
1870 }
1871
1872 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Interest {
1873 #[inline(always)]
1874 fn new_empty() -> Self {
1875 Self::default()
1876 }
1877
1878 unsafe fn decode(
1879 &mut self,
1880 decoder: &mut fidl::encoding::Decoder<'_, D>,
1881 offset: usize,
1882 mut depth: fidl::encoding::Depth,
1883 ) -> fidl::Result<()> {
1884 decoder.debug_check_bounds::<Self>(offset);
1885 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1886 None => return Err(fidl::Error::NotNullable),
1887 Some(len) => len,
1888 };
1889 if len == 0 {
1891 return Ok(());
1892 };
1893 depth.increment()?;
1894 let envelope_size = 8;
1895 let bytes_len = len * envelope_size;
1896 let offset = decoder.out_of_line_offset(bytes_len)?;
1897 let mut _next_ordinal_to_read = 0;
1899 let mut next_offset = offset;
1900 let end_offset = offset + bytes_len;
1901 _next_ordinal_to_read += 1;
1902 if next_offset >= end_offset {
1903 return Ok(());
1904 }
1905
1906 while _next_ordinal_to_read < 1 {
1908 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1909 _next_ordinal_to_read += 1;
1910 next_offset += envelope_size;
1911 }
1912
1913 let next_out_of_line = decoder.next_out_of_line();
1914 let handles_before = decoder.remaining_handles();
1915 if let Some((inlined, num_bytes, num_handles)) =
1916 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1917 {
1918 let member_inline_size =
1919 <Severity as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1920 if inlined != (member_inline_size <= 4) {
1921 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1922 }
1923 let inner_offset;
1924 let mut inner_depth = depth.clone();
1925 if inlined {
1926 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1927 inner_offset = next_offset;
1928 } else {
1929 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1930 inner_depth.increment()?;
1931 }
1932 let val_ref =
1933 self.min_severity.get_or_insert_with(|| fidl::new_empty!(Severity, D));
1934 fidl::decode!(Severity, D, val_ref, decoder, inner_offset, inner_depth)?;
1935 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1936 {
1937 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1938 }
1939 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1940 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1941 }
1942 }
1943
1944 next_offset += envelope_size;
1945
1946 while next_offset < end_offset {
1948 _next_ordinal_to_read += 1;
1949 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1950 next_offset += envelope_size;
1951 }
1952
1953 Ok(())
1954 }
1955 }
1956
1957 impl LogSettingsSetComponentInterestRequest {
1958 #[inline(always)]
1959 fn max_ordinal_present(&self) -> u64 {
1960 if let Some(_) = self.persist {
1961 return 2;
1962 }
1963 if let Some(_) = self.selectors {
1964 return 1;
1965 }
1966 0
1967 }
1968 }
1969
1970 impl fidl::encoding::ValueTypeMarker for LogSettingsSetComponentInterestRequest {
1971 type Borrowed<'a> = &'a Self;
1972 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1973 value
1974 }
1975 }
1976
1977 unsafe impl fidl::encoding::TypeMarker for LogSettingsSetComponentInterestRequest {
1978 type Owned = Self;
1979
1980 #[inline(always)]
1981 fn inline_align(_context: fidl::encoding::Context) -> usize {
1982 8
1983 }
1984
1985 #[inline(always)]
1986 fn inline_size(_context: fidl::encoding::Context) -> usize {
1987 16
1988 }
1989 }
1990
1991 unsafe impl<D: fidl::encoding::ResourceDialect>
1992 fidl::encoding::Encode<LogSettingsSetComponentInterestRequest, D>
1993 for &LogSettingsSetComponentInterestRequest
1994 {
1995 unsafe fn encode(
1996 self,
1997 encoder: &mut fidl::encoding::Encoder<'_, D>,
1998 offset: usize,
1999 mut depth: fidl::encoding::Depth,
2000 ) -> fidl::Result<()> {
2001 encoder.debug_check_bounds::<LogSettingsSetComponentInterestRequest>(offset);
2002 let max_ordinal: u64 = self.max_ordinal_present();
2004 encoder.write_num(max_ordinal, offset);
2005 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2006 if max_ordinal == 0 {
2008 return Ok(());
2009 }
2010 depth.increment()?;
2011 let envelope_size = 8;
2012 let bytes_len = max_ordinal as usize * envelope_size;
2013 #[allow(unused_variables)]
2014 let offset = encoder.out_of_line_offset(bytes_len);
2015 let mut _prev_end_offset: usize = 0;
2016 if 1 > max_ordinal {
2017 return Ok(());
2018 }
2019
2020 let cur_offset: usize = (1 - 1) * envelope_size;
2023
2024 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2026
2027 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<LogInterestSelector, 64>, D>(
2032 self.selectors.as_ref().map(<fidl::encoding::Vector<LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow),
2033 encoder, offset + cur_offset, depth
2034 )?;
2035
2036 _prev_end_offset = cur_offset + envelope_size;
2037 if 2 > max_ordinal {
2038 return Ok(());
2039 }
2040
2041 let cur_offset: usize = (2 - 1) * envelope_size;
2044
2045 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2047
2048 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2053 self.persist.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2054 encoder,
2055 offset + cur_offset,
2056 depth,
2057 )?;
2058
2059 _prev_end_offset = cur_offset + envelope_size;
2060
2061 Ok(())
2062 }
2063 }
2064
2065 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2066 for LogSettingsSetComponentInterestRequest
2067 {
2068 #[inline(always)]
2069 fn new_empty() -> Self {
2070 Self::default()
2071 }
2072
2073 unsafe fn decode(
2074 &mut self,
2075 decoder: &mut fidl::encoding::Decoder<'_, D>,
2076 offset: usize,
2077 mut depth: fidl::encoding::Depth,
2078 ) -> fidl::Result<()> {
2079 decoder.debug_check_bounds::<Self>(offset);
2080 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2081 None => return Err(fidl::Error::NotNullable),
2082 Some(len) => len,
2083 };
2084 if len == 0 {
2086 return Ok(());
2087 };
2088 depth.increment()?;
2089 let envelope_size = 8;
2090 let bytes_len = len * envelope_size;
2091 let offset = decoder.out_of_line_offset(bytes_len)?;
2092 let mut _next_ordinal_to_read = 0;
2094 let mut next_offset = offset;
2095 let end_offset = offset + bytes_len;
2096 _next_ordinal_to_read += 1;
2097 if next_offset >= end_offset {
2098 return Ok(());
2099 }
2100
2101 while _next_ordinal_to_read < 1 {
2103 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2104 _next_ordinal_to_read += 1;
2105 next_offset += envelope_size;
2106 }
2107
2108 let next_out_of_line = decoder.next_out_of_line();
2109 let handles_before = decoder.remaining_handles();
2110 if let Some((inlined, num_bytes, num_handles)) =
2111 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2112 {
2113 let member_inline_size = <fidl::encoding::Vector<LogInterestSelector, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2114 if inlined != (member_inline_size <= 4) {
2115 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2116 }
2117 let inner_offset;
2118 let mut inner_depth = depth.clone();
2119 if inlined {
2120 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2121 inner_offset = next_offset;
2122 } else {
2123 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2124 inner_depth.increment()?;
2125 }
2126 let val_ref = self.selectors.get_or_insert_with(
2127 || fidl::new_empty!(fidl::encoding::Vector<LogInterestSelector, 64>, D),
2128 );
2129 fidl::decode!(fidl::encoding::Vector<LogInterestSelector, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
2130 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2131 {
2132 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2133 }
2134 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2135 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2136 }
2137 }
2138
2139 next_offset += envelope_size;
2140 _next_ordinal_to_read += 1;
2141 if next_offset >= end_offset {
2142 return Ok(());
2143 }
2144
2145 while _next_ordinal_to_read < 2 {
2147 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2148 _next_ordinal_to_read += 1;
2149 next_offset += envelope_size;
2150 }
2151
2152 let next_out_of_line = decoder.next_out_of_line();
2153 let handles_before = decoder.remaining_handles();
2154 if let Some((inlined, num_bytes, num_handles)) =
2155 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2156 {
2157 let member_inline_size =
2158 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2159 if inlined != (member_inline_size <= 4) {
2160 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2161 }
2162 let inner_offset;
2163 let mut inner_depth = depth.clone();
2164 if inlined {
2165 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2166 inner_offset = next_offset;
2167 } else {
2168 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2169 inner_depth.increment()?;
2170 }
2171 let val_ref = self.persist.get_or_insert_with(|| fidl::new_empty!(bool, D));
2172 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2173 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2174 {
2175 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2176 }
2177 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2178 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2179 }
2180 }
2181
2182 next_offset += envelope_size;
2183
2184 while next_offset < end_offset {
2186 _next_ordinal_to_read += 1;
2187 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2188 next_offset += envelope_size;
2189 }
2190
2191 Ok(())
2192 }
2193 }
2194
2195 impl LogStreamOptions {
2196 #[inline(always)]
2197 fn max_ordinal_present(&self) -> u64 {
2198 if let Some(_) = self.include_rolled_out {
2199 return 4;
2200 }
2201 if let Some(_) = self.include_component_url {
2202 return 3;
2203 }
2204 if let Some(_) = self.include_moniker {
2205 return 2;
2206 }
2207 if let Some(_) = self.mode {
2208 return 1;
2209 }
2210 0
2211 }
2212 }
2213
2214 impl fidl::encoding::ValueTypeMarker for LogStreamOptions {
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 LogStreamOptions {
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<LogStreamOptions, D>
2236 for &LogStreamOptions
2237 {
2238 unsafe fn encode(
2239 self,
2240 encoder: &mut fidl::encoding::Encoder<'_, D>,
2241 offset: usize,
2242 mut depth: fidl::encoding::Depth,
2243 ) -> fidl::Result<()> {
2244 encoder.debug_check_bounds::<LogStreamOptions>(offset);
2245 let max_ordinal: u64 = self.max_ordinal_present();
2247 encoder.write_num(max_ordinal, offset);
2248 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2249 if max_ordinal == 0 {
2251 return Ok(());
2252 }
2253 depth.increment()?;
2254 let envelope_size = 8;
2255 let bytes_len = max_ordinal as usize * envelope_size;
2256 #[allow(unused_variables)]
2257 let offset = encoder.out_of_line_offset(bytes_len);
2258 let mut _prev_end_offset: usize = 0;
2259 if 1 > max_ordinal {
2260 return Ok(());
2261 }
2262
2263 let cur_offset: usize = (1 - 1) * envelope_size;
2266
2267 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2269
2270 fidl::encoding::encode_in_envelope_optional::<StreamMode, D>(
2275 self.mode.as_ref().map(<StreamMode as fidl::encoding::ValueTypeMarker>::borrow),
2276 encoder,
2277 offset + cur_offset,
2278 depth,
2279 )?;
2280
2281 _prev_end_offset = cur_offset + envelope_size;
2282 if 2 > max_ordinal {
2283 return Ok(());
2284 }
2285
2286 let cur_offset: usize = (2 - 1) * envelope_size;
2289
2290 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2292
2293 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2298 self.include_moniker
2299 .as_ref()
2300 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2301 encoder,
2302 offset + cur_offset,
2303 depth,
2304 )?;
2305
2306 _prev_end_offset = cur_offset + envelope_size;
2307 if 3 > max_ordinal {
2308 return Ok(());
2309 }
2310
2311 let cur_offset: usize = (3 - 1) * envelope_size;
2314
2315 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2317
2318 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2323 self.include_component_url
2324 .as_ref()
2325 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2326 encoder,
2327 offset + cur_offset,
2328 depth,
2329 )?;
2330
2331 _prev_end_offset = cur_offset + envelope_size;
2332 if 4 > max_ordinal {
2333 return Ok(());
2334 }
2335
2336 let cur_offset: usize = (4 - 1) * envelope_size;
2339
2340 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2342
2343 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2348 self.include_rolled_out
2349 .as_ref()
2350 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2351 encoder,
2352 offset + cur_offset,
2353 depth,
2354 )?;
2355
2356 _prev_end_offset = cur_offset + envelope_size;
2357
2358 Ok(())
2359 }
2360 }
2361
2362 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogStreamOptions {
2363 #[inline(always)]
2364 fn new_empty() -> Self {
2365 Self::default()
2366 }
2367
2368 unsafe fn decode(
2369 &mut self,
2370 decoder: &mut fidl::encoding::Decoder<'_, D>,
2371 offset: usize,
2372 mut depth: fidl::encoding::Depth,
2373 ) -> fidl::Result<()> {
2374 decoder.debug_check_bounds::<Self>(offset);
2375 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2376 None => return Err(fidl::Error::NotNullable),
2377 Some(len) => len,
2378 };
2379 if len == 0 {
2381 return Ok(());
2382 };
2383 depth.increment()?;
2384 let envelope_size = 8;
2385 let bytes_len = len * envelope_size;
2386 let offset = decoder.out_of_line_offset(bytes_len)?;
2387 let mut _next_ordinal_to_read = 0;
2389 let mut next_offset = offset;
2390 let end_offset = offset + bytes_len;
2391 _next_ordinal_to_read += 1;
2392 if next_offset >= end_offset {
2393 return Ok(());
2394 }
2395
2396 while _next_ordinal_to_read < 1 {
2398 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2399 _next_ordinal_to_read += 1;
2400 next_offset += envelope_size;
2401 }
2402
2403 let next_out_of_line = decoder.next_out_of_line();
2404 let handles_before = decoder.remaining_handles();
2405 if let Some((inlined, num_bytes, num_handles)) =
2406 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2407 {
2408 let member_inline_size =
2409 <StreamMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2410 if inlined != (member_inline_size <= 4) {
2411 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2412 }
2413 let inner_offset;
2414 let mut inner_depth = depth.clone();
2415 if inlined {
2416 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2417 inner_offset = next_offset;
2418 } else {
2419 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2420 inner_depth.increment()?;
2421 }
2422 let val_ref = self.mode.get_or_insert_with(|| fidl::new_empty!(StreamMode, D));
2423 fidl::decode!(StreamMode, D, val_ref, decoder, inner_offset, inner_depth)?;
2424 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2425 {
2426 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2427 }
2428 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2429 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2430 }
2431 }
2432
2433 next_offset += envelope_size;
2434 _next_ordinal_to_read += 1;
2435 if next_offset >= end_offset {
2436 return Ok(());
2437 }
2438
2439 while _next_ordinal_to_read < 2 {
2441 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2442 _next_ordinal_to_read += 1;
2443 next_offset += envelope_size;
2444 }
2445
2446 let next_out_of_line = decoder.next_out_of_line();
2447 let handles_before = decoder.remaining_handles();
2448 if let Some((inlined, num_bytes, num_handles)) =
2449 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2450 {
2451 let member_inline_size =
2452 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2453 if inlined != (member_inline_size <= 4) {
2454 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2455 }
2456 let inner_offset;
2457 let mut inner_depth = depth.clone();
2458 if inlined {
2459 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2460 inner_offset = next_offset;
2461 } else {
2462 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2463 inner_depth.increment()?;
2464 }
2465 let val_ref = self.include_moniker.get_or_insert_with(|| fidl::new_empty!(bool, D));
2466 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2467 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2468 {
2469 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2470 }
2471 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2472 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2473 }
2474 }
2475
2476 next_offset += envelope_size;
2477 _next_ordinal_to_read += 1;
2478 if next_offset >= end_offset {
2479 return Ok(());
2480 }
2481
2482 while _next_ordinal_to_read < 3 {
2484 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2485 _next_ordinal_to_read += 1;
2486 next_offset += envelope_size;
2487 }
2488
2489 let next_out_of_line = decoder.next_out_of_line();
2490 let handles_before = decoder.remaining_handles();
2491 if let Some((inlined, num_bytes, num_handles)) =
2492 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2493 {
2494 let member_inline_size =
2495 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2496 if inlined != (member_inline_size <= 4) {
2497 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2498 }
2499 let inner_offset;
2500 let mut inner_depth = depth.clone();
2501 if inlined {
2502 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2503 inner_offset = next_offset;
2504 } else {
2505 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2506 inner_depth.increment()?;
2507 }
2508 let val_ref =
2509 self.include_component_url.get_or_insert_with(|| fidl::new_empty!(bool, D));
2510 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2511 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2512 {
2513 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2514 }
2515 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2516 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2517 }
2518 }
2519
2520 next_offset += envelope_size;
2521 _next_ordinal_to_read += 1;
2522 if next_offset >= end_offset {
2523 return Ok(());
2524 }
2525
2526 while _next_ordinal_to_read < 4 {
2528 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2529 _next_ordinal_to_read += 1;
2530 next_offset += envelope_size;
2531 }
2532
2533 let next_out_of_line = decoder.next_out_of_line();
2534 let handles_before = decoder.remaining_handles();
2535 if let Some((inlined, num_bytes, num_handles)) =
2536 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2537 {
2538 let member_inline_size =
2539 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2540 if inlined != (member_inline_size <= 4) {
2541 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2542 }
2543 let inner_offset;
2544 let mut inner_depth = depth.clone();
2545 if inlined {
2546 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2547 inner_offset = next_offset;
2548 } else {
2549 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2550 inner_depth.increment()?;
2551 }
2552 let val_ref =
2553 self.include_rolled_out.get_or_insert_with(|| fidl::new_empty!(bool, D));
2554 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2555 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2556 {
2557 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2558 }
2559 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2560 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2561 }
2562 }
2563
2564 next_offset += envelope_size;
2565
2566 while next_offset < end_offset {
2568 _next_ordinal_to_read += 1;
2569 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2570 next_offset += envelope_size;
2571 }
2572
2573 Ok(())
2574 }
2575 }
2576
2577 impl PerformanceConfiguration {
2578 #[inline(always)]
2579 fn max_ordinal_present(&self) -> u64 {
2580 if let Some(_) = self.batch_retrieval_timeout_seconds {
2581 return 2;
2582 }
2583 if let Some(_) = self.max_aggregate_content_size_bytes {
2584 return 1;
2585 }
2586 0
2587 }
2588 }
2589
2590 impl fidl::encoding::ValueTypeMarker for PerformanceConfiguration {
2591 type Borrowed<'a> = &'a Self;
2592 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2593 value
2594 }
2595 }
2596
2597 unsafe impl fidl::encoding::TypeMarker for PerformanceConfiguration {
2598 type Owned = Self;
2599
2600 #[inline(always)]
2601 fn inline_align(_context: fidl::encoding::Context) -> usize {
2602 8
2603 }
2604
2605 #[inline(always)]
2606 fn inline_size(_context: fidl::encoding::Context) -> usize {
2607 16
2608 }
2609 }
2610
2611 unsafe impl<D: fidl::encoding::ResourceDialect>
2612 fidl::encoding::Encode<PerformanceConfiguration, D> for &PerformanceConfiguration
2613 {
2614 unsafe fn encode(
2615 self,
2616 encoder: &mut fidl::encoding::Encoder<'_, D>,
2617 offset: usize,
2618 mut depth: fidl::encoding::Depth,
2619 ) -> fidl::Result<()> {
2620 encoder.debug_check_bounds::<PerformanceConfiguration>(offset);
2621 let max_ordinal: u64 = self.max_ordinal_present();
2623 encoder.write_num(max_ordinal, offset);
2624 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2625 if max_ordinal == 0 {
2627 return Ok(());
2628 }
2629 depth.increment()?;
2630 let envelope_size = 8;
2631 let bytes_len = max_ordinal as usize * envelope_size;
2632 #[allow(unused_variables)]
2633 let offset = encoder.out_of_line_offset(bytes_len);
2634 let mut _prev_end_offset: usize = 0;
2635 if 1 > max_ordinal {
2636 return Ok(());
2637 }
2638
2639 let cur_offset: usize = (1 - 1) * envelope_size;
2642
2643 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2645
2646 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2651 self.max_aggregate_content_size_bytes
2652 .as_ref()
2653 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2654 encoder,
2655 offset + cur_offset,
2656 depth,
2657 )?;
2658
2659 _prev_end_offset = cur_offset + envelope_size;
2660 if 2 > max_ordinal {
2661 return Ok(());
2662 }
2663
2664 let cur_offset: usize = (2 - 1) * envelope_size;
2667
2668 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2670
2671 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2676 self.batch_retrieval_timeout_seconds
2677 .as_ref()
2678 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2679 encoder,
2680 offset + cur_offset,
2681 depth,
2682 )?;
2683
2684 _prev_end_offset = cur_offset + envelope_size;
2685
2686 Ok(())
2687 }
2688 }
2689
2690 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2691 for PerformanceConfiguration
2692 {
2693 #[inline(always)]
2694 fn new_empty() -> Self {
2695 Self::default()
2696 }
2697
2698 unsafe fn decode(
2699 &mut self,
2700 decoder: &mut fidl::encoding::Decoder<'_, D>,
2701 offset: usize,
2702 mut depth: fidl::encoding::Depth,
2703 ) -> fidl::Result<()> {
2704 decoder.debug_check_bounds::<Self>(offset);
2705 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2706 None => return Err(fidl::Error::NotNullable),
2707 Some(len) => len,
2708 };
2709 if len == 0 {
2711 return Ok(());
2712 };
2713 depth.increment()?;
2714 let envelope_size = 8;
2715 let bytes_len = len * envelope_size;
2716 let offset = decoder.out_of_line_offset(bytes_len)?;
2717 let mut _next_ordinal_to_read = 0;
2719 let mut next_offset = offset;
2720 let end_offset = offset + bytes_len;
2721 _next_ordinal_to_read += 1;
2722 if next_offset >= end_offset {
2723 return Ok(());
2724 }
2725
2726 while _next_ordinal_to_read < 1 {
2728 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2729 _next_ordinal_to_read += 1;
2730 next_offset += envelope_size;
2731 }
2732
2733 let next_out_of_line = decoder.next_out_of_line();
2734 let handles_before = decoder.remaining_handles();
2735 if let Some((inlined, num_bytes, num_handles)) =
2736 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2737 {
2738 let member_inline_size =
2739 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2740 if inlined != (member_inline_size <= 4) {
2741 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2742 }
2743 let inner_offset;
2744 let mut inner_depth = depth.clone();
2745 if inlined {
2746 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2747 inner_offset = next_offset;
2748 } else {
2749 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2750 inner_depth.increment()?;
2751 }
2752 let val_ref = self
2753 .max_aggregate_content_size_bytes
2754 .get_or_insert_with(|| fidl::new_empty!(u64, D));
2755 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2756 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2757 {
2758 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2759 }
2760 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2761 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2762 }
2763 }
2764
2765 next_offset += envelope_size;
2766 _next_ordinal_to_read += 1;
2767 if next_offset >= end_offset {
2768 return Ok(());
2769 }
2770
2771 while _next_ordinal_to_read < 2 {
2773 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2774 _next_ordinal_to_read += 1;
2775 next_offset += envelope_size;
2776 }
2777
2778 let next_out_of_line = decoder.next_out_of_line();
2779 let handles_before = decoder.remaining_handles();
2780 if let Some((inlined, num_bytes, num_handles)) =
2781 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2782 {
2783 let member_inline_size =
2784 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2785 if inlined != (member_inline_size <= 4) {
2786 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2787 }
2788 let inner_offset;
2789 let mut inner_depth = depth.clone();
2790 if inlined {
2791 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2792 inner_offset = next_offset;
2793 } else {
2794 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2795 inner_depth.increment()?;
2796 }
2797 let val_ref = self
2798 .batch_retrieval_timeout_seconds
2799 .get_or_insert_with(|| fidl::new_empty!(i64, D));
2800 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2801 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2802 {
2803 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2804 }
2805 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2806 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2807 }
2808 }
2809
2810 next_offset += envelope_size;
2811
2812 while next_offset < end_offset {
2814 _next_ordinal_to_read += 1;
2815 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2816 next_offset += envelope_size;
2817 }
2818
2819 Ok(())
2820 }
2821 }
2822
2823 impl Selector {
2824 #[inline(always)]
2825 fn max_ordinal_present(&self) -> u64 {
2826 if let Some(_) = self.tree_names {
2827 return 3;
2828 }
2829 if let Some(_) = self.tree_selector {
2830 return 2;
2831 }
2832 if let Some(_) = self.component_selector {
2833 return 1;
2834 }
2835 0
2836 }
2837 }
2838
2839 impl fidl::encoding::ValueTypeMarker for Selector {
2840 type Borrowed<'a> = &'a Self;
2841 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2842 value
2843 }
2844 }
2845
2846 unsafe impl fidl::encoding::TypeMarker for Selector {
2847 type Owned = Self;
2848
2849 #[inline(always)]
2850 fn inline_align(_context: fidl::encoding::Context) -> usize {
2851 8
2852 }
2853
2854 #[inline(always)]
2855 fn inline_size(_context: fidl::encoding::Context) -> usize {
2856 16
2857 }
2858 }
2859
2860 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Selector, D> for &Selector {
2861 unsafe fn encode(
2862 self,
2863 encoder: &mut fidl::encoding::Encoder<'_, D>,
2864 offset: usize,
2865 mut depth: fidl::encoding::Depth,
2866 ) -> fidl::Result<()> {
2867 encoder.debug_check_bounds::<Selector>(offset);
2868 let max_ordinal: u64 = self.max_ordinal_present();
2870 encoder.write_num(max_ordinal, offset);
2871 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2872 if max_ordinal == 0 {
2874 return Ok(());
2875 }
2876 depth.increment()?;
2877 let envelope_size = 8;
2878 let bytes_len = max_ordinal as usize * envelope_size;
2879 #[allow(unused_variables)]
2880 let offset = encoder.out_of_line_offset(bytes_len);
2881 let mut _prev_end_offset: usize = 0;
2882 if 1 > max_ordinal {
2883 return Ok(());
2884 }
2885
2886 let cur_offset: usize = (1 - 1) * envelope_size;
2889
2890 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2892
2893 fidl::encoding::encode_in_envelope_optional::<ComponentSelector, D>(
2898 self.component_selector
2899 .as_ref()
2900 .map(<ComponentSelector as fidl::encoding::ValueTypeMarker>::borrow),
2901 encoder,
2902 offset + cur_offset,
2903 depth,
2904 )?;
2905
2906 _prev_end_offset = cur_offset + envelope_size;
2907 if 2 > max_ordinal {
2908 return Ok(());
2909 }
2910
2911 let cur_offset: usize = (2 - 1) * envelope_size;
2914
2915 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2917
2918 fidl::encoding::encode_in_envelope_optional::<TreeSelector, D>(
2923 self.tree_selector
2924 .as_ref()
2925 .map(<TreeSelector as fidl::encoding::ValueTypeMarker>::borrow),
2926 encoder,
2927 offset + cur_offset,
2928 depth,
2929 )?;
2930
2931 _prev_end_offset = cur_offset + envelope_size;
2932 if 3 > max_ordinal {
2933 return Ok(());
2934 }
2935
2936 let cur_offset: usize = (3 - 1) * envelope_size;
2939
2940 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2942
2943 fidl::encoding::encode_in_envelope_optional::<TreeNames, D>(
2948 self.tree_names
2949 .as_ref()
2950 .map(<TreeNames as fidl::encoding::ValueTypeMarker>::borrow),
2951 encoder,
2952 offset + cur_offset,
2953 depth,
2954 )?;
2955
2956 _prev_end_offset = cur_offset + envelope_size;
2957
2958 Ok(())
2959 }
2960 }
2961
2962 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Selector {
2963 #[inline(always)]
2964 fn new_empty() -> Self {
2965 Self::default()
2966 }
2967
2968 unsafe fn decode(
2969 &mut self,
2970 decoder: &mut fidl::encoding::Decoder<'_, D>,
2971 offset: usize,
2972 mut depth: fidl::encoding::Depth,
2973 ) -> fidl::Result<()> {
2974 decoder.debug_check_bounds::<Self>(offset);
2975 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2976 None => return Err(fidl::Error::NotNullable),
2977 Some(len) => len,
2978 };
2979 if len == 0 {
2981 return Ok(());
2982 };
2983 depth.increment()?;
2984 let envelope_size = 8;
2985 let bytes_len = len * envelope_size;
2986 let offset = decoder.out_of_line_offset(bytes_len)?;
2987 let mut _next_ordinal_to_read = 0;
2989 let mut next_offset = offset;
2990 let end_offset = offset + bytes_len;
2991 _next_ordinal_to_read += 1;
2992 if next_offset >= end_offset {
2993 return Ok(());
2994 }
2995
2996 while _next_ordinal_to_read < 1 {
2998 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2999 _next_ordinal_to_read += 1;
3000 next_offset += envelope_size;
3001 }
3002
3003 let next_out_of_line = decoder.next_out_of_line();
3004 let handles_before = decoder.remaining_handles();
3005 if let Some((inlined, num_bytes, num_handles)) =
3006 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3007 {
3008 let member_inline_size =
3009 <ComponentSelector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3010 if inlined != (member_inline_size <= 4) {
3011 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3012 }
3013 let inner_offset;
3014 let mut inner_depth = depth.clone();
3015 if inlined {
3016 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3017 inner_offset = next_offset;
3018 } else {
3019 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3020 inner_depth.increment()?;
3021 }
3022 let val_ref = self
3023 .component_selector
3024 .get_or_insert_with(|| fidl::new_empty!(ComponentSelector, D));
3025 fidl::decode!(ComponentSelector, D, val_ref, decoder, inner_offset, inner_depth)?;
3026 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3027 {
3028 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3029 }
3030 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3031 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3032 }
3033 }
3034
3035 next_offset += envelope_size;
3036 _next_ordinal_to_read += 1;
3037 if next_offset >= end_offset {
3038 return Ok(());
3039 }
3040
3041 while _next_ordinal_to_read < 2 {
3043 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3044 _next_ordinal_to_read += 1;
3045 next_offset += envelope_size;
3046 }
3047
3048 let next_out_of_line = decoder.next_out_of_line();
3049 let handles_before = decoder.remaining_handles();
3050 if let Some((inlined, num_bytes, num_handles)) =
3051 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3052 {
3053 let member_inline_size =
3054 <TreeSelector as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3055 if inlined != (member_inline_size <= 4) {
3056 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3057 }
3058 let inner_offset;
3059 let mut inner_depth = depth.clone();
3060 if inlined {
3061 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3062 inner_offset = next_offset;
3063 } else {
3064 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3065 inner_depth.increment()?;
3066 }
3067 let val_ref =
3068 self.tree_selector.get_or_insert_with(|| fidl::new_empty!(TreeSelector, D));
3069 fidl::decode!(TreeSelector, D, val_ref, decoder, inner_offset, inner_depth)?;
3070 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3071 {
3072 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3073 }
3074 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3075 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3076 }
3077 }
3078
3079 next_offset += envelope_size;
3080 _next_ordinal_to_read += 1;
3081 if next_offset >= end_offset {
3082 return Ok(());
3083 }
3084
3085 while _next_ordinal_to_read < 3 {
3087 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3088 _next_ordinal_to_read += 1;
3089 next_offset += envelope_size;
3090 }
3091
3092 let next_out_of_line = decoder.next_out_of_line();
3093 let handles_before = decoder.remaining_handles();
3094 if let Some((inlined, num_bytes, num_handles)) =
3095 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3096 {
3097 let member_inline_size =
3098 <TreeNames as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3099 if inlined != (member_inline_size <= 4) {
3100 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3101 }
3102 let inner_offset;
3103 let mut inner_depth = depth.clone();
3104 if inlined {
3105 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3106 inner_offset = next_offset;
3107 } else {
3108 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3109 inner_depth.increment()?;
3110 }
3111 let val_ref = self.tree_names.get_or_insert_with(|| fidl::new_empty!(TreeNames, D));
3112 fidl::decode!(TreeNames, D, val_ref, decoder, inner_offset, inner_depth)?;
3113 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3114 {
3115 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3116 }
3117 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3118 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3119 }
3120 }
3121
3122 next_offset += envelope_size;
3123
3124 while next_offset < end_offset {
3126 _next_ordinal_to_read += 1;
3127 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3128 next_offset += envelope_size;
3129 }
3130
3131 Ok(())
3132 }
3133 }
3134
3135 impl StreamParameters {
3136 #[inline(always)]
3137 fn max_ordinal_present(&self) -> u64 {
3138 if let Some(_) = self.performance_configuration {
3139 return 6;
3140 }
3141 if let Some(_) = self.batch_retrieval_timeout_seconds {
3142 return 5;
3143 }
3144 if let Some(_) = self.client_selector_configuration {
3145 return 4;
3146 }
3147 if let Some(_) = self.format {
3148 return 3;
3149 }
3150 if let Some(_) = self.stream_mode {
3151 return 2;
3152 }
3153 if let Some(_) = self.data_type {
3154 return 1;
3155 }
3156 0
3157 }
3158 }
3159
3160 impl fidl::encoding::ValueTypeMarker for StreamParameters {
3161 type Borrowed<'a> = &'a Self;
3162 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3163 value
3164 }
3165 }
3166
3167 unsafe impl fidl::encoding::TypeMarker for StreamParameters {
3168 type Owned = Self;
3169
3170 #[inline(always)]
3171 fn inline_align(_context: fidl::encoding::Context) -> usize {
3172 8
3173 }
3174
3175 #[inline(always)]
3176 fn inline_size(_context: fidl::encoding::Context) -> usize {
3177 16
3178 }
3179 }
3180
3181 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamParameters, D>
3182 for &StreamParameters
3183 {
3184 unsafe fn encode(
3185 self,
3186 encoder: &mut fidl::encoding::Encoder<'_, D>,
3187 offset: usize,
3188 mut depth: fidl::encoding::Depth,
3189 ) -> fidl::Result<()> {
3190 encoder.debug_check_bounds::<StreamParameters>(offset);
3191 let max_ordinal: u64 = self.max_ordinal_present();
3193 encoder.write_num(max_ordinal, offset);
3194 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3195 if max_ordinal == 0 {
3197 return Ok(());
3198 }
3199 depth.increment()?;
3200 let envelope_size = 8;
3201 let bytes_len = max_ordinal as usize * envelope_size;
3202 #[allow(unused_variables)]
3203 let offset = encoder.out_of_line_offset(bytes_len);
3204 let mut _prev_end_offset: usize = 0;
3205 if 1 > max_ordinal {
3206 return Ok(());
3207 }
3208
3209 let cur_offset: usize = (1 - 1) * envelope_size;
3212
3213 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3215
3216 fidl::encoding::encode_in_envelope_optional::<DataType, D>(
3221 self.data_type.as_ref().map(<DataType as fidl::encoding::ValueTypeMarker>::borrow),
3222 encoder,
3223 offset + cur_offset,
3224 depth,
3225 )?;
3226
3227 _prev_end_offset = cur_offset + envelope_size;
3228 if 2 > max_ordinal {
3229 return Ok(());
3230 }
3231
3232 let cur_offset: usize = (2 - 1) * envelope_size;
3235
3236 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3238
3239 fidl::encoding::encode_in_envelope_optional::<StreamMode, D>(
3244 self.stream_mode
3245 .as_ref()
3246 .map(<StreamMode as fidl::encoding::ValueTypeMarker>::borrow),
3247 encoder,
3248 offset + cur_offset,
3249 depth,
3250 )?;
3251
3252 _prev_end_offset = cur_offset + envelope_size;
3253 if 3 > max_ordinal {
3254 return Ok(());
3255 }
3256
3257 let cur_offset: usize = (3 - 1) * envelope_size;
3260
3261 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3263
3264 fidl::encoding::encode_in_envelope_optional::<Format, D>(
3269 self.format.as_ref().map(<Format as fidl::encoding::ValueTypeMarker>::borrow),
3270 encoder,
3271 offset + cur_offset,
3272 depth,
3273 )?;
3274
3275 _prev_end_offset = cur_offset + envelope_size;
3276 if 4 > max_ordinal {
3277 return Ok(());
3278 }
3279
3280 let cur_offset: usize = (4 - 1) * envelope_size;
3283
3284 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3286
3287 fidl::encoding::encode_in_envelope_optional::<ClientSelectorConfiguration, D>(
3292 self.client_selector_configuration
3293 .as_ref()
3294 .map(<ClientSelectorConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
3295 encoder,
3296 offset + cur_offset,
3297 depth,
3298 )?;
3299
3300 _prev_end_offset = cur_offset + envelope_size;
3301 if 5 > max_ordinal {
3302 return Ok(());
3303 }
3304
3305 let cur_offset: usize = (5 - 1) * envelope_size;
3308
3309 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3311
3312 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3317 self.batch_retrieval_timeout_seconds
3318 .as_ref()
3319 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3320 encoder,
3321 offset + cur_offset,
3322 depth,
3323 )?;
3324
3325 _prev_end_offset = cur_offset + envelope_size;
3326 if 6 > max_ordinal {
3327 return Ok(());
3328 }
3329
3330 let cur_offset: usize = (6 - 1) * envelope_size;
3333
3334 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3336
3337 fidl::encoding::encode_in_envelope_optional::<PerformanceConfiguration, D>(
3342 self.performance_configuration
3343 .as_ref()
3344 .map(<PerformanceConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
3345 encoder,
3346 offset + cur_offset,
3347 depth,
3348 )?;
3349
3350 _prev_end_offset = cur_offset + envelope_size;
3351
3352 Ok(())
3353 }
3354 }
3355
3356 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamParameters {
3357 #[inline(always)]
3358 fn new_empty() -> Self {
3359 Self::default()
3360 }
3361
3362 unsafe fn decode(
3363 &mut self,
3364 decoder: &mut fidl::encoding::Decoder<'_, D>,
3365 offset: usize,
3366 mut depth: fidl::encoding::Depth,
3367 ) -> fidl::Result<()> {
3368 decoder.debug_check_bounds::<Self>(offset);
3369 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3370 None => return Err(fidl::Error::NotNullable),
3371 Some(len) => len,
3372 };
3373 if len == 0 {
3375 return Ok(());
3376 };
3377 depth.increment()?;
3378 let envelope_size = 8;
3379 let bytes_len = len * envelope_size;
3380 let offset = decoder.out_of_line_offset(bytes_len)?;
3381 let mut _next_ordinal_to_read = 0;
3383 let mut next_offset = offset;
3384 let end_offset = offset + bytes_len;
3385 _next_ordinal_to_read += 1;
3386 if next_offset >= end_offset {
3387 return Ok(());
3388 }
3389
3390 while _next_ordinal_to_read < 1 {
3392 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3393 _next_ordinal_to_read += 1;
3394 next_offset += envelope_size;
3395 }
3396
3397 let next_out_of_line = decoder.next_out_of_line();
3398 let handles_before = decoder.remaining_handles();
3399 if let Some((inlined, num_bytes, num_handles)) =
3400 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3401 {
3402 let member_inline_size =
3403 <DataType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3404 if inlined != (member_inline_size <= 4) {
3405 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3406 }
3407 let inner_offset;
3408 let mut inner_depth = depth.clone();
3409 if inlined {
3410 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3411 inner_offset = next_offset;
3412 } else {
3413 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3414 inner_depth.increment()?;
3415 }
3416 let val_ref = self.data_type.get_or_insert_with(|| fidl::new_empty!(DataType, D));
3417 fidl::decode!(DataType, D, val_ref, decoder, inner_offset, inner_depth)?;
3418 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3419 {
3420 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3421 }
3422 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3423 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3424 }
3425 }
3426
3427 next_offset += envelope_size;
3428 _next_ordinal_to_read += 1;
3429 if next_offset >= end_offset {
3430 return Ok(());
3431 }
3432
3433 while _next_ordinal_to_read < 2 {
3435 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3436 _next_ordinal_to_read += 1;
3437 next_offset += envelope_size;
3438 }
3439
3440 let next_out_of_line = decoder.next_out_of_line();
3441 let handles_before = decoder.remaining_handles();
3442 if let Some((inlined, num_bytes, num_handles)) =
3443 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3444 {
3445 let member_inline_size =
3446 <StreamMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3447 if inlined != (member_inline_size <= 4) {
3448 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3449 }
3450 let inner_offset;
3451 let mut inner_depth = depth.clone();
3452 if inlined {
3453 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3454 inner_offset = next_offset;
3455 } else {
3456 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3457 inner_depth.increment()?;
3458 }
3459 let val_ref =
3460 self.stream_mode.get_or_insert_with(|| fidl::new_empty!(StreamMode, D));
3461 fidl::decode!(StreamMode, D, val_ref, decoder, inner_offset, inner_depth)?;
3462 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3463 {
3464 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3465 }
3466 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3467 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3468 }
3469 }
3470
3471 next_offset += envelope_size;
3472 _next_ordinal_to_read += 1;
3473 if next_offset >= end_offset {
3474 return Ok(());
3475 }
3476
3477 while _next_ordinal_to_read < 3 {
3479 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3480 _next_ordinal_to_read += 1;
3481 next_offset += envelope_size;
3482 }
3483
3484 let next_out_of_line = decoder.next_out_of_line();
3485 let handles_before = decoder.remaining_handles();
3486 if let Some((inlined, num_bytes, num_handles)) =
3487 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3488 {
3489 let member_inline_size =
3490 <Format as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3491 if inlined != (member_inline_size <= 4) {
3492 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3493 }
3494 let inner_offset;
3495 let mut inner_depth = depth.clone();
3496 if inlined {
3497 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3498 inner_offset = next_offset;
3499 } else {
3500 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3501 inner_depth.increment()?;
3502 }
3503 let val_ref = self.format.get_or_insert_with(|| fidl::new_empty!(Format, D));
3504 fidl::decode!(Format, D, val_ref, decoder, inner_offset, inner_depth)?;
3505 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3506 {
3507 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3508 }
3509 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3510 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3511 }
3512 }
3513
3514 next_offset += envelope_size;
3515 _next_ordinal_to_read += 1;
3516 if next_offset >= end_offset {
3517 return Ok(());
3518 }
3519
3520 while _next_ordinal_to_read < 4 {
3522 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3523 _next_ordinal_to_read += 1;
3524 next_offset += envelope_size;
3525 }
3526
3527 let next_out_of_line = decoder.next_out_of_line();
3528 let handles_before = decoder.remaining_handles();
3529 if let Some((inlined, num_bytes, num_handles)) =
3530 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3531 {
3532 let member_inline_size =
3533 <ClientSelectorConfiguration as fidl::encoding::TypeMarker>::inline_size(
3534 decoder.context,
3535 );
3536 if inlined != (member_inline_size <= 4) {
3537 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3538 }
3539 let inner_offset;
3540 let mut inner_depth = depth.clone();
3541 if inlined {
3542 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3543 inner_offset = next_offset;
3544 } else {
3545 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3546 inner_depth.increment()?;
3547 }
3548 let val_ref = self
3549 .client_selector_configuration
3550 .get_or_insert_with(|| fidl::new_empty!(ClientSelectorConfiguration, D));
3551 fidl::decode!(
3552 ClientSelectorConfiguration,
3553 D,
3554 val_ref,
3555 decoder,
3556 inner_offset,
3557 inner_depth
3558 )?;
3559 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3560 {
3561 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3562 }
3563 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3564 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3565 }
3566 }
3567
3568 next_offset += envelope_size;
3569 _next_ordinal_to_read += 1;
3570 if next_offset >= end_offset {
3571 return Ok(());
3572 }
3573
3574 while _next_ordinal_to_read < 5 {
3576 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3577 _next_ordinal_to_read += 1;
3578 next_offset += envelope_size;
3579 }
3580
3581 let next_out_of_line = decoder.next_out_of_line();
3582 let handles_before = decoder.remaining_handles();
3583 if let Some((inlined, num_bytes, num_handles)) =
3584 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3585 {
3586 let member_inline_size =
3587 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3588 if inlined != (member_inline_size <= 4) {
3589 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3590 }
3591 let inner_offset;
3592 let mut inner_depth = depth.clone();
3593 if inlined {
3594 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3595 inner_offset = next_offset;
3596 } else {
3597 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3598 inner_depth.increment()?;
3599 }
3600 let val_ref = self
3601 .batch_retrieval_timeout_seconds
3602 .get_or_insert_with(|| fidl::new_empty!(i64, D));
3603 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3604 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3605 {
3606 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3607 }
3608 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3609 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3610 }
3611 }
3612
3613 next_offset += envelope_size;
3614 _next_ordinal_to_read += 1;
3615 if next_offset >= end_offset {
3616 return Ok(());
3617 }
3618
3619 while _next_ordinal_to_read < 6 {
3621 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3622 _next_ordinal_to_read += 1;
3623 next_offset += envelope_size;
3624 }
3625
3626 let next_out_of_line = decoder.next_out_of_line();
3627 let handles_before = decoder.remaining_handles();
3628 if let Some((inlined, num_bytes, num_handles)) =
3629 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3630 {
3631 let member_inline_size =
3632 <PerformanceConfiguration as fidl::encoding::TypeMarker>::inline_size(
3633 decoder.context,
3634 );
3635 if inlined != (member_inline_size <= 4) {
3636 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3637 }
3638 let inner_offset;
3639 let mut inner_depth = depth.clone();
3640 if inlined {
3641 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3642 inner_offset = next_offset;
3643 } else {
3644 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3645 inner_depth.increment()?;
3646 }
3647 let val_ref = self
3648 .performance_configuration
3649 .get_or_insert_with(|| fidl::new_empty!(PerformanceConfiguration, D));
3650 fidl::decode!(
3651 PerformanceConfiguration,
3652 D,
3653 val_ref,
3654 decoder,
3655 inner_offset,
3656 inner_depth
3657 )?;
3658 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3659 {
3660 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3661 }
3662 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3663 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3664 }
3665 }
3666
3667 next_offset += envelope_size;
3668
3669 while next_offset < end_offset {
3671 _next_ordinal_to_read += 1;
3672 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3673 next_offset += envelope_size;
3674 }
3675
3676 Ok(())
3677 }
3678 }
3679
3680 impl fidl::encoding::ValueTypeMarker for ClientSelectorConfiguration {
3681 type Borrowed<'a> = &'a Self;
3682 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3683 value
3684 }
3685 }
3686
3687 unsafe impl fidl::encoding::TypeMarker for ClientSelectorConfiguration {
3688 type Owned = Self;
3689
3690 #[inline(always)]
3691 fn inline_align(_context: fidl::encoding::Context) -> usize {
3692 8
3693 }
3694
3695 #[inline(always)]
3696 fn inline_size(_context: fidl::encoding::Context) -> usize {
3697 16
3698 }
3699 }
3700
3701 unsafe impl<D: fidl::encoding::ResourceDialect>
3702 fidl::encoding::Encode<ClientSelectorConfiguration, D> for &ClientSelectorConfiguration
3703 {
3704 #[inline]
3705 unsafe fn encode(
3706 self,
3707 encoder: &mut fidl::encoding::Encoder<'_, D>,
3708 offset: usize,
3709 _depth: fidl::encoding::Depth,
3710 ) -> fidl::Result<()> {
3711 encoder.debug_check_bounds::<ClientSelectorConfiguration>(offset);
3712 encoder.write_num::<u64>(self.ordinal(), offset);
3713 match self {
3714 ClientSelectorConfiguration::Selectors(ref val) => {
3715 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<SelectorArgument>, D>(
3716 <fidl::encoding::UnboundedVector<SelectorArgument> as fidl::encoding::ValueTypeMarker>::borrow(val),
3717 encoder, offset + 8, _depth
3718 )
3719 }
3720 ClientSelectorConfiguration::SelectAll(ref val) => {
3721 fidl::encoding::encode_in_envelope::<bool, D>(
3722 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
3723 encoder, offset + 8, _depth
3724 )
3725 }
3726 ClientSelectorConfiguration::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
3727 }
3728 }
3729 }
3730
3731 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3732 for ClientSelectorConfiguration
3733 {
3734 #[inline(always)]
3735 fn new_empty() -> Self {
3736 Self::__SourceBreaking { unknown_ordinal: 0 }
3737 }
3738
3739 #[inline]
3740 unsafe fn decode(
3741 &mut self,
3742 decoder: &mut fidl::encoding::Decoder<'_, D>,
3743 offset: usize,
3744 mut depth: fidl::encoding::Depth,
3745 ) -> fidl::Result<()> {
3746 decoder.debug_check_bounds::<Self>(offset);
3747 #[allow(unused_variables)]
3748 let next_out_of_line = decoder.next_out_of_line();
3749 let handles_before = decoder.remaining_handles();
3750 let (ordinal, inlined, num_bytes, num_handles) =
3751 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3752
3753 let member_inline_size = match ordinal {
3754 1 => <fidl::encoding::UnboundedVector<SelectorArgument> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3755 2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3756 0 => return Err(fidl::Error::UnknownUnionTag),
3757 _ => num_bytes as usize,
3758 };
3759
3760 if inlined != (member_inline_size <= 4) {
3761 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3762 }
3763 let _inner_offset;
3764 if inlined {
3765 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3766 _inner_offset = offset + 8;
3767 } else {
3768 depth.increment()?;
3769 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3770 }
3771 match ordinal {
3772 1 => {
3773 #[allow(irrefutable_let_patterns)]
3774 if let ClientSelectorConfiguration::Selectors(_) = self {
3775 } else {
3777 *self = ClientSelectorConfiguration::Selectors(fidl::new_empty!(
3779 fidl::encoding::UnboundedVector<SelectorArgument>,
3780 D
3781 ));
3782 }
3783 #[allow(irrefutable_let_patterns)]
3784 if let ClientSelectorConfiguration::Selectors(ref mut val) = self {
3785 fidl::decode!(
3786 fidl::encoding::UnboundedVector<SelectorArgument>,
3787 D,
3788 val,
3789 decoder,
3790 _inner_offset,
3791 depth
3792 )?;
3793 } else {
3794 unreachable!()
3795 }
3796 }
3797 2 => {
3798 #[allow(irrefutable_let_patterns)]
3799 if let ClientSelectorConfiguration::SelectAll(_) = self {
3800 } else {
3802 *self = ClientSelectorConfiguration::SelectAll(fidl::new_empty!(bool, D));
3804 }
3805 #[allow(irrefutable_let_patterns)]
3806 if let ClientSelectorConfiguration::SelectAll(ref mut val) = self {
3807 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
3808 } else {
3809 unreachable!()
3810 }
3811 }
3812 #[allow(deprecated)]
3813 ordinal => {
3814 for _ in 0..num_handles {
3815 decoder.drop_next_handle()?;
3816 }
3817 *self =
3818 ClientSelectorConfiguration::__SourceBreaking { unknown_ordinal: ordinal };
3819 }
3820 }
3821 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3822 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3823 }
3824 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3825 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3826 }
3827 Ok(())
3828 }
3829 }
3830
3831 impl fidl::encoding::ValueTypeMarker for SelectorArgument {
3832 type Borrowed<'a> = &'a Self;
3833 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3834 value
3835 }
3836 }
3837
3838 unsafe impl fidl::encoding::TypeMarker for SelectorArgument {
3839 type Owned = Self;
3840
3841 #[inline(always)]
3842 fn inline_align(_context: fidl::encoding::Context) -> usize {
3843 8
3844 }
3845
3846 #[inline(always)]
3847 fn inline_size(_context: fidl::encoding::Context) -> usize {
3848 16
3849 }
3850 }
3851
3852 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SelectorArgument, D>
3853 for &SelectorArgument
3854 {
3855 #[inline]
3856 unsafe fn encode(
3857 self,
3858 encoder: &mut fidl::encoding::Encoder<'_, D>,
3859 offset: usize,
3860 _depth: fidl::encoding::Depth,
3861 ) -> fidl::Result<()> {
3862 encoder.debug_check_bounds::<SelectorArgument>(offset);
3863 encoder.write_num::<u64>(self.ordinal(), offset);
3864 match self {
3865 SelectorArgument::StructuredSelector(ref val) => {
3866 fidl::encoding::encode_in_envelope::<Selector, D>(
3867 <Selector as fidl::encoding::ValueTypeMarker>::borrow(val),
3868 encoder, offset + 8, _depth
3869 )
3870 }
3871 SelectorArgument::RawSelector(ref val) => {
3872 fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<1024>, D>(
3873 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(val),
3874 encoder, offset + 8, _depth
3875 )
3876 }
3877 SelectorArgument::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
3878 }
3879 }
3880 }
3881
3882 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SelectorArgument {
3883 #[inline(always)]
3884 fn new_empty() -> Self {
3885 Self::__SourceBreaking { unknown_ordinal: 0 }
3886 }
3887
3888 #[inline]
3889 unsafe fn decode(
3890 &mut self,
3891 decoder: &mut fidl::encoding::Decoder<'_, D>,
3892 offset: usize,
3893 mut depth: fidl::encoding::Depth,
3894 ) -> fidl::Result<()> {
3895 decoder.debug_check_bounds::<Self>(offset);
3896 #[allow(unused_variables)]
3897 let next_out_of_line = decoder.next_out_of_line();
3898 let handles_before = decoder.remaining_handles();
3899 let (ordinal, inlined, num_bytes, num_handles) =
3900 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
3901
3902 let member_inline_size = match ordinal {
3903 1 => <Selector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3904 2 => {
3905 <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(
3906 decoder.context,
3907 )
3908 }
3909 0 => return Err(fidl::Error::UnknownUnionTag),
3910 _ => num_bytes as usize,
3911 };
3912
3913 if inlined != (member_inline_size <= 4) {
3914 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3915 }
3916 let _inner_offset;
3917 if inlined {
3918 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
3919 _inner_offset = offset + 8;
3920 } else {
3921 depth.increment()?;
3922 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3923 }
3924 match ordinal {
3925 1 => {
3926 #[allow(irrefutable_let_patterns)]
3927 if let SelectorArgument::StructuredSelector(_) = self {
3928 } else {
3930 *self = SelectorArgument::StructuredSelector(fidl::new_empty!(Selector, D));
3932 }
3933 #[allow(irrefutable_let_patterns)]
3934 if let SelectorArgument::StructuredSelector(ref mut val) = self {
3935 fidl::decode!(Selector, D, val, decoder, _inner_offset, depth)?;
3936 } else {
3937 unreachable!()
3938 }
3939 }
3940 2 => {
3941 #[allow(irrefutable_let_patterns)]
3942 if let SelectorArgument::RawSelector(_) = self {
3943 } else {
3945 *self = SelectorArgument::RawSelector(fidl::new_empty!(
3947 fidl::encoding::BoundedString<1024>,
3948 D
3949 ));
3950 }
3951 #[allow(irrefutable_let_patterns)]
3952 if let SelectorArgument::RawSelector(ref mut val) = self {
3953 fidl::decode!(
3954 fidl::encoding::BoundedString<1024>,
3955 D,
3956 val,
3957 decoder,
3958 _inner_offset,
3959 depth
3960 )?;
3961 } else {
3962 unreachable!()
3963 }
3964 }
3965 #[allow(deprecated)]
3966 ordinal => {
3967 for _ in 0..num_handles {
3968 decoder.drop_next_handle()?;
3969 }
3970 *self = SelectorArgument::__SourceBreaking { unknown_ordinal: ordinal };
3971 }
3972 }
3973 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
3974 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3975 }
3976 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3977 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3978 }
3979 Ok(())
3980 }
3981 }
3982
3983 impl fidl::encoding::ValueTypeMarker for StringSelector {
3984 type Borrowed<'a> = &'a Self;
3985 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3986 value
3987 }
3988 }
3989
3990 unsafe impl fidl::encoding::TypeMarker for StringSelector {
3991 type Owned = Self;
3992
3993 #[inline(always)]
3994 fn inline_align(_context: fidl::encoding::Context) -> usize {
3995 8
3996 }
3997
3998 #[inline(always)]
3999 fn inline_size(_context: fidl::encoding::Context) -> usize {
4000 16
4001 }
4002 }
4003
4004 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StringSelector, D>
4005 for &StringSelector
4006 {
4007 #[inline]
4008 unsafe fn encode(
4009 self,
4010 encoder: &mut fidl::encoding::Encoder<'_, D>,
4011 offset: usize,
4012 _depth: fidl::encoding::Depth,
4013 ) -> fidl::Result<()> {
4014 encoder.debug_check_bounds::<StringSelector>(offset);
4015 encoder.write_num::<u64>(self.ordinal(), offset);
4016 match self {
4017 StringSelector::StringPattern(ref val) => {
4018 fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<1024>, D>(
4019 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(val),
4020 encoder, offset + 8, _depth
4021 )
4022 }
4023 StringSelector::ExactMatch(ref val) => {
4024 fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<1024>, D>(
4025 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(val),
4026 encoder, offset + 8, _depth
4027 )
4028 }
4029 StringSelector::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4030 }
4031 }
4032 }
4033
4034 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StringSelector {
4035 #[inline(always)]
4036 fn new_empty() -> Self {
4037 Self::__SourceBreaking { unknown_ordinal: 0 }
4038 }
4039
4040 #[inline]
4041 unsafe fn decode(
4042 &mut self,
4043 decoder: &mut fidl::encoding::Decoder<'_, D>,
4044 offset: usize,
4045 mut depth: fidl::encoding::Depth,
4046 ) -> fidl::Result<()> {
4047 decoder.debug_check_bounds::<Self>(offset);
4048 #[allow(unused_variables)]
4049 let next_out_of_line = decoder.next_out_of_line();
4050 let handles_before = decoder.remaining_handles();
4051 let (ordinal, inlined, num_bytes, num_handles) =
4052 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4053
4054 let member_inline_size = match ordinal {
4055 1 => {
4056 <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(
4057 decoder.context,
4058 )
4059 }
4060 2 => {
4061 <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(
4062 decoder.context,
4063 )
4064 }
4065 0 => return Err(fidl::Error::UnknownUnionTag),
4066 _ => num_bytes as usize,
4067 };
4068
4069 if inlined != (member_inline_size <= 4) {
4070 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4071 }
4072 let _inner_offset;
4073 if inlined {
4074 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4075 _inner_offset = offset + 8;
4076 } else {
4077 depth.increment()?;
4078 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4079 }
4080 match ordinal {
4081 1 => {
4082 #[allow(irrefutable_let_patterns)]
4083 if let StringSelector::StringPattern(_) = self {
4084 } else {
4086 *self = StringSelector::StringPattern(fidl::new_empty!(
4088 fidl::encoding::BoundedString<1024>,
4089 D
4090 ));
4091 }
4092 #[allow(irrefutable_let_patterns)]
4093 if let StringSelector::StringPattern(ref mut val) = self {
4094 fidl::decode!(
4095 fidl::encoding::BoundedString<1024>,
4096 D,
4097 val,
4098 decoder,
4099 _inner_offset,
4100 depth
4101 )?;
4102 } else {
4103 unreachable!()
4104 }
4105 }
4106 2 => {
4107 #[allow(irrefutable_let_patterns)]
4108 if let StringSelector::ExactMatch(_) = self {
4109 } else {
4111 *self = StringSelector::ExactMatch(fidl::new_empty!(
4113 fidl::encoding::BoundedString<1024>,
4114 D
4115 ));
4116 }
4117 #[allow(irrefutable_let_patterns)]
4118 if let StringSelector::ExactMatch(ref mut val) = self {
4119 fidl::decode!(
4120 fidl::encoding::BoundedString<1024>,
4121 D,
4122 val,
4123 decoder,
4124 _inner_offset,
4125 depth
4126 )?;
4127 } else {
4128 unreachable!()
4129 }
4130 }
4131 #[allow(deprecated)]
4132 ordinal => {
4133 for _ in 0..num_handles {
4134 decoder.drop_next_handle()?;
4135 }
4136 *self = StringSelector::__SourceBreaking { unknown_ordinal: ordinal };
4137 }
4138 }
4139 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4140 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4141 }
4142 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4143 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4144 }
4145 Ok(())
4146 }
4147 }
4148
4149 impl fidl::encoding::ValueTypeMarker for TreeNames {
4150 type Borrowed<'a> = &'a Self;
4151 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4152 value
4153 }
4154 }
4155
4156 unsafe impl fidl::encoding::TypeMarker for TreeNames {
4157 type Owned = Self;
4158
4159 #[inline(always)]
4160 fn inline_align(_context: fidl::encoding::Context) -> usize {
4161 8
4162 }
4163
4164 #[inline(always)]
4165 fn inline_size(_context: fidl::encoding::Context) -> usize {
4166 16
4167 }
4168 }
4169
4170 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TreeNames, D>
4171 for &TreeNames
4172 {
4173 #[inline]
4174 unsafe fn encode(
4175 self,
4176 encoder: &mut fidl::encoding::Encoder<'_, D>,
4177 offset: usize,
4178 _depth: fidl::encoding::Depth,
4179 ) -> fidl::Result<()> {
4180 encoder.debug_check_bounds::<TreeNames>(offset);
4181 encoder.write_num::<u64>(self.ordinal(), offset);
4182 match self {
4183 TreeNames::Some(ref val) => {
4184 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<1024>>, D>(
4185 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<1024>> as fidl::encoding::ValueTypeMarker>::borrow(val),
4186 encoder, offset + 8, _depth
4187 )
4188 }
4189 TreeNames::All(ref val) => {
4190 fidl::encoding::encode_in_envelope::<All, D>(
4191 <All as fidl::encoding::ValueTypeMarker>::borrow(val),
4192 encoder, offset + 8, _depth
4193 )
4194 }
4195 TreeNames::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4196 }
4197 }
4198 }
4199
4200 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TreeNames {
4201 #[inline(always)]
4202 fn new_empty() -> Self {
4203 Self::__SourceBreaking { unknown_ordinal: 0 }
4204 }
4205
4206 #[inline]
4207 unsafe fn decode(
4208 &mut self,
4209 decoder: &mut fidl::encoding::Decoder<'_, D>,
4210 offset: usize,
4211 mut depth: fidl::encoding::Depth,
4212 ) -> fidl::Result<()> {
4213 decoder.debug_check_bounds::<Self>(offset);
4214 #[allow(unused_variables)]
4215 let next_out_of_line = decoder.next_out_of_line();
4216 let handles_before = decoder.remaining_handles();
4217 let (ordinal, inlined, num_bytes, num_handles) =
4218 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4219
4220 let member_inline_size = match ordinal {
4221 1 => <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<1024>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4222 2 => <All as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4223 0 => return Err(fidl::Error::UnknownUnionTag),
4224 _ => num_bytes as usize,
4225 };
4226
4227 if inlined != (member_inline_size <= 4) {
4228 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4229 }
4230 let _inner_offset;
4231 if inlined {
4232 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4233 _inner_offset = offset + 8;
4234 } else {
4235 depth.increment()?;
4236 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4237 }
4238 match ordinal {
4239 1 => {
4240 #[allow(irrefutable_let_patterns)]
4241 if let TreeNames::Some(_) = self {
4242 } else {
4244 *self = TreeNames::Some(fidl::new_empty!(
4246 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<1024>>,
4247 D
4248 ));
4249 }
4250 #[allow(irrefutable_let_patterns)]
4251 if let TreeNames::Some(ref mut val) = self {
4252 fidl::decode!(
4253 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<1024>>,
4254 D,
4255 val,
4256 decoder,
4257 _inner_offset,
4258 depth
4259 )?;
4260 } else {
4261 unreachable!()
4262 }
4263 }
4264 2 => {
4265 #[allow(irrefutable_let_patterns)]
4266 if let TreeNames::All(_) = self {
4267 } else {
4269 *self = TreeNames::All(fidl::new_empty!(All, D));
4271 }
4272 #[allow(irrefutable_let_patterns)]
4273 if let TreeNames::All(ref mut val) = self {
4274 fidl::decode!(All, D, val, decoder, _inner_offset, depth)?;
4275 } else {
4276 unreachable!()
4277 }
4278 }
4279 #[allow(deprecated)]
4280 ordinal => {
4281 for _ in 0..num_handles {
4282 decoder.drop_next_handle()?;
4283 }
4284 *self = TreeNames::__SourceBreaking { unknown_ordinal: ordinal };
4285 }
4286 }
4287 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4288 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4289 }
4290 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4291 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4292 }
4293 Ok(())
4294 }
4295 }
4296
4297 impl fidl::encoding::ValueTypeMarker for TreeSelector {
4298 type Borrowed<'a> = &'a Self;
4299 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4300 value
4301 }
4302 }
4303
4304 unsafe impl fidl::encoding::TypeMarker for TreeSelector {
4305 type Owned = Self;
4306
4307 #[inline(always)]
4308 fn inline_align(_context: fidl::encoding::Context) -> usize {
4309 8
4310 }
4311
4312 #[inline(always)]
4313 fn inline_size(_context: fidl::encoding::Context) -> usize {
4314 16
4315 }
4316 }
4317
4318 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TreeSelector, D>
4319 for &TreeSelector
4320 {
4321 #[inline]
4322 unsafe fn encode(
4323 self,
4324 encoder: &mut fidl::encoding::Encoder<'_, D>,
4325 offset: usize,
4326 _depth: fidl::encoding::Depth,
4327 ) -> fidl::Result<()> {
4328 encoder.debug_check_bounds::<TreeSelector>(offset);
4329 encoder.write_num::<u64>(self.ordinal(), offset);
4330 match self {
4331 TreeSelector::SubtreeSelector(ref val) => {
4332 fidl::encoding::encode_in_envelope::<SubtreeSelector, D>(
4333 <SubtreeSelector as fidl::encoding::ValueTypeMarker>::borrow(val),
4334 encoder,
4335 offset + 8,
4336 _depth,
4337 )
4338 }
4339 TreeSelector::PropertySelector(ref val) => {
4340 fidl::encoding::encode_in_envelope::<PropertySelector, D>(
4341 <PropertySelector as fidl::encoding::ValueTypeMarker>::borrow(val),
4342 encoder,
4343 offset + 8,
4344 _depth,
4345 )
4346 }
4347 TreeSelector::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
4348 }
4349 }
4350 }
4351
4352 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TreeSelector {
4353 #[inline(always)]
4354 fn new_empty() -> Self {
4355 Self::__SourceBreaking { unknown_ordinal: 0 }
4356 }
4357
4358 #[inline]
4359 unsafe fn decode(
4360 &mut self,
4361 decoder: &mut fidl::encoding::Decoder<'_, D>,
4362 offset: usize,
4363 mut depth: fidl::encoding::Depth,
4364 ) -> fidl::Result<()> {
4365 decoder.debug_check_bounds::<Self>(offset);
4366 #[allow(unused_variables)]
4367 let next_out_of_line = decoder.next_out_of_line();
4368 let handles_before = decoder.remaining_handles();
4369 let (ordinal, inlined, num_bytes, num_handles) =
4370 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4371
4372 let member_inline_size = match ordinal {
4373 1 => <SubtreeSelector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4374 2 => <PropertySelector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4375 0 => return Err(fidl::Error::UnknownUnionTag),
4376 _ => num_bytes as usize,
4377 };
4378
4379 if inlined != (member_inline_size <= 4) {
4380 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4381 }
4382 let _inner_offset;
4383 if inlined {
4384 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4385 _inner_offset = offset + 8;
4386 } else {
4387 depth.increment()?;
4388 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4389 }
4390 match ordinal {
4391 1 => {
4392 #[allow(irrefutable_let_patterns)]
4393 if let TreeSelector::SubtreeSelector(_) = self {
4394 } else {
4396 *self = TreeSelector::SubtreeSelector(fidl::new_empty!(SubtreeSelector, D));
4398 }
4399 #[allow(irrefutable_let_patterns)]
4400 if let TreeSelector::SubtreeSelector(ref mut val) = self {
4401 fidl::decode!(SubtreeSelector, D, val, decoder, _inner_offset, depth)?;
4402 } else {
4403 unreachable!()
4404 }
4405 }
4406 2 => {
4407 #[allow(irrefutable_let_patterns)]
4408 if let TreeSelector::PropertySelector(_) = self {
4409 } else {
4411 *self =
4413 TreeSelector::PropertySelector(fidl::new_empty!(PropertySelector, D));
4414 }
4415 #[allow(irrefutable_let_patterns)]
4416 if let TreeSelector::PropertySelector(ref mut val) = self {
4417 fidl::decode!(PropertySelector, D, val, decoder, _inner_offset, depth)?;
4418 } else {
4419 unreachable!()
4420 }
4421 }
4422 #[allow(deprecated)]
4423 ordinal => {
4424 for _ in 0..num_handles {
4425 decoder.drop_next_handle()?;
4426 }
4427 *self = TreeSelector::__SourceBreaking { unknown_ordinal: ordinal };
4428 }
4429 }
4430 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4431 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4432 }
4433 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4434 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4435 }
4436 Ok(())
4437 }
4438 }
4439}