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