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