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