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
1075 impl<'de> FormattedContent<'de> {
1076 pub fn as_ref(&self) -> crate::wire::formatted_content::Ref<'_> {
1077 match self.raw.ordinal() {
1078 1 => crate::wire::formatted_content::Ref::Json(unsafe {
1079 self.raw.get().deref_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>()
1080 }),
1081
1082 3 => crate::wire::formatted_content::Ref::Cbor(unsafe {
1083 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1084 }),
1085
1086 4 => crate::wire::formatted_content::Ref::Fxt(unsafe {
1087 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
1088 }),
1089
1090 unknown => crate::wire::formatted_content::Ref::UnknownOrdinal_(unknown),
1091 }
1092 }
1093 }
1094
1095 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormattedContent<'de>
1096 where
1097 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1098 ___D: ::fidl_next::Decoder<'de>,
1099 ___D: ::fidl_next::fuchsia::HandleDecoder,
1100 {
1101 fn decode(
1102 mut slot: ::fidl_next::Slot<'_, Self>,
1103 decoder: &mut ___D,
1104 _: (),
1105 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1106 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1107 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1108 1 => ::fidl_next::wire::Union::decode_as::<
1109 ___D,
1110 ::fidl_next_fuchsia_mem::wire::Buffer,
1111 >(raw, decoder, ())?,
1112
1113 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1114 raw,
1115 decoder,
1116 (),
1117 )?,
1118
1119 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1120 raw,
1121 decoder,
1122 (),
1123 )?,
1124
1125 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1126 }
1127
1128 Ok(())
1129 }
1130 }
1131
1132 impl<'de> ::core::fmt::Debug for FormattedContent<'de> {
1133 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1134 match self.raw.ordinal() {
1135 1 => unsafe {
1136 self.raw.get().deref_unchecked::<::fidl_next_fuchsia_mem::wire::Buffer>().fmt(f)
1137 },
1138 3 => unsafe {
1139 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>().fmt(f)
1140 },
1141 4 => unsafe {
1142 self.raw.get().deref_unchecked::<::fidl_next::wire::fuchsia::Vmo>().fmt(f)
1143 },
1144 _ => unsafe { ::core::hint::unreachable_unchecked() },
1145 }
1146 }
1147 }
1148
1149 impl<'de> ::fidl_next::IntoNatural for FormattedContent<'de> {
1150 type Natural = crate::natural::FormattedContent;
1151 }
1152
1153 #[derive(Debug)]
1155 #[repr(C)]
1156 pub struct BatchIteratorGetNextResponse<'de> {
1157 pub batch: ::fidl_next::wire::Vector<'de, crate::wire::FormattedContent<'de>>,
1158 }
1159
1160 static_assertions::const_assert_eq!(
1161 std::mem::size_of::<BatchIteratorGetNextResponse<'_>>(),
1162 16
1163 );
1164 static_assertions::const_assert_eq!(
1165 std::mem::align_of::<BatchIteratorGetNextResponse<'_>>(),
1166 8
1167 );
1168
1169 static_assertions::const_assert_eq!(
1170 std::mem::offset_of!(BatchIteratorGetNextResponse<'_>, batch),
1171 0
1172 );
1173
1174 impl ::fidl_next::Constrained for BatchIteratorGetNextResponse<'_> {
1175 type Constraint = ();
1176
1177 fn validate(
1178 _: ::fidl_next::Slot<'_, Self>,
1179 _: Self::Constraint,
1180 ) -> Result<(), ::fidl_next::ValidationError> {
1181 Ok(())
1182 }
1183 }
1184
1185 unsafe impl ::fidl_next::Wire for BatchIteratorGetNextResponse<'static> {
1186 type Narrowed<'de> = BatchIteratorGetNextResponse<'de>;
1187
1188 #[inline]
1189 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1190 ::fidl_next::munge! {
1191 let Self {
1192 batch,
1193
1194 } = &mut *out_;
1195 }
1196
1197 ::fidl_next::Wire::zero_padding(batch);
1198 }
1199 }
1200
1201 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for BatchIteratorGetNextResponse<'de>
1202 where
1203 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1204 ___D: ::fidl_next::Decoder<'de>,
1205 ___D: ::fidl_next::fuchsia::HandleDecoder,
1206 {
1207 fn decode(
1208 slot_: ::fidl_next::Slot<'_, Self>,
1209 decoder_: &mut ___D,
1210 _: (),
1211 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1212 ::fidl_next::munge! {
1213 let Self {
1214 mut batch,
1215
1216 } = slot_;
1217 }
1218
1219 let _field = batch.as_mut();
1220 ::fidl_next::Constrained::validate(_field, (64, ()))?;
1221 ::fidl_next::Decode::decode(batch.as_mut(), decoder_, (64, ()))?;
1222
1223 let batch = unsafe { batch.deref_unchecked() };
1224
1225 if batch.len() > 64 {
1226 return Err(::fidl_next::DecodeError::VectorTooLong {
1227 size: batch.len() as u64,
1228 limit: 64,
1229 });
1230 }
1231
1232 Ok(())
1233 }
1234 }
1235
1236 impl<'de> ::fidl_next::IntoNatural for BatchIteratorGetNextResponse<'de> {
1237 type Natural = crate::natural::BatchIteratorGetNextResponse;
1238 }
1239
1240 #[derive(Debug)]
1242 #[repr(C)]
1243 pub struct LogStreamConnectRequest<'de> {
1244 pub socket: ::fidl_next::wire::fuchsia::Socket,
1245
1246 pub opts: crate::wire::LogStreamOptions<'de>,
1247 }
1248
1249 static_assertions::const_assert_eq!(std::mem::size_of::<LogStreamConnectRequest<'_>>(), 24);
1250 static_assertions::const_assert_eq!(std::mem::align_of::<LogStreamConnectRequest<'_>>(), 8);
1251
1252 static_assertions::const_assert_eq!(
1253 std::mem::offset_of!(LogStreamConnectRequest<'_>, socket),
1254 0
1255 );
1256
1257 static_assertions::const_assert_eq!(std::mem::offset_of!(LogStreamConnectRequest<'_>, opts), 8);
1258
1259 impl ::fidl_next::Constrained for LogStreamConnectRequest<'_> {
1260 type Constraint = ();
1261
1262 fn validate(
1263 _: ::fidl_next::Slot<'_, Self>,
1264 _: Self::Constraint,
1265 ) -> Result<(), ::fidl_next::ValidationError> {
1266 Ok(())
1267 }
1268 }
1269
1270 unsafe impl ::fidl_next::Wire for LogStreamConnectRequest<'static> {
1271 type Narrowed<'de> = LogStreamConnectRequest<'de>;
1272
1273 #[inline]
1274 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1275 ::fidl_next::munge! {
1276 let Self {
1277 socket,
1278 opts,
1279
1280 } = &mut *out_;
1281 }
1282
1283 ::fidl_next::Wire::zero_padding(socket);
1284
1285 ::fidl_next::Wire::zero_padding(opts);
1286
1287 unsafe {
1288 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
1289 }
1290 }
1291 }
1292
1293 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogStreamConnectRequest<'de>
1294 where
1295 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1296 ___D: ::fidl_next::Decoder<'de>,
1297 ___D: ::fidl_next::fuchsia::HandleDecoder,
1298 {
1299 fn decode(
1300 slot_: ::fidl_next::Slot<'_, Self>,
1301 decoder_: &mut ___D,
1302 _: (),
1303 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1304 if slot_.as_bytes()[4..8] != [0u8; 4] {
1305 return Err(::fidl_next::DecodeError::InvalidPadding);
1306 }
1307
1308 ::fidl_next::munge! {
1309 let Self {
1310 mut socket,
1311 mut opts,
1312
1313 } = slot_;
1314 }
1315
1316 let _field = socket.as_mut();
1317
1318 ::fidl_next::Decode::decode(socket.as_mut(), decoder_, ())?;
1319
1320 let _field = opts.as_mut();
1321
1322 ::fidl_next::Decode::decode(opts.as_mut(), decoder_, ())?;
1323
1324 Ok(())
1325 }
1326 }
1327
1328 impl<'de> ::fidl_next::IntoNatural for LogStreamConnectRequest<'de> {
1329 type Natural = crate::natural::LogStreamConnectRequest;
1330 }
1331
1332 #[derive(Debug)]
1334 #[repr(C)]
1335 pub struct SampleSetRequest<'de> {
1336 pub sample_parameters: crate::wire::SampleParameters<'de>,
1337 }
1338
1339 static_assertions::const_assert_eq!(std::mem::size_of::<SampleSetRequest<'_>>(), 16);
1340 static_assertions::const_assert_eq!(std::mem::align_of::<SampleSetRequest<'_>>(), 8);
1341
1342 static_assertions::const_assert_eq!(
1343 std::mem::offset_of!(SampleSetRequest<'_>, sample_parameters),
1344 0
1345 );
1346
1347 impl ::fidl_next::Constrained for SampleSetRequest<'_> {
1348 type Constraint = ();
1349
1350 fn validate(
1351 _: ::fidl_next::Slot<'_, Self>,
1352 _: Self::Constraint,
1353 ) -> Result<(), ::fidl_next::ValidationError> {
1354 Ok(())
1355 }
1356 }
1357
1358 unsafe impl ::fidl_next::Wire for SampleSetRequest<'static> {
1359 type Narrowed<'de> = SampleSetRequest<'de>;
1360
1361 #[inline]
1362 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1363 ::fidl_next::munge! {
1364 let Self {
1365 sample_parameters,
1366
1367 } = &mut *out_;
1368 }
1369
1370 ::fidl_next::Wire::zero_padding(sample_parameters);
1371 }
1372 }
1373
1374 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSetRequest<'de>
1375 where
1376 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1377 ___D: ::fidl_next::Decoder<'de>,
1378 ___D: ::fidl_next::fuchsia::HandleDecoder,
1379 {
1380 fn decode(
1381 slot_: ::fidl_next::Slot<'_, Self>,
1382 decoder_: &mut ___D,
1383 _: (),
1384 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1385 ::fidl_next::munge! {
1386 let Self {
1387 mut sample_parameters,
1388
1389 } = slot_;
1390 }
1391
1392 let _field = sample_parameters.as_mut();
1393
1394 ::fidl_next::Decode::decode(sample_parameters.as_mut(), decoder_, ())?;
1395
1396 Ok(())
1397 }
1398 }
1399
1400 impl<'de> ::fidl_next::IntoNatural for SampleSetRequest<'de> {
1401 type Natural = crate::natural::SampleSetRequest;
1402 }
1403
1404 #[derive(Debug)]
1406 #[repr(C)]
1407 pub struct SampleCommitRequest {
1408 pub sink: ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
1409 }
1410
1411 static_assertions::const_assert_eq!(std::mem::size_of::<SampleCommitRequest>(), 4);
1412 static_assertions::const_assert_eq!(std::mem::align_of::<SampleCommitRequest>(), 4);
1413
1414 static_assertions::const_assert_eq!(std::mem::offset_of!(SampleCommitRequest, sink), 0);
1415
1416 impl ::fidl_next::Constrained for SampleCommitRequest {
1417 type Constraint = ();
1418
1419 fn validate(
1420 _: ::fidl_next::Slot<'_, Self>,
1421 _: Self::Constraint,
1422 ) -> Result<(), ::fidl_next::ValidationError> {
1423 Ok(())
1424 }
1425 }
1426
1427 unsafe impl ::fidl_next::Wire for SampleCommitRequest {
1428 type Narrowed<'de> = SampleCommitRequest;
1429
1430 #[inline]
1431 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1432 ::fidl_next::munge! {
1433 let Self {
1434 sink,
1435
1436 } = &mut *out_;
1437 }
1438
1439 ::fidl_next::Wire::zero_padding(sink);
1440 }
1441 }
1442
1443 unsafe impl<___D> ::fidl_next::Decode<___D> for SampleCommitRequest
1444 where
1445 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1446 ___D: ::fidl_next::fuchsia::HandleDecoder,
1447 {
1448 fn decode(
1449 slot_: ::fidl_next::Slot<'_, Self>,
1450 decoder_: &mut ___D,
1451 _: (),
1452 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1453 ::fidl_next::munge! {
1454 let Self {
1455 mut sink,
1456
1457 } = slot_;
1458 }
1459
1460 let _field = sink.as_mut();
1461
1462 ::fidl_next::Decode::decode(sink.as_mut(), decoder_, ())?;
1463
1464 Ok(())
1465 }
1466 }
1467
1468 impl ::fidl_next::IntoNatural for SampleCommitRequest {
1469 type Natural = crate::natural::SampleCommitRequest;
1470 }
1471
1472 #[repr(C)]
1474 pub struct SampleReady<'de> {
1475 pub(crate) table: ::fidl_next::wire::Table<'de>,
1476 }
1477
1478 impl<'de> Drop for SampleReady<'de> {
1479 fn drop(&mut self) {
1480 let _ = self.table.get(1).map(|envelope| unsafe {
1481 envelope.read_unchecked::<::fidl_next::ClientEnd<
1482 crate::BatchIterator,
1483 ::fidl_next::wire::fuchsia::Channel,
1484 >>()
1485 });
1486
1487 let _ = self
1488 .table
1489 .get(2)
1490 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
1491 }
1492 }
1493
1494 impl ::fidl_next::Constrained for SampleReady<'_> {
1495 type Constraint = ();
1496
1497 fn validate(
1498 _: ::fidl_next::Slot<'_, Self>,
1499 _: Self::Constraint,
1500 ) -> Result<(), ::fidl_next::ValidationError> {
1501 Ok(())
1502 }
1503 }
1504
1505 unsafe impl ::fidl_next::Wire for SampleReady<'static> {
1506 type Narrowed<'de> = SampleReady<'de>;
1507
1508 #[inline]
1509 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1510 ::fidl_next::munge!(let Self { table } = out);
1511 ::fidl_next::wire::Table::zero_padding(table);
1512 }
1513 }
1514
1515 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleReady<'de>
1516 where
1517 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1518 ___D: ::fidl_next::fuchsia::HandleDecoder,
1519 {
1520 fn decode(
1521 slot: ::fidl_next::Slot<'_, Self>,
1522 decoder: &mut ___D,
1523 _: (),
1524 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1525 ::fidl_next::munge!(let Self { table } = slot);
1526
1527 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1528 match ordinal {
1529 0 => unsafe { ::core::hint::unreachable_unchecked() },
1530
1531 1 => {
1532 ::fidl_next::wire::Envelope::decode_as::<
1533 ___D,
1534 ::fidl_next::ClientEnd<
1535 crate::BatchIterator,
1536 ::fidl_next::wire::fuchsia::Channel,
1537 >,
1538 >(slot.as_mut(), decoder, ())?;
1539
1540 Ok(())
1541 }
1542
1543 2 => {
1544 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
1545 slot.as_mut(),
1546 decoder,
1547 (),
1548 )?;
1549
1550 Ok(())
1551 }
1552
1553 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1554 }
1555 })
1556 }
1557 }
1558
1559 impl<'de> SampleReady<'de> {
1560 pub fn batch_iter(
1561 &self,
1562 ) -> ::core::option::Option<
1563 &::fidl_next::ClientEnd<crate::BatchIterator, ::fidl_next::wire::fuchsia::Channel>,
1564 > {
1565 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1566 }
1567
1568 pub fn seconds_since_start(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
1569 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1570 }
1571 }
1572
1573 impl<'de> ::core::fmt::Debug for SampleReady<'de> {
1574 fn fmt(
1575 &self,
1576 f: &mut ::core::fmt::Formatter<'_>,
1577 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1578 f.debug_struct("SampleReady")
1579 .field("batch_iter", &self.batch_iter())
1580 .field("seconds_since_start", &self.seconds_since_start())
1581 .finish()
1582 }
1583 }
1584
1585 impl<'de> ::fidl_next::IntoNatural for SampleReady<'de> {
1586 type Natural = crate::natural::SampleReady;
1587 }
1588
1589 #[repr(transparent)]
1591 pub struct SampleSinkResult<'de> {
1592 pub(crate) raw: ::fidl_next::wire::Union,
1593 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1594 }
1595
1596 impl<'de> Drop for SampleSinkResult<'de> {
1597 fn drop(&mut self) {
1598 match self.raw.ordinal() {
1599 1 => {
1600 let _ =
1601 unsafe { self.raw.get().read_unchecked::<crate::wire::SampleReady<'de>>() };
1602 }
1603
1604 2 => {
1605 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::RuntimeError>() };
1606 }
1607
1608 _ => (),
1609 }
1610 }
1611 }
1612
1613 impl ::fidl_next::Constrained for SampleSinkResult<'_> {
1614 type Constraint = ();
1615
1616 fn validate(
1617 _: ::fidl_next::Slot<'_, Self>,
1618 _: Self::Constraint,
1619 ) -> Result<(), ::fidl_next::ValidationError> {
1620 Ok(())
1621 }
1622 }
1623
1624 unsafe impl ::fidl_next::Wire for SampleSinkResult<'static> {
1625 type Narrowed<'de> = SampleSinkResult<'de>;
1626
1627 #[inline]
1628 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1629 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1630 ::fidl_next::wire::Union::zero_padding(raw);
1631 }
1632 }
1633
1634 pub mod sample_sink_result {
1635 pub enum Ref<'de> {
1636 Ready(&'de crate::wire::SampleReady<'de>),
1637
1638 Error(&'de crate::wire::RuntimeError),
1639
1640 UnknownOrdinal_(u64),
1641 }
1642 }
1643
1644 impl<'de> SampleSinkResult<'de> {
1645 pub fn as_ref(&self) -> crate::wire::sample_sink_result::Ref<'_> {
1646 match self.raw.ordinal() {
1647 1 => crate::wire::sample_sink_result::Ref::Ready(unsafe {
1648 self.raw.get().deref_unchecked::<crate::wire::SampleReady<'_>>()
1649 }),
1650
1651 2 => crate::wire::sample_sink_result::Ref::Error(unsafe {
1652 self.raw.get().deref_unchecked::<crate::wire::RuntimeError>()
1653 }),
1654
1655 unknown => crate::wire::sample_sink_result::Ref::UnknownOrdinal_(unknown),
1656 }
1657 }
1658 }
1659
1660 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSinkResult<'de>
1661 where
1662 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1663 ___D: ::fidl_next::Decoder<'de>,
1664 ___D: ::fidl_next::fuchsia::HandleDecoder,
1665 {
1666 fn decode(
1667 mut slot: ::fidl_next::Slot<'_, Self>,
1668 decoder: &mut ___D,
1669 _: (),
1670 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1671 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1672 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1673 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SampleReady<'de>>(
1674 raw,
1675 decoder,
1676 (),
1677 )?,
1678
1679 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::RuntimeError>(
1680 raw,
1681 decoder,
1682 (),
1683 )?,
1684
1685 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1686 }
1687
1688 Ok(())
1689 }
1690 }
1691
1692 impl<'de> ::core::fmt::Debug for SampleSinkResult<'de> {
1693 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1694 match self.raw.ordinal() {
1695 1 => unsafe {
1696 self.raw.get().deref_unchecked::<crate::wire::SampleReady<'_>>().fmt(f)
1697 },
1698 2 => unsafe {
1699 self.raw.get().deref_unchecked::<crate::wire::RuntimeError>().fmt(f)
1700 },
1701 _ => unsafe { ::core::hint::unreachable_unchecked() },
1702 }
1703 }
1704 }
1705
1706 impl<'de> ::fidl_next::IntoNatural for SampleSinkResult<'de> {
1707 type Natural = crate::natural::SampleSinkResult;
1708 }
1709
1710 #[derive(Debug)]
1712 #[repr(C)]
1713 pub struct SampleSinkOnSampleReadiedRequest<'de> {
1714 pub event: crate::wire::SampleSinkResult<'de>,
1715 }
1716
1717 static_assertions::const_assert_eq!(
1718 std::mem::size_of::<SampleSinkOnSampleReadiedRequest<'_>>(),
1719 16
1720 );
1721 static_assertions::const_assert_eq!(
1722 std::mem::align_of::<SampleSinkOnSampleReadiedRequest<'_>>(),
1723 8
1724 );
1725
1726 static_assertions::const_assert_eq!(
1727 std::mem::offset_of!(SampleSinkOnSampleReadiedRequest<'_>, event),
1728 0
1729 );
1730
1731 impl ::fidl_next::Constrained for SampleSinkOnSampleReadiedRequest<'_> {
1732 type Constraint = ();
1733
1734 fn validate(
1735 _: ::fidl_next::Slot<'_, Self>,
1736 _: Self::Constraint,
1737 ) -> Result<(), ::fidl_next::ValidationError> {
1738 Ok(())
1739 }
1740 }
1741
1742 unsafe impl ::fidl_next::Wire for SampleSinkOnSampleReadiedRequest<'static> {
1743 type Narrowed<'de> = SampleSinkOnSampleReadiedRequest<'de>;
1744
1745 #[inline]
1746 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1747 ::fidl_next::munge! {
1748 let Self {
1749 event,
1750
1751 } = &mut *out_;
1752 }
1753
1754 ::fidl_next::Wire::zero_padding(event);
1755 }
1756 }
1757
1758 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSinkOnSampleReadiedRequest<'de>
1759 where
1760 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1761 ___D: ::fidl_next::Decoder<'de>,
1762 ___D: ::fidl_next::fuchsia::HandleDecoder,
1763 {
1764 fn decode(
1765 slot_: ::fidl_next::Slot<'_, Self>,
1766 decoder_: &mut ___D,
1767 _: (),
1768 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1769 ::fidl_next::munge! {
1770 let Self {
1771 mut event,
1772
1773 } = slot_;
1774 }
1775
1776 let _field = event.as_mut();
1777
1778 ::fidl_next::Decode::decode(event.as_mut(), decoder_, ())?;
1779
1780 Ok(())
1781 }
1782 }
1783
1784 impl<'de> ::fidl_next::IntoNatural for SampleSinkOnSampleReadiedRequest<'de> {
1785 type Natural = crate::natural::SampleSinkOnSampleReadiedRequest;
1786 }
1787}
1788
1789pub mod wire_optional {
1790
1791 pub use fidl_next_common_fuchsia_diagnostics::wire_optional::*;
1792
1793 #[repr(transparent)]
1794 pub struct FormattedContent<'de> {
1795 pub(crate) raw: ::fidl_next::wire::Union,
1796 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1797 }
1798
1799 impl ::fidl_next::Constrained for FormattedContent<'_> {
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 FormattedContent<'static> {
1811 type Narrowed<'de> = FormattedContent<'de>;
1812
1813 #[inline]
1814 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1815 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1816 ::fidl_next::wire::Union::zero_padding(raw);
1817 }
1818 }
1819
1820 impl<'de> FormattedContent<'de> {
1821 pub fn is_some(&self) -> bool {
1822 self.raw.is_some()
1823 }
1824
1825 pub fn is_none(&self) -> bool {
1826 self.raw.is_none()
1827 }
1828
1829 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::FormattedContent<'de>> {
1830 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1831 }
1832
1833 pub fn into_option(self) -> ::core::option::Option<crate::wire::FormattedContent<'de>> {
1834 if self.is_some() {
1835 Some(crate::wire::FormattedContent {
1836 raw: self.raw,
1837 _phantom: ::core::marker::PhantomData,
1838 })
1839 } else {
1840 None
1841 }
1842 }
1843 }
1844
1845 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FormattedContent<'de>
1846 where
1847 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1848 ___D: ::fidl_next::Decoder<'de>,
1849 ___D: ::fidl_next::fuchsia::HandleDecoder,
1850 {
1851 fn decode(
1852 mut slot: ::fidl_next::Slot<'_, Self>,
1853 decoder: &mut ___D,
1854 _: (),
1855 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1856 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1857 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1858 1 => ::fidl_next::wire::Union::decode_as::<
1859 ___D,
1860 ::fidl_next_fuchsia_mem::wire::Buffer,
1861 >(raw, decoder, ())?,
1862
1863 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1864 raw,
1865 decoder,
1866 (),
1867 )?,
1868
1869 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::fuchsia::Vmo>(
1870 raw,
1871 decoder,
1872 (),
1873 )?,
1874
1875 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1876 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1877 }
1878
1879 Ok(())
1880 }
1881 }
1882
1883 impl<'de> ::core::fmt::Debug for FormattedContent<'de> {
1884 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1885 self.as_ref().fmt(f)
1886 }
1887 }
1888
1889 impl<'de> ::fidl_next::IntoNatural for FormattedContent<'de> {
1890 type Natural = ::core::option::Option<crate::natural::FormattedContent>;
1891 }
1892
1893 #[repr(transparent)]
1894 pub struct SampleSinkResult<'de> {
1895 pub(crate) raw: ::fidl_next::wire::Union,
1896 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1897 }
1898
1899 impl ::fidl_next::Constrained for SampleSinkResult<'_> {
1900 type Constraint = ();
1901
1902 fn validate(
1903 _: ::fidl_next::Slot<'_, Self>,
1904 _: Self::Constraint,
1905 ) -> Result<(), ::fidl_next::ValidationError> {
1906 Ok(())
1907 }
1908 }
1909
1910 unsafe impl ::fidl_next::Wire for SampleSinkResult<'static> {
1911 type Narrowed<'de> = SampleSinkResult<'de>;
1912
1913 #[inline]
1914 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1915 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1916 ::fidl_next::wire::Union::zero_padding(raw);
1917 }
1918 }
1919
1920 impl<'de> SampleSinkResult<'de> {
1921 pub fn is_some(&self) -> bool {
1922 self.raw.is_some()
1923 }
1924
1925 pub fn is_none(&self) -> bool {
1926 self.raw.is_none()
1927 }
1928
1929 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::SampleSinkResult<'de>> {
1930 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1931 }
1932
1933 pub fn into_option(self) -> ::core::option::Option<crate::wire::SampleSinkResult<'de>> {
1934 if self.is_some() {
1935 Some(crate::wire::SampleSinkResult {
1936 raw: self.raw,
1937 _phantom: ::core::marker::PhantomData,
1938 })
1939 } else {
1940 None
1941 }
1942 }
1943 }
1944
1945 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for SampleSinkResult<'de>
1946 where
1947 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1948 ___D: ::fidl_next::Decoder<'de>,
1949 ___D: ::fidl_next::fuchsia::HandleDecoder,
1950 {
1951 fn decode(
1952 mut slot: ::fidl_next::Slot<'_, Self>,
1953 decoder: &mut ___D,
1954 _: (),
1955 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1956 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1957 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1958 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SampleReady<'de>>(
1959 raw,
1960 decoder,
1961 (),
1962 )?,
1963
1964 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::RuntimeError>(
1965 raw,
1966 decoder,
1967 (),
1968 )?,
1969
1970 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1971 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1972 }
1973
1974 Ok(())
1975 }
1976 }
1977
1978 impl<'de> ::core::fmt::Debug for SampleSinkResult<'de> {
1979 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1980 self.as_ref().fmt(f)
1981 }
1982 }
1983
1984 impl<'de> ::fidl_next::IntoNatural for SampleSinkResult<'de> {
1985 type Natural = ::core::option::Option<crate::natural::SampleSinkResult>;
1986 }
1987}
1988
1989pub mod generic {
1990
1991 pub use fidl_next_common_fuchsia_diagnostics::generic::*;
1992
1993 pub struct ArchiveAccessorStreamDiagnosticsRequest<T0, T1> {
1995 pub stream_parameters: T0,
1996
1997 pub result_stream: T1,
1998 }
1999
2000 unsafe impl<___E, T0, T1>
2001 ::fidl_next::Encode<crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>, ___E>
2002 for ArchiveAccessorStreamDiagnosticsRequest<T0, T1>
2003 where
2004 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2005 ___E: ::fidl_next::Encoder,
2006 ___E: ::fidl_next::fuchsia::HandleEncoder,
2007 T0: ::fidl_next::Encode<crate::wire::StreamParameters<'static>, ___E>,
2008 T1: ::fidl_next::Encode<
2009 ::fidl_next::ServerEnd<crate::BatchIterator, ::fidl_next::wire::fuchsia::Channel>,
2010 ___E,
2011 >,
2012 {
2013 #[inline]
2014 fn encode(
2015 self,
2016 encoder_: &mut ___E,
2017 out_: &mut ::core::mem::MaybeUninit<
2018 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
2019 >,
2020 _: (),
2021 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2022 ::fidl_next::munge! {
2023 let crate::wire::ArchiveAccessorStreamDiagnosticsRequest {
2024 stream_parameters,
2025 result_stream,
2026
2027 } = out_;
2028 }
2029
2030 ::fidl_next::Encode::encode(self.stream_parameters, encoder_, stream_parameters, ())?;
2031
2032 ::fidl_next::Encode::encode(self.result_stream, encoder_, result_stream, ())?;
2033
2034 Ok(())
2035 }
2036 }
2037
2038 pub struct BatchIteratorGetNextResponse<T0> {
2040 pub batch: T0,
2041 }
2042
2043 unsafe impl<___E, T0>
2044 ::fidl_next::Encode<crate::wire::BatchIteratorGetNextResponse<'static>, ___E>
2045 for BatchIteratorGetNextResponse<T0>
2046 where
2047 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2048 ___E: ::fidl_next::Encoder,
2049 ___E: ::fidl_next::fuchsia::HandleEncoder,
2050 T0: ::fidl_next::Encode<
2051 ::fidl_next::wire::Vector<'static, crate::wire::FormattedContent<'static>>,
2052 ___E,
2053 >,
2054 {
2055 #[inline]
2056 fn encode(
2057 self,
2058 encoder_: &mut ___E,
2059 out_: &mut ::core::mem::MaybeUninit<crate::wire::BatchIteratorGetNextResponse<'static>>,
2060 _: (),
2061 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2062 ::fidl_next::munge! {
2063 let crate::wire::BatchIteratorGetNextResponse {
2064 batch,
2065
2066 } = out_;
2067 }
2068
2069 ::fidl_next::Encode::encode(self.batch, encoder_, batch, (64, ()))?;
2070
2071 Ok(())
2072 }
2073 }
2074
2075 pub struct LogStreamConnectRequest<T0, T1> {
2077 pub socket: T0,
2078
2079 pub opts: T1,
2080 }
2081
2082 unsafe impl<___E, T0, T1>
2083 ::fidl_next::Encode<crate::wire::LogStreamConnectRequest<'static>, ___E>
2084 for LogStreamConnectRequest<T0, T1>
2085 where
2086 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2087 ___E: ::fidl_next::Encoder,
2088 ___E: ::fidl_next::fuchsia::HandleEncoder,
2089 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Socket, ___E>,
2090 T1: ::fidl_next::Encode<crate::wire::LogStreamOptions<'static>, ___E>,
2091 {
2092 #[inline]
2093 fn encode(
2094 self,
2095 encoder_: &mut ___E,
2096 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogStreamConnectRequest<'static>>,
2097 _: (),
2098 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2099 ::fidl_next::munge! {
2100 let crate::wire::LogStreamConnectRequest {
2101 socket,
2102 opts,
2103
2104 } = out_;
2105 }
2106
2107 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
2108
2109 ::fidl_next::Encode::encode(self.opts, encoder_, opts, ())?;
2110
2111 Ok(())
2112 }
2113 }
2114
2115 pub struct SampleSetRequest<T0> {
2117 pub sample_parameters: T0,
2118 }
2119
2120 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SampleSetRequest<'static>, ___E>
2121 for SampleSetRequest<T0>
2122 where
2123 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2124 ___E: ::fidl_next::Encoder,
2125 ___E: ::fidl_next::fuchsia::HandleEncoder,
2126 T0: ::fidl_next::Encode<crate::wire::SampleParameters<'static>, ___E>,
2127 {
2128 #[inline]
2129 fn encode(
2130 self,
2131 encoder_: &mut ___E,
2132 out_: &mut ::core::mem::MaybeUninit<crate::wire::SampleSetRequest<'static>>,
2133 _: (),
2134 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2135 ::fidl_next::munge! {
2136 let crate::wire::SampleSetRequest {
2137 sample_parameters,
2138
2139 } = out_;
2140 }
2141
2142 ::fidl_next::Encode::encode(self.sample_parameters, encoder_, sample_parameters, ())?;
2143
2144 Ok(())
2145 }
2146 }
2147
2148 pub struct SampleCommitRequest<T0> {
2150 pub sink: T0,
2151 }
2152
2153 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::SampleCommitRequest, ___E>
2154 for SampleCommitRequest<T0>
2155 where
2156 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2157 ___E: ::fidl_next::fuchsia::HandleEncoder,
2158 T0: ::fidl_next::Encode<
2159 ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
2160 ___E,
2161 >,
2162 {
2163 #[inline]
2164 fn encode(
2165 self,
2166 encoder_: &mut ___E,
2167 out_: &mut ::core::mem::MaybeUninit<crate::wire::SampleCommitRequest>,
2168 _: (),
2169 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2170 ::fidl_next::munge! {
2171 let crate::wire::SampleCommitRequest {
2172 sink,
2173
2174 } = out_;
2175 }
2176
2177 ::fidl_next::Encode::encode(self.sink, encoder_, sink, ())?;
2178
2179 Ok(())
2180 }
2181 }
2182
2183 pub struct SampleSinkOnSampleReadiedRequest<T0> {
2185 pub event: T0,
2186 }
2187
2188 unsafe impl<___E, T0>
2189 ::fidl_next::Encode<crate::wire::SampleSinkOnSampleReadiedRequest<'static>, ___E>
2190 for SampleSinkOnSampleReadiedRequest<T0>
2191 where
2192 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2193 ___E: ::fidl_next::Encoder,
2194 ___E: ::fidl_next::fuchsia::HandleEncoder,
2195 T0: ::fidl_next::Encode<crate::wire::SampleSinkResult<'static>, ___E>,
2196 {
2197 #[inline]
2198 fn encode(
2199 self,
2200 encoder_: &mut ___E,
2201 out_: &mut ::core::mem::MaybeUninit<
2202 crate::wire::SampleSinkOnSampleReadiedRequest<'static>,
2203 >,
2204 _: (),
2205 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2206 ::fidl_next::munge! {
2207 let crate::wire::SampleSinkOnSampleReadiedRequest {
2208 event,
2209
2210 } = out_;
2211 }
2212
2213 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
2214
2215 Ok(())
2216 }
2217 }
2218}
2219
2220pub use self::natural::*;
2221
2222#[doc = " Outer protocol for interacting with the different diagnostics data sources.\n"]
2224#[derive(PartialEq, Debug)]
2225pub struct ArchiveAccessor;
2226
2227impl ::fidl_next::Discoverable for ArchiveAccessor {
2228 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.ArchiveAccessor";
2229}
2230
2231#[cfg(target_os = "fuchsia")]
2232impl ::fidl_next::HasTransport for ArchiveAccessor {
2233 type Transport = ::fidl_next::fuchsia::zx::Channel;
2234}
2235
2236pub mod archive_accessor {
2237 pub mod prelude {
2238 pub use crate::{
2239 ArchiveAccessor, ArchiveAccessorClientHandler, ArchiveAccessorLocalClientHandler,
2240 ArchiveAccessorLocalServerHandler, ArchiveAccessorServerHandler, archive_accessor,
2241 };
2242
2243 pub use crate::natural::ArchiveAccessorStreamDiagnosticsRequest;
2244
2245 pub use crate::natural::ArchiveAccessorWaitForReadyResponse;
2246 }
2247
2248 pub struct StreamDiagnostics;
2249
2250 impl ::fidl_next::Method for StreamDiagnostics {
2251 const ORDINAL: u64 = 2361924900314496062;
2252 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2253 ::fidl_next::protocol::Flexibility::Flexible;
2254
2255 type Protocol = crate::ArchiveAccessor;
2256
2257 type Request = crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>;
2258 }
2259
2260 pub struct WaitForReady;
2261
2262 impl ::fidl_next::Method for WaitForReady {
2263 const ORDINAL: u64 = 1308686127901818148;
2264 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2265 ::fidl_next::protocol::Flexibility::Flexible;
2266
2267 type Protocol = crate::ArchiveAccessor;
2268
2269 type Request = ::fidl_next::wire::EmptyMessageBody;
2270 }
2271
2272 impl ::fidl_next::TwoWayMethod for WaitForReady {
2273 type Response =
2274 ::fidl_next::wire::Flexible<'static, crate::wire::ArchiveAccessorWaitForReadyResponse>;
2275 }
2276
2277 impl<___R> ::fidl_next::Respond<___R> for WaitForReady {
2278 type Output = ::fidl_next::Flexible<___R>;
2279
2280 fn respond(response: ___R) -> Self::Output {
2281 ::fidl_next::Flexible::Ok(response)
2282 }
2283 }
2284
2285 mod ___detail {
2286 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ArchiveAccessor
2287 where
2288 ___T: ::fidl_next::Transport,
2289 {
2290 type Client = ArchiveAccessorClient<___T>;
2291 type Server = ArchiveAccessorServer<___T>;
2292 }
2293
2294 #[repr(transparent)]
2296 pub struct ArchiveAccessorClient<___T: ::fidl_next::Transport> {
2297 #[allow(dead_code)]
2298 client: ::fidl_next::protocol::Client<___T>,
2299 }
2300
2301 impl<___T> ArchiveAccessorClient<___T>
2302 where
2303 ___T: ::fidl_next::Transport,
2304 {
2305 #[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"]
2306 pub fn stream_diagnostics(
2307 &self,
2308
2309 stream_parameters: impl ::fidl_next::Encode<
2310 crate::wire::StreamParameters<'static>,
2311 <___T as ::fidl_next::Transport>::SendBuffer,
2312 >,
2313
2314 result_stream: impl ::fidl_next::Encode<
2315 ::fidl_next::ServerEnd<
2316 crate::BatchIterator,
2317 ::fidl_next::wire::fuchsia::Channel,
2318 >,
2319 <___T as ::fidl_next::Transport>::SendBuffer,
2320 >,
2321 ) -> ::fidl_next::SendFuture<'_, ___T>
2322 where
2323 <___T as ::fidl_next::Transport>::SendBuffer:
2324 ::fidl_next::encoder::InternalHandleEncoder,
2325 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2326 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2327 {
2328 self.stream_diagnostics_with(
2329 crate::generic::ArchiveAccessorStreamDiagnosticsRequest {
2330 stream_parameters,
2331
2332 result_stream,
2333 },
2334 )
2335 }
2336
2337 #[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"]
2338 pub fn stream_diagnostics_with<___R>(
2339 &self,
2340 request: ___R,
2341 ) -> ::fidl_next::SendFuture<'_, ___T>
2342 where
2343 ___R: ::fidl_next::Encode<
2344 crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'static>,
2345 <___T as ::fidl_next::Transport>::SendBuffer,
2346 >,
2347 {
2348 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
2349 2361924900314496062,
2350 <super::StreamDiagnostics as ::fidl_next::Method>::FLEXIBILITY,
2351 request,
2352 ))
2353 }
2354
2355 #[doc = " Ensures that the connection with the server was established to prevent\n races when using other pipelined methods of this protocol.\n"]
2356 pub fn wait_for_ready(
2357 &self,
2358 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForReady, ___T> {
2359 ::fidl_next::TwoWayFuture::from_untyped(
2360 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2361 1308686127901818148,
2362 <super::WaitForReady as ::fidl_next::Method>::FLEXIBILITY,
2363 (),
2364 ),
2365 )
2366 }
2367 }
2368
2369 #[repr(transparent)]
2371 pub struct ArchiveAccessorServer<___T: ::fidl_next::Transport> {
2372 server: ::fidl_next::protocol::Server<___T>,
2373 }
2374
2375 impl<___T> ArchiveAccessorServer<___T> where ___T: ::fidl_next::Transport {}
2376 }
2377}
2378
2379#[diagnostic::on_unimplemented(
2380 note = "If {Self} implements the non-local ArchiveAccessorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2381)]
2382
2383pub trait ArchiveAccessorLocalClientHandler<
2387 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2388 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2389>
2390{
2391 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2392 ::core::future::ready(())
2393 }
2394}
2395
2396impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ArchiveAccessor
2397where
2398 ___H: ArchiveAccessorLocalClientHandler<___T>,
2399 ___T: ::fidl_next::Transport,
2400{
2401 async fn on_event(
2402 handler: &mut ___H,
2403 ordinal: u64,
2404 flexibility: ::fidl_next::protocol::Flexibility,
2405 body: ::fidl_next::Body<___T>,
2406 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2407 match ordinal {
2408 ordinal => {
2409 handler.on_unknown_interaction(ordinal).await;
2410 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2411 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2412 } else {
2413 Ok(())
2414 }
2415 }
2416 }
2417 }
2418}
2419
2420#[diagnostic::on_unimplemented(
2421 note = "If {Self} implements the non-local ArchiveAccessorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2422)]
2423
2424pub trait ArchiveAccessorLocalServerHandler<
2428 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2429 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2430>
2431{
2432 #[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"]
2433 fn stream_diagnostics(
2434 &mut self,
2435
2436 request: ::fidl_next::Request<archive_accessor::StreamDiagnostics, ___T>,
2437 ) -> impl ::core::future::Future<Output = ()>;
2438
2439 #[doc = " Ensures that the connection with the server was established to prevent\n races when using other pipelined methods of this protocol.\n"]
2440 fn wait_for_ready(
2441 &mut self,
2442
2443 responder: ::fidl_next::Responder<archive_accessor::WaitForReady, ___T>,
2444 ) -> impl ::core::future::Future<Output = ()>;
2445
2446 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2447 ::core::future::ready(())
2448 }
2449}
2450
2451impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ArchiveAccessor
2452where
2453 ___H: ArchiveAccessorLocalServerHandler<___T>,
2454 ___T: ::fidl_next::Transport,
2455 for<'de> crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'de>: ::fidl_next::Decode<
2456 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2457 Constraint = (),
2458 >,
2459{
2460 async fn on_one_way(
2461 handler: &mut ___H,
2462 ordinal: u64,
2463 flexibility: ::fidl_next::protocol::Flexibility,
2464 body: ::fidl_next::Body<___T>,
2465 ) -> ::core::result::Result<
2466 (),
2467 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2468 > {
2469 match ordinal {
2470 2361924900314496062 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
2471 Ok(decoded) => {
2472 handler.stream_diagnostics(::fidl_next::Request::from_decoded(decoded)).await;
2473 Ok(())
2474 }
2475 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2476 ordinal: 2361924900314496062,
2477 error,
2478 }),
2479 },
2480
2481 ordinal => {
2482 handler.on_unknown_interaction(ordinal).await;
2483 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2484 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2485 } else {
2486 Ok(())
2487 }
2488 }
2489 }
2490 }
2491
2492 async fn on_two_way(
2493 handler: &mut ___H,
2494 ordinal: u64,
2495 flexibility: ::fidl_next::protocol::Flexibility,
2496 body: ::fidl_next::Body<___T>,
2497 responder: ::fidl_next::protocol::Responder<___T>,
2498 ) -> ::core::result::Result<
2499 (),
2500 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2501 > {
2502 match ordinal {
2503 1308686127901818148 => {
2504 let responder = ::fidl_next::Responder::from_untyped(responder);
2505
2506 handler.wait_for_ready(responder).await;
2507 Ok(())
2508 }
2509
2510 ordinal => {
2511 handler.on_unknown_interaction(ordinal).await;
2512 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2513 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2514 } else {
2515 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
2516 ordinal,
2517 flexibility,
2518 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
2519 )
2520 .expect("encoding a framework error should never fail")
2521 .await?;
2522 Ok(())
2523 }
2524 }
2525 }
2526 }
2527}
2528
2529pub trait ArchiveAccessorClientHandler<
2533 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2534 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2535>
2536{
2537 fn on_unknown_interaction(
2538 &mut self,
2539 ordinal: u64,
2540 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2541 ::core::future::ready(())
2542 }
2543}
2544
2545impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ArchiveAccessor
2546where
2547 ___H: ArchiveAccessorClientHandler<___T> + ::core::marker::Send,
2548 ___T: ::fidl_next::Transport,
2549{
2550 async fn on_event(
2551 handler: &mut ___H,
2552 ordinal: u64,
2553 flexibility: ::fidl_next::protocol::Flexibility,
2554 body: ::fidl_next::Body<___T>,
2555 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2556 match ordinal {
2557 ordinal => {
2558 handler.on_unknown_interaction(ordinal).await;
2559 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2560 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2561 } else {
2562 Ok(())
2563 }
2564 }
2565 }
2566 }
2567}
2568
2569pub trait ArchiveAccessorServerHandler<
2573 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2574 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2575>
2576{
2577 #[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"]
2578 fn stream_diagnostics(
2579 &mut self,
2580
2581 request: ::fidl_next::Request<archive_accessor::StreamDiagnostics, ___T>,
2582 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2583
2584 #[doc = " Ensures that the connection with the server was established to prevent\n races when using other pipelined methods of this protocol.\n"]
2585 fn wait_for_ready(
2586 &mut self,
2587
2588 responder: ::fidl_next::Responder<archive_accessor::WaitForReady, ___T>,
2589 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2590
2591 fn on_unknown_interaction(
2592 &mut self,
2593 ordinal: u64,
2594 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2595 ::core::future::ready(())
2596 }
2597}
2598
2599impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ArchiveAccessor
2600where
2601 ___H: ArchiveAccessorServerHandler<___T> + ::core::marker::Send,
2602 ___T: ::fidl_next::Transport,
2603 for<'de> crate::wire::ArchiveAccessorStreamDiagnosticsRequest<'de>: ::fidl_next::Decode<
2604 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2605 Constraint = (),
2606 >,
2607{
2608 async fn on_one_way(
2609 handler: &mut ___H,
2610 ordinal: u64,
2611 flexibility: ::fidl_next::protocol::Flexibility,
2612 body: ::fidl_next::Body<___T>,
2613 ) -> ::core::result::Result<
2614 (),
2615 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2616 > {
2617 match ordinal {
2618 2361924900314496062 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
2619 Ok(decoded) => {
2620 handler.stream_diagnostics(::fidl_next::Request::from_decoded(decoded)).await;
2621 Ok(())
2622 }
2623 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2624 ordinal: 2361924900314496062,
2625 error,
2626 }),
2627 },
2628
2629 ordinal => {
2630 handler.on_unknown_interaction(ordinal).await;
2631 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2632 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2633 } else {
2634 Ok(())
2635 }
2636 }
2637 }
2638 }
2639
2640 async fn on_two_way(
2641 handler: &mut ___H,
2642 ordinal: u64,
2643 flexibility: ::fidl_next::protocol::Flexibility,
2644 body: ::fidl_next::Body<___T>,
2645 responder: ::fidl_next::protocol::Responder<___T>,
2646 ) -> ::core::result::Result<
2647 (),
2648 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2649 > {
2650 match ordinal {
2651 1308686127901818148 => {
2652 let responder = ::fidl_next::Responder::from_untyped(responder);
2653
2654 handler.wait_for_ready(responder).await;
2655 Ok(())
2656 }
2657
2658 ordinal => {
2659 handler.on_unknown_interaction(ordinal).await;
2660 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2661 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2662 } else {
2663 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
2664 ordinal,
2665 flexibility,
2666 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
2667 )
2668 .expect("encoding a framework error should never fail")
2669 .await?;
2670 Ok(())
2671 }
2672 }
2673 }
2674 }
2675}
2676
2677impl<___T> ArchiveAccessorClientHandler<___T> for ::fidl_next::IgnoreEvents
2678where
2679 ___T: ::fidl_next::Transport,
2680{
2681 async fn on_unknown_interaction(&mut self, _: u64) {}
2682}
2683
2684impl<___H, ___T> ArchiveAccessorLocalClientHandler<___T> for ::fidl_next::Local<___H>
2685where
2686 ___H: ArchiveAccessorClientHandler<___T>,
2687 ___T: ::fidl_next::Transport,
2688{
2689 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2690 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2691 }
2692}
2693
2694impl<___H, ___T> ArchiveAccessorLocalServerHandler<___T> for ::fidl_next::Local<___H>
2695where
2696 ___H: ArchiveAccessorServerHandler<___T>,
2697 ___T: ::fidl_next::Transport,
2698{
2699 async fn stream_diagnostics(
2700 &mut self,
2701
2702 request: ::fidl_next::Request<archive_accessor::StreamDiagnostics, ___T>,
2703 ) {
2704 ___H::stream_diagnostics(&mut self.0, request).await
2705 }
2706
2707 async fn wait_for_ready(
2708 &mut self,
2709
2710 responder: ::fidl_next::Responder<archive_accessor::WaitForReady, ___T>,
2711 ) {
2712 ___H::wait_for_ready(&mut self.0, responder).await
2713 }
2714
2715 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2716 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2717 }
2718}
2719
2720#[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"]
2722#[derive(PartialEq, Debug)]
2723pub struct BatchIterator;
2724
2725#[cfg(target_os = "fuchsia")]
2726impl ::fidl_next::HasTransport for BatchIterator {
2727 type Transport = ::fidl_next::fuchsia::zx::Channel;
2728}
2729
2730pub mod batch_iterator {
2731 pub mod prelude {
2732 pub use crate::{
2733 BatchIterator, BatchIteratorClientHandler, BatchIteratorLocalClientHandler,
2734 BatchIteratorLocalServerHandler, BatchIteratorServerHandler, batch_iterator,
2735 };
2736
2737 pub use crate::natural::BatchIteratorGetNextResponse;
2738
2739 pub use crate::natural::BatchIteratorWaitForReadyResponse;
2740
2741 pub use crate::natural::ReaderError;
2742 }
2743
2744 pub struct GetNext;
2745
2746 impl ::fidl_next::Method for GetNext {
2747 const ORDINAL: u64 = 8654095804583269541;
2748 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2749 ::fidl_next::protocol::Flexibility::Flexible;
2750
2751 type Protocol = crate::BatchIterator;
2752
2753 type Request = ::fidl_next::wire::EmptyMessageBody;
2754 }
2755
2756 impl ::fidl_next::TwoWayMethod for GetNext {
2757 type Response = ::fidl_next::wire::FlexibleResult<
2758 'static,
2759 crate::wire::BatchIteratorGetNextResponse<'static>,
2760 crate::wire::ReaderError,
2761 >;
2762 }
2763
2764 impl<___R> ::fidl_next::Respond<___R> for GetNext {
2765 type Output = ::fidl_next::FlexibleResult<
2766 crate::generic::BatchIteratorGetNextResponse<___R>,
2767 ::fidl_next::util::Never,
2768 >;
2769
2770 fn respond(response: ___R) -> Self::Output {
2771 ::fidl_next::FlexibleResult::Ok(crate::generic::BatchIteratorGetNextResponse {
2772 batch: response,
2773 })
2774 }
2775 }
2776
2777 impl<___R> ::fidl_next::RespondErr<___R> for GetNext {
2778 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
2779
2780 fn respond_err(response: ___R) -> Self::Output {
2781 ::fidl_next::FlexibleResult::Err(response)
2782 }
2783 }
2784
2785 pub struct WaitForReady;
2786
2787 impl ::fidl_next::Method for WaitForReady {
2788 const ORDINAL: u64 = 8095658908390618627;
2789 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2790 ::fidl_next::protocol::Flexibility::Flexible;
2791
2792 type Protocol = crate::BatchIterator;
2793
2794 type Request = ::fidl_next::wire::EmptyMessageBody;
2795 }
2796
2797 impl ::fidl_next::TwoWayMethod for WaitForReady {
2798 type Response =
2799 ::fidl_next::wire::Flexible<'static, crate::wire::BatchIteratorWaitForReadyResponse>;
2800 }
2801
2802 impl<___R> ::fidl_next::Respond<___R> for WaitForReady {
2803 type Output = ::fidl_next::Flexible<___R>;
2804
2805 fn respond(response: ___R) -> Self::Output {
2806 ::fidl_next::Flexible::Ok(response)
2807 }
2808 }
2809
2810 mod ___detail {
2811 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::BatchIterator
2812 where
2813 ___T: ::fidl_next::Transport,
2814 {
2815 type Client = BatchIteratorClient<___T>;
2816 type Server = BatchIteratorServer<___T>;
2817 }
2818
2819 #[repr(transparent)]
2821 pub struct BatchIteratorClient<___T: ::fidl_next::Transport> {
2822 #[allow(dead_code)]
2823 client: ::fidl_next::protocol::Client<___T>,
2824 }
2825
2826 impl<___T> BatchIteratorClient<___T>
2827 where
2828 ___T: ::fidl_next::Transport,
2829 {
2830 #[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"]
2831 pub fn get_next(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetNext, ___T> {
2832 ::fidl_next::TwoWayFuture::from_untyped(
2833 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2834 8654095804583269541,
2835 <super::GetNext as ::fidl_next::Method>::FLEXIBILITY,
2836 (),
2837 ),
2838 )
2839 }
2840
2841 #[doc = " Indicates that the BatchIterator has been connected. If the\n BatchIterator hasn\'t been connected, this method will hang until it is.\n"]
2842 pub fn wait_for_ready(
2843 &self,
2844 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForReady, ___T> {
2845 ::fidl_next::TwoWayFuture::from_untyped(
2846 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2847 8095658908390618627,
2848 <super::WaitForReady as ::fidl_next::Method>::FLEXIBILITY,
2849 (),
2850 ),
2851 )
2852 }
2853 }
2854
2855 #[repr(transparent)]
2857 pub struct BatchIteratorServer<___T: ::fidl_next::Transport> {
2858 server: ::fidl_next::protocol::Server<___T>,
2859 }
2860
2861 impl<___T> BatchIteratorServer<___T> where ___T: ::fidl_next::Transport {}
2862 }
2863}
2864
2865#[diagnostic::on_unimplemented(
2866 note = "If {Self} implements the non-local BatchIteratorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2867)]
2868
2869pub trait BatchIteratorLocalClientHandler<
2873 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2874 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2875>
2876{
2877 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2878 ::core::future::ready(())
2879 }
2880}
2881
2882impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for BatchIterator
2883where
2884 ___H: BatchIteratorLocalClientHandler<___T>,
2885 ___T: ::fidl_next::Transport,
2886{
2887 async fn on_event(
2888 handler: &mut ___H,
2889 ordinal: u64,
2890 flexibility: ::fidl_next::protocol::Flexibility,
2891 body: ::fidl_next::Body<___T>,
2892 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2893 match ordinal {
2894 ordinal => {
2895 handler.on_unknown_interaction(ordinal).await;
2896 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2897 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2898 } else {
2899 Ok(())
2900 }
2901 }
2902 }
2903 }
2904}
2905
2906#[diagnostic::on_unimplemented(
2907 note = "If {Self} implements the non-local BatchIteratorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2908)]
2909
2910pub trait BatchIteratorLocalServerHandler<
2914 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2915 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2916>
2917{
2918 #[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"]
2919 fn get_next(
2920 &mut self,
2921
2922 responder: ::fidl_next::Responder<batch_iterator::GetNext, ___T>,
2923 ) -> impl ::core::future::Future<Output = ()>;
2924
2925 #[doc = " Indicates that the BatchIterator has been connected. If the\n BatchIterator hasn\'t been connected, this method will hang until it is.\n"]
2926 fn wait_for_ready(
2927 &mut self,
2928
2929 responder: ::fidl_next::Responder<batch_iterator::WaitForReady, ___T>,
2930 ) -> impl ::core::future::Future<Output = ()>;
2931
2932 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2933 ::core::future::ready(())
2934 }
2935}
2936
2937impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for BatchIterator
2938where
2939 ___H: BatchIteratorLocalServerHandler<___T>,
2940 ___T: ::fidl_next::Transport,
2941{
2942 async fn on_one_way(
2943 handler: &mut ___H,
2944 ordinal: u64,
2945 flexibility: ::fidl_next::protocol::Flexibility,
2946 body: ::fidl_next::Body<___T>,
2947 ) -> ::core::result::Result<
2948 (),
2949 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2950 > {
2951 match ordinal {
2952 ordinal => {
2953 handler.on_unknown_interaction(ordinal).await;
2954 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2955 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2956 } else {
2957 Ok(())
2958 }
2959 }
2960 }
2961 }
2962
2963 async fn on_two_way(
2964 handler: &mut ___H,
2965 ordinal: u64,
2966 flexibility: ::fidl_next::protocol::Flexibility,
2967 body: ::fidl_next::Body<___T>,
2968 responder: ::fidl_next::protocol::Responder<___T>,
2969 ) -> ::core::result::Result<
2970 (),
2971 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2972 > {
2973 match ordinal {
2974 8654095804583269541 => {
2975 let responder = ::fidl_next::Responder::from_untyped(responder);
2976
2977 handler.get_next(responder).await;
2978 Ok(())
2979 }
2980
2981 8095658908390618627 => {
2982 let responder = ::fidl_next::Responder::from_untyped(responder);
2983
2984 handler.wait_for_ready(responder).await;
2985 Ok(())
2986 }
2987
2988 ordinal => {
2989 handler.on_unknown_interaction(ordinal).await;
2990 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2991 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2992 } else {
2993 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
2994 ordinal,
2995 flexibility,
2996 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
2997 )
2998 .expect("encoding a framework error should never fail")
2999 .await?;
3000 Ok(())
3001 }
3002 }
3003 }
3004 }
3005}
3006
3007pub trait BatchIteratorClientHandler<
3011 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3012 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3013>
3014{
3015 fn on_unknown_interaction(
3016 &mut self,
3017 ordinal: u64,
3018 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3019 ::core::future::ready(())
3020 }
3021}
3022
3023impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for BatchIterator
3024where
3025 ___H: BatchIteratorClientHandler<___T> + ::core::marker::Send,
3026 ___T: ::fidl_next::Transport,
3027{
3028 async fn on_event(
3029 handler: &mut ___H,
3030 ordinal: u64,
3031 flexibility: ::fidl_next::protocol::Flexibility,
3032 body: ::fidl_next::Body<___T>,
3033 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3034 match ordinal {
3035 ordinal => {
3036 handler.on_unknown_interaction(ordinal).await;
3037 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3038 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3039 } else {
3040 Ok(())
3041 }
3042 }
3043 }
3044 }
3045}
3046
3047pub trait BatchIteratorServerHandler<
3051 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3052 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3053>
3054{
3055 #[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"]
3056 fn get_next(
3057 &mut self,
3058
3059 responder: ::fidl_next::Responder<batch_iterator::GetNext, ___T>,
3060 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3061
3062 #[doc = " Indicates that the BatchIterator has been connected. If the\n BatchIterator hasn\'t been connected, this method will hang until it is.\n"]
3063 fn wait_for_ready(
3064 &mut self,
3065
3066 responder: ::fidl_next::Responder<batch_iterator::WaitForReady, ___T>,
3067 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3068
3069 fn on_unknown_interaction(
3070 &mut self,
3071 ordinal: u64,
3072 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3073 ::core::future::ready(())
3074 }
3075}
3076
3077impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for BatchIterator
3078where
3079 ___H: BatchIteratorServerHandler<___T> + ::core::marker::Send,
3080 ___T: ::fidl_next::Transport,
3081{
3082 async fn on_one_way(
3083 handler: &mut ___H,
3084 ordinal: u64,
3085 flexibility: ::fidl_next::protocol::Flexibility,
3086 body: ::fidl_next::Body<___T>,
3087 ) -> ::core::result::Result<
3088 (),
3089 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3090 > {
3091 match ordinal {
3092 ordinal => {
3093 handler.on_unknown_interaction(ordinal).await;
3094 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3095 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3096 } else {
3097 Ok(())
3098 }
3099 }
3100 }
3101 }
3102
3103 async fn on_two_way(
3104 handler: &mut ___H,
3105 ordinal: u64,
3106 flexibility: ::fidl_next::protocol::Flexibility,
3107 body: ::fidl_next::Body<___T>,
3108 responder: ::fidl_next::protocol::Responder<___T>,
3109 ) -> ::core::result::Result<
3110 (),
3111 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3112 > {
3113 match ordinal {
3114 8654095804583269541 => {
3115 let responder = ::fidl_next::Responder::from_untyped(responder);
3116
3117 handler.get_next(responder).await;
3118 Ok(())
3119 }
3120
3121 8095658908390618627 => {
3122 let responder = ::fidl_next::Responder::from_untyped(responder);
3123
3124 handler.wait_for_ready(responder).await;
3125 Ok(())
3126 }
3127
3128 ordinal => {
3129 handler.on_unknown_interaction(ordinal).await;
3130 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3131 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3132 } else {
3133 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
3134 ordinal,
3135 flexibility,
3136 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
3137 )
3138 .expect("encoding a framework error should never fail")
3139 .await?;
3140 Ok(())
3141 }
3142 }
3143 }
3144 }
3145}
3146
3147impl<___T> BatchIteratorClientHandler<___T> for ::fidl_next::IgnoreEvents
3148where
3149 ___T: ::fidl_next::Transport,
3150{
3151 async fn on_unknown_interaction(&mut self, _: u64) {}
3152}
3153
3154impl<___H, ___T> BatchIteratorLocalClientHandler<___T> for ::fidl_next::Local<___H>
3155where
3156 ___H: BatchIteratorClientHandler<___T>,
3157 ___T: ::fidl_next::Transport,
3158{
3159 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3160 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3161 }
3162}
3163
3164impl<___H, ___T> BatchIteratorLocalServerHandler<___T> for ::fidl_next::Local<___H>
3165where
3166 ___H: BatchIteratorServerHandler<___T>,
3167 ___T: ::fidl_next::Transport,
3168{
3169 async fn get_next(&mut self, responder: ::fidl_next::Responder<batch_iterator::GetNext, ___T>) {
3170 ___H::get_next(&mut self.0, responder).await
3171 }
3172
3173 async fn wait_for_ready(
3174 &mut self,
3175
3176 responder: ::fidl_next::Responder<batch_iterator::WaitForReady, ___T>,
3177 ) {
3178 ___H::wait_for_ready(&mut self.0, responder).await
3179 }
3180
3181 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3182 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3183 }
3184}
3185
3186#[derive(PartialEq, Debug)]
3188pub struct LogStream;
3189
3190impl ::fidl_next::Discoverable for LogStream {
3191 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.LogStream";
3192}
3193
3194#[cfg(target_os = "fuchsia")]
3195impl ::fidl_next::HasTransport for LogStream {
3196 type Transport = ::fidl_next::fuchsia::zx::Channel;
3197}
3198
3199pub mod log_stream {
3200 pub mod prelude {
3201 pub use crate::{
3202 LogStream, LogStreamClientHandler, LogStreamLocalClientHandler,
3203 LogStreamLocalServerHandler, LogStreamServerHandler, log_stream,
3204 };
3205
3206 pub use crate::natural::LogStreamConnectRequest;
3207 }
3208
3209 pub struct Connect;
3210
3211 impl ::fidl_next::Method for Connect {
3212 const ORDINAL: u64 = 8385336708376631944;
3213 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3214 ::fidl_next::protocol::Flexibility::Flexible;
3215
3216 type Protocol = crate::LogStream;
3217
3218 type Request = crate::wire::LogStreamConnectRequest<'static>;
3219 }
3220
3221 mod ___detail {
3222 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogStream
3223 where
3224 ___T: ::fidl_next::Transport,
3225 {
3226 type Client = LogStreamClient<___T>;
3227 type Server = LogStreamServer<___T>;
3228 }
3229
3230 #[repr(transparent)]
3232 pub struct LogStreamClient<___T: ::fidl_next::Transport> {
3233 #[allow(dead_code)]
3234 client: ::fidl_next::protocol::Client<___T>,
3235 }
3236
3237 impl<___T> LogStreamClient<___T>
3238 where
3239 ___T: ::fidl_next::Transport,
3240 {
3241 #[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"]
3242 pub fn connect(
3243 &self,
3244
3245 socket: impl ::fidl_next::Encode<
3246 ::fidl_next::wire::fuchsia::Socket,
3247 <___T as ::fidl_next::Transport>::SendBuffer,
3248 >,
3249
3250 opts: impl ::fidl_next::Encode<
3251 crate::wire::LogStreamOptions<'static>,
3252 <___T as ::fidl_next::Transport>::SendBuffer,
3253 >,
3254 ) -> ::fidl_next::SendFuture<'_, ___T>
3255 where
3256 <___T as ::fidl_next::Transport>::SendBuffer:
3257 ::fidl_next::encoder::InternalHandleEncoder,
3258 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3259 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3260 {
3261 self.connect_with(crate::generic::LogStreamConnectRequest { socket, opts })
3262 }
3263
3264 #[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"]
3265 pub fn connect_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3266 where
3267 ___R: ::fidl_next::Encode<
3268 crate::wire::LogStreamConnectRequest<'static>,
3269 <___T as ::fidl_next::Transport>::SendBuffer,
3270 >,
3271 {
3272 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3273 8385336708376631944,
3274 <super::Connect as ::fidl_next::Method>::FLEXIBILITY,
3275 request,
3276 ))
3277 }
3278 }
3279
3280 #[repr(transparent)]
3282 pub struct LogStreamServer<___T: ::fidl_next::Transport> {
3283 server: ::fidl_next::protocol::Server<___T>,
3284 }
3285
3286 impl<___T> LogStreamServer<___T> where ___T: ::fidl_next::Transport {}
3287 }
3288}
3289
3290#[diagnostic::on_unimplemented(
3291 note = "If {Self} implements the non-local LogStreamClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3292)]
3293
3294pub trait LogStreamLocalClientHandler<
3298 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3299 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3300>
3301{
3302 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3303 ::core::future::ready(())
3304 }
3305}
3306
3307impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogStream
3308where
3309 ___H: LogStreamLocalClientHandler<___T>,
3310 ___T: ::fidl_next::Transport,
3311{
3312 async fn on_event(
3313 handler: &mut ___H,
3314 ordinal: u64,
3315 flexibility: ::fidl_next::protocol::Flexibility,
3316 body: ::fidl_next::Body<___T>,
3317 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3318 match ordinal {
3319 ordinal => {
3320 handler.on_unknown_interaction(ordinal).await;
3321 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3322 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3323 } else {
3324 Ok(())
3325 }
3326 }
3327 }
3328 }
3329}
3330
3331#[diagnostic::on_unimplemented(
3332 note = "If {Self} implements the non-local LogStreamServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3333)]
3334
3335pub trait LogStreamLocalServerHandler<
3339 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3340 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3341>
3342{
3343 #[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"]
3344 fn connect(
3345 &mut self,
3346
3347 request: ::fidl_next::Request<log_stream::Connect, ___T>,
3348 ) -> impl ::core::future::Future<Output = ()>;
3349
3350 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3351 ::core::future::ready(())
3352 }
3353}
3354
3355impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogStream
3356where
3357 ___H: LogStreamLocalServerHandler<___T>,
3358 ___T: ::fidl_next::Transport,
3359 for<'de> crate::wire::LogStreamConnectRequest<'de>: ::fidl_next::Decode<
3360 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3361 Constraint = (),
3362 >,
3363{
3364 async fn on_one_way(
3365 handler: &mut ___H,
3366 ordinal: u64,
3367 flexibility: ::fidl_next::protocol::Flexibility,
3368 body: ::fidl_next::Body<___T>,
3369 ) -> ::core::result::Result<
3370 (),
3371 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3372 > {
3373 match ordinal {
3374 8385336708376631944 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
3375 Ok(decoded) => {
3376 handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
3377 Ok(())
3378 }
3379 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3380 ordinal: 8385336708376631944,
3381 error,
3382 }),
3383 },
3384
3385 ordinal => {
3386 handler.on_unknown_interaction(ordinal).await;
3387 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3388 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3389 } else {
3390 Ok(())
3391 }
3392 }
3393 }
3394 }
3395
3396 async fn on_two_way(
3397 handler: &mut ___H,
3398 ordinal: u64,
3399 flexibility: ::fidl_next::protocol::Flexibility,
3400 body: ::fidl_next::Body<___T>,
3401 responder: ::fidl_next::protocol::Responder<___T>,
3402 ) -> ::core::result::Result<
3403 (),
3404 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3405 > {
3406 match ordinal {
3407 ordinal => {
3408 handler.on_unknown_interaction(ordinal).await;
3409 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3410 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3411 } else {
3412 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
3413 ordinal,
3414 flexibility,
3415 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
3416 )
3417 .expect("encoding a framework error should never fail")
3418 .await?;
3419 Ok(())
3420 }
3421 }
3422 }
3423 }
3424}
3425
3426pub trait LogStreamClientHandler<
3430 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3431 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3432>
3433{
3434 fn on_unknown_interaction(
3435 &mut self,
3436 ordinal: u64,
3437 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3438 ::core::future::ready(())
3439 }
3440}
3441
3442impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogStream
3443where
3444 ___H: LogStreamClientHandler<___T> + ::core::marker::Send,
3445 ___T: ::fidl_next::Transport,
3446{
3447 async fn on_event(
3448 handler: &mut ___H,
3449 ordinal: u64,
3450 flexibility: ::fidl_next::protocol::Flexibility,
3451 body: ::fidl_next::Body<___T>,
3452 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3453 match ordinal {
3454 ordinal => {
3455 handler.on_unknown_interaction(ordinal).await;
3456 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3457 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3458 } else {
3459 Ok(())
3460 }
3461 }
3462 }
3463 }
3464}
3465
3466pub trait LogStreamServerHandler<
3470 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3471 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3472>
3473{
3474 #[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"]
3475 fn connect(
3476 &mut self,
3477
3478 request: ::fidl_next::Request<log_stream::Connect, ___T>,
3479 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3480
3481 fn on_unknown_interaction(
3482 &mut self,
3483 ordinal: u64,
3484 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3485 ::core::future::ready(())
3486 }
3487}
3488
3489impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogStream
3490where
3491 ___H: LogStreamServerHandler<___T> + ::core::marker::Send,
3492 ___T: ::fidl_next::Transport,
3493 for<'de> crate::wire::LogStreamConnectRequest<'de>: ::fidl_next::Decode<
3494 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3495 Constraint = (),
3496 >,
3497{
3498 async fn on_one_way(
3499 handler: &mut ___H,
3500 ordinal: u64,
3501 flexibility: ::fidl_next::protocol::Flexibility,
3502 body: ::fidl_next::Body<___T>,
3503 ) -> ::core::result::Result<
3504 (),
3505 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3506 > {
3507 match ordinal {
3508 8385336708376631944 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
3509 Ok(decoded) => {
3510 handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
3511 Ok(())
3512 }
3513 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3514 ordinal: 8385336708376631944,
3515 error,
3516 }),
3517 },
3518
3519 ordinal => {
3520 handler.on_unknown_interaction(ordinal).await;
3521 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3522 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3523 } else {
3524 Ok(())
3525 }
3526 }
3527 }
3528 }
3529
3530 async fn on_two_way(
3531 handler: &mut ___H,
3532 ordinal: u64,
3533 flexibility: ::fidl_next::protocol::Flexibility,
3534 body: ::fidl_next::Body<___T>,
3535 responder: ::fidl_next::protocol::Responder<___T>,
3536 ) -> ::core::result::Result<
3537 (),
3538 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3539 > {
3540 match ordinal {
3541 ordinal => {
3542 handler.on_unknown_interaction(ordinal).await;
3543 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3544 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3545 } else {
3546 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
3547 ordinal,
3548 flexibility,
3549 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
3550 )
3551 .expect("encoding a framework error should never fail")
3552 .await?;
3553 Ok(())
3554 }
3555 }
3556 }
3557 }
3558}
3559
3560impl<___T> LogStreamClientHandler<___T> for ::fidl_next::IgnoreEvents
3561where
3562 ___T: ::fidl_next::Transport,
3563{
3564 async fn on_unknown_interaction(&mut self, _: u64) {}
3565}
3566
3567impl<___H, ___T> LogStreamLocalClientHandler<___T> for ::fidl_next::Local<___H>
3568where
3569 ___H: LogStreamClientHandler<___T>,
3570 ___T: ::fidl_next::Transport,
3571{
3572 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3573 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3574 }
3575}
3576
3577impl<___H, ___T> LogStreamLocalServerHandler<___T> for ::fidl_next::Local<___H>
3578where
3579 ___H: LogStreamServerHandler<___T>,
3580 ___T: ::fidl_next::Transport,
3581{
3582 async fn connect(&mut self, request: ::fidl_next::Request<log_stream::Connect, ___T>) {
3583 ___H::connect(&mut self.0, request).await
3584 }
3585
3586 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3587 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3588 }
3589}
3590
3591#[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"]
3593#[derive(PartialEq, Debug)]
3594pub struct Sample;
3595
3596impl ::fidl_next::Discoverable for Sample {
3597 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.Sample";
3598}
3599
3600#[cfg(target_os = "fuchsia")]
3601impl ::fidl_next::HasTransport for Sample {
3602 type Transport = ::fidl_next::fuchsia::zx::Channel;
3603}
3604
3605pub mod sample {
3606 pub mod prelude {
3607 pub use crate::{
3608 Sample, SampleClientHandler, SampleLocalClientHandler, SampleLocalServerHandler,
3609 SampleServerHandler, sample,
3610 };
3611
3612 pub use crate::natural::ConfigurationError;
3613
3614 pub use crate::natural::SampleCommitRequest;
3615
3616 pub use crate::natural::SampleSetRequest;
3617
3618 pub use crate::natural::SampleCommitResponse;
3619 }
3620
3621 pub struct Set;
3622
3623 impl ::fidl_next::Method for Set {
3624 const ORDINAL: u64 = 4763253411762487694;
3625 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3626 ::fidl_next::protocol::Flexibility::Flexible;
3627
3628 type Protocol = crate::Sample;
3629
3630 type Request = crate::wire::SampleSetRequest<'static>;
3631 }
3632
3633 pub struct Commit;
3634
3635 impl ::fidl_next::Method for Commit {
3636 const ORDINAL: u64 = 2712218517460516507;
3637 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3638 ::fidl_next::protocol::Flexibility::Flexible;
3639
3640 type Protocol = crate::Sample;
3641
3642 type Request = crate::wire::SampleCommitRequest;
3643 }
3644
3645 impl ::fidl_next::TwoWayMethod for Commit {
3646 type Response = ::fidl_next::wire::FlexibleResult<
3647 'static,
3648 crate::wire::SampleCommitResponse,
3649 crate::wire::ConfigurationError,
3650 >;
3651 }
3652
3653 impl<___R> ::fidl_next::Respond<___R> for Commit {
3654 type Output = ::fidl_next::FlexibleResult<___R, ::fidl_next::util::Never>;
3655
3656 fn respond(response: ___R) -> Self::Output {
3657 ::fidl_next::FlexibleResult::Ok(response)
3658 }
3659 }
3660
3661 impl<___R> ::fidl_next::RespondErr<___R> for Commit {
3662 type Output = ::fidl_next::FlexibleResult<::fidl_next::util::Never, ___R>;
3663
3664 fn respond_err(response: ___R) -> Self::Output {
3665 ::fidl_next::FlexibleResult::Err(response)
3666 }
3667 }
3668
3669 mod ___detail {
3670 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Sample
3671 where
3672 ___T: ::fidl_next::Transport,
3673 {
3674 type Client = SampleClient<___T>;
3675 type Server = SampleServer<___T>;
3676 }
3677
3678 #[repr(transparent)]
3680 pub struct SampleClient<___T: ::fidl_next::Transport> {
3681 #[allow(dead_code)]
3682 client: ::fidl_next::protocol::Client<___T>,
3683 }
3684
3685 impl<___T> SampleClient<___T>
3686 where
3687 ___T: ::fidl_next::Transport,
3688 {
3689 #[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"]
3690 pub fn set(
3691 &self,
3692
3693 sample_parameters: impl ::fidl_next::Encode<
3694 crate::wire::SampleParameters<'static>,
3695 <___T as ::fidl_next::Transport>::SendBuffer,
3696 >,
3697 ) -> ::fidl_next::SendFuture<'_, ___T>
3698 where
3699 <___T as ::fidl_next::Transport>::SendBuffer:
3700 ::fidl_next::encoder::InternalHandleEncoder,
3701 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3702 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3703 {
3704 self.set_with(crate::generic::SampleSetRequest { sample_parameters })
3705 }
3706
3707 #[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"]
3708 pub fn set_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
3709 where
3710 ___R: ::fidl_next::Encode<
3711 crate::wire::SampleSetRequest<'static>,
3712 <___T as ::fidl_next::Transport>::SendBuffer,
3713 >,
3714 {
3715 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3716 4763253411762487694,
3717 <super::Set as ::fidl_next::Method>::FLEXIBILITY,
3718 request,
3719 ))
3720 }
3721
3722 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3723 pub fn commit(
3724 &self,
3725
3726 sink: impl ::fidl_next::Encode<
3727 ::fidl_next::ClientEnd<crate::SampleSink, ::fidl_next::wire::fuchsia::Channel>,
3728 <___T as ::fidl_next::Transport>::SendBuffer,
3729 >,
3730 ) -> ::fidl_next::TwoWayFuture<'_, super::Commit, ___T>
3731 where
3732 <___T as ::fidl_next::Transport>::SendBuffer:
3733 ::fidl_next::encoder::InternalHandleEncoder,
3734 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3735 {
3736 self.commit_with(crate::generic::SampleCommitRequest { sink })
3737 }
3738
3739 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3740 pub fn commit_with<___R>(
3741 &self,
3742 request: ___R,
3743 ) -> ::fidl_next::TwoWayFuture<'_, super::Commit, ___T>
3744 where
3745 ___R: ::fidl_next::Encode<
3746 crate::wire::SampleCommitRequest,
3747 <___T as ::fidl_next::Transport>::SendBuffer,
3748 >,
3749 {
3750 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3751 2712218517460516507,
3752 <super::Commit as ::fidl_next::Method>::FLEXIBILITY,
3753 request,
3754 ))
3755 }
3756 }
3757
3758 #[repr(transparent)]
3760 pub struct SampleServer<___T: ::fidl_next::Transport> {
3761 server: ::fidl_next::protocol::Server<___T>,
3762 }
3763
3764 impl<___T> SampleServer<___T> where ___T: ::fidl_next::Transport {}
3765 }
3766}
3767
3768#[diagnostic::on_unimplemented(
3769 note = "If {Self} implements the non-local SampleClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3770)]
3771
3772pub trait SampleLocalClientHandler<
3776 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3777 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3778>
3779{
3780 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3781 ::core::future::ready(())
3782 }
3783}
3784
3785impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Sample
3786where
3787 ___H: SampleLocalClientHandler<___T>,
3788 ___T: ::fidl_next::Transport,
3789{
3790 async fn on_event(
3791 handler: &mut ___H,
3792 ordinal: u64,
3793 flexibility: ::fidl_next::protocol::Flexibility,
3794 body: ::fidl_next::Body<___T>,
3795 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3796 match ordinal {
3797 ordinal => {
3798 handler.on_unknown_interaction(ordinal).await;
3799 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3800 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3801 } else {
3802 Ok(())
3803 }
3804 }
3805 }
3806 }
3807}
3808
3809#[diagnostic::on_unimplemented(
3810 note = "If {Self} implements the non-local SampleServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3811)]
3812
3813pub trait SampleLocalServerHandler<
3817 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3818 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3819>
3820{
3821 #[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"]
3822 fn set(
3823 &mut self,
3824
3825 request: ::fidl_next::Request<sample::Set, ___T>,
3826 ) -> impl ::core::future::Future<Output = ()>;
3827
3828 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3829 fn commit(
3830 &mut self,
3831
3832 request: ::fidl_next::Request<sample::Commit, ___T>,
3833
3834 responder: ::fidl_next::Responder<sample::Commit, ___T>,
3835 ) -> impl ::core::future::Future<Output = ()>;
3836
3837 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3838 ::core::future::ready(())
3839 }
3840}
3841
3842impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Sample
3843where
3844 ___H: SampleLocalServerHandler<___T>,
3845 ___T: ::fidl_next::Transport,
3846 for<'de> crate::wire::SampleSetRequest<'de>: ::fidl_next::Decode<
3847 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3848 Constraint = (),
3849 >,
3850 for<'de> crate::wire::SampleCommitRequest: ::fidl_next::Decode<
3851 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3852 Constraint = (),
3853 >,
3854{
3855 async fn on_one_way(
3856 handler: &mut ___H,
3857 ordinal: u64,
3858 flexibility: ::fidl_next::protocol::Flexibility,
3859 body: ::fidl_next::Body<___T>,
3860 ) -> ::core::result::Result<
3861 (),
3862 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3863 > {
3864 match ordinal {
3865 4763253411762487694 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
3866 Ok(decoded) => {
3867 handler.set(::fidl_next::Request::from_decoded(decoded)).await;
3868 Ok(())
3869 }
3870 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3871 ordinal: 4763253411762487694,
3872 error,
3873 }),
3874 },
3875
3876 ordinal => {
3877 handler.on_unknown_interaction(ordinal).await;
3878 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3879 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3880 } else {
3881 Ok(())
3882 }
3883 }
3884 }
3885 }
3886
3887 async fn on_two_way(
3888 handler: &mut ___H,
3889 ordinal: u64,
3890 flexibility: ::fidl_next::protocol::Flexibility,
3891 body: ::fidl_next::Body<___T>,
3892 responder: ::fidl_next::protocol::Responder<___T>,
3893 ) -> ::core::result::Result<
3894 (),
3895 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3896 > {
3897 match ordinal {
3898 2712218517460516507 => {
3899 let responder = ::fidl_next::Responder::from_untyped(responder);
3900
3901 match ::fidl_next::AsDecoderExt::into_decoded(body) {
3902 Ok(decoded) => {
3903 handler
3904 .commit(::fidl_next::Request::from_decoded(decoded), responder)
3905 .await;
3906 Ok(())
3907 }
3908 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3909 ordinal: 2712218517460516507,
3910 error,
3911 }),
3912 }
3913 }
3914
3915 ordinal => {
3916 handler.on_unknown_interaction(ordinal).await;
3917 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3918 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3919 } else {
3920 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
3921 ordinal,
3922 flexibility,
3923 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
3924 )
3925 .expect("encoding a framework error should never fail")
3926 .await?;
3927 Ok(())
3928 }
3929 }
3930 }
3931 }
3932}
3933
3934pub trait SampleClientHandler<
3938 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3939 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3940>
3941{
3942 fn on_unknown_interaction(
3943 &mut self,
3944 ordinal: u64,
3945 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3946 ::core::future::ready(())
3947 }
3948}
3949
3950impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Sample
3951where
3952 ___H: SampleClientHandler<___T> + ::core::marker::Send,
3953 ___T: ::fidl_next::Transport,
3954{
3955 async fn on_event(
3956 handler: &mut ___H,
3957 ordinal: u64,
3958 flexibility: ::fidl_next::protocol::Flexibility,
3959 body: ::fidl_next::Body<___T>,
3960 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3961 match ordinal {
3962 ordinal => {
3963 handler.on_unknown_interaction(ordinal).await;
3964 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
3965 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3966 } else {
3967 Ok(())
3968 }
3969 }
3970 }
3971 }
3972}
3973
3974pub trait SampleServerHandler<
3978 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3979 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3980>
3981{
3982 #[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"]
3983 fn set(
3984 &mut self,
3985
3986 request: ::fidl_next::Request<sample::Set, ___T>,
3987 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3988
3989 #[doc = " `Commit` returns errors quickly, as all configuration is validated\n before the first sample is taken.\n"]
3990 fn commit(
3991 &mut self,
3992
3993 request: ::fidl_next::Request<sample::Commit, ___T>,
3994
3995 responder: ::fidl_next::Responder<sample::Commit, ___T>,
3996 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3997
3998 fn on_unknown_interaction(
3999 &mut self,
4000 ordinal: u64,
4001 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4002 ::core::future::ready(())
4003 }
4004}
4005
4006impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Sample
4007where
4008 ___H: SampleServerHandler<___T> + ::core::marker::Send,
4009 ___T: ::fidl_next::Transport,
4010 for<'de> crate::wire::SampleSetRequest<'de>: ::fidl_next::Decode<
4011 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4012 Constraint = (),
4013 >,
4014 for<'de> crate::wire::SampleCommitRequest: ::fidl_next::Decode<
4015 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4016 Constraint = (),
4017 >,
4018{
4019 async fn on_one_way(
4020 handler: &mut ___H,
4021 ordinal: u64,
4022 flexibility: ::fidl_next::protocol::Flexibility,
4023 body: ::fidl_next::Body<___T>,
4024 ) -> ::core::result::Result<
4025 (),
4026 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4027 > {
4028 match ordinal {
4029 4763253411762487694 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4030 Ok(decoded) => {
4031 handler.set(::fidl_next::Request::from_decoded(decoded)).await;
4032 Ok(())
4033 }
4034 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4035 ordinal: 4763253411762487694,
4036 error,
4037 }),
4038 },
4039
4040 ordinal => {
4041 handler.on_unknown_interaction(ordinal).await;
4042 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4043 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4044 } else {
4045 Ok(())
4046 }
4047 }
4048 }
4049 }
4050
4051 async fn on_two_way(
4052 handler: &mut ___H,
4053 ordinal: u64,
4054 flexibility: ::fidl_next::protocol::Flexibility,
4055 body: ::fidl_next::Body<___T>,
4056 responder: ::fidl_next::protocol::Responder<___T>,
4057 ) -> ::core::result::Result<
4058 (),
4059 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4060 > {
4061 match ordinal {
4062 2712218517460516507 => {
4063 let responder = ::fidl_next::Responder::from_untyped(responder);
4064
4065 match ::fidl_next::AsDecoderExt::into_decoded(body) {
4066 Ok(decoded) => {
4067 handler
4068 .commit(::fidl_next::Request::from_decoded(decoded), responder)
4069 .await;
4070 Ok(())
4071 }
4072 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4073 ordinal: 2712218517460516507,
4074 error,
4075 }),
4076 }
4077 }
4078
4079 ordinal => {
4080 handler.on_unknown_interaction(ordinal).await;
4081 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4082 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4083 } else {
4084 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
4085 ordinal,
4086 flexibility,
4087 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
4088 )
4089 .expect("encoding a framework error should never fail")
4090 .await?;
4091 Ok(())
4092 }
4093 }
4094 }
4095 }
4096}
4097
4098impl<___T> SampleClientHandler<___T> for ::fidl_next::IgnoreEvents
4099where
4100 ___T: ::fidl_next::Transport,
4101{
4102 async fn on_unknown_interaction(&mut self, _: u64) {}
4103}
4104
4105impl<___H, ___T> SampleLocalClientHandler<___T> for ::fidl_next::Local<___H>
4106where
4107 ___H: SampleClientHandler<___T>,
4108 ___T: ::fidl_next::Transport,
4109{
4110 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4111 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4112 }
4113}
4114
4115impl<___H, ___T> SampleLocalServerHandler<___T> for ::fidl_next::Local<___H>
4116where
4117 ___H: SampleServerHandler<___T>,
4118 ___T: ::fidl_next::Transport,
4119{
4120 async fn set(&mut self, request: ::fidl_next::Request<sample::Set, ___T>) {
4121 ___H::set(&mut self.0, request).await
4122 }
4123
4124 async fn commit(
4125 &mut self,
4126
4127 request: ::fidl_next::Request<sample::Commit, ___T>,
4128
4129 responder: ::fidl_next::Responder<sample::Commit, ___T>,
4130 ) {
4131 ___H::commit(&mut self.0, request, responder).await
4132 }
4133
4134 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4135 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4136 }
4137}
4138
4139#[doc = " `SampleSink` is served by the client, in order to be notified when samples\n are ready.\n"]
4141#[derive(PartialEq, Debug)]
4142pub struct SampleSink;
4143
4144impl ::fidl_next::Discoverable for SampleSink {
4145 const PROTOCOL_NAME: &'static str = "fuchsia.diagnostics.SampleSink";
4146}
4147
4148#[cfg(target_os = "fuchsia")]
4149impl ::fidl_next::HasTransport for SampleSink {
4150 type Transport = ::fidl_next::fuchsia::zx::Channel;
4151}
4152
4153pub mod sample_sink {
4154 pub mod prelude {
4155 pub use crate::{
4156 SampleSink, SampleSinkClientHandler, SampleSinkLocalClientHandler,
4157 SampleSinkLocalServerHandler, SampleSinkServerHandler, sample_sink,
4158 };
4159
4160 pub use crate::natural::SampleSinkOnSampleReadiedRequest;
4161 }
4162
4163 pub struct OnSampleReadied;
4164
4165 impl ::fidl_next::Method for OnSampleReadied {
4166 const ORDINAL: u64 = 4109936634236187487;
4167 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4168 ::fidl_next::protocol::Flexibility::Flexible;
4169
4170 type Protocol = crate::SampleSink;
4171
4172 type Request = crate::wire::SampleSinkOnSampleReadiedRequest<'static>;
4173 }
4174
4175 pub struct OnNowOrNever;
4176
4177 impl ::fidl_next::Method for OnNowOrNever {
4178 const ORDINAL: u64 = 4452173964783454356;
4179 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4180 ::fidl_next::protocol::Flexibility::Flexible;
4181
4182 type Protocol = crate::SampleSink;
4183
4184 type Request = ::fidl_next::wire::EmptyMessageBody;
4185 }
4186
4187 mod ___detail {
4188 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::SampleSink
4189 where
4190 ___T: ::fidl_next::Transport,
4191 {
4192 type Client = SampleSinkClient<___T>;
4193 type Server = SampleSinkServer<___T>;
4194 }
4195
4196 #[repr(transparent)]
4198 pub struct SampleSinkClient<___T: ::fidl_next::Transport> {
4199 #[allow(dead_code)]
4200 client: ::fidl_next::protocol::Client<___T>,
4201 }
4202
4203 impl<___T> SampleSinkClient<___T>
4204 where
4205 ___T: ::fidl_next::Transport,
4206 {
4207 pub fn on_sample_readied(
4208 &self,
4209
4210 event: impl ::fidl_next::Encode<
4211 crate::wire::SampleSinkResult<'static>,
4212 <___T as ::fidl_next::Transport>::SendBuffer,
4213 >,
4214 ) -> ::fidl_next::SendFuture<'_, ___T>
4215 where
4216 <___T as ::fidl_next::Transport>::SendBuffer:
4217 ::fidl_next::encoder::InternalHandleEncoder,
4218 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4219 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
4220 {
4221 self.on_sample_readied_with(crate::generic::SampleSinkOnSampleReadiedRequest {
4222 event,
4223 })
4224 }
4225
4226 pub fn on_sample_readied_with<___R>(
4227 &self,
4228 request: ___R,
4229 ) -> ::fidl_next::SendFuture<'_, ___T>
4230 where
4231 ___R: ::fidl_next::Encode<
4232 crate::wire::SampleSinkOnSampleReadiedRequest<'static>,
4233 <___T as ::fidl_next::Transport>::SendBuffer,
4234 >,
4235 {
4236 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
4237 4109936634236187487,
4238 <super::OnSampleReadied as ::fidl_next::Method>::FLEXIBILITY,
4239 request,
4240 ))
4241 }
4242 }
4243
4244 #[repr(transparent)]
4246 pub struct SampleSinkServer<___T: ::fidl_next::Transport> {
4247 server: ::fidl_next::protocol::Server<___T>,
4248 }
4249
4250 impl<___T> SampleSinkServer<___T>
4251 where
4252 ___T: ::fidl_next::Transport,
4253 {
4254 #[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"]
4255 pub fn on_now_or_never(&self) -> ::fidl_next::SendFuture<'_, ___T> {
4256 ::fidl_next::SendFuture::from_untyped(
4257 self.server.send_event::<::fidl_next::wire::EmptyMessageBody>(
4258 4452173964783454356,
4259 <super::OnNowOrNever as ::fidl_next::Method>::FLEXIBILITY,
4260 (),
4261 ),
4262 )
4263 }
4264 }
4265 }
4266}
4267
4268#[diagnostic::on_unimplemented(
4269 note = "If {Self} implements the non-local SampleSinkClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4270)]
4271
4272pub trait SampleSinkLocalClientHandler<
4276 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4277 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4278>
4279{
4280 #[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"]
4281 fn on_now_or_never(&mut self) -> impl ::core::future::Future<Output = ()>;
4282
4283 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4284 ::core::future::ready(())
4285 }
4286}
4287
4288impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for SampleSink
4289where
4290 ___H: SampleSinkLocalClientHandler<___T>,
4291 ___T: ::fidl_next::Transport,
4292{
4293 async fn on_event(
4294 handler: &mut ___H,
4295 ordinal: u64,
4296 flexibility: ::fidl_next::protocol::Flexibility,
4297 body: ::fidl_next::Body<___T>,
4298 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4299 match ordinal {
4300 4452173964783454356 => {
4301 handler.on_now_or_never().await;
4302 Ok(())
4303 }
4304
4305 ordinal => {
4306 handler.on_unknown_interaction(ordinal).await;
4307 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4308 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4309 } else {
4310 Ok(())
4311 }
4312 }
4313 }
4314 }
4315}
4316
4317#[diagnostic::on_unimplemented(
4318 note = "If {Self} implements the non-local SampleSinkServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4319)]
4320
4321pub trait SampleSinkLocalServerHandler<
4325 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4326 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4327>
4328{
4329 fn on_sample_readied(
4330 &mut self,
4331
4332 request: ::fidl_next::Request<sample_sink::OnSampleReadied, ___T>,
4333 ) -> impl ::core::future::Future<Output = ()>;
4334
4335 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4336 ::core::future::ready(())
4337 }
4338}
4339
4340impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for SampleSink
4341where
4342 ___H: SampleSinkLocalServerHandler<___T>,
4343 ___T: ::fidl_next::Transport,
4344 for<'de> crate::wire::SampleSinkOnSampleReadiedRequest<'de>: ::fidl_next::Decode<
4345 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4346 Constraint = (),
4347 >,
4348{
4349 async fn on_one_way(
4350 handler: &mut ___H,
4351 ordinal: u64,
4352 flexibility: ::fidl_next::protocol::Flexibility,
4353 body: ::fidl_next::Body<___T>,
4354 ) -> ::core::result::Result<
4355 (),
4356 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4357 > {
4358 match ordinal {
4359 4109936634236187487 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4360 Ok(decoded) => {
4361 handler.on_sample_readied(::fidl_next::Request::from_decoded(decoded)).await;
4362 Ok(())
4363 }
4364 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4365 ordinal: 4109936634236187487,
4366 error,
4367 }),
4368 },
4369
4370 ordinal => {
4371 handler.on_unknown_interaction(ordinal).await;
4372 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4373 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4374 } else {
4375 Ok(())
4376 }
4377 }
4378 }
4379 }
4380
4381 async fn on_two_way(
4382 handler: &mut ___H,
4383 ordinal: u64,
4384 flexibility: ::fidl_next::protocol::Flexibility,
4385 body: ::fidl_next::Body<___T>,
4386 responder: ::fidl_next::protocol::Responder<___T>,
4387 ) -> ::core::result::Result<
4388 (),
4389 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4390 > {
4391 match ordinal {
4392 ordinal => {
4393 handler.on_unknown_interaction(ordinal).await;
4394 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4395 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4396 } else {
4397 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
4398 ordinal,
4399 flexibility,
4400 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
4401 )
4402 .expect("encoding a framework error should never fail")
4403 .await?;
4404 Ok(())
4405 }
4406 }
4407 }
4408 }
4409}
4410
4411pub trait SampleSinkClientHandler<
4415 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4416 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4417>
4418{
4419 #[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"]
4420 fn on_now_or_never(
4421 &mut self,
4422 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4423
4424 fn on_unknown_interaction(
4425 &mut self,
4426 ordinal: u64,
4427 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4428 ::core::future::ready(())
4429 }
4430}
4431
4432impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for SampleSink
4433where
4434 ___H: SampleSinkClientHandler<___T> + ::core::marker::Send,
4435 ___T: ::fidl_next::Transport,
4436{
4437 async fn on_event(
4438 handler: &mut ___H,
4439 ordinal: u64,
4440 flexibility: ::fidl_next::protocol::Flexibility,
4441 body: ::fidl_next::Body<___T>,
4442 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4443 match ordinal {
4444 4452173964783454356 => {
4445 handler.on_now_or_never().await;
4446 Ok(())
4447 }
4448
4449 ordinal => {
4450 handler.on_unknown_interaction(ordinal).await;
4451 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4452 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4453 } else {
4454 Ok(())
4455 }
4456 }
4457 }
4458 }
4459}
4460
4461pub trait SampleSinkServerHandler<
4465 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4466 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4467>
4468{
4469 fn on_sample_readied(
4470 &mut self,
4471
4472 request: ::fidl_next::Request<sample_sink::OnSampleReadied, ___T>,
4473 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4474
4475 fn on_unknown_interaction(
4476 &mut self,
4477 ordinal: u64,
4478 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4479 ::core::future::ready(())
4480 }
4481}
4482
4483impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for SampleSink
4484where
4485 ___H: SampleSinkServerHandler<___T> + ::core::marker::Send,
4486 ___T: ::fidl_next::Transport,
4487 for<'de> crate::wire::SampleSinkOnSampleReadiedRequest<'de>: ::fidl_next::Decode<
4488 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4489 Constraint = (),
4490 >,
4491{
4492 async fn on_one_way(
4493 handler: &mut ___H,
4494 ordinal: u64,
4495 flexibility: ::fidl_next::protocol::Flexibility,
4496 body: ::fidl_next::Body<___T>,
4497 ) -> ::core::result::Result<
4498 (),
4499 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4500 > {
4501 match ordinal {
4502 4109936634236187487 => match ::fidl_next::AsDecoderExt::into_decoded(body) {
4503 Ok(decoded) => {
4504 handler.on_sample_readied(::fidl_next::Request::from_decoded(decoded)).await;
4505 Ok(())
4506 }
4507 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4508 ordinal: 4109936634236187487,
4509 error,
4510 }),
4511 },
4512
4513 ordinal => {
4514 handler.on_unknown_interaction(ordinal).await;
4515 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4516 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4517 } else {
4518 Ok(())
4519 }
4520 }
4521 }
4522 }
4523
4524 async fn on_two_way(
4525 handler: &mut ___H,
4526 ordinal: u64,
4527 flexibility: ::fidl_next::protocol::Flexibility,
4528 body: ::fidl_next::Body<___T>,
4529 responder: ::fidl_next::protocol::Responder<___T>,
4530 ) -> ::core::result::Result<
4531 (),
4532 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4533 > {
4534 match ordinal {
4535 ordinal => {
4536 handler.on_unknown_interaction(ordinal).await;
4537 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
4538 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4539 } else {
4540 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
4541 ordinal,
4542 flexibility,
4543 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
4544 )
4545 .expect("encoding a framework error should never fail")
4546 .await?;
4547 Ok(())
4548 }
4549 }
4550 }
4551 }
4552}
4553
4554impl<___T> SampleSinkClientHandler<___T> for ::fidl_next::IgnoreEvents
4555where
4556 ___T: ::fidl_next::Transport,
4557{
4558 async fn on_now_or_never(&mut self) {}
4559
4560 async fn on_unknown_interaction(&mut self, _: u64) {}
4561}
4562
4563impl<___H, ___T> SampleSinkLocalClientHandler<___T> for ::fidl_next::Local<___H>
4564where
4565 ___H: SampleSinkClientHandler<___T>,
4566 ___T: ::fidl_next::Transport,
4567{
4568 async fn on_now_or_never(&mut self) {
4569 ___H::on_now_or_never(&mut self.0).await
4570 }
4571
4572 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4573 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4574 }
4575}
4576
4577impl<___H, ___T> SampleSinkLocalServerHandler<___T> for ::fidl_next::Local<___H>
4578where
4579 ___H: SampleSinkServerHandler<___T>,
4580 ___T: ::fidl_next::Transport,
4581{
4582 async fn on_sample_readied(
4583 &mut self,
4584
4585 request: ::fidl_next::Request<sample_sink::OnSampleReadied, ___T>,
4586 ) {
4587 ___H::on_sample_readied(&mut self.0, request).await
4588 }
4589
4590 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4591 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4592 }
4593}
4594
4595pub use fidl_next_common_fuchsia_diagnostics::*;