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