1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub type All = ();
8
9 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10 #[repr(u8)]
11 pub enum DataType {
12 Inspect = 1,
13 Logs = 3,
14 }
15 impl ::core::convert::TryFrom<u8> for DataType {
16 type Error = ::fidl_next::UnknownStrictEnumMemberError;
17 fn try_from(
18 value: u8,
19 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
20 match value {
21 1 => Ok(Self::Inspect),
22 3 => Ok(Self::Logs),
23
24 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
25 }
26 }
27 }
28
29 impl ::std::convert::From<DataType> for u8 {
30 fn from(value: DataType) -> Self {
31 match value {
32 DataType::Inspect => 1,
33 DataType::Logs => 3,
34 }
35 }
36 }
37
38 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DataType, ___E> for DataType
39 where
40 ___E: ?Sized,
41 {
42 #[inline]
43 fn encode(
44 self,
45 encoder: &mut ___E,
46 out: &mut ::core::mem::MaybeUninit<crate::wire::DataType>,
47 _: (),
48 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
49 ::fidl_next::Encode::encode(&self, encoder, out, ())
50 }
51 }
52
53 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DataType, ___E> for &'a DataType
54 where
55 ___E: ?Sized,
56 {
57 #[inline]
58 fn encode(
59 self,
60 encoder: &mut ___E,
61 out: &mut ::core::mem::MaybeUninit<crate::wire::DataType>,
62 _: (),
63 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
64 ::fidl_next::munge!(let crate::wire::DataType { value } = out);
65 let _ = value.write(u8::from(match *self {
66 DataType::Inspect => 1,
67
68 DataType::Logs => 3,
69 }));
70
71 Ok(())
72 }
73 }
74
75 impl ::core::convert::From<crate::wire::DataType> for DataType {
76 fn from(wire: crate::wire::DataType) -> Self {
77 match u8::from(wire.value) {
78 1 => Self::Inspect,
79
80 3 => Self::Logs,
81
82 _ => unsafe { ::core::hint::unreachable_unchecked() },
83 }
84 }
85 }
86
87 impl ::fidl_next::FromWire<crate::wire::DataType> for DataType {
88 #[inline]
89 fn from_wire(wire: crate::wire::DataType) -> Self {
90 Self::from(wire)
91 }
92 }
93
94 impl ::fidl_next::FromWireRef<crate::wire::DataType> for DataType {
95 #[inline]
96 fn from_wire_ref(wire: &crate::wire::DataType) -> Self {
97 Self::from(*wire)
98 }
99 }
100
101 #[doc = " Enum specifying the modes by which a user can connect to and stream diagnostics metrics.\n"]
102 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
103 #[repr(u8)]
104 pub enum StreamMode {
105 Snapshot = 1,
106 SnapshotThenSubscribe = 2,
107 Subscribe = 3,
108 }
109 impl ::core::convert::TryFrom<u8> for StreamMode {
110 type Error = ::fidl_next::UnknownStrictEnumMemberError;
111 fn try_from(
112 value: u8,
113 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
114 match value {
115 1 => Ok(Self::Snapshot),
116 2 => Ok(Self::SnapshotThenSubscribe),
117 3 => Ok(Self::Subscribe),
118
119 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
120 }
121 }
122 }
123
124 impl ::std::convert::From<StreamMode> for u8 {
125 fn from(value: StreamMode) -> Self {
126 match value {
127 StreamMode::Snapshot => 1,
128 StreamMode::SnapshotThenSubscribe => 2,
129 StreamMode::Subscribe => 3,
130 }
131 }
132 }
133
134 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StreamMode, ___E> for StreamMode
135 where
136 ___E: ?Sized,
137 {
138 #[inline]
139 fn encode(
140 self,
141 encoder: &mut ___E,
142 out: &mut ::core::mem::MaybeUninit<crate::wire::StreamMode>,
143 _: (),
144 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
145 ::fidl_next::Encode::encode(&self, encoder, out, ())
146 }
147 }
148
149 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StreamMode, ___E> for &'a StreamMode
150 where
151 ___E: ?Sized,
152 {
153 #[inline]
154 fn encode(
155 self,
156 encoder: &mut ___E,
157 out: &mut ::core::mem::MaybeUninit<crate::wire::StreamMode>,
158 _: (),
159 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
160 ::fidl_next::munge!(let crate::wire::StreamMode { value } = out);
161 let _ = value.write(u8::from(match *self {
162 StreamMode::Snapshot => 1,
163
164 StreamMode::SnapshotThenSubscribe => 2,
165
166 StreamMode::Subscribe => 3,
167 }));
168
169 Ok(())
170 }
171 }
172
173 impl ::core::convert::From<crate::wire::StreamMode> for StreamMode {
174 fn from(wire: crate::wire::StreamMode) -> Self {
175 match u8::from(wire.value) {
176 1 => Self::Snapshot,
177
178 2 => Self::SnapshotThenSubscribe,
179
180 3 => Self::Subscribe,
181
182 _ => unsafe { ::core::hint::unreachable_unchecked() },
183 }
184 }
185 }
186
187 impl ::fidl_next::FromWire<crate::wire::StreamMode> for StreamMode {
188 #[inline]
189 fn from_wire(wire: crate::wire::StreamMode) -> Self {
190 Self::from(wire)
191 }
192 }
193
194 impl ::fidl_next::FromWireRef<crate::wire::StreamMode> for StreamMode {
195 #[inline]
196 fn from_wire_ref(wire: &crate::wire::StreamMode) -> Self {
197 Self::from(*wire)
198 }
199 }
200
201 #[doc = " Parameters which configure a diagnostics stream\'s performance properties.\n"]
202 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
203 pub struct PerformanceConfiguration {
204 pub max_aggregate_content_size_bytes: ::core::option::Option<u64>,
205
206 pub batch_retrieval_timeout_seconds: ::core::option::Option<i64>,
207 }
208
209 impl PerformanceConfiguration {
210 fn __max_ordinal(&self) -> usize {
211 if self.batch_retrieval_timeout_seconds.is_some() {
212 return 2;
213 }
214
215 if self.max_aggregate_content_size_bytes.is_some() {
216 return 1;
217 }
218
219 0
220 }
221 }
222
223 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PerformanceConfiguration<'static>, ___E>
224 for PerformanceConfiguration
225 where
226 ___E: ::fidl_next::Encoder + ?Sized,
227 {
228 #[inline]
229 fn encode(
230 mut self,
231 encoder: &mut ___E,
232 out: &mut ::core::mem::MaybeUninit<crate::wire::PerformanceConfiguration<'static>>,
233 _: (),
234 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
235 ::fidl_next::munge!(let crate::wire::PerformanceConfiguration { table } = out);
236
237 let max_ord = self.__max_ordinal();
238
239 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
240 ::fidl_next::Wire::zero_padding(&mut out);
241
242 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
243 ::fidl_next::wire::Envelope,
244 >(encoder, max_ord);
245
246 for i in 1..=max_ord {
247 match i {
248 2 => {
249 if let Some(value) = self.batch_retrieval_timeout_seconds.take() {
250 ::fidl_next::wire::Envelope::encode_value::<
251 ::fidl_next::wire::Int64,
252 ___E,
253 >(
254 value, preallocated.encoder, &mut out, ()
255 )?;
256 } else {
257 ::fidl_next::wire::Envelope::encode_zero(&mut out)
258 }
259 }
260
261 1 => {
262 if let Some(value) = self.max_aggregate_content_size_bytes.take() {
263 ::fidl_next::wire::Envelope::encode_value::<
264 ::fidl_next::wire::Uint64,
265 ___E,
266 >(
267 value, preallocated.encoder, &mut out, ()
268 )?;
269 } else {
270 ::fidl_next::wire::Envelope::encode_zero(&mut out)
271 }
272 }
273
274 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
275 }
276 unsafe {
277 preallocated.write_next(out.assume_init_ref());
278 }
279 }
280
281 ::fidl_next::wire::Table::encode_len(table, max_ord);
282
283 Ok(())
284 }
285 }
286
287 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PerformanceConfiguration<'static>, ___E>
288 for &'a PerformanceConfiguration
289 where
290 ___E: ::fidl_next::Encoder + ?Sized,
291 {
292 #[inline]
293 fn encode(
294 self,
295 encoder: &mut ___E,
296 out: &mut ::core::mem::MaybeUninit<crate::wire::PerformanceConfiguration<'static>>,
297 _: (),
298 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
299 ::fidl_next::munge!(let crate::wire::PerformanceConfiguration { table } = out);
300
301 let max_ord = self.__max_ordinal();
302
303 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
304 ::fidl_next::Wire::zero_padding(&mut out);
305
306 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
307 ::fidl_next::wire::Envelope,
308 >(encoder, max_ord);
309
310 for i in 1..=max_ord {
311 match i {
312 2 => {
313 if let Some(value) = &self.batch_retrieval_timeout_seconds {
314 ::fidl_next::wire::Envelope::encode_value::<
315 ::fidl_next::wire::Int64,
316 ___E,
317 >(
318 value, preallocated.encoder, &mut out, ()
319 )?;
320 } else {
321 ::fidl_next::wire::Envelope::encode_zero(&mut out)
322 }
323 }
324
325 1 => {
326 if let Some(value) = &self.max_aggregate_content_size_bytes {
327 ::fidl_next::wire::Envelope::encode_value::<
328 ::fidl_next::wire::Uint64,
329 ___E,
330 >(
331 value, preallocated.encoder, &mut out, ()
332 )?;
333 } else {
334 ::fidl_next::wire::Envelope::encode_zero(&mut out)
335 }
336 }
337
338 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
339 }
340 unsafe {
341 preallocated.write_next(out.assume_init_ref());
342 }
343 }
344
345 ::fidl_next::wire::Table::encode_len(table, max_ord);
346
347 Ok(())
348 }
349 }
350
351 impl<'de> ::fidl_next::FromWire<crate::wire::PerformanceConfiguration<'de>>
352 for PerformanceConfiguration
353 {
354 #[inline]
355 fn from_wire(wire_: crate::wire::PerformanceConfiguration<'de>) -> Self {
356 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
357
358 let max_aggregate_content_size_bytes = wire_.table.get(1);
359
360 let batch_retrieval_timeout_seconds = wire_.table.get(2);
361
362 Self {
363 max_aggregate_content_size_bytes: max_aggregate_content_size_bytes.map(
364 |envelope| {
365 ::fidl_next::FromWire::from_wire(unsafe {
366 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
367 })
368 },
369 ),
370
371 batch_retrieval_timeout_seconds: batch_retrieval_timeout_seconds.map(|envelope| {
372 ::fidl_next::FromWire::from_wire(unsafe {
373 envelope.read_unchecked::<::fidl_next::wire::Int64>()
374 })
375 }),
376 }
377 }
378 }
379
380 impl<'de> ::fidl_next::FromWireRef<crate::wire::PerformanceConfiguration<'de>>
381 for PerformanceConfiguration
382 {
383 #[inline]
384 fn from_wire_ref(wire: &crate::wire::PerformanceConfiguration<'de>) -> Self {
385 Self {
386 max_aggregate_content_size_bytes: wire.table.get(1).map(|envelope| {
387 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
388 envelope.deref_unchecked::<::fidl_next::wire::Uint64>()
389 })
390 }),
391
392 batch_retrieval_timeout_seconds: wire.table.get(2).map(|envelope| {
393 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
394 envelope.deref_unchecked::<::fidl_next::wire::Int64>()
395 })
396 }),
397 }
398 }
399 }
400
401 #[doc = " StringSelector is an union defining different ways to describe a pattern to match\n strings against.\n"]
402 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
403 pub enum StringSelector {
404 StringPattern(::std::string::String),
405
406 ExactMatch(::std::string::String),
407
408 UnknownOrdinal_(u64),
409 }
410
411 impl StringSelector {
412 pub fn is_unknown(&self) -> bool {
413 #[allow(unreachable_patterns)]
414 match self {
415 Self::UnknownOrdinal_(_) => true,
416 _ => false,
417 }
418 }
419 }
420
421 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StringSelector<'static>, ___E> for StringSelector
422 where
423 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
424 ___E: ::fidl_next::Encoder,
425 {
426 #[inline]
427 fn encode(
428 self,
429 encoder: &mut ___E,
430 out: &mut ::core::mem::MaybeUninit<crate::wire::StringSelector<'static>>,
431 _: (),
432 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
433 ::fidl_next::munge!(let crate::wire::StringSelector { raw, _phantom: _ } = out);
434
435 match self {
436 Self::StringPattern(value) => ::fidl_next::wire::Union::encode_as::<
437 ___E,
438 ::fidl_next::wire::String<'static>,
439 >(value, 1, encoder, raw, 1024)?,
440
441 Self::ExactMatch(value) => ::fidl_next::wire::Union::encode_as::<
442 ___E,
443 ::fidl_next::wire::String<'static>,
444 >(value, 2, encoder, raw, 1024)?,
445
446 Self::UnknownOrdinal_(ordinal) => {
447 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
448 }
449 }
450
451 Ok(())
452 }
453 }
454
455 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StringSelector<'static>, ___E>
456 for &'a StringSelector
457 where
458 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
459 ___E: ::fidl_next::Encoder,
460 {
461 #[inline]
462 fn encode(
463 self,
464 encoder: &mut ___E,
465 out: &mut ::core::mem::MaybeUninit<crate::wire::StringSelector<'static>>,
466 _: (),
467 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
468 ::fidl_next::munge!(let crate::wire::StringSelector { raw, _phantom: _ } = out);
469
470 match self {
471 StringSelector::StringPattern(value) => {
472 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
473 value, 1, encoder, raw, 1024,
474 )?
475 }
476
477 StringSelector::ExactMatch(value) => {
478 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
479 value, 2, encoder, raw, 1024,
480 )?
481 }
482
483 StringSelector::UnknownOrdinal_(ordinal) => {
484 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
485 }
486 }
487
488 Ok(())
489 }
490 }
491
492 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::StringSelector<'static>, ___E>
493 for StringSelector
494 where
495 ___E: ?Sized,
496 StringSelector: ::fidl_next::Encode<crate::wire::StringSelector<'static>, ___E>,
497 {
498 #[inline]
499 fn encode_option(
500 this: ::core::option::Option<Self>,
501 encoder: &mut ___E,
502 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::StringSelector<'static>>,
503 _: (),
504 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
505 ::fidl_next::munge!(let crate::wire_optional::StringSelector { raw, _phantom: _ } = &mut *out);
506
507 if let Some(inner) = this {
508 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
509 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
510 } else {
511 ::fidl_next::wire::Union::encode_absent(raw);
512 }
513
514 Ok(())
515 }
516 }
517
518 unsafe impl<'a, ___E>
519 ::fidl_next::EncodeOption<crate::wire_optional::StringSelector<'static>, ___E>
520 for &'a StringSelector
521 where
522 ___E: ?Sized,
523 &'a StringSelector: ::fidl_next::Encode<crate::wire::StringSelector<'static>, ___E>,
524 {
525 #[inline]
526 fn encode_option(
527 this: ::core::option::Option<Self>,
528 encoder: &mut ___E,
529 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::StringSelector<'static>>,
530 _: (),
531 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
532 ::fidl_next::munge!(let crate::wire_optional::StringSelector { raw, _phantom: _ } = &mut *out);
533
534 if let Some(inner) = this {
535 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
536 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
537 } else {
538 ::fidl_next::wire::Union::encode_absent(raw);
539 }
540
541 Ok(())
542 }
543 }
544
545 impl<'de> ::fidl_next::FromWire<crate::wire::StringSelector<'de>> for StringSelector {
546 #[inline]
547 fn from_wire(wire: crate::wire::StringSelector<'de>) -> Self {
548 let wire = ::core::mem::ManuallyDrop::new(wire);
549 match wire.raw.ordinal() {
550 1 => Self::StringPattern(::fidl_next::FromWire::from_wire(unsafe {
551 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
552 })),
553
554 2 => Self::ExactMatch(::fidl_next::FromWire::from_wire(unsafe {
555 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
556 })),
557
558 ord => return Self::UnknownOrdinal_(ord as u64),
559 }
560 }
561 }
562
563 impl<'de> ::fidl_next::FromWireRef<crate::wire::StringSelector<'de>> for StringSelector {
564 #[inline]
565 fn from_wire_ref(wire: &crate::wire::StringSelector<'de>) -> Self {
566 match wire.raw.ordinal() {
567 1 => Self::StringPattern(::fidl_next::FromWireRef::from_wire_ref(unsafe {
568 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
569 })),
570
571 2 => Self::ExactMatch(::fidl_next::FromWireRef::from_wire_ref(unsafe {
572 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
573 })),
574
575 ord => return Self::UnknownOrdinal_(ord as u64),
576 }
577 }
578 }
579
580 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::StringSelector<'de>>
581 for StringSelector
582 {
583 #[inline]
584 fn from_wire_option(
585 wire: crate::wire_optional::StringSelector<'de>,
586 ) -> ::core::option::Option<Self> {
587 if let Some(inner) = wire.into_option() {
588 Some(::fidl_next::FromWire::from_wire(inner))
589 } else {
590 None
591 }
592 }
593 }
594
595 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::StringSelector<'de>>
596 for Box<StringSelector>
597 {
598 #[inline]
599 fn from_wire_option(
600 wire: crate::wire_optional::StringSelector<'de>,
601 ) -> ::core::option::Option<Self> {
602 <StringSelector as ::fidl_next::FromWireOption<
603 crate::wire_optional::StringSelector<'de>,
604 >>::from_wire_option(wire)
605 .map(Box::new)
606 }
607 }
608
609 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::StringSelector<'de>>
610 for Box<StringSelector>
611 {
612 #[inline]
613 fn from_wire_option_ref(
614 wire: &crate::wire_optional::StringSelector<'de>,
615 ) -> ::core::option::Option<Self> {
616 if let Some(inner) = wire.as_ref() {
617 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
618 } else {
619 None
620 }
621 }
622 }
623
624 #[doc = " Specifies a pattern of component monikers which\n identify components being selected for.\n\n Component selectors support wildcarding, which will glob a single \"level\" of a\n component moniker. eg:\n core/*/echo\n will match all echo instances running only in realms directly under core, but none\n nested further.\n\n Component selectors also support a recursive wildcard, which will glob multiple\n \"levels\" of a component moniker. eg:\n core/**\n will match all component instances running under core/ and all descendants of it.\n Note that the wildcard does not select core itself. Clients that wish to choose a\n subtree including the root should pass two selectors, eg:\n core\n core/**\n The recursive wildcard is only allowed as the final segment of the selector.\n"]
625 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
626 pub struct ComponentSelector {
627 pub moniker_segments:
628 ::core::option::Option<::std::vec::Vec<crate::natural::StringSelector>>,
629 }
630
631 impl ComponentSelector {
632 fn __max_ordinal(&self) -> usize {
633 if self.moniker_segments.is_some() {
634 return 1;
635 }
636
637 0
638 }
639 }
640
641 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ComponentSelector<'static>, ___E>
642 for ComponentSelector
643 where
644 ___E: ::fidl_next::Encoder + ?Sized,
645 {
646 #[inline]
647 fn encode(
648 mut self,
649 encoder: &mut ___E,
650 out: &mut ::core::mem::MaybeUninit<crate::wire::ComponentSelector<'static>>,
651 _: (),
652 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
653 ::fidl_next::munge!(let crate::wire::ComponentSelector { table } = out);
654
655 let max_ord = self.__max_ordinal();
656
657 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
658 ::fidl_next::Wire::zero_padding(&mut out);
659
660 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
661 ::fidl_next::wire::Envelope,
662 >(encoder, max_ord);
663
664 for i in 1..=max_ord {
665 match i {
666 1 => {
667 if let Some(value) = self.moniker_segments.take() {
668 ::fidl_next::wire::Envelope::encode_value::<
669 ::fidl_next::wire::Vector<
670 'static,
671 crate::wire::StringSelector<'static>,
672 >,
673 ___E,
674 >(
675 value, preallocated.encoder, &mut out, (25, ())
676 )?;
677 } else {
678 ::fidl_next::wire::Envelope::encode_zero(&mut out)
679 }
680 }
681
682 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
683 }
684 unsafe {
685 preallocated.write_next(out.assume_init_ref());
686 }
687 }
688
689 ::fidl_next::wire::Table::encode_len(table, max_ord);
690
691 Ok(())
692 }
693 }
694
695 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ComponentSelector<'static>, ___E>
696 for &'a ComponentSelector
697 where
698 ___E: ::fidl_next::Encoder + ?Sized,
699 {
700 #[inline]
701 fn encode(
702 self,
703 encoder: &mut ___E,
704 out: &mut ::core::mem::MaybeUninit<crate::wire::ComponentSelector<'static>>,
705 _: (),
706 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
707 ::fidl_next::munge!(let crate::wire::ComponentSelector { table } = out);
708
709 let max_ord = self.__max_ordinal();
710
711 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
712 ::fidl_next::Wire::zero_padding(&mut out);
713
714 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
715 ::fidl_next::wire::Envelope,
716 >(encoder, max_ord);
717
718 for i in 1..=max_ord {
719 match i {
720 1 => {
721 if let Some(value) = &self.moniker_segments {
722 ::fidl_next::wire::Envelope::encode_value::<
723 ::fidl_next::wire::Vector<
724 'static,
725 crate::wire::StringSelector<'static>,
726 >,
727 ___E,
728 >(
729 value, preallocated.encoder, &mut out, (25, ())
730 )?;
731 } else {
732 ::fidl_next::wire::Envelope::encode_zero(&mut out)
733 }
734 }
735
736 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
737 }
738 unsafe {
739 preallocated.write_next(out.assume_init_ref());
740 }
741 }
742
743 ::fidl_next::wire::Table::encode_len(table, max_ord);
744
745 Ok(())
746 }
747 }
748
749 impl<'de> ::fidl_next::FromWire<crate::wire::ComponentSelector<'de>> for ComponentSelector {
750 #[inline]
751 fn from_wire(wire_: crate::wire::ComponentSelector<'de>) -> Self {
752 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
753
754 let moniker_segments = wire_.table.get(1);
755
756 Self {
757
758
759 moniker_segments: moniker_segments.map(|envelope| ::fidl_next::FromWire::from_wire(
760 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>>() }
761 )),
762
763 }
764 }
765 }
766
767 impl<'de> ::fidl_next::FromWireRef<crate::wire::ComponentSelector<'de>> for ComponentSelector {
768 #[inline]
769 fn from_wire_ref(wire: &crate::wire::ComponentSelector<'de>) -> Self {
770 Self {
771
772
773 moniker_segments: wire.table.get(1)
774 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
775 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>>() }
776 )),
777
778 }
779 }
780 }
781
782 #[doc = " A selector defining a set of nodes to match, for which the entire subtree including\n those nodes are selected.\n"]
783 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
784 pub struct SubtreeSelector {
785 pub node_path: ::std::vec::Vec<crate::natural::StringSelector>,
786 }
787
788 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SubtreeSelector<'static>, ___E>
789 for SubtreeSelector
790 where
791 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
792 ___E: ::fidl_next::Encoder,
793 {
794 #[inline]
795 fn encode(
796 self,
797 encoder_: &mut ___E,
798 out_: &mut ::core::mem::MaybeUninit<crate::wire::SubtreeSelector<'static>>,
799 _: (),
800 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
801 ::fidl_next::munge! {
802 let crate::wire::SubtreeSelector {
803 node_path,
804
805 } = out_;
806 }
807
808 ::fidl_next::Encode::encode(self.node_path, encoder_, node_path, (100, ()))?;
809
810 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(node_path.as_mut_ptr()) };
811 ::fidl_next::Constrained::validate(_field, (100, ()))?;
812
813 Ok(())
814 }
815 }
816
817 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SubtreeSelector<'static>, ___E>
818 for &'a SubtreeSelector
819 where
820 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
821 ___E: ::fidl_next::Encoder,
822 {
823 #[inline]
824 fn encode(
825 self,
826 encoder_: &mut ___E,
827 out_: &mut ::core::mem::MaybeUninit<crate::wire::SubtreeSelector<'static>>,
828 _: (),
829 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
830 ::fidl_next::munge! {
831 let crate::wire::SubtreeSelector {
832 node_path,
833
834 } = out_;
835 }
836
837 ::fidl_next::Encode::encode(&self.node_path, encoder_, node_path, (100, ()))?;
838
839 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(node_path.as_mut_ptr()) };
840 ::fidl_next::Constrained::validate(_field, (100, ()))?;
841
842 Ok(())
843 }
844 }
845
846 unsafe impl<___E>
847 ::fidl_next::EncodeOption<
848 ::fidl_next::wire::Box<'static, crate::wire::SubtreeSelector<'static>>,
849 ___E,
850 > for SubtreeSelector
851 where
852 ___E: ::fidl_next::Encoder + ?Sized,
853 SubtreeSelector: ::fidl_next::Encode<crate::wire::SubtreeSelector<'static>, ___E>,
854 {
855 #[inline]
856 fn encode_option(
857 this: ::core::option::Option<Self>,
858 encoder: &mut ___E,
859 out: &mut ::core::mem::MaybeUninit<
860 ::fidl_next::wire::Box<'static, crate::wire::SubtreeSelector<'static>>,
861 >,
862 _: (),
863 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
864 if let Some(inner) = this {
865 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
866 ::fidl_next::wire::Box::encode_present(out);
867 } else {
868 ::fidl_next::wire::Box::encode_absent(out);
869 }
870
871 Ok(())
872 }
873 }
874
875 unsafe impl<'a, ___E>
876 ::fidl_next::EncodeOption<
877 ::fidl_next::wire::Box<'static, crate::wire::SubtreeSelector<'static>>,
878 ___E,
879 > for &'a SubtreeSelector
880 where
881 ___E: ::fidl_next::Encoder + ?Sized,
882 &'a SubtreeSelector: ::fidl_next::Encode<crate::wire::SubtreeSelector<'static>, ___E>,
883 {
884 #[inline]
885 fn encode_option(
886 this: ::core::option::Option<Self>,
887 encoder: &mut ___E,
888 out: &mut ::core::mem::MaybeUninit<
889 ::fidl_next::wire::Box<'static, crate::wire::SubtreeSelector<'static>>,
890 >,
891 _: (),
892 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
893 if let Some(inner) = this {
894 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
895 ::fidl_next::wire::Box::encode_present(out);
896 } else {
897 ::fidl_next::wire::Box::encode_absent(out);
898 }
899
900 Ok(())
901 }
902 }
903
904 impl<'de> ::fidl_next::FromWire<crate::wire::SubtreeSelector<'de>> for SubtreeSelector {
905 #[inline]
906 fn from_wire(wire: crate::wire::SubtreeSelector<'de>) -> Self {
907 Self { node_path: ::fidl_next::FromWire::from_wire(wire.node_path) }
908 }
909 }
910
911 impl<'de> ::fidl_next::FromWireRef<crate::wire::SubtreeSelector<'de>> for SubtreeSelector {
912 #[inline]
913 fn from_wire_ref(wire: &crate::wire::SubtreeSelector<'de>) -> Self {
914 Self { node_path: ::fidl_next::FromWireRef::from_wire_ref(&wire.node_path) }
915 }
916 }
917
918 #[doc = " A selector defining a set of nodes to match, and on those matched nodes a set of named\n properties to match.\n"]
919 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
920 pub struct PropertySelector {
921 pub node_path: ::std::vec::Vec<crate::natural::StringSelector>,
922
923 pub target_properties: crate::natural::StringSelector,
924 }
925
926 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PropertySelector<'static>, ___E>
927 for PropertySelector
928 where
929 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
930 ___E: ::fidl_next::Encoder,
931 {
932 #[inline]
933 fn encode(
934 self,
935 encoder_: &mut ___E,
936 out_: &mut ::core::mem::MaybeUninit<crate::wire::PropertySelector<'static>>,
937 _: (),
938 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
939 ::fidl_next::munge! {
940 let crate::wire::PropertySelector {
941 node_path,
942 target_properties,
943
944 } = out_;
945 }
946
947 ::fidl_next::Encode::encode(self.node_path, encoder_, node_path, (100, ()))?;
948
949 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(node_path.as_mut_ptr()) };
950 ::fidl_next::Constrained::validate(_field, (100, ()))?;
951
952 ::fidl_next::Encode::encode(self.target_properties, encoder_, target_properties, ())?;
953
954 let mut _field =
955 unsafe { ::fidl_next::Slot::new_unchecked(target_properties.as_mut_ptr()) };
956
957 Ok(())
958 }
959 }
960
961 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::PropertySelector<'static>, ___E>
962 for &'a PropertySelector
963 where
964 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
965 ___E: ::fidl_next::Encoder,
966 {
967 #[inline]
968 fn encode(
969 self,
970 encoder_: &mut ___E,
971 out_: &mut ::core::mem::MaybeUninit<crate::wire::PropertySelector<'static>>,
972 _: (),
973 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
974 ::fidl_next::munge! {
975 let crate::wire::PropertySelector {
976 node_path,
977 target_properties,
978
979 } = out_;
980 }
981
982 ::fidl_next::Encode::encode(&self.node_path, encoder_, node_path, (100, ()))?;
983
984 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(node_path.as_mut_ptr()) };
985 ::fidl_next::Constrained::validate(_field, (100, ()))?;
986
987 ::fidl_next::Encode::encode(&self.target_properties, encoder_, target_properties, ())?;
988
989 let mut _field =
990 unsafe { ::fidl_next::Slot::new_unchecked(target_properties.as_mut_ptr()) };
991
992 Ok(())
993 }
994 }
995
996 unsafe impl<___E>
997 ::fidl_next::EncodeOption<
998 ::fidl_next::wire::Box<'static, crate::wire::PropertySelector<'static>>,
999 ___E,
1000 > for PropertySelector
1001 where
1002 ___E: ::fidl_next::Encoder + ?Sized,
1003 PropertySelector: ::fidl_next::Encode<crate::wire::PropertySelector<'static>, ___E>,
1004 {
1005 #[inline]
1006 fn encode_option(
1007 this: ::core::option::Option<Self>,
1008 encoder: &mut ___E,
1009 out: &mut ::core::mem::MaybeUninit<
1010 ::fidl_next::wire::Box<'static, crate::wire::PropertySelector<'static>>,
1011 >,
1012 _: (),
1013 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1014 if let Some(inner) = this {
1015 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1016 ::fidl_next::wire::Box::encode_present(out);
1017 } else {
1018 ::fidl_next::wire::Box::encode_absent(out);
1019 }
1020
1021 Ok(())
1022 }
1023 }
1024
1025 unsafe impl<'a, ___E>
1026 ::fidl_next::EncodeOption<
1027 ::fidl_next::wire::Box<'static, crate::wire::PropertySelector<'static>>,
1028 ___E,
1029 > for &'a PropertySelector
1030 where
1031 ___E: ::fidl_next::Encoder + ?Sized,
1032 &'a PropertySelector: ::fidl_next::Encode<crate::wire::PropertySelector<'static>, ___E>,
1033 {
1034 #[inline]
1035 fn encode_option(
1036 this: ::core::option::Option<Self>,
1037 encoder: &mut ___E,
1038 out: &mut ::core::mem::MaybeUninit<
1039 ::fidl_next::wire::Box<'static, crate::wire::PropertySelector<'static>>,
1040 >,
1041 _: (),
1042 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1043 if let Some(inner) = this {
1044 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1045 ::fidl_next::wire::Box::encode_present(out);
1046 } else {
1047 ::fidl_next::wire::Box::encode_absent(out);
1048 }
1049
1050 Ok(())
1051 }
1052 }
1053
1054 impl<'de> ::fidl_next::FromWire<crate::wire::PropertySelector<'de>> for PropertySelector {
1055 #[inline]
1056 fn from_wire(wire: crate::wire::PropertySelector<'de>) -> Self {
1057 Self {
1058 node_path: ::fidl_next::FromWire::from_wire(wire.node_path),
1059
1060 target_properties: ::fidl_next::FromWire::from_wire(wire.target_properties),
1061 }
1062 }
1063 }
1064
1065 impl<'de> ::fidl_next::FromWireRef<crate::wire::PropertySelector<'de>> for PropertySelector {
1066 #[inline]
1067 fn from_wire_ref(wire: &crate::wire::PropertySelector<'de>) -> Self {
1068 Self {
1069 node_path: ::fidl_next::FromWireRef::from_wire_ref(&wire.node_path),
1070
1071 target_properties: ::fidl_next::FromWireRef::from_wire_ref(&wire.target_properties),
1072 }
1073 }
1074 }
1075
1076 #[doc = " TreeSelector represents a selection request on a hierarchy of named nodes, with\n named properties on those nodes.\n"]
1077 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1078 pub enum TreeSelector {
1079 SubtreeSelector(crate::natural::SubtreeSelector),
1080
1081 PropertySelector(crate::natural::PropertySelector),
1082
1083 UnknownOrdinal_(u64),
1084 }
1085
1086 impl TreeSelector {
1087 pub fn is_unknown(&self) -> bool {
1088 #[allow(unreachable_patterns)]
1089 match self {
1090 Self::UnknownOrdinal_(_) => true,
1091 _ => false,
1092 }
1093 }
1094 }
1095
1096 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TreeSelector<'static>, ___E> for TreeSelector
1097 where
1098 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1099 ___E: ::fidl_next::Encoder,
1100 {
1101 #[inline]
1102 fn encode(
1103 self,
1104 encoder: &mut ___E,
1105 out: &mut ::core::mem::MaybeUninit<crate::wire::TreeSelector<'static>>,
1106 _: (),
1107 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1108 ::fidl_next::munge!(let crate::wire::TreeSelector { raw, _phantom: _ } = out);
1109
1110 match self {
1111 Self::SubtreeSelector(value) => ::fidl_next::wire::Union::encode_as::<
1112 ___E,
1113 crate::wire::SubtreeSelector<'static>,
1114 >(value, 1, encoder, raw, ())?,
1115
1116 Self::PropertySelector(value) => ::fidl_next::wire::Union::encode_as::<
1117 ___E,
1118 crate::wire::PropertySelector<'static>,
1119 >(value, 2, encoder, raw, ())?,
1120
1121 Self::UnknownOrdinal_(ordinal) => {
1122 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1123 }
1124 }
1125
1126 Ok(())
1127 }
1128 }
1129
1130 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TreeSelector<'static>, ___E>
1131 for &'a TreeSelector
1132 where
1133 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1134 ___E: ::fidl_next::Encoder,
1135 {
1136 #[inline]
1137 fn encode(
1138 self,
1139 encoder: &mut ___E,
1140 out: &mut ::core::mem::MaybeUninit<crate::wire::TreeSelector<'static>>,
1141 _: (),
1142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1143 ::fidl_next::munge!(let crate::wire::TreeSelector { raw, _phantom: _ } = out);
1144
1145 match self {
1146 TreeSelector::SubtreeSelector(value) => {
1147 ::fidl_next::wire::Union::encode_as::<
1148 ___E,
1149 crate::wire::SubtreeSelector<'static>,
1150 >(value, 1, encoder, raw, ())?
1151 }
1152
1153 TreeSelector::PropertySelector(value) => {
1154 ::fidl_next::wire::Union::encode_as::<
1155 ___E,
1156 crate::wire::PropertySelector<'static>,
1157 >(value, 2, encoder, raw, ())?
1158 }
1159
1160 TreeSelector::UnknownOrdinal_(ordinal) => {
1161 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1162 }
1163 }
1164
1165 Ok(())
1166 }
1167 }
1168
1169 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::TreeSelector<'static>, ___E>
1170 for TreeSelector
1171 where
1172 ___E: ?Sized,
1173 TreeSelector: ::fidl_next::Encode<crate::wire::TreeSelector<'static>, ___E>,
1174 {
1175 #[inline]
1176 fn encode_option(
1177 this: ::core::option::Option<Self>,
1178 encoder: &mut ___E,
1179 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::TreeSelector<'static>>,
1180 _: (),
1181 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1182 ::fidl_next::munge!(let crate::wire_optional::TreeSelector { raw, _phantom: _ } = &mut *out);
1183
1184 if let Some(inner) = this {
1185 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1186 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1187 } else {
1188 ::fidl_next::wire::Union::encode_absent(raw);
1189 }
1190
1191 Ok(())
1192 }
1193 }
1194
1195 unsafe impl<'a, ___E>
1196 ::fidl_next::EncodeOption<crate::wire_optional::TreeSelector<'static>, ___E>
1197 for &'a TreeSelector
1198 where
1199 ___E: ?Sized,
1200 &'a TreeSelector: ::fidl_next::Encode<crate::wire::TreeSelector<'static>, ___E>,
1201 {
1202 #[inline]
1203 fn encode_option(
1204 this: ::core::option::Option<Self>,
1205 encoder: &mut ___E,
1206 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::TreeSelector<'static>>,
1207 _: (),
1208 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1209 ::fidl_next::munge!(let crate::wire_optional::TreeSelector { raw, _phantom: _ } = &mut *out);
1210
1211 if let Some(inner) = this {
1212 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1213 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1214 } else {
1215 ::fidl_next::wire::Union::encode_absent(raw);
1216 }
1217
1218 Ok(())
1219 }
1220 }
1221
1222 impl<'de> ::fidl_next::FromWire<crate::wire::TreeSelector<'de>> for TreeSelector {
1223 #[inline]
1224 fn from_wire(wire: crate::wire::TreeSelector<'de>) -> Self {
1225 let wire = ::core::mem::ManuallyDrop::new(wire);
1226 match wire.raw.ordinal() {
1227 1 => Self::SubtreeSelector(::fidl_next::FromWire::from_wire(unsafe {
1228 wire.raw.get().read_unchecked::<crate::wire::SubtreeSelector<'de>>()
1229 })),
1230
1231 2 => Self::PropertySelector(::fidl_next::FromWire::from_wire(unsafe {
1232 wire.raw.get().read_unchecked::<crate::wire::PropertySelector<'de>>()
1233 })),
1234
1235 ord => return Self::UnknownOrdinal_(ord as u64),
1236 }
1237 }
1238 }
1239
1240 impl<'de> ::fidl_next::FromWireRef<crate::wire::TreeSelector<'de>> for TreeSelector {
1241 #[inline]
1242 fn from_wire_ref(wire: &crate::wire::TreeSelector<'de>) -> Self {
1243 match wire.raw.ordinal() {
1244 1 => Self::SubtreeSelector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1245 wire.raw.get().deref_unchecked::<crate::wire::SubtreeSelector<'de>>()
1246 })),
1247
1248 2 => Self::PropertySelector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1249 wire.raw.get().deref_unchecked::<crate::wire::PropertySelector<'de>>()
1250 })),
1251
1252 ord => return Self::UnknownOrdinal_(ord as u64),
1253 }
1254 }
1255 }
1256
1257 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::TreeSelector<'de>> for TreeSelector {
1258 #[inline]
1259 fn from_wire_option(
1260 wire: crate::wire_optional::TreeSelector<'de>,
1261 ) -> ::core::option::Option<Self> {
1262 if let Some(inner) = wire.into_option() {
1263 Some(::fidl_next::FromWire::from_wire(inner))
1264 } else {
1265 None
1266 }
1267 }
1268 }
1269
1270 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::TreeSelector<'de>>
1271 for Box<TreeSelector>
1272 {
1273 #[inline]
1274 fn from_wire_option(
1275 wire: crate::wire_optional::TreeSelector<'de>,
1276 ) -> ::core::option::Option<Self> {
1277 <
1278 TreeSelector as ::fidl_next::FromWireOption<crate::wire_optional::TreeSelector<'de>>
1279 >::from_wire_option(wire).map(Box::new)
1280 }
1281 }
1282
1283 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::TreeSelector<'de>>
1284 for Box<TreeSelector>
1285 {
1286 #[inline]
1287 fn from_wire_option_ref(
1288 wire: &crate::wire_optional::TreeSelector<'de>,
1289 ) -> ::core::option::Option<Self> {
1290 if let Some(inner) = wire.as_ref() {
1291 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1292 } else {
1293 None
1294 }
1295 }
1296 }
1297
1298 #[doc = " TreeNames are the set of names of fuchsia.inspect.Trees for a component that\n were parsed out of a selector. The hierarchy and property selector portions\n will only be applied to trees that match this set.\n"]
1299 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1300 pub enum TreeNames {
1301 Some(::std::vec::Vec<::std::string::String>),
1302
1303 All(crate::natural::All),
1304
1305 UnknownOrdinal_(u64),
1306 }
1307
1308 impl TreeNames {
1309 pub fn is_unknown(&self) -> bool {
1310 #[allow(unreachable_patterns)]
1311 match self {
1312 Self::UnknownOrdinal_(_) => true,
1313 _ => false,
1314 }
1315 }
1316 }
1317
1318 unsafe impl<___E> ::fidl_next::Encode<crate::wire::TreeNames<'static>, ___E> for TreeNames
1319 where
1320 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1321 ___E: ::fidl_next::Encoder,
1322 {
1323 #[inline]
1324 fn encode(
1325 self,
1326 encoder: &mut ___E,
1327 out: &mut ::core::mem::MaybeUninit<crate::wire::TreeNames<'static>>,
1328 _: (),
1329 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1330 ::fidl_next::munge!(let crate::wire::TreeNames { raw, _phantom: _ } = out);
1331
1332 match self {
1333 Self::Some(value) => ::fidl_next::wire::Union::encode_as::<
1334 ___E,
1335 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
1336 >(value, 1, encoder, raw, (4294967295, 1024))?,
1337
1338 Self::All(value) => ::fidl_next::wire::Union::encode_as::<___E, crate::wire::All>(
1339 value,
1340 2,
1341 encoder,
1342 raw,
1343 (),
1344 )?,
1345
1346 Self::UnknownOrdinal_(ordinal) => {
1347 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1348 }
1349 }
1350
1351 Ok(())
1352 }
1353 }
1354
1355 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::TreeNames<'static>, ___E> for &'a TreeNames
1356 where
1357 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1358 ___E: ::fidl_next::Encoder,
1359 {
1360 #[inline]
1361 fn encode(
1362 self,
1363 encoder: &mut ___E,
1364 out: &mut ::core::mem::MaybeUninit<crate::wire::TreeNames<'static>>,
1365 _: (),
1366 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1367 ::fidl_next::munge!(let crate::wire::TreeNames { raw, _phantom: _ } = out);
1368
1369 match self {
1370 TreeNames::Some(value) => {
1371 ::fidl_next::wire::Union::encode_as::<
1372 ___E,
1373 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
1374 >(value, 1, encoder, raw, (4294967295, 1024))?
1375 }
1376
1377 TreeNames::All(value) => ::fidl_next::wire::Union::encode_as::<
1378 ___E,
1379 crate::wire::All,
1380 >(value, 2, encoder, raw, ())?,
1381
1382 TreeNames::UnknownOrdinal_(ordinal) => {
1383 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1384 }
1385 }
1386
1387 Ok(())
1388 }
1389 }
1390
1391 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::TreeNames<'static>, ___E>
1392 for TreeNames
1393 where
1394 ___E: ?Sized,
1395 TreeNames: ::fidl_next::Encode<crate::wire::TreeNames<'static>, ___E>,
1396 {
1397 #[inline]
1398 fn encode_option(
1399 this: ::core::option::Option<Self>,
1400 encoder: &mut ___E,
1401 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::TreeNames<'static>>,
1402 _: (),
1403 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1404 ::fidl_next::munge!(let crate::wire_optional::TreeNames { raw, _phantom: _ } = &mut *out);
1405
1406 if let Some(inner) = this {
1407 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1408 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1409 } else {
1410 ::fidl_next::wire::Union::encode_absent(raw);
1411 }
1412
1413 Ok(())
1414 }
1415 }
1416
1417 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::TreeNames<'static>, ___E>
1418 for &'a TreeNames
1419 where
1420 ___E: ?Sized,
1421 &'a TreeNames: ::fidl_next::Encode<crate::wire::TreeNames<'static>, ___E>,
1422 {
1423 #[inline]
1424 fn encode_option(
1425 this: ::core::option::Option<Self>,
1426 encoder: &mut ___E,
1427 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::TreeNames<'static>>,
1428 _: (),
1429 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1430 ::fidl_next::munge!(let crate::wire_optional::TreeNames { raw, _phantom: _ } = &mut *out);
1431
1432 if let Some(inner) = this {
1433 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1434 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1435 } else {
1436 ::fidl_next::wire::Union::encode_absent(raw);
1437 }
1438
1439 Ok(())
1440 }
1441 }
1442
1443 impl<'de> ::fidl_next::FromWire<crate::wire::TreeNames<'de>> for TreeNames {
1444 #[inline]
1445 fn from_wire(wire: crate::wire::TreeNames<'de>) -> Self {
1446 let wire = ::core::mem::ManuallyDrop::new(wire);
1447 match wire.raw.ordinal() {
1448 1 => Self::Some(::fidl_next::FromWire::from_wire(unsafe {
1449 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
1450 })),
1451
1452 2 => Self::All(::fidl_next::FromWire::from_wire(unsafe {
1453 wire.raw.get().read_unchecked::<crate::wire::All>()
1454 })),
1455
1456 ord => return Self::UnknownOrdinal_(ord as u64),
1457 }
1458 }
1459 }
1460
1461 impl<'de> ::fidl_next::FromWireRef<crate::wire::TreeNames<'de>> for TreeNames {
1462 #[inline]
1463 fn from_wire_ref(wire: &crate::wire::TreeNames<'de>) -> Self {
1464 match wire.raw.ordinal() {
1465 1 => Self::Some(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1466 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
1467 })),
1468
1469 2 => Self::All(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1470 wire.raw.get().deref_unchecked::<crate::wire::All>()
1471 })),
1472
1473 ord => return Self::UnknownOrdinal_(ord as u64),
1474 }
1475 }
1476 }
1477
1478 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::TreeNames<'de>> for TreeNames {
1479 #[inline]
1480 fn from_wire_option(
1481 wire: crate::wire_optional::TreeNames<'de>,
1482 ) -> ::core::option::Option<Self> {
1483 if let Some(inner) = wire.into_option() {
1484 Some(::fidl_next::FromWire::from_wire(inner))
1485 } else {
1486 None
1487 }
1488 }
1489 }
1490
1491 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::TreeNames<'de>> for Box<TreeNames> {
1492 #[inline]
1493 fn from_wire_option(
1494 wire: crate::wire_optional::TreeNames<'de>,
1495 ) -> ::core::option::Option<Self> {
1496 <
1497 TreeNames as ::fidl_next::FromWireOption<crate::wire_optional::TreeNames<'de>>
1498 >::from_wire_option(wire).map(Box::new)
1499 }
1500 }
1501
1502 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::TreeNames<'de>> for Box<TreeNames> {
1503 #[inline]
1504 fn from_wire_option_ref(
1505 wire: &crate::wire_optional::TreeNames<'de>,
1506 ) -> ::core::option::Option<Self> {
1507 if let Some(inner) = wire.as_ref() {
1508 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1509 } else {
1510 None
1511 }
1512 }
1513 }
1514
1515 #[doc = " Structured selector containing all required information for pattern-matching onto\n string-named properties owned by nodes in a data hierarchy, where data hierarchies belong\n to specific components.\n\n These selectors are represented in text form as three segments, colon delimited,\n specifying:\n <component_moniker>:<node_selector>:<property_selector>\n Examples:\n Property selection:\n realm1/realm2/echo:root/active_users:user_count\n\n Subtree selection:\n realm1/realm2/echo:root/active_users\n"]
1516 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1517 pub struct Selector {
1518 pub component_selector: ::core::option::Option<crate::natural::ComponentSelector>,
1519
1520 pub tree_selector: ::core::option::Option<crate::natural::TreeSelector>,
1521
1522 pub tree_names: ::core::option::Option<crate::natural::TreeNames>,
1523 }
1524
1525 impl Selector {
1526 fn __max_ordinal(&self) -> usize {
1527 if self.tree_names.is_some() {
1528 return 3;
1529 }
1530
1531 if self.tree_selector.is_some() {
1532 return 2;
1533 }
1534
1535 if self.component_selector.is_some() {
1536 return 1;
1537 }
1538
1539 0
1540 }
1541 }
1542
1543 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Selector<'static>, ___E> for Selector
1544 where
1545 ___E: ::fidl_next::Encoder + ?Sized,
1546 {
1547 #[inline]
1548 fn encode(
1549 mut self,
1550 encoder: &mut ___E,
1551 out: &mut ::core::mem::MaybeUninit<crate::wire::Selector<'static>>,
1552 _: (),
1553 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1554 ::fidl_next::munge!(let crate::wire::Selector { table } = out);
1555
1556 let max_ord = self.__max_ordinal();
1557
1558 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1559 ::fidl_next::Wire::zero_padding(&mut out);
1560
1561 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1562 ::fidl_next::wire::Envelope,
1563 >(encoder, max_ord);
1564
1565 for i in 1..=max_ord {
1566 match i {
1567 3 => {
1568 if let Some(value) = self.tree_names.take() {
1569 ::fidl_next::wire::Envelope::encode_value::<
1570 crate::wire::TreeNames<'static>,
1571 ___E,
1572 >(
1573 value, preallocated.encoder, &mut out, ()
1574 )?;
1575 } else {
1576 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1577 }
1578 }
1579
1580 2 => {
1581 if let Some(value) = self.tree_selector.take() {
1582 ::fidl_next::wire::Envelope::encode_value::<
1583 crate::wire::TreeSelector<'static>,
1584 ___E,
1585 >(
1586 value, preallocated.encoder, &mut out, ()
1587 )?;
1588 } else {
1589 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1590 }
1591 }
1592
1593 1 => {
1594 if let Some(value) = self.component_selector.take() {
1595 ::fidl_next::wire::Envelope::encode_value::<
1596 crate::wire::ComponentSelector<'static>,
1597 ___E,
1598 >(
1599 value, preallocated.encoder, &mut out, ()
1600 )?;
1601 } else {
1602 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1603 }
1604 }
1605
1606 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1607 }
1608 unsafe {
1609 preallocated.write_next(out.assume_init_ref());
1610 }
1611 }
1612
1613 ::fidl_next::wire::Table::encode_len(table, max_ord);
1614
1615 Ok(())
1616 }
1617 }
1618
1619 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Selector<'static>, ___E> for &'a Selector
1620 where
1621 ___E: ::fidl_next::Encoder + ?Sized,
1622 {
1623 #[inline]
1624 fn encode(
1625 self,
1626 encoder: &mut ___E,
1627 out: &mut ::core::mem::MaybeUninit<crate::wire::Selector<'static>>,
1628 _: (),
1629 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1630 ::fidl_next::munge!(let crate::wire::Selector { table } = out);
1631
1632 let max_ord = self.__max_ordinal();
1633
1634 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1635 ::fidl_next::Wire::zero_padding(&mut out);
1636
1637 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1638 ::fidl_next::wire::Envelope,
1639 >(encoder, max_ord);
1640
1641 for i in 1..=max_ord {
1642 match i {
1643 3 => {
1644 if let Some(value) = &self.tree_names {
1645 ::fidl_next::wire::Envelope::encode_value::<
1646 crate::wire::TreeNames<'static>,
1647 ___E,
1648 >(
1649 value, preallocated.encoder, &mut out, ()
1650 )?;
1651 } else {
1652 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1653 }
1654 }
1655
1656 2 => {
1657 if let Some(value) = &self.tree_selector {
1658 ::fidl_next::wire::Envelope::encode_value::<
1659 crate::wire::TreeSelector<'static>,
1660 ___E,
1661 >(
1662 value, preallocated.encoder, &mut out, ()
1663 )?;
1664 } else {
1665 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1666 }
1667 }
1668
1669 1 => {
1670 if let Some(value) = &self.component_selector {
1671 ::fidl_next::wire::Envelope::encode_value::<
1672 crate::wire::ComponentSelector<'static>,
1673 ___E,
1674 >(
1675 value, preallocated.encoder, &mut out, ()
1676 )?;
1677 } else {
1678 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1679 }
1680 }
1681
1682 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1683 }
1684 unsafe {
1685 preallocated.write_next(out.assume_init_ref());
1686 }
1687 }
1688
1689 ::fidl_next::wire::Table::encode_len(table, max_ord);
1690
1691 Ok(())
1692 }
1693 }
1694
1695 impl<'de> ::fidl_next::FromWire<crate::wire::Selector<'de>> for Selector {
1696 #[inline]
1697 fn from_wire(wire_: crate::wire::Selector<'de>) -> Self {
1698 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1699
1700 let component_selector = wire_.table.get(1);
1701
1702 let tree_selector = wire_.table.get(2);
1703
1704 let tree_names = wire_.table.get(3);
1705
1706 Self {
1707 component_selector: component_selector.map(|envelope| {
1708 ::fidl_next::FromWire::from_wire(unsafe {
1709 envelope.read_unchecked::<crate::wire::ComponentSelector<'de>>()
1710 })
1711 }),
1712
1713 tree_selector: tree_selector.map(|envelope| {
1714 ::fidl_next::FromWire::from_wire(unsafe {
1715 envelope.read_unchecked::<crate::wire::TreeSelector<'de>>()
1716 })
1717 }),
1718
1719 tree_names: tree_names.map(|envelope| {
1720 ::fidl_next::FromWire::from_wire(unsafe {
1721 envelope.read_unchecked::<crate::wire::TreeNames<'de>>()
1722 })
1723 }),
1724 }
1725 }
1726 }
1727
1728 impl<'de> ::fidl_next::FromWireRef<crate::wire::Selector<'de>> for Selector {
1729 #[inline]
1730 fn from_wire_ref(wire: &crate::wire::Selector<'de>) -> Self {
1731 Self {
1732 component_selector: wire.table.get(1).map(|envelope| {
1733 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1734 envelope.deref_unchecked::<crate::wire::ComponentSelector<'de>>()
1735 })
1736 }),
1737
1738 tree_selector: wire.table.get(2).map(|envelope| {
1739 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1740 envelope.deref_unchecked::<crate::wire::TreeSelector<'de>>()
1741 })
1742 }),
1743
1744 tree_names: wire.table.get(3).map(|envelope| {
1745 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1746 envelope.deref_unchecked::<crate::wire::TreeNames<'de>>()
1747 })
1748 }),
1749 }
1750 }
1751 }
1752
1753 #[doc = " Argument used for Archive selectors, can be either the pre-parsed\n fidl struct or string representation.\n"]
1754 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1755 pub enum SelectorArgument {
1756 StructuredSelector(crate::natural::Selector),
1757
1758 RawSelector(::std::string::String),
1759
1760 UnknownOrdinal_(u64),
1761 }
1762
1763 impl SelectorArgument {
1764 pub fn is_unknown(&self) -> bool {
1765 #[allow(unreachable_patterns)]
1766 match self {
1767 Self::UnknownOrdinal_(_) => true,
1768 _ => false,
1769 }
1770 }
1771 }
1772
1773 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SelectorArgument<'static>, ___E>
1774 for SelectorArgument
1775 where
1776 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1777 ___E: ::fidl_next::Encoder,
1778 {
1779 #[inline]
1780 fn encode(
1781 self,
1782 encoder: &mut ___E,
1783 out: &mut ::core::mem::MaybeUninit<crate::wire::SelectorArgument<'static>>,
1784 _: (),
1785 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1786 ::fidl_next::munge!(let crate::wire::SelectorArgument { raw, _phantom: _ } = out);
1787
1788 match self {
1789 Self::StructuredSelector(value) => ::fidl_next::wire::Union::encode_as::<
1790 ___E,
1791 crate::wire::Selector<'static>,
1792 >(value, 1, encoder, raw, ())?,
1793
1794 Self::RawSelector(value) => ::fidl_next::wire::Union::encode_as::<
1795 ___E,
1796 ::fidl_next::wire::String<'static>,
1797 >(value, 2, encoder, raw, 1024)?,
1798
1799 Self::UnknownOrdinal_(ordinal) => {
1800 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1801 }
1802 }
1803
1804 Ok(())
1805 }
1806 }
1807
1808 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SelectorArgument<'static>, ___E>
1809 for &'a SelectorArgument
1810 where
1811 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1812 ___E: ::fidl_next::Encoder,
1813 {
1814 #[inline]
1815 fn encode(
1816 self,
1817 encoder: &mut ___E,
1818 out: &mut ::core::mem::MaybeUninit<crate::wire::SelectorArgument<'static>>,
1819 _: (),
1820 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1821 ::fidl_next::munge!(let crate::wire::SelectorArgument { raw, _phantom: _ } = out);
1822
1823 match self {
1824 SelectorArgument::StructuredSelector(value) => {
1825 ::fidl_next::wire::Union::encode_as::<___E, crate::wire::Selector<'static>>(
1826 value,
1827 1,
1828 encoder,
1829 raw,
1830 (),
1831 )?
1832 }
1833
1834 SelectorArgument::RawSelector(value) => {
1835 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
1836 value, 2, encoder, raw, 1024,
1837 )?
1838 }
1839
1840 SelectorArgument::UnknownOrdinal_(ordinal) => {
1841 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1842 }
1843 }
1844
1845 Ok(())
1846 }
1847 }
1848
1849 unsafe impl<___E>
1850 ::fidl_next::EncodeOption<crate::wire_optional::SelectorArgument<'static>, ___E>
1851 for SelectorArgument
1852 where
1853 ___E: ?Sized,
1854 SelectorArgument: ::fidl_next::Encode<crate::wire::SelectorArgument<'static>, ___E>,
1855 {
1856 #[inline]
1857 fn encode_option(
1858 this: ::core::option::Option<Self>,
1859 encoder: &mut ___E,
1860 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SelectorArgument<'static>>,
1861 _: (),
1862 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1863 ::fidl_next::munge!(let crate::wire_optional::SelectorArgument { raw, _phantom: _ } = &mut *out);
1864
1865 if let Some(inner) = this {
1866 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1867 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1868 } else {
1869 ::fidl_next::wire::Union::encode_absent(raw);
1870 }
1871
1872 Ok(())
1873 }
1874 }
1875
1876 unsafe impl<'a, ___E>
1877 ::fidl_next::EncodeOption<crate::wire_optional::SelectorArgument<'static>, ___E>
1878 for &'a SelectorArgument
1879 where
1880 ___E: ?Sized,
1881 &'a SelectorArgument: ::fidl_next::Encode<crate::wire::SelectorArgument<'static>, ___E>,
1882 {
1883 #[inline]
1884 fn encode_option(
1885 this: ::core::option::Option<Self>,
1886 encoder: &mut ___E,
1887 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SelectorArgument<'static>>,
1888 _: (),
1889 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1890 ::fidl_next::munge!(let crate::wire_optional::SelectorArgument { raw, _phantom: _ } = &mut *out);
1891
1892 if let Some(inner) = this {
1893 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1894 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1895 } else {
1896 ::fidl_next::wire::Union::encode_absent(raw);
1897 }
1898
1899 Ok(())
1900 }
1901 }
1902
1903 impl<'de> ::fidl_next::FromWire<crate::wire::SelectorArgument<'de>> for SelectorArgument {
1904 #[inline]
1905 fn from_wire(wire: crate::wire::SelectorArgument<'de>) -> Self {
1906 let wire = ::core::mem::ManuallyDrop::new(wire);
1907 match wire.raw.ordinal() {
1908 1 => Self::StructuredSelector(::fidl_next::FromWire::from_wire(unsafe {
1909 wire.raw.get().read_unchecked::<crate::wire::Selector<'de>>()
1910 })),
1911
1912 2 => Self::RawSelector(::fidl_next::FromWire::from_wire(unsafe {
1913 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
1914 })),
1915
1916 ord => return Self::UnknownOrdinal_(ord as u64),
1917 }
1918 }
1919 }
1920
1921 impl<'de> ::fidl_next::FromWireRef<crate::wire::SelectorArgument<'de>> for SelectorArgument {
1922 #[inline]
1923 fn from_wire_ref(wire: &crate::wire::SelectorArgument<'de>) -> Self {
1924 match wire.raw.ordinal() {
1925 1 => Self::StructuredSelector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1926 wire.raw.get().deref_unchecked::<crate::wire::Selector<'de>>()
1927 })),
1928
1929 2 => Self::RawSelector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1930 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
1931 })),
1932
1933 ord => return Self::UnknownOrdinal_(ord as u64),
1934 }
1935 }
1936 }
1937
1938 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::SelectorArgument<'de>>
1939 for SelectorArgument
1940 {
1941 #[inline]
1942 fn from_wire_option(
1943 wire: crate::wire_optional::SelectorArgument<'de>,
1944 ) -> ::core::option::Option<Self> {
1945 if let Some(inner) = wire.into_option() {
1946 Some(::fidl_next::FromWire::from_wire(inner))
1947 } else {
1948 None
1949 }
1950 }
1951 }
1952
1953 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::SelectorArgument<'de>>
1954 for Box<SelectorArgument>
1955 {
1956 #[inline]
1957 fn from_wire_option(
1958 wire: crate::wire_optional::SelectorArgument<'de>,
1959 ) -> ::core::option::Option<Self> {
1960 <SelectorArgument as ::fidl_next::FromWireOption<
1961 crate::wire_optional::SelectorArgument<'de>,
1962 >>::from_wire_option(wire)
1963 .map(Box::new)
1964 }
1965 }
1966
1967 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::SelectorArgument<'de>>
1968 for Box<SelectorArgument>
1969 {
1970 #[inline]
1971 fn from_wire_option_ref(
1972 wire: &crate::wire_optional::SelectorArgument<'de>,
1973 ) -> ::core::option::Option<Self> {
1974 if let Some(inner) = wire.as_ref() {
1975 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
1976 } else {
1977 None
1978 }
1979 }
1980 }
1981
1982 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1983 pub enum ClientSelectorConfiguration {
1984 Selectors(::std::vec::Vec<crate::natural::SelectorArgument>),
1985
1986 SelectAll(bool),
1987
1988 UnknownOrdinal_(u64),
1989 }
1990
1991 impl ClientSelectorConfiguration {
1992 pub fn is_unknown(&self) -> bool {
1993 #[allow(unreachable_patterns)]
1994 match self {
1995 Self::UnknownOrdinal_(_) => true,
1996 _ => false,
1997 }
1998 }
1999 }
2000
2001 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClientSelectorConfiguration<'static>, ___E>
2002 for ClientSelectorConfiguration
2003 where
2004 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2005 ___E: ::fidl_next::Encoder,
2006 {
2007 #[inline]
2008 fn encode(
2009 self,
2010 encoder: &mut ___E,
2011 out: &mut ::core::mem::MaybeUninit<crate::wire::ClientSelectorConfiguration<'static>>,
2012 _: (),
2013 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2014 ::fidl_next::munge!(let crate::wire::ClientSelectorConfiguration { raw, _phantom: _ } = out);
2015
2016 match self {
2017 Self::Selectors(value) => {
2018 ::fidl_next::wire::Union::encode_as::<
2019 ___E,
2020 ::fidl_next::wire::Vector<'static, crate::wire::SelectorArgument<'static>>,
2021 >(value, 1, encoder, raw, (4294967295, ()))?
2022 }
2023
2024 Self::SelectAll(value) => {
2025 ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 2, encoder, raw, ())?
2026 }
2027
2028 Self::UnknownOrdinal_(ordinal) => {
2029 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2030 }
2031 }
2032
2033 Ok(())
2034 }
2035 }
2036
2037 unsafe impl<'a, ___E>
2038 ::fidl_next::Encode<crate::wire::ClientSelectorConfiguration<'static>, ___E>
2039 for &'a ClientSelectorConfiguration
2040 where
2041 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2042 ___E: ::fidl_next::Encoder,
2043 {
2044 #[inline]
2045 fn encode(
2046 self,
2047 encoder: &mut ___E,
2048 out: &mut ::core::mem::MaybeUninit<crate::wire::ClientSelectorConfiguration<'static>>,
2049 _: (),
2050 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2051 ::fidl_next::munge!(let crate::wire::ClientSelectorConfiguration { raw, _phantom: _ } = out);
2052
2053 match self {
2054 ClientSelectorConfiguration::Selectors(value) => {
2055 ::fidl_next::wire::Union::encode_as::<
2056 ___E,
2057 ::fidl_next::wire::Vector<'static, crate::wire::SelectorArgument<'static>>,
2058 >(value, 1, encoder, raw, (4294967295, ()))?
2059 }
2060
2061 ClientSelectorConfiguration::SelectAll(value) => {
2062 ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 2, encoder, raw, ())?
2063 }
2064
2065 ClientSelectorConfiguration::UnknownOrdinal_(ordinal) => {
2066 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2067 }
2068 }
2069
2070 Ok(())
2071 }
2072 }
2073
2074 unsafe impl<___E>
2075 ::fidl_next::EncodeOption<crate::wire_optional::ClientSelectorConfiguration<'static>, ___E>
2076 for ClientSelectorConfiguration
2077 where
2078 ___E: ?Sized,
2079 ClientSelectorConfiguration:
2080 ::fidl_next::Encode<crate::wire::ClientSelectorConfiguration<'static>, ___E>,
2081 {
2082 #[inline]
2083 fn encode_option(
2084 this: ::core::option::Option<Self>,
2085 encoder: &mut ___E,
2086 out: &mut ::core::mem::MaybeUninit<
2087 crate::wire_optional::ClientSelectorConfiguration<'static>,
2088 >,
2089 _: (),
2090 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2091 ::fidl_next::munge!(let crate::wire_optional::ClientSelectorConfiguration { raw, _phantom: _ } = &mut *out);
2092
2093 if let Some(inner) = this {
2094 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2095 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2096 } else {
2097 ::fidl_next::wire::Union::encode_absent(raw);
2098 }
2099
2100 Ok(())
2101 }
2102 }
2103
2104 unsafe impl<'a, ___E>
2105 ::fidl_next::EncodeOption<crate::wire_optional::ClientSelectorConfiguration<'static>, ___E>
2106 for &'a ClientSelectorConfiguration
2107 where
2108 ___E: ?Sized,
2109 &'a ClientSelectorConfiguration:
2110 ::fidl_next::Encode<crate::wire::ClientSelectorConfiguration<'static>, ___E>,
2111 {
2112 #[inline]
2113 fn encode_option(
2114 this: ::core::option::Option<Self>,
2115 encoder: &mut ___E,
2116 out: &mut ::core::mem::MaybeUninit<
2117 crate::wire_optional::ClientSelectorConfiguration<'static>,
2118 >,
2119 _: (),
2120 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2121 ::fidl_next::munge!(let crate::wire_optional::ClientSelectorConfiguration { raw, _phantom: _ } = &mut *out);
2122
2123 if let Some(inner) = this {
2124 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2125 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2126 } else {
2127 ::fidl_next::wire::Union::encode_absent(raw);
2128 }
2129
2130 Ok(())
2131 }
2132 }
2133
2134 impl<'de> ::fidl_next::FromWire<crate::wire::ClientSelectorConfiguration<'de>>
2135 for ClientSelectorConfiguration
2136 {
2137 #[inline]
2138 fn from_wire(wire: crate::wire::ClientSelectorConfiguration<'de>) -> Self {
2139 let wire = ::core::mem::ManuallyDrop::new(wire);
2140 match wire.raw.ordinal() {
2141 1 => Self::Selectors(::fidl_next::FromWire::from_wire(unsafe {
2142 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>>()
2143 })),
2144
2145 2 => Self::SelectAll(::fidl_next::FromWire::from_wire(unsafe {
2146 wire.raw.get().read_unchecked::<bool>()
2147 })),
2148
2149 ord => return Self::UnknownOrdinal_(ord as u64),
2150 }
2151 }
2152 }
2153
2154 impl<'de> ::fidl_next::FromWireRef<crate::wire::ClientSelectorConfiguration<'de>>
2155 for ClientSelectorConfiguration
2156 {
2157 #[inline]
2158 fn from_wire_ref(wire: &crate::wire::ClientSelectorConfiguration<'de>) -> Self {
2159 match wire.raw.ordinal() {
2160 1 => Self::Selectors(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2161 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>>()
2162 })),
2163
2164 2 => Self::SelectAll(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2165 wire.raw.get().deref_unchecked::<bool>()
2166 })),
2167
2168 ord => return Self::UnknownOrdinal_(ord as u64),
2169 }
2170 }
2171 }
2172
2173 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ClientSelectorConfiguration<'de>>
2174 for ClientSelectorConfiguration
2175 {
2176 #[inline]
2177 fn from_wire_option(
2178 wire: crate::wire_optional::ClientSelectorConfiguration<'de>,
2179 ) -> ::core::option::Option<Self> {
2180 if let Some(inner) = wire.into_option() {
2181 Some(::fidl_next::FromWire::from_wire(inner))
2182 } else {
2183 None
2184 }
2185 }
2186 }
2187
2188 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ClientSelectorConfiguration<'de>>
2189 for Box<ClientSelectorConfiguration>
2190 {
2191 #[inline]
2192 fn from_wire_option(
2193 wire: crate::wire_optional::ClientSelectorConfiguration<'de>,
2194 ) -> ::core::option::Option<Self> {
2195 <ClientSelectorConfiguration as ::fidl_next::FromWireOption<
2196 crate::wire_optional::ClientSelectorConfiguration<'de>,
2197 >>::from_wire_option(wire)
2198 .map(Box::new)
2199 }
2200 }
2201
2202 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ClientSelectorConfiguration<'de>>
2203 for Box<ClientSelectorConfiguration>
2204 {
2205 #[inline]
2206 fn from_wire_option_ref(
2207 wire: &crate::wire_optional::ClientSelectorConfiguration<'de>,
2208 ) -> ::core::option::Option<Self> {
2209 if let Some(inner) = wire.as_ref() {
2210 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
2211 } else {
2212 None
2213 }
2214 }
2215 }
2216
2217 #[doc = " Enum used to specify the output format for\n Reader results.\n"]
2218 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2219 #[repr(u32)]
2220 pub enum Format {
2221 Json = 1,
2222 Text = 2,
2223 Cbor = 3,
2224 LegacyFxt = 4,
2225 Fxt = 5,
2226 }
2227 impl ::core::convert::TryFrom<u32> for Format {
2228 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2229 fn try_from(
2230 value: u32,
2231 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
2232 match value {
2233 1 => Ok(Self::Json),
2234 2 => Ok(Self::Text),
2235 3 => Ok(Self::Cbor),
2236 4 => Ok(Self::LegacyFxt),
2237 5 => Ok(Self::Fxt),
2238
2239 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
2240 }
2241 }
2242 }
2243
2244 impl ::std::convert::From<Format> for u32 {
2245 fn from(value: Format) -> Self {
2246 match value {
2247 Format::Json => 1,
2248 Format::Text => 2,
2249 Format::Cbor => 3,
2250 Format::LegacyFxt => 4,
2251 Format::Fxt => 5,
2252 }
2253 }
2254 }
2255
2256 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Format, ___E> for Format
2257 where
2258 ___E: ?Sized,
2259 {
2260 #[inline]
2261 fn encode(
2262 self,
2263 encoder: &mut ___E,
2264 out: &mut ::core::mem::MaybeUninit<crate::wire::Format>,
2265 _: (),
2266 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2267 ::fidl_next::Encode::encode(&self, encoder, out, ())
2268 }
2269 }
2270
2271 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Format, ___E> for &'a Format
2272 where
2273 ___E: ?Sized,
2274 {
2275 #[inline]
2276 fn encode(
2277 self,
2278 encoder: &mut ___E,
2279 out: &mut ::core::mem::MaybeUninit<crate::wire::Format>,
2280 _: (),
2281 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2282 ::fidl_next::munge!(let crate::wire::Format { value } = out);
2283 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2284 Format::Json => 1,
2285
2286 Format::Text => 2,
2287
2288 Format::Cbor => 3,
2289
2290 Format::LegacyFxt => 4,
2291
2292 Format::Fxt => 5,
2293 }));
2294
2295 Ok(())
2296 }
2297 }
2298
2299 impl ::core::convert::From<crate::wire::Format> for Format {
2300 fn from(wire: crate::wire::Format) -> Self {
2301 match u32::from(wire.value) {
2302 1 => Self::Json,
2303
2304 2 => Self::Text,
2305
2306 3 => Self::Cbor,
2307
2308 4 => Self::LegacyFxt,
2309
2310 5 => Self::Fxt,
2311
2312 _ => unsafe { ::core::hint::unreachable_unchecked() },
2313 }
2314 }
2315 }
2316
2317 impl ::fidl_next::FromWire<crate::wire::Format> for Format {
2318 #[inline]
2319 fn from_wire(wire: crate::wire::Format) -> Self {
2320 Self::from(wire)
2321 }
2322 }
2323
2324 impl ::fidl_next::FromWireRef<crate::wire::Format> for Format {
2325 #[inline]
2326 fn from_wire_ref(wire: &crate::wire::Format) -> Self {
2327 Self::from(*wire)
2328 }
2329 }
2330
2331 #[doc = " Parameters needed to configure a stream of diagnostics information.\n"]
2332 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2333 pub struct StreamParameters {
2334 pub data_type: ::core::option::Option<crate::natural::DataType>,
2335
2336 pub stream_mode: ::core::option::Option<crate::natural::StreamMode>,
2337
2338 pub format: ::core::option::Option<crate::natural::Format>,
2339
2340 pub client_selector_configuration:
2341 ::core::option::Option<crate::natural::ClientSelectorConfiguration>,
2342
2343 pub batch_retrieval_timeout_seconds: ::core::option::Option<i64>,
2344
2345 pub performance_configuration:
2346 ::core::option::Option<crate::natural::PerformanceConfiguration>,
2347 }
2348
2349 impl StreamParameters {
2350 fn __max_ordinal(&self) -> usize {
2351 if self.performance_configuration.is_some() {
2352 return 6;
2353 }
2354
2355 if self.batch_retrieval_timeout_seconds.is_some() {
2356 return 5;
2357 }
2358
2359 if self.client_selector_configuration.is_some() {
2360 return 4;
2361 }
2362
2363 if self.format.is_some() {
2364 return 3;
2365 }
2366
2367 if self.stream_mode.is_some() {
2368 return 2;
2369 }
2370
2371 if self.data_type.is_some() {
2372 return 1;
2373 }
2374
2375 0
2376 }
2377 }
2378
2379 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StreamParameters<'static>, ___E>
2380 for StreamParameters
2381 where
2382 ___E: ::fidl_next::Encoder + ?Sized,
2383 {
2384 #[inline]
2385 fn encode(
2386 mut self,
2387 encoder: &mut ___E,
2388 out: &mut ::core::mem::MaybeUninit<crate::wire::StreamParameters<'static>>,
2389 _: (),
2390 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2391 ::fidl_next::munge!(let crate::wire::StreamParameters { table } = out);
2392
2393 let max_ord = self.__max_ordinal();
2394
2395 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2396 ::fidl_next::Wire::zero_padding(&mut out);
2397
2398 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2399 ::fidl_next::wire::Envelope,
2400 >(encoder, max_ord);
2401
2402 for i in 1..=max_ord {
2403 match i {
2404 6 => {
2405 if let Some(value) = self.performance_configuration.take() {
2406 ::fidl_next::wire::Envelope::encode_value::<
2407 crate::wire::PerformanceConfiguration<'static>,
2408 ___E,
2409 >(
2410 value, preallocated.encoder, &mut out, ()
2411 )?;
2412 } else {
2413 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2414 }
2415 }
2416
2417 5 => {
2418 if let Some(value) = self.batch_retrieval_timeout_seconds.take() {
2419 ::fidl_next::wire::Envelope::encode_value::<
2420 ::fidl_next::wire::Int64,
2421 ___E,
2422 >(
2423 value, preallocated.encoder, &mut out, ()
2424 )?;
2425 } else {
2426 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2427 }
2428 }
2429
2430 4 => {
2431 if let Some(value) = self.client_selector_configuration.take() {
2432 ::fidl_next::wire::Envelope::encode_value::<
2433 crate::wire::ClientSelectorConfiguration<'static>,
2434 ___E,
2435 >(
2436 value, preallocated.encoder, &mut out, ()
2437 )?;
2438 } else {
2439 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2440 }
2441 }
2442
2443 3 => {
2444 if let Some(value) = self.format.take() {
2445 ::fidl_next::wire::Envelope::encode_value::<crate::wire::Format, ___E>(
2446 value,
2447 preallocated.encoder,
2448 &mut out,
2449 (),
2450 )?;
2451 } else {
2452 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2453 }
2454 }
2455
2456 2 => {
2457 if let Some(value) = self.stream_mode.take() {
2458 ::fidl_next::wire::Envelope::encode_value::<
2459 crate::wire::StreamMode,
2460 ___E,
2461 >(
2462 value, preallocated.encoder, &mut out, ()
2463 )?;
2464 } else {
2465 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2466 }
2467 }
2468
2469 1 => {
2470 if let Some(value) = self.data_type.take() {
2471 ::fidl_next::wire::Envelope::encode_value::<crate::wire::DataType, ___E>(
2472 value,
2473 preallocated.encoder,
2474 &mut out,
2475 (),
2476 )?;
2477 } else {
2478 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2479 }
2480 }
2481
2482 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2483 }
2484 unsafe {
2485 preallocated.write_next(out.assume_init_ref());
2486 }
2487 }
2488
2489 ::fidl_next::wire::Table::encode_len(table, max_ord);
2490
2491 Ok(())
2492 }
2493 }
2494
2495 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StreamParameters<'static>, ___E>
2496 for &'a StreamParameters
2497 where
2498 ___E: ::fidl_next::Encoder + ?Sized,
2499 {
2500 #[inline]
2501 fn encode(
2502 self,
2503 encoder: &mut ___E,
2504 out: &mut ::core::mem::MaybeUninit<crate::wire::StreamParameters<'static>>,
2505 _: (),
2506 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2507 ::fidl_next::munge!(let crate::wire::StreamParameters { table } = out);
2508
2509 let max_ord = self.__max_ordinal();
2510
2511 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2512 ::fidl_next::Wire::zero_padding(&mut out);
2513
2514 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2515 ::fidl_next::wire::Envelope,
2516 >(encoder, max_ord);
2517
2518 for i in 1..=max_ord {
2519 match i {
2520 6 => {
2521 if let Some(value) = &self.performance_configuration {
2522 ::fidl_next::wire::Envelope::encode_value::<
2523 crate::wire::PerformanceConfiguration<'static>,
2524 ___E,
2525 >(
2526 value, preallocated.encoder, &mut out, ()
2527 )?;
2528 } else {
2529 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2530 }
2531 }
2532
2533 5 => {
2534 if let Some(value) = &self.batch_retrieval_timeout_seconds {
2535 ::fidl_next::wire::Envelope::encode_value::<
2536 ::fidl_next::wire::Int64,
2537 ___E,
2538 >(
2539 value, preallocated.encoder, &mut out, ()
2540 )?;
2541 } else {
2542 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2543 }
2544 }
2545
2546 4 => {
2547 if let Some(value) = &self.client_selector_configuration {
2548 ::fidl_next::wire::Envelope::encode_value::<
2549 crate::wire::ClientSelectorConfiguration<'static>,
2550 ___E,
2551 >(
2552 value, preallocated.encoder, &mut out, ()
2553 )?;
2554 } else {
2555 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2556 }
2557 }
2558
2559 3 => {
2560 if let Some(value) = &self.format {
2561 ::fidl_next::wire::Envelope::encode_value::<crate::wire::Format, ___E>(
2562 value,
2563 preallocated.encoder,
2564 &mut out,
2565 (),
2566 )?;
2567 } else {
2568 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2569 }
2570 }
2571
2572 2 => {
2573 if let Some(value) = &self.stream_mode {
2574 ::fidl_next::wire::Envelope::encode_value::<
2575 crate::wire::StreamMode,
2576 ___E,
2577 >(
2578 value, preallocated.encoder, &mut out, ()
2579 )?;
2580 } else {
2581 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2582 }
2583 }
2584
2585 1 => {
2586 if let Some(value) = &self.data_type {
2587 ::fidl_next::wire::Envelope::encode_value::<crate::wire::DataType, ___E>(
2588 value,
2589 preallocated.encoder,
2590 &mut out,
2591 (),
2592 )?;
2593 } else {
2594 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2595 }
2596 }
2597
2598 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2599 }
2600 unsafe {
2601 preallocated.write_next(out.assume_init_ref());
2602 }
2603 }
2604
2605 ::fidl_next::wire::Table::encode_len(table, max_ord);
2606
2607 Ok(())
2608 }
2609 }
2610
2611 impl<'de> ::fidl_next::FromWire<crate::wire::StreamParameters<'de>> for StreamParameters {
2612 #[inline]
2613 fn from_wire(wire_: crate::wire::StreamParameters<'de>) -> Self {
2614 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2615
2616 let data_type = wire_.table.get(1);
2617
2618 let stream_mode = wire_.table.get(2);
2619
2620 let format = wire_.table.get(3);
2621
2622 let client_selector_configuration = wire_.table.get(4);
2623
2624 let batch_retrieval_timeout_seconds = wire_.table.get(5);
2625
2626 let performance_configuration = wire_.table.get(6);
2627
2628 Self {
2629 data_type: data_type.map(|envelope| {
2630 ::fidl_next::FromWire::from_wire(unsafe {
2631 envelope.read_unchecked::<crate::wire::DataType>()
2632 })
2633 }),
2634
2635 stream_mode: stream_mode.map(|envelope| {
2636 ::fidl_next::FromWire::from_wire(unsafe {
2637 envelope.read_unchecked::<crate::wire::StreamMode>()
2638 })
2639 }),
2640
2641 format: format.map(|envelope| {
2642 ::fidl_next::FromWire::from_wire(unsafe {
2643 envelope.read_unchecked::<crate::wire::Format>()
2644 })
2645 }),
2646
2647 client_selector_configuration: client_selector_configuration.map(|envelope| {
2648 ::fidl_next::FromWire::from_wire(unsafe {
2649 envelope.read_unchecked::<crate::wire::ClientSelectorConfiguration<'de>>()
2650 })
2651 }),
2652
2653 batch_retrieval_timeout_seconds: batch_retrieval_timeout_seconds.map(|envelope| {
2654 ::fidl_next::FromWire::from_wire(unsafe {
2655 envelope.read_unchecked::<::fidl_next::wire::Int64>()
2656 })
2657 }),
2658
2659 performance_configuration: performance_configuration.map(|envelope| {
2660 ::fidl_next::FromWire::from_wire(unsafe {
2661 envelope.read_unchecked::<crate::wire::PerformanceConfiguration<'de>>()
2662 })
2663 }),
2664 }
2665 }
2666 }
2667
2668 impl<'de> ::fidl_next::FromWireRef<crate::wire::StreamParameters<'de>> for StreamParameters {
2669 #[inline]
2670 fn from_wire_ref(wire: &crate::wire::StreamParameters<'de>) -> Self {
2671 Self {
2672 data_type: wire.table.get(1).map(|envelope| {
2673 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2674 envelope.deref_unchecked::<crate::wire::DataType>()
2675 })
2676 }),
2677
2678 stream_mode: wire.table.get(2).map(|envelope| {
2679 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2680 envelope.deref_unchecked::<crate::wire::StreamMode>()
2681 })
2682 }),
2683
2684 format: wire.table.get(3).map(|envelope| {
2685 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2686 envelope.deref_unchecked::<crate::wire::Format>()
2687 })
2688 }),
2689
2690 client_selector_configuration: wire.table.get(4).map(|envelope| {
2691 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2692 envelope.deref_unchecked::<crate::wire::ClientSelectorConfiguration<'de>>()
2693 })
2694 }),
2695
2696 batch_retrieval_timeout_seconds: wire.table.get(5).map(|envelope| {
2697 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2698 envelope.deref_unchecked::<::fidl_next::wire::Int64>()
2699 })
2700 }),
2701
2702 performance_configuration: wire.table.get(6).map(|envelope| {
2703 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2704 envelope.deref_unchecked::<crate::wire::PerformanceConfiguration<'de>>()
2705 })
2706 }),
2707 }
2708 }
2709 }
2710
2711 pub type ArchiveAccessorStreamDiagnosticsToSocketResponse = ();
2712
2713 pub type ArchiveAccessorWaitForReadyResponse = ();
2714
2715 #[doc = " Enum describing the potential failure states of the streaming protocol when serving results\n to the client over the result iterator.\n"]
2716 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2717 #[repr(u32)]
2718 pub enum ReaderError {
2719 Io = 1,
2720 }
2721 impl ::core::convert::TryFrom<u32> for ReaderError {
2722 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2723 fn try_from(
2724 value: u32,
2725 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
2726 match value {
2727 1 => Ok(Self::Io),
2728
2729 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
2730 }
2731 }
2732 }
2733
2734 impl ::std::convert::From<ReaderError> for u32 {
2735 fn from(value: ReaderError) -> Self {
2736 match value {
2737 ReaderError::Io => 1,
2738 }
2739 }
2740 }
2741
2742 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ReaderError, ___E> for ReaderError
2743 where
2744 ___E: ?Sized,
2745 {
2746 #[inline]
2747 fn encode(
2748 self,
2749 encoder: &mut ___E,
2750 out: &mut ::core::mem::MaybeUninit<crate::wire::ReaderError>,
2751 _: (),
2752 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2753 ::fidl_next::Encode::encode(&self, encoder, out, ())
2754 }
2755 }
2756
2757 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ReaderError, ___E> for &'a ReaderError
2758 where
2759 ___E: ?Sized,
2760 {
2761 #[inline]
2762 fn encode(
2763 self,
2764 encoder: &mut ___E,
2765 out: &mut ::core::mem::MaybeUninit<crate::wire::ReaderError>,
2766 _: (),
2767 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2768 ::fidl_next::munge!(let crate::wire::ReaderError { value } = out);
2769 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2770 ReaderError::Io => 1,
2771 }));
2772
2773 Ok(())
2774 }
2775 }
2776
2777 impl ::core::convert::From<crate::wire::ReaderError> for ReaderError {
2778 fn from(wire: crate::wire::ReaderError) -> Self {
2779 match u32::from(wire.value) {
2780 1 => Self::Io,
2781
2782 _ => unsafe { ::core::hint::unreachable_unchecked() },
2783 }
2784 }
2785 }
2786
2787 impl ::fidl_next::FromWire<crate::wire::ReaderError> for ReaderError {
2788 #[inline]
2789 fn from_wire(wire: crate::wire::ReaderError) -> Self {
2790 Self::from(wire)
2791 }
2792 }
2793
2794 impl ::fidl_next::FromWireRef<crate::wire::ReaderError> for ReaderError {
2795 #[inline]
2796 fn from_wire_ref(wire: &crate::wire::ReaderError) -> Self {
2797 Self::from(*wire)
2798 }
2799 }
2800
2801 pub type BatchIteratorWaitForReadyResponse = ();
2802
2803 #[doc = " ConfigurationError indicates a bad setting in `Sample::Set`. This value\n is returned before the first sample is taken.\n"]
2804 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2805 #[repr(u32)]
2806 pub enum ConfigurationError {
2807 SamplePeriodTooSmall = 1,
2808 SampleParametersInvalid = 2,
2809 InvalidSelectors = 3,
2810 UnknownOrdinal_(u32) = 4,
2811 }
2812 impl ::std::convert::From<u32> for ConfigurationError {
2813 fn from(value: u32) -> Self {
2814 match value {
2815 1 => Self::SamplePeriodTooSmall,
2816 2 => Self::SampleParametersInvalid,
2817 3 => Self::InvalidSelectors,
2818
2819 _ => Self::UnknownOrdinal_(value),
2820 }
2821 }
2822 }
2823
2824 impl ::std::convert::From<ConfigurationError> for u32 {
2825 fn from(value: ConfigurationError) -> Self {
2826 match value {
2827 ConfigurationError::SamplePeriodTooSmall => 1,
2828 ConfigurationError::SampleParametersInvalid => 2,
2829 ConfigurationError::InvalidSelectors => 3,
2830
2831 ConfigurationError::UnknownOrdinal_(value) => value,
2832 }
2833 }
2834 }
2835
2836 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigurationError, ___E> for ConfigurationError
2837 where
2838 ___E: ?Sized,
2839 {
2840 #[inline]
2841 fn encode(
2842 self,
2843 encoder: &mut ___E,
2844 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigurationError>,
2845 _: (),
2846 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2847 ::fidl_next::Encode::encode(&self, encoder, out, ())
2848 }
2849 }
2850
2851 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigurationError, ___E>
2852 for &'a ConfigurationError
2853 where
2854 ___E: ?Sized,
2855 {
2856 #[inline]
2857 fn encode(
2858 self,
2859 encoder: &mut ___E,
2860 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigurationError>,
2861 _: (),
2862 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2863 ::fidl_next::munge!(let crate::wire::ConfigurationError { value } = out);
2864 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2865 ConfigurationError::SamplePeriodTooSmall => 1,
2866
2867 ConfigurationError::SampleParametersInvalid => 2,
2868
2869 ConfigurationError::InvalidSelectors => 3,
2870
2871 ConfigurationError::UnknownOrdinal_(value) => value,
2872 }));
2873
2874 Ok(())
2875 }
2876 }
2877
2878 impl ::core::convert::From<crate::wire::ConfigurationError> for ConfigurationError {
2879 fn from(wire: crate::wire::ConfigurationError) -> Self {
2880 match u32::from(wire.value) {
2881 1 => Self::SamplePeriodTooSmall,
2882
2883 2 => Self::SampleParametersInvalid,
2884
2885 3 => Self::InvalidSelectors,
2886
2887 value => Self::UnknownOrdinal_(value),
2888 }
2889 }
2890 }
2891
2892 impl ::fidl_next::FromWire<crate::wire::ConfigurationError> for ConfigurationError {
2893 #[inline]
2894 fn from_wire(wire: crate::wire::ConfigurationError) -> Self {
2895 Self::from(wire)
2896 }
2897 }
2898
2899 impl ::fidl_next::FromWireRef<crate::wire::ConfigurationError> for ConfigurationError {
2900 #[inline]
2901 fn from_wire_ref(wire: &crate::wire::ConfigurationError) -> Self {
2902 Self::from(*wire)
2903 }
2904 }
2905
2906 pub type LogFlusherWaitUntilFlushedResponse = ();
2907
2908 #[derive(Debug, Clone, PartialEq)]
2909 pub struct LogInterestSelector {
2910 pub selector: crate::natural::ComponentSelector,
2911
2912 pub interest: ::fidl_next_common_fuchsia_diagnostics_types::natural::Interest,
2913 }
2914
2915 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>
2916 for LogInterestSelector
2917 where
2918 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2919 ___E: ::fidl_next::Encoder,
2920 {
2921 #[inline]
2922 fn encode(
2923 self,
2924 encoder_: &mut ___E,
2925 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogInterestSelector<'static>>,
2926 _: (),
2927 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2928 ::fidl_next::munge! {
2929 let crate::wire::LogInterestSelector {
2930 selector,
2931 interest,
2932
2933 } = out_;
2934 }
2935
2936 ::fidl_next::Encode::encode(self.selector, encoder_, selector, ())?;
2937
2938 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(selector.as_mut_ptr()) };
2939
2940 ::fidl_next::Encode::encode(self.interest, encoder_, interest, ())?;
2941
2942 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(interest.as_mut_ptr()) };
2943
2944 Ok(())
2945 }
2946 }
2947
2948 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>
2949 for &'a LogInterestSelector
2950 where
2951 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2952 ___E: ::fidl_next::Encoder,
2953 {
2954 #[inline]
2955 fn encode(
2956 self,
2957 encoder_: &mut ___E,
2958 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogInterestSelector<'static>>,
2959 _: (),
2960 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2961 ::fidl_next::munge! {
2962 let crate::wire::LogInterestSelector {
2963 selector,
2964 interest,
2965
2966 } = out_;
2967 }
2968
2969 ::fidl_next::Encode::encode(&self.selector, encoder_, selector, ())?;
2970
2971 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(selector.as_mut_ptr()) };
2972
2973 ::fidl_next::Encode::encode(&self.interest, encoder_, interest, ())?;
2974
2975 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(interest.as_mut_ptr()) };
2976
2977 Ok(())
2978 }
2979 }
2980
2981 unsafe impl<___E>
2982 ::fidl_next::EncodeOption<
2983 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
2984 ___E,
2985 > for LogInterestSelector
2986 where
2987 ___E: ::fidl_next::Encoder + ?Sized,
2988 LogInterestSelector: ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>,
2989 {
2990 #[inline]
2991 fn encode_option(
2992 this: ::core::option::Option<Self>,
2993 encoder: &mut ___E,
2994 out: &mut ::core::mem::MaybeUninit<
2995 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
2996 >,
2997 _: (),
2998 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2999 if let Some(inner) = this {
3000 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3001 ::fidl_next::wire::Box::encode_present(out);
3002 } else {
3003 ::fidl_next::wire::Box::encode_absent(out);
3004 }
3005
3006 Ok(())
3007 }
3008 }
3009
3010 unsafe impl<'a, ___E>
3011 ::fidl_next::EncodeOption<
3012 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
3013 ___E,
3014 > for &'a LogInterestSelector
3015 where
3016 ___E: ::fidl_next::Encoder + ?Sized,
3017 &'a LogInterestSelector:
3018 ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>,
3019 {
3020 #[inline]
3021 fn encode_option(
3022 this: ::core::option::Option<Self>,
3023 encoder: &mut ___E,
3024 out: &mut ::core::mem::MaybeUninit<
3025 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
3026 >,
3027 _: (),
3028 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3029 if let Some(inner) = this {
3030 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3031 ::fidl_next::wire::Box::encode_present(out);
3032 } else {
3033 ::fidl_next::wire::Box::encode_absent(out);
3034 }
3035
3036 Ok(())
3037 }
3038 }
3039
3040 impl<'de> ::fidl_next::FromWire<crate::wire::LogInterestSelector<'de>> for LogInterestSelector {
3041 #[inline]
3042 fn from_wire(wire: crate::wire::LogInterestSelector<'de>) -> Self {
3043 Self {
3044 selector: ::fidl_next::FromWire::from_wire(wire.selector),
3045
3046 interest: ::fidl_next::FromWire::from_wire(wire.interest),
3047 }
3048 }
3049 }
3050
3051 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogInterestSelector<'de>> for LogInterestSelector {
3052 #[inline]
3053 fn from_wire_ref(wire: &crate::wire::LogInterestSelector<'de>) -> Self {
3054 Self {
3055 selector: ::fidl_next::FromWireRef::from_wire_ref(&wire.selector),
3056
3057 interest: ::fidl_next::FromWireRef::from_wire_ref(&wire.interest),
3058 }
3059 }
3060 }
3061
3062 #[derive(Debug, Default, Clone, PartialEq)]
3063 pub struct LogSettingsSetComponentInterestRequest {
3064 pub selectors: ::core::option::Option<::std::vec::Vec<crate::natural::LogInterestSelector>>,
3065
3066 pub persist: ::core::option::Option<bool>,
3067 }
3068
3069 impl LogSettingsSetComponentInterestRequest {
3070 fn __max_ordinal(&self) -> usize {
3071 if self.persist.is_some() {
3072 return 2;
3073 }
3074
3075 if self.selectors.is_some() {
3076 return 1;
3077 }
3078
3079 0
3080 }
3081 }
3082
3083 unsafe impl<___E>
3084 ::fidl_next::Encode<crate::wire::LogSettingsSetComponentInterestRequest<'static>, ___E>
3085 for LogSettingsSetComponentInterestRequest
3086 where
3087 ___E: ::fidl_next::Encoder + ?Sized,
3088 {
3089 #[inline]
3090 fn encode(
3091 mut self,
3092 encoder: &mut ___E,
3093 out: &mut ::core::mem::MaybeUninit<
3094 crate::wire::LogSettingsSetComponentInterestRequest<'static>,
3095 >,
3096 _: (),
3097 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3098 ::fidl_next::munge!(let crate::wire::LogSettingsSetComponentInterestRequest { table } = out);
3099
3100 let max_ord = self.__max_ordinal();
3101
3102 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3103 ::fidl_next::Wire::zero_padding(&mut out);
3104
3105 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3106 ::fidl_next::wire::Envelope,
3107 >(encoder, max_ord);
3108
3109 for i in 1..=max_ord {
3110 match i {
3111 2 => {
3112 if let Some(value) = self.persist.take() {
3113 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3114 value,
3115 preallocated.encoder,
3116 &mut out,
3117 (),
3118 )?;
3119 } else {
3120 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3121 }
3122 }
3123
3124 1 => {
3125 if let Some(value) = self.selectors.take() {
3126 ::fidl_next::wire::Envelope::encode_value::<
3127 ::fidl_next::wire::Vector<
3128 'static,
3129 crate::wire::LogInterestSelector<'static>,
3130 >,
3131 ___E,
3132 >(
3133 value, preallocated.encoder, &mut out, (64, ())
3134 )?;
3135 } else {
3136 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3137 }
3138 }
3139
3140 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3141 }
3142 unsafe {
3143 preallocated.write_next(out.assume_init_ref());
3144 }
3145 }
3146
3147 ::fidl_next::wire::Table::encode_len(table, max_ord);
3148
3149 Ok(())
3150 }
3151 }
3152
3153 unsafe impl<'a, ___E>
3154 ::fidl_next::Encode<crate::wire::LogSettingsSetComponentInterestRequest<'static>, ___E>
3155 for &'a LogSettingsSetComponentInterestRequest
3156 where
3157 ___E: ::fidl_next::Encoder + ?Sized,
3158 {
3159 #[inline]
3160 fn encode(
3161 self,
3162 encoder: &mut ___E,
3163 out: &mut ::core::mem::MaybeUninit<
3164 crate::wire::LogSettingsSetComponentInterestRequest<'static>,
3165 >,
3166 _: (),
3167 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3168 ::fidl_next::munge!(let crate::wire::LogSettingsSetComponentInterestRequest { table } = out);
3169
3170 let max_ord = self.__max_ordinal();
3171
3172 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3173 ::fidl_next::Wire::zero_padding(&mut out);
3174
3175 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3176 ::fidl_next::wire::Envelope,
3177 >(encoder, max_ord);
3178
3179 for i in 1..=max_ord {
3180 match i {
3181 2 => {
3182 if let Some(value) = &self.persist {
3183 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3184 value,
3185 preallocated.encoder,
3186 &mut out,
3187 (),
3188 )?;
3189 } else {
3190 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3191 }
3192 }
3193
3194 1 => {
3195 if let Some(value) = &self.selectors {
3196 ::fidl_next::wire::Envelope::encode_value::<
3197 ::fidl_next::wire::Vector<
3198 'static,
3199 crate::wire::LogInterestSelector<'static>,
3200 >,
3201 ___E,
3202 >(
3203 value, preallocated.encoder, &mut out, (64, ())
3204 )?;
3205 } else {
3206 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3207 }
3208 }
3209
3210 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3211 }
3212 unsafe {
3213 preallocated.write_next(out.assume_init_ref());
3214 }
3215 }
3216
3217 ::fidl_next::wire::Table::encode_len(table, max_ord);
3218
3219 Ok(())
3220 }
3221 }
3222
3223 impl<'de> ::fidl_next::FromWire<crate::wire::LogSettingsSetComponentInterestRequest<'de>>
3224 for LogSettingsSetComponentInterestRequest
3225 {
3226 #[inline]
3227 fn from_wire(wire_: crate::wire::LogSettingsSetComponentInterestRequest<'de>) -> Self {
3228 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3229
3230 let selectors = wire_.table.get(1);
3231
3232 let persist = wire_.table.get(2);
3233
3234 Self {
3235 selectors: selectors.map(|envelope| {
3236 ::fidl_next::FromWire::from_wire(unsafe {
3237 envelope.read_unchecked::<::fidl_next::wire::Vector<
3238 'de,
3239 crate::wire::LogInterestSelector<'de>,
3240 >>()
3241 })
3242 }),
3243
3244 persist: persist.map(|envelope| {
3245 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3246 }),
3247 }
3248 }
3249 }
3250
3251 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogSettingsSetComponentInterestRequest<'de>>
3252 for LogSettingsSetComponentInterestRequest
3253 {
3254 #[inline]
3255 fn from_wire_ref(wire: &crate::wire::LogSettingsSetComponentInterestRequest<'de>) -> Self {
3256 Self {
3257 selectors: wire.table.get(1).map(|envelope| {
3258 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3259 envelope.deref_unchecked::<::fidl_next::wire::Vector<
3260 'de,
3261 crate::wire::LogInterestSelector<'de>,
3262 >>()
3263 })
3264 }),
3265
3266 persist: wire.table.get(2).map(|envelope| {
3267 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3268 envelope.deref_unchecked::<bool>()
3269 })
3270 }),
3271 }
3272 }
3273 }
3274
3275 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3276 pub struct LogStreamOptions {
3277 pub mode: ::core::option::Option<crate::natural::StreamMode>,
3278
3279 pub include_moniker: ::core::option::Option<bool>,
3280
3281 pub include_component_url: ::core::option::Option<bool>,
3282
3283 pub include_rolled_out: ::core::option::Option<bool>,
3284
3285 pub subscribe_to_manifest: ::core::option::Option<bool>,
3286 }
3287
3288 impl LogStreamOptions {
3289 fn __max_ordinal(&self) -> usize {
3290 if self.subscribe_to_manifest.is_some() {
3291 return 5;
3292 }
3293
3294 if self.include_rolled_out.is_some() {
3295 return 4;
3296 }
3297
3298 if self.include_component_url.is_some() {
3299 return 3;
3300 }
3301
3302 if self.include_moniker.is_some() {
3303 return 2;
3304 }
3305
3306 if self.mode.is_some() {
3307 return 1;
3308 }
3309
3310 0
3311 }
3312 }
3313
3314 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogStreamOptions<'static>, ___E>
3315 for LogStreamOptions
3316 where
3317 ___E: ::fidl_next::Encoder + ?Sized,
3318 {
3319 #[inline]
3320 fn encode(
3321 mut self,
3322 encoder: &mut ___E,
3323 out: &mut ::core::mem::MaybeUninit<crate::wire::LogStreamOptions<'static>>,
3324 _: (),
3325 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3326 ::fidl_next::munge!(let crate::wire::LogStreamOptions { table } = out);
3327
3328 let max_ord = self.__max_ordinal();
3329
3330 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3331 ::fidl_next::Wire::zero_padding(&mut out);
3332
3333 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3334 ::fidl_next::wire::Envelope,
3335 >(encoder, max_ord);
3336
3337 for i in 1..=max_ord {
3338 match i {
3339 5 => {
3340 if let Some(value) = self.subscribe_to_manifest.take() {
3341 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3342 value,
3343 preallocated.encoder,
3344 &mut out,
3345 (),
3346 )?;
3347 } else {
3348 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3349 }
3350 }
3351
3352 4 => {
3353 if let Some(value) = self.include_rolled_out.take() {
3354 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3355 value,
3356 preallocated.encoder,
3357 &mut out,
3358 (),
3359 )?;
3360 } else {
3361 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3362 }
3363 }
3364
3365 3 => {
3366 if let Some(value) = self.include_component_url.take() {
3367 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3368 value,
3369 preallocated.encoder,
3370 &mut out,
3371 (),
3372 )?;
3373 } else {
3374 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3375 }
3376 }
3377
3378 2 => {
3379 if let Some(value) = self.include_moniker.take() {
3380 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3381 value,
3382 preallocated.encoder,
3383 &mut out,
3384 (),
3385 )?;
3386 } else {
3387 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3388 }
3389 }
3390
3391 1 => {
3392 if let Some(value) = self.mode.take() {
3393 ::fidl_next::wire::Envelope::encode_value::<
3394 crate::wire::StreamMode,
3395 ___E,
3396 >(
3397 value, preallocated.encoder, &mut out, ()
3398 )?;
3399 } else {
3400 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3401 }
3402 }
3403
3404 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3405 }
3406 unsafe {
3407 preallocated.write_next(out.assume_init_ref());
3408 }
3409 }
3410
3411 ::fidl_next::wire::Table::encode_len(table, max_ord);
3412
3413 Ok(())
3414 }
3415 }
3416
3417 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogStreamOptions<'static>, ___E>
3418 for &'a LogStreamOptions
3419 where
3420 ___E: ::fidl_next::Encoder + ?Sized,
3421 {
3422 #[inline]
3423 fn encode(
3424 self,
3425 encoder: &mut ___E,
3426 out: &mut ::core::mem::MaybeUninit<crate::wire::LogStreamOptions<'static>>,
3427 _: (),
3428 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3429 ::fidl_next::munge!(let crate::wire::LogStreamOptions { table } = out);
3430
3431 let max_ord = self.__max_ordinal();
3432
3433 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3434 ::fidl_next::Wire::zero_padding(&mut out);
3435
3436 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3437 ::fidl_next::wire::Envelope,
3438 >(encoder, max_ord);
3439
3440 for i in 1..=max_ord {
3441 match i {
3442 5 => {
3443 if let Some(value) = &self.subscribe_to_manifest {
3444 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3445 value,
3446 preallocated.encoder,
3447 &mut out,
3448 (),
3449 )?;
3450 } else {
3451 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3452 }
3453 }
3454
3455 4 => {
3456 if let Some(value) = &self.include_rolled_out {
3457 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3458 value,
3459 preallocated.encoder,
3460 &mut out,
3461 (),
3462 )?;
3463 } else {
3464 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3465 }
3466 }
3467
3468 3 => {
3469 if let Some(value) = &self.include_component_url {
3470 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3471 value,
3472 preallocated.encoder,
3473 &mut out,
3474 (),
3475 )?;
3476 } else {
3477 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3478 }
3479 }
3480
3481 2 => {
3482 if let Some(value) = &self.include_moniker {
3483 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3484 value,
3485 preallocated.encoder,
3486 &mut out,
3487 (),
3488 )?;
3489 } else {
3490 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3491 }
3492 }
3493
3494 1 => {
3495 if let Some(value) = &self.mode {
3496 ::fidl_next::wire::Envelope::encode_value::<
3497 crate::wire::StreamMode,
3498 ___E,
3499 >(
3500 value, preallocated.encoder, &mut out, ()
3501 )?;
3502 } else {
3503 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3504 }
3505 }
3506
3507 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3508 }
3509 unsafe {
3510 preallocated.write_next(out.assume_init_ref());
3511 }
3512 }
3513
3514 ::fidl_next::wire::Table::encode_len(table, max_ord);
3515
3516 Ok(())
3517 }
3518 }
3519
3520 impl<'de> ::fidl_next::FromWire<crate::wire::LogStreamOptions<'de>> for LogStreamOptions {
3521 #[inline]
3522 fn from_wire(wire_: crate::wire::LogStreamOptions<'de>) -> Self {
3523 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3524
3525 let mode = wire_.table.get(1);
3526
3527 let include_moniker = wire_.table.get(2);
3528
3529 let include_component_url = wire_.table.get(3);
3530
3531 let include_rolled_out = wire_.table.get(4);
3532
3533 let subscribe_to_manifest = wire_.table.get(5);
3534
3535 Self {
3536 mode: mode.map(|envelope| {
3537 ::fidl_next::FromWire::from_wire(unsafe {
3538 envelope.read_unchecked::<crate::wire::StreamMode>()
3539 })
3540 }),
3541
3542 include_moniker: include_moniker.map(|envelope| {
3543 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3544 }),
3545
3546 include_component_url: include_component_url.map(|envelope| {
3547 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3548 }),
3549
3550 include_rolled_out: include_rolled_out.map(|envelope| {
3551 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3552 }),
3553
3554 subscribe_to_manifest: subscribe_to_manifest.map(|envelope| {
3555 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3556 }),
3557 }
3558 }
3559 }
3560
3561 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogStreamOptions<'de>> for LogStreamOptions {
3562 #[inline]
3563 fn from_wire_ref(wire: &crate::wire::LogStreamOptions<'de>) -> Self {
3564 Self {
3565 mode: wire.table.get(1).map(|envelope| {
3566 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3567 envelope.deref_unchecked::<crate::wire::StreamMode>()
3568 })
3569 }),
3570
3571 include_moniker: wire.table.get(2).map(|envelope| {
3572 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3573 envelope.deref_unchecked::<bool>()
3574 })
3575 }),
3576
3577 include_component_url: wire.table.get(3).map(|envelope| {
3578 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3579 envelope.deref_unchecked::<bool>()
3580 })
3581 }),
3582
3583 include_rolled_out: wire.table.get(4).map(|envelope| {
3584 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3585 envelope.deref_unchecked::<bool>()
3586 })
3587 }),
3588
3589 subscribe_to_manifest: wire.table.get(5).map(|envelope| {
3590 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3591 envelope.deref_unchecked::<bool>()
3592 })
3593 }),
3594 }
3595 }
3596 }
3597
3598 #[doc = " `RuntimeError` indicates errors that manifest after the Sample server has\n begun periodically sampling data. Clients can ignore these errors, though\n they could potentially indicate that no `SampleReady` request will ever arrive,\n or that the batch iterator might behave in unexpected ways, such as hanging.\n"]
3599 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3600 #[repr(u32)]
3601 pub enum RuntimeError {
3602 BatchIteratorFailed = 1,
3603 UnknownOrdinal_(u32) = 2,
3604 }
3605 impl ::std::convert::From<u32> for RuntimeError {
3606 fn from(value: u32) -> Self {
3607 match value {
3608 1 => Self::BatchIteratorFailed,
3609
3610 _ => Self::UnknownOrdinal_(value),
3611 }
3612 }
3613 }
3614
3615 impl ::std::convert::From<RuntimeError> for u32 {
3616 fn from(value: RuntimeError) -> Self {
3617 match value {
3618 RuntimeError::BatchIteratorFailed => 1,
3619
3620 RuntimeError::UnknownOrdinal_(value) => value,
3621 }
3622 }
3623 }
3624
3625 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RuntimeError, ___E> for RuntimeError
3626 where
3627 ___E: ?Sized,
3628 {
3629 #[inline]
3630 fn encode(
3631 self,
3632 encoder: &mut ___E,
3633 out: &mut ::core::mem::MaybeUninit<crate::wire::RuntimeError>,
3634 _: (),
3635 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3636 ::fidl_next::Encode::encode(&self, encoder, out, ())
3637 }
3638 }
3639
3640 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RuntimeError, ___E> for &'a RuntimeError
3641 where
3642 ___E: ?Sized,
3643 {
3644 #[inline]
3645 fn encode(
3646 self,
3647 encoder: &mut ___E,
3648 out: &mut ::core::mem::MaybeUninit<crate::wire::RuntimeError>,
3649 _: (),
3650 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3651 ::fidl_next::munge!(let crate::wire::RuntimeError { value } = out);
3652 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
3653 RuntimeError::BatchIteratorFailed => 1,
3654
3655 RuntimeError::UnknownOrdinal_(value) => value,
3656 }));
3657
3658 Ok(())
3659 }
3660 }
3661
3662 impl ::core::convert::From<crate::wire::RuntimeError> for RuntimeError {
3663 fn from(wire: crate::wire::RuntimeError) -> Self {
3664 match u32::from(wire.value) {
3665 1 => Self::BatchIteratorFailed,
3666
3667 value => Self::UnknownOrdinal_(value),
3668 }
3669 }
3670 }
3671
3672 impl ::fidl_next::FromWire<crate::wire::RuntimeError> for RuntimeError {
3673 #[inline]
3674 fn from_wire(wire: crate::wire::RuntimeError) -> Self {
3675 Self::from(wire)
3676 }
3677 }
3678
3679 impl ::fidl_next::FromWireRef<crate::wire::RuntimeError> for RuntimeError {
3680 #[inline]
3681 fn from_wire_ref(wire: &crate::wire::RuntimeError) -> Self {
3682 Self::from(*wire)
3683 }
3684 }
3685
3686 #[doc = " `SampleStrategy` instructs Archivist on the circumstances under which you\n want to receive data for the given `SampleDatum`.\n"]
3687 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3688 #[repr(u8)]
3689 pub enum SampleStrategy {
3690 OnDiff = 1,
3691 Always = 2,
3692 UnknownOrdinal_(u8) = 3,
3693 }
3694 impl ::std::convert::From<u8> for SampleStrategy {
3695 fn from(value: u8) -> Self {
3696 match value {
3697 1 => Self::OnDiff,
3698 2 => Self::Always,
3699
3700 _ => Self::UnknownOrdinal_(value),
3701 }
3702 }
3703 }
3704
3705 impl ::std::convert::From<SampleStrategy> for u8 {
3706 fn from(value: SampleStrategy) -> Self {
3707 match value {
3708 SampleStrategy::OnDiff => 1,
3709 SampleStrategy::Always => 2,
3710
3711 SampleStrategy::UnknownOrdinal_(value) => value,
3712 }
3713 }
3714 }
3715
3716 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleStrategy, ___E> for SampleStrategy
3717 where
3718 ___E: ?Sized,
3719 {
3720 #[inline]
3721 fn encode(
3722 self,
3723 encoder: &mut ___E,
3724 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleStrategy>,
3725 _: (),
3726 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3727 ::fidl_next::Encode::encode(&self, encoder, out, ())
3728 }
3729 }
3730
3731 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SampleStrategy, ___E> for &'a SampleStrategy
3732 where
3733 ___E: ?Sized,
3734 {
3735 #[inline]
3736 fn encode(
3737 self,
3738 encoder: &mut ___E,
3739 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleStrategy>,
3740 _: (),
3741 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3742 ::fidl_next::munge!(let crate::wire::SampleStrategy { value } = out);
3743 let _ = value.write(u8::from(match *self {
3744 SampleStrategy::OnDiff => 1,
3745
3746 SampleStrategy::Always => 2,
3747
3748 SampleStrategy::UnknownOrdinal_(value) => value,
3749 }));
3750
3751 Ok(())
3752 }
3753 }
3754
3755 impl ::core::convert::From<crate::wire::SampleStrategy> for SampleStrategy {
3756 fn from(wire: crate::wire::SampleStrategy) -> Self {
3757 match u8::from(wire.value) {
3758 1 => Self::OnDiff,
3759
3760 2 => Self::Always,
3761
3762 value => Self::UnknownOrdinal_(value),
3763 }
3764 }
3765 }
3766
3767 impl ::fidl_next::FromWire<crate::wire::SampleStrategy> for SampleStrategy {
3768 #[inline]
3769 fn from_wire(wire: crate::wire::SampleStrategy) -> Self {
3770 Self::from(wire)
3771 }
3772 }
3773
3774 impl ::fidl_next::FromWireRef<crate::wire::SampleStrategy> for SampleStrategy {
3775 #[inline]
3776 fn from_wire_ref(wire: &crate::wire::SampleStrategy) -> Self {
3777 Self::from(*wire)
3778 }
3779 }
3780
3781 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3782 pub struct SampleDatum {
3783 pub selector: ::core::option::Option<crate::natural::SelectorArgument>,
3784
3785 pub strategy: ::core::option::Option<crate::natural::SampleStrategy>,
3786
3787 pub interval_secs: ::core::option::Option<i64>,
3788 }
3789
3790 impl SampleDatum {
3791 fn __max_ordinal(&self) -> usize {
3792 if self.interval_secs.is_some() {
3793 return 3;
3794 }
3795
3796 if self.strategy.is_some() {
3797 return 2;
3798 }
3799
3800 if self.selector.is_some() {
3801 return 1;
3802 }
3803
3804 0
3805 }
3806 }
3807
3808 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleDatum<'static>, ___E> for SampleDatum
3809 where
3810 ___E: ::fidl_next::Encoder + ?Sized,
3811 {
3812 #[inline]
3813 fn encode(
3814 mut self,
3815 encoder: &mut ___E,
3816 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleDatum<'static>>,
3817 _: (),
3818 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3819 ::fidl_next::munge!(let crate::wire::SampleDatum { table } = out);
3820
3821 let max_ord = self.__max_ordinal();
3822
3823 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3824 ::fidl_next::Wire::zero_padding(&mut out);
3825
3826 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3827 ::fidl_next::wire::Envelope,
3828 >(encoder, max_ord);
3829
3830 for i in 1..=max_ord {
3831 match i {
3832 3 => {
3833 if let Some(value) = self.interval_secs.take() {
3834 ::fidl_next::wire::Envelope::encode_value::<
3835 ::fidl_next::wire::Int64,
3836 ___E,
3837 >(
3838 value, preallocated.encoder, &mut out, ()
3839 )?;
3840 } else {
3841 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3842 }
3843 }
3844
3845 2 => {
3846 if let Some(value) = self.strategy.take() {
3847 ::fidl_next::wire::Envelope::encode_value::<
3848 crate::wire::SampleStrategy,
3849 ___E,
3850 >(
3851 value, preallocated.encoder, &mut out, ()
3852 )?;
3853 } else {
3854 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3855 }
3856 }
3857
3858 1 => {
3859 if let Some(value) = self.selector.take() {
3860 ::fidl_next::wire::Envelope::encode_value::<
3861 crate::wire::SelectorArgument<'static>,
3862 ___E,
3863 >(
3864 value, preallocated.encoder, &mut out, ()
3865 )?;
3866 } else {
3867 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3868 }
3869 }
3870
3871 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3872 }
3873 unsafe {
3874 preallocated.write_next(out.assume_init_ref());
3875 }
3876 }
3877
3878 ::fidl_next::wire::Table::encode_len(table, max_ord);
3879
3880 Ok(())
3881 }
3882 }
3883
3884 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SampleDatum<'static>, ___E>
3885 for &'a SampleDatum
3886 where
3887 ___E: ::fidl_next::Encoder + ?Sized,
3888 {
3889 #[inline]
3890 fn encode(
3891 self,
3892 encoder: &mut ___E,
3893 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleDatum<'static>>,
3894 _: (),
3895 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3896 ::fidl_next::munge!(let crate::wire::SampleDatum { table } = out);
3897
3898 let max_ord = self.__max_ordinal();
3899
3900 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3901 ::fidl_next::Wire::zero_padding(&mut out);
3902
3903 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3904 ::fidl_next::wire::Envelope,
3905 >(encoder, max_ord);
3906
3907 for i in 1..=max_ord {
3908 match i {
3909 3 => {
3910 if let Some(value) = &self.interval_secs {
3911 ::fidl_next::wire::Envelope::encode_value::<
3912 ::fidl_next::wire::Int64,
3913 ___E,
3914 >(
3915 value, preallocated.encoder, &mut out, ()
3916 )?;
3917 } else {
3918 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3919 }
3920 }
3921
3922 2 => {
3923 if let Some(value) = &self.strategy {
3924 ::fidl_next::wire::Envelope::encode_value::<
3925 crate::wire::SampleStrategy,
3926 ___E,
3927 >(
3928 value, preallocated.encoder, &mut out, ()
3929 )?;
3930 } else {
3931 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3932 }
3933 }
3934
3935 1 => {
3936 if let Some(value) = &self.selector {
3937 ::fidl_next::wire::Envelope::encode_value::<
3938 crate::wire::SelectorArgument<'static>,
3939 ___E,
3940 >(
3941 value, preallocated.encoder, &mut out, ()
3942 )?;
3943 } else {
3944 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3945 }
3946 }
3947
3948 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3949 }
3950 unsafe {
3951 preallocated.write_next(out.assume_init_ref());
3952 }
3953 }
3954
3955 ::fidl_next::wire::Table::encode_len(table, max_ord);
3956
3957 Ok(())
3958 }
3959 }
3960
3961 impl<'de> ::fidl_next::FromWire<crate::wire::SampleDatum<'de>> for SampleDatum {
3962 #[inline]
3963 fn from_wire(wire_: crate::wire::SampleDatum<'de>) -> Self {
3964 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3965
3966 let selector = wire_.table.get(1);
3967
3968 let strategy = wire_.table.get(2);
3969
3970 let interval_secs = wire_.table.get(3);
3971
3972 Self {
3973 selector: selector.map(|envelope| {
3974 ::fidl_next::FromWire::from_wire(unsafe {
3975 envelope.read_unchecked::<crate::wire::SelectorArgument<'de>>()
3976 })
3977 }),
3978
3979 strategy: strategy.map(|envelope| {
3980 ::fidl_next::FromWire::from_wire(unsafe {
3981 envelope.read_unchecked::<crate::wire::SampleStrategy>()
3982 })
3983 }),
3984
3985 interval_secs: interval_secs.map(|envelope| {
3986 ::fidl_next::FromWire::from_wire(unsafe {
3987 envelope.read_unchecked::<::fidl_next::wire::Int64>()
3988 })
3989 }),
3990 }
3991 }
3992 }
3993
3994 impl<'de> ::fidl_next::FromWireRef<crate::wire::SampleDatum<'de>> for SampleDatum {
3995 #[inline]
3996 fn from_wire_ref(wire: &crate::wire::SampleDatum<'de>) -> Self {
3997 Self {
3998 selector: wire.table.get(1).map(|envelope| {
3999 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4000 envelope.deref_unchecked::<crate::wire::SelectorArgument<'de>>()
4001 })
4002 }),
4003
4004 strategy: wire.table.get(2).map(|envelope| {
4005 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4006 envelope.deref_unchecked::<crate::wire::SampleStrategy>()
4007 })
4008 }),
4009
4010 interval_secs: wire.table.get(3).map(|envelope| {
4011 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4012 envelope.deref_unchecked::<::fidl_next::wire::Int64>()
4013 })
4014 }),
4015 }
4016 }
4017 }
4018
4019 #[doc = " The data for one Sample server.\n"]
4020 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4021 pub struct SampleParameters {
4022 pub data: ::core::option::Option<::std::vec::Vec<crate::natural::SampleDatum>>,
4023 }
4024
4025 impl SampleParameters {
4026 fn __max_ordinal(&self) -> usize {
4027 if self.data.is_some() {
4028 return 1;
4029 }
4030
4031 0
4032 }
4033 }
4034
4035 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleParameters<'static>, ___E>
4036 for SampleParameters
4037 where
4038 ___E: ::fidl_next::Encoder + ?Sized,
4039 {
4040 #[inline]
4041 fn encode(
4042 mut self,
4043 encoder: &mut ___E,
4044 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleParameters<'static>>,
4045 _: (),
4046 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4047 ::fidl_next::munge!(let crate::wire::SampleParameters { table } = out);
4048
4049 let max_ord = self.__max_ordinal();
4050
4051 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4052 ::fidl_next::Wire::zero_padding(&mut out);
4053
4054 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4055 ::fidl_next::wire::Envelope,
4056 >(encoder, max_ord);
4057
4058 for i in 1..=max_ord {
4059 match i {
4060 1 => {
4061 if let Some(value) = self.data.take() {
4062 ::fidl_next::wire::Envelope::encode_value::<
4063 ::fidl_next::wire::Vector<
4064 'static,
4065 crate::wire::SampleDatum<'static>,
4066 >,
4067 ___E,
4068 >(
4069 value, preallocated.encoder, &mut out, (100, ())
4070 )?;
4071 } else {
4072 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4073 }
4074 }
4075
4076 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4077 }
4078 unsafe {
4079 preallocated.write_next(out.assume_init_ref());
4080 }
4081 }
4082
4083 ::fidl_next::wire::Table::encode_len(table, max_ord);
4084
4085 Ok(())
4086 }
4087 }
4088
4089 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SampleParameters<'static>, ___E>
4090 for &'a SampleParameters
4091 where
4092 ___E: ::fidl_next::Encoder + ?Sized,
4093 {
4094 #[inline]
4095 fn encode(
4096 self,
4097 encoder: &mut ___E,
4098 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleParameters<'static>>,
4099 _: (),
4100 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4101 ::fidl_next::munge!(let crate::wire::SampleParameters { table } = out);
4102
4103 let max_ord = self.__max_ordinal();
4104
4105 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4106 ::fidl_next::Wire::zero_padding(&mut out);
4107
4108 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4109 ::fidl_next::wire::Envelope,
4110 >(encoder, max_ord);
4111
4112 for i in 1..=max_ord {
4113 match i {
4114 1 => {
4115 if let Some(value) = &self.data {
4116 ::fidl_next::wire::Envelope::encode_value::<
4117 ::fidl_next::wire::Vector<
4118 'static,
4119 crate::wire::SampleDatum<'static>,
4120 >,
4121 ___E,
4122 >(
4123 value, preallocated.encoder, &mut out, (100, ())
4124 )?;
4125 } else {
4126 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4127 }
4128 }
4129
4130 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4131 }
4132 unsafe {
4133 preallocated.write_next(out.assume_init_ref());
4134 }
4135 }
4136
4137 ::fidl_next::wire::Table::encode_len(table, max_ord);
4138
4139 Ok(())
4140 }
4141 }
4142
4143 impl<'de> ::fidl_next::FromWire<crate::wire::SampleParameters<'de>> for SampleParameters {
4144 #[inline]
4145 fn from_wire(wire_: crate::wire::SampleParameters<'de>) -> Self {
4146 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4147
4148 let data = wire_.table.get(1);
4149
4150 Self {
4151
4152
4153 data: data.map(|envelope| ::fidl_next::FromWire::from_wire(
4154 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>() }
4155 )),
4156
4157 }
4158 }
4159 }
4160
4161 impl<'de> ::fidl_next::FromWireRef<crate::wire::SampleParameters<'de>> for SampleParameters {
4162 #[inline]
4163 fn from_wire_ref(wire: &crate::wire::SampleParameters<'de>) -> Self {
4164 Self {
4165
4166
4167 data: wire.table.get(1)
4168 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
4169 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>() }
4170 )),
4171
4172 }
4173 }
4174 }
4175
4176 pub type SampleCommitResponse = ();
4177}
4178
4179pub mod wire {
4180
4181 pub type All = ::fidl_next::wire::Unit;
4183
4184 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4186 #[repr(transparent)]
4187 pub struct DataType {
4188 pub(crate) value: u8,
4189 }
4190
4191 impl ::fidl_next::Constrained for DataType {
4192 type Constraint = ();
4193
4194 fn validate(
4195 _: ::fidl_next::Slot<'_, Self>,
4196 _: Self::Constraint,
4197 ) -> Result<(), ::fidl_next::ValidationError> {
4198 Ok(())
4199 }
4200 }
4201
4202 unsafe impl ::fidl_next::Wire for DataType {
4203 type Narrowed<'de> = Self;
4204
4205 #[inline]
4206 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4207 }
4209 }
4210
4211 impl DataType {
4212 pub const INSPECT: DataType = DataType { value: 1 };
4213
4214 pub const LOGS: DataType = DataType { value: 3 };
4215 }
4216
4217 unsafe impl<___D> ::fidl_next::Decode<___D> for DataType
4218 where
4219 ___D: ?Sized,
4220 {
4221 fn decode(
4222 slot: ::fidl_next::Slot<'_, Self>,
4223 _: &mut ___D,
4224 _: (),
4225 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4226 ::fidl_next::munge!(let Self { value } = slot);
4227
4228 match u8::from(*value) {
4229 1 | 3 => (),
4230 unknown => {
4231 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
4232 }
4233 }
4234
4235 Ok(())
4236 }
4237 }
4238
4239 impl ::core::convert::From<crate::natural::DataType> for DataType {
4240 fn from(natural: crate::natural::DataType) -> Self {
4241 match natural {
4242 crate::natural::DataType::Inspect => DataType::INSPECT,
4243
4244 crate::natural::DataType::Logs => DataType::LOGS,
4245 }
4246 }
4247 }
4248
4249 impl ::fidl_next::IntoNatural for DataType {
4250 type Natural = crate::natural::DataType;
4251 }
4252
4253 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4255 #[repr(transparent)]
4256 pub struct StreamMode {
4257 pub(crate) value: u8,
4258 }
4259
4260 impl ::fidl_next::Constrained for StreamMode {
4261 type Constraint = ();
4262
4263 fn validate(
4264 _: ::fidl_next::Slot<'_, Self>,
4265 _: Self::Constraint,
4266 ) -> Result<(), ::fidl_next::ValidationError> {
4267 Ok(())
4268 }
4269 }
4270
4271 unsafe impl ::fidl_next::Wire for StreamMode {
4272 type Narrowed<'de> = Self;
4273
4274 #[inline]
4275 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4276 }
4278 }
4279
4280 impl StreamMode {
4281 pub const SNAPSHOT: StreamMode = StreamMode { value: 1 };
4282
4283 pub const SNAPSHOT_THEN_SUBSCRIBE: StreamMode = StreamMode { value: 2 };
4284
4285 pub const SUBSCRIBE: StreamMode = StreamMode { value: 3 };
4286 }
4287
4288 unsafe impl<___D> ::fidl_next::Decode<___D> for StreamMode
4289 where
4290 ___D: ?Sized,
4291 {
4292 fn decode(
4293 slot: ::fidl_next::Slot<'_, Self>,
4294 _: &mut ___D,
4295 _: (),
4296 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4297 ::fidl_next::munge!(let Self { value } = slot);
4298
4299 match u8::from(*value) {
4300 1 | 2 | 3 => (),
4301 unknown => {
4302 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
4303 }
4304 }
4305
4306 Ok(())
4307 }
4308 }
4309
4310 impl ::core::convert::From<crate::natural::StreamMode> for StreamMode {
4311 fn from(natural: crate::natural::StreamMode) -> Self {
4312 match natural {
4313 crate::natural::StreamMode::Snapshot => StreamMode::SNAPSHOT,
4314
4315 crate::natural::StreamMode::SnapshotThenSubscribe => {
4316 StreamMode::SNAPSHOT_THEN_SUBSCRIBE
4317 }
4318
4319 crate::natural::StreamMode::Subscribe => StreamMode::SUBSCRIBE,
4320 }
4321 }
4322 }
4323
4324 impl ::fidl_next::IntoNatural for StreamMode {
4325 type Natural = crate::natural::StreamMode;
4326 }
4327
4328 #[repr(C)]
4330 pub struct PerformanceConfiguration<'de> {
4331 pub(crate) table: ::fidl_next::wire::Table<'de>,
4332 }
4333
4334 impl<'de> Drop for PerformanceConfiguration<'de> {
4335 fn drop(&mut self) {
4336 let _ = self
4337 .table
4338 .get(1)
4339 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
4340
4341 let _ = self
4342 .table
4343 .get(2)
4344 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
4345 }
4346 }
4347
4348 impl ::fidl_next::Constrained for PerformanceConfiguration<'_> {
4349 type Constraint = ();
4350
4351 fn validate(
4352 _: ::fidl_next::Slot<'_, Self>,
4353 _: Self::Constraint,
4354 ) -> Result<(), ::fidl_next::ValidationError> {
4355 Ok(())
4356 }
4357 }
4358
4359 unsafe impl ::fidl_next::Wire for PerformanceConfiguration<'static> {
4360 type Narrowed<'de> = PerformanceConfiguration<'de>;
4361
4362 #[inline]
4363 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4364 ::fidl_next::munge!(let Self { table } = out);
4365 ::fidl_next::wire::Table::zero_padding(table);
4366 }
4367 }
4368
4369 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PerformanceConfiguration<'de>
4370 where
4371 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4372 {
4373 fn decode(
4374 slot: ::fidl_next::Slot<'_, Self>,
4375 decoder: &mut ___D,
4376 _: (),
4377 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4378 ::fidl_next::munge!(let Self { table } = slot);
4379
4380 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4381 match ordinal {
4382 0 => unsafe { ::core::hint::unreachable_unchecked() },
4383
4384 1 => {
4385 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
4386 slot.as_mut(),
4387 decoder,
4388 (),
4389 )?;
4390
4391 Ok(())
4392 }
4393
4394 2 => {
4395 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
4396 slot.as_mut(),
4397 decoder,
4398 (),
4399 )?;
4400
4401 Ok(())
4402 }
4403
4404 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4405 }
4406 })
4407 }
4408 }
4409
4410 impl<'de> PerformanceConfiguration<'de> {
4411 pub fn max_aggregate_content_size_bytes(
4412 &self,
4413 ) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
4414 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4415 }
4416
4417 pub fn take_max_aggregate_content_size_bytes(
4418 &mut self,
4419 ) -> ::core::option::Option<::fidl_next::wire::Uint64> {
4420 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4421 }
4422
4423 pub fn batch_retrieval_timeout_seconds(
4424 &self,
4425 ) -> ::core::option::Option<&::fidl_next::wire::Int64> {
4426 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4427 }
4428
4429 pub fn take_batch_retrieval_timeout_seconds(
4430 &mut self,
4431 ) -> ::core::option::Option<::fidl_next::wire::Int64> {
4432 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
4433 }
4434 }
4435
4436 impl<'de> ::core::fmt::Debug for PerformanceConfiguration<'de> {
4437 fn fmt(
4438 &self,
4439 f: &mut ::core::fmt::Formatter<'_>,
4440 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4441 f.debug_struct("PerformanceConfiguration")
4442 .field("max_aggregate_content_size_bytes", &self.max_aggregate_content_size_bytes())
4443 .field("batch_retrieval_timeout_seconds", &self.batch_retrieval_timeout_seconds())
4444 .finish()
4445 }
4446 }
4447
4448 impl<'de> ::fidl_next::IntoNatural for PerformanceConfiguration<'de> {
4449 type Natural = crate::natural::PerformanceConfiguration;
4450 }
4451
4452 #[repr(transparent)]
4454 pub struct StringSelector<'de> {
4455 pub(crate) raw: ::fidl_next::wire::Union,
4456 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4457 }
4458
4459 impl<'de> Drop for StringSelector<'de> {
4460 fn drop(&mut self) {
4461 match self.raw.ordinal() {
4462 1 => {
4463 let _ = unsafe {
4464 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4465 };
4466 }
4467
4468 2 => {
4469 let _ = unsafe {
4470 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4471 };
4472 }
4473
4474 _ => (),
4475 }
4476 }
4477 }
4478
4479 impl ::fidl_next::Constrained for StringSelector<'_> {
4480 type Constraint = ();
4481
4482 fn validate(
4483 _: ::fidl_next::Slot<'_, Self>,
4484 _: Self::Constraint,
4485 ) -> Result<(), ::fidl_next::ValidationError> {
4486 Ok(())
4487 }
4488 }
4489
4490 unsafe impl ::fidl_next::Wire for StringSelector<'static> {
4491 type Narrowed<'de> = StringSelector<'de>;
4492
4493 #[inline]
4494 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4495 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4496 ::fidl_next::wire::Union::zero_padding(raw);
4497 }
4498 }
4499
4500 pub mod string_selector {
4501 pub enum Ref<'de> {
4502 StringPattern(&'de ::fidl_next::wire::String<'de>),
4503
4504 ExactMatch(&'de ::fidl_next::wire::String<'de>),
4505
4506 UnknownOrdinal_(u64),
4507 }
4508
4509 pub enum Value<'de> {
4510 StringPattern(::fidl_next::wire::String<'de>),
4511
4512 ExactMatch(::fidl_next::wire::String<'de>),
4513
4514 UnknownOrdinal_(u64),
4515 }
4516 }
4517
4518 impl<'de> StringSelector<'de> {
4519 pub fn as_ref(&self) -> crate::wire::string_selector::Ref<'_> {
4520 match self.raw.ordinal() {
4521 1 => crate::wire::string_selector::Ref::StringPattern(unsafe {
4522 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
4523 }),
4524
4525 2 => crate::wire::string_selector::Ref::ExactMatch(unsafe {
4526 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
4527 }),
4528
4529 unknown => crate::wire::string_selector::Ref::UnknownOrdinal_(unknown),
4530 }
4531 }
4532
4533 pub fn into_inner(self) -> crate::wire::string_selector::Value<'de> {
4534 let this = ::core::mem::ManuallyDrop::new(self);
4535
4536 match this.raw.ordinal() {
4537 1 => crate::wire::string_selector::Value::StringPattern(unsafe {
4538 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4539 }),
4540
4541 2 => crate::wire::string_selector::Value::ExactMatch(unsafe {
4542 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
4543 }),
4544
4545 unknown => crate::wire::string_selector::Value::UnknownOrdinal_(unknown),
4546 }
4547 }
4548 }
4549
4550 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for StringSelector<'de>
4551 where
4552 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4553 ___D: ::fidl_next::Decoder<'de>,
4554 {
4555 fn decode(
4556 mut slot: ::fidl_next::Slot<'_, Self>,
4557 decoder: &mut ___D,
4558 _: (),
4559 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4560 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4561 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
4562 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
4563 raw, decoder, 1024,
4564 )?,
4565
4566 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
4567 raw, decoder, 1024,
4568 )?,
4569
4570 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
4571 }
4572
4573 Ok(())
4574 }
4575 }
4576
4577 impl<'de> ::core::fmt::Debug for StringSelector<'de> {
4578 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4579 match self.raw.ordinal() {
4580 1 => unsafe {
4581 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
4582 },
4583 2 => unsafe {
4584 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
4585 },
4586 _ => unsafe { ::core::hint::unreachable_unchecked() },
4587 }
4588 }
4589 }
4590
4591 impl<'de> ::fidl_next::IntoNatural for StringSelector<'de> {
4592 type Natural = crate::natural::StringSelector;
4593 }
4594
4595 #[repr(C)]
4597 pub struct ComponentSelector<'de> {
4598 pub(crate) table: ::fidl_next::wire::Table<'de>,
4599 }
4600
4601 impl<'de> Drop for ComponentSelector<'de> {
4602 fn drop(&mut self) {
4603 let _ = self.table.get(1)
4604 .map(|envelope| unsafe {
4605 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>>()
4606 });
4607 }
4608 }
4609
4610 impl ::fidl_next::Constrained for ComponentSelector<'_> {
4611 type Constraint = ();
4612
4613 fn validate(
4614 _: ::fidl_next::Slot<'_, Self>,
4615 _: Self::Constraint,
4616 ) -> Result<(), ::fidl_next::ValidationError> {
4617 Ok(())
4618 }
4619 }
4620
4621 unsafe impl ::fidl_next::Wire for ComponentSelector<'static> {
4622 type Narrowed<'de> = ComponentSelector<'de>;
4623
4624 #[inline]
4625 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4626 ::fidl_next::munge!(let Self { table } = out);
4627 ::fidl_next::wire::Table::zero_padding(table);
4628 }
4629 }
4630
4631 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ComponentSelector<'de>
4632 where
4633 ___D: ::fidl_next::Decoder<'de> + ?Sized,
4634 {
4635 fn decode(
4636 slot: ::fidl_next::Slot<'_, Self>,
4637 decoder: &mut ___D,
4638 _: (),
4639 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4640 ::fidl_next::munge!(let Self { table } = slot);
4641
4642 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4643 match ordinal {
4644 0 => unsafe { ::core::hint::unreachable_unchecked() },
4645
4646 1 => {
4647 ::fidl_next::wire::Envelope::decode_as::<
4648 ___D,
4649 ::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>,
4650 >(slot.as_mut(), decoder, (25, ()))?;
4651
4652 let value = unsafe {
4653 slot
4654 .deref_unchecked()
4655 .deref_unchecked::<
4656 ::fidl_next::wire::Vector<'_, crate::wire::StringSelector<'_>>
4657 >()
4658 };
4659
4660 if value.len() > 25 {
4661 return Err(::fidl_next::DecodeError::VectorTooLong {
4662 size: value.len() as u64,
4663 limit: 25,
4664 });
4665 }
4666
4667 Ok(())
4668 }
4669
4670 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
4671 }
4672 })
4673 }
4674 }
4675
4676 impl<'de> ComponentSelector<'de> {
4677 pub fn moniker_segments(
4678 &self,
4679 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>>
4680 {
4681 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4682 }
4683
4684 pub fn take_moniker_segments(
4685 &mut self,
4686 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>>
4687 {
4688 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
4689 }
4690 }
4691
4692 impl<'de> ::core::fmt::Debug for ComponentSelector<'de> {
4693 fn fmt(
4694 &self,
4695 f: &mut ::core::fmt::Formatter<'_>,
4696 ) -> ::core::result::Result<(), ::core::fmt::Error> {
4697 f.debug_struct("ComponentSelector")
4698 .field("moniker_segments", &self.moniker_segments())
4699 .finish()
4700 }
4701 }
4702
4703 impl<'de> ::fidl_next::IntoNatural for ComponentSelector<'de> {
4704 type Natural = crate::natural::ComponentSelector;
4705 }
4706
4707 #[derive(Debug)]
4709 #[repr(C)]
4710 pub struct SubtreeSelector<'de> {
4711 pub node_path: ::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>,
4712 }
4713
4714 static_assertions::const_assert_eq!(std::mem::size_of::<SubtreeSelector<'_>>(), 16);
4715 static_assertions::const_assert_eq!(std::mem::align_of::<SubtreeSelector<'_>>(), 8);
4716
4717 static_assertions::const_assert_eq!(std::mem::offset_of!(SubtreeSelector<'_>, node_path), 0);
4718
4719 impl ::fidl_next::Constrained for SubtreeSelector<'_> {
4720 type Constraint = ();
4721
4722 fn validate(
4723 _: ::fidl_next::Slot<'_, Self>,
4724 _: Self::Constraint,
4725 ) -> Result<(), ::fidl_next::ValidationError> {
4726 Ok(())
4727 }
4728 }
4729
4730 unsafe impl ::fidl_next::Wire for SubtreeSelector<'static> {
4731 type Narrowed<'de> = SubtreeSelector<'de>;
4732
4733 #[inline]
4734 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4735 ::fidl_next::munge! {
4736 let Self {
4737 node_path,
4738
4739 } = &mut *out_;
4740 }
4741
4742 ::fidl_next::Wire::zero_padding(node_path);
4743 }
4744 }
4745
4746 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SubtreeSelector<'de>
4747 where
4748 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4749 ___D: ::fidl_next::Decoder<'de>,
4750 {
4751 fn decode(
4752 slot_: ::fidl_next::Slot<'_, Self>,
4753 decoder_: &mut ___D,
4754 _: (),
4755 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4756 ::fidl_next::munge! {
4757 let Self {
4758 mut node_path,
4759
4760 } = slot_;
4761 }
4762
4763 let _field = node_path.as_mut();
4764 ::fidl_next::Constrained::validate(_field, (100, ()))?;
4765 ::fidl_next::Decode::decode(node_path.as_mut(), decoder_, (100, ()))?;
4766
4767 let node_path = unsafe { node_path.deref_unchecked() };
4768
4769 if node_path.len() > 100 {
4770 return Err(::fidl_next::DecodeError::VectorTooLong {
4771 size: node_path.len() as u64,
4772 limit: 100,
4773 });
4774 }
4775
4776 Ok(())
4777 }
4778 }
4779
4780 impl<'de> ::fidl_next::IntoNatural for SubtreeSelector<'de> {
4781 type Natural = crate::natural::SubtreeSelector;
4782 }
4783
4784 #[derive(Debug)]
4786 #[repr(C)]
4787 pub struct PropertySelector<'de> {
4788 pub node_path: ::fidl_next::wire::Vector<'de, crate::wire::StringSelector<'de>>,
4789
4790 pub target_properties: crate::wire::StringSelector<'de>,
4791 }
4792
4793 static_assertions::const_assert_eq!(std::mem::size_of::<PropertySelector<'_>>(), 32);
4794 static_assertions::const_assert_eq!(std::mem::align_of::<PropertySelector<'_>>(), 8);
4795
4796 static_assertions::const_assert_eq!(std::mem::offset_of!(PropertySelector<'_>, node_path), 0);
4797
4798 static_assertions::const_assert_eq!(
4799 std::mem::offset_of!(PropertySelector<'_>, target_properties),
4800 16
4801 );
4802
4803 impl ::fidl_next::Constrained for PropertySelector<'_> {
4804 type Constraint = ();
4805
4806 fn validate(
4807 _: ::fidl_next::Slot<'_, Self>,
4808 _: Self::Constraint,
4809 ) -> Result<(), ::fidl_next::ValidationError> {
4810 Ok(())
4811 }
4812 }
4813
4814 unsafe impl ::fidl_next::Wire for PropertySelector<'static> {
4815 type Narrowed<'de> = PropertySelector<'de>;
4816
4817 #[inline]
4818 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
4819 ::fidl_next::munge! {
4820 let Self {
4821 node_path,
4822 target_properties,
4823
4824 } = &mut *out_;
4825 }
4826
4827 ::fidl_next::Wire::zero_padding(node_path);
4828
4829 ::fidl_next::Wire::zero_padding(target_properties);
4830 }
4831 }
4832
4833 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PropertySelector<'de>
4834 where
4835 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4836 ___D: ::fidl_next::Decoder<'de>,
4837 {
4838 fn decode(
4839 slot_: ::fidl_next::Slot<'_, Self>,
4840 decoder_: &mut ___D,
4841 _: (),
4842 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4843 ::fidl_next::munge! {
4844 let Self {
4845 mut node_path,
4846 mut target_properties,
4847
4848 } = slot_;
4849 }
4850
4851 let _field = node_path.as_mut();
4852 ::fidl_next::Constrained::validate(_field, (100, ()))?;
4853 ::fidl_next::Decode::decode(node_path.as_mut(), decoder_, (100, ()))?;
4854
4855 let node_path = unsafe { node_path.deref_unchecked() };
4856
4857 if node_path.len() > 100 {
4858 return Err(::fidl_next::DecodeError::VectorTooLong {
4859 size: node_path.len() as u64,
4860 limit: 100,
4861 });
4862 }
4863
4864 let _field = target_properties.as_mut();
4865
4866 ::fidl_next::Decode::decode(target_properties.as_mut(), decoder_, ())?;
4867
4868 Ok(())
4869 }
4870 }
4871
4872 impl<'de> ::fidl_next::IntoNatural for PropertySelector<'de> {
4873 type Natural = crate::natural::PropertySelector;
4874 }
4875
4876 #[repr(transparent)]
4878 pub struct TreeSelector<'de> {
4879 pub(crate) raw: ::fidl_next::wire::Union,
4880 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4881 }
4882
4883 impl<'de> Drop for TreeSelector<'de> {
4884 fn drop(&mut self) {
4885 match self.raw.ordinal() {
4886 1 => {
4887 let _ = unsafe {
4888 self.raw.get().read_unchecked::<crate::wire::SubtreeSelector<'de>>()
4889 };
4890 }
4891
4892 2 => {
4893 let _ = unsafe {
4894 self.raw.get().read_unchecked::<crate::wire::PropertySelector<'de>>()
4895 };
4896 }
4897
4898 _ => (),
4899 }
4900 }
4901 }
4902
4903 impl ::fidl_next::Constrained for TreeSelector<'_> {
4904 type Constraint = ();
4905
4906 fn validate(
4907 _: ::fidl_next::Slot<'_, Self>,
4908 _: Self::Constraint,
4909 ) -> Result<(), ::fidl_next::ValidationError> {
4910 Ok(())
4911 }
4912 }
4913
4914 unsafe impl ::fidl_next::Wire for TreeSelector<'static> {
4915 type Narrowed<'de> = TreeSelector<'de>;
4916
4917 #[inline]
4918 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4919 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4920 ::fidl_next::wire::Union::zero_padding(raw);
4921 }
4922 }
4923
4924 pub mod tree_selector {
4925 pub enum Ref<'de> {
4926 SubtreeSelector(&'de crate::wire::SubtreeSelector<'de>),
4927
4928 PropertySelector(&'de crate::wire::PropertySelector<'de>),
4929
4930 UnknownOrdinal_(u64),
4931 }
4932
4933 pub enum Value<'de> {
4934 SubtreeSelector(crate::wire::SubtreeSelector<'de>),
4935
4936 PropertySelector(crate::wire::PropertySelector<'de>),
4937
4938 UnknownOrdinal_(u64),
4939 }
4940 }
4941
4942 impl<'de> TreeSelector<'de> {
4943 pub fn as_ref(&self) -> crate::wire::tree_selector::Ref<'_> {
4944 match self.raw.ordinal() {
4945 1 => crate::wire::tree_selector::Ref::SubtreeSelector(unsafe {
4946 self.raw.get().deref_unchecked::<crate::wire::SubtreeSelector<'_>>()
4947 }),
4948
4949 2 => crate::wire::tree_selector::Ref::PropertySelector(unsafe {
4950 self.raw.get().deref_unchecked::<crate::wire::PropertySelector<'_>>()
4951 }),
4952
4953 unknown => crate::wire::tree_selector::Ref::UnknownOrdinal_(unknown),
4954 }
4955 }
4956
4957 pub fn into_inner(self) -> crate::wire::tree_selector::Value<'de> {
4958 let this = ::core::mem::ManuallyDrop::new(self);
4959
4960 match this.raw.ordinal() {
4961 1 => crate::wire::tree_selector::Value::SubtreeSelector(unsafe {
4962 this.raw.get().read_unchecked::<crate::wire::SubtreeSelector<'de>>()
4963 }),
4964
4965 2 => crate::wire::tree_selector::Value::PropertySelector(unsafe {
4966 this.raw.get().read_unchecked::<crate::wire::PropertySelector<'de>>()
4967 }),
4968
4969 unknown => crate::wire::tree_selector::Value::UnknownOrdinal_(unknown),
4970 }
4971 }
4972 }
4973
4974 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TreeSelector<'de>
4975 where
4976 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4977 ___D: ::fidl_next::Decoder<'de>,
4978 {
4979 fn decode(
4980 mut slot: ::fidl_next::Slot<'_, Self>,
4981 decoder: &mut ___D,
4982 _: (),
4983 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4984 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4985 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
4986 1 => {
4987 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SubtreeSelector<'de>>(
4988 raw,
4989 decoder,
4990 (),
4991 )?
4992 }
4993
4994 2 => {
4995 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::PropertySelector<'de>>(
4996 raw,
4997 decoder,
4998 (),
4999 )?
5000 }
5001
5002 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
5003 }
5004
5005 Ok(())
5006 }
5007 }
5008
5009 impl<'de> ::core::fmt::Debug for TreeSelector<'de> {
5010 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5011 match self.raw.ordinal() {
5012 1 => unsafe {
5013 self.raw.get().deref_unchecked::<crate::wire::SubtreeSelector<'_>>().fmt(f)
5014 },
5015 2 => unsafe {
5016 self.raw.get().deref_unchecked::<crate::wire::PropertySelector<'_>>().fmt(f)
5017 },
5018 _ => unsafe { ::core::hint::unreachable_unchecked() },
5019 }
5020 }
5021 }
5022
5023 impl<'de> ::fidl_next::IntoNatural for TreeSelector<'de> {
5024 type Natural = crate::natural::TreeSelector;
5025 }
5026
5027 #[repr(transparent)]
5029 pub struct TreeNames<'de> {
5030 pub(crate) raw: ::fidl_next::wire::Union,
5031 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5032 }
5033
5034 impl<'de> Drop for TreeNames<'de> {
5035 fn drop(&mut self) {
5036 match self.raw.ordinal() {
5037 1 => {
5038 let _ = unsafe {
5039 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
5040 };
5041 }
5042
5043 2 => {
5044 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::All>() };
5045 }
5046
5047 _ => (),
5048 }
5049 }
5050 }
5051
5052 impl ::fidl_next::Constrained for TreeNames<'_> {
5053 type Constraint = ();
5054
5055 fn validate(
5056 _: ::fidl_next::Slot<'_, Self>,
5057 _: Self::Constraint,
5058 ) -> Result<(), ::fidl_next::ValidationError> {
5059 Ok(())
5060 }
5061 }
5062
5063 unsafe impl ::fidl_next::Wire for TreeNames<'static> {
5064 type Narrowed<'de> = TreeNames<'de>;
5065
5066 #[inline]
5067 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5068 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5069 ::fidl_next::wire::Union::zero_padding(raw);
5070 }
5071 }
5072
5073 pub mod tree_names {
5074 pub enum Ref<'de> {
5075 Some(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>),
5076
5077 All(&'de crate::wire::All),
5078
5079 UnknownOrdinal_(u64),
5080 }
5081
5082 pub enum Value<'de> {
5083 Some(::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>),
5084
5085 All(crate::wire::All),
5086
5087 UnknownOrdinal_(u64),
5088 }
5089 }
5090
5091 impl<'de> TreeNames<'de> {
5092 pub fn as_ref(&self) -> crate::wire::tree_names::Ref<'_> {
5093 match self.raw.ordinal() {
5094 1 => crate::wire::tree_names::Ref::Some(unsafe {
5095 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>>()
5096 }),
5097
5098 2 => crate::wire::tree_names::Ref::All(unsafe {
5099 self.raw.get().deref_unchecked::<crate::wire::All>()
5100 }),
5101
5102 unknown => crate::wire::tree_names::Ref::UnknownOrdinal_(unknown),
5103 }
5104 }
5105
5106 pub fn into_inner(self) -> crate::wire::tree_names::Value<'de> {
5107 let this = ::core::mem::ManuallyDrop::new(self);
5108
5109 match this.raw.ordinal() {
5110 1 => crate::wire::tree_names::Value::Some(unsafe {
5111 this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
5112 }),
5113
5114 2 => crate::wire::tree_names::Value::All(unsafe {
5115 this.raw.get().read_unchecked::<crate::wire::All>()
5116 }),
5117
5118 unknown => crate::wire::tree_names::Value::UnknownOrdinal_(unknown),
5119 }
5120 }
5121 }
5122
5123 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TreeNames<'de>
5124 where
5125 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5126 ___D: ::fidl_next::Decoder<'de>,
5127 {
5128 fn decode(
5129 mut slot: ::fidl_next::Slot<'_, Self>,
5130 decoder: &mut ___D,
5131 _: (),
5132 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5133 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5134 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
5135 1 => ::fidl_next::wire::Union::decode_as::<
5136 ___D,
5137 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
5138 >(raw, decoder, (4294967295, 1024))?,
5139
5140 2 => {
5141 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::All>(raw, decoder, ())?
5142 }
5143
5144 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
5145 }
5146
5147 Ok(())
5148 }
5149 }
5150
5151 impl<'de> ::core::fmt::Debug for TreeNames<'de> {
5152 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5153 match self.raw.ordinal() {
5154 1 => unsafe {
5155 self.raw.get().deref_unchecked::<
5156 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>
5157 >().fmt(f)
5158 },
5159 2 => unsafe { self.raw.get().deref_unchecked::<crate::wire::All>().fmt(f) },
5160 _ => unsafe { ::core::hint::unreachable_unchecked() },
5161 }
5162 }
5163 }
5164
5165 impl<'de> ::fidl_next::IntoNatural for TreeNames<'de> {
5166 type Natural = crate::natural::TreeNames;
5167 }
5168
5169 #[repr(C)]
5171 pub struct Selector<'de> {
5172 pub(crate) table: ::fidl_next::wire::Table<'de>,
5173 }
5174
5175 impl<'de> Drop for Selector<'de> {
5176 fn drop(&mut self) {
5177 let _ = self.table.get(1).map(|envelope| unsafe {
5178 envelope.read_unchecked::<crate::wire::ComponentSelector<'de>>()
5179 });
5180
5181 let _ = self.table.get(2).map(|envelope| unsafe {
5182 envelope.read_unchecked::<crate::wire::TreeSelector<'de>>()
5183 });
5184
5185 let _ = self.table.get(3).map(|envelope| unsafe {
5186 envelope.read_unchecked::<crate::wire::TreeNames<'de>>()
5187 });
5188 }
5189 }
5190
5191 impl ::fidl_next::Constrained for Selector<'_> {
5192 type Constraint = ();
5193
5194 fn validate(
5195 _: ::fidl_next::Slot<'_, Self>,
5196 _: Self::Constraint,
5197 ) -> Result<(), ::fidl_next::ValidationError> {
5198 Ok(())
5199 }
5200 }
5201
5202 unsafe impl ::fidl_next::Wire for Selector<'static> {
5203 type Narrowed<'de> = Selector<'de>;
5204
5205 #[inline]
5206 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5207 ::fidl_next::munge!(let Self { table } = out);
5208 ::fidl_next::wire::Table::zero_padding(table);
5209 }
5210 }
5211
5212 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Selector<'de>
5213 where
5214 ___D: ::fidl_next::Decoder<'de> + ?Sized,
5215 {
5216 fn decode(
5217 slot: ::fidl_next::Slot<'_, Self>,
5218 decoder: &mut ___D,
5219 _: (),
5220 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5221 ::fidl_next::munge!(let Self { table } = slot);
5222
5223 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5224 match ordinal {
5225 0 => unsafe { ::core::hint::unreachable_unchecked() },
5226
5227 1 => {
5228 ::fidl_next::wire::Envelope::decode_as::<
5229 ___D,
5230 crate::wire::ComponentSelector<'de>,
5231 >(slot.as_mut(), decoder, ())?;
5232
5233 Ok(())
5234 }
5235
5236 2 => {
5237 ::fidl_next::wire::Envelope::decode_as::<
5238 ___D,
5239 crate::wire::TreeSelector<'de>,
5240 >(slot.as_mut(), decoder, ())?;
5241
5242 Ok(())
5243 }
5244
5245 3 => {
5246 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::TreeNames<'de>>(
5247 slot.as_mut(),
5248 decoder,
5249 (),
5250 )?;
5251
5252 Ok(())
5253 }
5254
5255 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
5256 }
5257 })
5258 }
5259 }
5260
5261 impl<'de> Selector<'de> {
5262 pub fn component_selector(
5263 &self,
5264 ) -> ::core::option::Option<&crate::wire::ComponentSelector<'de>> {
5265 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5266 }
5267
5268 pub fn take_component_selector(
5269 &mut self,
5270 ) -> ::core::option::Option<crate::wire::ComponentSelector<'de>> {
5271 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
5272 }
5273
5274 pub fn tree_selector(&self) -> ::core::option::Option<&crate::wire::TreeSelector<'de>> {
5275 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5276 }
5277
5278 pub fn take_tree_selector(
5279 &mut self,
5280 ) -> ::core::option::Option<crate::wire::TreeSelector<'de>> {
5281 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
5282 }
5283
5284 pub fn tree_names(&self) -> ::core::option::Option<&crate::wire::TreeNames<'de>> {
5285 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5286 }
5287
5288 pub fn take_tree_names(&mut self) -> ::core::option::Option<crate::wire::TreeNames<'de>> {
5289 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
5290 }
5291 }
5292
5293 impl<'de> ::core::fmt::Debug for Selector<'de> {
5294 fn fmt(
5295 &self,
5296 f: &mut ::core::fmt::Formatter<'_>,
5297 ) -> ::core::result::Result<(), ::core::fmt::Error> {
5298 f.debug_struct("Selector")
5299 .field("component_selector", &self.component_selector())
5300 .field("tree_selector", &self.tree_selector())
5301 .field("tree_names", &self.tree_names())
5302 .finish()
5303 }
5304 }
5305
5306 impl<'de> ::fidl_next::IntoNatural for Selector<'de> {
5307 type Natural = crate::natural::Selector;
5308 }
5309
5310 #[repr(transparent)]
5312 pub struct SelectorArgument<'de> {
5313 pub(crate) raw: ::fidl_next::wire::Union,
5314 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5315 }
5316
5317 impl<'de> Drop for SelectorArgument<'de> {
5318 fn drop(&mut self) {
5319 match self.raw.ordinal() {
5320 1 => {
5321 let _ =
5322 unsafe { self.raw.get().read_unchecked::<crate::wire::Selector<'de>>() };
5323 }
5324
5325 2 => {
5326 let _ = unsafe {
5327 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
5328 };
5329 }
5330
5331 _ => (),
5332 }
5333 }
5334 }
5335
5336 impl ::fidl_next::Constrained for SelectorArgument<'_> {
5337 type Constraint = ();
5338
5339 fn validate(
5340 _: ::fidl_next::Slot<'_, Self>,
5341 _: Self::Constraint,
5342 ) -> Result<(), ::fidl_next::ValidationError> {
5343 Ok(())
5344 }
5345 }
5346
5347 unsafe impl ::fidl_next::Wire for SelectorArgument<'static> {
5348 type Narrowed<'de> = SelectorArgument<'de>;
5349
5350 #[inline]
5351 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5352 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5353 ::fidl_next::wire::Union::zero_padding(raw);
5354 }
5355 }
5356
5357 pub mod selector_argument {
5358 pub enum Ref<'de> {
5359 StructuredSelector(&'de crate::wire::Selector<'de>),
5360
5361 RawSelector(&'de ::fidl_next::wire::String<'de>),
5362
5363 UnknownOrdinal_(u64),
5364 }
5365
5366 pub enum Value<'de> {
5367 StructuredSelector(crate::wire::Selector<'de>),
5368
5369 RawSelector(::fidl_next::wire::String<'de>),
5370
5371 UnknownOrdinal_(u64),
5372 }
5373 }
5374
5375 impl<'de> SelectorArgument<'de> {
5376 pub fn as_ref(&self) -> crate::wire::selector_argument::Ref<'_> {
5377 match self.raw.ordinal() {
5378 1 => crate::wire::selector_argument::Ref::StructuredSelector(unsafe {
5379 self.raw.get().deref_unchecked::<crate::wire::Selector<'_>>()
5380 }),
5381
5382 2 => crate::wire::selector_argument::Ref::RawSelector(unsafe {
5383 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
5384 }),
5385
5386 unknown => crate::wire::selector_argument::Ref::UnknownOrdinal_(unknown),
5387 }
5388 }
5389
5390 pub fn into_inner(self) -> crate::wire::selector_argument::Value<'de> {
5391 let this = ::core::mem::ManuallyDrop::new(self);
5392
5393 match this.raw.ordinal() {
5394 1 => crate::wire::selector_argument::Value::StructuredSelector(unsafe {
5395 this.raw.get().read_unchecked::<crate::wire::Selector<'de>>()
5396 }),
5397
5398 2 => crate::wire::selector_argument::Value::RawSelector(unsafe {
5399 this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
5400 }),
5401
5402 unknown => crate::wire::selector_argument::Value::UnknownOrdinal_(unknown),
5403 }
5404 }
5405 }
5406
5407 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SelectorArgument<'de>
5408 where
5409 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5410 ___D: ::fidl_next::Decoder<'de>,
5411 {
5412 fn decode(
5413 mut slot: ::fidl_next::Slot<'_, Self>,
5414 decoder: &mut ___D,
5415 _: (),
5416 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5417 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5418 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
5419 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Selector<'de>>(
5420 raw,
5421 decoder,
5422 (),
5423 )?,
5424
5425 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
5426 raw, decoder, 1024,
5427 )?,
5428
5429 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
5430 }
5431
5432 Ok(())
5433 }
5434 }
5435
5436 impl<'de> ::core::fmt::Debug for SelectorArgument<'de> {
5437 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5438 match self.raw.ordinal() {
5439 1 => unsafe {
5440 self.raw.get().deref_unchecked::<crate::wire::Selector<'_>>().fmt(f)
5441 },
5442 2 => unsafe {
5443 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
5444 },
5445 _ => unsafe { ::core::hint::unreachable_unchecked() },
5446 }
5447 }
5448 }
5449
5450 impl<'de> ::fidl_next::IntoNatural for SelectorArgument<'de> {
5451 type Natural = crate::natural::SelectorArgument;
5452 }
5453
5454 #[repr(transparent)]
5456 pub struct ClientSelectorConfiguration<'de> {
5457 pub(crate) raw: ::fidl_next::wire::Union,
5458 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5459 }
5460
5461 impl<'de> Drop for ClientSelectorConfiguration<'de> {
5462 fn drop(&mut self) {
5463 match self.raw.ordinal() {
5464 1 => {
5465 let _ = unsafe {
5466 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>>()
5467 };
5468 }
5469
5470 2 => {
5471 let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
5472 }
5473
5474 _ => (),
5475 }
5476 }
5477 }
5478
5479 impl ::fidl_next::Constrained for ClientSelectorConfiguration<'_> {
5480 type Constraint = ();
5481
5482 fn validate(
5483 _: ::fidl_next::Slot<'_, Self>,
5484 _: Self::Constraint,
5485 ) -> Result<(), ::fidl_next::ValidationError> {
5486 Ok(())
5487 }
5488 }
5489
5490 unsafe impl ::fidl_next::Wire for ClientSelectorConfiguration<'static> {
5491 type Narrowed<'de> = ClientSelectorConfiguration<'de>;
5492
5493 #[inline]
5494 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5495 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5496 ::fidl_next::wire::Union::zero_padding(raw);
5497 }
5498 }
5499
5500 pub mod client_selector_configuration {
5501 pub enum Ref<'de> {
5502 Selectors(&'de ::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>),
5503
5504 SelectAll(&'de bool),
5505
5506 UnknownOrdinal_(u64),
5507 }
5508
5509 pub enum Value<'de> {
5510 Selectors(::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>),
5511
5512 SelectAll(bool),
5513
5514 UnknownOrdinal_(u64),
5515 }
5516 }
5517
5518 impl<'de> ClientSelectorConfiguration<'de> {
5519 pub fn as_ref(&self) -> crate::wire::client_selector_configuration::Ref<'_> {
5520 match self.raw.ordinal() {
5521 1 => crate::wire::client_selector_configuration::Ref::Selectors(unsafe {
5522 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, crate::wire::SelectorArgument<'_>>>()
5523 }),
5524
5525 2 => crate::wire::client_selector_configuration::Ref::SelectAll(unsafe {
5526 self.raw.get().deref_unchecked::<bool>()
5527 }),
5528
5529 unknown => {
5530 crate::wire::client_selector_configuration::Ref::UnknownOrdinal_(unknown)
5531 }
5532 }
5533 }
5534
5535 pub fn into_inner(self) -> crate::wire::client_selector_configuration::Value<'de> {
5536 let this = ::core::mem::ManuallyDrop::new(self);
5537
5538 match this.raw.ordinal() {
5539 1 => crate::wire::client_selector_configuration::Value::Selectors(unsafe {
5540 this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>>()
5541 }),
5542
5543 2 => crate::wire::client_selector_configuration::Value::SelectAll(unsafe {
5544 this.raw.get().read_unchecked::<bool>()
5545 }),
5546
5547 unknown => {
5548 crate::wire::client_selector_configuration::Value::UnknownOrdinal_(unknown)
5549 }
5550 }
5551 }
5552 }
5553
5554 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ClientSelectorConfiguration<'de>
5555 where
5556 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5557 ___D: ::fidl_next::Decoder<'de>,
5558 {
5559 fn decode(
5560 mut slot: ::fidl_next::Slot<'_, Self>,
5561 decoder: &mut ___D,
5562 _: (),
5563 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5564 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5565 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
5566 1 => ::fidl_next::wire::Union::decode_as::<
5567 ___D,
5568 ::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>,
5569 >(raw, decoder, (4294967295, ()))?,
5570
5571 2 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
5572
5573 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
5574 }
5575
5576 Ok(())
5577 }
5578 }
5579
5580 impl<'de> ::core::fmt::Debug for ClientSelectorConfiguration<'de> {
5581 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5582 match self.raw.ordinal() {
5583 1 => unsafe {
5584 self.raw.get().deref_unchecked::<
5585 ::fidl_next::wire::Vector<'_, crate::wire::SelectorArgument<'_>>
5586 >().fmt(f)
5587 },
5588 2 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
5589 _ => unsafe { ::core::hint::unreachable_unchecked() },
5590 }
5591 }
5592 }
5593
5594 impl<'de> ::fidl_next::IntoNatural for ClientSelectorConfiguration<'de> {
5595 type Natural = crate::natural::ClientSelectorConfiguration;
5596 }
5597
5598 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5600 #[repr(transparent)]
5601 pub struct Format {
5602 pub(crate) value: ::fidl_next::wire::Uint32,
5603 }
5604
5605 impl ::fidl_next::Constrained for Format {
5606 type Constraint = ();
5607
5608 fn validate(
5609 _: ::fidl_next::Slot<'_, Self>,
5610 _: Self::Constraint,
5611 ) -> Result<(), ::fidl_next::ValidationError> {
5612 Ok(())
5613 }
5614 }
5615
5616 unsafe impl ::fidl_next::Wire for Format {
5617 type Narrowed<'de> = Self;
5618
5619 #[inline]
5620 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5621 }
5623 }
5624
5625 impl Format {
5626 pub const JSON: Format = Format { value: ::fidl_next::wire::Uint32(1) };
5627
5628 pub const TEXT: Format = Format { value: ::fidl_next::wire::Uint32(2) };
5629
5630 pub const CBOR: Format = Format { value: ::fidl_next::wire::Uint32(3) };
5631
5632 pub const LEGACY_FXT: Format = Format { value: ::fidl_next::wire::Uint32(4) };
5633
5634 pub const FXT: Format = Format { value: ::fidl_next::wire::Uint32(5) };
5635 }
5636
5637 unsafe impl<___D> ::fidl_next::Decode<___D> for Format
5638 where
5639 ___D: ?Sized,
5640 {
5641 fn decode(
5642 slot: ::fidl_next::Slot<'_, Self>,
5643 _: &mut ___D,
5644 _: (),
5645 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5646 ::fidl_next::munge!(let Self { value } = slot);
5647
5648 match u32::from(*value) {
5649 1 | 2 | 3 | 4 | 5 => (),
5650 unknown => {
5651 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
5652 }
5653 }
5654
5655 Ok(())
5656 }
5657 }
5658
5659 impl ::core::convert::From<crate::natural::Format> for Format {
5660 fn from(natural: crate::natural::Format) -> Self {
5661 match natural {
5662 crate::natural::Format::Json => Format::JSON,
5663
5664 crate::natural::Format::Text => Format::TEXT,
5665
5666 crate::natural::Format::Cbor => Format::CBOR,
5667
5668 crate::natural::Format::LegacyFxt => Format::LEGACY_FXT,
5669
5670 crate::natural::Format::Fxt => Format::FXT,
5671 }
5672 }
5673 }
5674
5675 impl ::fidl_next::IntoNatural for Format {
5676 type Natural = crate::natural::Format;
5677 }
5678
5679 #[repr(C)]
5681 pub struct StreamParameters<'de> {
5682 pub(crate) table: ::fidl_next::wire::Table<'de>,
5683 }
5684
5685 impl<'de> Drop for StreamParameters<'de> {
5686 fn drop(&mut self) {
5687 let _ = self
5688 .table
5689 .get(1)
5690 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::DataType>() });
5691
5692 let _ = self
5693 .table
5694 .get(2)
5695 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StreamMode>() });
5696
5697 let _ = self
5698 .table
5699 .get(3)
5700 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Format>() });
5701
5702 let _ = self.table.get(4).map(|envelope| unsafe {
5703 envelope.read_unchecked::<crate::wire::ClientSelectorConfiguration<'de>>()
5704 });
5705
5706 let _ = self
5707 .table
5708 .get(5)
5709 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
5710
5711 let _ = self.table.get(6).map(|envelope| unsafe {
5712 envelope.read_unchecked::<crate::wire::PerformanceConfiguration<'de>>()
5713 });
5714 }
5715 }
5716
5717 impl ::fidl_next::Constrained for StreamParameters<'_> {
5718 type Constraint = ();
5719
5720 fn validate(
5721 _: ::fidl_next::Slot<'_, Self>,
5722 _: Self::Constraint,
5723 ) -> Result<(), ::fidl_next::ValidationError> {
5724 Ok(())
5725 }
5726 }
5727
5728 unsafe impl ::fidl_next::Wire for StreamParameters<'static> {
5729 type Narrowed<'de> = StreamParameters<'de>;
5730
5731 #[inline]
5732 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5733 ::fidl_next::munge!(let Self { table } = out);
5734 ::fidl_next::wire::Table::zero_padding(table);
5735 }
5736 }
5737
5738 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for StreamParameters<'de>
5739 where
5740 ___D: ::fidl_next::Decoder<'de> + ?Sized,
5741 {
5742 fn decode(
5743 slot: ::fidl_next::Slot<'_, Self>,
5744 decoder: &mut ___D,
5745 _: (),
5746 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5747 ::fidl_next::munge!(let Self { table } = slot);
5748
5749 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5750 match ordinal {
5751 0 => unsafe { ::core::hint::unreachable_unchecked() },
5752
5753 1 => {
5754 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DataType>(
5755 slot.as_mut(),
5756 decoder,
5757 (),
5758 )?;
5759
5760 Ok(())
5761 }
5762
5763 2 => {
5764 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StreamMode>(
5765 slot.as_mut(),
5766 decoder,
5767 (),
5768 )?;
5769
5770 Ok(())
5771 }
5772
5773 3 => {
5774 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Format>(
5775 slot.as_mut(),
5776 decoder,
5777 (),
5778 )?;
5779
5780 Ok(())
5781 }
5782
5783 4 => {
5784 ::fidl_next::wire::Envelope::decode_as::<
5785 ___D,
5786 crate::wire::ClientSelectorConfiguration<'de>,
5787 >(slot.as_mut(), decoder, ())?;
5788
5789 Ok(())
5790 }
5791
5792 5 => {
5793 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
5794 slot.as_mut(),
5795 decoder,
5796 (),
5797 )?;
5798
5799 Ok(())
5800 }
5801
5802 6 => {
5803 ::fidl_next::wire::Envelope::decode_as::<
5804 ___D,
5805 crate::wire::PerformanceConfiguration<'de>,
5806 >(slot.as_mut(), decoder, ())?;
5807
5808 Ok(())
5809 }
5810
5811 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
5812 }
5813 })
5814 }
5815 }
5816
5817 impl<'de> StreamParameters<'de> {
5818 pub fn data_type(&self) -> ::core::option::Option<&crate::wire::DataType> {
5819 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5820 }
5821
5822 pub fn take_data_type(&mut self) -> ::core::option::Option<crate::wire::DataType> {
5823 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
5824 }
5825
5826 pub fn stream_mode(&self) -> ::core::option::Option<&crate::wire::StreamMode> {
5827 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5828 }
5829
5830 pub fn take_stream_mode(&mut self) -> ::core::option::Option<crate::wire::StreamMode> {
5831 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
5832 }
5833
5834 pub fn format(&self) -> ::core::option::Option<&crate::wire::Format> {
5835 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5836 }
5837
5838 pub fn take_format(&mut self) -> ::core::option::Option<crate::wire::Format> {
5839 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
5840 }
5841
5842 pub fn client_selector_configuration(
5843 &self,
5844 ) -> ::core::option::Option<&crate::wire::ClientSelectorConfiguration<'de>> {
5845 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
5846 }
5847
5848 pub fn take_client_selector_configuration(
5849 &mut self,
5850 ) -> ::core::option::Option<crate::wire::ClientSelectorConfiguration<'de>> {
5851 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
5852 }
5853
5854 pub fn batch_retrieval_timeout_seconds(
5855 &self,
5856 ) -> ::core::option::Option<&::fidl_next::wire::Int64> {
5857 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
5858 }
5859
5860 pub fn take_batch_retrieval_timeout_seconds(
5861 &mut self,
5862 ) -> ::core::option::Option<::fidl_next::wire::Int64> {
5863 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
5864 }
5865
5866 pub fn performance_configuration(
5867 &self,
5868 ) -> ::core::option::Option<&crate::wire::PerformanceConfiguration<'de>> {
5869 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
5870 }
5871
5872 pub fn take_performance_configuration(
5873 &mut self,
5874 ) -> ::core::option::Option<crate::wire::PerformanceConfiguration<'de>> {
5875 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
5876 }
5877 }
5878
5879 impl<'de> ::core::fmt::Debug for StreamParameters<'de> {
5880 fn fmt(
5881 &self,
5882 f: &mut ::core::fmt::Formatter<'_>,
5883 ) -> ::core::result::Result<(), ::core::fmt::Error> {
5884 f.debug_struct("StreamParameters")
5885 .field("data_type", &self.data_type())
5886 .field("stream_mode", &self.stream_mode())
5887 .field("format", &self.format())
5888 .field("client_selector_configuration", &self.client_selector_configuration())
5889 .field("batch_retrieval_timeout_seconds", &self.batch_retrieval_timeout_seconds())
5890 .field("performance_configuration", &self.performance_configuration())
5891 .finish()
5892 }
5893 }
5894
5895 impl<'de> ::fidl_next::IntoNatural for StreamParameters<'de> {
5896 type Natural = crate::natural::StreamParameters;
5897 }
5898
5899 pub type ArchiveAccessorStreamDiagnosticsToSocketResponse = ::fidl_next::wire::Unit;
5901
5902 pub type ArchiveAccessorWaitForReadyResponse = ::fidl_next::wire::Unit;
5904
5905 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5907 #[repr(transparent)]
5908 pub struct ReaderError {
5909 pub(crate) value: ::fidl_next::wire::Uint32,
5910 }
5911
5912 impl ::fidl_next::Constrained for ReaderError {
5913 type Constraint = ();
5914
5915 fn validate(
5916 _: ::fidl_next::Slot<'_, Self>,
5917 _: Self::Constraint,
5918 ) -> Result<(), ::fidl_next::ValidationError> {
5919 Ok(())
5920 }
5921 }
5922
5923 unsafe impl ::fidl_next::Wire for ReaderError {
5924 type Narrowed<'de> = Self;
5925
5926 #[inline]
5927 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5928 }
5930 }
5931
5932 impl ReaderError {
5933 pub const IO: ReaderError = ReaderError { value: ::fidl_next::wire::Uint32(1) };
5934 }
5935
5936 unsafe impl<___D> ::fidl_next::Decode<___D> for ReaderError
5937 where
5938 ___D: ?Sized,
5939 {
5940 fn decode(
5941 slot: ::fidl_next::Slot<'_, Self>,
5942 _: &mut ___D,
5943 _: (),
5944 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5945 ::fidl_next::munge!(let Self { value } = slot);
5946
5947 match u32::from(*value) {
5948 1 => (),
5949 unknown => {
5950 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
5951 }
5952 }
5953
5954 Ok(())
5955 }
5956 }
5957
5958 impl ::core::convert::From<crate::natural::ReaderError> for ReaderError {
5959 fn from(natural: crate::natural::ReaderError) -> Self {
5960 match natural {
5961 crate::natural::ReaderError::Io => ReaderError::IO,
5962 }
5963 }
5964 }
5965
5966 impl ::fidl_next::IntoNatural for ReaderError {
5967 type Natural = crate::natural::ReaderError;
5968 }
5969
5970 pub type BatchIteratorWaitForReadyResponse = ::fidl_next::wire::Unit;
5972
5973 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5975 #[repr(transparent)]
5976 pub struct ConfigurationError {
5977 pub(crate) value: ::fidl_next::wire::Uint32,
5978 }
5979
5980 impl ::fidl_next::Constrained for ConfigurationError {
5981 type Constraint = ();
5982
5983 fn validate(
5984 _: ::fidl_next::Slot<'_, Self>,
5985 _: Self::Constraint,
5986 ) -> Result<(), ::fidl_next::ValidationError> {
5987 Ok(())
5988 }
5989 }
5990
5991 unsafe impl ::fidl_next::Wire for ConfigurationError {
5992 type Narrowed<'de> = Self;
5993
5994 #[inline]
5995 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5996 }
5998 }
5999
6000 impl ConfigurationError {
6001 pub const SAMPLE_PERIOD_TOO_SMALL: ConfigurationError =
6002 ConfigurationError { value: ::fidl_next::wire::Uint32(1) };
6003
6004 pub const SAMPLE_PARAMETERS_INVALID: ConfigurationError =
6005 ConfigurationError { value: ::fidl_next::wire::Uint32(2) };
6006
6007 pub const INVALID_SELECTORS: ConfigurationError =
6008 ConfigurationError { value: ::fidl_next::wire::Uint32(3) };
6009 }
6010
6011 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigurationError
6012 where
6013 ___D: ?Sized,
6014 {
6015 fn decode(
6016 slot: ::fidl_next::Slot<'_, Self>,
6017 _: &mut ___D,
6018 _: (),
6019 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6020 Ok(())
6021 }
6022 }
6023
6024 impl ::core::convert::From<crate::natural::ConfigurationError> for ConfigurationError {
6025 fn from(natural: crate::natural::ConfigurationError) -> Self {
6026 match natural {
6027 crate::natural::ConfigurationError::SamplePeriodTooSmall => {
6028 ConfigurationError::SAMPLE_PERIOD_TOO_SMALL
6029 }
6030
6031 crate::natural::ConfigurationError::SampleParametersInvalid => {
6032 ConfigurationError::SAMPLE_PARAMETERS_INVALID
6033 }
6034
6035 crate::natural::ConfigurationError::InvalidSelectors => {
6036 ConfigurationError::INVALID_SELECTORS
6037 }
6038
6039 crate::natural::ConfigurationError::UnknownOrdinal_(value) => {
6040 ConfigurationError { value: ::fidl_next::wire::Uint32::from(value) }
6041 }
6042 }
6043 }
6044 }
6045
6046 impl ::fidl_next::IntoNatural for ConfigurationError {
6047 type Natural = crate::natural::ConfigurationError;
6048 }
6049
6050 pub type LogFlusherWaitUntilFlushedResponse = ::fidl_next::wire::Unit;
6052
6053 #[derive(Debug)]
6055 #[repr(C)]
6056 pub struct LogInterestSelector<'de> {
6057 pub selector: crate::wire::ComponentSelector<'de>,
6058
6059 pub interest: ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'de>,
6060 }
6061
6062 static_assertions::const_assert_eq!(std::mem::size_of::<LogInterestSelector<'_>>(), 32);
6063 static_assertions::const_assert_eq!(std::mem::align_of::<LogInterestSelector<'_>>(), 8);
6064
6065 static_assertions::const_assert_eq!(std::mem::offset_of!(LogInterestSelector<'_>, selector), 0);
6066
6067 static_assertions::const_assert_eq!(
6068 std::mem::offset_of!(LogInterestSelector<'_>, interest),
6069 16
6070 );
6071
6072 impl ::fidl_next::Constrained for LogInterestSelector<'_> {
6073 type Constraint = ();
6074
6075 fn validate(
6076 _: ::fidl_next::Slot<'_, Self>,
6077 _: Self::Constraint,
6078 ) -> Result<(), ::fidl_next::ValidationError> {
6079 Ok(())
6080 }
6081 }
6082
6083 unsafe impl ::fidl_next::Wire for LogInterestSelector<'static> {
6084 type Narrowed<'de> = LogInterestSelector<'de>;
6085
6086 #[inline]
6087 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6088 ::fidl_next::munge! {
6089 let Self {
6090 selector,
6091 interest,
6092
6093 } = &mut *out_;
6094 }
6095
6096 ::fidl_next::Wire::zero_padding(selector);
6097
6098 ::fidl_next::Wire::zero_padding(interest);
6099 }
6100 }
6101
6102 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogInterestSelector<'de>
6103 where
6104 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6105 ___D: ::fidl_next::Decoder<'de>,
6106 {
6107 fn decode(
6108 slot_: ::fidl_next::Slot<'_, Self>,
6109 decoder_: &mut ___D,
6110 _: (),
6111 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6112 ::fidl_next::munge! {
6113 let Self {
6114 mut selector,
6115 mut interest,
6116
6117 } = slot_;
6118 }
6119
6120 let _field = selector.as_mut();
6121
6122 ::fidl_next::Decode::decode(selector.as_mut(), decoder_, ())?;
6123
6124 let _field = interest.as_mut();
6125
6126 ::fidl_next::Decode::decode(interest.as_mut(), decoder_, ())?;
6127
6128 Ok(())
6129 }
6130 }
6131
6132 impl<'de> ::fidl_next::IntoNatural for LogInterestSelector<'de> {
6133 type Natural = crate::natural::LogInterestSelector;
6134 }
6135
6136 #[repr(C)]
6138 pub struct LogSettingsSetComponentInterestRequest<'de> {
6139 pub(crate) table: ::fidl_next::wire::Table<'de>,
6140 }
6141
6142 impl<'de> Drop for LogSettingsSetComponentInterestRequest<'de> {
6143 fn drop(&mut self) {
6144 let _ = self.table.get(1)
6145 .map(|envelope| unsafe {
6146 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>>()
6147 });
6148
6149 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6150 }
6151 }
6152
6153 impl ::fidl_next::Constrained for LogSettingsSetComponentInterestRequest<'_> {
6154 type Constraint = ();
6155
6156 fn validate(
6157 _: ::fidl_next::Slot<'_, Self>,
6158 _: Self::Constraint,
6159 ) -> Result<(), ::fidl_next::ValidationError> {
6160 Ok(())
6161 }
6162 }
6163
6164 unsafe impl ::fidl_next::Wire for LogSettingsSetComponentInterestRequest<'static> {
6165 type Narrowed<'de> = LogSettingsSetComponentInterestRequest<'de>;
6166
6167 #[inline]
6168 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6169 ::fidl_next::munge!(let Self { table } = out);
6170 ::fidl_next::wire::Table::zero_padding(table);
6171 }
6172 }
6173
6174 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogSettingsSetComponentInterestRequest<'de>
6175 where
6176 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6177 {
6178 fn decode(
6179 slot: ::fidl_next::Slot<'_, Self>,
6180 decoder: &mut ___D,
6181 _: (),
6182 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6183 ::fidl_next::munge!(let Self { table } = slot);
6184
6185 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6186 match ordinal {
6187 0 => unsafe { ::core::hint::unreachable_unchecked() },
6188
6189 1 => {
6190 ::fidl_next::wire::Envelope::decode_as::<
6191 ___D,
6192 ::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>,
6193 >(slot.as_mut(), decoder, (64, ()))?;
6194
6195 let value = unsafe {
6196 slot
6197 .deref_unchecked()
6198 .deref_unchecked::<
6199 ::fidl_next::wire::Vector<'_, crate::wire::LogInterestSelector<'_>>
6200 >()
6201 };
6202
6203 if value.len() > 64 {
6204 return Err(::fidl_next::DecodeError::VectorTooLong {
6205 size: value.len() as u64,
6206 limit: 64,
6207 });
6208 }
6209
6210 Ok(())
6211 }
6212
6213 2 => {
6214 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6215 slot.as_mut(),
6216 decoder,
6217 (),
6218 )?;
6219
6220 Ok(())
6221 }
6222
6223 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6224 }
6225 })
6226 }
6227 }
6228
6229 impl<'de> LogSettingsSetComponentInterestRequest<'de> {
6230 pub fn selectors(
6231 &self,
6232 ) -> ::core::option::Option<
6233 &::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>,
6234 > {
6235 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6236 }
6237
6238 pub fn take_selectors(
6239 &mut self,
6240 ) -> ::core::option::Option<
6241 ::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>,
6242 > {
6243 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6244 }
6245
6246 pub fn persist(&self) -> ::core::option::Option<&bool> {
6247 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6248 }
6249
6250 pub fn take_persist(&mut self) -> ::core::option::Option<bool> {
6251 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
6252 }
6253 }
6254
6255 impl<'de> ::core::fmt::Debug for LogSettingsSetComponentInterestRequest<'de> {
6256 fn fmt(
6257 &self,
6258 f: &mut ::core::fmt::Formatter<'_>,
6259 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6260 f.debug_struct("LogSettingsSetComponentInterestRequest")
6261 .field("selectors", &self.selectors())
6262 .field("persist", &self.persist())
6263 .finish()
6264 }
6265 }
6266
6267 impl<'de> ::fidl_next::IntoNatural for LogSettingsSetComponentInterestRequest<'de> {
6268 type Natural = crate::natural::LogSettingsSetComponentInterestRequest;
6269 }
6270
6271 #[repr(C)]
6273 pub struct LogStreamOptions<'de> {
6274 pub(crate) table: ::fidl_next::wire::Table<'de>,
6275 }
6276
6277 impl<'de> Drop for LogStreamOptions<'de> {
6278 fn drop(&mut self) {
6279 let _ = self
6280 .table
6281 .get(1)
6282 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StreamMode>() });
6283
6284 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6285
6286 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6287
6288 let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6289
6290 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6291 }
6292 }
6293
6294 impl ::fidl_next::Constrained for LogStreamOptions<'_> {
6295 type Constraint = ();
6296
6297 fn validate(
6298 _: ::fidl_next::Slot<'_, Self>,
6299 _: Self::Constraint,
6300 ) -> Result<(), ::fidl_next::ValidationError> {
6301 Ok(())
6302 }
6303 }
6304
6305 unsafe impl ::fidl_next::Wire for LogStreamOptions<'static> {
6306 type Narrowed<'de> = LogStreamOptions<'de>;
6307
6308 #[inline]
6309 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6310 ::fidl_next::munge!(let Self { table } = out);
6311 ::fidl_next::wire::Table::zero_padding(table);
6312 }
6313 }
6314
6315 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogStreamOptions<'de>
6316 where
6317 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6318 {
6319 fn decode(
6320 slot: ::fidl_next::Slot<'_, Self>,
6321 decoder: &mut ___D,
6322 _: (),
6323 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6324 ::fidl_next::munge!(let Self { table } = slot);
6325
6326 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6327 match ordinal {
6328 0 => unsafe { ::core::hint::unreachable_unchecked() },
6329
6330 1 => {
6331 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StreamMode>(
6332 slot.as_mut(),
6333 decoder,
6334 (),
6335 )?;
6336
6337 Ok(())
6338 }
6339
6340 2 => {
6341 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6342 slot.as_mut(),
6343 decoder,
6344 (),
6345 )?;
6346
6347 Ok(())
6348 }
6349
6350 3 => {
6351 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6352 slot.as_mut(),
6353 decoder,
6354 (),
6355 )?;
6356
6357 Ok(())
6358 }
6359
6360 4 => {
6361 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6362 slot.as_mut(),
6363 decoder,
6364 (),
6365 )?;
6366
6367 Ok(())
6368 }
6369
6370 5 => {
6371 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6372 slot.as_mut(),
6373 decoder,
6374 (),
6375 )?;
6376
6377 Ok(())
6378 }
6379
6380 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6381 }
6382 })
6383 }
6384 }
6385
6386 impl<'de> LogStreamOptions<'de> {
6387 pub fn mode(&self) -> ::core::option::Option<&crate::wire::StreamMode> {
6388 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6389 }
6390
6391 pub fn take_mode(&mut self) -> ::core::option::Option<crate::wire::StreamMode> {
6392 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6393 }
6394
6395 pub fn include_moniker(&self) -> ::core::option::Option<&bool> {
6396 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6397 }
6398
6399 pub fn take_include_moniker(&mut self) -> ::core::option::Option<bool> {
6400 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
6401 }
6402
6403 pub fn include_component_url(&self) -> ::core::option::Option<&bool> {
6404 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6405 }
6406
6407 pub fn take_include_component_url(&mut self) -> ::core::option::Option<bool> {
6408 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
6409 }
6410
6411 pub fn include_rolled_out(&self) -> ::core::option::Option<&bool> {
6412 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
6413 }
6414
6415 pub fn take_include_rolled_out(&mut self) -> ::core::option::Option<bool> {
6416 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
6417 }
6418
6419 pub fn subscribe_to_manifest(&self) -> ::core::option::Option<&bool> {
6420 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
6421 }
6422
6423 pub fn take_subscribe_to_manifest(&mut self) -> ::core::option::Option<bool> {
6424 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
6425 }
6426 }
6427
6428 impl<'de> ::core::fmt::Debug for LogStreamOptions<'de> {
6429 fn fmt(
6430 &self,
6431 f: &mut ::core::fmt::Formatter<'_>,
6432 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6433 f.debug_struct("LogStreamOptions")
6434 .field("mode", &self.mode())
6435 .field("include_moniker", &self.include_moniker())
6436 .field("include_component_url", &self.include_component_url())
6437 .field("include_rolled_out", &self.include_rolled_out())
6438 .field("subscribe_to_manifest", &self.subscribe_to_manifest())
6439 .finish()
6440 }
6441 }
6442
6443 impl<'de> ::fidl_next::IntoNatural for LogStreamOptions<'de> {
6444 type Natural = crate::natural::LogStreamOptions;
6445 }
6446
6447 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6449 #[repr(transparent)]
6450 pub struct RuntimeError {
6451 pub(crate) value: ::fidl_next::wire::Uint32,
6452 }
6453
6454 impl ::fidl_next::Constrained for RuntimeError {
6455 type Constraint = ();
6456
6457 fn validate(
6458 _: ::fidl_next::Slot<'_, Self>,
6459 _: Self::Constraint,
6460 ) -> Result<(), ::fidl_next::ValidationError> {
6461 Ok(())
6462 }
6463 }
6464
6465 unsafe impl ::fidl_next::Wire for RuntimeError {
6466 type Narrowed<'de> = Self;
6467
6468 #[inline]
6469 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6470 }
6472 }
6473
6474 impl RuntimeError {
6475 pub const BATCH_ITERATOR_FAILED: RuntimeError =
6476 RuntimeError { value: ::fidl_next::wire::Uint32(1) };
6477 }
6478
6479 unsafe impl<___D> ::fidl_next::Decode<___D> for RuntimeError
6480 where
6481 ___D: ?Sized,
6482 {
6483 fn decode(
6484 slot: ::fidl_next::Slot<'_, Self>,
6485 _: &mut ___D,
6486 _: (),
6487 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6488 Ok(())
6489 }
6490 }
6491
6492 impl ::core::convert::From<crate::natural::RuntimeError> for RuntimeError {
6493 fn from(natural: crate::natural::RuntimeError) -> Self {
6494 match natural {
6495 crate::natural::RuntimeError::BatchIteratorFailed => {
6496 RuntimeError::BATCH_ITERATOR_FAILED
6497 }
6498
6499 crate::natural::RuntimeError::UnknownOrdinal_(value) => {
6500 RuntimeError { value: ::fidl_next::wire::Uint32::from(value) }
6501 }
6502 }
6503 }
6504 }
6505
6506 impl ::fidl_next::IntoNatural for RuntimeError {
6507 type Natural = crate::natural::RuntimeError;
6508 }
6509
6510 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6512 #[repr(transparent)]
6513 pub struct SampleStrategy {
6514 pub(crate) value: u8,
6515 }
6516
6517 impl ::fidl_next::Constrained for SampleStrategy {
6518 type Constraint = ();
6519
6520 fn validate(
6521 _: ::fidl_next::Slot<'_, Self>,
6522 _: Self::Constraint,
6523 ) -> Result<(), ::fidl_next::ValidationError> {
6524 Ok(())
6525 }
6526 }
6527
6528 unsafe impl ::fidl_next::Wire for SampleStrategy {
6529 type Narrowed<'de> = Self;
6530
6531 #[inline]
6532 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6533 }
6535 }
6536
6537 impl SampleStrategy {
6538 pub const ON_DIFF: SampleStrategy = SampleStrategy { value: 1 };
6539
6540 pub const ALWAYS: SampleStrategy = SampleStrategy { value: 2 };
6541 }
6542
6543 unsafe impl<___D> ::fidl_next::Decode<___D> for SampleStrategy
6544 where
6545 ___D: ?Sized,
6546 {
6547 fn decode(
6548 slot: ::fidl_next::Slot<'_, Self>,
6549 _: &mut ___D,
6550 _: (),
6551 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6552 Ok(())
6553 }
6554 }
6555
6556 impl ::core::convert::From<crate::natural::SampleStrategy> for SampleStrategy {
6557 fn from(natural: crate::natural::SampleStrategy) -> Self {
6558 match natural {
6559 crate::natural::SampleStrategy::OnDiff => SampleStrategy::ON_DIFF,
6560
6561 crate::natural::SampleStrategy::Always => SampleStrategy::ALWAYS,
6562
6563 crate::natural::SampleStrategy::UnknownOrdinal_(value) => {
6564 SampleStrategy { value: u8::from(value) }
6565 }
6566 }
6567 }
6568 }
6569
6570 impl ::fidl_next::IntoNatural for SampleStrategy {
6571 type Natural = crate::natural::SampleStrategy;
6572 }
6573
6574 #[repr(C)]
6576 pub struct SampleDatum<'de> {
6577 pub(crate) table: ::fidl_next::wire::Table<'de>,
6578 }
6579
6580 impl<'de> Drop for SampleDatum<'de> {
6581 fn drop(&mut self) {
6582 let _ = self.table.get(1).map(|envelope| unsafe {
6583 envelope.read_unchecked::<crate::wire::SelectorArgument<'de>>()
6584 });
6585
6586 let _ = self.table.get(2).map(|envelope| unsafe {
6587 envelope.read_unchecked::<crate::wire::SampleStrategy>()
6588 });
6589
6590 let _ = self
6591 .table
6592 .get(3)
6593 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
6594 }
6595 }
6596
6597 impl ::fidl_next::Constrained for SampleDatum<'_> {
6598 type Constraint = ();
6599
6600 fn validate(
6601 _: ::fidl_next::Slot<'_, Self>,
6602 _: Self::Constraint,
6603 ) -> Result<(), ::fidl_next::ValidationError> {
6604 Ok(())
6605 }
6606 }
6607
6608 unsafe impl ::fidl_next::Wire for SampleDatum<'static> {
6609 type Narrowed<'de> = SampleDatum<'de>;
6610
6611 #[inline]
6612 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6613 ::fidl_next::munge!(let Self { table } = out);
6614 ::fidl_next::wire::Table::zero_padding(table);
6615 }
6616 }
6617
6618 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleDatum<'de>
6619 where
6620 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6621 {
6622 fn decode(
6623 slot: ::fidl_next::Slot<'_, Self>,
6624 decoder: &mut ___D,
6625 _: (),
6626 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6627 ::fidl_next::munge!(let Self { table } = slot);
6628
6629 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6630 match ordinal {
6631 0 => unsafe { ::core::hint::unreachable_unchecked() },
6632
6633 1 => {
6634 ::fidl_next::wire::Envelope::decode_as::<
6635 ___D,
6636 crate::wire::SelectorArgument<'de>,
6637 >(slot.as_mut(), decoder, ())?;
6638
6639 Ok(())
6640 }
6641
6642 2 => {
6643 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::SampleStrategy>(
6644 slot.as_mut(),
6645 decoder,
6646 (),
6647 )?;
6648
6649 Ok(())
6650 }
6651
6652 3 => {
6653 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
6654 slot.as_mut(),
6655 decoder,
6656 (),
6657 )?;
6658
6659 Ok(())
6660 }
6661
6662 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6663 }
6664 })
6665 }
6666 }
6667
6668 impl<'de> SampleDatum<'de> {
6669 pub fn selector(&self) -> ::core::option::Option<&crate::wire::SelectorArgument<'de>> {
6670 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6671 }
6672
6673 pub fn take_selector(
6674 &mut self,
6675 ) -> ::core::option::Option<crate::wire::SelectorArgument<'de>> {
6676 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6677 }
6678
6679 pub fn strategy(&self) -> ::core::option::Option<&crate::wire::SampleStrategy> {
6680 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6681 }
6682
6683 pub fn take_strategy(&mut self) -> ::core::option::Option<crate::wire::SampleStrategy> {
6684 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
6685 }
6686
6687 pub fn interval_secs(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
6688 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6689 }
6690
6691 pub fn take_interval_secs(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
6692 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
6693 }
6694 }
6695
6696 impl<'de> ::core::fmt::Debug for SampleDatum<'de> {
6697 fn fmt(
6698 &self,
6699 f: &mut ::core::fmt::Formatter<'_>,
6700 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6701 f.debug_struct("SampleDatum")
6702 .field("selector", &self.selector())
6703 .field("strategy", &self.strategy())
6704 .field("interval_secs", &self.interval_secs())
6705 .finish()
6706 }
6707 }
6708
6709 impl<'de> ::fidl_next::IntoNatural for SampleDatum<'de> {
6710 type Natural = crate::natural::SampleDatum;
6711 }
6712
6713 #[repr(C)]
6715 pub struct SampleParameters<'de> {
6716 pub(crate) table: ::fidl_next::wire::Table<'de>,
6717 }
6718
6719 impl<'de> Drop for SampleParameters<'de> {
6720 fn drop(&mut self) {
6721 let _ = self.table.get(1)
6722 .map(|envelope| unsafe {
6723 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>()
6724 });
6725 }
6726 }
6727
6728 impl ::fidl_next::Constrained for SampleParameters<'_> {
6729 type Constraint = ();
6730
6731 fn validate(
6732 _: ::fidl_next::Slot<'_, Self>,
6733 _: Self::Constraint,
6734 ) -> Result<(), ::fidl_next::ValidationError> {
6735 Ok(())
6736 }
6737 }
6738
6739 unsafe impl ::fidl_next::Wire for SampleParameters<'static> {
6740 type Narrowed<'de> = SampleParameters<'de>;
6741
6742 #[inline]
6743 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6744 ::fidl_next::munge!(let Self { table } = out);
6745 ::fidl_next::wire::Table::zero_padding(table);
6746 }
6747 }
6748
6749 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleParameters<'de>
6750 where
6751 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6752 {
6753 fn decode(
6754 slot: ::fidl_next::Slot<'_, Self>,
6755 decoder: &mut ___D,
6756 _: (),
6757 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6758 ::fidl_next::munge!(let Self { table } = slot);
6759
6760 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6761 match ordinal {
6762 0 => unsafe { ::core::hint::unreachable_unchecked() },
6763
6764 1 => {
6765 ::fidl_next::wire::Envelope::decode_as::<
6766 ___D,
6767 ::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>,
6768 >(slot.as_mut(), decoder, (100, ()))?;
6769
6770 let value = unsafe {
6771 slot
6772 .deref_unchecked()
6773 .deref_unchecked::<
6774 ::fidl_next::wire::Vector<'_, crate::wire::SampleDatum<'_>>
6775 >()
6776 };
6777
6778 if value.len() > 100 {
6779 return Err(::fidl_next::DecodeError::VectorTooLong {
6780 size: value.len() as u64,
6781 limit: 100,
6782 });
6783 }
6784
6785 Ok(())
6786 }
6787
6788 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6789 }
6790 })
6791 }
6792 }
6793
6794 impl<'de> SampleParameters<'de> {
6795 pub fn data(
6796 &self,
6797 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>
6798 {
6799 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6800 }
6801
6802 pub fn take_data(
6803 &mut self,
6804 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>
6805 {
6806 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6807 }
6808 }
6809
6810 impl<'de> ::core::fmt::Debug for SampleParameters<'de> {
6811 fn fmt(
6812 &self,
6813 f: &mut ::core::fmt::Formatter<'_>,
6814 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6815 f.debug_struct("SampleParameters").field("data", &self.data()).finish()
6816 }
6817 }
6818
6819 impl<'de> ::fidl_next::IntoNatural for SampleParameters<'de> {
6820 type Natural = crate::natural::SampleParameters;
6821 }
6822
6823 pub type SampleCommitResponse = ::fidl_next::wire::Unit;
6825}
6826
6827pub mod wire_optional {
6828
6829 #[repr(transparent)]
6830 pub struct StringSelector<'de> {
6831 pub(crate) raw: ::fidl_next::wire::Union,
6832 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6833 }
6834
6835 impl ::fidl_next::Constrained for StringSelector<'_> {
6836 type Constraint = ();
6837
6838 fn validate(
6839 _: ::fidl_next::Slot<'_, Self>,
6840 _: Self::Constraint,
6841 ) -> Result<(), ::fidl_next::ValidationError> {
6842 Ok(())
6843 }
6844 }
6845
6846 unsafe impl ::fidl_next::Wire for StringSelector<'static> {
6847 type Narrowed<'de> = StringSelector<'de>;
6848
6849 #[inline]
6850 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6851 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6852 ::fidl_next::wire::Union::zero_padding(raw);
6853 }
6854 }
6855
6856 impl<'de> StringSelector<'de> {
6857 pub fn is_some(&self) -> bool {
6858 self.raw.is_some()
6859 }
6860
6861 pub fn is_none(&self) -> bool {
6862 self.raw.is_none()
6863 }
6864
6865 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::StringSelector<'de>> {
6866 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6867 }
6868
6869 pub fn into_option(self) -> ::core::option::Option<crate::wire::StringSelector<'de>> {
6870 if self.is_some() {
6871 Some(crate::wire::StringSelector {
6872 raw: self.raw,
6873 _phantom: ::core::marker::PhantomData,
6874 })
6875 } else {
6876 None
6877 }
6878 }
6879 }
6880
6881 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for StringSelector<'de>
6882 where
6883 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6884 ___D: ::fidl_next::Decoder<'de>,
6885 {
6886 fn decode(
6887 mut slot: ::fidl_next::Slot<'_, Self>,
6888 decoder: &mut ___D,
6889 _: (),
6890 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6891 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6892 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
6893 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
6894 raw, decoder, 1024,
6895 )?,
6896
6897 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
6898 raw, decoder, 1024,
6899 )?,
6900
6901 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
6902 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
6903 }
6904
6905 Ok(())
6906 }
6907 }
6908
6909 impl<'de> ::core::fmt::Debug for StringSelector<'de> {
6910 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6911 self.as_ref().fmt(f)
6912 }
6913 }
6914
6915 impl<'de> ::fidl_next::IntoNatural for StringSelector<'de> {
6916 type Natural = ::core::option::Option<crate::natural::StringSelector>;
6917 }
6918
6919 #[repr(transparent)]
6920 pub struct TreeSelector<'de> {
6921 pub(crate) raw: ::fidl_next::wire::Union,
6922 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6923 }
6924
6925 impl ::fidl_next::Constrained for TreeSelector<'_> {
6926 type Constraint = ();
6927
6928 fn validate(
6929 _: ::fidl_next::Slot<'_, Self>,
6930 _: Self::Constraint,
6931 ) -> Result<(), ::fidl_next::ValidationError> {
6932 Ok(())
6933 }
6934 }
6935
6936 unsafe impl ::fidl_next::Wire for TreeSelector<'static> {
6937 type Narrowed<'de> = TreeSelector<'de>;
6938
6939 #[inline]
6940 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6941 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6942 ::fidl_next::wire::Union::zero_padding(raw);
6943 }
6944 }
6945
6946 impl<'de> TreeSelector<'de> {
6947 pub fn is_some(&self) -> bool {
6948 self.raw.is_some()
6949 }
6950
6951 pub fn is_none(&self) -> bool {
6952 self.raw.is_none()
6953 }
6954
6955 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::TreeSelector<'de>> {
6956 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6957 }
6958
6959 pub fn into_option(self) -> ::core::option::Option<crate::wire::TreeSelector<'de>> {
6960 if self.is_some() {
6961 Some(crate::wire::TreeSelector {
6962 raw: self.raw,
6963 _phantom: ::core::marker::PhantomData,
6964 })
6965 } else {
6966 None
6967 }
6968 }
6969 }
6970
6971 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TreeSelector<'de>
6972 where
6973 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6974 ___D: ::fidl_next::Decoder<'de>,
6975 {
6976 fn decode(
6977 mut slot: ::fidl_next::Slot<'_, Self>,
6978 decoder: &mut ___D,
6979 _: (),
6980 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6981 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6982 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
6983 1 => {
6984 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SubtreeSelector<'de>>(
6985 raw,
6986 decoder,
6987 (),
6988 )?
6989 }
6990
6991 2 => {
6992 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::PropertySelector<'de>>(
6993 raw,
6994 decoder,
6995 (),
6996 )?
6997 }
6998
6999 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7000 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7001 }
7002
7003 Ok(())
7004 }
7005 }
7006
7007 impl<'de> ::core::fmt::Debug for TreeSelector<'de> {
7008 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7009 self.as_ref().fmt(f)
7010 }
7011 }
7012
7013 impl<'de> ::fidl_next::IntoNatural for TreeSelector<'de> {
7014 type Natural = ::core::option::Option<crate::natural::TreeSelector>;
7015 }
7016
7017 #[repr(transparent)]
7018 pub struct TreeNames<'de> {
7019 pub(crate) raw: ::fidl_next::wire::Union,
7020 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7021 }
7022
7023 impl ::fidl_next::Constrained for TreeNames<'_> {
7024 type Constraint = ();
7025
7026 fn validate(
7027 _: ::fidl_next::Slot<'_, Self>,
7028 _: Self::Constraint,
7029 ) -> Result<(), ::fidl_next::ValidationError> {
7030 Ok(())
7031 }
7032 }
7033
7034 unsafe impl ::fidl_next::Wire for TreeNames<'static> {
7035 type Narrowed<'de> = TreeNames<'de>;
7036
7037 #[inline]
7038 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7039 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7040 ::fidl_next::wire::Union::zero_padding(raw);
7041 }
7042 }
7043
7044 impl<'de> TreeNames<'de> {
7045 pub fn is_some(&self) -> bool {
7046 self.raw.is_some()
7047 }
7048
7049 pub fn is_none(&self) -> bool {
7050 self.raw.is_none()
7051 }
7052
7053 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::TreeNames<'de>> {
7054 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7055 }
7056
7057 pub fn into_option(self) -> ::core::option::Option<crate::wire::TreeNames<'de>> {
7058 if self.is_some() {
7059 Some(crate::wire::TreeNames {
7060 raw: self.raw,
7061 _phantom: ::core::marker::PhantomData,
7062 })
7063 } else {
7064 None
7065 }
7066 }
7067 }
7068
7069 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TreeNames<'de>
7070 where
7071 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7072 ___D: ::fidl_next::Decoder<'de>,
7073 {
7074 fn decode(
7075 mut slot: ::fidl_next::Slot<'_, Self>,
7076 decoder: &mut ___D,
7077 _: (),
7078 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7079 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7080 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
7081 1 => ::fidl_next::wire::Union::decode_as::<
7082 ___D,
7083 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
7084 >(raw, decoder, (4294967295, 1024))?,
7085
7086 2 => {
7087 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::All>(raw, decoder, ())?
7088 }
7089
7090 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7091 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7092 }
7093
7094 Ok(())
7095 }
7096 }
7097
7098 impl<'de> ::core::fmt::Debug for TreeNames<'de> {
7099 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7100 self.as_ref().fmt(f)
7101 }
7102 }
7103
7104 impl<'de> ::fidl_next::IntoNatural for TreeNames<'de> {
7105 type Natural = ::core::option::Option<crate::natural::TreeNames>;
7106 }
7107
7108 #[repr(transparent)]
7109 pub struct SelectorArgument<'de> {
7110 pub(crate) raw: ::fidl_next::wire::Union,
7111 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7112 }
7113
7114 impl ::fidl_next::Constrained for SelectorArgument<'_> {
7115 type Constraint = ();
7116
7117 fn validate(
7118 _: ::fidl_next::Slot<'_, Self>,
7119 _: Self::Constraint,
7120 ) -> Result<(), ::fidl_next::ValidationError> {
7121 Ok(())
7122 }
7123 }
7124
7125 unsafe impl ::fidl_next::Wire for SelectorArgument<'static> {
7126 type Narrowed<'de> = SelectorArgument<'de>;
7127
7128 #[inline]
7129 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7130 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7131 ::fidl_next::wire::Union::zero_padding(raw);
7132 }
7133 }
7134
7135 impl<'de> SelectorArgument<'de> {
7136 pub fn is_some(&self) -> bool {
7137 self.raw.is_some()
7138 }
7139
7140 pub fn is_none(&self) -> bool {
7141 self.raw.is_none()
7142 }
7143
7144 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::SelectorArgument<'de>> {
7145 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7146 }
7147
7148 pub fn into_option(self) -> ::core::option::Option<crate::wire::SelectorArgument<'de>> {
7149 if self.is_some() {
7150 Some(crate::wire::SelectorArgument {
7151 raw: self.raw,
7152 _phantom: ::core::marker::PhantomData,
7153 })
7154 } else {
7155 None
7156 }
7157 }
7158 }
7159
7160 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SelectorArgument<'de>
7161 where
7162 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7163 ___D: ::fidl_next::Decoder<'de>,
7164 {
7165 fn decode(
7166 mut slot: ::fidl_next::Slot<'_, Self>,
7167 decoder: &mut ___D,
7168 _: (),
7169 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7170 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7171 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
7172 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Selector<'de>>(
7173 raw,
7174 decoder,
7175 (),
7176 )?,
7177
7178 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
7179 raw, decoder, 1024,
7180 )?,
7181
7182 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7183 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7184 }
7185
7186 Ok(())
7187 }
7188 }
7189
7190 impl<'de> ::core::fmt::Debug for SelectorArgument<'de> {
7191 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7192 self.as_ref().fmt(f)
7193 }
7194 }
7195
7196 impl<'de> ::fidl_next::IntoNatural for SelectorArgument<'de> {
7197 type Natural = ::core::option::Option<crate::natural::SelectorArgument>;
7198 }
7199
7200 #[repr(transparent)]
7201 pub struct ClientSelectorConfiguration<'de> {
7202 pub(crate) raw: ::fidl_next::wire::Union,
7203 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7204 }
7205
7206 impl ::fidl_next::Constrained for ClientSelectorConfiguration<'_> {
7207 type Constraint = ();
7208
7209 fn validate(
7210 _: ::fidl_next::Slot<'_, Self>,
7211 _: Self::Constraint,
7212 ) -> Result<(), ::fidl_next::ValidationError> {
7213 Ok(())
7214 }
7215 }
7216
7217 unsafe impl ::fidl_next::Wire for ClientSelectorConfiguration<'static> {
7218 type Narrowed<'de> = ClientSelectorConfiguration<'de>;
7219
7220 #[inline]
7221 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7222 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7223 ::fidl_next::wire::Union::zero_padding(raw);
7224 }
7225 }
7226
7227 impl<'de> ClientSelectorConfiguration<'de> {
7228 pub fn is_some(&self) -> bool {
7229 self.raw.is_some()
7230 }
7231
7232 pub fn is_none(&self) -> bool {
7233 self.raw.is_none()
7234 }
7235
7236 pub fn as_ref(
7237 &self,
7238 ) -> ::core::option::Option<&crate::wire::ClientSelectorConfiguration<'de>> {
7239 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7240 }
7241
7242 pub fn into_option(
7243 self,
7244 ) -> ::core::option::Option<crate::wire::ClientSelectorConfiguration<'de>> {
7245 if self.is_some() {
7246 Some(crate::wire::ClientSelectorConfiguration {
7247 raw: self.raw,
7248 _phantom: ::core::marker::PhantomData,
7249 })
7250 } else {
7251 None
7252 }
7253 }
7254 }
7255
7256 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ClientSelectorConfiguration<'de>
7257 where
7258 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7259 ___D: ::fidl_next::Decoder<'de>,
7260 {
7261 fn decode(
7262 mut slot: ::fidl_next::Slot<'_, Self>,
7263 decoder: &mut ___D,
7264 _: (),
7265 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7266 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7267 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
7268 1 => ::fidl_next::wire::Union::decode_as::<
7269 ___D,
7270 ::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>,
7271 >(raw, decoder, (4294967295, ()))?,
7272
7273 2 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
7274
7275 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7276 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7277 }
7278
7279 Ok(())
7280 }
7281 }
7282
7283 impl<'de> ::core::fmt::Debug for ClientSelectorConfiguration<'de> {
7284 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7285 self.as_ref().fmt(f)
7286 }
7287 }
7288
7289 impl<'de> ::fidl_next::IntoNatural for ClientSelectorConfiguration<'de> {
7290 type Natural = ::core::option::Option<crate::natural::ClientSelectorConfiguration>;
7291 }
7292}
7293
7294pub mod generic {
7295
7296 pub type All = ();
7298
7299 pub struct SubtreeSelector<T0> {
7301 pub node_path: T0,
7302 }
7303
7304 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SubtreeSelector<'static>, ___E>
7305 for SubtreeSelector<T0>
7306 where
7307 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7308 ___E: ::fidl_next::Encoder,
7309 T0: ::fidl_next::Encode<
7310 ::fidl_next::wire::Vector<'static, crate::wire::StringSelector<'static>>,
7311 ___E,
7312 >,
7313 {
7314 #[inline]
7315 fn encode(
7316 self,
7317 encoder_: &mut ___E,
7318 out_: &mut ::core::mem::MaybeUninit<crate::wire::SubtreeSelector<'static>>,
7319 _: (),
7320 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7321 ::fidl_next::munge! {
7322 let crate::wire::SubtreeSelector {
7323 node_path,
7324
7325 } = out_;
7326 }
7327
7328 ::fidl_next::Encode::encode(self.node_path, encoder_, node_path, (100, ()))?;
7329
7330 Ok(())
7331 }
7332 }
7333
7334 pub struct PropertySelector<T0, T1> {
7336 pub node_path: T0,
7337
7338 pub target_properties: T1,
7339 }
7340
7341 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::PropertySelector<'static>, ___E>
7342 for PropertySelector<T0, T1>
7343 where
7344 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7345 ___E: ::fidl_next::Encoder,
7346 T0: ::fidl_next::Encode<
7347 ::fidl_next::wire::Vector<'static, crate::wire::StringSelector<'static>>,
7348 ___E,
7349 >,
7350 T1: ::fidl_next::Encode<crate::wire::StringSelector<'static>, ___E>,
7351 {
7352 #[inline]
7353 fn encode(
7354 self,
7355 encoder_: &mut ___E,
7356 out_: &mut ::core::mem::MaybeUninit<crate::wire::PropertySelector<'static>>,
7357 _: (),
7358 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7359 ::fidl_next::munge! {
7360 let crate::wire::PropertySelector {
7361 node_path,
7362 target_properties,
7363
7364 } = out_;
7365 }
7366
7367 ::fidl_next::Encode::encode(self.node_path, encoder_, node_path, (100, ()))?;
7368
7369 ::fidl_next::Encode::encode(self.target_properties, encoder_, target_properties, ())?;
7370
7371 Ok(())
7372 }
7373 }
7374
7375 pub type ArchiveAccessorStreamDiagnosticsToSocketResponse = ();
7377
7378 pub type ArchiveAccessorWaitForReadyResponse = ();
7380
7381 pub type BatchIteratorWaitForReadyResponse = ();
7383
7384 pub type LogFlusherWaitUntilFlushedResponse = ();
7386
7387 pub struct LogInterestSelector<T0, T1> {
7389 pub selector: T0,
7390
7391 pub interest: T1,
7392 }
7393
7394 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>
7395 for LogInterestSelector<T0, T1>
7396 where
7397 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7398 ___E: ::fidl_next::Encoder,
7399 T0: ::fidl_next::Encode<crate::wire::ComponentSelector<'static>, ___E>,
7400 T1: ::fidl_next::Encode<
7401 ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'static>,
7402 ___E,
7403 >,
7404 {
7405 #[inline]
7406 fn encode(
7407 self,
7408 encoder_: &mut ___E,
7409 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogInterestSelector<'static>>,
7410 _: (),
7411 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7412 ::fidl_next::munge! {
7413 let crate::wire::LogInterestSelector {
7414 selector,
7415 interest,
7416
7417 } = out_;
7418 }
7419
7420 ::fidl_next::Encode::encode(self.selector, encoder_, selector, ())?;
7421
7422 ::fidl_next::Encode::encode(self.interest, encoder_, interest, ())?;
7423
7424 Ok(())
7425 }
7426 }
7427
7428 pub type SampleCommitResponse = ();
7430}
7431
7432pub use self::natural::*;
7433
7434pub const MAX_MONIKER_SEGMENTS: u16 = 25 as u16;
7435
7436pub const MAX_DATA_HIERARCHY_DEPTH: u16 = 100 as u16;
7437
7438#[doc = " The size bound of 1024 is a reasonably low size restriction that meets most\n canonical selectors we\'ve ecountered.\n"]
7439pub const MAXIMUM_RAW_SELECTOR_LENGTH: u16 = 1024 as u16;
7440
7441pub const MAX_STRING_SELECTOR_LENGTH: u16 = 1024 as u16;
7442
7443#[doc = " The size 64 was chosen because entries in batches are handles to\n VMOs and there is a limit of 64 handles per fidl message.\n"]
7444pub const MAXIMUM_ENTRIES_PER_BATCH: u16 = 64 as u16;
7445
7446pub const COMPONENT_URL_ARG_NAME: &str = "$__url";
7447
7448#[derive(PartialEq, Debug)]
7450pub struct LogFlusher;
7451
7452impl ::fidl_next::Discoverable for LogFlusher {
7453 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.LogFlusher";
7454}
7455
7456#[cfg(target_os = "fuchsia")]
7457impl ::fidl_next::HasTransport for LogFlusher {
7458 type Transport = ::fidl_next::fuchsia::zx::Channel;
7459}
7460
7461pub mod log_flusher {
7462 pub mod prelude {
7463 pub use crate::{
7464 LogFlusher, LogFlusherClientHandler, LogFlusherLocalClientHandler,
7465 LogFlusherLocalServerHandler, LogFlusherServerHandler, log_flusher,
7466 };
7467
7468 pub use crate::natural::LogFlusherWaitUntilFlushedResponse;
7469 }
7470
7471 pub struct WaitUntilFlushed;
7472
7473 impl ::fidl_next::Method for WaitUntilFlushed {
7474 const ORDINAL: u64 = 9062519182019824475;
7475 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7476 ::fidl_next::protocol::Flexibility::Flexible;
7477
7478 type Protocol = crate::LogFlusher;
7479
7480 type Request = ::fidl_next::wire::EmptyMessageBody;
7481 }
7482
7483 impl ::fidl_next::TwoWayMethod for WaitUntilFlushed {
7484 type Response =
7485 ::fidl_next::wire::Flexible<'static, crate::wire::LogFlusherWaitUntilFlushedResponse>;
7486 }
7487
7488 impl<___R> ::fidl_next::Respond<___R> for WaitUntilFlushed {
7489 type Output = ::fidl_next::Flexible<___R>;
7490
7491 fn respond(response: ___R) -> Self::Output {
7492 ::fidl_next::Flexible(response)
7493 }
7494 }
7495
7496 mod ___detail {
7497 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogFlusher
7498 where
7499 ___T: ::fidl_next::Transport,
7500 {
7501 type Client = LogFlusherClient<___T>;
7502 type Server = LogFlusherServer<___T>;
7503 }
7504
7505 #[repr(transparent)]
7507 pub struct LogFlusherClient<___T: ::fidl_next::Transport> {
7508 #[allow(dead_code)]
7509 client: ::fidl_next::protocol::Client<___T>,
7510 }
7511
7512 impl<___T> LogFlusherClient<___T>
7513 where
7514 ___T: ::fidl_next::Transport,
7515 {
7516 #[doc = " Flushes all pending logs through the logging pipeline\n to the serial port. Logs written to sockets prior to\n the call to Flush are guaranteed to be fully written\n to serial when this returns. Logs written to sockets\n after this call has been received by Archivist are\n not guaranteed to be flushed.\n Additionally, sockets must actually be connected to the Archivist\n before this call is made. If a socket hasn\'t been\n received by Archivist yet, those logs may be dropped.\n To ensure that logs are properly flushed, make sure\n to wait for the initial interest when logging.\n Important note: This may be called from the host,\n but host sockets will NOT be flushed by this method.\n If you write data from the host (not on the device,\n there is no guarantee that such logs will ever be printed).\n"]
7517 pub fn wait_until_flushed(
7518 &self,
7519 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitUntilFlushed, ___T> {
7520 ::fidl_next::TwoWayFuture::from_untyped(
7521 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7522 9062519182019824475,
7523 <super::WaitUntilFlushed as ::fidl_next::Method>::FLEXIBILITY,
7524 (),
7525 ),
7526 )
7527 }
7528 }
7529
7530 #[repr(transparent)]
7532 pub struct LogFlusherServer<___T: ::fidl_next::Transport> {
7533 server: ::fidl_next::protocol::Server<___T>,
7534 }
7535
7536 impl<___T> LogFlusherServer<___T> where ___T: ::fidl_next::Transport {}
7537 }
7538}
7539
7540#[diagnostic::on_unimplemented(
7541 note = "If {Self} implements the non-local LogFlusherClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7542)]
7543
7544pub trait LogFlusherLocalClientHandler<
7548 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7549 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7550>
7551{
7552 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
7553 ::core::future::ready(())
7554 }
7555}
7556
7557impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogFlusher
7558where
7559 ___H: LogFlusherLocalClientHandler<___T>,
7560 ___T: ::fidl_next::Transport,
7561{
7562 async fn on_event(
7563 handler: &mut ___H,
7564 mut message: ::fidl_next::Message<___T>,
7565 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7566 match *message.header().ordinal {
7567 ordinal => {
7568 handler.on_unknown_interaction(ordinal).await;
7569 if ::core::matches!(
7570 message.header().flexibility(),
7571 ::fidl_next::protocol::Flexibility::Strict
7572 ) {
7573 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7574 } else {
7575 Ok(())
7576 }
7577 }
7578 }
7579 }
7580}
7581
7582#[diagnostic::on_unimplemented(
7583 note = "If {Self} implements the non-local LogFlusherServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7584)]
7585
7586pub trait LogFlusherLocalServerHandler<
7590 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7591 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7592>
7593{
7594 #[doc = " Flushes all pending logs through the logging pipeline\n to the serial port. Logs written to sockets prior to\n the call to Flush are guaranteed to be fully written\n to serial when this returns. Logs written to sockets\n after this call has been received by Archivist are\n not guaranteed to be flushed.\n Additionally, sockets must actually be connected to the Archivist\n before this call is made. If a socket hasn\'t been\n received by Archivist yet, those logs may be dropped.\n To ensure that logs are properly flushed, make sure\n to wait for the initial interest when logging.\n Important note: This may be called from the host,\n but host sockets will NOT be flushed by this method.\n If you write data from the host (not on the device,\n there is no guarantee that such logs will ever be printed).\n"]
7595 fn wait_until_flushed(
7596 &mut self,
7597
7598 responder: ::fidl_next::Responder<log_flusher::WaitUntilFlushed, ___T>,
7599 ) -> impl ::core::future::Future<Output = ()>;
7600
7601 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
7602 ::core::future::ready(())
7603 }
7604}
7605
7606impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogFlusher
7607where
7608 ___H: LogFlusherLocalServerHandler<___T>,
7609 ___T: ::fidl_next::Transport,
7610{
7611 async fn on_one_way(
7612 handler: &mut ___H,
7613 mut message: ::fidl_next::Message<___T>,
7614 ) -> ::core::result::Result<
7615 (),
7616 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7617 > {
7618 match *message.header().ordinal {
7619 ordinal => {
7620 handler.on_unknown_interaction(ordinal).await;
7621 if ::core::matches!(
7622 message.header().flexibility(),
7623 ::fidl_next::protocol::Flexibility::Strict
7624 ) {
7625 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7626 } else {
7627 Ok(())
7628 }
7629 }
7630 }
7631 }
7632
7633 async fn on_two_way(
7634 handler: &mut ___H,
7635 mut message: ::fidl_next::Message<___T>,
7636 responder: ::fidl_next::protocol::Responder<___T>,
7637 ) -> ::core::result::Result<
7638 (),
7639 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7640 > {
7641 match *message.header().ordinal {
7642 9062519182019824475 => {
7643 let responder = ::fidl_next::Responder::from_untyped(responder);
7644
7645 handler.wait_until_flushed(responder).await;
7646 Ok(())
7647 }
7648
7649 ordinal => {
7650 handler.on_unknown_interaction(ordinal).await;
7651 if ::core::matches!(
7652 message.header().flexibility(),
7653 ::fidl_next::protocol::Flexibility::Strict
7654 ) {
7655 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7656 } else {
7657 responder
7658 .respond_framework_error(
7659 ordinal,
7660 ::fidl_next::FrameworkError::UnknownMethod,
7661 )
7662 .expect("encoding a framework error should never fail")
7663 .await?;
7664 Ok(())
7665 }
7666 }
7667 }
7668 }
7669}
7670
7671pub trait LogFlusherClientHandler<
7675 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7676 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7677>
7678{
7679 fn on_unknown_interaction(
7680 &mut self,
7681 ordinal: u64,
7682 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
7683 ::core::future::ready(())
7684 }
7685}
7686
7687impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogFlusher
7688where
7689 ___H: LogFlusherClientHandler<___T> + ::core::marker::Send,
7690 ___T: ::fidl_next::Transport,
7691{
7692 async fn on_event(
7693 handler: &mut ___H,
7694 mut message: ::fidl_next::Message<___T>,
7695 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7696 match *message.header().ordinal {
7697 ordinal => {
7698 handler.on_unknown_interaction(ordinal).await;
7699 if ::core::matches!(
7700 message.header().flexibility(),
7701 ::fidl_next::protocol::Flexibility::Strict
7702 ) {
7703 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7704 } else {
7705 Ok(())
7706 }
7707 }
7708 }
7709 }
7710}
7711
7712pub trait LogFlusherServerHandler<
7716 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7717 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7718>
7719{
7720 #[doc = " Flushes all pending logs through the logging pipeline\n to the serial port. Logs written to sockets prior to\n the call to Flush are guaranteed to be fully written\n to serial when this returns. Logs written to sockets\n after this call has been received by Archivist are\n not guaranteed to be flushed.\n Additionally, sockets must actually be connected to the Archivist\n before this call is made. If a socket hasn\'t been\n received by Archivist yet, those logs may be dropped.\n To ensure that logs are properly flushed, make sure\n to wait for the initial interest when logging.\n Important note: This may be called from the host,\n but host sockets will NOT be flushed by this method.\n If you write data from the host (not on the device,\n there is no guarantee that such logs will ever be printed).\n"]
7721 fn wait_until_flushed(
7722 &mut self,
7723
7724 responder: ::fidl_next::Responder<log_flusher::WaitUntilFlushed, ___T>,
7725 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7726
7727 fn on_unknown_interaction(
7728 &mut self,
7729 ordinal: u64,
7730 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
7731 ::core::future::ready(())
7732 }
7733}
7734
7735impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogFlusher
7736where
7737 ___H: LogFlusherServerHandler<___T> + ::core::marker::Send,
7738 ___T: ::fidl_next::Transport,
7739{
7740 async fn on_one_way(
7741 handler: &mut ___H,
7742 mut message: ::fidl_next::Message<___T>,
7743 ) -> ::core::result::Result<
7744 (),
7745 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7746 > {
7747 match *message.header().ordinal {
7748 ordinal => {
7749 handler.on_unknown_interaction(ordinal).await;
7750 if ::core::matches!(
7751 message.header().flexibility(),
7752 ::fidl_next::protocol::Flexibility::Strict
7753 ) {
7754 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7755 } else {
7756 Ok(())
7757 }
7758 }
7759 }
7760 }
7761
7762 async fn on_two_way(
7763 handler: &mut ___H,
7764 mut message: ::fidl_next::Message<___T>,
7765 responder: ::fidl_next::protocol::Responder<___T>,
7766 ) -> ::core::result::Result<
7767 (),
7768 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7769 > {
7770 match *message.header().ordinal {
7771 9062519182019824475 => {
7772 let responder = ::fidl_next::Responder::from_untyped(responder);
7773
7774 handler.wait_until_flushed(responder).await;
7775 Ok(())
7776 }
7777
7778 ordinal => {
7779 handler.on_unknown_interaction(ordinal).await;
7780 if ::core::matches!(
7781 message.header().flexibility(),
7782 ::fidl_next::protocol::Flexibility::Strict
7783 ) {
7784 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7785 } else {
7786 responder
7787 .respond_framework_error(
7788 ordinal,
7789 ::fidl_next::FrameworkError::UnknownMethod,
7790 )
7791 .expect("encoding a framework error should never fail")
7792 .await?;
7793 Ok(())
7794 }
7795 }
7796 }
7797 }
7798}
7799
7800impl<___T> LogFlusherClientHandler<___T> for ::fidl_next::IgnoreEvents
7801where
7802 ___T: ::fidl_next::Transport,
7803{
7804 async fn on_unknown_interaction(&mut self, _: u64) {}
7805}
7806
7807impl<___H, ___T> LogFlusherLocalClientHandler<___T> for ::fidl_next::Local<___H>
7808where
7809 ___H: LogFlusherClientHandler<___T>,
7810 ___T: ::fidl_next::Transport,
7811{
7812 async fn on_unknown_interaction(&mut self, ordinal: u64) {
7813 ___H::on_unknown_interaction(&mut self.0, ordinal).await
7814 }
7815}
7816
7817impl<___H, ___T> LogFlusherLocalServerHandler<___T> for ::fidl_next::Local<___H>
7818where
7819 ___H: LogFlusherServerHandler<___T>,
7820 ___T: ::fidl_next::Transport,
7821{
7822 async fn wait_until_flushed(
7823 &mut self,
7824
7825 responder: ::fidl_next::Responder<log_flusher::WaitUntilFlushed, ___T>,
7826 ) {
7827 ___H::wait_until_flushed(&mut self.0, responder).await
7828 }
7829
7830 async fn on_unknown_interaction(&mut self, ordinal: u64) {
7831 ___H::on_unknown_interaction(&mut self.0, ordinal).await
7832 }
7833}
7834
7835#[doc = " Max number of LogInterestSelectors that can be specified via a listener.\n"]
7836pub const MAX_LOG_SELECTORS: u8 = 64 as u8;
7837
7838#[doc = " This protocol allows clients to modify the logging behavior of components\n in the system.\n"]
7840#[derive(PartialEq, Debug)]
7841pub struct LogSettings;
7842
7843impl ::fidl_next::Discoverable for LogSettings {
7844 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.LogSettings";
7845}
7846
7847#[cfg(target_os = "fuchsia")]
7848impl ::fidl_next::HasTransport for LogSettings {
7849 type Transport = ::fidl_next::fuchsia::zx::Channel;
7850}
7851
7852pub mod log_settings {
7853 pub mod prelude {
7854 pub use crate::{
7855 LogSettings, LogSettingsClientHandler, LogSettingsLocalClientHandler,
7856 LogSettingsLocalServerHandler, LogSettingsServerHandler, log_settings,
7857 };
7858
7859 pub use crate::natural::LogSettingsSetComponentInterestRequest;
7860 }
7861
7862 pub struct SetComponentInterest;
7863
7864 impl ::fidl_next::Method for SetComponentInterest {
7865 const ORDINAL: u64 = 3888577134564210369;
7866 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7867 ::fidl_next::protocol::Flexibility::Strict;
7868
7869 type Protocol = crate::LogSettings;
7870
7871 type Request = crate::wire::LogSettingsSetComponentInterestRequest<'static>;
7872 }
7873
7874 impl ::fidl_next::TwoWayMethod for SetComponentInterest {
7875 type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
7876 }
7877
7878 impl<___R> ::fidl_next::Respond<___R> for SetComponentInterest {
7879 type Output = ::fidl_next::Strict<___R>;
7880
7881 fn respond(response: ___R) -> Self::Output {
7882 ::fidl_next::Strict(response)
7883 }
7884 }
7885
7886 mod ___detail {
7887 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogSettings
7888 where
7889 ___T: ::fidl_next::Transport,
7890 {
7891 type Client = LogSettingsClient<___T>;
7892 type Server = LogSettingsServer<___T>;
7893 }
7894
7895 #[repr(transparent)]
7897 pub struct LogSettingsClient<___T: ::fidl_next::Transport> {
7898 #[allow(dead_code)]
7899 client: ::fidl_next::protocol::Client<___T>,
7900 }
7901
7902 impl<___T> LogSettingsClient<___T>
7903 where
7904 ___T: ::fidl_next::Transport,
7905 {
7906 #[doc = " Requests a change in interest for the matched components.\n\n Each component holds a set of requested interests.\n\n When a new request on LogSettings#SetComponentInterest is received,\n the sets for matched components receive the new minimum interest.\n If the interest is less than the previous minimum interest, then a\n `SetComponentInterest` request is sent with the new minimum interest.\n\n If a connection to `LogSettings` sends another `SetComponentInterest`\n request, its previous interest request will be undone.\n\n When the connection to `LogSettings` is finished, the interests are\n undone, unless persist is set to true. Each matched component minimum\n interest is updated with the new minimum interest in the set.\n"]
7907 pub fn set_component_interest_with<___R>(
7908 &self,
7909 request: ___R,
7910 ) -> ::fidl_next::TwoWayFuture<'_, super::SetComponentInterest, ___T>
7911 where
7912 ___R: ::fidl_next::Encode<
7913 crate::wire::LogSettingsSetComponentInterestRequest<'static>,
7914 <___T as ::fidl_next::Transport>::SendBuffer,
7915 >,
7916 {
7917 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7918 3888577134564210369,
7919 <super::SetComponentInterest as ::fidl_next::Method>::FLEXIBILITY,
7920 request,
7921 ))
7922 }
7923 }
7924
7925 #[repr(transparent)]
7927 pub struct LogSettingsServer<___T: ::fidl_next::Transport> {
7928 server: ::fidl_next::protocol::Server<___T>,
7929 }
7930
7931 impl<___T> LogSettingsServer<___T> where ___T: ::fidl_next::Transport {}
7932 }
7933}
7934
7935#[diagnostic::on_unimplemented(
7936 note = "If {Self} implements the non-local LogSettingsClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7937)]
7938
7939pub trait LogSettingsLocalClientHandler<
7943 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7944 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7945>
7946{
7947}
7948
7949impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogSettings
7950where
7951 ___H: LogSettingsLocalClientHandler<___T>,
7952 ___T: ::fidl_next::Transport,
7953{
7954 async fn on_event(
7955 handler: &mut ___H,
7956 mut message: ::fidl_next::Message<___T>,
7957 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7958 match *message.header().ordinal {
7959 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7960 }
7961 }
7962}
7963
7964#[diagnostic::on_unimplemented(
7965 note = "If {Self} implements the non-local LogSettingsServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7966)]
7967
7968pub trait LogSettingsLocalServerHandler<
7972 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7973 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7974>
7975{
7976 #[doc = " Requests a change in interest for the matched components.\n\n Each component holds a set of requested interests.\n\n When a new request on LogSettings#SetComponentInterest is received,\n the sets for matched components receive the new minimum interest.\n If the interest is less than the previous minimum interest, then a\n `SetComponentInterest` request is sent with the new minimum interest.\n\n If a connection to `LogSettings` sends another `SetComponentInterest`\n request, its previous interest request will be undone.\n\n When the connection to `LogSettings` is finished, the interests are\n undone, unless persist is set to true. Each matched component minimum\n interest is updated with the new minimum interest in the set.\n"]
7977 fn set_component_interest(
7978 &mut self,
7979
7980 request: ::fidl_next::Request<log_settings::SetComponentInterest, ___T>,
7981
7982 responder: ::fidl_next::Responder<log_settings::SetComponentInterest, ___T>,
7983 ) -> impl ::core::future::Future<Output = ()>;
7984}
7985
7986impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogSettings
7987where
7988 ___H: LogSettingsLocalServerHandler<___T>,
7989 ___T: ::fidl_next::Transport,
7990 for<'de> crate::wire::LogSettingsSetComponentInterestRequest<'de>: ::fidl_next::Decode<
7991 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7992 Constraint = (),
7993 >,
7994{
7995 async fn on_one_way(
7996 handler: &mut ___H,
7997 mut message: ::fidl_next::Message<___T>,
7998 ) -> ::core::result::Result<
7999 (),
8000 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8001 > {
8002 match *message.header().ordinal {
8003 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8004 }
8005 }
8006
8007 async fn on_two_way(
8008 handler: &mut ___H,
8009 mut message: ::fidl_next::Message<___T>,
8010 responder: ::fidl_next::protocol::Responder<___T>,
8011 ) -> ::core::result::Result<
8012 (),
8013 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8014 > {
8015 match *message.header().ordinal {
8016 3888577134564210369 => {
8017 let responder = ::fidl_next::Responder::from_untyped(responder);
8018
8019 match ::fidl_next::AsDecoderExt::into_decoded(message) {
8020 Ok(decoded) => {
8021 handler
8022 .set_component_interest(
8023 ::fidl_next::Request::from_decoded(decoded),
8024 responder,
8025 )
8026 .await;
8027 Ok(())
8028 }
8029 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
8030 ordinal: 3888577134564210369,
8031 error,
8032 }),
8033 }
8034 }
8035
8036 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8037 }
8038 }
8039}
8040
8041pub trait LogSettingsClientHandler<
8045 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
8046 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
8047>
8048{
8049}
8050
8051impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogSettings
8052where
8053 ___H: LogSettingsClientHandler<___T> + ::core::marker::Send,
8054 ___T: ::fidl_next::Transport,
8055{
8056 async fn on_event(
8057 handler: &mut ___H,
8058 mut message: ::fidl_next::Message<___T>,
8059 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
8060 match *message.header().ordinal {
8061 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8062 }
8063 }
8064}
8065
8066pub trait LogSettingsServerHandler<
8070 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
8071 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
8072>
8073{
8074 #[doc = " Requests a change in interest for the matched components.\n\n Each component holds a set of requested interests.\n\n When a new request on LogSettings#SetComponentInterest is received,\n the sets for matched components receive the new minimum interest.\n If the interest is less than the previous minimum interest, then a\n `SetComponentInterest` request is sent with the new minimum interest.\n\n If a connection to `LogSettings` sends another `SetComponentInterest`\n request, its previous interest request will be undone.\n\n When the connection to `LogSettings` is finished, the interests are\n undone, unless persist is set to true. Each matched component minimum\n interest is updated with the new minimum interest in the set.\n"]
8075 fn set_component_interest(
8076 &mut self,
8077
8078 request: ::fidl_next::Request<log_settings::SetComponentInterest, ___T>,
8079
8080 responder: ::fidl_next::Responder<log_settings::SetComponentInterest, ___T>,
8081 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
8082}
8083
8084impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogSettings
8085where
8086 ___H: LogSettingsServerHandler<___T> + ::core::marker::Send,
8087 ___T: ::fidl_next::Transport,
8088 for<'de> crate::wire::LogSettingsSetComponentInterestRequest<'de>: ::fidl_next::Decode<
8089 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
8090 Constraint = (),
8091 >,
8092{
8093 async fn on_one_way(
8094 handler: &mut ___H,
8095 mut message: ::fidl_next::Message<___T>,
8096 ) -> ::core::result::Result<
8097 (),
8098 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8099 > {
8100 match *message.header().ordinal {
8101 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8102 }
8103 }
8104
8105 async fn on_two_way(
8106 handler: &mut ___H,
8107 mut message: ::fidl_next::Message<___T>,
8108 responder: ::fidl_next::protocol::Responder<___T>,
8109 ) -> ::core::result::Result<
8110 (),
8111 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8112 > {
8113 match *message.header().ordinal {
8114 3888577134564210369 => {
8115 let responder = ::fidl_next::Responder::from_untyped(responder);
8116
8117 match ::fidl_next::AsDecoderExt::into_decoded(message) {
8118 Ok(decoded) => {
8119 handler
8120 .set_component_interest(
8121 ::fidl_next::Request::from_decoded(decoded),
8122 responder,
8123 )
8124 .await;
8125 Ok(())
8126 }
8127 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
8128 ordinal: 3888577134564210369,
8129 error,
8130 }),
8131 }
8132 }
8133
8134 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8135 }
8136 }
8137}
8138
8139impl<___T> LogSettingsClientHandler<___T> for ::fidl_next::IgnoreEvents where
8140 ___T: ::fidl_next::Transport
8141{
8142}
8143
8144impl<___H, ___T> LogSettingsLocalClientHandler<___T> for ::fidl_next::Local<___H>
8145where
8146 ___H: LogSettingsClientHandler<___T>,
8147 ___T: ::fidl_next::Transport,
8148{
8149}
8150
8151impl<___H, ___T> LogSettingsLocalServerHandler<___T> for ::fidl_next::Local<___H>
8152where
8153 ___H: LogSettingsServerHandler<___T>,
8154 ___T: ::fidl_next::Transport,
8155{
8156 async fn set_component_interest(
8157 &mut self,
8158
8159 request: ::fidl_next::Request<log_settings::SetComponentInterest, ___T>,
8160
8161 responder: ::fidl_next::Responder<log_settings::SetComponentInterest, ___T>,
8162 ) {
8163 ___H::set_component_interest(&mut self.0, request, responder).await
8164 }
8165}
8166
8167#[doc = " The maximum number of parameters that can be sent in one `Set` call.\n"]
8168pub const MAX_SAMPLE_PARAMETERS_PER_SET: u64 = 100 as u64;
8169
8170pub const MONIKER_ARG_NAME: &str = "$__moniker";
8171
8172pub const ROLLED_OUT_ARG_NAME: &str = "$__rolled_out";