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_logger::natural::*;
8
9 #[derive(Debug, PartialEq)]
10 pub struct LogListenSafeRequest {
11 pub log_listener:
12 ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::fuchsia::zx::Channel>,
13
14 pub options: ::core::option::Option<::std::boxed::Box<crate::natural::LogFilterOptions>>,
15 }
16
17 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>
18 for LogListenSafeRequest
19 where
20 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21 ___E: ::fidl_next::Encoder,
22 ___E: ::fidl_next::fuchsia::HandleEncoder,
23 {
24 #[inline]
25 fn encode(
26 self,
27 encoder_: &mut ___E,
28 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenSafeRequest<'static>>,
29 _: (),
30 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31 ::fidl_next::munge! {
32 let crate::wire::LogListenSafeRequest {
33 log_listener,
34 options,
35
36 } = out_;
37 }
38
39 ::fidl_next::Encode::encode(self.log_listener, encoder_, log_listener, ())?;
40
41 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(log_listener.as_mut_ptr()) };
42
43 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
44
45 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(options.as_mut_ptr()) };
46
47 Ok(())
48 }
49 }
50
51 unsafe impl<___E>
52 ::fidl_next::EncodeOption<
53 ::fidl_next::wire::Box<'static, crate::wire::LogListenSafeRequest<'static>>,
54 ___E,
55 > for LogListenSafeRequest
56 where
57 ___E: ::fidl_next::Encoder + ?Sized,
58 LogListenSafeRequest: ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>,
59 {
60 #[inline]
61 fn encode_option(
62 this: ::core::option::Option<Self>,
63 encoder: &mut ___E,
64 out: &mut ::core::mem::MaybeUninit<
65 ::fidl_next::wire::Box<'static, crate::wire::LogListenSafeRequest<'static>>,
66 >,
67 _: (),
68 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
69 if let Some(inner) = this {
70 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
71 ::fidl_next::wire::Box::encode_present(out);
72 } else {
73 ::fidl_next::wire::Box::encode_absent(out);
74 }
75
76 Ok(())
77 }
78 }
79
80 impl<'de> ::fidl_next::FromWire<crate::wire::LogListenSafeRequest<'de>> for LogListenSafeRequest {
81 #[inline]
82 fn from_wire(wire: crate::wire::LogListenSafeRequest<'de>) -> Self {
83 Self {
84 log_listener: ::fidl_next::FromWire::from_wire(wire.log_listener),
85
86 options: ::fidl_next::FromWire::from_wire(wire.options),
87 }
88 }
89 }
90
91 #[derive(Debug, Default, PartialEq)]
92 pub struct LogSinkOnInitRequest {
93 pub buffer: ::core::option::Option<::fidl_next::fuchsia::zx::Iob>,
94
95 pub interest:
96 ::core::option::Option<::fidl_next_fuchsia_diagnostics_types::natural::Interest>,
97 }
98
99 impl LogSinkOnInitRequest {
100 fn __max_ordinal(&self) -> usize {
101 if self.interest.is_some() {
102 return 2;
103 }
104
105 if self.buffer.is_some() {
106 return 1;
107 }
108
109 0
110 }
111 }
112
113 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogSinkOnInitRequest<'static>, ___E>
114 for LogSinkOnInitRequest
115 where
116 ___E: ::fidl_next::Encoder + ?Sized,
117 ___E: ::fidl_next::fuchsia::HandleEncoder,
118 {
119 #[inline]
120 fn encode(
121 mut self,
122 encoder: &mut ___E,
123 out: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkOnInitRequest<'static>>,
124 _: (),
125 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
126 ::fidl_next::munge!(let crate::wire::LogSinkOnInitRequest { table } = out);
127
128 let max_ord = self.__max_ordinal();
129
130 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
131 ::fidl_next::Wire::zero_padding(&mut out);
132
133 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
134 ::fidl_next::wire::Envelope,
135 >(encoder, max_ord);
136
137 for i in 1..=max_ord {
138 match i {
139 2 => {
140 if let Some(value) = self.interest.take() {
141 ::fidl_next::wire::Envelope::encode_value::<
142 ::fidl_next_fuchsia_diagnostics_types::wire::Interest<'static>,
143 ___E,
144 >(
145 value, preallocated.encoder, &mut out, ()
146 )?;
147 } else {
148 ::fidl_next::wire::Envelope::encode_zero(&mut out)
149 }
150 }
151
152 1 => {
153 if let Some(value) = self.buffer.take() {
154 ::fidl_next::wire::Envelope::encode_value::<
155 ::fidl_next::wire::fuchsia::Iob,
156 ___E,
157 >(
158 value, preallocated.encoder, &mut out, ()
159 )?;
160 } else {
161 ::fidl_next::wire::Envelope::encode_zero(&mut out)
162 }
163 }
164
165 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
166 }
167 unsafe {
168 preallocated.write_next(out.assume_init_ref());
169 }
170 }
171
172 ::fidl_next::wire::Table::encode_len(table, max_ord);
173
174 Ok(())
175 }
176 }
177
178 impl<'de> ::fidl_next::FromWire<crate::wire::LogSinkOnInitRequest<'de>> for LogSinkOnInitRequest {
179 #[inline]
180 fn from_wire(wire_: crate::wire::LogSinkOnInitRequest<'de>) -> Self {
181 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
182
183 let buffer = wire_.table.get(1);
184
185 let interest = wire_.table.get(2);
186
187 Self {
188
189
190 buffer: buffer.map(|envelope| ::fidl_next::FromWire::from_wire(
191 unsafe { envelope.read_unchecked::<::fidl_next::wire::fuchsia::Iob>() }
192 )),
193
194
195 interest: interest.map(|envelope| ::fidl_next::FromWire::from_wire(
196 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>() }
197 )),
198
199 }
200 }
201 }
202
203 #[derive(Debug, PartialEq)]
204 #[repr(C)]
205 pub struct LogSinkConnectStructuredRequest {
206 pub socket: ::fidl_next::fuchsia::zx::Socket,
207 }
208
209 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>
210 for LogSinkConnectStructuredRequest
211 where
212 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
213 ___E: ::fidl_next::fuchsia::HandleEncoder,
214 {
215 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
216 Self,
217 crate::wire::LogSinkConnectStructuredRequest,
218 > = unsafe {
219 ::fidl_next::CopyOptimization::enable_if(
220 true && <::fidl_next::fuchsia::zx::Socket as ::fidl_next::Encode<
221 ::fidl_next::wire::fuchsia::Socket,
222 ___E,
223 >>::COPY_OPTIMIZATION
224 .is_enabled(),
225 )
226 };
227
228 #[inline]
229 fn encode(
230 self,
231 encoder_: &mut ___E,
232 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkConnectStructuredRequest>,
233 _: (),
234 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
235 ::fidl_next::munge! {
236 let crate::wire::LogSinkConnectStructuredRequest {
237 socket,
238
239 } = out_;
240 }
241
242 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
243
244 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(socket.as_mut_ptr()) };
245
246 Ok(())
247 }
248 }
249
250 unsafe impl<___E>
251 ::fidl_next::EncodeOption<
252 ::fidl_next::wire::Box<'static, crate::wire::LogSinkConnectStructuredRequest>,
253 ___E,
254 > for LogSinkConnectStructuredRequest
255 where
256 ___E: ::fidl_next::Encoder + ?Sized,
257 LogSinkConnectStructuredRequest:
258 ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>,
259 {
260 #[inline]
261 fn encode_option(
262 this: ::core::option::Option<Self>,
263 encoder: &mut ___E,
264 out: &mut ::core::mem::MaybeUninit<
265 ::fidl_next::wire::Box<'static, crate::wire::LogSinkConnectStructuredRequest>,
266 >,
267 _: (),
268 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
269 if let Some(inner) = this {
270 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
271 ::fidl_next::wire::Box::encode_present(out);
272 } else {
273 ::fidl_next::wire::Box::encode_absent(out);
274 }
275
276 Ok(())
277 }
278 }
279
280 impl ::fidl_next::FromWire<crate::wire::LogSinkConnectStructuredRequest>
281 for LogSinkConnectStructuredRequest
282 {
283 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
284 crate::wire::LogSinkConnectStructuredRequest,
285 Self,
286 > = unsafe {
287 ::fidl_next::CopyOptimization::enable_if(
288 true && <::fidl_next::fuchsia::zx::Socket as ::fidl_next::FromWire<
289 ::fidl_next::wire::fuchsia::Socket,
290 >>::COPY_OPTIMIZATION
291 .is_enabled(),
292 )
293 };
294
295 #[inline]
296 fn from_wire(wire: crate::wire::LogSinkConnectStructuredRequest) -> Self {
297 Self { socket: ::fidl_next::FromWire::from_wire(wire.socket) }
298 }
299 }
300}
301
302pub mod wire {
303
304 pub use fidl_next_common_fuchsia_logger::wire::*;
305
306 #[derive(Debug)]
308 #[repr(C)]
309 pub struct LogListenSafeRequest<'de> {
310 pub log_listener:
311 ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::wire::fuchsia::Channel>,
312
313 pub options: ::fidl_next::wire::Box<'de, crate::wire::LogFilterOptions<'de>>,
314 }
315
316 static_assertions::const_assert_eq!(std::mem::size_of::<LogListenSafeRequest<'_>>(), 16);
317 static_assertions::const_assert_eq!(std::mem::align_of::<LogListenSafeRequest<'_>>(), 8);
318
319 static_assertions::const_assert_eq!(
320 std::mem::offset_of!(LogListenSafeRequest<'_>, log_listener),
321 0
322 );
323
324 static_assertions::const_assert_eq!(std::mem::offset_of!(LogListenSafeRequest<'_>, options), 8);
325
326 impl ::fidl_next::Constrained for LogListenSafeRequest<'_> {
327 type Constraint = ();
328
329 fn validate(
330 _: ::fidl_next::Slot<'_, Self>,
331 _: Self::Constraint,
332 ) -> Result<(), ::fidl_next::ValidationError> {
333 Ok(())
334 }
335 }
336
337 unsafe impl ::fidl_next::Wire for LogListenSafeRequest<'static> {
338 type Narrowed<'de> = LogListenSafeRequest<'de>;
339
340 #[inline]
341 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
342 ::fidl_next::munge! {
343 let Self {
344 log_listener,
345 options,
346
347 } = &mut *out_;
348 }
349
350 ::fidl_next::Wire::zero_padding(log_listener);
351
352 ::fidl_next::Wire::zero_padding(options);
353
354 unsafe {
355 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
356 }
357 }
358 }
359
360 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogListenSafeRequest<'de>
361 where
362 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
363 ___D: ::fidl_next::Decoder<'de>,
364 ___D: ::fidl_next::fuchsia::HandleDecoder,
365 {
366 fn decode(
367 slot_: ::fidl_next::Slot<'_, Self>,
368 decoder_: &mut ___D,
369 _: (),
370 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
371 if slot_.as_bytes()[4..8] != [0u8; 4] {
372 return Err(::fidl_next::DecodeError::InvalidPadding);
373 }
374
375 ::fidl_next::munge! {
376 let Self {
377 mut log_listener,
378 mut options,
379
380 } = slot_;
381 }
382
383 let _field = log_listener.as_mut();
384
385 ::fidl_next::Decode::decode(log_listener.as_mut(), decoder_, ())?;
386
387 let _field = options.as_mut();
388
389 ::fidl_next::Decode::decode(options.as_mut(), decoder_, ())?;
390
391 Ok(())
392 }
393 }
394
395 impl<'de> ::fidl_next::IntoNatural for LogListenSafeRequest<'de> {
396 type Natural = crate::natural::LogListenSafeRequest;
397 }
398
399 #[repr(C)]
401 pub struct LogSinkOnInitRequest<'de> {
402 pub(crate) table: ::fidl_next::wire::Table<'de>,
403 }
404
405 impl<'de> Drop for LogSinkOnInitRequest<'de> {
406 fn drop(&mut self) {
407 let _ = self.table.get(1).map(|envelope| unsafe {
408 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Iob>()
409 });
410
411 let _ = self.table.get(2)
412 .map(|envelope| unsafe {
413 envelope.read_unchecked::<::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>()
414 });
415 }
416 }
417
418 impl ::fidl_next::Constrained for LogSinkOnInitRequest<'_> {
419 type Constraint = ();
420
421 fn validate(
422 _: ::fidl_next::Slot<'_, Self>,
423 _: Self::Constraint,
424 ) -> Result<(), ::fidl_next::ValidationError> {
425 Ok(())
426 }
427 }
428
429 unsafe impl ::fidl_next::Wire for LogSinkOnInitRequest<'static> {
430 type Narrowed<'de> = LogSinkOnInitRequest<'de>;
431
432 #[inline]
433 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
434 ::fidl_next::munge!(let Self { table } = out);
435 ::fidl_next::wire::Table::zero_padding(table);
436 }
437 }
438
439 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LogSinkOnInitRequest<'de>
440 where
441 ___D: ::fidl_next::Decoder<'de> + ?Sized,
442 ___D: ::fidl_next::fuchsia::HandleDecoder,
443 {
444 fn decode(
445 slot: ::fidl_next::Slot<'_, Self>,
446 decoder: &mut ___D,
447 _: (),
448 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
449 ::fidl_next::munge!(let Self { table } = slot);
450
451 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
452 match ordinal {
453 0 => unsafe { ::core::hint::unreachable_unchecked() },
454
455 1 => {
456 ::fidl_next::wire::Envelope::decode_as::<
457 ___D,
458 ::fidl_next::wire::fuchsia::Iob,
459 >(slot.as_mut(), decoder, ())?;
460
461 Ok(())
462 }
463
464 2 => {
465 ::fidl_next::wire::Envelope::decode_as::<
466 ___D,
467 ::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>,
468 >(slot.as_mut(), decoder, ())?;
469
470 Ok(())
471 }
472
473 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
474 }
475 })
476 }
477 }
478
479 impl<'de> LogSinkOnInitRequest<'de> {
480 pub fn buffer(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Iob> {
481 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
482 }
483
484 pub fn interest(
485 &self,
486 ) -> ::core::option::Option<&::fidl_next_fuchsia_diagnostics_types::wire::Interest<'de>>
487 {
488 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
489 }
490 }
491
492 impl<'de> ::core::fmt::Debug for LogSinkOnInitRequest<'de> {
493 fn fmt(
494 &self,
495 f: &mut ::core::fmt::Formatter<'_>,
496 ) -> ::core::result::Result<(), ::core::fmt::Error> {
497 f.debug_struct("LogSinkOnInitRequest")
498 .field("buffer", &self.buffer())
499 .field("interest", &self.interest())
500 .finish()
501 }
502 }
503
504 impl<'de> ::fidl_next::IntoNatural for LogSinkOnInitRequest<'de> {
505 type Natural = crate::natural::LogSinkOnInitRequest;
506 }
507
508 #[derive(Debug)]
510 #[repr(C)]
511 pub struct LogSinkConnectStructuredRequest {
512 pub socket: ::fidl_next::wire::fuchsia::Socket,
513 }
514
515 static_assertions::const_assert_eq!(std::mem::size_of::<LogSinkConnectStructuredRequest>(), 4);
516 static_assertions::const_assert_eq!(std::mem::align_of::<LogSinkConnectStructuredRequest>(), 4);
517
518 static_assertions::const_assert_eq!(
519 std::mem::offset_of!(LogSinkConnectStructuredRequest, socket),
520 0
521 );
522
523 impl ::fidl_next::Constrained for LogSinkConnectStructuredRequest {
524 type Constraint = ();
525
526 fn validate(
527 _: ::fidl_next::Slot<'_, Self>,
528 _: Self::Constraint,
529 ) -> Result<(), ::fidl_next::ValidationError> {
530 Ok(())
531 }
532 }
533
534 unsafe impl ::fidl_next::Wire for LogSinkConnectStructuredRequest {
535 type Narrowed<'de> = LogSinkConnectStructuredRequest;
536
537 #[inline]
538 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
539 ::fidl_next::munge! {
540 let Self {
541 socket,
542
543 } = &mut *out_;
544 }
545
546 ::fidl_next::Wire::zero_padding(socket);
547 }
548 }
549
550 unsafe impl<___D> ::fidl_next::Decode<___D> for LogSinkConnectStructuredRequest
551 where
552 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
553 ___D: ::fidl_next::fuchsia::HandleDecoder,
554 {
555 fn decode(
556 slot_: ::fidl_next::Slot<'_, Self>,
557 decoder_: &mut ___D,
558 _: (),
559 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
560 ::fidl_next::munge! {
561 let Self {
562 mut socket,
563
564 } = slot_;
565 }
566
567 let _field = socket.as_mut();
568
569 ::fidl_next::Decode::decode(socket.as_mut(), decoder_, ())?;
570
571 Ok(())
572 }
573 }
574
575 impl ::fidl_next::IntoNatural for LogSinkConnectStructuredRequest {
576 type Natural = crate::natural::LogSinkConnectStructuredRequest;
577 }
578}
579
580pub mod wire_optional {
581
582 pub use fidl_next_common_fuchsia_logger::wire_optional::*;
583}
584
585pub mod generic {
586
587 pub use fidl_next_common_fuchsia_logger::generic::*;
588
589 pub struct LogListenSafeRequest<T0, T1> {
591 pub log_listener: T0,
592
593 pub options: T1,
594 }
595
596 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::LogListenSafeRequest<'static>, ___E>
597 for LogListenSafeRequest<T0, T1>
598 where
599 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
600 ___E: ::fidl_next::Encoder,
601 ___E: ::fidl_next::fuchsia::HandleEncoder,
602 T0: ::fidl_next::Encode<
603 ::fidl_next::ClientEnd<crate::LogListenerSafe, ::fidl_next::wire::fuchsia::Channel>,
604 ___E,
605 >,
606 T1: ::fidl_next::Encode<
607 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
608 ___E,
609 >,
610 {
611 #[inline]
612 fn encode(
613 self,
614 encoder_: &mut ___E,
615 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogListenSafeRequest<'static>>,
616 _: (),
617 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
618 ::fidl_next::munge! {
619 let crate::wire::LogListenSafeRequest {
620 log_listener,
621 options,
622
623 } = out_;
624 }
625
626 ::fidl_next::Encode::encode(self.log_listener, encoder_, log_listener, ())?;
627
628 ::fidl_next::Encode::encode(self.options, encoder_, options, ())?;
629
630 Ok(())
631 }
632 }
633
634 pub struct LogSinkConnectStructuredRequest<T0> {
636 pub socket: T0,
637 }
638
639 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::LogSinkConnectStructuredRequest, ___E>
640 for LogSinkConnectStructuredRequest<T0>
641 where
642 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
643 ___E: ::fidl_next::fuchsia::HandleEncoder,
644 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Socket, ___E>,
645 {
646 #[inline]
647 fn encode(
648 self,
649 encoder_: &mut ___E,
650 out_: &mut ::core::mem::MaybeUninit<crate::wire::LogSinkConnectStructuredRequest>,
651 _: (),
652 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
653 ::fidl_next::munge! {
654 let crate::wire::LogSinkConnectStructuredRequest {
655 socket,
656
657 } = out_;
658 }
659
660 ::fidl_next::Encode::encode(self.socket, encoder_, socket, ())?;
661
662 Ok(())
663 }
664 }
665}
666
667pub use self::natural::*;
668
669#[doc = " Interface for LogListenerSafe to register to listen to logs.\n"]
671#[derive(PartialEq, Debug)]
672pub struct Log;
673
674impl ::fidl_next::Discoverable for Log {
675 const PROTOCOL_NAME: &'static str = "fuchsia.logger.Log";
676}
677
678#[cfg(target_os = "fuchsia")]
679impl ::fidl_next::HasTransport for Log {
680 type Transport = ::fidl_next::fuchsia::zx::Channel;
681}
682
683pub mod log {
684 pub mod prelude {
685 pub use crate::{
686 Log, LogClientHandler, LogLocalClientHandler, LogLocalServerHandler, LogServerHandler,
687 log,
688 };
689
690 pub use crate::natural::LogListenSafeRequest;
691 }
692
693 pub struct ListenSafe;
694
695 impl ::fidl_next::Method for ListenSafe {
696 const ORDINAL: u64 = 5643638173917143473;
697 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
698 ::fidl_next::protocol::Flexibility::Strict;
699
700 type Protocol = crate::Log;
701
702 type Request = crate::wire::LogListenSafeRequest<'static>;
703 }
704
705 mod ___detail {
706 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Log
707 where
708 ___T: ::fidl_next::Transport,
709 {
710 type Client = LogClient<___T>;
711 type Server = LogServer<___T>;
712 }
713
714 #[repr(transparent)]
716 pub struct LogClient<___T: ::fidl_next::Transport> {
717 #[allow(dead_code)]
718 client: ::fidl_next::protocol::Client<___T>,
719 }
720
721 impl<___T> LogClient<___T>
722 where
723 ___T: ::fidl_next::Transport,
724 {
725 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
726 pub fn listen_safe(
727 &self,
728
729 log_listener: impl ::fidl_next::Encode<
730 ::fidl_next::ClientEnd<
731 crate::LogListenerSafe,
732 ::fidl_next::wire::fuchsia::Channel,
733 >,
734 <___T as ::fidl_next::Transport>::SendBuffer,
735 >,
736
737 options: impl ::fidl_next::Encode<
738 ::fidl_next::wire::Box<'static, crate::wire::LogFilterOptions<'static>>,
739 <___T as ::fidl_next::Transport>::SendBuffer,
740 >,
741 ) -> ::fidl_next::SendFuture<'_, ___T>
742 where
743 <___T as ::fidl_next::Transport>::SendBuffer:
744 ::fidl_next::encoder::InternalHandleEncoder,
745 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
746 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
747 {
748 self.listen_safe_with(crate::generic::LogListenSafeRequest {
749 log_listener,
750
751 options,
752 })
753 }
754
755 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
756 pub fn listen_safe_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
757 where
758 ___R: ::fidl_next::Encode<
759 crate::wire::LogListenSafeRequest<'static>,
760 <___T as ::fidl_next::Transport>::SendBuffer,
761 >,
762 {
763 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
764 5643638173917143473,
765 <super::ListenSafe as ::fidl_next::Method>::FLEXIBILITY,
766 request,
767 ))
768 }
769 }
770
771 #[repr(transparent)]
773 pub struct LogServer<___T: ::fidl_next::Transport> {
774 server: ::fidl_next::protocol::Server<___T>,
775 }
776
777 impl<___T> LogServer<___T> where ___T: ::fidl_next::Transport {}
778 }
779}
780
781#[diagnostic::on_unimplemented(
782 note = "If {Self} implements the non-local LogClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
783)]
784
785pub trait LogLocalClientHandler<
789 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
790 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
791>
792{
793}
794
795impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Log
796where
797 ___H: LogLocalClientHandler<___T>,
798 ___T: ::fidl_next::Transport,
799{
800 async fn on_event(
801 handler: &mut ___H,
802 mut message: ::fidl_next::Message<___T>,
803 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
804 match *message.header().ordinal {
805 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
806 }
807 }
808}
809
810#[diagnostic::on_unimplemented(
811 note = "If {Self} implements the non-local LogServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
812)]
813
814pub trait LogLocalServerHandler<
818 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
819 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
820>
821{
822 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
823 fn listen_safe(
824 &mut self,
825
826 request: ::fidl_next::Request<log::ListenSafe, ___T>,
827 ) -> impl ::core::future::Future<Output = ()>;
828}
829
830impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Log
831where
832 ___H: LogLocalServerHandler<___T>,
833 ___T: ::fidl_next::Transport,
834 for<'de> crate::wire::LogListenSafeRequest<'de>: ::fidl_next::Decode<
835 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
836 Constraint = (),
837 >,
838{
839 async fn on_one_way(
840 handler: &mut ___H,
841 mut message: ::fidl_next::Message<___T>,
842 ) -> ::core::result::Result<
843 (),
844 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
845 > {
846 match *message.header().ordinal {
847 5643638173917143473 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
848 Ok(decoded) => {
849 handler.listen_safe(::fidl_next::Request::from_decoded(decoded)).await;
850 Ok(())
851 }
852 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
853 ordinal: 5643638173917143473,
854 error,
855 }),
856 },
857
858 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
859 }
860 }
861
862 async fn on_two_way(
863 handler: &mut ___H,
864 mut message: ::fidl_next::Message<___T>,
865 responder: ::fidl_next::protocol::Responder<___T>,
866 ) -> ::core::result::Result<
867 (),
868 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
869 > {
870 match *message.header().ordinal {
871 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
872 }
873 }
874}
875
876pub trait LogClientHandler<
880 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
881 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
882>
883{
884}
885
886impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Log
887where
888 ___H: LogClientHandler<___T> + ::core::marker::Send,
889 ___T: ::fidl_next::Transport,
890{
891 async fn on_event(
892 handler: &mut ___H,
893 mut message: ::fidl_next::Message<___T>,
894 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
895 match *message.header().ordinal {
896 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
897 }
898 }
899}
900
901pub trait LogServerHandler<
905 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
906 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
907>
908{
909 #[doc = " Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log\n message.\n A null `options` indicates no filtering is requested.\n"]
910 fn listen_safe(
911 &mut self,
912
913 request: ::fidl_next::Request<log::ListenSafe, ___T>,
914 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
915}
916
917impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Log
918where
919 ___H: LogServerHandler<___T> + ::core::marker::Send,
920 ___T: ::fidl_next::Transport,
921 for<'de> crate::wire::LogListenSafeRequest<'de>: ::fidl_next::Decode<
922 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
923 Constraint = (),
924 >,
925{
926 async fn on_one_way(
927 handler: &mut ___H,
928 mut message: ::fidl_next::Message<___T>,
929 ) -> ::core::result::Result<
930 (),
931 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
932 > {
933 match *message.header().ordinal {
934 5643638173917143473 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
935 Ok(decoded) => {
936 handler.listen_safe(::fidl_next::Request::from_decoded(decoded)).await;
937 Ok(())
938 }
939 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
940 ordinal: 5643638173917143473,
941 error,
942 }),
943 },
944
945 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
946 }
947 }
948
949 async fn on_two_way(
950 handler: &mut ___H,
951 mut message: ::fidl_next::Message<___T>,
952 responder: ::fidl_next::protocol::Responder<___T>,
953 ) -> ::core::result::Result<
954 (),
955 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
956 > {
957 match *message.header().ordinal {
958 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
959 }
960 }
961}
962
963impl<___T> LogClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
964
965impl<___H, ___T> LogLocalClientHandler<___T> for ::fidl_next::Local<___H>
966where
967 ___H: LogClientHandler<___T>,
968 ___T: ::fidl_next::Transport,
969{
970}
971
972impl<___H, ___T> LogLocalServerHandler<___T> for ::fidl_next::Local<___H>
973where
974 ___H: LogServerHandler<___T>,
975 ___T: ::fidl_next::Transport,
976{
977 async fn listen_safe(&mut self, request: ::fidl_next::Request<log::ListenSafe, ___T>) {
978 ___H::listen_safe(&mut self.0, request).await
979 }
980}
981
982#[doc = " Drains a program\'s logs.\n"]
984#[derive(PartialEq, Debug)]
985pub struct LogSink;
986
987impl ::fidl_next::Discoverable for LogSink {
988 const PROTOCOL_NAME: &'static str = "fuchsia.logger.LogSink";
989}
990
991#[cfg(target_os = "fuchsia")]
992impl ::fidl_next::HasTransport for LogSink {
993 type Transport = ::fidl_next::fuchsia::zx::Channel;
994}
995
996pub mod log_sink {
997 pub mod prelude {
998 pub use crate::{
999 LogSink, LogSinkClientHandler, LogSinkLocalClientHandler, LogSinkLocalServerHandler,
1000 LogSinkServerHandler, log_sink,
1001 };
1002
1003 pub use crate::natural::InterestChangeError;
1004
1005 pub use crate::natural::LogSinkConnectStructuredRequest;
1006
1007 pub use crate::natural::LogSinkOnInitRequest;
1008
1009 pub use crate::natural::LogSinkWaitForInterestChangeResponse;
1010 }
1011
1012 pub struct OnInit;
1013
1014 impl ::fidl_next::Method for OnInit {
1015 const ORDINAL: u64 = 7052827292487084730;
1016 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1017 ::fidl_next::protocol::Flexibility::Flexible;
1018
1019 type Protocol = crate::LogSink;
1020
1021 type Request = crate::wire::LogSinkOnInitRequest<'static>;
1022 }
1023
1024 pub struct WaitForInterestChange;
1025
1026 impl ::fidl_next::Method for WaitForInterestChange {
1027 const ORDINAL: u64 = 2138400952013124162;
1028 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1029 ::fidl_next::protocol::Flexibility::Strict;
1030
1031 type Protocol = crate::LogSink;
1032
1033 type Request = ::fidl_next::wire::EmptyMessageBody;
1034 }
1035
1036 impl ::fidl_next::TwoWayMethod for WaitForInterestChange {
1037 type Response = ::fidl_next::wire::Result<
1038 'static,
1039 crate::wire::LogSinkWaitForInterestChangeResponse<'static>,
1040 crate::wire::InterestChangeError,
1041 >;
1042 }
1043
1044 impl<___R> ::fidl_next::Respond<___R> for WaitForInterestChange {
1045 type Output = ::core::result::Result<
1046 crate::generic::LogSinkWaitForInterestChangeResponse<___R>,
1047 ::fidl_next::util::Never,
1048 >;
1049
1050 fn respond(response: ___R) -> Self::Output {
1051 ::core::result::Result::Ok(crate::generic::LogSinkWaitForInterestChangeResponse {
1052 data: response,
1053 })
1054 }
1055 }
1056
1057 impl<___R> ::fidl_next::RespondErr<___R> for WaitForInterestChange {
1058 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1059
1060 fn respond_err(response: ___R) -> Self::Output {
1061 ::core::result::Result::Err(response)
1062 }
1063 }
1064
1065 pub struct ConnectStructured;
1066
1067 impl ::fidl_next::Method for ConnectStructured {
1068 const ORDINAL: u64 = 7157386067685058380;
1069 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1070 ::fidl_next::protocol::Flexibility::Strict;
1071
1072 type Protocol = crate::LogSink;
1073
1074 type Request = crate::wire::LogSinkConnectStructuredRequest;
1075 }
1076
1077 mod ___detail {
1078 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::LogSink
1079 where
1080 ___T: ::fidl_next::Transport,
1081 {
1082 type Client = LogSinkClient<___T>;
1083 type Server = LogSinkServer<___T>;
1084 }
1085
1086 #[repr(transparent)]
1088 pub struct LogSinkClient<___T: ::fidl_next::Transport> {
1089 #[allow(dead_code)]
1090 client: ::fidl_next::protocol::Client<___T>,
1091 }
1092
1093 impl<___T> LogSinkClient<___T>
1094 where
1095 ___T: ::fidl_next::Transport,
1096 {
1097 #[doc = " LogSink implementers will return to this hanging-get whenever the scope of\n their interest changes. Clients are expected to emit messages based on\n the registered Interest. In the event that an empty interest is\n conveyed, clients should emit messages based on their default\n e.g. compile time configuration. Each client may only poll this once at a time.\n Invoking WaitForInterestChange a second time before the first call returns will\n result in an error being returned.\n"]
1098 pub fn wait_for_interest_change(
1099 &self,
1100 ) -> ::fidl_next::TwoWayFuture<'_, super::WaitForInterestChange, ___T> {
1101 ::fidl_next::TwoWayFuture::from_untyped(
1102 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1103 2138400952013124162,
1104 <super::WaitForInterestChange as ::fidl_next::Method>::FLEXIBILITY,
1105 (),
1106 ),
1107 )
1108 }
1109
1110 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1111 pub fn connect_structured(
1112 &self,
1113
1114 socket: impl ::fidl_next::Encode<
1115 ::fidl_next::wire::fuchsia::Socket,
1116 <___T as ::fidl_next::Transport>::SendBuffer,
1117 >,
1118 ) -> ::fidl_next::SendFuture<'_, ___T>
1119 where
1120 <___T as ::fidl_next::Transport>::SendBuffer:
1121 ::fidl_next::encoder::InternalHandleEncoder,
1122 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1123 {
1124 self.connect_structured_with(crate::generic::LogSinkConnectStructuredRequest {
1125 socket,
1126 })
1127 }
1128
1129 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1130 pub fn connect_structured_with<___R>(
1131 &self,
1132 request: ___R,
1133 ) -> ::fidl_next::SendFuture<'_, ___T>
1134 where
1135 ___R: ::fidl_next::Encode<
1136 crate::wire::LogSinkConnectStructuredRequest,
1137 <___T as ::fidl_next::Transport>::SendBuffer,
1138 >,
1139 {
1140 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1141 7157386067685058380,
1142 <super::ConnectStructured as ::fidl_next::Method>::FLEXIBILITY,
1143 request,
1144 ))
1145 }
1146 }
1147
1148 #[repr(transparent)]
1150 pub struct LogSinkServer<___T: ::fidl_next::Transport> {
1151 server: ::fidl_next::protocol::Server<___T>,
1152 }
1153
1154 impl<___T> LogSinkServer<___T>
1155 where
1156 ___T: ::fidl_next::Transport,
1157 {
1158 #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1159
1160 pub fn on_init_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1161 where
1162 ___R: ::fidl_next::Encode<
1163 <super::OnInit as ::fidl_next::Method>::Request,
1164 <___T as ::fidl_next::Transport>::SendBuffer,
1165 >,
1166 {
1167 ::fidl_next::SendFuture::from_untyped(self.server.send_event(
1168 7052827292487084730,
1169 <super::OnInit as ::fidl_next::Method>::FLEXIBILITY,
1170 request,
1171 ))
1172 }
1173 }
1174 }
1175}
1176
1177#[diagnostic::on_unimplemented(
1178 note = "If {Self} implements the non-local LogSinkClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1179)]
1180
1181pub trait LogSinkLocalClientHandler<
1185 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1186 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1187>
1188{
1189 #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1190 fn on_init(
1191 &mut self,
1192
1193 request: ::fidl_next::Request<log_sink::OnInit, ___T>,
1194 ) -> impl ::core::future::Future<Output = ()>;
1195
1196 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1197 ::core::future::ready(())
1198 }
1199}
1200
1201impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for LogSink
1202where
1203 ___H: LogSinkLocalClientHandler<___T>,
1204 ___T: ::fidl_next::Transport,
1205 for<'de> crate::wire::LogSinkOnInitRequest<'de>: ::fidl_next::Decode<
1206 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1207 Constraint = (),
1208 >,
1209{
1210 async fn on_event(
1211 handler: &mut ___H,
1212 mut message: ::fidl_next::Message<___T>,
1213 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1214 match *message.header().ordinal {
1215 7052827292487084730 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1216 Ok(decoded) => {
1217 handler.on_init(::fidl_next::Request::from_decoded(decoded)).await;
1218 Ok(())
1219 }
1220 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1221 ordinal: 7052827292487084730,
1222 error,
1223 }),
1224 },
1225
1226 ordinal => {
1227 handler.on_unknown_interaction(ordinal).await;
1228 if ::core::matches!(
1229 message.header().flexibility(),
1230 ::fidl_next::protocol::Flexibility::Strict
1231 ) {
1232 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1233 } else {
1234 Ok(())
1235 }
1236 }
1237 }
1238 }
1239}
1240
1241#[diagnostic::on_unimplemented(
1242 note = "If {Self} implements the non-local LogSinkServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1243)]
1244
1245pub trait LogSinkLocalServerHandler<
1249 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1250 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1251>
1252{
1253 #[doc = " LogSink implementers will return to this hanging-get whenever the scope of\n their interest changes. Clients are expected to emit messages based on\n the registered Interest. In the event that an empty interest is\n conveyed, clients should emit messages based on their default\n e.g. compile time configuration. Each client may only poll this once at a time.\n Invoking WaitForInterestChange a second time before the first call returns will\n result in an error being returned.\n"]
1254 fn wait_for_interest_change(
1255 &mut self,
1256
1257 responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1258 ) -> impl ::core::future::Future<Output = ()>;
1259
1260 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1261 fn connect_structured(
1262 &mut self,
1263
1264 request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1265 ) -> impl ::core::future::Future<Output = ()>;
1266
1267 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1268 ::core::future::ready(())
1269 }
1270}
1271
1272impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for LogSink
1273where
1274 ___H: LogSinkLocalServerHandler<___T>,
1275 ___T: ::fidl_next::Transport,
1276 for<'de> crate::wire::LogSinkConnectStructuredRequest: ::fidl_next::Decode<
1277 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1278 Constraint = (),
1279 >,
1280{
1281 async fn on_one_way(
1282 handler: &mut ___H,
1283 mut message: ::fidl_next::Message<___T>,
1284 ) -> ::core::result::Result<
1285 (),
1286 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1287 > {
1288 match *message.header().ordinal {
1289 7157386067685058380 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1290 Ok(decoded) => {
1291 handler.connect_structured(::fidl_next::Request::from_decoded(decoded)).await;
1292 Ok(())
1293 }
1294 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1295 ordinal: 7157386067685058380,
1296 error,
1297 }),
1298 },
1299
1300 ordinal => {
1301 handler.on_unknown_interaction(ordinal).await;
1302 if ::core::matches!(
1303 message.header().flexibility(),
1304 ::fidl_next::protocol::Flexibility::Strict
1305 ) {
1306 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1307 } else {
1308 Ok(())
1309 }
1310 }
1311 }
1312 }
1313
1314 async fn on_two_way(
1315 handler: &mut ___H,
1316 mut message: ::fidl_next::Message<___T>,
1317 responder: ::fidl_next::protocol::Responder<___T>,
1318 ) -> ::core::result::Result<
1319 (),
1320 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1321 > {
1322 match *message.header().ordinal {
1323 2138400952013124162 => {
1324 let responder = ::fidl_next::Responder::from_untyped(responder);
1325
1326 handler.wait_for_interest_change(responder).await;
1327 Ok(())
1328 }
1329
1330 ordinal => {
1331 handler.on_unknown_interaction(ordinal).await;
1332 if ::core::matches!(
1333 message.header().flexibility(),
1334 ::fidl_next::protocol::Flexibility::Strict
1335 ) {
1336 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1337 } else {
1338 responder
1339 .respond_framework_error(
1340 ordinal,
1341 ::fidl_next::FrameworkError::UnknownMethod,
1342 )
1343 .expect("encoding a framework error should never fail")
1344 .await?;
1345 Ok(())
1346 }
1347 }
1348 }
1349 }
1350}
1351
1352pub trait LogSinkClientHandler<
1356 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1357 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1358>
1359{
1360 #[doc = " This event is sent whenever Archivist accepts a new connection. Clients may use\n the returned IOBuffer to write logs.\n"]
1361 fn on_init(
1362 &mut self,
1363
1364 request: ::fidl_next::Request<log_sink::OnInit, ___T>,
1365 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1366
1367 fn on_unknown_interaction(
1368 &mut self,
1369 ordinal: u64,
1370 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1371 ::core::future::ready(())
1372 }
1373}
1374
1375impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for LogSink
1376where
1377 ___H: LogSinkClientHandler<___T> + ::core::marker::Send,
1378 ___T: ::fidl_next::Transport,
1379 for<'de> crate::wire::LogSinkOnInitRequest<'de>: ::fidl_next::Decode<
1380 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1381 Constraint = (),
1382 >,
1383{
1384 async fn on_event(
1385 handler: &mut ___H,
1386 mut message: ::fidl_next::Message<___T>,
1387 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1388 match *message.header().ordinal {
1389 7052827292487084730 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1390 Ok(decoded) => {
1391 handler.on_init(::fidl_next::Request::from_decoded(decoded)).await;
1392 Ok(())
1393 }
1394 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1395 ordinal: 7052827292487084730,
1396 error,
1397 }),
1398 },
1399
1400 ordinal => {
1401 handler.on_unknown_interaction(ordinal).await;
1402 if ::core::matches!(
1403 message.header().flexibility(),
1404 ::fidl_next::protocol::Flexibility::Strict
1405 ) {
1406 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1407 } else {
1408 Ok(())
1409 }
1410 }
1411 }
1412 }
1413}
1414
1415pub trait LogSinkServerHandler<
1419 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1420 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1421>
1422{
1423 #[doc = " LogSink implementers will return to this hanging-get whenever the scope of\n their interest changes. Clients are expected to emit messages based on\n the registered Interest. In the event that an empty interest is\n conveyed, clients should emit messages based on their default\n e.g. compile time configuration. Each client may only poll this once at a time.\n Invoking WaitForInterestChange a second time before the first call returns will\n result in an error being returned.\n"]
1424 fn wait_for_interest_change(
1425 &mut self,
1426
1427 responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1428 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1429
1430 #[doc = " Send this socket to be drained, using the structured logs format.\n\n See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding)\n for what is expected to be received over the socket.\n"]
1431 fn connect_structured(
1432 &mut self,
1433
1434 request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1435 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1436
1437 fn on_unknown_interaction(
1438 &mut self,
1439 ordinal: u64,
1440 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1441 ::core::future::ready(())
1442 }
1443}
1444
1445impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for LogSink
1446where
1447 ___H: LogSinkServerHandler<___T> + ::core::marker::Send,
1448 ___T: ::fidl_next::Transport,
1449 for<'de> crate::wire::LogSinkConnectStructuredRequest: ::fidl_next::Decode<
1450 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1451 Constraint = (),
1452 >,
1453{
1454 async fn on_one_way(
1455 handler: &mut ___H,
1456 mut message: ::fidl_next::Message<___T>,
1457 ) -> ::core::result::Result<
1458 (),
1459 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1460 > {
1461 match *message.header().ordinal {
1462 7157386067685058380 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1463 Ok(decoded) => {
1464 handler.connect_structured(::fidl_next::Request::from_decoded(decoded)).await;
1465 Ok(())
1466 }
1467 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1468 ordinal: 7157386067685058380,
1469 error,
1470 }),
1471 },
1472
1473 ordinal => {
1474 handler.on_unknown_interaction(ordinal).await;
1475 if ::core::matches!(
1476 message.header().flexibility(),
1477 ::fidl_next::protocol::Flexibility::Strict
1478 ) {
1479 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1480 } else {
1481 Ok(())
1482 }
1483 }
1484 }
1485 }
1486
1487 async fn on_two_way(
1488 handler: &mut ___H,
1489 mut message: ::fidl_next::Message<___T>,
1490 responder: ::fidl_next::protocol::Responder<___T>,
1491 ) -> ::core::result::Result<
1492 (),
1493 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1494 > {
1495 match *message.header().ordinal {
1496 2138400952013124162 => {
1497 let responder = ::fidl_next::Responder::from_untyped(responder);
1498
1499 handler.wait_for_interest_change(responder).await;
1500 Ok(())
1501 }
1502
1503 ordinal => {
1504 handler.on_unknown_interaction(ordinal).await;
1505 if ::core::matches!(
1506 message.header().flexibility(),
1507 ::fidl_next::protocol::Flexibility::Strict
1508 ) {
1509 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1510 } else {
1511 responder
1512 .respond_framework_error(
1513 ordinal,
1514 ::fidl_next::FrameworkError::UnknownMethod,
1515 )
1516 .expect("encoding a framework error should never fail")
1517 .await?;
1518 Ok(())
1519 }
1520 }
1521 }
1522 }
1523}
1524
1525impl<___T> LogSinkClientHandler<___T> for ::fidl_next::IgnoreEvents
1526where
1527 ___T: ::fidl_next::Transport,
1528{
1529 async fn on_init(&mut self, _: ::fidl_next::Request<log_sink::OnInit, ___T>) {}
1530
1531 async fn on_unknown_interaction(&mut self, _: u64) {}
1532}
1533
1534impl<___H, ___T> LogSinkLocalClientHandler<___T> for ::fidl_next::Local<___H>
1535where
1536 ___H: LogSinkClientHandler<___T>,
1537 ___T: ::fidl_next::Transport,
1538{
1539 async fn on_init(&mut self, request: ::fidl_next::Request<log_sink::OnInit, ___T>) {
1540 ___H::on_init(&mut self.0, request).await
1541 }
1542
1543 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1544 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1545 }
1546}
1547
1548impl<___H, ___T> LogSinkLocalServerHandler<___T> for ::fidl_next::Local<___H>
1549where
1550 ___H: LogSinkServerHandler<___T>,
1551 ___T: ::fidl_next::Transport,
1552{
1553 async fn wait_for_interest_change(
1554 &mut self,
1555
1556 responder: ::fidl_next::Responder<log_sink::WaitForInterestChange, ___T>,
1557 ) {
1558 ___H::wait_for_interest_change(&mut self.0, responder).await
1559 }
1560
1561 async fn connect_structured(
1562 &mut self,
1563
1564 request: ::fidl_next::Request<log_sink::ConnectStructured, ___T>,
1565 ) {
1566 ___H::connect_structured(&mut self.0, request).await
1567 }
1568
1569 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1570 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1571 }
1572}
1573
1574pub use fidl_next_common_fuchsia_logger::*;