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 ArchiveAccessorWaitForReadyResponse = ();
2712
2713 #[doc = " Enum describing the potential failure states of the streaming protocol when serving results\n to the client over the result iterator.\n"]
2714 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2715 #[repr(u32)]
2716 pub enum ReaderError {
2717 Io = 1,
2718 }
2719 impl ::core::convert::TryFrom<u32> for ReaderError {
2720 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2721 fn try_from(
2722 value: u32,
2723 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
2724 match value {
2725 1 => Ok(Self::Io),
2726
2727 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
2728 }
2729 }
2730 }
2731
2732 impl ::std::convert::From<ReaderError> for u32 {
2733 fn from(value: ReaderError) -> Self {
2734 match value {
2735 ReaderError::Io => 1,
2736 }
2737 }
2738 }
2739
2740 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ReaderError, ___E> for ReaderError
2741 where
2742 ___E: ?Sized,
2743 {
2744 #[inline]
2745 fn encode(
2746 self,
2747 encoder: &mut ___E,
2748 out: &mut ::core::mem::MaybeUninit<crate::wire::ReaderError>,
2749 _: (),
2750 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2751 ::fidl_next::Encode::encode(&self, encoder, out, ())
2752 }
2753 }
2754
2755 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ReaderError, ___E> for &'a ReaderError
2756 where
2757 ___E: ?Sized,
2758 {
2759 #[inline]
2760 fn encode(
2761 self,
2762 encoder: &mut ___E,
2763 out: &mut ::core::mem::MaybeUninit<crate::wire::ReaderError>,
2764 _: (),
2765 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2766 ::fidl_next::munge!(let crate::wire::ReaderError { value } = out);
2767 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2768 ReaderError::Io => 1,
2769 }));
2770
2771 Ok(())
2772 }
2773 }
2774
2775 impl ::core::convert::From<crate::wire::ReaderError> for ReaderError {
2776 fn from(wire: crate::wire::ReaderError) -> Self {
2777 match u32::from(wire.value) {
2778 1 => Self::Io,
2779
2780 _ => unsafe { ::core::hint::unreachable_unchecked() },
2781 }
2782 }
2783 }
2784
2785 impl ::fidl_next::FromWire<crate::wire::ReaderError> for ReaderError {
2786 #[inline]
2787 fn from_wire(wire: crate::wire::ReaderError) -> Self {
2788 Self::from(wire)
2789 }
2790 }
2791
2792 impl ::fidl_next::FromWireRef<crate::wire::ReaderError> for ReaderError {
2793 #[inline]
2794 fn from_wire_ref(wire: &crate::wire::ReaderError) -> Self {
2795 Self::from(*wire)
2796 }
2797 }
2798
2799 pub type BatchIteratorWaitForReadyResponse = ();
2800
2801 #[doc = " ConfigurationError indicates a bad setting in `Sample::Set`. This value\n is returned before the first sample is taken.\n"]
2802 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2803 #[repr(u32)]
2804 pub enum ConfigurationError {
2805 SamplePeriodTooSmall = 1,
2806 SampleParametersInvalid = 2,
2807 InvalidSelectors = 3,
2808 UnknownOrdinal_(u32) = 4,
2809 }
2810 impl ::std::convert::From<u32> for ConfigurationError {
2811 fn from(value: u32) -> Self {
2812 match value {
2813 1 => Self::SamplePeriodTooSmall,
2814 2 => Self::SampleParametersInvalid,
2815 3 => Self::InvalidSelectors,
2816
2817 _ => Self::UnknownOrdinal_(value),
2818 }
2819 }
2820 }
2821
2822 impl ::std::convert::From<ConfigurationError> for u32 {
2823 fn from(value: ConfigurationError) -> Self {
2824 match value {
2825 ConfigurationError::SamplePeriodTooSmall => 1,
2826 ConfigurationError::SampleParametersInvalid => 2,
2827 ConfigurationError::InvalidSelectors => 3,
2828
2829 ConfigurationError::UnknownOrdinal_(value) => value,
2830 }
2831 }
2832 }
2833
2834 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigurationError, ___E> for ConfigurationError
2835 where
2836 ___E: ?Sized,
2837 {
2838 #[inline]
2839 fn encode(
2840 self,
2841 encoder: &mut ___E,
2842 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigurationError>,
2843 _: (),
2844 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2845 ::fidl_next::Encode::encode(&self, encoder, out, ())
2846 }
2847 }
2848
2849 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigurationError, ___E>
2850 for &'a ConfigurationError
2851 where
2852 ___E: ?Sized,
2853 {
2854 #[inline]
2855 fn encode(
2856 self,
2857 encoder: &mut ___E,
2858 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigurationError>,
2859 _: (),
2860 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2861 ::fidl_next::munge!(let crate::wire::ConfigurationError { value } = out);
2862 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2863 ConfigurationError::SamplePeriodTooSmall => 1,
2864
2865 ConfigurationError::SampleParametersInvalid => 2,
2866
2867 ConfigurationError::InvalidSelectors => 3,
2868
2869 ConfigurationError::UnknownOrdinal_(value) => value,
2870 }));
2871
2872 Ok(())
2873 }
2874 }
2875
2876 impl ::core::convert::From<crate::wire::ConfigurationError> for ConfigurationError {
2877 fn from(wire: crate::wire::ConfigurationError) -> Self {
2878 match u32::from(wire.value) {
2879 1 => Self::SamplePeriodTooSmall,
2880
2881 2 => Self::SampleParametersInvalid,
2882
2883 3 => Self::InvalidSelectors,
2884
2885 value => Self::UnknownOrdinal_(value),
2886 }
2887 }
2888 }
2889
2890 impl ::fidl_next::FromWire<crate::wire::ConfigurationError> for ConfigurationError {
2891 #[inline]
2892 fn from_wire(wire: crate::wire::ConfigurationError) -> Self {
2893 Self::from(wire)
2894 }
2895 }
2896
2897 impl ::fidl_next::FromWireRef<crate::wire::ConfigurationError> for ConfigurationError {
2898 #[inline]
2899 fn from_wire_ref(wire: &crate::wire::ConfigurationError) -> Self {
2900 Self::from(*wire)
2901 }
2902 }
2903
2904 pub type LogFlusherWaitUntilFlushedResponse = ();
2905
2906 #[derive(Debug, Clone, PartialEq)]
2907 pub struct LogInterestSelector {
2908 pub selector: crate::natural::ComponentSelector,
2909
2910 pub interest: ::fidl_next_common_fuchsia_diagnostics_types::natural::Interest,
2911 }
2912
2913 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>
2914 for LogInterestSelector
2915 where
2916 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2917 ___E: ::fidl_next::Encoder,
2918 {
2919 #[inline]
2920 fn encode(
2921 self,
2922 encoder_: &mut ___E,
2923 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogInterestSelector<'static>>,
2924 _: (),
2925 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2926 ::fidl_next::munge! {
2927 let crate::wire::LogInterestSelector {
2928 selector,
2929 interest,
2930
2931 } = out_;
2932 }
2933
2934 ::fidl_next::Encode::encode(self.selector, encoder_, selector, ())?;
2935
2936 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(selector.as_mut_ptr()) };
2937
2938 ::fidl_next::Encode::encode(self.interest, encoder_, interest, ())?;
2939
2940 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(interest.as_mut_ptr()) };
2941
2942 Ok(())
2943 }
2944 }
2945
2946 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>
2947 for &'a LogInterestSelector
2948 where
2949 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2950 ___E: ::fidl_next::Encoder,
2951 {
2952 #[inline]
2953 fn encode(
2954 self,
2955 encoder_: &mut ___E,
2956 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogInterestSelector<'static>>,
2957 _: (),
2958 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2959 ::fidl_next::munge! {
2960 let crate::wire::LogInterestSelector {
2961 selector,
2962 interest,
2963
2964 } = out_;
2965 }
2966
2967 ::fidl_next::Encode::encode(&self.selector, encoder_, selector, ())?;
2968
2969 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(selector.as_mut_ptr()) };
2970
2971 ::fidl_next::Encode::encode(&self.interest, encoder_, interest, ())?;
2972
2973 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(interest.as_mut_ptr()) };
2974
2975 Ok(())
2976 }
2977 }
2978
2979 unsafe impl<___E>
2980 ::fidl_next::EncodeOption<
2981 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
2982 ___E,
2983 > for LogInterestSelector
2984 where
2985 ___E: ::fidl_next::Encoder + ?Sized,
2986 LogInterestSelector: ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>,
2987 {
2988 #[inline]
2989 fn encode_option(
2990 this: ::core::option::Option<Self>,
2991 encoder: &mut ___E,
2992 out: &mut ::core::mem::MaybeUninit<
2993 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
2994 >,
2995 _: (),
2996 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2997 if let Some(inner) = this {
2998 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2999 ::fidl_next::wire::Box::encode_present(out);
3000 } else {
3001 ::fidl_next::wire::Box::encode_absent(out);
3002 }
3003
3004 Ok(())
3005 }
3006 }
3007
3008 unsafe impl<'a, ___E>
3009 ::fidl_next::EncodeOption<
3010 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
3011 ___E,
3012 > for &'a LogInterestSelector
3013 where
3014 ___E: ::fidl_next::Encoder + ?Sized,
3015 &'a LogInterestSelector:
3016 ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>,
3017 {
3018 #[inline]
3019 fn encode_option(
3020 this: ::core::option::Option<Self>,
3021 encoder: &mut ___E,
3022 out: &mut ::core::mem::MaybeUninit<
3023 ::fidl_next::wire::Box<'static, crate::wire::LogInterestSelector<'static>>,
3024 >,
3025 _: (),
3026 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3027 if let Some(inner) = this {
3028 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3029 ::fidl_next::wire::Box::encode_present(out);
3030 } else {
3031 ::fidl_next::wire::Box::encode_absent(out);
3032 }
3033
3034 Ok(())
3035 }
3036 }
3037
3038 impl<'de> ::fidl_next::FromWire<crate::wire::LogInterestSelector<'de>> for LogInterestSelector {
3039 #[inline]
3040 fn from_wire(wire: crate::wire::LogInterestSelector<'de>) -> Self {
3041 Self {
3042 selector: ::fidl_next::FromWire::from_wire(wire.selector),
3043
3044 interest: ::fidl_next::FromWire::from_wire(wire.interest),
3045 }
3046 }
3047 }
3048
3049 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogInterestSelector<'de>> for LogInterestSelector {
3050 #[inline]
3051 fn from_wire_ref(wire: &crate::wire::LogInterestSelector<'de>) -> Self {
3052 Self {
3053 selector: ::fidl_next::FromWireRef::from_wire_ref(&wire.selector),
3054
3055 interest: ::fidl_next::FromWireRef::from_wire_ref(&wire.interest),
3056 }
3057 }
3058 }
3059
3060 #[derive(Debug, Default, Clone, PartialEq)]
3061 pub struct LogSettingsSetComponentInterestRequest {
3062 pub selectors: ::core::option::Option<::std::vec::Vec<crate::natural::LogInterestSelector>>,
3063
3064 pub persist: ::core::option::Option<bool>,
3065 }
3066
3067 impl LogSettingsSetComponentInterestRequest {
3068 fn __max_ordinal(&self) -> usize {
3069 if self.persist.is_some() {
3070 return 2;
3071 }
3072
3073 if self.selectors.is_some() {
3074 return 1;
3075 }
3076
3077 0
3078 }
3079 }
3080
3081 unsafe impl<___E>
3082 ::fidl_next::Encode<crate::wire::LogSettingsSetComponentInterestRequest<'static>, ___E>
3083 for LogSettingsSetComponentInterestRequest
3084 where
3085 ___E: ::fidl_next::Encoder + ?Sized,
3086 {
3087 #[inline]
3088 fn encode(
3089 mut self,
3090 encoder: &mut ___E,
3091 out: &mut ::core::mem::MaybeUninit<
3092 crate::wire::LogSettingsSetComponentInterestRequest<'static>,
3093 >,
3094 _: (),
3095 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3096 ::fidl_next::munge!(let crate::wire::LogSettingsSetComponentInterestRequest { table } = out);
3097
3098 let max_ord = self.__max_ordinal();
3099
3100 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3101 ::fidl_next::Wire::zero_padding(&mut out);
3102
3103 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3104 ::fidl_next::wire::Envelope,
3105 >(encoder, max_ord);
3106
3107 for i in 1..=max_ord {
3108 match i {
3109 2 => {
3110 if let Some(value) = self.persist.take() {
3111 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3112 value,
3113 preallocated.encoder,
3114 &mut out,
3115 (),
3116 )?;
3117 } else {
3118 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3119 }
3120 }
3121
3122 1 => {
3123 if let Some(value) = self.selectors.take() {
3124 ::fidl_next::wire::Envelope::encode_value::<
3125 ::fidl_next::wire::Vector<
3126 'static,
3127 crate::wire::LogInterestSelector<'static>,
3128 >,
3129 ___E,
3130 >(
3131 value, preallocated.encoder, &mut out, (64, ())
3132 )?;
3133 } else {
3134 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3135 }
3136 }
3137
3138 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3139 }
3140 unsafe {
3141 preallocated.write_next(out.assume_init_ref());
3142 }
3143 }
3144
3145 ::fidl_next::wire::Table::encode_len(table, max_ord);
3146
3147 Ok(())
3148 }
3149 }
3150
3151 unsafe impl<'a, ___E>
3152 ::fidl_next::Encode<crate::wire::LogSettingsSetComponentInterestRequest<'static>, ___E>
3153 for &'a LogSettingsSetComponentInterestRequest
3154 where
3155 ___E: ::fidl_next::Encoder + ?Sized,
3156 {
3157 #[inline]
3158 fn encode(
3159 self,
3160 encoder: &mut ___E,
3161 out: &mut ::core::mem::MaybeUninit<
3162 crate::wire::LogSettingsSetComponentInterestRequest<'static>,
3163 >,
3164 _: (),
3165 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3166 ::fidl_next::munge!(let crate::wire::LogSettingsSetComponentInterestRequest { table } = out);
3167
3168 let max_ord = self.__max_ordinal();
3169
3170 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3171 ::fidl_next::Wire::zero_padding(&mut out);
3172
3173 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3174 ::fidl_next::wire::Envelope,
3175 >(encoder, max_ord);
3176
3177 for i in 1..=max_ord {
3178 match i {
3179 2 => {
3180 if let Some(value) = &self.persist {
3181 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
3182 value,
3183 preallocated.encoder,
3184 &mut out,
3185 (),
3186 )?;
3187 } else {
3188 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3189 }
3190 }
3191
3192 1 => {
3193 if let Some(value) = &self.selectors {
3194 ::fidl_next::wire::Envelope::encode_value::<
3195 ::fidl_next::wire::Vector<
3196 'static,
3197 crate::wire::LogInterestSelector<'static>,
3198 >,
3199 ___E,
3200 >(
3201 value, preallocated.encoder, &mut out, (64, ())
3202 )?;
3203 } else {
3204 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3205 }
3206 }
3207
3208 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3209 }
3210 unsafe {
3211 preallocated.write_next(out.assume_init_ref());
3212 }
3213 }
3214
3215 ::fidl_next::wire::Table::encode_len(table, max_ord);
3216
3217 Ok(())
3218 }
3219 }
3220
3221 impl<'de> ::fidl_next::FromWire<crate::wire::LogSettingsSetComponentInterestRequest<'de>>
3222 for LogSettingsSetComponentInterestRequest
3223 {
3224 #[inline]
3225 fn from_wire(wire_: crate::wire::LogSettingsSetComponentInterestRequest<'de>) -> Self {
3226 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3227
3228 let selectors = wire_.table.get(1);
3229
3230 let persist = wire_.table.get(2);
3231
3232 Self {
3233 selectors:
3234 selectors.map(|envelope| {
3235 ::fidl_next::FromWire::from_wire(unsafe {
3236 envelope.read_unchecked::<::fidl_next::wire::Vector<
3237 'de,
3238 crate::wire::LogInterestSelector<'de>,
3239 >>()
3240 })
3241 }),
3242
3243 persist: persist.map(|envelope| {
3244 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
3245 }),
3246 }
3247 }
3248 }
3249
3250 impl<'de> ::fidl_next::FromWireRef<crate::wire::LogSettingsSetComponentInterestRequest<'de>>
3251 for LogSettingsSetComponentInterestRequest
3252 {
3253 #[inline]
3254 fn from_wire_ref(wire: &crate::wire::LogSettingsSetComponentInterestRequest<'de>) -> Self {
3255 Self {
3256 selectors:
3257 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 ArchiveAccessorWaitForReadyResponse = ::fidl_next::wire::Unit;
5901
5902 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5904 #[repr(transparent)]
5905 pub struct ReaderError {
5906 pub(crate) value: ::fidl_next::wire::Uint32,
5907 }
5908
5909 impl ::fidl_next::Constrained for ReaderError {
5910 type Constraint = ();
5911
5912 fn validate(
5913 _: ::fidl_next::Slot<'_, Self>,
5914 _: Self::Constraint,
5915 ) -> Result<(), ::fidl_next::ValidationError> {
5916 Ok(())
5917 }
5918 }
5919
5920 unsafe impl ::fidl_next::Wire for ReaderError {
5921 type Narrowed<'de> = Self;
5922
5923 #[inline]
5924 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5925 }
5927 }
5928
5929 impl ReaderError {
5930 pub const IO: ReaderError = ReaderError { value: ::fidl_next::wire::Uint32(1) };
5931 }
5932
5933 unsafe impl<___D> ::fidl_next::Decode<___D> for ReaderError
5934 where
5935 ___D: ?Sized,
5936 {
5937 fn decode(
5938 slot: ::fidl_next::Slot<'_, Self>,
5939 _: &mut ___D,
5940 _: (),
5941 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5942 ::fidl_next::munge!(let Self { value } = slot);
5943
5944 match u32::from(*value) {
5945 1 => (),
5946 unknown => {
5947 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
5948 }
5949 }
5950
5951 Ok(())
5952 }
5953 }
5954
5955 impl ::core::convert::From<crate::natural::ReaderError> for ReaderError {
5956 fn from(natural: crate::natural::ReaderError) -> Self {
5957 match natural {
5958 crate::natural::ReaderError::Io => ReaderError::IO,
5959 }
5960 }
5961 }
5962
5963 impl ::fidl_next::IntoNatural for ReaderError {
5964 type Natural = crate::natural::ReaderError;
5965 }
5966
5967 pub type BatchIteratorWaitForReadyResponse = ::fidl_next::wire::Unit;
5969
5970 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5972 #[repr(transparent)]
5973 pub struct ConfigurationError {
5974 pub(crate) value: ::fidl_next::wire::Uint32,
5975 }
5976
5977 impl ::fidl_next::Constrained for ConfigurationError {
5978 type Constraint = ();
5979
5980 fn validate(
5981 _: ::fidl_next::Slot<'_, Self>,
5982 _: Self::Constraint,
5983 ) -> Result<(), ::fidl_next::ValidationError> {
5984 Ok(())
5985 }
5986 }
5987
5988 unsafe impl ::fidl_next::Wire for ConfigurationError {
5989 type Narrowed<'de> = Self;
5990
5991 #[inline]
5992 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5993 }
5995 }
5996
5997 impl ConfigurationError {
5998 pub const SAMPLE_PERIOD_TOO_SMALL: ConfigurationError =
5999 ConfigurationError { value: ::fidl_next::wire::Uint32(1) };
6000
6001 pub const SAMPLE_PARAMETERS_INVALID: ConfigurationError =
6002 ConfigurationError { value: ::fidl_next::wire::Uint32(2) };
6003
6004 pub const INVALID_SELECTORS: ConfigurationError =
6005 ConfigurationError { value: ::fidl_next::wire::Uint32(3) };
6006 }
6007
6008 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigurationError
6009 where
6010 ___D: ?Sized,
6011 {
6012 fn decode(
6013 slot: ::fidl_next::Slot<'_, Self>,
6014 _: &mut ___D,
6015 _: (),
6016 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6017 Ok(())
6018 }
6019 }
6020
6021 impl ::core::convert::From<crate::natural::ConfigurationError> for ConfigurationError {
6022 fn from(natural: crate::natural::ConfigurationError) -> Self {
6023 match natural {
6024 crate::natural::ConfigurationError::SamplePeriodTooSmall => {
6025 ConfigurationError::SAMPLE_PERIOD_TOO_SMALL
6026 }
6027
6028 crate::natural::ConfigurationError::SampleParametersInvalid => {
6029 ConfigurationError::SAMPLE_PARAMETERS_INVALID
6030 }
6031
6032 crate::natural::ConfigurationError::InvalidSelectors => {
6033 ConfigurationError::INVALID_SELECTORS
6034 }
6035
6036 crate::natural::ConfigurationError::UnknownOrdinal_(value) => {
6037 ConfigurationError { value: ::fidl_next::wire::Uint32::from(value) }
6038 }
6039 }
6040 }
6041 }
6042
6043 impl ::fidl_next::IntoNatural for ConfigurationError {
6044 type Natural = crate::natural::ConfigurationError;
6045 }
6046
6047 pub type LogFlusherWaitUntilFlushedResponse = ::fidl_next::wire::Unit;
6049
6050 #[derive(Debug)]
6052 #[repr(C)]
6053 pub struct LogInterestSelector<'de> {
6054 pub selector: crate::wire::ComponentSelector<'de>,
6055
6056 pub interest: ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'de>,
6057 }
6058
6059 static_assertions::const_assert_eq!(std::mem::size_of::<LogInterestSelector<'_>>(), 32);
6060 static_assertions::const_assert_eq!(std::mem::align_of::<LogInterestSelector<'_>>(), 8);
6061
6062 static_assertions::const_assert_eq!(std::mem::offset_of!(LogInterestSelector<'_>, selector), 0);
6063
6064 static_assertions::const_assert_eq!(
6065 std::mem::offset_of!(LogInterestSelector<'_>, interest),
6066 16
6067 );
6068
6069 impl ::fidl_next::Constrained for LogInterestSelector<'_> {
6070 type Constraint = ();
6071
6072 fn validate(
6073 _: ::fidl_next::Slot<'_, Self>,
6074 _: Self::Constraint,
6075 ) -> Result<(), ::fidl_next::ValidationError> {
6076 Ok(())
6077 }
6078 }
6079
6080 unsafe impl ::fidl_next::Wire for LogInterestSelector<'static> {
6081 type Narrowed<'de> = LogInterestSelector<'de>;
6082
6083 #[inline]
6084 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6085 ::fidl_next::munge! {
6086 let Self {
6087 selector,
6088 interest,
6089
6090 } = &mut *out_;
6091 }
6092
6093 ::fidl_next::Wire::zero_padding(selector);
6094
6095 ::fidl_next::Wire::zero_padding(interest);
6096 }
6097 }
6098
6099 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogInterestSelector<'de>
6100 where
6101 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6102 ___D: ::fidl_next::Decoder<'de>,
6103 {
6104 fn decode(
6105 slot_: ::fidl_next::Slot<'_, Self>,
6106 decoder_: &mut ___D,
6107 _: (),
6108 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6109 ::fidl_next::munge! {
6110 let Self {
6111 mut selector,
6112 mut interest,
6113
6114 } = slot_;
6115 }
6116
6117 let _field = selector.as_mut();
6118
6119 ::fidl_next::Decode::decode(selector.as_mut(), decoder_, ())?;
6120
6121 let _field = interest.as_mut();
6122
6123 ::fidl_next::Decode::decode(interest.as_mut(), decoder_, ())?;
6124
6125 Ok(())
6126 }
6127 }
6128
6129 impl<'de> ::fidl_next::IntoNatural for LogInterestSelector<'de> {
6130 type Natural = crate::natural::LogInterestSelector;
6131 }
6132
6133 #[repr(C)]
6135 pub struct LogSettingsSetComponentInterestRequest<'de> {
6136 pub(crate) table: ::fidl_next::wire::Table<'de>,
6137 }
6138
6139 impl<'de> Drop for LogSettingsSetComponentInterestRequest<'de> {
6140 fn drop(&mut self) {
6141 let _ = self.table.get(1)
6142 .map(|envelope| unsafe {
6143 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>>()
6144 });
6145
6146 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6147 }
6148 }
6149
6150 impl ::fidl_next::Constrained for LogSettingsSetComponentInterestRequest<'_> {
6151 type Constraint = ();
6152
6153 fn validate(
6154 _: ::fidl_next::Slot<'_, Self>,
6155 _: Self::Constraint,
6156 ) -> Result<(), ::fidl_next::ValidationError> {
6157 Ok(())
6158 }
6159 }
6160
6161 unsafe impl ::fidl_next::Wire for LogSettingsSetComponentInterestRequest<'static> {
6162 type Narrowed<'de> = LogSettingsSetComponentInterestRequest<'de>;
6163
6164 #[inline]
6165 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6166 ::fidl_next::munge!(let Self { table } = out);
6167 ::fidl_next::wire::Table::zero_padding(table);
6168 }
6169 }
6170
6171 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogSettingsSetComponentInterestRequest<'de>
6172 where
6173 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6174 {
6175 fn decode(
6176 slot: ::fidl_next::Slot<'_, Self>,
6177 decoder: &mut ___D,
6178 _: (),
6179 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6180 ::fidl_next::munge!(let Self { table } = slot);
6181
6182 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6183 match ordinal {
6184 0 => unsafe { ::core::hint::unreachable_unchecked() },
6185
6186 1 => {
6187 ::fidl_next::wire::Envelope::decode_as::<
6188 ___D,
6189 ::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>,
6190 >(slot.as_mut(), decoder, (64, ()))?;
6191
6192 let value = unsafe {
6193 slot
6194 .deref_unchecked()
6195 .deref_unchecked::<
6196 ::fidl_next::wire::Vector<'_, crate::wire::LogInterestSelector<'_>>
6197 >()
6198 };
6199
6200 if value.len() > 64 {
6201 return Err(::fidl_next::DecodeError::VectorTooLong {
6202 size: value.len() as u64,
6203 limit: 64,
6204 });
6205 }
6206
6207 Ok(())
6208 }
6209
6210 2 => {
6211 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6212 slot.as_mut(),
6213 decoder,
6214 (),
6215 )?;
6216
6217 Ok(())
6218 }
6219
6220 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6221 }
6222 })
6223 }
6224 }
6225
6226 impl<'de> LogSettingsSetComponentInterestRequest<'de> {
6227 pub fn selectors(
6228 &self,
6229 ) -> ::core::option::Option<
6230 &::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>,
6231 > {
6232 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6233 }
6234
6235 pub fn take_selectors(
6236 &mut self,
6237 ) -> ::core::option::Option<
6238 ::fidl_next::wire::Vector<'de, crate::wire::LogInterestSelector<'de>>,
6239 > {
6240 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6241 }
6242
6243 pub fn persist(&self) -> ::core::option::Option<&bool> {
6244 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6245 }
6246
6247 pub fn take_persist(&mut self) -> ::core::option::Option<bool> {
6248 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
6249 }
6250 }
6251
6252 impl<'de> ::core::fmt::Debug for LogSettingsSetComponentInterestRequest<'de> {
6253 fn fmt(
6254 &self,
6255 f: &mut ::core::fmt::Formatter<'_>,
6256 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6257 f.debug_struct("LogSettingsSetComponentInterestRequest")
6258 .field("selectors", &self.selectors())
6259 .field("persist", &self.persist())
6260 .finish()
6261 }
6262 }
6263
6264 impl<'de> ::fidl_next::IntoNatural for LogSettingsSetComponentInterestRequest<'de> {
6265 type Natural = crate::natural::LogSettingsSetComponentInterestRequest;
6266 }
6267
6268 #[repr(C)]
6270 pub struct LogStreamOptions<'de> {
6271 pub(crate) table: ::fidl_next::wire::Table<'de>,
6272 }
6273
6274 impl<'de> Drop for LogStreamOptions<'de> {
6275 fn drop(&mut self) {
6276 let _ = self
6277 .table
6278 .get(1)
6279 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StreamMode>() });
6280
6281 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6282
6283 let _ = self.table.get(3).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6284
6285 let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6286
6287 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
6288 }
6289 }
6290
6291 impl ::fidl_next::Constrained for LogStreamOptions<'_> {
6292 type Constraint = ();
6293
6294 fn validate(
6295 _: ::fidl_next::Slot<'_, Self>,
6296 _: Self::Constraint,
6297 ) -> Result<(), ::fidl_next::ValidationError> {
6298 Ok(())
6299 }
6300 }
6301
6302 unsafe impl ::fidl_next::Wire for LogStreamOptions<'static> {
6303 type Narrowed<'de> = LogStreamOptions<'de>;
6304
6305 #[inline]
6306 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6307 ::fidl_next::munge!(let Self { table } = out);
6308 ::fidl_next::wire::Table::zero_padding(table);
6309 }
6310 }
6311
6312 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogStreamOptions<'de>
6313 where
6314 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6315 {
6316 fn decode(
6317 slot: ::fidl_next::Slot<'_, Self>,
6318 decoder: &mut ___D,
6319 _: (),
6320 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6321 ::fidl_next::munge!(let Self { table } = slot);
6322
6323 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6324 match ordinal {
6325 0 => unsafe { ::core::hint::unreachable_unchecked() },
6326
6327 1 => {
6328 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StreamMode>(
6329 slot.as_mut(),
6330 decoder,
6331 (),
6332 )?;
6333
6334 Ok(())
6335 }
6336
6337 2 => {
6338 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6339 slot.as_mut(),
6340 decoder,
6341 (),
6342 )?;
6343
6344 Ok(())
6345 }
6346
6347 3 => {
6348 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6349 slot.as_mut(),
6350 decoder,
6351 (),
6352 )?;
6353
6354 Ok(())
6355 }
6356
6357 4 => {
6358 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6359 slot.as_mut(),
6360 decoder,
6361 (),
6362 )?;
6363
6364 Ok(())
6365 }
6366
6367 5 => {
6368 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
6369 slot.as_mut(),
6370 decoder,
6371 (),
6372 )?;
6373
6374 Ok(())
6375 }
6376
6377 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6378 }
6379 })
6380 }
6381 }
6382
6383 impl<'de> LogStreamOptions<'de> {
6384 pub fn mode(&self) -> ::core::option::Option<&crate::wire::StreamMode> {
6385 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6386 }
6387
6388 pub fn take_mode(&mut self) -> ::core::option::Option<crate::wire::StreamMode> {
6389 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6390 }
6391
6392 pub fn include_moniker(&self) -> ::core::option::Option<&bool> {
6393 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6394 }
6395
6396 pub fn take_include_moniker(&mut self) -> ::core::option::Option<bool> {
6397 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
6398 }
6399
6400 pub fn include_component_url(&self) -> ::core::option::Option<&bool> {
6401 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6402 }
6403
6404 pub fn take_include_component_url(&mut self) -> ::core::option::Option<bool> {
6405 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
6406 }
6407
6408 pub fn include_rolled_out(&self) -> ::core::option::Option<&bool> {
6409 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
6410 }
6411
6412 pub fn take_include_rolled_out(&mut self) -> ::core::option::Option<bool> {
6413 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
6414 }
6415
6416 pub fn subscribe_to_manifest(&self) -> ::core::option::Option<&bool> {
6417 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
6418 }
6419
6420 pub fn take_subscribe_to_manifest(&mut self) -> ::core::option::Option<bool> {
6421 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
6422 }
6423 }
6424
6425 impl<'de> ::core::fmt::Debug for LogStreamOptions<'de> {
6426 fn fmt(
6427 &self,
6428 f: &mut ::core::fmt::Formatter<'_>,
6429 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6430 f.debug_struct("LogStreamOptions")
6431 .field("mode", &self.mode())
6432 .field("include_moniker", &self.include_moniker())
6433 .field("include_component_url", &self.include_component_url())
6434 .field("include_rolled_out", &self.include_rolled_out())
6435 .field("subscribe_to_manifest", &self.subscribe_to_manifest())
6436 .finish()
6437 }
6438 }
6439
6440 impl<'de> ::fidl_next::IntoNatural for LogStreamOptions<'de> {
6441 type Natural = crate::natural::LogStreamOptions;
6442 }
6443
6444 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6446 #[repr(transparent)]
6447 pub struct RuntimeError {
6448 pub(crate) value: ::fidl_next::wire::Uint32,
6449 }
6450
6451 impl ::fidl_next::Constrained for RuntimeError {
6452 type Constraint = ();
6453
6454 fn validate(
6455 _: ::fidl_next::Slot<'_, Self>,
6456 _: Self::Constraint,
6457 ) -> Result<(), ::fidl_next::ValidationError> {
6458 Ok(())
6459 }
6460 }
6461
6462 unsafe impl ::fidl_next::Wire for RuntimeError {
6463 type Narrowed<'de> = Self;
6464
6465 #[inline]
6466 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6467 }
6469 }
6470
6471 impl RuntimeError {
6472 pub const BATCH_ITERATOR_FAILED: RuntimeError =
6473 RuntimeError { value: ::fidl_next::wire::Uint32(1) };
6474 }
6475
6476 unsafe impl<___D> ::fidl_next::Decode<___D> for RuntimeError
6477 where
6478 ___D: ?Sized,
6479 {
6480 fn decode(
6481 slot: ::fidl_next::Slot<'_, Self>,
6482 _: &mut ___D,
6483 _: (),
6484 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6485 Ok(())
6486 }
6487 }
6488
6489 impl ::core::convert::From<crate::natural::RuntimeError> for RuntimeError {
6490 fn from(natural: crate::natural::RuntimeError) -> Self {
6491 match natural {
6492 crate::natural::RuntimeError::BatchIteratorFailed => {
6493 RuntimeError::BATCH_ITERATOR_FAILED
6494 }
6495
6496 crate::natural::RuntimeError::UnknownOrdinal_(value) => {
6497 RuntimeError { value: ::fidl_next::wire::Uint32::from(value) }
6498 }
6499 }
6500 }
6501 }
6502
6503 impl ::fidl_next::IntoNatural for RuntimeError {
6504 type Natural = crate::natural::RuntimeError;
6505 }
6506
6507 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6509 #[repr(transparent)]
6510 pub struct SampleStrategy {
6511 pub(crate) value: u8,
6512 }
6513
6514 impl ::fidl_next::Constrained for SampleStrategy {
6515 type Constraint = ();
6516
6517 fn validate(
6518 _: ::fidl_next::Slot<'_, Self>,
6519 _: Self::Constraint,
6520 ) -> Result<(), ::fidl_next::ValidationError> {
6521 Ok(())
6522 }
6523 }
6524
6525 unsafe impl ::fidl_next::Wire for SampleStrategy {
6526 type Narrowed<'de> = Self;
6527
6528 #[inline]
6529 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6530 }
6532 }
6533
6534 impl SampleStrategy {
6535 pub const ON_DIFF: SampleStrategy = SampleStrategy { value: 1 };
6536
6537 pub const ALWAYS: SampleStrategy = SampleStrategy { value: 2 };
6538 }
6539
6540 unsafe impl<___D> ::fidl_next::Decode<___D> for SampleStrategy
6541 where
6542 ___D: ?Sized,
6543 {
6544 fn decode(
6545 slot: ::fidl_next::Slot<'_, Self>,
6546 _: &mut ___D,
6547 _: (),
6548 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6549 Ok(())
6550 }
6551 }
6552
6553 impl ::core::convert::From<crate::natural::SampleStrategy> for SampleStrategy {
6554 fn from(natural: crate::natural::SampleStrategy) -> Self {
6555 match natural {
6556 crate::natural::SampleStrategy::OnDiff => SampleStrategy::ON_DIFF,
6557
6558 crate::natural::SampleStrategy::Always => SampleStrategy::ALWAYS,
6559
6560 crate::natural::SampleStrategy::UnknownOrdinal_(value) => {
6561 SampleStrategy { value: u8::from(value) }
6562 }
6563 }
6564 }
6565 }
6566
6567 impl ::fidl_next::IntoNatural for SampleStrategy {
6568 type Natural = crate::natural::SampleStrategy;
6569 }
6570
6571 #[repr(C)]
6573 pub struct SampleDatum<'de> {
6574 pub(crate) table: ::fidl_next::wire::Table<'de>,
6575 }
6576
6577 impl<'de> Drop for SampleDatum<'de> {
6578 fn drop(&mut self) {
6579 let _ = self.table.get(1).map(|envelope| unsafe {
6580 envelope.read_unchecked::<crate::wire::SelectorArgument<'de>>()
6581 });
6582
6583 let _ = self.table.get(2).map(|envelope| unsafe {
6584 envelope.read_unchecked::<crate::wire::SampleStrategy>()
6585 });
6586
6587 let _ = self
6588 .table
6589 .get(3)
6590 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
6591 }
6592 }
6593
6594 impl ::fidl_next::Constrained for SampleDatum<'_> {
6595 type Constraint = ();
6596
6597 fn validate(
6598 _: ::fidl_next::Slot<'_, Self>,
6599 _: Self::Constraint,
6600 ) -> Result<(), ::fidl_next::ValidationError> {
6601 Ok(())
6602 }
6603 }
6604
6605 unsafe impl ::fidl_next::Wire for SampleDatum<'static> {
6606 type Narrowed<'de> = SampleDatum<'de>;
6607
6608 #[inline]
6609 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6610 ::fidl_next::munge!(let Self { table } = out);
6611 ::fidl_next::wire::Table::zero_padding(table);
6612 }
6613 }
6614
6615 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleDatum<'de>
6616 where
6617 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6618 {
6619 fn decode(
6620 slot: ::fidl_next::Slot<'_, Self>,
6621 decoder: &mut ___D,
6622 _: (),
6623 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6624 ::fidl_next::munge!(let Self { table } = slot);
6625
6626 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6627 match ordinal {
6628 0 => unsafe { ::core::hint::unreachable_unchecked() },
6629
6630 1 => {
6631 ::fidl_next::wire::Envelope::decode_as::<
6632 ___D,
6633 crate::wire::SelectorArgument<'de>,
6634 >(slot.as_mut(), decoder, ())?;
6635
6636 Ok(())
6637 }
6638
6639 2 => {
6640 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::SampleStrategy>(
6641 slot.as_mut(),
6642 decoder,
6643 (),
6644 )?;
6645
6646 Ok(())
6647 }
6648
6649 3 => {
6650 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
6651 slot.as_mut(),
6652 decoder,
6653 (),
6654 )?;
6655
6656 Ok(())
6657 }
6658
6659 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6660 }
6661 })
6662 }
6663 }
6664
6665 impl<'de> SampleDatum<'de> {
6666 pub fn selector(&self) -> ::core::option::Option<&crate::wire::SelectorArgument<'de>> {
6667 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6668 }
6669
6670 pub fn take_selector(
6671 &mut self,
6672 ) -> ::core::option::Option<crate::wire::SelectorArgument<'de>> {
6673 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6674 }
6675
6676 pub fn strategy(&self) -> ::core::option::Option<&crate::wire::SampleStrategy> {
6677 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6678 }
6679
6680 pub fn take_strategy(&mut self) -> ::core::option::Option<crate::wire::SampleStrategy> {
6681 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
6682 }
6683
6684 pub fn interval_secs(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
6685 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6686 }
6687
6688 pub fn take_interval_secs(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
6689 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
6690 }
6691 }
6692
6693 impl<'de> ::core::fmt::Debug for SampleDatum<'de> {
6694 fn fmt(
6695 &self,
6696 f: &mut ::core::fmt::Formatter<'_>,
6697 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6698 f.debug_struct("SampleDatum")
6699 .field("selector", &self.selector())
6700 .field("strategy", &self.strategy())
6701 .field("interval_secs", &self.interval_secs())
6702 .finish()
6703 }
6704 }
6705
6706 impl<'de> ::fidl_next::IntoNatural for SampleDatum<'de> {
6707 type Natural = crate::natural::SampleDatum;
6708 }
6709
6710 #[repr(C)]
6712 pub struct SampleParameters<'de> {
6713 pub(crate) table: ::fidl_next::wire::Table<'de>,
6714 }
6715
6716 impl<'de> Drop for SampleParameters<'de> {
6717 fn drop(&mut self) {
6718 let _ = self.table.get(1)
6719 .map(|envelope| unsafe {
6720 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>()
6721 });
6722 }
6723 }
6724
6725 impl ::fidl_next::Constrained for SampleParameters<'_> {
6726 type Constraint = ();
6727
6728 fn validate(
6729 _: ::fidl_next::Slot<'_, Self>,
6730 _: Self::Constraint,
6731 ) -> Result<(), ::fidl_next::ValidationError> {
6732 Ok(())
6733 }
6734 }
6735
6736 unsafe impl ::fidl_next::Wire for SampleParameters<'static> {
6737 type Narrowed<'de> = SampleParameters<'de>;
6738
6739 #[inline]
6740 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6741 ::fidl_next::munge!(let Self { table } = out);
6742 ::fidl_next::wire::Table::zero_padding(table);
6743 }
6744 }
6745
6746 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleParameters<'de>
6747 where
6748 ___D: ::fidl_next::Decoder<'de> + ?Sized,
6749 {
6750 fn decode(
6751 slot: ::fidl_next::Slot<'_, Self>,
6752 decoder: &mut ___D,
6753 _: (),
6754 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6755 ::fidl_next::munge!(let Self { table } = slot);
6756
6757 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6758 match ordinal {
6759 0 => unsafe { ::core::hint::unreachable_unchecked() },
6760
6761 1 => {
6762 ::fidl_next::wire::Envelope::decode_as::<
6763 ___D,
6764 ::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>,
6765 >(slot.as_mut(), decoder, (100, ()))?;
6766
6767 let value = unsafe {
6768 slot
6769 .deref_unchecked()
6770 .deref_unchecked::<
6771 ::fidl_next::wire::Vector<'_, crate::wire::SampleDatum<'_>>
6772 >()
6773 };
6774
6775 if value.len() > 100 {
6776 return Err(::fidl_next::DecodeError::VectorTooLong {
6777 size: value.len() as u64,
6778 limit: 100,
6779 });
6780 }
6781
6782 Ok(())
6783 }
6784
6785 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
6786 }
6787 })
6788 }
6789 }
6790
6791 impl<'de> SampleParameters<'de> {
6792 pub fn data(
6793 &self,
6794 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>
6795 {
6796 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6797 }
6798
6799 pub fn take_data(
6800 &mut self,
6801 ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::SampleDatum<'de>>>
6802 {
6803 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
6804 }
6805 }
6806
6807 impl<'de> ::core::fmt::Debug for SampleParameters<'de> {
6808 fn fmt(
6809 &self,
6810 f: &mut ::core::fmt::Formatter<'_>,
6811 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6812 f.debug_struct("SampleParameters").field("data", &self.data()).finish()
6813 }
6814 }
6815
6816 impl<'de> ::fidl_next::IntoNatural for SampleParameters<'de> {
6817 type Natural = crate::natural::SampleParameters;
6818 }
6819
6820 pub type SampleCommitResponse = ::fidl_next::wire::Unit;
6822}
6823
6824pub mod wire_optional {
6825
6826 #[repr(transparent)]
6827 pub struct StringSelector<'de> {
6828 pub(crate) raw: ::fidl_next::wire::Union,
6829 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6830 }
6831
6832 impl ::fidl_next::Constrained for StringSelector<'_> {
6833 type Constraint = ();
6834
6835 fn validate(
6836 _: ::fidl_next::Slot<'_, Self>,
6837 _: Self::Constraint,
6838 ) -> Result<(), ::fidl_next::ValidationError> {
6839 Ok(())
6840 }
6841 }
6842
6843 unsafe impl ::fidl_next::Wire for StringSelector<'static> {
6844 type Narrowed<'de> = StringSelector<'de>;
6845
6846 #[inline]
6847 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6848 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6849 ::fidl_next::wire::Union::zero_padding(raw);
6850 }
6851 }
6852
6853 impl<'de> StringSelector<'de> {
6854 pub fn is_some(&self) -> bool {
6855 self.raw.is_some()
6856 }
6857
6858 pub fn is_none(&self) -> bool {
6859 self.raw.is_none()
6860 }
6861
6862 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::StringSelector<'de>> {
6863 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6864 }
6865
6866 pub fn into_option(self) -> ::core::option::Option<crate::wire::StringSelector<'de>> {
6867 if self.is_some() {
6868 Some(crate::wire::StringSelector {
6869 raw: self.raw,
6870 _phantom: ::core::marker::PhantomData,
6871 })
6872 } else {
6873 None
6874 }
6875 }
6876 }
6877
6878 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for StringSelector<'de>
6879 where
6880 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6881 ___D: ::fidl_next::Decoder<'de>,
6882 {
6883 fn decode(
6884 mut slot: ::fidl_next::Slot<'_, Self>,
6885 decoder: &mut ___D,
6886 _: (),
6887 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6888 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6889 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
6890 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
6891 raw, decoder, 1024,
6892 )?,
6893
6894 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
6895 raw, decoder, 1024,
6896 )?,
6897
6898 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
6899 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
6900 }
6901
6902 Ok(())
6903 }
6904 }
6905
6906 impl<'de> ::core::fmt::Debug for StringSelector<'de> {
6907 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6908 self.as_ref().fmt(f)
6909 }
6910 }
6911
6912 impl<'de> ::fidl_next::IntoNatural for StringSelector<'de> {
6913 type Natural = ::core::option::Option<crate::natural::StringSelector>;
6914 }
6915
6916 #[repr(transparent)]
6917 pub struct TreeSelector<'de> {
6918 pub(crate) raw: ::fidl_next::wire::Union,
6919 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6920 }
6921
6922 impl ::fidl_next::Constrained for TreeSelector<'_> {
6923 type Constraint = ();
6924
6925 fn validate(
6926 _: ::fidl_next::Slot<'_, Self>,
6927 _: Self::Constraint,
6928 ) -> Result<(), ::fidl_next::ValidationError> {
6929 Ok(())
6930 }
6931 }
6932
6933 unsafe impl ::fidl_next::Wire for TreeSelector<'static> {
6934 type Narrowed<'de> = TreeSelector<'de>;
6935
6936 #[inline]
6937 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6938 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6939 ::fidl_next::wire::Union::zero_padding(raw);
6940 }
6941 }
6942
6943 impl<'de> TreeSelector<'de> {
6944 pub fn is_some(&self) -> bool {
6945 self.raw.is_some()
6946 }
6947
6948 pub fn is_none(&self) -> bool {
6949 self.raw.is_none()
6950 }
6951
6952 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::TreeSelector<'de>> {
6953 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6954 }
6955
6956 pub fn into_option(self) -> ::core::option::Option<crate::wire::TreeSelector<'de>> {
6957 if self.is_some() {
6958 Some(crate::wire::TreeSelector {
6959 raw: self.raw,
6960 _phantom: ::core::marker::PhantomData,
6961 })
6962 } else {
6963 None
6964 }
6965 }
6966 }
6967
6968 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TreeSelector<'de>
6969 where
6970 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6971 ___D: ::fidl_next::Decoder<'de>,
6972 {
6973 fn decode(
6974 mut slot: ::fidl_next::Slot<'_, Self>,
6975 decoder: &mut ___D,
6976 _: (),
6977 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6978 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6979 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
6980 1 => {
6981 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SubtreeSelector<'de>>(
6982 raw,
6983 decoder,
6984 (),
6985 )?
6986 }
6987
6988 2 => {
6989 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::PropertySelector<'de>>(
6990 raw,
6991 decoder,
6992 (),
6993 )?
6994 }
6995
6996 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
6997 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
6998 }
6999
7000 Ok(())
7001 }
7002 }
7003
7004 impl<'de> ::core::fmt::Debug for TreeSelector<'de> {
7005 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7006 self.as_ref().fmt(f)
7007 }
7008 }
7009
7010 impl<'de> ::fidl_next::IntoNatural for TreeSelector<'de> {
7011 type Natural = ::core::option::Option<crate::natural::TreeSelector>;
7012 }
7013
7014 #[repr(transparent)]
7015 pub struct TreeNames<'de> {
7016 pub(crate) raw: ::fidl_next::wire::Union,
7017 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7018 }
7019
7020 impl ::fidl_next::Constrained for TreeNames<'_> {
7021 type Constraint = ();
7022
7023 fn validate(
7024 _: ::fidl_next::Slot<'_, Self>,
7025 _: Self::Constraint,
7026 ) -> Result<(), ::fidl_next::ValidationError> {
7027 Ok(())
7028 }
7029 }
7030
7031 unsafe impl ::fidl_next::Wire for TreeNames<'static> {
7032 type Narrowed<'de> = TreeNames<'de>;
7033
7034 #[inline]
7035 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7036 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7037 ::fidl_next::wire::Union::zero_padding(raw);
7038 }
7039 }
7040
7041 impl<'de> TreeNames<'de> {
7042 pub fn is_some(&self) -> bool {
7043 self.raw.is_some()
7044 }
7045
7046 pub fn is_none(&self) -> bool {
7047 self.raw.is_none()
7048 }
7049
7050 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::TreeNames<'de>> {
7051 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7052 }
7053
7054 pub fn into_option(self) -> ::core::option::Option<crate::wire::TreeNames<'de>> {
7055 if self.is_some() {
7056 Some(crate::wire::TreeNames {
7057 raw: self.raw,
7058 _phantom: ::core::marker::PhantomData,
7059 })
7060 } else {
7061 None
7062 }
7063 }
7064 }
7065
7066 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for TreeNames<'de>
7067 where
7068 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7069 ___D: ::fidl_next::Decoder<'de>,
7070 {
7071 fn decode(
7072 mut slot: ::fidl_next::Slot<'_, Self>,
7073 decoder: &mut ___D,
7074 _: (),
7075 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7076 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7077 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
7078 1 => ::fidl_next::wire::Union::decode_as::<
7079 ___D,
7080 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
7081 >(raw, decoder, (4294967295, 1024))?,
7082
7083 2 => {
7084 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::All>(raw, decoder, ())?
7085 }
7086
7087 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7088 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7089 }
7090
7091 Ok(())
7092 }
7093 }
7094
7095 impl<'de> ::core::fmt::Debug for TreeNames<'de> {
7096 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7097 self.as_ref().fmt(f)
7098 }
7099 }
7100
7101 impl<'de> ::fidl_next::IntoNatural for TreeNames<'de> {
7102 type Natural = ::core::option::Option<crate::natural::TreeNames>;
7103 }
7104
7105 #[repr(transparent)]
7106 pub struct SelectorArgument<'de> {
7107 pub(crate) raw: ::fidl_next::wire::Union,
7108 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7109 }
7110
7111 impl ::fidl_next::Constrained for SelectorArgument<'_> {
7112 type Constraint = ();
7113
7114 fn validate(
7115 _: ::fidl_next::Slot<'_, Self>,
7116 _: Self::Constraint,
7117 ) -> Result<(), ::fidl_next::ValidationError> {
7118 Ok(())
7119 }
7120 }
7121
7122 unsafe impl ::fidl_next::Wire for SelectorArgument<'static> {
7123 type Narrowed<'de> = SelectorArgument<'de>;
7124
7125 #[inline]
7126 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7127 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7128 ::fidl_next::wire::Union::zero_padding(raw);
7129 }
7130 }
7131
7132 impl<'de> SelectorArgument<'de> {
7133 pub fn is_some(&self) -> bool {
7134 self.raw.is_some()
7135 }
7136
7137 pub fn is_none(&self) -> bool {
7138 self.raw.is_none()
7139 }
7140
7141 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::SelectorArgument<'de>> {
7142 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7143 }
7144
7145 pub fn into_option(self) -> ::core::option::Option<crate::wire::SelectorArgument<'de>> {
7146 if self.is_some() {
7147 Some(crate::wire::SelectorArgument {
7148 raw: self.raw,
7149 _phantom: ::core::marker::PhantomData,
7150 })
7151 } else {
7152 None
7153 }
7154 }
7155 }
7156
7157 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SelectorArgument<'de>
7158 where
7159 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7160 ___D: ::fidl_next::Decoder<'de>,
7161 {
7162 fn decode(
7163 mut slot: ::fidl_next::Slot<'_, Self>,
7164 decoder: &mut ___D,
7165 _: (),
7166 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7167 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7168 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
7169 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Selector<'de>>(
7170 raw,
7171 decoder,
7172 (),
7173 )?,
7174
7175 2 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
7176 raw, decoder, 1024,
7177 )?,
7178
7179 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7180 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7181 }
7182
7183 Ok(())
7184 }
7185 }
7186
7187 impl<'de> ::core::fmt::Debug for SelectorArgument<'de> {
7188 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7189 self.as_ref().fmt(f)
7190 }
7191 }
7192
7193 impl<'de> ::fidl_next::IntoNatural for SelectorArgument<'de> {
7194 type Natural = ::core::option::Option<crate::natural::SelectorArgument>;
7195 }
7196
7197 #[repr(transparent)]
7198 pub struct ClientSelectorConfiguration<'de> {
7199 pub(crate) raw: ::fidl_next::wire::Union,
7200 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7201 }
7202
7203 impl ::fidl_next::Constrained for ClientSelectorConfiguration<'_> {
7204 type Constraint = ();
7205
7206 fn validate(
7207 _: ::fidl_next::Slot<'_, Self>,
7208 _: Self::Constraint,
7209 ) -> Result<(), ::fidl_next::ValidationError> {
7210 Ok(())
7211 }
7212 }
7213
7214 unsafe impl ::fidl_next::Wire for ClientSelectorConfiguration<'static> {
7215 type Narrowed<'de> = ClientSelectorConfiguration<'de>;
7216
7217 #[inline]
7218 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7219 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7220 ::fidl_next::wire::Union::zero_padding(raw);
7221 }
7222 }
7223
7224 impl<'de> ClientSelectorConfiguration<'de> {
7225 pub fn is_some(&self) -> bool {
7226 self.raw.is_some()
7227 }
7228
7229 pub fn is_none(&self) -> bool {
7230 self.raw.is_none()
7231 }
7232
7233 pub fn as_ref(
7234 &self,
7235 ) -> ::core::option::Option<&crate::wire::ClientSelectorConfiguration<'de>> {
7236 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7237 }
7238
7239 pub fn into_option(
7240 self,
7241 ) -> ::core::option::Option<crate::wire::ClientSelectorConfiguration<'de>> {
7242 if self.is_some() {
7243 Some(crate::wire::ClientSelectorConfiguration {
7244 raw: self.raw,
7245 _phantom: ::core::marker::PhantomData,
7246 })
7247 } else {
7248 None
7249 }
7250 }
7251 }
7252
7253 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ClientSelectorConfiguration<'de>
7254 where
7255 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7256 ___D: ::fidl_next::Decoder<'de>,
7257 {
7258 fn decode(
7259 mut slot: ::fidl_next::Slot<'_, Self>,
7260 decoder: &mut ___D,
7261 _: (),
7262 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7263 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7264 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
7265 1 => ::fidl_next::wire::Union::decode_as::<
7266 ___D,
7267 ::fidl_next::wire::Vector<'de, crate::wire::SelectorArgument<'de>>,
7268 >(raw, decoder, (4294967295, ()))?,
7269
7270 2 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
7271
7272 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
7273 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
7274 }
7275
7276 Ok(())
7277 }
7278 }
7279
7280 impl<'de> ::core::fmt::Debug for ClientSelectorConfiguration<'de> {
7281 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7282 self.as_ref().fmt(f)
7283 }
7284 }
7285
7286 impl<'de> ::fidl_next::IntoNatural for ClientSelectorConfiguration<'de> {
7287 type Natural = ::core::option::Option<crate::natural::ClientSelectorConfiguration>;
7288 }
7289}
7290
7291pub mod generic {
7292
7293 pub type All = ();
7295
7296 pub struct SubtreeSelector<T0> {
7298 pub node_path: T0,
7299 }
7300
7301 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SubtreeSelector<'static>, ___E>
7302 for SubtreeSelector<T0>
7303 where
7304 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7305 ___E: ::fidl_next::Encoder,
7306 T0: ::fidl_next::Encode<
7307 ::fidl_next::wire::Vector<'static, crate::wire::StringSelector<'static>>,
7308 ___E,
7309 >,
7310 {
7311 #[inline]
7312 fn encode(
7313 self,
7314 encoder_: &mut ___E,
7315 out_: &mut ::core::mem::MaybeUninit<crate::wire::SubtreeSelector<'static>>,
7316 _: (),
7317 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7318 ::fidl_next::munge! {
7319 let crate::wire::SubtreeSelector {
7320 node_path,
7321
7322 } = out_;
7323 }
7324
7325 ::fidl_next::Encode::encode(self.node_path, encoder_, node_path, (100, ()))?;
7326
7327 Ok(())
7328 }
7329 }
7330
7331 pub struct PropertySelector<T0, T1> {
7333 pub node_path: T0,
7334
7335 pub target_properties: T1,
7336 }
7337
7338 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::PropertySelector<'static>, ___E>
7339 for PropertySelector<T0, T1>
7340 where
7341 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7342 ___E: ::fidl_next::Encoder,
7343 T0: ::fidl_next::Encode<
7344 ::fidl_next::wire::Vector<'static, crate::wire::StringSelector<'static>>,
7345 ___E,
7346 >,
7347 T1: ::fidl_next::Encode<crate::wire::StringSelector<'static>, ___E>,
7348 {
7349 #[inline]
7350 fn encode(
7351 self,
7352 encoder_: &mut ___E,
7353 out_: &mut ::core::mem::MaybeUninit<crate::wire::PropertySelector<'static>>,
7354 _: (),
7355 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7356 ::fidl_next::munge! {
7357 let crate::wire::PropertySelector {
7358 node_path,
7359 target_properties,
7360
7361 } = out_;
7362 }
7363
7364 ::fidl_next::Encode::encode(self.node_path, encoder_, node_path, (100, ()))?;
7365
7366 ::fidl_next::Encode::encode(self.target_properties, encoder_, target_properties, ())?;
7367
7368 Ok(())
7369 }
7370 }
7371
7372 pub type ArchiveAccessorWaitForReadyResponse = ();
7374
7375 pub type BatchIteratorWaitForReadyResponse = ();
7377
7378 pub type LogFlusherWaitUntilFlushedResponse = ();
7380
7381 pub struct LogInterestSelector<T0, T1> {
7383 pub selector: T0,
7384
7385 pub interest: T1,
7386 }
7387
7388 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LogInterestSelector<'static>, ___E>
7389 for LogInterestSelector<T0, T1>
7390 where
7391 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7392 ___E: ::fidl_next::Encoder,
7393 T0: ::fidl_next::Encode<crate::wire::ComponentSelector<'static>, ___E>,
7394 T1: ::fidl_next::Encode<
7395 ::fidl_next_common_fuchsia_diagnostics_types::wire::Interest<'static>,
7396 ___E,
7397 >,
7398 {
7399 #[inline]
7400 fn encode(
7401 self,
7402 encoder_: &mut ___E,
7403 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogInterestSelector<'static>>,
7404 _: (),
7405 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7406 ::fidl_next::munge! {
7407 let crate::wire::LogInterestSelector {
7408 selector,
7409 interest,
7410
7411 } = out_;
7412 }
7413
7414 ::fidl_next::Encode::encode(self.selector, encoder_, selector, ())?;
7415
7416 ::fidl_next::Encode::encode(self.interest, encoder_, interest, ())?;
7417
7418 Ok(())
7419 }
7420 }
7421
7422 pub type SampleCommitResponse = ();
7424}
7425
7426pub use self::natural::*;
7427
7428pub const MAX_MONIKER_SEGMENTS: u16 = 25 as u16;
7429
7430pub const MAX_DATA_HIERARCHY_DEPTH: u16 = 100 as u16;
7431
7432#[doc = " The size bound of 1024 is a reasonably low size restriction that meets most\n canonical selectors we\'ve ecountered.\n"]
7433pub const MAXIMUM_RAW_SELECTOR_LENGTH: u16 = 1024 as u16;
7434
7435pub const MAX_STRING_SELECTOR_LENGTH: u16 = 1024 as u16;
7436
7437#[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"]
7438pub const MAXIMUM_ENTRIES_PER_BATCH: u16 = 64 as u16;
7439
7440pub const COMPONENT_URL_ARG_NAME: &str = "$__url";
7441
7442#[derive(PartialEq, Debug)]
7444pub struct LogFlusher;
7445
7446impl ::fidl_next::Discoverable for LogFlusher {
7447 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.LogFlusher";
7448}
7449
7450#[cfg(target_os = "fuchsia")]
7451impl ::fidl_next::HasTransport for LogFlusher {
7452 type Transport = ::fidl_next::fuchsia::zx::Channel;
7453}
7454
7455pub mod log_flusher {
7456 pub mod prelude {
7457 pub use crate::{
7458 LogFlusher, LogFlusherClientHandler, LogFlusherLocalClientHandler,
7459 LogFlusherLocalServerHandler, LogFlusherServerHandler, log_flusher,
7460 };
7461
7462 pub use crate::natural::LogFlusherWaitUntilFlushedResponse;
7463 }
7464
7465 pub struct WaitUntilFlushed;
7466
7467 impl ::fidl_next::Method for WaitUntilFlushed {
7468 const ORDINAL: u64 = 9062519182019824475;
7469 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7470 ::fidl_next::protocol::Flexibility::Flexible;
7471
7472 type Protocol = crate::LogFlusher;
7473
7474 type Request = ::fidl_next::wire::EmptyMessageBody;
7475 }
7476
7477 impl ::fidl_next::TwoWayMethod for WaitUntilFlushed {
7478 type Response =
7479 ::fidl_next::wire::Flexible<'static, crate::wire::LogFlusherWaitUntilFlushedResponse>;
7480 }
7481
7482 impl<___R> ::fidl_next::Respond<___R> for WaitUntilFlushed {
7483 type Output = ::fidl_next::Flexible<___R>;
7484
7485 fn respond(response: ___R) -> Self::Output {
7486 ::fidl_next::Flexible(response)
7487 }
7488 }
7489
7490 mod ___detail {
7491 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogFlusher
7492 where
7493 ___T: ::fidl_next::Transport,
7494 {
7495 type Client = LogFlusherClient<___T>;
7496 type Server = LogFlusherServer<___T>;
7497 }
7498
7499 #[repr(transparent)]
7501 pub struct LogFlusherClient<___T: ::fidl_next::Transport> {
7502 #[allow(dead_code)]
7503 client: ::fidl_next::protocol::Client<___T>,
7504 }
7505
7506 impl<___T> LogFlusherClient<___T>
7507 where
7508 ___T: ::fidl_next::Transport,
7509 {
7510 #[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"]
7511 pub fn wait_until_flushed(
7512 &self,
7513 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitUntilFlushed, ___T> {
7514 ::fidl_next::TwoWayFuture::from_untyped(
7515 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
7516 9062519182019824475,
7517 <super::WaitUntilFlushed as ::fidl_next::Method>::FLEXIBILITY,
7518 (),
7519 ),
7520 )
7521 }
7522 }
7523
7524 #[repr(transparent)]
7526 pub struct LogFlusherServer<___T: ::fidl_next::Transport> {
7527 server: ::fidl_next::protocol::Server<___T>,
7528 }
7529
7530 impl<___T> LogFlusherServer<___T> where ___T: ::fidl_next::Transport {}
7531 }
7532}
7533
7534#[diagnostic::on_unimplemented(
7535 note = "If {Self} implements the non-local LogFlusherClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7536)]
7537
7538pub trait LogFlusherLocalClientHandler<
7542 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7543 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7544>
7545{
7546 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
7547 ::core::future::ready(())
7548 }
7549}
7550
7551impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogFlusher
7552where
7553 ___H: LogFlusherLocalClientHandler<___T>,
7554 ___T: ::fidl_next::Transport,
7555{
7556 async fn on_event(
7557 handler: &mut ___H,
7558 mut message: ::fidl_next::Message<___T>,
7559 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7560 match *message.header().ordinal {
7561 ordinal => {
7562 handler.on_unknown_interaction(ordinal).await;
7563 if ::core::matches!(
7564 message.header().flexibility(),
7565 ::fidl_next::protocol::Flexibility::Strict
7566 ) {
7567 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7568 } else {
7569 Ok(())
7570 }
7571 }
7572 }
7573 }
7574}
7575
7576#[diagnostic::on_unimplemented(
7577 note = "If {Self} implements the non-local LogFlusherServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7578)]
7579
7580pub trait LogFlusherLocalServerHandler<
7584 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7585 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7586>
7587{
7588 #[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"]
7589 fn wait_until_flushed(
7590 &mut self,
7591
7592 responder: ::fidl_next::Responder<log_flusher::WaitUntilFlushed, ___T>,
7593 ) -> impl ::core::future::Future<Output = ()>;
7594
7595 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
7596 ::core::future::ready(())
7597 }
7598}
7599
7600impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogFlusher
7601where
7602 ___H: LogFlusherLocalServerHandler<___T>,
7603 ___T: ::fidl_next::Transport,
7604{
7605 async fn on_one_way(
7606 handler: &mut ___H,
7607 mut message: ::fidl_next::Message<___T>,
7608 ) -> ::core::result::Result<
7609 (),
7610 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7611 > {
7612 match *message.header().ordinal {
7613 ordinal => {
7614 handler.on_unknown_interaction(ordinal).await;
7615 if ::core::matches!(
7616 message.header().flexibility(),
7617 ::fidl_next::protocol::Flexibility::Strict
7618 ) {
7619 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7620 } else {
7621 Ok(())
7622 }
7623 }
7624 }
7625 }
7626
7627 async fn on_two_way(
7628 handler: &mut ___H,
7629 mut message: ::fidl_next::Message<___T>,
7630 responder: ::fidl_next::protocol::Responder<___T>,
7631 ) -> ::core::result::Result<
7632 (),
7633 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7634 > {
7635 match *message.header().ordinal {
7636 9062519182019824475 => {
7637 let responder = ::fidl_next::Responder::from_untyped(responder);
7638
7639 handler.wait_until_flushed(responder).await;
7640 Ok(())
7641 }
7642
7643 ordinal => {
7644 handler.on_unknown_interaction(ordinal).await;
7645 if ::core::matches!(
7646 message.header().flexibility(),
7647 ::fidl_next::protocol::Flexibility::Strict
7648 ) {
7649 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7650 } else {
7651 responder
7652 .respond_framework_error(
7653 ordinal,
7654 ::fidl_next::FrameworkError::UnknownMethod,
7655 )
7656 .expect("encoding a framework error should never fail")
7657 .await?;
7658 Ok(())
7659 }
7660 }
7661 }
7662 }
7663}
7664
7665pub trait LogFlusherClientHandler<
7669 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7670 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7671>
7672{
7673 fn on_unknown_interaction(
7674 &mut self,
7675 ordinal: u64,
7676 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
7677 ::core::future::ready(())
7678 }
7679}
7680
7681impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogFlusher
7682where
7683 ___H: LogFlusherClientHandler<___T> + ::core::marker::Send,
7684 ___T: ::fidl_next::Transport,
7685{
7686 async fn on_event(
7687 handler: &mut ___H,
7688 mut message: ::fidl_next::Message<___T>,
7689 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7690 match *message.header().ordinal {
7691 ordinal => {
7692 handler.on_unknown_interaction(ordinal).await;
7693 if ::core::matches!(
7694 message.header().flexibility(),
7695 ::fidl_next::protocol::Flexibility::Strict
7696 ) {
7697 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7698 } else {
7699 Ok(())
7700 }
7701 }
7702 }
7703 }
7704}
7705
7706pub trait LogFlusherServerHandler<
7710 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7711 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7712>
7713{
7714 #[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"]
7715 fn wait_until_flushed(
7716 &mut self,
7717
7718 responder: ::fidl_next::Responder<log_flusher::WaitUntilFlushed, ___T>,
7719 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
7720
7721 fn on_unknown_interaction(
7722 &mut self,
7723 ordinal: u64,
7724 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
7725 ::core::future::ready(())
7726 }
7727}
7728
7729impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogFlusher
7730where
7731 ___H: LogFlusherServerHandler<___T> + ::core::marker::Send,
7732 ___T: ::fidl_next::Transport,
7733{
7734 async fn on_one_way(
7735 handler: &mut ___H,
7736 mut message: ::fidl_next::Message<___T>,
7737 ) -> ::core::result::Result<
7738 (),
7739 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7740 > {
7741 match *message.header().ordinal {
7742 ordinal => {
7743 handler.on_unknown_interaction(ordinal).await;
7744 if ::core::matches!(
7745 message.header().flexibility(),
7746 ::fidl_next::protocol::Flexibility::Strict
7747 ) {
7748 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7749 } else {
7750 Ok(())
7751 }
7752 }
7753 }
7754 }
7755
7756 async fn on_two_way(
7757 handler: &mut ___H,
7758 mut message: ::fidl_next::Message<___T>,
7759 responder: ::fidl_next::protocol::Responder<___T>,
7760 ) -> ::core::result::Result<
7761 (),
7762 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7763 > {
7764 match *message.header().ordinal {
7765 9062519182019824475 => {
7766 let responder = ::fidl_next::Responder::from_untyped(responder);
7767
7768 handler.wait_until_flushed(responder).await;
7769 Ok(())
7770 }
7771
7772 ordinal => {
7773 handler.on_unknown_interaction(ordinal).await;
7774 if ::core::matches!(
7775 message.header().flexibility(),
7776 ::fidl_next::protocol::Flexibility::Strict
7777 ) {
7778 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
7779 } else {
7780 responder
7781 .respond_framework_error(
7782 ordinal,
7783 ::fidl_next::FrameworkError::UnknownMethod,
7784 )
7785 .expect("encoding a framework error should never fail")
7786 .await?;
7787 Ok(())
7788 }
7789 }
7790 }
7791 }
7792}
7793
7794impl<___T> LogFlusherClientHandler<___T> for ::fidl_next::IgnoreEvents
7795where
7796 ___T: ::fidl_next::Transport,
7797{
7798 async fn on_unknown_interaction(&mut self, _: u64) {}
7799}
7800
7801impl<___H, ___T> LogFlusherLocalClientHandler<___T> for ::fidl_next::Local<___H>
7802where
7803 ___H: LogFlusherClientHandler<___T>,
7804 ___T: ::fidl_next::Transport,
7805{
7806 async fn on_unknown_interaction(&mut self, ordinal: u64) {
7807 ___H::on_unknown_interaction(&mut self.0, ordinal).await
7808 }
7809}
7810
7811impl<___H, ___T> LogFlusherLocalServerHandler<___T> for ::fidl_next::Local<___H>
7812where
7813 ___H: LogFlusherServerHandler<___T>,
7814 ___T: ::fidl_next::Transport,
7815{
7816 async fn wait_until_flushed(
7817 &mut self,
7818
7819 responder: ::fidl_next::Responder<log_flusher::WaitUntilFlushed, ___T>,
7820 ) {
7821 ___H::wait_until_flushed(&mut self.0, responder).await
7822 }
7823
7824 async fn on_unknown_interaction(&mut self, ordinal: u64) {
7825 ___H::on_unknown_interaction(&mut self.0, ordinal).await
7826 }
7827}
7828
7829#[doc = " Max number of LogInterestSelectors that can be specified via a listener.\n"]
7830pub const MAX_LOG_SELECTORS: u8 = 64 as u8;
7831
7832#[doc = " This protocol allows clients to modify the logging behavior of components\n in the system.\n"]
7834#[derive(PartialEq, Debug)]
7835pub struct LogSettings;
7836
7837impl ::fidl_next::Discoverable for LogSettings {
7838 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.LogSettings";
7839}
7840
7841#[cfg(target_os = "fuchsia")]
7842impl ::fidl_next::HasTransport for LogSettings {
7843 type Transport = ::fidl_next::fuchsia::zx::Channel;
7844}
7845
7846pub mod log_settings {
7847 pub mod prelude {
7848 pub use crate::{
7849 LogSettings, LogSettingsClientHandler, LogSettingsLocalClientHandler,
7850 LogSettingsLocalServerHandler, LogSettingsServerHandler, log_settings,
7851 };
7852
7853 pub use crate::natural::LogSettingsSetComponentInterestRequest;
7854 }
7855
7856 pub struct SetComponentInterest;
7857
7858 impl ::fidl_next::Method for SetComponentInterest {
7859 const ORDINAL: u64 = 3888577134564210369;
7860 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
7861 ::fidl_next::protocol::Flexibility::Strict;
7862
7863 type Protocol = crate::LogSettings;
7864
7865 type Request = crate::wire::LogSettingsSetComponentInterestRequest<'static>;
7866 }
7867
7868 impl ::fidl_next::TwoWayMethod for SetComponentInterest {
7869 type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
7870 }
7871
7872 impl<___R> ::fidl_next::Respond<___R> for SetComponentInterest {
7873 type Output = ::fidl_next::Strict<___R>;
7874
7875 fn respond(response: ___R) -> Self::Output {
7876 ::fidl_next::Strict(response)
7877 }
7878 }
7879
7880 mod ___detail {
7881 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogSettings
7882 where
7883 ___T: ::fidl_next::Transport,
7884 {
7885 type Client = LogSettingsClient<___T>;
7886 type Server = LogSettingsServer<___T>;
7887 }
7888
7889 #[repr(transparent)]
7891 pub struct LogSettingsClient<___T: ::fidl_next::Transport> {
7892 #[allow(dead_code)]
7893 client: ::fidl_next::protocol::Client<___T>,
7894 }
7895
7896 impl<___T> LogSettingsClient<___T>
7897 where
7898 ___T: ::fidl_next::Transport,
7899 {
7900 #[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"]
7901 pub fn set_component_interest_with<___R>(
7902 &self,
7903 request: ___R,
7904 ) -> ::fidl_next::TwoWayFuture<'_, super::SetComponentInterest, ___T>
7905 where
7906 ___R: ::fidl_next::Encode<
7907 crate::wire::LogSettingsSetComponentInterestRequest<'static>,
7908 <___T as ::fidl_next::Transport>::SendBuffer,
7909 >,
7910 {
7911 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
7912 3888577134564210369,
7913 <super::SetComponentInterest as ::fidl_next::Method>::FLEXIBILITY,
7914 request,
7915 ))
7916 }
7917 }
7918
7919 #[repr(transparent)]
7921 pub struct LogSettingsServer<___T: ::fidl_next::Transport> {
7922 server: ::fidl_next::protocol::Server<___T>,
7923 }
7924
7925 impl<___T> LogSettingsServer<___T> where ___T: ::fidl_next::Transport {}
7926 }
7927}
7928
7929#[diagnostic::on_unimplemented(
7930 note = "If {Self} implements the non-local LogSettingsClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
7931)]
7932
7933pub trait LogSettingsLocalClientHandler<
7937 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7938 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7939>
7940{
7941}
7942
7943impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogSettings
7944where
7945 ___H: LogSettingsLocalClientHandler<___T>,
7946 ___T: ::fidl_next::Transport,
7947{
7948 async fn on_event(
7949 handler: &mut ___H,
7950 mut message: ::fidl_next::Message<___T>,
7951 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
7952 match *message.header().ordinal {
7953 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7954 }
7955 }
7956}
7957
7958#[diagnostic::on_unimplemented(
7959 note = "If {Self} implements the non-local LogSettingsServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
7960)]
7961
7962pub trait LogSettingsLocalServerHandler<
7966 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
7967 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
7968>
7969{
7970 #[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"]
7971 fn set_component_interest(
7972 &mut self,
7973
7974 request: ::fidl_next::Request<log_settings::SetComponentInterest, ___T>,
7975
7976 responder: ::fidl_next::Responder<log_settings::SetComponentInterest, ___T>,
7977 ) -> impl ::core::future::Future<Output = ()>;
7978}
7979
7980impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogSettings
7981where
7982 ___H: LogSettingsLocalServerHandler<___T>,
7983 ___T: ::fidl_next::Transport,
7984 for<'de> crate::wire::LogSettingsSetComponentInterestRequest<'de>: ::fidl_next::Decode<
7985 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
7986 Constraint = (),
7987 >,
7988{
7989 async fn on_one_way(
7990 handler: &mut ___H,
7991 mut message: ::fidl_next::Message<___T>,
7992 ) -> ::core::result::Result<
7993 (),
7994 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
7995 > {
7996 match *message.header().ordinal {
7997 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
7998 }
7999 }
8000
8001 async fn on_two_way(
8002 handler: &mut ___H,
8003 mut message: ::fidl_next::Message<___T>,
8004 responder: ::fidl_next::protocol::Responder<___T>,
8005 ) -> ::core::result::Result<
8006 (),
8007 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8008 > {
8009 match *message.header().ordinal {
8010 3888577134564210369 => {
8011 let responder = ::fidl_next::Responder::from_untyped(responder);
8012
8013 match ::fidl_next::AsDecoderExt::into_decoded(message) {
8014 Ok(decoded) => {
8015 handler
8016 .set_component_interest(
8017 ::fidl_next::Request::from_decoded(decoded),
8018 responder,
8019 )
8020 .await;
8021 Ok(())
8022 }
8023 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
8024 ordinal: 3888577134564210369,
8025 error,
8026 }),
8027 }
8028 }
8029
8030 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8031 }
8032 }
8033}
8034
8035pub trait LogSettingsClientHandler<
8039 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
8040 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
8041>
8042{
8043}
8044
8045impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogSettings
8046where
8047 ___H: LogSettingsClientHandler<___T> + ::core::marker::Send,
8048 ___T: ::fidl_next::Transport,
8049{
8050 async fn on_event(
8051 handler: &mut ___H,
8052 mut message: ::fidl_next::Message<___T>,
8053 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
8054 match *message.header().ordinal {
8055 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8056 }
8057 }
8058}
8059
8060pub trait LogSettingsServerHandler<
8064 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
8065 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
8066>
8067{
8068 #[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"]
8069 fn set_component_interest(
8070 &mut self,
8071
8072 request: ::fidl_next::Request<log_settings::SetComponentInterest, ___T>,
8073
8074 responder: ::fidl_next::Responder<log_settings::SetComponentInterest, ___T>,
8075 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
8076}
8077
8078impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogSettings
8079where
8080 ___H: LogSettingsServerHandler<___T> + ::core::marker::Send,
8081 ___T: ::fidl_next::Transport,
8082 for<'de> crate::wire::LogSettingsSetComponentInterestRequest<'de>: ::fidl_next::Decode<
8083 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
8084 Constraint = (),
8085 >,
8086{
8087 async fn on_one_way(
8088 handler: &mut ___H,
8089 mut message: ::fidl_next::Message<___T>,
8090 ) -> ::core::result::Result<
8091 (),
8092 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8093 > {
8094 match *message.header().ordinal {
8095 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8096 }
8097 }
8098
8099 async fn on_two_way(
8100 handler: &mut ___H,
8101 mut message: ::fidl_next::Message<___T>,
8102 responder: ::fidl_next::protocol::Responder<___T>,
8103 ) -> ::core::result::Result<
8104 (),
8105 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
8106 > {
8107 match *message.header().ordinal {
8108 3888577134564210369 => {
8109 let responder = ::fidl_next::Responder::from_untyped(responder);
8110
8111 match ::fidl_next::AsDecoderExt::into_decoded(message) {
8112 Ok(decoded) => {
8113 handler
8114 .set_component_interest(
8115 ::fidl_next::Request::from_decoded(decoded),
8116 responder,
8117 )
8118 .await;
8119 Ok(())
8120 }
8121 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
8122 ordinal: 3888577134564210369,
8123 error,
8124 }),
8125 }
8126 }
8127
8128 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
8129 }
8130 }
8131}
8132
8133impl<___T> LogSettingsClientHandler<___T> for ::fidl_next::IgnoreEvents where
8134 ___T: ::fidl_next::Transport
8135{
8136}
8137
8138impl<___H, ___T> LogSettingsLocalClientHandler<___T> for ::fidl_next::Local<___H>
8139where
8140 ___H: LogSettingsClientHandler<___T>,
8141 ___T: ::fidl_next::Transport,
8142{
8143}
8144
8145impl<___H, ___T> LogSettingsLocalServerHandler<___T> for ::fidl_next::Local<___H>
8146where
8147 ___H: LogSettingsServerHandler<___T>,
8148 ___T: ::fidl_next::Transport,
8149{
8150 async fn set_component_interest(
8151 &mut self,
8152
8153 request: ::fidl_next::Request<log_settings::SetComponentInterest, ___T>,
8154
8155 responder: ::fidl_next::Responder<log_settings::SetComponentInterest, ___T>,
8156 ) {
8157 ___H::set_component_interest(&mut self.0, request, responder).await
8158 }
8159}
8160
8161#[doc = " The maximum number of parameters that can be sent in one `Set` call.\n"]
8162pub const MAX_SAMPLE_PARAMETERS_PER_SET: u64 = 100 as u64;
8163
8164pub const MONIKER_ARG_NAME: &str = "$__moniker";
8165
8166pub const ROLLED_OUT_ARG_NAME: &str = "$__rolled_out";