1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_diagnostics::natural::*;
8
9 #[derive(Debug, PartialEq)]
10 pub struct ArchiveAccessorStreamDiagnosticsRequest {
11 pub stream_parameters: crate::natural::StreamParameters,
12
13 pub result_stream:
14 ::fidl_next::ServerEnd<crate::BatchIterator, ::fidl_next::fuchsia::zx::Channel>,
15 }
16
17 unsafe impl<___E>
18 ::fidl_next::Encode<crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>, ___E>
19 for ArchiveAccessorStreamDiagnosticsRequest
20 where
21 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22 ___E: ::fidl_next::Encoder,
23 ___E: ::fidl_next::fuchsia::HandleEncoder,
24 {
25 #[inline]
26 fn encode(
27 self,
28 encoder_: &mut ___E,
29 out_: &mut ::core::mem::MaybeUninit<
30 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
31 >,
32 _: (),
33 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
34 ::fidl_next::munge! {
35 let crate::wire::ArchiveAccessorStreamDiagnosticsRequest {
36 stream_parameters,
37 result_stream,
38
39 } = out_;
40 }
41
42 ::fidl_next::Encode::encode(self.stream_parameters, encoder_, stream_parameters, ())?;
43
44 let mut _field =
45 unsafe { ::fidl_next::Slot::new_unchecked(stream_parameters.as_mut_ptr()) };
46
47 ::fidl_next::Encode::encode(self.result_stream, encoder_, result_stream, ())?;
48
49 let mut _field =
50 unsafe { ::fidl_next::Slot::new_unchecked(result_stream.as_mut_ptr()) };
51
52 Ok(())
53 }
54 }
55
56 unsafe impl<___E>
57 ::fidl_next::EncodeOption<
58 ::fidl_next::wire::Box<
59 'static,
60 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
61 >,
62 ___E,
63 > for ArchiveAccessorStreamDiagnosticsRequest
64 where
65 ___E: ::fidl_next::Encoder + ?Sized,
66 ArchiveAccessorStreamDiagnosticsRequest: ::fidl_next::Encode<crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>, ___E>,
67 {
68 #[inline]
69 fn encode_option(
70 this: ::core::option::Option<Self>,
71 encoder: &mut ___E,
72 out: &mut ::core::mem::MaybeUninit<
73 ::fidl_next::wire::Box<
74 'static,
75 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
76 >,
77 >,
78 _: (),
79 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
80 if let Some(inner) = this {
81 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
82 ::fidl_next::wire::Box::encode_present(out);
83 } else {
84 ::fidl_next::wire::Box::encode_absent(out);
85 }
86
87 Ok(())
88 }
89 }
90
91 impl<'de> ::fidl_next::FromWire<crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'de>>
92 for ArchiveAccessorStreamDiagnosticsRequest
93 {
94 #[inline]
95 fn from_wire(wire: crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'de>) -> Self {
96 Self {
97 stream_parameters: ::fidl_next::FromWire::from_wire(wire.stream_parameters),
98
99 result_stream: ::fidl_next::FromWire::from_wire(wire.result_stream),
100 }
101 }
102 }
103
104 #[doc = " A fidl union containing a complete hierarchy of structured diagnostics\n data, such that the content can be parsed into a file by itself.\n"]
105 #[derive(Debug, PartialEq)]
106 pub enum FormattedContent {
107 Json(::fidl_next_fuchsia_mem::natural::Buffer),
108
109 Cbor(::fidl_next::fuchsia::zx::Vmo),
110
111 Fxt(::fidl_next::fuchsia::zx::Vmo),
112
113 UnknownOrdinal_(u64),
114 }
115
116 impl FormattedContent {
117 pub fn is_unknown(&self) -> bool {
118 #[allow(unreachable_patterns)]
119 match self {
120 Self::UnknownOrdinal_(_) => true,
121 _ => false,
122 }
123 }
124 }
125
126 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FormattedContent<'static>, ___E>
127 for FormattedContent
128 where
129 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
130 ___E: ::fidl_next::Encoder,
131 ___E: ::fidl_next::fuchsia::HandleEncoder,
132 {
133 #[inline]
134 fn encode(
135 self,
136 encoder: &mut ___E,
137 out: &mut ::core::mem::MaybeUninit<crate::wire::FormattedContent<'static>>,
138 _: (),
139 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
140 ::fidl_next::munge!(let crate::wire::FormattedContent { raw, _phantom: _ } = out);
141
142 match self {
143 Self::Json(value) => ::fidl_next::wire::Union::encode_as::<
144 ___E,
145 ::fidl_next_fuchsia_mem::wire::Buffer,
146 >(value, 1, encoder, raw, ())?,
147
148 Self::Cbor(value) => ::fidl_next::wire::Union::encode_as::<
149 ___E,
150 ::fidl_next::wire::fuchsia::Vmo,
151 >(value, 3, encoder, raw, ())?,
152
153 Self::Fxt(value) => ::fidl_next::wire::Union::encode_as::<
154 ___E,
155 ::fidl_next::wire::fuchsia::Vmo,
156 >(value, 4, encoder, raw, ())?,
157
158 Self::UnknownOrdinal_(ordinal) => {
159 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
160 }
161 }
162
163 Ok(())
164 }
165 }
166
167 unsafe impl<___E>
168 ::fidl_next::EncodeOption<crate::wire_optional::FormattedContent<'static>, ___E>
169 for FormattedContent
170 where
171 ___E: ?Sized,
172 FormattedContent: ::fidl_next::Encode<crate::wire::FormattedContent<'static>, ___E>,
173 {
174 #[inline]
175 fn encode_option(
176 this: ::core::option::Option<Self>,
177 encoder: &mut ___E,
178 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::FormattedContent<'static>>,
179 _: (),
180 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
181 ::fidl_next::munge!(let crate::wire_optional::FormattedContent { raw, _phantom: _ } = &mut *out);
182
183 if let Some(inner) = this {
184 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
185 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
186 } else {
187 ::fidl_next::wire::Union::encode_absent(raw);
188 }
189
190 Ok(())
191 }
192 }
193
194 impl<'de> ::fidl_next::FromWire<crate::wire::FormattedContent<'de>> for FormattedContent {
195 #[inline]
196 fn from_wire(wire: crate::wire::FormattedContent<'de>) -> Self {
197 let wire = ::core::mem::ManuallyDrop::new(wire);
198 match wire.raw.ordinal() {
199 1 => Self::Json(::fidl_next::FromWire::from_wire(unsafe {
200 wire.raw.get().read_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>()
201 })),
202
203 3 => Self::Cbor(::fidl_next::FromWire::from_wire(unsafe {
204 wire.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
205 })),
206
207 4 => Self::Fxt(::fidl_next::FromWire::from_wire(unsafe {
208 wire.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
209 })),
210
211 ord => return Self::UnknownOrdinal_(ord as u64),
212 }
213 }
214 }
215
216 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::FormattedContent<'de>>
217 for FormattedContent
218 {
219 #[inline]
220 fn from_wire_option(
221 wire: crate::wire_optional::FormattedContent<'de>,
222 ) -> ::core::option::Option<Self> {
223 if let Some(inner) = wire.into_option() {
224 Some(::fidl_next::FromWire::from_wire(inner))
225 } else {
226 None
227 }
228 }
229 }
230
231 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::FormattedContent<'de>>
232 for Box<FormattedContent>
233 {
234 #[inline]
235 fn from_wire_option(
236 wire: crate::wire_optional::FormattedContent<'de>,
237 ) -> ::core::option::Option<Self> {
238 <FormattedContent as ::fidl_next::FromWireOption<
239 crate::wire_optional::FormattedContent<'de>,
240 >>::from_wire_option(wire)
241 .map(Box::new)
242 }
243 }
244
245 #[derive(Debug, PartialEq)]
246 pub struct BatchIteratorGetNextResponse {
247 pub batch: ::std::vec::Vec<crate::natural::FormattedContent>,
248 }
249
250 unsafe impl<___E> ::fidl_next::Encode<crate::wire::BatchIteratorGetNextResponse<'static>, ___E>
251 for BatchIteratorGetNextResponse
252 where
253 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
254 ___E: ::fidl_next::Encoder,
255 ___E: ::fidl_next::fuchsia::HandleEncoder,
256 {
257 #[inline]
258 fn encode(
259 self,
260 encoder_: &mut ___E,
261 out_: &mut ::core::mem::MaybeUninit<crate::wire::BatchIteratorGetNextResponse<'static>>,
262 _: (),
263 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
264 ::fidl_next::munge! {
265 let crate::wire::BatchIteratorGetNextResponse {
266 batch,
267
268 } = out_;
269 }
270
271 ::fidl_next::Encode::encode(self.batch, encoder_, batch, (64, ()))?;
272
273 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(batch.as_mut_ptr()) };
274 ::fidl_next::Constrained::validate(_field, (64, ()))?;
275
276 Ok(())
277 }
278 }
279
280 unsafe impl<___E>
281 ::fidl_next::EncodeOption<
282 ::fidl_next::wire::Box<'static, crate::wire::BatchIteratorGetNextResponse<'static>>,
283 ___E,
284 > for BatchIteratorGetNextResponse
285 where
286 ___E: ::fidl_next::Encoder + ?Sized,
287 BatchIteratorGetNextResponse:
288 ::fidl_next::Encode<crate::wire::BatchIteratorGetNextResponse<'static>, ___E>,
289 {
290 #[inline]
291 fn encode_option(
292 this: ::core::option::Option<Self>,
293 encoder: &mut ___E,
294 out: &mut ::core::mem::MaybeUninit<
295 ::fidl_next::wire::Box<'static, crate::wire::BatchIteratorGetNextResponse<'static>>,
296 >,
297 _: (),
298 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
299 if let Some(inner) = this {
300 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
301 ::fidl_next::wire::Box::encode_present(out);
302 } else {
303 ::fidl_next::wire::Box::encode_absent(out);
304 }
305
306 Ok(())
307 }
308 }
309
310 impl<'de> ::fidl_next::FromWire<crate::wire::BatchIteratorGetNextResponse<'de>>
311 for BatchIteratorGetNextResponse
312 {
313 #[inline]
314 fn from_wire(wire: crate::wire::BatchIteratorGetNextResponse<'de>) -> Self {
315 Self { batch: ::fidl_next::FromWire::from_wire(wire.batch) }
316 }
317 }
318
319 #[derive(Debug, PartialEq)]
320 pub struct LogStreamConnectRequest {
321 pub socket: ::fidl_next::fuchsia::zx::Socket,
322
323 pub opts: crate::natural::LogStreamOptions,
324 }
325
326 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogStreamConnectRequest<'static>, ___E>
327 for LogStreamConnectRequest
328 where
329 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
330 ___E: ::fidl_next::Encoder,
331 ___E: ::fidl_next::fuchsia::HandleEncoder,
332 {
333 #[inline]
334 fn encode(
335 self,
336 encoder_: &mut ___E,
337 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogStreamConnectRequest<'static>>,
338 _: (),
339 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
340 ::fidl_next::munge! {
341 let crate::wire::LogStreamConnectRequest {
342 socket,
343 opts,
344
345 } = out_;
346 }
347
348 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
349
350 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(socket.as_mut_ptr()) };
351
352 ::fidl_next::Encode::encode(self.opts, encoder_, opts, ())?;
353
354 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(opts.as_mut_ptr()) };
355
356 Ok(())
357 }
358 }
359
360 unsafe impl<___E>
361 ::fidl_next::EncodeOption<
362 ::fidl_next::wire::Box<'static, crate::wire::LogStreamConnectRequest<'static>>,
363 ___E,
364 > for LogStreamConnectRequest
365 where
366 ___E: ::fidl_next::Encoder + ?Sized,
367 LogStreamConnectRequest:
368 ::fidl_next::Encode<crate::wire::LogStreamConnectRequest<'static>, ___E>,
369 {
370 #[inline]
371 fn encode_option(
372 this: ::core::option::Option<Self>,
373 encoder: &mut ___E,
374 out: &mut ::core::mem::MaybeUninit<
375 ::fidl_next::wire::Box<'static, crate::wire::LogStreamConnectRequest<'static>>,
376 >,
377 _: (),
378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
379 if let Some(inner) = this {
380 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
381 ::fidl_next::wire::Box::encode_present(out);
382 } else {
383 ::fidl_next::wire::Box::encode_absent(out);
384 }
385
386 Ok(())
387 }
388 }
389
390 impl<'de> ::fidl_next::FromWire<crate::wire::LogStreamConnectRequest<'de>>
391 for LogStreamConnectRequest
392 {
393 #[inline]
394 fn from_wire(wire: crate::wire::LogStreamConnectRequest<'de>) -> Self {
395 Self {
396 socket: ::fidl_next::FromWire::from_wire(wire.socket),
397
398 opts: ::fidl_next::FromWire::from_wire(wire.opts),
399 }
400 }
401 }
402
403 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
404 pub struct SampleSetRequest {
405 pub sample_parameters: crate::natural::SampleParameters,
406 }
407
408 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleSetRequest<'static>, ___E>
409 for SampleSetRequest
410 where
411 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
412 ___E: ::fidl_next::Encoder,
413 ___E: ::fidl_next::fuchsia::HandleEncoder,
414 {
415 #[inline]
416 fn encode(
417 self,
418 encoder_: &mut ___E,
419 out_: &mut ::core::mem::MaybeUninit<crate::wire::SampleSetRequest<'static>>,
420 _: (),
421 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
422 ::fidl_next::munge! {
423 let crate::wire::SampleSetRequest {
424 sample_parameters,
425
426 } = out_;
427 }
428
429 ::fidl_next::Encode::encode(self.sample_parameters, encoder_, sample_parameters, ())?;
430
431 let mut _field =
432 unsafe { ::fidl_next::Slot::new_unchecked(sample_parameters.as_mut_ptr()) };
433
434 Ok(())
435 }
436 }
437
438 unsafe impl<___E>
439 ::fidl_next::EncodeOption<
440 ::fidl_next::wire::Box<'static, crate::wire::SampleSetRequest<'static>>,
441 ___E,
442 > for SampleSetRequest
443 where
444 ___E: ::fidl_next::Encoder + ?Sized,
445 SampleSetRequest: ::fidl_next::Encode<crate::wire::SampleSetRequest<'static>, ___E>,
446 {
447 #[inline]
448 fn encode_option(
449 this: ::core::option::Option<Self>,
450 encoder: &mut ___E,
451 out: &mut ::core::mem::MaybeUninit<
452 ::fidl_next::wire::Box<'static, crate::wire::SampleSetRequest<'static>>,
453 >,
454 _: (),
455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
456 if let Some(inner) = this {
457 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
458 ::fidl_next::wire::Box::encode_present(out);
459 } else {
460 ::fidl_next::wire::Box::encode_absent(out);
461 }
462
463 Ok(())
464 }
465 }
466
467 impl<'de> ::fidl_next::FromWire<crate::wire::SampleSetRequest<'de>> for SampleSetRequest {
468 #[inline]
469 fn from_wire(wire: crate::wire::SampleSetRequest<'de>) -> Self {
470 Self { sample_parameters: ::fidl_next::FromWire::from_wire(wire.sample_parameters) }
471 }
472 }
473
474 #[derive(Debug, PartialEq)]
475 #[repr(C)]
476 pub struct SampleCommitRequest {
477 pub sink: ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::fuchsia::zx::Channel>,
478 }
479
480 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleCommitRequest, ___E>
481 for SampleCommitRequest
482 where
483 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
484 ___E: ::fidl_next::fuchsia::HandleEncoder,
485 {
486 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
487 Self,
488 crate::wire::SampleCommitRequest,
489 > = unsafe {
490 ::fidl_next::CopyOptimization::enable_if(
491 true && <::fidl_next::ClientEnd<
492 crate::SampleSink,
493 ::fidl_next::fuchsia::zx::Channel,
494 > as ::fidl_next::Encode<
495 ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
496 ___E,
497 >>::COPY_OPTIMIZATION
498 .is_enabled(),
499 )
500 };
501
502 #[inline]
503 fn encode(
504 self,
505 encoder_: &mut ___E,
506 out_: &mut ::core::mem::MaybeUninit<crate::wire::SampleCommitRequest>,
507 _: (),
508 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
509 ::fidl_next::munge! {
510 let crate::wire::SampleCommitRequest {
511 sink,
512
513 } = out_;
514 }
515
516 ::fidl_next::Encode::encode(self.sink, encoder_, sink, ())?;
517
518 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(sink.as_mut_ptr()) };
519
520 Ok(())
521 }
522 }
523
524 unsafe impl<___E>
525 ::fidl_next::EncodeOption<
526 ::fidl_next::wire::Box<'static, crate::wire::SampleCommitRequest>,
527 ___E,
528 > for SampleCommitRequest
529 where
530 ___E: ::fidl_next::Encoder + ?Sized,
531 SampleCommitRequest: ::fidl_next::Encode<crate::wire::SampleCommitRequest, ___E>,
532 {
533 #[inline]
534 fn encode_option(
535 this: ::core::option::Option<Self>,
536 encoder: &mut ___E,
537 out: &mut ::core::mem::MaybeUninit<
538 ::fidl_next::wire::Box<'static, crate::wire::SampleCommitRequest>,
539 >,
540 _: (),
541 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
542 if let Some(inner) = this {
543 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
544 ::fidl_next::wire::Box::encode_present(out);
545 } else {
546 ::fidl_next::wire::Box::encode_absent(out);
547 }
548
549 Ok(())
550 }
551 }
552
553 impl ::fidl_next::FromWire<crate::wire::SampleCommitRequest> for SampleCommitRequest {
554 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
555 crate::wire::SampleCommitRequest,
556 Self,
557 > = unsafe {
558 ::fidl_next::CopyOptimization::enable_if(
559 true && <::fidl_next::ClientEnd<
560 crate::SampleSink,
561 ::fidl_next::fuchsia::zx::Channel,
562 > as ::fidl_next::FromWire<
563 ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
564 >>::COPY_OPTIMIZATION
565 .is_enabled(),
566 )
567 };
568
569 #[inline]
570 fn from_wire(wire: crate::wire::SampleCommitRequest) -> Self {
571 Self { sink: ::fidl_next::FromWire::from_wire(wire.sink) }
572 }
573 }
574
575 #[doc = " `SampleReady` carries the data for a ready-to-consume sample.\n"]
576 #[derive(Debug, Default, PartialEq)]
577 pub struct SampleReady {
578 pub batch_iter: ::core::option::Option<
579 ::fidl_next::ClientEnd<crate::BatchIterator, ::fidl_next::fuchsia::zx::Channel>,
580 >,
581
582 pub seconds_since_start: ::core::option::Option<i64>,
583 }
584
585 impl SampleReady {
586 fn __max_ordinal(&self) -> usize {
587 if self.seconds_since_start.is_some() {
588 return 2;
589 }
590
591 if self.batch_iter.is_some() {
592 return 1;
593 }
594
595 0
596 }
597 }
598
599 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleReady<'static>, ___E> for SampleReady
600 where
601 ___E: ::fidl_next::Encoder + ?Sized,
602 ___E: ::fidl_next::fuchsia::HandleEncoder,
603 {
604 #[inline]
605 fn encode(
606 mut self,
607 encoder: &mut ___E,
608 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleReady<'static>>,
609 _: (),
610 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
611 ::fidl_next::munge!(let crate::wire::SampleReady { table } = out);
612
613 let max_ord = self.__max_ordinal();
614
615 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
616 ::fidl_next::Wire::zero_padding(&mut out);
617
618 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
619 ::fidl_next::wire::Envelope,
620 >(encoder, max_ord);
621
622 for i in 1..=max_ord {
623 match i {
624 2 => {
625 if let Some(value) = self.seconds_since_start.take() {
626 ::fidl_next::wire::Envelope::encode_value::<
627 ::fidl_next::wire::Int64,
628 ___E,
629 >(
630 value, preallocated.encoder, &mut out, ()
631 )?;
632 } else {
633 ::fidl_next::wire::Envelope::encode_zero(&mut out)
634 }
635 }
636
637 1 => {
638 if let Some(value) = self.batch_iter.take() {
639 ::fidl_next::wire::Envelope::encode_value::<
640 ::fidl_next::ClientEnd<
641 crate::BatchIterator,
642 ::fidl_next::wire::fuchsia::Channel,
643 >,
644 ___E,
645 >(
646 value, preallocated.encoder, &mut out, ()
647 )?;
648 } else {
649 ::fidl_next::wire::Envelope::encode_zero(&mut out)
650 }
651 }
652
653 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
654 }
655 unsafe {
656 preallocated.write_next(out.assume_init_ref());
657 }
658 }
659
660 ::fidl_next::wire::Table::encode_len(table, max_ord);
661
662 Ok(())
663 }
664 }
665
666 impl<'de> ::fidl_next::FromWire<crate::wire::SampleReady<'de>> for SampleReady {
667 #[inline]
668 fn from_wire(wire_: crate::wire::SampleReady<'de>) -> Self {
669 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
670
671 let batch_iter = wire_.table.get(1);
672
673 let seconds_since_start = wire_.table.get(2);
674
675 Self {
676 batch_iter: batch_iter.map(|envelope| {
677 ::fidl_next::FromWire::from_wire(unsafe {
678 envelope.read_unchecked::<::fidl_next::ClientEnd<
679 crate::BatchIterator,
680 ::fidl_next::wire::fuchsia::Channel,
681 >>()
682 })
683 }),
684
685 seconds_since_start: seconds_since_start.map(|envelope| {
686 ::fidl_next::FromWire::from_wire(unsafe {
687 envelope.read_unchecked::<::fidl_next::wire::Int64>()
688 })
689 }),
690 }
691 }
692 }
693
694 #[derive(Debug, PartialEq)]
695 pub enum SampleSinkResult {
696 Ready(crate::natural::SampleReady),
697
698 Error(crate::natural::RuntimeError),
699
700 UnknownOrdinal_(u64),
701 }
702
703 impl SampleSinkResult {
704 pub fn is_unknown(&self) -> bool {
705 #[allow(unreachable_patterns)]
706 match self {
707 Self::UnknownOrdinal_(_) => true,
708 _ => false,
709 }
710 }
711 }
712
713 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SampleSinkResult<'static>, ___E>
714 for SampleSinkResult
715 where
716 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
717 ___E: ::fidl_next::Encoder,
718 ___E: ::fidl_next::fuchsia::HandleEncoder,
719 {
720 #[inline]
721 fn encode(
722 self,
723 encoder: &mut ___E,
724 out: &mut ::core::mem::MaybeUninit<crate::wire::SampleSinkResult<'static>>,
725 _: (),
726 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
727 ::fidl_next::munge!(let crate::wire::SampleSinkResult { raw, _phantom: _ } = out);
728
729 match self {
730 Self::Ready(value) => ::fidl_next::wire::Union::encode_as::<
731 ___E,
732 crate::wire::SampleReady<'static>,
733 >(value, 1, encoder, raw, ())?,
734
735 Self::Error(value) => ::fidl_next::wire::Union::encode_as::<
736 ___E,
737 crate::wire::RuntimeError,
738 >(value, 2, encoder, raw, ())?,
739
740 Self::UnknownOrdinal_(ordinal) => {
741 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
742 }
743 }
744
745 Ok(())
746 }
747 }
748
749 unsafe impl<___E>
750 ::fidl_next::EncodeOption<crate::wire_optional::SampleSinkResult<'static>, ___E>
751 for SampleSinkResult
752 where
753 ___E: ?Sized,
754 SampleSinkResult: ::fidl_next::Encode<crate::wire::SampleSinkResult<'static>, ___E>,
755 {
756 #[inline]
757 fn encode_option(
758 this: ::core::option::Option<Self>,
759 encoder: &mut ___E,
760 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::SampleSinkResult<'static>>,
761 _: (),
762 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
763 ::fidl_next::munge!(let crate::wire_optional::SampleSinkResult { raw, _phantom: _ } = &mut *out);
764
765 if let Some(inner) = this {
766 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
767 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
768 } else {
769 ::fidl_next::wire::Union::encode_absent(raw);
770 }
771
772 Ok(())
773 }
774 }
775
776 impl<'de> ::fidl_next::FromWire<crate::wire::SampleSinkResult<'de>> for SampleSinkResult {
777 #[inline]
778 fn from_wire(wire: crate::wire::SampleSinkResult<'de>) -> Self {
779 let wire = ::core::mem::ManuallyDrop::new(wire);
780 match wire.raw.ordinal() {
781 1 => Self::Ready(::fidl_next::FromWire::from_wire(unsafe {
782 wire.raw.get().read_unchecked::<crate::wire::SampleReady<'de>>()
783 })),
784
785 2 => Self::Error(::fidl_next::FromWire::from_wire(unsafe {
786 wire.raw.get().read_unchecked::<crate::wire::RuntimeError>()
787 })),
788
789 ord => return Self::UnknownOrdinal_(ord as u64),
790 }
791 }
792 }
793
794 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::SampleSinkResult<'de>>
795 for SampleSinkResult
796 {
797 #[inline]
798 fn from_wire_option(
799 wire: crate::wire_optional::SampleSinkResult<'de>,
800 ) -> ::core::option::Option<Self> {
801 if let Some(inner) = wire.into_option() {
802 Some(::fidl_next::FromWire::from_wire(inner))
803 } else {
804 None
805 }
806 }
807 }
808
809 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::SampleSinkResult<'de>>
810 for Box<SampleSinkResult>
811 {
812 #[inline]
813 fn from_wire_option(
814 wire: crate::wire_optional::SampleSinkResult<'de>,
815 ) -> ::core::option::Option<Self> {
816 <SampleSinkResult as ::fidl_next::FromWireOption<
817 crate::wire_optional::SampleSinkResult<'de>,
818 >>::from_wire_option(wire)
819 .map(Box::new)
820 }
821 }
822
823 #[derive(Debug, PartialEq)]
824 pub struct SampleSinkOnSampleReadiedRequest {
825 pub event: crate::natural::SampleSinkResult,
826 }
827
828 unsafe impl<___E>
829 ::fidl_next::Encode<crate::wire::SampleSinkOnSampleReadiedRequest<'static>, ___E>
830 for SampleSinkOnSampleReadiedRequest
831 where
832 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
833 ___E: ::fidl_next::Encoder,
834 ___E: ::fidl_next::fuchsia::HandleEncoder,
835 {
836 #[inline]
837 fn encode(
838 self,
839 encoder_: &mut ___E,
840 out_: &mut ::core::mem::MaybeUninit<
841 crate::wire::SampleSinkOnSampleReadiedRequest<'static>,
842 >,
843 _: (),
844 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
845 ::fidl_next::munge! {
846 let crate::wire::SampleSinkOnSampleReadiedRequest {
847 event,
848
849 } = out_;
850 }
851
852 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
853
854 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event.as_mut_ptr()) };
855
856 Ok(())
857 }
858 }
859
860 unsafe impl<___E>
861 ::fidl_next::EncodeOption<
862 ::fidl_next::wire::Box<'static, crate::wire::SampleSinkOnSampleReadiedRequest<'static>>,
863 ___E,
864 > for SampleSinkOnSampleReadiedRequest
865 where
866 ___E: ::fidl_next::Encoder + ?Sized,
867 SampleSinkOnSampleReadiedRequest:
868 ::fidl_next::Encode<crate::wire::SampleSinkOnSampleReadiedRequest<'static>, ___E>,
869 {
870 #[inline]
871 fn encode_option(
872 this: ::core::option::Option<Self>,
873 encoder: &mut ___E,
874 out: &mut ::core::mem::MaybeUninit<
875 ::fidl_next::wire::Box<
876 'static,
877 crate::wire::SampleSinkOnSampleReadiedRequest<'static>,
878 >,
879 >,
880 _: (),
881 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
882 if let Some(inner) = this {
883 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
884 ::fidl_next::wire::Box::encode_present(out);
885 } else {
886 ::fidl_next::wire::Box::encode_absent(out);
887 }
888
889 Ok(())
890 }
891 }
892
893 impl<'de> ::fidl_next::FromWire<crate::wire::SampleSinkOnSampleReadiedRequest<'de>>
894 for SampleSinkOnSampleReadiedRequest
895 {
896 #[inline]
897 fn from_wire(wire: crate::wire::SampleSinkOnSampleReadiedRequest<'de>) -> Self {
898 Self { event: ::fidl_next::FromWire::from_wire(wire.event) }
899 }
900 }
901}
902
903pub mod wire {
904
905 pub use fidl_next_common_fuchsia_diagnostics::wire::*;
906
907 #[derive(Debug)]
909 #[repr(C)]
910 pub struct ArchiveAccessorStreamDiagnosticsRequest<'de> {
911 pub stream_parameters: crate::wire::StreamParameters<'de>,
912
913 pub result_stream:
914 ::fidl_next::ServerEnd<crate::BatchIterator, ::fidl_next::wire::fuchsia::Channel>,
915 }
916
917 static_assertions::const_assert_eq!(
918 std::mem::size_of::<ArchiveAccessorStreamDiagnosticsRequest<'_>>(),
919 24
920 );
921 static_assertions::const_assert_eq!(
922 std::mem::align_of::<ArchiveAccessorStreamDiagnosticsRequest<'_>>(),
923 8
924 );
925
926 static_assertions::const_assert_eq!(
927 std::mem::offset_of!(ArchiveAccessorStreamDiagnosticsRequest<'_>, stream_parameters),
928 0
929 );
930
931 static_assertions::const_assert_eq!(
932 std::mem::offset_of!(ArchiveAccessorStreamDiagnosticsRequest<'_>, result_stream),
933 16
934 );
935
936 impl ::fidl_next::Constrained for ArchiveAccessorStreamDiagnosticsRequest<'_> {
937 type Constraint = ();
938
939 fn validate(
940 _: ::fidl_next::Slot<'_, Self>,
941 _: Self::Constraint,
942 ) -> Result<(), ::fidl_next::ValidationError> {
943 Ok(())
944 }
945 }
946
947 unsafe impl ::fidl_next::Wire for ArchiveAccessorStreamDiagnosticsRequest<'static> {
948 type Narrowed<'de> = ArchiveAccessorStreamDiagnosticsRequest<'de>;
949
950 #[inline]
951 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
952 ::fidl_next::munge! {
953 let Self {
954 stream_parameters,
955 result_stream,
956
957 } = &mut *out_;
958 }
959
960 ::fidl_next::Wire::zero_padding(stream_parameters);
961
962 ::fidl_next::Wire::zero_padding(result_stream);
963
964 unsafe {
965 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
966 }
967 }
968 }
969
970 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ArchiveAccessorStreamDiagnosticsRequest<'de>
971 where
972 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
973 ___D: ::fidl_next::Decoder<'de>,
974 ___D: ::fidl_next::fuchsia::HandleDecoder,
975 {
976 fn decode(
977 slot_: ::fidl_next::Slot<'_, Self>,
978 decoder_: &mut ___D,
979 _: (),
980 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
981 if slot_.as_bytes()[20..24] != [0u8; 4] {
982 return Err(::fidl_next::DecodeError::InvalidPadding);
983 }
984
985 ::fidl_next::munge! {
986 let Self {
987 mut stream_parameters,
988 mut result_stream,
989
990 } = slot_;
991 }
992
993 let _field = stream_parameters.as_mut();
994
995 ::fidl_next::Decode::decode(stream_parameters.as_mut(), decoder_, ())?;
996
997 let _field = result_stream.as_mut();
998
999 ::fidl_next::Decode::decode(result_stream.as_mut(), decoder_, ())?;
1000
1001 Ok(())
1002 }
1003 }
1004
1005 impl<'de> ::fidl_next::IntoNatural for ArchiveAccessorStreamDiagnosticsRequest<'de> {
1006 type Natural = crate::natural::ArchiveAccessorStreamDiagnosticsRequest;
1007 }
1008
1009 #[repr(transparent)]
1011 pub struct FormattedContent<'de> {
1012 pub(crate) raw: ::fidl_next::wire::Union,
1013 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1014 }
1015
1016 impl<'de> Drop for FormattedContent<'de> {
1017 fn drop(&mut self) {
1018 match self.raw.ordinal() {
1019 1 => {
1020 let _ = unsafe {
1021 self.raw.get().read_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>()
1022 };
1023 }
1024
1025 3 => {
1026 let _ = unsafe {
1027 self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1028 };
1029 }
1030
1031 4 => {
1032 let _ = unsafe {
1033 self.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1034 };
1035 }
1036
1037 _ => (),
1038 }
1039 }
1040 }
1041
1042 impl ::fidl_next::Constrained for FormattedContent<'_> {
1043 type Constraint = ();
1044
1045 fn validate(
1046 _: ::fidl_next::Slot<'_, Self>,
1047 _: Self::Constraint,
1048 ) -> Result<(), ::fidl_next::ValidationError> {
1049 Ok(())
1050 }
1051 }
1052
1053 unsafe impl ::fidl_next::Wire for FormattedContent<'static> {
1054 type Narrowed<'de> = FormattedContent<'de>;
1055
1056 #[inline]
1057 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1058 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1059 ::fidl_next::wire::Union::zero_padding(raw);
1060 }
1061 }
1062
1063 pub mod formatted_content {
1064 pub enum Ref<'de> {
1065 Json(&'de ::fidl_next_fuchsia_mem::wire::Buffer),
1066
1067 Cbor(&'de ::fidl_next::wire::fuchsia::Vmo),
1068
1069 Fxt(&'de ::fidl_next::wire::fuchsia::Vmo),
1070
1071 UnknownOrdinal_(u64),
1072 }
1073
1074 pub enum Value {
1075 Json(::fidl_next_fuchsia_mem::wire::Buffer),
1076
1077 Cbor(::fidl_next::wire::fuchsia::Vmo),
1078
1079 Fxt(::fidl_next::wire::fuchsia::Vmo),
1080
1081 UnknownOrdinal_(u64),
1082 }
1083 }
1084
1085 impl<'de> FormattedContent<'de> {
1086 pub fn as_ref(&self) -> crate::wire::formatted_content::Ref<'_> {
1087 match self.raw.ordinal() {
1088 1 => crate::wire::formatted_content::Ref::Json(unsafe {
1089 self.raw.get().deref_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>()
1090 }),
1091
1092 3 => crate::wire::formatted_content::Ref::Cbor(unsafe {
1093 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1094 }),
1095
1096 4 => crate::wire::formatted_content::Ref::Fxt(unsafe {
1097 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1098 }),
1099
1100 unknown => crate::wire::formatted_content::Ref::UnknownOrdinal_(unknown),
1101 }
1102 }
1103
1104 pub fn into_inner(self) -> crate::wire::formatted_content::Value {
1105 let this = ::core::mem::ManuallyDrop::new(self);
1106
1107 match this.raw.ordinal() {
1108 1 => crate::wire::formatted_content::Value::Json(unsafe {
1109 this.raw.get().read_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>()
1110 }),
1111
1112 3 => crate::wire::formatted_content::Value::Cbor(unsafe {
1113 this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1114 }),
1115
1116 4 => crate::wire::formatted_content::Value::Fxt(unsafe {
1117 this.raw.get().read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1118 }),
1119
1120 unknown => crate::wire::formatted_content::Value::UnknownOrdinal_(unknown),
1121 }
1122 }
1123 }
1124
1125 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormattedContent<'de>
1126 where
1127 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1128 ___D: ::fidl_next::Decoder<'de>,
1129 ___D: ::fidl_next::fuchsia::HandleDecoder,
1130 {
1131 fn decode(
1132 mut slot: ::fidl_next::Slot<'_, Self>,
1133 decoder: &mut ___D,
1134 _: (),
1135 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1136 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1137 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1138 1 => ::fidl_next::wire::Union::decode_as::<
1139 ___D,
1140 ::fidl_next_fuchsia_mem::wire::Buffer,
1141 >(raw, decoder, ())?,
1142
1143 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1144 raw,
1145 decoder,
1146 (),
1147 )?,
1148
1149 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1150 raw,
1151 decoder,
1152 (),
1153 )?,
1154
1155 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1156 }
1157
1158 Ok(())
1159 }
1160 }
1161
1162 impl<'de> ::core::fmt::Debug for FormattedContent<'de> {
1163 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1164 match self.raw.ordinal() {
1165 1 => unsafe {
1166 self.raw.get().deref_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>().fmt(f)
1167 },
1168 3 => unsafe {
1169 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>().fmt(f)
1170 },
1171 4 => unsafe {
1172 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>().fmt(f)
1173 },
1174 _ => unsafe { ::core::hint::unreachable_unchecked() },
1175 }
1176 }
1177 }
1178
1179 impl<'de> ::fidl_next::IntoNatural for FormattedContent<'de> {
1180 type Natural = crate::natural::FormattedContent;
1181 }
1182
1183 #[derive(Debug)]
1185 #[repr(C)]
1186 pub struct BatchIteratorGetNextResponse<'de> {
1187 pub batch: ::fidl_next::wire::Vector<'de, crate::wire::FormattedContent<'de>>,
1188 }
1189
1190 static_assertions::const_assert_eq!(
1191 std::mem::size_of::<BatchIteratorGetNextResponse<'_>>(),
1192 16
1193 );
1194 static_assertions::const_assert_eq!(
1195 std::mem::align_of::<BatchIteratorGetNextResponse<'_>>(),
1196 8
1197 );
1198
1199 static_assertions::const_assert_eq!(
1200 std::mem::offset_of!(BatchIteratorGetNextResponse<'_>, batch),
1201 0
1202 );
1203
1204 impl ::fidl_next::Constrained for BatchIteratorGetNextResponse<'_> {
1205 type Constraint = ();
1206
1207 fn validate(
1208 _: ::fidl_next::Slot<'_, Self>,
1209 _: Self::Constraint,
1210 ) -> Result<(), ::fidl_next::ValidationError> {
1211 Ok(())
1212 }
1213 }
1214
1215 unsafe impl ::fidl_next::Wire for BatchIteratorGetNextResponse<'static> {
1216 type Narrowed<'de> = BatchIteratorGetNextResponse<'de>;
1217
1218 #[inline]
1219 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1220 ::fidl_next::munge! {
1221 let Self {
1222 batch,
1223
1224 } = &mut *out_;
1225 }
1226
1227 ::fidl_next::Wire::zero_padding(batch);
1228 }
1229 }
1230
1231 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BatchIteratorGetNextResponse<'de>
1232 where
1233 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1234 ___D: ::fidl_next::Decoder<'de>,
1235 ___D: ::fidl_next::fuchsia::HandleDecoder,
1236 {
1237 fn decode(
1238 slot_: ::fidl_next::Slot<'_, Self>,
1239 decoder_: &mut ___D,
1240 _: (),
1241 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1242 ::fidl_next::munge! {
1243 let Self {
1244 mut batch,
1245
1246 } = slot_;
1247 }
1248
1249 let _field = batch.as_mut();
1250 ::fidl_next::Constrained::validate(_field, (64, ()))?;
1251 ::fidl_next::Decode::decode(batch.as_mut(), decoder_, (64, ()))?;
1252
1253 let batch = unsafe { batch.deref_unchecked() };
1254
1255 if batch.len() > 64 {
1256 return Err(::fidl_next::DecodeError::VectorTooLong {
1257 size: batch.len() as u64,
1258 limit: 64,
1259 });
1260 }
1261
1262 Ok(())
1263 }
1264 }
1265
1266 impl<'de> ::fidl_next::IntoNatural for BatchIteratorGetNextResponse<'de> {
1267 type Natural = crate::natural::BatchIteratorGetNextResponse;
1268 }
1269
1270 #[derive(Debug)]
1272 #[repr(C)]
1273 pub struct LogStreamConnectRequest<'de> {
1274 pub socket: ::fidl_next::wire::fuchsia::Socket,
1275
1276 pub opts: crate::wire::LogStreamOptions<'de>,
1277 }
1278
1279 static_assertions::const_assert_eq!(std::mem::size_of::<LogStreamConnectRequest<'_>>(), 24);
1280 static_assertions::const_assert_eq!(std::mem::align_of::<LogStreamConnectRequest<'_>>(), 8);
1281
1282 static_assertions::const_assert_eq!(
1283 std::mem::offset_of!(LogStreamConnectRequest<'_>, socket),
1284 0
1285 );
1286
1287 static_assertions::const_assert_eq!(std::mem::offset_of!(LogStreamConnectRequest<'_>, opts), 8);
1288
1289 impl ::fidl_next::Constrained for LogStreamConnectRequest<'_> {
1290 type Constraint = ();
1291
1292 fn validate(
1293 _: ::fidl_next::Slot<'_, Self>,
1294 _: Self::Constraint,
1295 ) -> Result<(), ::fidl_next::ValidationError> {
1296 Ok(())
1297 }
1298 }
1299
1300 unsafe impl ::fidl_next::Wire for LogStreamConnectRequest<'static> {
1301 type Narrowed<'de> = LogStreamConnectRequest<'de>;
1302
1303 #[inline]
1304 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1305 ::fidl_next::munge! {
1306 let Self {
1307 socket,
1308 opts,
1309
1310 } = &mut *out_;
1311 }
1312
1313 ::fidl_next::Wire::zero_padding(socket);
1314
1315 ::fidl_next::Wire::zero_padding(opts);
1316
1317 unsafe {
1318 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
1319 }
1320 }
1321 }
1322
1323 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogStreamConnectRequest<'de>
1324 where
1325 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1326 ___D: ::fidl_next::Decoder<'de>,
1327 ___D: ::fidl_next::fuchsia::HandleDecoder,
1328 {
1329 fn decode(
1330 slot_: ::fidl_next::Slot<'_, Self>,
1331 decoder_: &mut ___D,
1332 _: (),
1333 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1334 if slot_.as_bytes()[4..8] != [0u8; 4] {
1335 return Err(::fidl_next::DecodeError::InvalidPadding);
1336 }
1337
1338 ::fidl_next::munge! {
1339 let Self {
1340 mut socket,
1341 mut opts,
1342
1343 } = slot_;
1344 }
1345
1346 let _field = socket.as_mut();
1347
1348 ::fidl_next::Decode::decode(socket.as_mut(), decoder_, ())?;
1349
1350 let _field = opts.as_mut();
1351
1352 ::fidl_next::Decode::decode(opts.as_mut(), decoder_, ())?;
1353
1354 Ok(())
1355 }
1356 }
1357
1358 impl<'de> ::fidl_next::IntoNatural for LogStreamConnectRequest<'de> {
1359 type Natural = crate::natural::LogStreamConnectRequest;
1360 }
1361
1362 #[derive(Debug)]
1364 #[repr(C)]
1365 pub struct SampleSetRequest<'de> {
1366 pub sample_parameters: crate::wire::SampleParameters<'de>,
1367 }
1368
1369 static_assertions::const_assert_eq!(std::mem::size_of::<SampleSetRequest<'_>>(), 16);
1370 static_assertions::const_assert_eq!(std::mem::align_of::<SampleSetRequest<'_>>(), 8);
1371
1372 static_assertions::const_assert_eq!(
1373 std::mem::offset_of!(SampleSetRequest<'_>, sample_parameters),
1374 0
1375 );
1376
1377 impl ::fidl_next::Constrained for SampleSetRequest<'_> {
1378 type Constraint = ();
1379
1380 fn validate(
1381 _: ::fidl_next::Slot<'_, Self>,
1382 _: Self::Constraint,
1383 ) -> Result<(), ::fidl_next::ValidationError> {
1384 Ok(())
1385 }
1386 }
1387
1388 unsafe impl ::fidl_next::Wire for SampleSetRequest<'static> {
1389 type Narrowed<'de> = SampleSetRequest<'de>;
1390
1391 #[inline]
1392 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1393 ::fidl_next::munge! {
1394 let Self {
1395 sample_parameters,
1396
1397 } = &mut *out_;
1398 }
1399
1400 ::fidl_next::Wire::zero_padding(sample_parameters);
1401 }
1402 }
1403
1404 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSetRequest<'de>
1405 where
1406 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1407 ___D: ::fidl_next::Decoder<'de>,
1408 ___D: ::fidl_next::fuchsia::HandleDecoder,
1409 {
1410 fn decode(
1411 slot_: ::fidl_next::Slot<'_, Self>,
1412 decoder_: &mut ___D,
1413 _: (),
1414 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1415 ::fidl_next::munge! {
1416 let Self {
1417 mut sample_parameters,
1418
1419 } = slot_;
1420 }
1421
1422 let _field = sample_parameters.as_mut();
1423
1424 ::fidl_next::Decode::decode(sample_parameters.as_mut(), decoder_, ())?;
1425
1426 Ok(())
1427 }
1428 }
1429
1430 impl<'de> ::fidl_next::IntoNatural for SampleSetRequest<'de> {
1431 type Natural = crate::natural::SampleSetRequest;
1432 }
1433
1434 #[derive(Debug)]
1436 #[repr(C)]
1437 pub struct SampleCommitRequest {
1438 pub sink: ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
1439 }
1440
1441 static_assertions::const_assert_eq!(std::mem::size_of::<SampleCommitRequest>(), 4);
1442 static_assertions::const_assert_eq!(std::mem::align_of::<SampleCommitRequest>(), 4);
1443
1444 static_assertions::const_assert_eq!(std::mem::offset_of!(SampleCommitRequest, sink), 0);
1445
1446 impl ::fidl_next::Constrained for SampleCommitRequest {
1447 type Constraint = ();
1448
1449 fn validate(
1450 _: ::fidl_next::Slot<'_, Self>,
1451 _: Self::Constraint,
1452 ) -> Result<(), ::fidl_next::ValidationError> {
1453 Ok(())
1454 }
1455 }
1456
1457 unsafe impl ::fidl_next::Wire for SampleCommitRequest {
1458 type Narrowed<'de> = SampleCommitRequest;
1459
1460 #[inline]
1461 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1462 ::fidl_next::munge! {
1463 let Self {
1464 sink,
1465
1466 } = &mut *out_;
1467 }
1468
1469 ::fidl_next::Wire::zero_padding(sink);
1470 }
1471 }
1472
1473 unsafe impl<___D> ::fidl_next::Decode<___D> for SampleCommitRequest
1474 where
1475 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1476 ___D: ::fidl_next::fuchsia::HandleDecoder,
1477 {
1478 fn decode(
1479 slot_: ::fidl_next::Slot<'_, Self>,
1480 decoder_: &mut ___D,
1481 _: (),
1482 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1483 ::fidl_next::munge! {
1484 let Self {
1485 mut sink,
1486
1487 } = slot_;
1488 }
1489
1490 let _field = sink.as_mut();
1491
1492 ::fidl_next::Decode::decode(sink.as_mut(), decoder_, ())?;
1493
1494 Ok(())
1495 }
1496 }
1497
1498 impl ::fidl_next::IntoNatural for SampleCommitRequest {
1499 type Natural = crate::natural::SampleCommitRequest;
1500 }
1501
1502 #[repr(C)]
1504 pub struct SampleReady<'de> {
1505 pub(crate) table: ::fidl_next::wire::Table<'de>,
1506 }
1507
1508 impl<'de> Drop for SampleReady<'de> {
1509 fn drop(&mut self) {
1510 let _ = self.table.get(1).map(|envelope| unsafe {
1511 envelope.read_unchecked::<::fidl_next::ClientEnd<
1512 crate::BatchIterator,
1513 ::fidl_next::wire::fuchsia::Channel,
1514 >>()
1515 });
1516
1517 let _ = self
1518 .table
1519 .get(2)
1520 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
1521 }
1522 }
1523
1524 impl ::fidl_next::Constrained for SampleReady<'_> {
1525 type Constraint = ();
1526
1527 fn validate(
1528 _: ::fidl_next::Slot<'_, Self>,
1529 _: Self::Constraint,
1530 ) -> Result<(), ::fidl_next::ValidationError> {
1531 Ok(())
1532 }
1533 }
1534
1535 unsafe impl ::fidl_next::Wire for SampleReady<'static> {
1536 type Narrowed<'de> = SampleReady<'de>;
1537
1538 #[inline]
1539 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1540 ::fidl_next::munge!(let Self { table } = out);
1541 ::fidl_next::wire::Table::zero_padding(table);
1542 }
1543 }
1544
1545 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleReady<'de>
1546 where
1547 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1548 ___D: ::fidl_next::fuchsia::HandleDecoder,
1549 {
1550 fn decode(
1551 slot: ::fidl_next::Slot<'_, Self>,
1552 decoder: &mut ___D,
1553 _: (),
1554 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1555 ::fidl_next::munge!(let Self { table } = slot);
1556
1557 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1558 match ordinal {
1559 0 => unsafe { ::core::hint::unreachable_unchecked() },
1560
1561 1 => {
1562 ::fidl_next::wire::Envelope::decode_as::<
1563 ___D,
1564 ::fidl_next::ClientEnd<
1565 crate::BatchIterator,
1566 ::fidl_next::wire::fuchsia::Channel,
1567 >,
1568 >(slot.as_mut(), decoder, ())?;
1569
1570 Ok(())
1571 }
1572
1573 2 => {
1574 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
1575 slot.as_mut(),
1576 decoder,
1577 (),
1578 )?;
1579
1580 Ok(())
1581 }
1582
1583 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1584 }
1585 })
1586 }
1587 }
1588
1589 impl<'de> SampleReady<'de> {
1590 pub fn batch_iter(
1591 &self,
1592 ) -> ::core::option::Option<
1593 &::fidl_next::ClientEnd<crate::BatchIterator, ::fidl_next::wire::fuchsia::Channel>,
1594 > {
1595 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1596 }
1597
1598 pub fn take_batch_iter(
1599 &mut self,
1600 ) -> ::core::option::Option<
1601 ::fidl_next::ClientEnd<crate::BatchIterator, ::fidl_next::wire::fuchsia::Channel>,
1602 > {
1603 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1604 }
1605
1606 pub fn seconds_since_start(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
1607 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1608 }
1609
1610 pub fn take_seconds_since_start(
1611 &mut self,
1612 ) -> ::core::option::Option<::fidl_next::wire::Int64> {
1613 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1614 }
1615 }
1616
1617 impl<'de> ::core::fmt::Debug for SampleReady<'de> {
1618 fn fmt(
1619 &self,
1620 f: &mut ::core::fmt::Formatter<'_>,
1621 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1622 f.debug_struct("SampleReady")
1623 .field("batch_iter", &self.batch_iter())
1624 .field("seconds_since_start", &self.seconds_since_start())
1625 .finish()
1626 }
1627 }
1628
1629 impl<'de> ::fidl_next::IntoNatural for SampleReady<'de> {
1630 type Natural = crate::natural::SampleReady;
1631 }
1632
1633 #[repr(transparent)]
1635 pub struct SampleSinkResult<'de> {
1636 pub(crate) raw: ::fidl_next::wire::Union,
1637 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1638 }
1639
1640 impl<'de> Drop for SampleSinkResult<'de> {
1641 fn drop(&mut self) {
1642 match self.raw.ordinal() {
1643 1 => {
1644 let _ =
1645 unsafe { self.raw.get().read_unchecked::<crate::wire::SampleReady<'de>>() };
1646 }
1647
1648 2 => {
1649 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::RuntimeError>() };
1650 }
1651
1652 _ => (),
1653 }
1654 }
1655 }
1656
1657 impl ::fidl_next::Constrained for SampleSinkResult<'_> {
1658 type Constraint = ();
1659
1660 fn validate(
1661 _: ::fidl_next::Slot<'_, Self>,
1662 _: Self::Constraint,
1663 ) -> Result<(), ::fidl_next::ValidationError> {
1664 Ok(())
1665 }
1666 }
1667
1668 unsafe impl ::fidl_next::Wire for SampleSinkResult<'static> {
1669 type Narrowed<'de> = SampleSinkResult<'de>;
1670
1671 #[inline]
1672 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1673 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1674 ::fidl_next::wire::Union::zero_padding(raw);
1675 }
1676 }
1677
1678 pub mod sample_sink_result {
1679 pub enum Ref<'de> {
1680 Ready(&'de crate::wire::SampleReady<'de>),
1681
1682 Error(&'de crate::wire::RuntimeError),
1683
1684 UnknownOrdinal_(u64),
1685 }
1686
1687 pub enum Value<'de> {
1688 Ready(crate::wire::SampleReady<'de>),
1689
1690 Error(crate::wire::RuntimeError),
1691
1692 UnknownOrdinal_(u64),
1693 }
1694 }
1695
1696 impl<'de> SampleSinkResult<'de> {
1697 pub fn as_ref(&self) -> crate::wire::sample_sink_result::Ref<'_> {
1698 match self.raw.ordinal() {
1699 1 => crate::wire::sample_sink_result::Ref::Ready(unsafe {
1700 self.raw.get().deref_unchecked::<crate::wire::SampleReady<'_>>()
1701 }),
1702
1703 2 => crate::wire::sample_sink_result::Ref::Error(unsafe {
1704 self.raw.get().deref_unchecked::<crate::wire::RuntimeError>()
1705 }),
1706
1707 unknown => crate::wire::sample_sink_result::Ref::UnknownOrdinal_(unknown),
1708 }
1709 }
1710
1711 pub fn into_inner(self) -> crate::wire::sample_sink_result::Value<'de> {
1712 let this = ::core::mem::ManuallyDrop::new(self);
1713
1714 match this.raw.ordinal() {
1715 1 => crate::wire::sample_sink_result::Value::Ready(unsafe {
1716 this.raw.get().read_unchecked::<crate::wire::SampleReady<'de>>()
1717 }),
1718
1719 2 => crate::wire::sample_sink_result::Value::Error(unsafe {
1720 this.raw.get().read_unchecked::<crate::wire::RuntimeError>()
1721 }),
1722
1723 unknown => crate::wire::sample_sink_result::Value::UnknownOrdinal_(unknown),
1724 }
1725 }
1726 }
1727
1728 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSinkResult<'de>
1729 where
1730 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1731 ___D: ::fidl_next::Decoder<'de>,
1732 ___D: ::fidl_next::fuchsia::HandleDecoder,
1733 {
1734 fn decode(
1735 mut slot: ::fidl_next::Slot<'_, Self>,
1736 decoder: &mut ___D,
1737 _: (),
1738 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1739 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1740 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1741 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SampleReady<'de>>(
1742 raw,
1743 decoder,
1744 (),
1745 )?,
1746
1747 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::RuntimeError>(
1748 raw,
1749 decoder,
1750 (),
1751 )?,
1752
1753 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1754 }
1755
1756 Ok(())
1757 }
1758 }
1759
1760 impl<'de> ::core::fmt::Debug for SampleSinkResult<'de> {
1761 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1762 match self.raw.ordinal() {
1763 1 => unsafe {
1764 self.raw.get().deref_unchecked::<crate::wire::SampleReady<'_>>().fmt(f)
1765 },
1766 2 => unsafe {
1767 self.raw.get().deref_unchecked::<crate::wire::RuntimeError>().fmt(f)
1768 },
1769 _ => unsafe { ::core::hint::unreachable_unchecked() },
1770 }
1771 }
1772 }
1773
1774 impl<'de> ::fidl_next::IntoNatural for SampleSinkResult<'de> {
1775 type Natural = crate::natural::SampleSinkResult;
1776 }
1777
1778 #[derive(Debug)]
1780 #[repr(C)]
1781 pub struct SampleSinkOnSampleReadiedRequest<'de> {
1782 pub event: crate::wire::SampleSinkResult<'de>,
1783 }
1784
1785 static_assertions::const_assert_eq!(
1786 std::mem::size_of::<SampleSinkOnSampleReadiedRequest<'_>>(),
1787 16
1788 );
1789 static_assertions::const_assert_eq!(
1790 std::mem::align_of::<SampleSinkOnSampleReadiedRequest<'_>>(),
1791 8
1792 );
1793
1794 static_assertions::const_assert_eq!(
1795 std::mem::offset_of!(SampleSinkOnSampleReadiedRequest<'_>, event),
1796 0
1797 );
1798
1799 impl ::fidl_next::Constrained for SampleSinkOnSampleReadiedRequest<'_> {
1800 type Constraint = ();
1801
1802 fn validate(
1803 _: ::fidl_next::Slot<'_, Self>,
1804 _: Self::Constraint,
1805 ) -> Result<(), ::fidl_next::ValidationError> {
1806 Ok(())
1807 }
1808 }
1809
1810 unsafe impl ::fidl_next::Wire for SampleSinkOnSampleReadiedRequest<'static> {
1811 type Narrowed<'de> = SampleSinkOnSampleReadiedRequest<'de>;
1812
1813 #[inline]
1814 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1815 ::fidl_next::munge! {
1816 let Self {
1817 event,
1818
1819 } = &mut *out_;
1820 }
1821
1822 ::fidl_next::Wire::zero_padding(event);
1823 }
1824 }
1825
1826 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSinkOnSampleReadiedRequest<'de>
1827 where
1828 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1829 ___D: ::fidl_next::Decoder<'de>,
1830 ___D: ::fidl_next::fuchsia::HandleDecoder,
1831 {
1832 fn decode(
1833 slot_: ::fidl_next::Slot<'_, Self>,
1834 decoder_: &mut ___D,
1835 _: (),
1836 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1837 ::fidl_next::munge! {
1838 let Self {
1839 mut event,
1840
1841 } = slot_;
1842 }
1843
1844 let _field = event.as_mut();
1845
1846 ::fidl_next::Decode::decode(event.as_mut(), decoder_, ())?;
1847
1848 Ok(())
1849 }
1850 }
1851
1852 impl<'de> ::fidl_next::IntoNatural for SampleSinkOnSampleReadiedRequest<'de> {
1853 type Natural = crate::natural::SampleSinkOnSampleReadiedRequest;
1854 }
1855}
1856
1857pub mod wire_optional {
1858
1859 pub use fidl_next_common_fuchsia_diagnostics::wire_optional::*;
1860
1861 #[repr(transparent)]
1862 pub struct FormattedContent<'de> {
1863 pub(crate) raw: ::fidl_next::wire::Union,
1864 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1865 }
1866
1867 impl ::fidl_next::Constrained for FormattedContent<'_> {
1868 type Constraint = ();
1869
1870 fn validate(
1871 _: ::fidl_next::Slot<'_, Self>,
1872 _: Self::Constraint,
1873 ) -> Result<(), ::fidl_next::ValidationError> {
1874 Ok(())
1875 }
1876 }
1877
1878 unsafe impl ::fidl_next::Wire for FormattedContent<'static> {
1879 type Narrowed<'de> = FormattedContent<'de>;
1880
1881 #[inline]
1882 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1883 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1884 ::fidl_next::wire::Union::zero_padding(raw);
1885 }
1886 }
1887
1888 impl<'de> FormattedContent<'de> {
1889 pub fn is_some(&self) -> bool {
1890 self.raw.is_some()
1891 }
1892
1893 pub fn is_none(&self) -> bool {
1894 self.raw.is_none()
1895 }
1896
1897 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::FormattedContent<'de>> {
1898 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1899 }
1900
1901 pub fn into_option(self) -> ::core::option::Option<crate::wire::FormattedContent<'de>> {
1902 if self.is_some() {
1903 Some(crate::wire::FormattedContent {
1904 raw: self.raw,
1905 _phantom: ::core::marker::PhantomData,
1906 })
1907 } else {
1908 None
1909 }
1910 }
1911 }
1912
1913 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormattedContent<'de>
1914 where
1915 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1916 ___D: ::fidl_next::Decoder<'de>,
1917 ___D: ::fidl_next::fuchsia::HandleDecoder,
1918 {
1919 fn decode(
1920 mut slot: ::fidl_next::Slot<'_, Self>,
1921 decoder: &mut ___D,
1922 _: (),
1923 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1924 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1925 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1926 1 => ::fidl_next::wire::Union::decode_as::<
1927 ___D,
1928 ::fidl_next_fuchsia_mem::wire::Buffer,
1929 >(raw, decoder, ())?,
1930
1931 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1932 raw,
1933 decoder,
1934 (),
1935 )?,
1936
1937 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1938 raw,
1939 decoder,
1940 (),
1941 )?,
1942
1943 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1944 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1945 }
1946
1947 Ok(())
1948 }
1949 }
1950
1951 impl<'de> ::core::fmt::Debug for FormattedContent<'de> {
1952 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1953 self.as_ref().fmt(f)
1954 }
1955 }
1956
1957 impl<'de> ::fidl_next::IntoNatural for FormattedContent<'de> {
1958 type Natural = ::core::option::Option<crate::natural::FormattedContent>;
1959 }
1960
1961 #[repr(transparent)]
1962 pub struct SampleSinkResult<'de> {
1963 pub(crate) raw: ::fidl_next::wire::Union,
1964 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1965 }
1966
1967 impl ::fidl_next::Constrained for SampleSinkResult<'_> {
1968 type Constraint = ();
1969
1970 fn validate(
1971 _: ::fidl_next::Slot<'_, Self>,
1972 _: Self::Constraint,
1973 ) -> Result<(), ::fidl_next::ValidationError> {
1974 Ok(())
1975 }
1976 }
1977
1978 unsafe impl ::fidl_next::Wire for SampleSinkResult<'static> {
1979 type Narrowed<'de> = SampleSinkResult<'de>;
1980
1981 #[inline]
1982 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1983 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1984 ::fidl_next::wire::Union::zero_padding(raw);
1985 }
1986 }
1987
1988 impl<'de> SampleSinkResult<'de> {
1989 pub fn is_some(&self) -> bool {
1990 self.raw.is_some()
1991 }
1992
1993 pub fn is_none(&self) -> bool {
1994 self.raw.is_none()
1995 }
1996
1997 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::SampleSinkResult<'de>> {
1998 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1999 }
2000
2001 pub fn into_option(self) -> ::core::option::Option<crate::wire::SampleSinkResult<'de>> {
2002 if self.is_some() {
2003 Some(crate::wire::SampleSinkResult {
2004 raw: self.raw,
2005 _phantom: ::core::marker::PhantomData,
2006 })
2007 } else {
2008 None
2009 }
2010 }
2011 }
2012
2013 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSinkResult<'de>
2014 where
2015 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2016 ___D: ::fidl_next::Decoder<'de>,
2017 ___D: ::fidl_next::fuchsia::HandleDecoder,
2018 {
2019 fn decode(
2020 mut slot: ::fidl_next::Slot<'_, Self>,
2021 decoder: &mut ___D,
2022 _: (),
2023 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2024 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2025 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2026 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SampleReady<'de>>(
2027 raw,
2028 decoder,
2029 (),
2030 )?,
2031
2032 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::RuntimeError>(
2033 raw,
2034 decoder,
2035 (),
2036 )?,
2037
2038 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
2039 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
2040 }
2041
2042 Ok(())
2043 }
2044 }
2045
2046 impl<'de> ::core::fmt::Debug for SampleSinkResult<'de> {
2047 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2048 self.as_ref().fmt(f)
2049 }
2050 }
2051
2052 impl<'de> ::fidl_next::IntoNatural for SampleSinkResult<'de> {
2053 type Natural = ::core::option::Option<crate::natural::SampleSinkResult>;
2054 }
2055}
2056
2057pub mod generic {
2058
2059 pub use fidl_next_common_fuchsia_diagnostics::generic::*;
2060
2061 pub struct ArchiveAccessorStreamDiagnosticsRequest<T0, T1> {
2063 pub stream_parameters: T0,
2064
2065 pub result_stream: T1,
2066 }
2067
2068 unsafe impl<___E, T0, T1>
2069 ::fidl_next::Encode<crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>, ___E>
2070 for ArchiveAccessorStreamDiagnosticsRequest<T0, T1>
2071 where
2072 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2073 ___E: ::fidl_next::Encoder,
2074 ___E: ::fidl_next::fuchsia::HandleEncoder,
2075 T0: ::fidl_next::Encode<crate::wire::StreamParameters<'static>, ___E>,
2076 T1: ::fidl_next::Encode<
2077 ::fidl_next::ServerEnd<crate::BatchIterator, ::fidl_next::wire::fuchsia::Channel>,
2078 ___E,
2079 >,
2080 {
2081 #[inline]
2082 fn encode(
2083 self,
2084 encoder_: &mut ___E,
2085 out_: &mut ::core::mem::MaybeUninit<
2086 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
2087 >,
2088 _: (),
2089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2090 ::fidl_next::munge! {
2091 let crate::wire::ArchiveAccessorStreamDiagnosticsRequest {
2092 stream_parameters,
2093 result_stream,
2094
2095 } = out_;
2096 }
2097
2098 ::fidl_next::Encode::encode(self.stream_parameters, encoder_, stream_parameters, ())?;
2099
2100 ::fidl_next::Encode::encode(self.result_stream, encoder_, result_stream, ())?;
2101
2102 Ok(())
2103 }
2104 }
2105
2106 pub struct BatchIteratorGetNextResponse<T0> {
2108 pub batch: T0,
2109 }
2110
2111 unsafe impl<___E, T0>
2112 ::fidl_next::Encode<crate::wire::BatchIteratorGetNextResponse<'static>, ___E>
2113 for BatchIteratorGetNextResponse<T0>
2114 where
2115 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2116 ___E: ::fidl_next::Encoder,
2117 ___E: ::fidl_next::fuchsia::HandleEncoder,
2118 T0: ::fidl_next::Encode<
2119 ::fidl_next::wire::Vector<'static, crate::wire::FormattedContent<'static>>,
2120 ___E,
2121 >,
2122 {
2123 #[inline]
2124 fn encode(
2125 self,
2126 encoder_: &mut ___E,
2127 out_: &mut ::core::mem::MaybeUninit<crate::wire::BatchIteratorGetNextResponse<'static>>,
2128 _: (),
2129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2130 ::fidl_next::munge! {
2131 let crate::wire::BatchIteratorGetNextResponse {
2132 batch,
2133
2134 } = out_;
2135 }
2136
2137 ::fidl_next::Encode::encode(self.batch, encoder_, batch, (64, ()))?;
2138
2139 Ok(())
2140 }
2141 }
2142
2143 pub struct LogStreamConnectRequest<T0, T1> {
2145 pub socket: T0,
2146
2147 pub opts: T1,
2148 }
2149
2150 unsafe impl<___E, T0, T1>
2151 ::fidl_next::Encode<crate::wire::LogStreamConnectRequest<'static>, ___E>
2152 for LogStreamConnectRequest<T0, T1>
2153 where
2154 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2155 ___E: ::fidl_next::Encoder,
2156 ___E: ::fidl_next::fuchsia::HandleEncoder,
2157 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Socket, ___E>,
2158 T1: ::fidl_next::Encode<crate::wire::LogStreamOptions<'static>, ___E>,
2159 {
2160 #[inline]
2161 fn encode(
2162 self,
2163 encoder_: &mut ___E,
2164 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogStreamConnectRequest<'static>>,
2165 _: (),
2166 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2167 ::fidl_next::munge! {
2168 let crate::wire::LogStreamConnectRequest {
2169 socket,
2170 opts,
2171
2172 } = out_;
2173 }
2174
2175 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
2176
2177 ::fidl_next::Encode::encode(self.opts, encoder_, opts, ())?;
2178
2179 Ok(())
2180 }
2181 }
2182
2183 pub struct SampleSetRequest<T0> {
2185 pub sample_parameters: T0,
2186 }
2187
2188 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SampleSetRequest<'static>, ___E>
2189 for SampleSetRequest<T0>
2190 where
2191 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2192 ___E: ::fidl_next::Encoder,
2193 ___E: ::fidl_next::fuchsia::HandleEncoder,
2194 T0: ::fidl_next::Encode<crate::wire::SampleParameters<'static>, ___E>,
2195 {
2196 #[inline]
2197 fn encode(
2198 self,
2199 encoder_: &mut ___E,
2200 out_: &mut ::core::mem::MaybeUninit<crate::wire::SampleSetRequest<'static>>,
2201 _: (),
2202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2203 ::fidl_next::munge! {
2204 let crate::wire::SampleSetRequest {
2205 sample_parameters,
2206
2207 } = out_;
2208 }
2209
2210 ::fidl_next::Encode::encode(self.sample_parameters, encoder_, sample_parameters, ())?;
2211
2212 Ok(())
2213 }
2214 }
2215
2216 pub struct SampleCommitRequest<T0> {
2218 pub sink: T0,
2219 }
2220
2221 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SampleCommitRequest, ___E>
2222 for SampleCommitRequest<T0>
2223 where
2224 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2225 ___E: ::fidl_next::fuchsia::HandleEncoder,
2226 T0: ::fidl_next::Encode<
2227 ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
2228 ___E,
2229 >,
2230 {
2231 #[inline]
2232 fn encode(
2233 self,
2234 encoder_: &mut ___E,
2235 out_: &mut ::core::mem::MaybeUninit<crate::wire::SampleCommitRequest>,
2236 _: (),
2237 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2238 ::fidl_next::munge! {
2239 let crate::wire::SampleCommitRequest {
2240 sink,
2241
2242 } = out_;
2243 }
2244
2245 ::fidl_next::Encode::encode(self.sink, encoder_, sink, ())?;
2246
2247 Ok(())
2248 }
2249 }
2250
2251 pub struct SampleSinkOnSampleReadiedRequest<T0> {
2253 pub event: T0,
2254 }
2255
2256 unsafe impl<___E, T0>
2257 ::fidl_next::Encode<crate::wire::SampleSinkOnSampleReadiedRequest<'static>, ___E>
2258 for SampleSinkOnSampleReadiedRequest<T0>
2259 where
2260 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2261 ___E: ::fidl_next::Encoder,
2262 ___E: ::fidl_next::fuchsia::HandleEncoder,
2263 T0: ::fidl_next::Encode<crate::wire::SampleSinkResult<'static>, ___E>,
2264 {
2265 #[inline]
2266 fn encode(
2267 self,
2268 encoder_: &mut ___E,
2269 out_: &mut ::core::mem::MaybeUninit<
2270 crate::wire::SampleSinkOnSampleReadiedRequest<'static>,
2271 >,
2272 _: (),
2273 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2274 ::fidl_next::munge! {
2275 let crate::wire::SampleSinkOnSampleReadiedRequest {
2276 event,
2277
2278 } = out_;
2279 }
2280
2281 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
2282
2283 Ok(())
2284 }
2285 }
2286}
2287
2288pub use self::natural::*;
2289
2290#[doc = " Outer protocol for interacting with the different diagnostics data sources.\n"]
2292#[derive(PartialEq, Debug)]
2293pub struct ArchiveAccessor;
2294
2295impl ::fidl_next::Discoverable for ArchiveAccessor {
2296 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.ArchiveAccessor";
2297}
2298
2299#[cfg(target_os = "fuchsia")]
2300impl ::fidl_next::HasTransport for ArchiveAccessor {
2301 type Transport = ::fidl_next::fuchsia::zx::Channel;
2302}
2303
2304pub mod archive_accessor {
2305 pub mod prelude {
2306 pub use crate::{
2307 ArchiveAccessor, ArchiveAccessorClientHandler, ArchiveAccessorLocalClientHandler,
2308 ArchiveAccessorLocalServerHandler, ArchiveAccessorServerHandler, archive_accessor,
2309 };
2310
2311 pub use crate::natural::ArchiveAccessorStreamDiagnosticsRequest;
2312
2313 pub use crate::natural::ArchiveAccessorWaitForReadyResponse;
2314 }
2315
2316 pub struct StreamDiagnostics;
2317
2318 impl ::fidl_next::Method for StreamDiagnostics {
2319 const ORDINAL: u64 = 2361924900314496062;
2320 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2321 ::fidl_next::protocol::Flexibility::Flexible;
2322
2323 type Protocol = crate::ArchiveAccessor;
2324
2325 type Request = crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>;
2326 }
2327
2328 pub struct WaitForReady;
2329
2330 impl ::fidl_next::Method for WaitForReady {
2331 const ORDINAL: u64 = 1308686127901818148;
2332 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2333 ::fidl_next::protocol::Flexibility::Flexible;
2334
2335 type Protocol = crate::ArchiveAccessor;
2336
2337 type Request = ::fidl_next::wire::EmptyMessageBody;
2338 }
2339
2340 impl ::fidl_next::TwoWayMethod for WaitForReady {
2341 type Response =
2342 ::fidl_next::wire::Flexible<'static, crate::wire::ArchiveAccessorWaitForReadyResponse>;
2343 }
2344
2345 impl<___R> ::fidl_next::Respond<___R> for WaitForReady {
2346 type Output = ::fidl_next::Flexible<___R>;
2347
2348 fn respond(response: ___R) -> Self::Output {
2349 ::fidl_next::Flexible(response)
2350 }
2351 }
2352
2353 mod ___detail {
2354 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ArchiveAccessor
2355 where
2356 ___T: ::fidl_next::Transport,
2357 {
2358 type Client = ArchiveAccessorClient<___T>;
2359 type Server = ArchiveAccessorServer<___T>;
2360 }
2361
2362 #[repr(transparent)]
2364 pub struct ArchiveAccessorClient<___T: ::fidl_next::Transport> {
2365 #[allow(dead_code)]
2366 client: ::fidl_next::protocol::Client<___T>,
2367 }
2368
2369 impl<___T> ArchiveAccessorClient<___T>
2370 where
2371 ___T: ::fidl_next::Transport,
2372 {
2373 #[doc = " Creates an iterator over diagnostics data on the system.\n * The iterator may be finite by streaming in SNAPSHOT mode, serving only the\n current state of diagnostics data on the system.\n * The iterator may be infinite by streaming in either SNAPSHOT_THEN_SUBSCRIBE\n or SUBSCRIBE mode; the prior first provides iteration over the current state of\n the sytem, and then both provide ongoing iteration over newly arriving diagnostics\n data.\n\n + request `result stream` a [fuchsia.diagnostics/BatchIterator] that diagnostic\n records are exposed to the client over.\n * epitaphs:\n - INVALID_ARGS: A required argument in the StreamParameters struct was missing.\n - WRONG_TYPE: A selector provided by the StreamParameters struct was incorrectly\n formatted.\n\n + request `stream_parameters` is a [fuchsia.diagnostics/StreamParameter] which\n specifies how to configure the stream.\n"]
2374 pub fn stream_diagnostics(
2375 &self,
2376
2377 stream_parameters: impl ::fidl_next::Encode<
2378 crate::wire::StreamParameters<'static>,
2379 <___T as ::fidl_next::Transport>::SendBuffer,
2380 >,
2381
2382 result_stream: impl ::fidl_next::Encode<
2383 ::fidl_next::ServerEnd<
2384 crate::BatchIterator,
2385 ::fidl_next::wire::fuchsia::Channel,
2386 >,
2387 <___T as ::fidl_next::Transport>::SendBuffer,
2388 >,
2389 ) -> ::fidl_next::SendFuture<'_, ___T>
2390 where
2391 <___T as ::fidl_next::Transport>::SendBuffer:
2392 ::fidl_next::encoder::InternalHandleEncoder,
2393 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2394 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2395 {
2396 self.stream_diagnostics_with(
2397 crate::generic::ArchiveAccessorStreamDiagnosticsRequest {
2398 stream_parameters,
2399
2400 result_stream,
2401 },
2402 )
2403 }
2404
2405 #[doc = " Creates an iterator over diagnostics data on the system.\n * The iterator may be finite by streaming in SNAPSHOT mode, serving only the\n current state of diagnostics data on the system.\n * The iterator may be infinite by streaming in either SNAPSHOT_THEN_SUBSCRIBE\n or SUBSCRIBE mode; the prior first provides iteration over the current state of\n the sytem, and then both provide ongoing iteration over newly arriving diagnostics\n data.\n\n + request `result stream` a [fuchsia.diagnostics/BatchIterator] that diagnostic\n records are exposed to the client over.\n * epitaphs:\n - INVALID_ARGS: A required argument in the StreamParameters struct was missing.\n - WRONG_TYPE: A selector provided by the StreamParameters struct was incorrectly\n formatted.\n\n + request `stream_parameters` is a [fuchsia.diagnostics/StreamParameter] which\n specifies how to configure the stream.\n"]
2406 pub fn stream_diagnostics_with<___R>(
2407 &self,
2408 request: ___R,
2409 ) -> ::fidl_next::SendFuture<'_, ___T>
2410 where
2411 ___R: ::fidl_next::Encode<
2412 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
2413 <___T as ::fidl_next::Transport>::SendBuffer,
2414 >,
2415 {
2416 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
2417 2361924900314496062,
2418 <super::StreamDiagnostics as ::fidl_next::Method>::FLEXIBILITY,
2419 request,
2420 ))
2421 }
2422
2423 #[doc = " Ensures that the connection with the server was established to prevent\n races when using other pipelined methods of this protocol.\n"]
2424 pub fn wait_for_ready(
2425 &self,
2426 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForReady, ___T> {
2427 ::fidl_next::TwoWayFuture::from_untyped(
2428 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2429 1308686127901818148,
2430 <super::WaitForReady as ::fidl_next::Method>::FLEXIBILITY,
2431 (),
2432 ),
2433 )
2434 }
2435 }
2436
2437 #[repr(transparent)]
2439 pub struct ArchiveAccessorServer<___T: ::fidl_next::Transport> {
2440 server: ::fidl_next::protocol::Server<___T>,
2441 }
2442
2443 impl<___T> ArchiveAccessorServer<___T> where ___T: ::fidl_next::Transport {}
2444 }
2445}
2446
2447#[diagnostic::on_unimplemented(
2448 note = "If {Self} implements the non-local ArchiveAccessorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2449)]
2450
2451pub trait ArchiveAccessorLocalClientHandler<
2455 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2456 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2457>
2458{
2459 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2460 ::core::future::ready(())
2461 }
2462}
2463
2464impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ArchiveAccessor
2465where
2466 ___H: ArchiveAccessorLocalClientHandler<___T>,
2467 ___T: ::fidl_next::Transport,
2468{
2469 async fn on_event(
2470 handler: &mut ___H,
2471 mut message: ::fidl_next::Message<___T>,
2472 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2473 match *message.header().ordinal {
2474 ordinal => {
2475 handler.on_unknown_interaction(ordinal).await;
2476 if ::core::matches!(
2477 message.header().flexibility(),
2478 ::fidl_next::protocol::Flexibility::Strict
2479 ) {
2480 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2481 } else {
2482 Ok(())
2483 }
2484 }
2485 }
2486 }
2487}
2488
2489#[diagnostic::on_unimplemented(
2490 note = "If {Self} implements the non-local ArchiveAccessorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2491)]
2492
2493pub trait ArchiveAccessorLocalServerHandler<
2497 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2498 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2499>
2500{
2501 #[doc = " Creates an iterator over diagnostics data on the system.\n * The iterator may be finite by streaming in SNAPSHOT mode, serving only the\n current state of diagnostics data on the system.\n * The iterator may be infinite by streaming in either SNAPSHOT_THEN_SUBSCRIBE\n or SUBSCRIBE mode; the prior first provides iteration over the current state of\n the sytem, and then both provide ongoing iteration over newly arriving diagnostics\n data.\n\n + request `result stream` a [fuchsia.diagnostics/BatchIterator] that diagnostic\n records are exposed to the client over.\n * epitaphs:\n - INVALID_ARGS: A required argument in the StreamParameters struct was missing.\n - WRONG_TYPE: A selector provided by the StreamParameters struct was incorrectly\n formatted.\n\n + request `stream_parameters` is a [fuchsia.diagnostics/StreamParameter] which\n specifies how to configure the stream.\n"]
2502 fn stream_diagnostics(
2503 &mut self,
2504
2505 request: ::fidl_next::Request<archive_accessor::StreamDiagnostics, ___T>,
2506 ) -> impl ::core::future::Future<Output = ()>;
2507
2508 #[doc = " Ensures that the connection with the server was established to prevent\n races when using other pipelined methods of this protocol.\n"]
2509 fn wait_for_ready(
2510 &mut self,
2511
2512 responder: ::fidl_next::Responder<archive_accessor::WaitForReady, ___T>,
2513 ) -> impl ::core::future::Future<Output = ()>;
2514
2515 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2516 ::core::future::ready(())
2517 }
2518}
2519
2520impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ArchiveAccessor
2521where
2522 ___H: ArchiveAccessorLocalServerHandler<___T>,
2523 ___T: ::fidl_next::Transport,
2524 for<'de> crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'de>: ::fidl_next::Decode<
2525 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2526 Constraint = (),
2527 >,
2528{
2529 async fn on_one_way(
2530 handler: &mut ___H,
2531 mut message: ::fidl_next::Message<___T>,
2532 ) -> ::core::result::Result<
2533 (),
2534 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2535 > {
2536 match *message.header().ordinal {
2537 2361924900314496062 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2538 Ok(decoded) => {
2539 handler.stream_diagnostics(::fidl_next::Request::from_decoded(decoded)).await;
2540 Ok(())
2541 }
2542 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2543 ordinal: 2361924900314496062,
2544 error,
2545 }),
2546 },
2547
2548 ordinal => {
2549 handler.on_unknown_interaction(ordinal).await;
2550 if ::core::matches!(
2551 message.header().flexibility(),
2552 ::fidl_next::protocol::Flexibility::Strict
2553 ) {
2554 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2555 } else {
2556 Ok(())
2557 }
2558 }
2559 }
2560 }
2561
2562 async fn on_two_way(
2563 handler: &mut ___H,
2564 mut message: ::fidl_next::Message<___T>,
2565 responder: ::fidl_next::protocol::Responder<___T>,
2566 ) -> ::core::result::Result<
2567 (),
2568 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2569 > {
2570 match *message.header().ordinal {
2571 1308686127901818148 => {
2572 let responder = ::fidl_next::Responder::from_untyped(responder);
2573
2574 handler.wait_for_ready(responder).await;
2575 Ok(())
2576 }
2577
2578 ordinal => {
2579 handler.on_unknown_interaction(ordinal).await;
2580 if ::core::matches!(
2581 message.header().flexibility(),
2582 ::fidl_next::protocol::Flexibility::Strict
2583 ) {
2584 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2585 } else {
2586 responder
2587 .respond_framework_error(
2588 ordinal,
2589 ::fidl_next::FrameworkError::UnknownMethod,
2590 )
2591 .expect("encoding a framework error should never fail")
2592 .await?;
2593 Ok(())
2594 }
2595 }
2596 }
2597 }
2598}
2599
2600pub trait ArchiveAccessorClientHandler<
2604 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2605 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2606>
2607{
2608 fn on_unknown_interaction(
2609 &mut self,
2610 ordinal: u64,
2611 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2612 ::core::future::ready(())
2613 }
2614}
2615
2616impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ArchiveAccessor
2617where
2618 ___H: ArchiveAccessorClientHandler<___T> + ::core::marker::Send,
2619 ___T: ::fidl_next::Transport,
2620{
2621 async fn on_event(
2622 handler: &mut ___H,
2623 mut message: ::fidl_next::Message<___T>,
2624 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2625 match *message.header().ordinal {
2626 ordinal => {
2627 handler.on_unknown_interaction(ordinal).await;
2628 if ::core::matches!(
2629 message.header().flexibility(),
2630 ::fidl_next::protocol::Flexibility::Strict
2631 ) {
2632 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2633 } else {
2634 Ok(())
2635 }
2636 }
2637 }
2638 }
2639}
2640
2641pub trait ArchiveAccessorServerHandler<
2645 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2646 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2647>
2648{
2649 #[doc = " Creates an iterator over diagnostics data on the system.\n * The iterator may be finite by streaming in SNAPSHOT mode, serving only the\n current state of diagnostics data on the system.\n * The iterator may be infinite by streaming in either SNAPSHOT_THEN_SUBSCRIBE\n or SUBSCRIBE mode; the prior first provides iteration over the current state of\n the sytem, and then both provide ongoing iteration over newly arriving diagnostics\n data.\n\n + request `result stream` a [fuchsia.diagnostics/BatchIterator] that diagnostic\n records are exposed to the client over.\n * epitaphs:\n - INVALID_ARGS: A required argument in the StreamParameters struct was missing.\n - WRONG_TYPE: A selector provided by the StreamParameters struct was incorrectly\n formatted.\n\n + request `stream_parameters` is a [fuchsia.diagnostics/StreamParameter] which\n specifies how to configure the stream.\n"]
2650 fn stream_diagnostics(
2651 &mut self,
2652
2653 request: ::fidl_next::Request<archive_accessor::StreamDiagnostics, ___T>,
2654 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2655
2656 #[doc = " Ensures that the connection with the server was established to prevent\n races when using other pipelined methods of this protocol.\n"]
2657 fn wait_for_ready(
2658 &mut self,
2659
2660 responder: ::fidl_next::Responder<archive_accessor::WaitForReady, ___T>,
2661 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2662
2663 fn on_unknown_interaction(
2664 &mut self,
2665 ordinal: u64,
2666 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2667 ::core::future::ready(())
2668 }
2669}
2670
2671impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ArchiveAccessor
2672where
2673 ___H: ArchiveAccessorServerHandler<___T> + ::core::marker::Send,
2674 ___T: ::fidl_next::Transport,
2675 for<'de> crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'de>: ::fidl_next::Decode<
2676 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2677 Constraint = (),
2678 >,
2679{
2680 async fn on_one_way(
2681 handler: &mut ___H,
2682 mut message: ::fidl_next::Message<___T>,
2683 ) -> ::core::result::Result<
2684 (),
2685 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2686 > {
2687 match *message.header().ordinal {
2688 2361924900314496062 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2689 Ok(decoded) => {
2690 handler.stream_diagnostics(::fidl_next::Request::from_decoded(decoded)).await;
2691 Ok(())
2692 }
2693 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2694 ordinal: 2361924900314496062,
2695 error,
2696 }),
2697 },
2698
2699 ordinal => {
2700 handler.on_unknown_interaction(ordinal).await;
2701 if ::core::matches!(
2702 message.header().flexibility(),
2703 ::fidl_next::protocol::Flexibility::Strict
2704 ) {
2705 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2706 } else {
2707 Ok(())
2708 }
2709 }
2710 }
2711 }
2712
2713 async fn on_two_way(
2714 handler: &mut ___H,
2715 mut message: ::fidl_next::Message<___T>,
2716 responder: ::fidl_next::protocol::Responder<___T>,
2717 ) -> ::core::result::Result<
2718 (),
2719 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2720 > {
2721 match *message.header().ordinal {
2722 1308686127901818148 => {
2723 let responder = ::fidl_next::Responder::from_untyped(responder);
2724
2725 handler.wait_for_ready(responder).await;
2726 Ok(())
2727 }
2728
2729 ordinal => {
2730 handler.on_unknown_interaction(ordinal).await;
2731 if ::core::matches!(
2732 message.header().flexibility(),
2733 ::fidl_next::protocol::Flexibility::Strict
2734 ) {
2735 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2736 } else {
2737 responder
2738 .respond_framework_error(
2739 ordinal,
2740 ::fidl_next::FrameworkError::UnknownMethod,
2741 )
2742 .expect("encoding a framework error should never fail")
2743 .await?;
2744 Ok(())
2745 }
2746 }
2747 }
2748 }
2749}
2750
2751impl<___T> ArchiveAccessorClientHandler<___T> for ::fidl_next::IgnoreEvents
2752where
2753 ___T: ::fidl_next::Transport,
2754{
2755 async fn on_unknown_interaction(&mut self, _: u64) {}
2756}
2757
2758impl<___H, ___T> ArchiveAccessorLocalClientHandler<___T> for ::fidl_next::Local<___H>
2759where
2760 ___H: ArchiveAccessorClientHandler<___T>,
2761 ___T: ::fidl_next::Transport,
2762{
2763 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2764 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2765 }
2766}
2767
2768impl<___H, ___T> ArchiveAccessorLocalServerHandler<___T> for ::fidl_next::Local<___H>
2769where
2770 ___H: ArchiveAccessorServerHandler<___T>,
2771 ___T: ::fidl_next::Transport,
2772{
2773 async fn stream_diagnostics(
2774 &mut self,
2775
2776 request: ::fidl_next::Request<archive_accessor::StreamDiagnostics, ___T>,
2777 ) {
2778 ___H::stream_diagnostics(&mut self.0, request).await
2779 }
2780
2781 async fn wait_for_ready(
2782 &mut self,
2783
2784 responder: ::fidl_next::Responder<archive_accessor::WaitForReady, ___T>,
2785 ) {
2786 ___H::wait_for_ready(&mut self.0, responder).await
2787 }
2788
2789 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2790 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2791 }
2792}
2793
2794#[doc = " Conceptually, a directory iterator, where each element in the iterator is a single\n complete file that can be concatenated with other results.\n"]
2796#[derive(PartialEq, Debug)]
2797pub struct BatchIterator;
2798
2799#[cfg(target_os = "fuchsia")]
2800impl ::fidl_next::HasTransport for BatchIterator {
2801 type Transport = ::fidl_next::fuchsia::zx::Channel;
2802}
2803
2804pub mod batch_iterator {
2805 pub mod prelude {
2806 pub use crate::{
2807 BatchIterator, BatchIteratorClientHandler, BatchIteratorLocalClientHandler,
2808 BatchIteratorLocalServerHandler, BatchIteratorServerHandler, batch_iterator,
2809 };
2810
2811 pub use crate::natural::BatchIteratorGetNextResponse;
2812
2813 pub use crate::natural::BatchIteratorWaitForReadyResponse;
2814
2815 pub use crate::natural::ReaderError;
2816 }
2817
2818 pub struct GetNext;
2819
2820 impl ::fidl_next::Method for GetNext {
2821 const ORDINAL: u64 = 8654095804583269541;
2822 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2823 ::fidl_next::protocol::Flexibility::Flexible;
2824
2825 type Protocol = crate::BatchIterator;
2826
2827 type Request = ::fidl_next::wire::EmptyMessageBody;
2828 }
2829
2830 impl ::fidl_next::TwoWayMethod for GetNext {
2831 type Response = ::fidl_next::wire::Result<
2832 'static,
2833 crate::wire::BatchIteratorGetNextResponse<'static>,
2834 crate::wire::ReaderError,
2835 >;
2836 }
2837
2838 impl<___R> ::fidl_next::Respond<___R> for GetNext {
2839 type Output = ::core::result::Result<
2840 crate::generic::BatchIteratorGetNextResponse<___R>,
2841 ::fidl_next::never::Never,
2842 >;
2843
2844 fn respond(response: ___R) -> Self::Output {
2845 ::core::result::Result::Ok(crate::generic::BatchIteratorGetNextResponse {
2846 batch: response,
2847 })
2848 }
2849 }
2850
2851 impl<___R> ::fidl_next::RespondErr<___R> for GetNext {
2852 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2853
2854 fn respond_err(response: ___R) -> Self::Output {
2855 ::core::result::Result::Err(response)
2856 }
2857 }
2858
2859 pub struct WaitForReady;
2860
2861 impl ::fidl_next::Method for WaitForReady {
2862 const ORDINAL: u64 = 8095658908390618627;
2863 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2864 ::fidl_next::protocol::Flexibility::Flexible;
2865
2866 type Protocol = crate::BatchIterator;
2867
2868 type Request = ::fidl_next::wire::EmptyMessageBody;
2869 }
2870
2871 impl ::fidl_next::TwoWayMethod for WaitForReady {
2872 type Response =
2873 ::fidl_next::wire::Flexible<'static, crate::wire::BatchIteratorWaitForReadyResponse>;
2874 }
2875
2876 impl<___R> ::fidl_next::Respond<___R> for WaitForReady {
2877 type Output = ::fidl_next::Flexible<___R>;
2878
2879 fn respond(response: ___R) -> Self::Output {
2880 ::fidl_next::Flexible(response)
2881 }
2882 }
2883
2884 mod ___detail {
2885 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::BatchIterator
2886 where
2887 ___T: ::fidl_next::Transport,
2888 {
2889 type Client = BatchIteratorClient<___T>;
2890 type Server = BatchIteratorServer<___T>;
2891 }
2892
2893 #[repr(transparent)]
2895 pub struct BatchIteratorClient<___T: ::fidl_next::Transport> {
2896 #[allow(dead_code)]
2897 client: ::fidl_next::protocol::Client<___T>,
2898 }
2899
2900 impl<___T> BatchIteratorClient<___T>
2901 where
2902 ___T: ::fidl_next::Transport,
2903 {
2904 #[doc = " Returns a vector of [fuchsia.diagnostics/FormattedContent] structs\n with a format dictated by the format_settings argument provided to the Reader protocol\n which spawned this BatchIterator.\n\n An empty vector implies that the data hierarchy has been fully iterated, and subsequent\n GetNext calls will always return the empty vector.\n\n When the BatchIterator is serving results via subscription model, calls to GetNext will\n hang until there is new data available, it will not return an empty vector.\n\n - returns a vector of FormattedContent structs. Clients connected to a\n Batch are expected to call GetNext() until an empty vector\n is returned, denoting that the entire data hierarchy has been read.\n\n * error a [fuchsia.diagnostics/ReaderError]\n value indicating that there was an issue reading the underlying data hierarchies\n or formatting those hierarchies to populate the `batch`. Note, these\n issues do not include a single component\'s data hierarchy failing to be read.\n The iterator is tolerant of individual component data sources failing to be read,\n whether that failure is a timeout or a malformed binary file.\n In the event that a GetNext call fails, that subset of the data hierarchy results is\n dropped, but future calls to GetNext will provide new subsets of\n FormattedDataHierarchies.\n"]
2905 pub fn get_next(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetNext, ___T> {
2906 ::fidl_next::TwoWayFuture::from_untyped(
2907 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2908 8654095804583269541,
2909 <super::GetNext as ::fidl_next::Method>::FLEXIBILITY,
2910 (),
2911 ),
2912 )
2913 }
2914
2915 #[doc = " Indicates that the BatchIterator has been connected. If the\n BatchIterator hasn\'t been connected, this method will hang until it is.\n"]
2916 pub fn wait_for_ready(
2917 &self,
2918 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForReady, ___T> {
2919 ::fidl_next::TwoWayFuture::from_untyped(
2920 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2921 8095658908390618627,
2922 <super::WaitForReady as ::fidl_next::Method>::FLEXIBILITY,
2923 (),
2924 ),
2925 )
2926 }
2927 }
2928
2929 #[repr(transparent)]
2931 pub struct BatchIteratorServer<___T: ::fidl_next::Transport> {
2932 server: ::fidl_next::protocol::Server<___T>,
2933 }
2934
2935 impl<___T> BatchIteratorServer<___T> where ___T: ::fidl_next::Transport {}
2936 }
2937}
2938
2939#[diagnostic::on_unimplemented(
2940 note = "If {Self} implements the non-local BatchIteratorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2941)]
2942
2943pub trait BatchIteratorLocalClientHandler<
2947 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2948 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2949>
2950{
2951 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2952 ::core::future::ready(())
2953 }
2954}
2955
2956impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for BatchIterator
2957where
2958 ___H: BatchIteratorLocalClientHandler<___T>,
2959 ___T: ::fidl_next::Transport,
2960{
2961 async fn on_event(
2962 handler: &mut ___H,
2963 mut message: ::fidl_next::Message<___T>,
2964 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2965 match *message.header().ordinal {
2966 ordinal => {
2967 handler.on_unknown_interaction(ordinal).await;
2968 if ::core::matches!(
2969 message.header().flexibility(),
2970 ::fidl_next::protocol::Flexibility::Strict
2971 ) {
2972 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2973 } else {
2974 Ok(())
2975 }
2976 }
2977 }
2978 }
2979}
2980
2981#[diagnostic::on_unimplemented(
2982 note = "If {Self} implements the non-local BatchIteratorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2983)]
2984
2985pub trait BatchIteratorLocalServerHandler<
2989 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2990 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2991>
2992{
2993 #[doc = " Returns a vector of [fuchsia.diagnostics/FormattedContent] structs\n with a format dictated by the format_settings argument provided to the Reader protocol\n which spawned this BatchIterator.\n\n An empty vector implies that the data hierarchy has been fully iterated, and subsequent\n GetNext calls will always return the empty vector.\n\n When the BatchIterator is serving results via subscription model, calls to GetNext will\n hang until there is new data available, it will not return an empty vector.\n\n - returns a vector of FormattedContent structs. Clients connected to a\n Batch are expected to call GetNext() until an empty vector\n is returned, denoting that the entire data hierarchy has been read.\n\n * error a [fuchsia.diagnostics/ReaderError]\n value indicating that there was an issue reading the underlying data hierarchies\n or formatting those hierarchies to populate the `batch`. Note, these\n issues do not include a single component\'s data hierarchy failing to be read.\n The iterator is tolerant of individual component data sources failing to be read,\n whether that failure is a timeout or a malformed binary file.\n In the event that a GetNext call fails, that subset of the data hierarchy results is\n dropped, but future calls to GetNext will provide new subsets of\n FormattedDataHierarchies.\n"]
2994 fn get_next(
2995 &mut self,
2996
2997 responder: ::fidl_next::Responder<batch_iterator::GetNext, ___T>,
2998 ) -> impl ::core::future::Future<Output = ()>;
2999
3000 #[doc = " Indicates that the BatchIterator has been connected. If the\n BatchIterator hasn\'t been connected, this method will hang until it is.\n"]
3001 fn wait_for_ready(
3002 &mut self,
3003
3004 responder: ::fidl_next::Responder<batch_iterator::WaitForReady, ___T>,
3005 ) -> impl ::core::future::Future<Output = ()>;
3006
3007 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3008 ::core::future::ready(())
3009 }
3010}
3011
3012impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for BatchIterator
3013where
3014 ___H: BatchIteratorLocalServerHandler<___T>,
3015 ___T: ::fidl_next::Transport,
3016{
3017 async fn on_one_way(
3018 handler: &mut ___H,
3019 mut message: ::fidl_next::Message<___T>,
3020 ) -> ::core::result::Result<
3021 (),
3022 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3023 > {
3024 match *message.header().ordinal {
3025 ordinal => {
3026 handler.on_unknown_interaction(ordinal).await;
3027 if ::core::matches!(
3028 message.header().flexibility(),
3029 ::fidl_next::protocol::Flexibility::Strict
3030 ) {
3031 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3032 } else {
3033 Ok(())
3034 }
3035 }
3036 }
3037 }
3038
3039 async fn on_two_way(
3040 handler: &mut ___H,
3041 mut message: ::fidl_next::Message<___T>,
3042 responder: ::fidl_next::protocol::Responder<___T>,
3043 ) -> ::core::result::Result<
3044 (),
3045 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3046 > {
3047 match *message.header().ordinal {
3048 8654095804583269541 => {
3049 let responder = ::fidl_next::Responder::from_untyped(responder);
3050
3051 handler.get_next(responder).await;
3052 Ok(())
3053 }
3054
3055 8095658908390618627 => {
3056 let responder = ::fidl_next::Responder::from_untyped(responder);
3057
3058 handler.wait_for_ready(responder).await;
3059 Ok(())
3060 }
3061
3062 ordinal => {
3063 handler.on_unknown_interaction(ordinal).await;
3064 if ::core::matches!(
3065 message.header().flexibility(),
3066 ::fidl_next::protocol::Flexibility::Strict
3067 ) {
3068 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3069 } else {
3070 responder
3071 .respond_framework_error(
3072 ordinal,
3073 ::fidl_next::FrameworkError::UnknownMethod,
3074 )
3075 .expect("encoding a framework error should never fail")
3076 .await?;
3077 Ok(())
3078 }
3079 }
3080 }
3081 }
3082}
3083
3084pub trait BatchIteratorClientHandler<
3088 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3089 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3090>
3091{
3092 fn on_unknown_interaction(
3093 &mut self,
3094 ordinal: u64,
3095 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3096 ::core::future::ready(())
3097 }
3098}
3099
3100impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for BatchIterator
3101where
3102 ___H: BatchIteratorClientHandler<___T> + ::core::marker::Send,
3103 ___T: ::fidl_next::Transport,
3104{
3105 async fn on_event(
3106 handler: &mut ___H,
3107 mut message: ::fidl_next::Message<___T>,
3108 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3109 match *message.header().ordinal {
3110 ordinal => {
3111 handler.on_unknown_interaction(ordinal).await;
3112 if ::core::matches!(
3113 message.header().flexibility(),
3114 ::fidl_next::protocol::Flexibility::Strict
3115 ) {
3116 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3117 } else {
3118 Ok(())
3119 }
3120 }
3121 }
3122 }
3123}
3124
3125pub trait BatchIteratorServerHandler<
3129 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3130 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3131>
3132{
3133 #[doc = " Returns a vector of [fuchsia.diagnostics/FormattedContent] structs\n with a format dictated by the format_settings argument provided to the Reader protocol\n which spawned this BatchIterator.\n\n An empty vector implies that the data hierarchy has been fully iterated, and subsequent\n GetNext calls will always return the empty vector.\n\n When the BatchIterator is serving results via subscription model, calls to GetNext will\n hang until there is new data available, it will not return an empty vector.\n\n - returns a vector of FormattedContent structs. Clients connected to a\n Batch are expected to call GetNext() until an empty vector\n is returned, denoting that the entire data hierarchy has been read.\n\n * error a [fuchsia.diagnostics/ReaderError]\n value indicating that there was an issue reading the underlying data hierarchies\n or formatting those hierarchies to populate the `batch`. Note, these\n issues do not include a single component\'s data hierarchy failing to be read.\n The iterator is tolerant of individual component data sources failing to be read,\n whether that failure is a timeout or a malformed binary file.\n In the event that a GetNext call fails, that subset of the data hierarchy results is\n dropped, but future calls to GetNext will provide new subsets of\n FormattedDataHierarchies.\n"]
3134 fn get_next(
3135 &mut self,
3136
3137 responder: ::fidl_next::Responder<batch_iterator::GetNext, ___T>,
3138 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3139
3140 #[doc = " Indicates that the BatchIterator has been connected. If the\n BatchIterator hasn\'t been connected, this method will hang until it is.\n"]
3141 fn wait_for_ready(
3142 &mut self,
3143
3144 responder: ::fidl_next::Responder<batch_iterator::WaitForReady, ___T>,
3145 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3146
3147 fn on_unknown_interaction(
3148 &mut self,
3149 ordinal: u64,
3150 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3151 ::core::future::ready(())
3152 }
3153}
3154
3155impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for BatchIterator
3156where
3157 ___H: BatchIteratorServerHandler<___T> + ::core::marker::Send,
3158 ___T: ::fidl_next::Transport,
3159{
3160 async fn on_one_way(
3161 handler: &mut ___H,
3162 mut message: ::fidl_next::Message<___T>,
3163 ) -> ::core::result::Result<
3164 (),
3165 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3166 > {
3167 match *message.header().ordinal {
3168 ordinal => {
3169 handler.on_unknown_interaction(ordinal).await;
3170 if ::core::matches!(
3171 message.header().flexibility(),
3172 ::fidl_next::protocol::Flexibility::Strict
3173 ) {
3174 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3175 } else {
3176 Ok(())
3177 }
3178 }
3179 }
3180 }
3181
3182 async fn on_two_way(
3183 handler: &mut ___H,
3184 mut message: ::fidl_next::Message<___T>,
3185 responder: ::fidl_next::protocol::Responder<___T>,
3186 ) -> ::core::result::Result<
3187 (),
3188 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3189 > {
3190 match *message.header().ordinal {
3191 8654095804583269541 => {
3192 let responder = ::fidl_next::Responder::from_untyped(responder);
3193
3194 handler.get_next(responder).await;
3195 Ok(())
3196 }
3197
3198 8095658908390618627 => {
3199 let responder = ::fidl_next::Responder::from_untyped(responder);
3200
3201 handler.wait_for_ready(responder).await;
3202 Ok(())
3203 }
3204
3205 ordinal => {
3206 handler.on_unknown_interaction(ordinal).await;
3207 if ::core::matches!(
3208 message.header().flexibility(),
3209 ::fidl_next::protocol::Flexibility::Strict
3210 ) {
3211 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3212 } else {
3213 responder
3214 .respond_framework_error(
3215 ordinal,
3216 ::fidl_next::FrameworkError::UnknownMethod,
3217 )
3218 .expect("encoding a framework error should never fail")
3219 .await?;
3220 Ok(())
3221 }
3222 }
3223 }
3224 }
3225}
3226
3227impl<___T> BatchIteratorClientHandler<___T> for ::fidl_next::IgnoreEvents
3228where
3229 ___T: ::fidl_next::Transport,
3230{
3231 async fn on_unknown_interaction(&mut self, _: u64) {}
3232}
3233
3234impl<___H, ___T> BatchIteratorLocalClientHandler<___T> for ::fidl_next::Local<___H>
3235where
3236 ___H: BatchIteratorClientHandler<___T>,
3237 ___T: ::fidl_next::Transport,
3238{
3239 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3240 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3241 }
3242}
3243
3244impl<___H, ___T> BatchIteratorLocalServerHandler<___T> for ::fidl_next::Local<___H>
3245where
3246 ___H: BatchIteratorServerHandler<___T>,
3247 ___T: ::fidl_next::Transport,
3248{
3249 async fn get_next(&mut self, responder: ::fidl_next::Responder<batch_iterator::GetNext, ___T>) {
3250 ___H::get_next(&mut self.0, responder).await
3251 }
3252
3253 async fn wait_for_ready(
3254 &mut self,
3255
3256 responder: ::fidl_next::Responder<batch_iterator::WaitForReady, ___T>,
3257 ) {
3258 ___H::wait_for_ready(&mut self.0, responder).await
3259 }
3260
3261 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3262 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3263 }
3264}
3265
3266#[derive(PartialEq, Debug)]
3268pub struct LogStream;
3269
3270impl ::fidl_next::Discoverable for LogStream {
3271 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.LogStream";
3272}
3273
3274#[cfg(target_os = "fuchsia")]
3275impl ::fidl_next::HasTransport for LogStream {
3276 type Transport = ::fidl_next::fuchsia::zx::Channel;
3277}
3278
3279pub mod log_stream {
3280 pub mod prelude {
3281 pub use crate::{
3282 LogStream, LogStreamClientHandler, LogStreamLocalClientHandler,
3283 LogStreamLocalServerHandler, LogStreamServerHandler, log_stream,
3284 };
3285
3286 pub use crate::natural::LogStreamConnectRequest;
3287 }
3288
3289 pub struct Connect;
3290
3291 impl ::fidl_next::Method for Connect {
3292 const ORDINAL: u64 = 8385336708376631944;
3293 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3294 ::fidl_next::protocol::Flexibility::Flexible;
3295
3296 type Protocol = crate::LogStream;
3297
3298 type Request = crate::wire::LogStreamConnectRequest<'static>;
3299 }
3300
3301 mod ___detail {
3302 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogStream
3303 where
3304 ___T: ::fidl_next::Transport,
3305 {
3306 type Client = LogStreamClient<___T>;
3307 type Server = LogStreamServer<___T>;
3308 }
3309
3310 #[repr(transparent)]
3312 pub struct LogStreamClient<___T: ::fidl_next::Transport> {
3313 #[allow(dead_code)]
3314 client: ::fidl_next::protocol::Client<___T>,
3315 }
3316
3317 impl<___T> LogStreamClient<___T>
3318 where
3319 ___T: ::fidl_next::Transport,
3320 {
3321 #[doc = " Enables clients to stream all logs stored in the Archivist.\n Expects a datagram or stream socket handle that can be written to.\n If subscribe_to_manifest is used, a stream socket is required,\n otherwise either a stream or datagram socket can be used.\n\n Logs will be written in the original FXT format with two additional\n arguments appended at the end of the record depending on the options\n passed:\n\n - `$__moniker`: the moniker of the component that emitted the log.\n - `$__url`: the URL of the component that emitted the log.\n - `$__rolled_out`: the number of logs that were rolled out from the\n buffer before this one.\n"]
3322 pub fn connect(
3323 &self,
3324
3325 socket: impl ::fidl_next::Encode<
3326 ::fidl_next::wire::fuchsia::Socket,
3327 <___T as ::fidl_next::Transport>::SendBuffer,
3328 >,
3329
3330 opts: impl ::fidl_next::Encode<
3331 crate::wire::LogStreamOptions<'static>,
3332 <___T as ::fidl_next::Transport>::SendBuffer,
3333 >,
3334 ) -> ::fidl_next::SendFuture<'_, ___T>
3335 where
3336 <___T as ::fidl_next::Transport>::SendBuffer:
3337 ::fidl_next::encoder::InternalHandleEncoder,
3338 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3339 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3340 {
3341 self.connect_with(crate::generic::LogStreamConnectRequest { socket, opts })
3342 }
3343
3344 #[doc = " Enables clients to stream all logs stored in the Archivist.\n Expects a datagram or stream socket handle that can be written to.\n If subscribe_to_manifest is used, a stream socket is required,\n otherwise either a stream or datagram socket can be used.\n\n Logs will be written in the original FXT format with two additional\n arguments appended at the end of the record depending on the options\n passed:\n\n - `$__moniker`: the moniker of the component that emitted the log.\n - `$__url`: the URL of the component that emitted the log.\n - `$__rolled_out`: the number of logs that were rolled out from the\n buffer before this one.\n"]
3345 pub fn connect_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3346 where
3347 ___R: ::fidl_next::Encode<
3348 crate::wire::LogStreamConnectRequest<'static>,
3349 <___T as ::fidl_next::Transport>::SendBuffer,
3350 >,
3351 {
3352 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3353 8385336708376631944,
3354 <super::Connect as ::fidl_next::Method>::FLEXIBILITY,
3355 request,
3356 ))
3357 }
3358 }
3359
3360 #[repr(transparent)]
3362 pub struct LogStreamServer<___T: ::fidl_next::Transport> {
3363 server: ::fidl_next::protocol::Server<___T>,
3364 }
3365
3366 impl<___T> LogStreamServer<___T> where ___T: ::fidl_next::Transport {}
3367 }
3368}
3369
3370#[diagnostic::on_unimplemented(
3371 note = "If {Self} implements the non-local LogStreamClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3372)]
3373
3374pub trait LogStreamLocalClientHandler<
3378 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3379 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3380>
3381{
3382 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3383 ::core::future::ready(())
3384 }
3385}
3386
3387impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogStream
3388where
3389 ___H: LogStreamLocalClientHandler<___T>,
3390 ___T: ::fidl_next::Transport,
3391{
3392 async fn on_event(
3393 handler: &mut ___H,
3394 mut message: ::fidl_next::Message<___T>,
3395 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3396 match *message.header().ordinal {
3397 ordinal => {
3398 handler.on_unknown_interaction(ordinal).await;
3399 if ::core::matches!(
3400 message.header().flexibility(),
3401 ::fidl_next::protocol::Flexibility::Strict
3402 ) {
3403 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3404 } else {
3405 Ok(())
3406 }
3407 }
3408 }
3409 }
3410}
3411
3412#[diagnostic::on_unimplemented(
3413 note = "If {Self} implements the non-local LogStreamServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3414)]
3415
3416pub trait LogStreamLocalServerHandler<
3420 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3421 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3422>
3423{
3424 #[doc = " Enables clients to stream all logs stored in the Archivist.\n Expects a datagram or stream socket handle that can be written to.\n If subscribe_to_manifest is used, a stream socket is required,\n otherwise either a stream or datagram socket can be used.\n\n Logs will be written in the original FXT format with two additional\n arguments appended at the end of the record depending on the options\n passed:\n\n - `$__moniker`: the moniker of the component that emitted the log.\n - `$__url`: the URL of the component that emitted the log.\n - `$__rolled_out`: the number of logs that were rolled out from the\n buffer before this one.\n"]
3425 fn connect(
3426 &mut self,
3427
3428 request: ::fidl_next::Request<log_stream::Connect, ___T>,
3429 ) -> impl ::core::future::Future<Output = ()>;
3430
3431 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3432 ::core::future::ready(())
3433 }
3434}
3435
3436impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogStream
3437where
3438 ___H: LogStreamLocalServerHandler<___T>,
3439 ___T: ::fidl_next::Transport,
3440 for<'de> crate::wire::LogStreamConnectRequest<'de>: ::fidl_next::Decode<
3441 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3442 Constraint = (),
3443 >,
3444{
3445 async fn on_one_way(
3446 handler: &mut ___H,
3447 mut message: ::fidl_next::Message<___T>,
3448 ) -> ::core::result::Result<
3449 (),
3450 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3451 > {
3452 match *message.header().ordinal {
3453 8385336708376631944 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3454 Ok(decoded) => {
3455 handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
3456 Ok(())
3457 }
3458 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3459 ordinal: 8385336708376631944,
3460 error,
3461 }),
3462 },
3463
3464 ordinal => {
3465 handler.on_unknown_interaction(ordinal).await;
3466 if ::core::matches!(
3467 message.header().flexibility(),
3468 ::fidl_next::protocol::Flexibility::Strict
3469 ) {
3470 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3471 } else {
3472 Ok(())
3473 }
3474 }
3475 }
3476 }
3477
3478 async fn on_two_way(
3479 handler: &mut ___H,
3480 mut message: ::fidl_next::Message<___T>,
3481 responder: ::fidl_next::protocol::Responder<___T>,
3482 ) -> ::core::result::Result<
3483 (),
3484 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3485 > {
3486 match *message.header().ordinal {
3487 ordinal => {
3488 handler.on_unknown_interaction(ordinal).await;
3489 if ::core::matches!(
3490 message.header().flexibility(),
3491 ::fidl_next::protocol::Flexibility::Strict
3492 ) {
3493 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3494 } else {
3495 responder
3496 .respond_framework_error(
3497 ordinal,
3498 ::fidl_next::FrameworkError::UnknownMethod,
3499 )
3500 .expect("encoding a framework error should never fail")
3501 .await?;
3502 Ok(())
3503 }
3504 }
3505 }
3506 }
3507}
3508
3509pub trait LogStreamClientHandler<
3513 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3514 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3515>
3516{
3517 fn on_unknown_interaction(
3518 &mut self,
3519 ordinal: u64,
3520 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3521 ::core::future::ready(())
3522 }
3523}
3524
3525impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogStream
3526where
3527 ___H: LogStreamClientHandler<___T> + ::core::marker::Send,
3528 ___T: ::fidl_next::Transport,
3529{
3530 async fn on_event(
3531 handler: &mut ___H,
3532 mut message: ::fidl_next::Message<___T>,
3533 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3534 match *message.header().ordinal {
3535 ordinal => {
3536 handler.on_unknown_interaction(ordinal).await;
3537 if ::core::matches!(
3538 message.header().flexibility(),
3539 ::fidl_next::protocol::Flexibility::Strict
3540 ) {
3541 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3542 } else {
3543 Ok(())
3544 }
3545 }
3546 }
3547 }
3548}
3549
3550pub trait LogStreamServerHandler<
3554 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3555 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3556>
3557{
3558 #[doc = " Enables clients to stream all logs stored in the Archivist.\n Expects a datagram or stream socket handle that can be written to.\n If subscribe_to_manifest is used, a stream socket is required,\n otherwise either a stream or datagram socket can be used.\n\n Logs will be written in the original FXT format with two additional\n arguments appended at the end of the record depending on the options\n passed:\n\n - `$__moniker`: the moniker of the component that emitted the log.\n - `$__url`: the URL of the component that emitted the log.\n - `$__rolled_out`: the number of logs that were rolled out from the\n buffer before this one.\n"]
3559 fn connect(
3560 &mut self,
3561
3562 request: ::fidl_next::Request<log_stream::Connect, ___T>,
3563 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3564
3565 fn on_unknown_interaction(
3566 &mut self,
3567 ordinal: u64,
3568 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3569 ::core::future::ready(())
3570 }
3571}
3572
3573impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogStream
3574where
3575 ___H: LogStreamServerHandler<___T> + ::core::marker::Send,
3576 ___T: ::fidl_next::Transport,
3577 for<'de> crate::wire::LogStreamConnectRequest<'de>: ::fidl_next::Decode<
3578 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3579 Constraint = (),
3580 >,
3581{
3582 async fn on_one_way(
3583 handler: &mut ___H,
3584 mut message: ::fidl_next::Message<___T>,
3585 ) -> ::core::result::Result<
3586 (),
3587 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3588 > {
3589 match *message.header().ordinal {
3590 8385336708376631944 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3591 Ok(decoded) => {
3592 handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
3593 Ok(())
3594 }
3595 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3596 ordinal: 8385336708376631944,
3597 error,
3598 }),
3599 },
3600
3601 ordinal => {
3602 handler.on_unknown_interaction(ordinal).await;
3603 if ::core::matches!(
3604 message.header().flexibility(),
3605 ::fidl_next::protocol::Flexibility::Strict
3606 ) {
3607 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3608 } else {
3609 Ok(())
3610 }
3611 }
3612 }
3613 }
3614
3615 async fn on_two_way(
3616 handler: &mut ___H,
3617 mut message: ::fidl_next::Message<___T>,
3618 responder: ::fidl_next::protocol::Responder<___T>,
3619 ) -> ::core::result::Result<
3620 (),
3621 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3622 > {
3623 match *message.header().ordinal {
3624 ordinal => {
3625 handler.on_unknown_interaction(ordinal).await;
3626 if ::core::matches!(
3627 message.header().flexibility(),
3628 ::fidl_next::protocol::Flexibility::Strict
3629 ) {
3630 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3631 } else {
3632 responder
3633 .respond_framework_error(
3634 ordinal,
3635 ::fidl_next::FrameworkError::UnknownMethod,
3636 )
3637 .expect("encoding a framework error should never fail")
3638 .await?;
3639 Ok(())
3640 }
3641 }
3642 }
3643 }
3644}
3645
3646impl<___T> LogStreamClientHandler<___T> for ::fidl_next::IgnoreEvents
3647where
3648 ___T: ::fidl_next::Transport,
3649{
3650 async fn on_unknown_interaction(&mut self, _: u64) {}
3651}
3652
3653impl<___H, ___T> LogStreamLocalClientHandler<___T> for ::fidl_next::Local<___H>
3654where
3655 ___H: LogStreamClientHandler<___T>,
3656 ___T: ::fidl_next::Transport,
3657{
3658 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3659 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3660 }
3661}
3662
3663impl<___H, ___T> LogStreamLocalServerHandler<___T> for ::fidl_next::Local<___H>
3664where
3665 ___H: LogStreamServerHandler<___T>,
3666 ___T: ::fidl_next::Transport,
3667{
3668 async fn connect(&mut self, request: ::fidl_next::Request<log_stream::Connect, ___T>) {
3669 ___H::connect(&mut self.0, request).await
3670 }
3671
3672 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3673 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3674 }
3675}
3676
3677#[doc = " Configure Archivist to alert you periodically about the state of data\n provided via `SampleParameters`.\n\n If the given configuration results in a hit, a `BatchIterator` is sent\n over the `sink` provided. That iterator may be drained, and then the\n `sink` will go quiet until the next hit.\n\n Archivist does not inform the client which data result in a success,\n because it has not inherent advantaged ability to do so. Clients who\n need to know which data was queried should cache their selectors and\n use `selectors::select_from_hierarchy` (or similar in C++).\n"]
3679#[derive(PartialEq, Debug)]
3680pub struct Sample;
3681
3682impl ::fidl_next::Discoverable for Sample {
3683 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.Sample";
3684}
3685
3686#[cfg(target_os = "fuchsia")]
3687impl ::fidl_next::HasTransport for Sample {
3688 type Transport = ::fidl_next::fuchsia::zx::Channel;
3689}
3690
3691pub mod sample {
3692 pub mod prelude {
3693 pub use crate::{
3694 Sample, SampleClientHandler, SampleLocalClientHandler, SampleLocalServerHandler,
3695 SampleServerHandler, sample,
3696 };
3697
3698 pub use crate::natural::ConfigurationError;
3699
3700 pub use crate::natural::SampleCommitRequest;
3701
3702 pub use crate::natural::SampleSetRequest;
3703
3704 pub use crate::natural::SampleCommitResponse;
3705 }
3706
3707 pub struct Set;
3708
3709 impl ::fidl_next::Method for Set {
3710 const ORDINAL: u64 = 4763253411762487694;
3711 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3712 ::fidl_next::protocol::Flexibility::Flexible;
3713
3714 type Protocol = crate::Sample;
3715
3716 type Request = crate::wire::SampleSetRequest<'static>;
3717 }
3718
3719 pub struct Commit;
3720
3721 impl ::fidl_next::Method for Commit {
3722 const ORDINAL: u64 = 2712218517460516507;
3723 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3724 ::fidl_next::protocol::Flexibility::Flexible;
3725
3726 type Protocol = crate::Sample;
3727
3728 type Request = crate::wire::SampleCommitRequest;
3729 }
3730
3731 impl ::fidl_next::TwoWayMethod for Commit {
3732 type Response = ::fidl_next::wire::Result<
3733 'static,
3734 crate::wire::SampleCommitResponse,
3735 crate::wire::ConfigurationError,
3736 >;
3737 }
3738
3739 impl<___R> ::fidl_next::Respond<___R> for Commit {
3740 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3741
3742 fn respond(response: ___R) -> Self::Output {
3743 ::core::result::Result::Ok(response)
3744 }
3745 }
3746
3747 impl<___R> ::fidl_next::RespondErr<___R> for Commit {
3748 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3749
3750 fn respond_err(response: ___R) -> Self::Output {
3751 ::core::result::Result::Err(response)
3752 }
3753 }
3754
3755 mod ___detail {
3756 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Sample
3757 where
3758 ___T: ::fidl_next::Transport,
3759 {
3760 type Client = SampleClient<___T>;
3761 type Server = SampleServer<___T>;
3762 }
3763
3764 #[repr(transparent)]
3766 pub struct SampleClient<___T: ::fidl_next::Transport> {
3767 #[allow(dead_code)]
3768 client: ::fidl_next::protocol::Client<___T>,
3769 }
3770
3771 impl<___T> SampleClient<___T>
3772 where
3773 ___T: ::fidl_next::Transport,
3774 {
3775 #[doc = " Add sample parameters.\n\n Since this is limited by channel size, this API paginates at 300\n items. That should fit in a channel unless a selector is particularly\n gigantic.\n\n Use `Commit` to indicate that all samples are sent over.\n"]
3776 pub fn set(
3777 &self,
3778
3779 sample_parameters: impl ::fidl_next::Encode<
3780 crate::wire::SampleParameters<'static>,
3781 <___T as ::fidl_next::Transport>::SendBuffer,
3782 >,
3783 ) -> ::fidl_next::SendFuture<'_, ___T>
3784 where
3785 <___T as ::fidl_next::Transport>::SendBuffer:
3786 ::fidl_next::encoder::InternalHandleEncoder,
3787 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3788 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3789 {
3790 self.set_with(crate::generic::SampleSetRequest { sample_parameters })
3791 }
3792
3793 #[doc = " Add sample parameters.\n\n Since this is limited by channel size, this API paginates at 300\n items. That should fit in a channel unless a selector is particularly\n gigantic.\n\n Use `Commit` to indicate that all samples are sent over.\n"]
3794 pub fn set_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3795 where
3796 ___R: ::fidl_next::Encode<
3797 crate::wire::SampleSetRequest<'static>,
3798 <___T as ::fidl_next::Transport>::SendBuffer,
3799 >,
3800 {
3801 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3802 4763253411762487694,
3803 <super::Set as ::fidl_next::Method>::FLEXIBILITY,
3804 request,
3805 ))
3806 }
3807
3808 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3809 pub fn commit(
3810 &self,
3811
3812 sink: impl ::fidl_next::Encode<
3813 ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
3814 <___T as ::fidl_next::Transport>::SendBuffer,
3815 >,
3816 ) -> ::fidl_next::TwoWayFuture<'_, super::Commit, ___T>
3817 where
3818 <___T as ::fidl_next::Transport>::SendBuffer:
3819 ::fidl_next::encoder::InternalHandleEncoder,
3820 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3821 {
3822 self.commit_with(crate::generic::SampleCommitRequest { sink })
3823 }
3824
3825 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3826 pub fn commit_with<___R>(
3827 &self,
3828 request: ___R,
3829 ) -> ::fidl_next::TwoWayFuture<'_, super::Commit, ___T>
3830 where
3831 ___R: ::fidl_next::Encode<
3832 crate::wire::SampleCommitRequest,
3833 <___T as ::fidl_next::Transport>::SendBuffer,
3834 >,
3835 {
3836 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3837 2712218517460516507,
3838 <super::Commit as ::fidl_next::Method>::FLEXIBILITY,
3839 request,
3840 ))
3841 }
3842 }
3843
3844 #[repr(transparent)]
3846 pub struct SampleServer<___T: ::fidl_next::Transport> {
3847 server: ::fidl_next::protocol::Server<___T>,
3848 }
3849
3850 impl<___T> SampleServer<___T> where ___T: ::fidl_next::Transport {}
3851 }
3852}
3853
3854#[diagnostic::on_unimplemented(
3855 note = "If {Self} implements the non-local SampleClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3856)]
3857
3858pub trait SampleLocalClientHandler<
3862 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3863 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3864>
3865{
3866 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3867 ::core::future::ready(())
3868 }
3869}
3870
3871impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Sample
3872where
3873 ___H: SampleLocalClientHandler<___T>,
3874 ___T: ::fidl_next::Transport,
3875{
3876 async fn on_event(
3877 handler: &mut ___H,
3878 mut message: ::fidl_next::Message<___T>,
3879 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3880 match *message.header().ordinal {
3881 ordinal => {
3882 handler.on_unknown_interaction(ordinal).await;
3883 if ::core::matches!(
3884 message.header().flexibility(),
3885 ::fidl_next::protocol::Flexibility::Strict
3886 ) {
3887 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3888 } else {
3889 Ok(())
3890 }
3891 }
3892 }
3893 }
3894}
3895
3896#[diagnostic::on_unimplemented(
3897 note = "If {Self} implements the non-local SampleServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3898)]
3899
3900pub trait SampleLocalServerHandler<
3904 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3905 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3906>
3907{
3908 #[doc = " Add sample parameters.\n\n Since this is limited by channel size, this API paginates at 300\n items. That should fit in a channel unless a selector is particularly\n gigantic.\n\n Use `Commit` to indicate that all samples are sent over.\n"]
3909 fn set(
3910 &mut self,
3911
3912 request: ::fidl_next::Request<sample::Set, ___T>,
3913 ) -> impl ::core::future::Future<Output = ()>;
3914
3915 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3916 fn commit(
3917 &mut self,
3918
3919 request: ::fidl_next::Request<sample::Commit, ___T>,
3920
3921 responder: ::fidl_next::Responder<sample::Commit, ___T>,
3922 ) -> impl ::core::future::Future<Output = ()>;
3923
3924 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3925 ::core::future::ready(())
3926 }
3927}
3928
3929impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Sample
3930where
3931 ___H: SampleLocalServerHandler<___T>,
3932 ___T: ::fidl_next::Transport,
3933 for<'de> crate::wire::SampleSetRequest<'de>: ::fidl_next::Decode<
3934 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3935 Constraint = (),
3936 >,
3937 for<'de> crate::wire::SampleCommitRequest: ::fidl_next::Decode<
3938 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3939 Constraint = (),
3940 >,
3941{
3942 async fn on_one_way(
3943 handler: &mut ___H,
3944 mut message: ::fidl_next::Message<___T>,
3945 ) -> ::core::result::Result<
3946 (),
3947 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3948 > {
3949 match *message.header().ordinal {
3950 4763253411762487694 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3951 Ok(decoded) => {
3952 handler.set(::fidl_next::Request::from_decoded(decoded)).await;
3953 Ok(())
3954 }
3955 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3956 ordinal: 4763253411762487694,
3957 error,
3958 }),
3959 },
3960
3961 ordinal => {
3962 handler.on_unknown_interaction(ordinal).await;
3963 if ::core::matches!(
3964 message.header().flexibility(),
3965 ::fidl_next::protocol::Flexibility::Strict
3966 ) {
3967 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3968 } else {
3969 Ok(())
3970 }
3971 }
3972 }
3973 }
3974
3975 async fn on_two_way(
3976 handler: &mut ___H,
3977 mut message: ::fidl_next::Message<___T>,
3978 responder: ::fidl_next::protocol::Responder<___T>,
3979 ) -> ::core::result::Result<
3980 (),
3981 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3982 > {
3983 match *message.header().ordinal {
3984 2712218517460516507 => {
3985 let responder = ::fidl_next::Responder::from_untyped(responder);
3986
3987 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3988 Ok(decoded) => {
3989 handler
3990 .commit(::fidl_next::Request::from_decoded(decoded), responder)
3991 .await;
3992 Ok(())
3993 }
3994 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3995 ordinal: 2712218517460516507,
3996 error,
3997 }),
3998 }
3999 }
4000
4001 ordinal => {
4002 handler.on_unknown_interaction(ordinal).await;
4003 if ::core::matches!(
4004 message.header().flexibility(),
4005 ::fidl_next::protocol::Flexibility::Strict
4006 ) {
4007 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4008 } else {
4009 responder
4010 .respond_framework_error(
4011 ordinal,
4012 ::fidl_next::FrameworkError::UnknownMethod,
4013 )
4014 .expect("encoding a framework error should never fail")
4015 .await?;
4016 Ok(())
4017 }
4018 }
4019 }
4020 }
4021}
4022
4023pub trait SampleClientHandler<
4027 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4028 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4029>
4030{
4031 fn on_unknown_interaction(
4032 &mut self,
4033 ordinal: u64,
4034 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4035 ::core::future::ready(())
4036 }
4037}
4038
4039impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Sample
4040where
4041 ___H: SampleClientHandler<___T> + ::core::marker::Send,
4042 ___T: ::fidl_next::Transport,
4043{
4044 async fn on_event(
4045 handler: &mut ___H,
4046 mut message: ::fidl_next::Message<___T>,
4047 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4048 match *message.header().ordinal {
4049 ordinal => {
4050 handler.on_unknown_interaction(ordinal).await;
4051 if ::core::matches!(
4052 message.header().flexibility(),
4053 ::fidl_next::protocol::Flexibility::Strict
4054 ) {
4055 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4056 } else {
4057 Ok(())
4058 }
4059 }
4060 }
4061 }
4062}
4063
4064pub trait SampleServerHandler<
4068 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4069 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4070>
4071{
4072 #[doc = " Add sample parameters.\n\n Since this is limited by channel size, this API paginates at 300\n items. That should fit in a channel unless a selector is particularly\n gigantic.\n\n Use `Commit` to indicate that all samples are sent over.\n"]
4073 fn set(
4074 &mut self,
4075
4076 request: ::fidl_next::Request<sample::Set, ___T>,
4077 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4078
4079 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
4080 fn commit(
4081 &mut self,
4082
4083 request: ::fidl_next::Request<sample::Commit, ___T>,
4084
4085 responder: ::fidl_next::Responder<sample::Commit, ___T>,
4086 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4087
4088 fn on_unknown_interaction(
4089 &mut self,
4090 ordinal: u64,
4091 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4092 ::core::future::ready(())
4093 }
4094}
4095
4096impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Sample
4097where
4098 ___H: SampleServerHandler<___T> + ::core::marker::Send,
4099 ___T: ::fidl_next::Transport,
4100 for<'de> crate::wire::SampleSetRequest<'de>: ::fidl_next::Decode<
4101 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4102 Constraint = (),
4103 >,
4104 for<'de> crate::wire::SampleCommitRequest: ::fidl_next::Decode<
4105 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4106 Constraint = (),
4107 >,
4108{
4109 async fn on_one_way(
4110 handler: &mut ___H,
4111 mut message: ::fidl_next::Message<___T>,
4112 ) -> ::core::result::Result<
4113 (),
4114 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4115 > {
4116 match *message.header().ordinal {
4117 4763253411762487694 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4118 Ok(decoded) => {
4119 handler.set(::fidl_next::Request::from_decoded(decoded)).await;
4120 Ok(())
4121 }
4122 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4123 ordinal: 4763253411762487694,
4124 error,
4125 }),
4126 },
4127
4128 ordinal => {
4129 handler.on_unknown_interaction(ordinal).await;
4130 if ::core::matches!(
4131 message.header().flexibility(),
4132 ::fidl_next::protocol::Flexibility::Strict
4133 ) {
4134 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4135 } else {
4136 Ok(())
4137 }
4138 }
4139 }
4140 }
4141
4142 async fn on_two_way(
4143 handler: &mut ___H,
4144 mut message: ::fidl_next::Message<___T>,
4145 responder: ::fidl_next::protocol::Responder<___T>,
4146 ) -> ::core::result::Result<
4147 (),
4148 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4149 > {
4150 match *message.header().ordinal {
4151 2712218517460516507 => {
4152 let responder = ::fidl_next::Responder::from_untyped(responder);
4153
4154 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4155 Ok(decoded) => {
4156 handler
4157 .commit(::fidl_next::Request::from_decoded(decoded), responder)
4158 .await;
4159 Ok(())
4160 }
4161 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4162 ordinal: 2712218517460516507,
4163 error,
4164 }),
4165 }
4166 }
4167
4168 ordinal => {
4169 handler.on_unknown_interaction(ordinal).await;
4170 if ::core::matches!(
4171 message.header().flexibility(),
4172 ::fidl_next::protocol::Flexibility::Strict
4173 ) {
4174 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4175 } else {
4176 responder
4177 .respond_framework_error(
4178 ordinal,
4179 ::fidl_next::FrameworkError::UnknownMethod,
4180 )
4181 .expect("encoding a framework error should never fail")
4182 .await?;
4183 Ok(())
4184 }
4185 }
4186 }
4187 }
4188}
4189
4190impl<___T> SampleClientHandler<___T> for ::fidl_next::IgnoreEvents
4191where
4192 ___T: ::fidl_next::Transport,
4193{
4194 async fn on_unknown_interaction(&mut self, _: u64) {}
4195}
4196
4197impl<___H, ___T> SampleLocalClientHandler<___T> for ::fidl_next::Local<___H>
4198where
4199 ___H: SampleClientHandler<___T>,
4200 ___T: ::fidl_next::Transport,
4201{
4202 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4203 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4204 }
4205}
4206
4207impl<___H, ___T> SampleLocalServerHandler<___T> for ::fidl_next::Local<___H>
4208where
4209 ___H: SampleServerHandler<___T>,
4210 ___T: ::fidl_next::Transport,
4211{
4212 async fn set(&mut self, request: ::fidl_next::Request<sample::Set, ___T>) {
4213 ___H::set(&mut self.0, request).await
4214 }
4215
4216 async fn commit(
4217 &mut self,
4218
4219 request: ::fidl_next::Request<sample::Commit, ___T>,
4220
4221 responder: ::fidl_next::Responder<sample::Commit, ___T>,
4222 ) {
4223 ___H::commit(&mut self.0, request, responder).await
4224 }
4225
4226 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4227 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4228 }
4229}
4230
4231#[doc = " `SampleSink` is served by the client, in order to be notified when samples\n are ready.\n"]
4233#[derive(PartialEq, Debug)]
4234pub struct SampleSink;
4235
4236impl ::fidl_next::Discoverable for SampleSink {
4237 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.SampleSink";
4238}
4239
4240#[cfg(target_os = "fuchsia")]
4241impl ::fidl_next::HasTransport for SampleSink {
4242 type Transport = ::fidl_next::fuchsia::zx::Channel;
4243}
4244
4245pub mod sample_sink {
4246 pub mod prelude {
4247 pub use crate::{
4248 SampleSink, SampleSinkClientHandler, SampleSinkLocalClientHandler,
4249 SampleSinkLocalServerHandler, SampleSinkServerHandler, sample_sink,
4250 };
4251
4252 pub use crate::natural::SampleSinkOnSampleReadiedRequest;
4253 }
4254
4255 pub struct OnSampleReadied;
4256
4257 impl ::fidl_next::Method for OnSampleReadied {
4258 const ORDINAL: u64 = 4109936634236187487;
4259 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4260 ::fidl_next::protocol::Flexibility::Flexible;
4261
4262 type Protocol = crate::SampleSink;
4263
4264 type Request = crate::wire::SampleSinkOnSampleReadiedRequest<'static>;
4265 }
4266
4267 pub struct OnNowOrNever;
4268
4269 impl ::fidl_next::Method for OnNowOrNever {
4270 const ORDINAL: u64 = 4452173964783454356;
4271 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4272 ::fidl_next::protocol::Flexibility::Flexible;
4273
4274 type Protocol = crate::SampleSink;
4275
4276 type Request = ::fidl_next::wire::EmptyMessageBody;
4277 }
4278
4279 mod ___detail {
4280 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::SampleSink
4281 where
4282 ___T: ::fidl_next::Transport,
4283 {
4284 type Client = SampleSinkClient<___T>;
4285 type Server = SampleSinkServer<___T>;
4286 }
4287
4288 #[repr(transparent)]
4290 pub struct SampleSinkClient<___T: ::fidl_next::Transport> {
4291 #[allow(dead_code)]
4292 client: ::fidl_next::protocol::Client<___T>,
4293 }
4294
4295 impl<___T> SampleSinkClient<___T>
4296 where
4297 ___T: ::fidl_next::Transport,
4298 {
4299 pub fn on_sample_readied(
4300 &self,
4301
4302 event: impl ::fidl_next::Encode<
4303 crate::wire::SampleSinkResult<'static>,
4304 <___T as ::fidl_next::Transport>::SendBuffer,
4305 >,
4306 ) -> ::fidl_next::SendFuture<'_, ___T>
4307 where
4308 <___T as ::fidl_next::Transport>::SendBuffer:
4309 ::fidl_next::encoder::InternalHandleEncoder,
4310 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4311 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
4312 {
4313 self.on_sample_readied_with(crate::generic::SampleSinkOnSampleReadiedRequest {
4314 event,
4315 })
4316 }
4317
4318 pub fn on_sample_readied_with<___R>(
4319 &self,
4320 request: ___R,
4321 ) -> ::fidl_next::SendFuture<'_, ___T>
4322 where
4323 ___R: ::fidl_next::Encode<
4324 crate::wire::SampleSinkOnSampleReadiedRequest<'static>,
4325 <___T as ::fidl_next::Transport>::SendBuffer,
4326 >,
4327 {
4328 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
4329 4109936634236187487,
4330 <super::OnSampleReadied as ::fidl_next::Method>::FLEXIBILITY,
4331 request,
4332 ))
4333 }
4334 }
4335
4336 #[repr(transparent)]
4338 pub struct SampleSinkServer<___T: ::fidl_next::Transport> {
4339 server: ::fidl_next::protocol::Server<___T>,
4340 }
4341
4342 impl<___T> SampleSinkServer<___T>
4343 where
4344 ___T: ::fidl_next::Transport,
4345 {
4346 #[doc = " `OnNowOrNever` initiates a final sample of all data in this server, and\n exits after the next `OnSampleReadied` event is drained.\n\n It ignores polling periods but not diffing behavior.\n"]
4347 pub fn on_now_or_never(&self) -> ::fidl_next::SendFuture<'_, ___T> {
4348 ::fidl_next::SendFuture::from_untyped(
4349 self.server.send_event::<::fidl_next::wire::EmptyMessageBody>(
4350 4452173964783454356,
4351 <super::OnNowOrNever as ::fidl_next::Method>::FLEXIBILITY,
4352 (),
4353 ),
4354 )
4355 }
4356 }
4357 }
4358}
4359
4360#[diagnostic::on_unimplemented(
4361 note = "If {Self} implements the non-local SampleSinkClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4362)]
4363
4364pub trait SampleSinkLocalClientHandler<
4368 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4369 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4370>
4371{
4372 #[doc = " `OnNowOrNever` initiates a final sample of all data in this server, and\n exits after the next `OnSampleReadied` event is drained.\n\n It ignores polling periods but not diffing behavior.\n"]
4373 fn on_now_or_never(&mut self) -> impl ::core::future::Future<Output = ()>;
4374
4375 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4376 ::core::future::ready(())
4377 }
4378}
4379
4380impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for SampleSink
4381where
4382 ___H: SampleSinkLocalClientHandler<___T>,
4383 ___T: ::fidl_next::Transport,
4384{
4385 async fn on_event(
4386 handler: &mut ___H,
4387 mut message: ::fidl_next::Message<___T>,
4388 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4389 match *message.header().ordinal {
4390 4452173964783454356 => {
4391 handler.on_now_or_never().await;
4392 Ok(())
4393 }
4394
4395 ordinal => {
4396 handler.on_unknown_interaction(ordinal).await;
4397 if ::core::matches!(
4398 message.header().flexibility(),
4399 ::fidl_next::protocol::Flexibility::Strict
4400 ) {
4401 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4402 } else {
4403 Ok(())
4404 }
4405 }
4406 }
4407 }
4408}
4409
4410#[diagnostic::on_unimplemented(
4411 note = "If {Self} implements the non-local SampleSinkServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4412)]
4413
4414pub trait SampleSinkLocalServerHandler<
4418 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4419 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4420>
4421{
4422 fn on_sample_readied(
4423 &mut self,
4424
4425 request: ::fidl_next::Request<sample_sink::OnSampleReadied, ___T>,
4426 ) -> impl ::core::future::Future<Output = ()>;
4427
4428 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4429 ::core::future::ready(())
4430 }
4431}
4432
4433impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for SampleSink
4434where
4435 ___H: SampleSinkLocalServerHandler<___T>,
4436 ___T: ::fidl_next::Transport,
4437 for<'de> crate::wire::SampleSinkOnSampleReadiedRequest<'de>: ::fidl_next::Decode<
4438 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4439 Constraint = (),
4440 >,
4441{
4442 async fn on_one_way(
4443 handler: &mut ___H,
4444 mut message: ::fidl_next::Message<___T>,
4445 ) -> ::core::result::Result<
4446 (),
4447 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4448 > {
4449 match *message.header().ordinal {
4450 4109936634236187487 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4451 Ok(decoded) => {
4452 handler.on_sample_readied(::fidl_next::Request::from_decoded(decoded)).await;
4453 Ok(())
4454 }
4455 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4456 ordinal: 4109936634236187487,
4457 error,
4458 }),
4459 },
4460
4461 ordinal => {
4462 handler.on_unknown_interaction(ordinal).await;
4463 if ::core::matches!(
4464 message.header().flexibility(),
4465 ::fidl_next::protocol::Flexibility::Strict
4466 ) {
4467 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4468 } else {
4469 Ok(())
4470 }
4471 }
4472 }
4473 }
4474
4475 async fn on_two_way(
4476 handler: &mut ___H,
4477 mut message: ::fidl_next::Message<___T>,
4478 responder: ::fidl_next::protocol::Responder<___T>,
4479 ) -> ::core::result::Result<
4480 (),
4481 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4482 > {
4483 match *message.header().ordinal {
4484 ordinal => {
4485 handler.on_unknown_interaction(ordinal).await;
4486 if ::core::matches!(
4487 message.header().flexibility(),
4488 ::fidl_next::protocol::Flexibility::Strict
4489 ) {
4490 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4491 } else {
4492 responder
4493 .respond_framework_error(
4494 ordinal,
4495 ::fidl_next::FrameworkError::UnknownMethod,
4496 )
4497 .expect("encoding a framework error should never fail")
4498 .await?;
4499 Ok(())
4500 }
4501 }
4502 }
4503 }
4504}
4505
4506pub trait SampleSinkClientHandler<
4510 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4511 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4512>
4513{
4514 #[doc = " `OnNowOrNever` initiates a final sample of all data in this server, and\n exits after the next `OnSampleReadied` event is drained.\n\n It ignores polling periods but not diffing behavior.\n"]
4515 fn on_now_or_never(
4516 &mut self,
4517 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4518
4519 fn on_unknown_interaction(
4520 &mut self,
4521 ordinal: u64,
4522 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4523 ::core::future::ready(())
4524 }
4525}
4526
4527impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for SampleSink
4528where
4529 ___H: SampleSinkClientHandler<___T> + ::core::marker::Send,
4530 ___T: ::fidl_next::Transport,
4531{
4532 async fn on_event(
4533 handler: &mut ___H,
4534 mut message: ::fidl_next::Message<___T>,
4535 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4536 match *message.header().ordinal {
4537 4452173964783454356 => {
4538 handler.on_now_or_never().await;
4539 Ok(())
4540 }
4541
4542 ordinal => {
4543 handler.on_unknown_interaction(ordinal).await;
4544 if ::core::matches!(
4545 message.header().flexibility(),
4546 ::fidl_next::protocol::Flexibility::Strict
4547 ) {
4548 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4549 } else {
4550 Ok(())
4551 }
4552 }
4553 }
4554 }
4555}
4556
4557pub trait SampleSinkServerHandler<
4561 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4562 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4563>
4564{
4565 fn on_sample_readied(
4566 &mut self,
4567
4568 request: ::fidl_next::Request<sample_sink::OnSampleReadied, ___T>,
4569 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4570
4571 fn on_unknown_interaction(
4572 &mut self,
4573 ordinal: u64,
4574 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4575 ::core::future::ready(())
4576 }
4577}
4578
4579impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for SampleSink
4580where
4581 ___H: SampleSinkServerHandler<___T> + ::core::marker::Send,
4582 ___T: ::fidl_next::Transport,
4583 for<'de> crate::wire::SampleSinkOnSampleReadiedRequest<'de>: ::fidl_next::Decode<
4584 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4585 Constraint = (),
4586 >,
4587{
4588 async fn on_one_way(
4589 handler: &mut ___H,
4590 mut message: ::fidl_next::Message<___T>,
4591 ) -> ::core::result::Result<
4592 (),
4593 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4594 > {
4595 match *message.header().ordinal {
4596 4109936634236187487 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
4597 Ok(decoded) => {
4598 handler.on_sample_readied(::fidl_next::Request::from_decoded(decoded)).await;
4599 Ok(())
4600 }
4601 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4602 ordinal: 4109936634236187487,
4603 error,
4604 }),
4605 },
4606
4607 ordinal => {
4608 handler.on_unknown_interaction(ordinal).await;
4609 if ::core::matches!(
4610 message.header().flexibility(),
4611 ::fidl_next::protocol::Flexibility::Strict
4612 ) {
4613 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4614 } else {
4615 Ok(())
4616 }
4617 }
4618 }
4619 }
4620
4621 async fn on_two_way(
4622 handler: &mut ___H,
4623 mut message: ::fidl_next::Message<___T>,
4624 responder: ::fidl_next::protocol::Responder<___T>,
4625 ) -> ::core::result::Result<
4626 (),
4627 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4628 > {
4629 match *message.header().ordinal {
4630 ordinal => {
4631 handler.on_unknown_interaction(ordinal).await;
4632 if ::core::matches!(
4633 message.header().flexibility(),
4634 ::fidl_next::protocol::Flexibility::Strict
4635 ) {
4636 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4637 } else {
4638 responder
4639 .respond_framework_error(
4640 ordinal,
4641 ::fidl_next::FrameworkError::UnknownMethod,
4642 )
4643 .expect("encoding a framework error should never fail")
4644 .await?;
4645 Ok(())
4646 }
4647 }
4648 }
4649 }
4650}
4651
4652impl<___T> SampleSinkClientHandler<___T> for ::fidl_next::IgnoreEvents
4653where
4654 ___T: ::fidl_next::Transport,
4655{
4656 async fn on_now_or_never(&mut self) {}
4657
4658 async fn on_unknown_interaction(&mut self, _: u64) {}
4659}
4660
4661impl<___H, ___T> SampleSinkLocalClientHandler<___T> for ::fidl_next::Local<___H>
4662where
4663 ___H: SampleSinkClientHandler<___T>,
4664 ___T: ::fidl_next::Transport,
4665{
4666 async fn on_now_or_never(&mut self) {
4667 ___H::on_now_or_never(&mut self.0).await
4668 }
4669
4670 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4671 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4672 }
4673}
4674
4675impl<___H, ___T> SampleSinkLocalServerHandler<___T> for ::fidl_next::Local<___H>
4676where
4677 ___H: SampleSinkServerHandler<___T>,
4678 ___T: ::fidl_next::Transport,
4679{
4680 async fn on_sample_readied(
4681 &mut self,
4682
4683 request: ::fidl_next::Request<sample_sink::OnSampleReadied, ___T>,
4684 ) {
4685 ___H::on_sample_readied(&mut self.0, request).await
4686 }
4687
4688 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4689 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4690 }
4691}
4692
4693pub use fidl_next_common_fuchsia_diagnostics::*;