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