1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const LOG_LEVEL_DEFAULT: LogLevelFilter = LogLevelFilter::Info;
13
14pub const LOG_SEVERITY_MAX_STEP: u8 = 6;
16
17pub const LOG_SEVERITY_STEP_SIZE: u8 = 16;
19
20pub const LOG_VERBOSITY_STEP_SIZE: u8 = 1;
22
23pub const MAX_DATAGRAM_LEN_BYTES: u32 = 32768;
25
26pub const MAX_LOG_MANY_SIZE_BYTES: u64 = 16384;
28
29pub const MAX_TAGS: u8 = 16;
31
32pub const MAX_TAGS_PER_LOG_MESSAGE: u8 = 5;
34
35pub const MAX_TAG_LEN_BYTES: u8 = 63;
37
38#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
39#[repr(u32)]
40pub enum InterestChangeError {
41 CalledTwice = 1,
44}
45
46impl InterestChangeError {
47 #[inline]
48 pub fn from_primitive(prim: u32) -> Option<Self> {
49 match prim {
50 1 => Some(Self::CalledTwice),
51 _ => None,
52 }
53 }
54
55 #[inline]
56 pub const fn into_primitive(self) -> u32 {
57 self as u32
58 }
59
60 #[deprecated = "Strict enums should not use `is_unknown`"]
61 #[inline]
62 pub fn is_unknown(&self) -> bool {
63 false
64 }
65}
66
67#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
73#[repr(i8)]
74pub enum LogLevelFilter {
75 Trace = 16,
76 Debug = 32,
77 Info = 48,
78 Warn = 64,
79 Error = 80,
80 Fatal = 96,
81 None = 127,
82}
83
84impl LogLevelFilter {
85 #[inline]
86 pub fn from_primitive(prim: i8) -> Option<Self> {
87 match prim {
88 16 => Some(Self::Trace),
89 32 => Some(Self::Debug),
90 48 => Some(Self::Info),
91 64 => Some(Self::Warn),
92 80 => Some(Self::Error),
93 96 => Some(Self::Fatal),
94 127 => Some(Self::None),
95 _ => None,
96 }
97 }
98
99 #[inline]
100 pub const fn into_primitive(self) -> i8 {
101 self as i8
102 }
103
104 #[deprecated = "Strict enums should not use `is_unknown`"]
105 #[inline]
106 pub fn is_unknown(&self) -> bool {
107 false
108 }
109}
110
111#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112pub struct LogFilterOptions {
113 pub filter_by_pid: bool,
114 pub pid: u64,
115 pub filter_by_tid: bool,
116 pub tid: u64,
117 pub verbosity: u8,
120 pub min_severity: LogLevelFilter,
122 pub tags: Vec<String>,
128}
129
130impl fidl::Persistable for LogFilterOptions {}
131
132#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
133pub struct LogListenerSafeLogManyRequest {
134 pub log: Vec<LogMessage>,
135}
136
137impl fidl::Persistable for LogListenerSafeLogManyRequest {}
138
139#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
140pub struct LogListenerSafeLogRequest {
141 pub log: LogMessage,
142}
143
144impl fidl::Persistable for LogListenerSafeLogRequest {}
145
146#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
147pub struct LogMessage {
148 pub pid: u64,
149 pub tid: u64,
150 pub time: fidl::BootInstant,
152 pub severity: i32,
153 pub dropped_logs: u32,
157 pub tags: Vec<String>,
158 pub msg: String,
159}
160
161impl fidl::Persistable for LogMessage {}
162
163#[derive(Clone, Debug, PartialEq)]
164pub struct LogSinkWaitForInterestChangeResponse {
165 pub data: fidl_fuchsia_diagnostics_types::Interest,
166}
167
168impl fidl::Persistable for LogSinkWaitForInterestChangeResponse {}
169
170mod internal {
171 use super::*;
172 unsafe impl fidl::encoding::TypeMarker for InterestChangeError {
173 type Owned = Self;
174
175 #[inline(always)]
176 fn inline_align(_context: fidl::encoding::Context) -> usize {
177 std::mem::align_of::<u32>()
178 }
179
180 #[inline(always)]
181 fn inline_size(_context: fidl::encoding::Context) -> usize {
182 std::mem::size_of::<u32>()
183 }
184
185 #[inline(always)]
186 fn encode_is_copy() -> bool {
187 true
188 }
189
190 #[inline(always)]
191 fn decode_is_copy() -> bool {
192 false
193 }
194 }
195
196 impl fidl::encoding::ValueTypeMarker for InterestChangeError {
197 type Borrowed<'a> = Self;
198 #[inline(always)]
199 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
200 *value
201 }
202 }
203
204 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
205 for InterestChangeError
206 {
207 #[inline]
208 unsafe fn encode(
209 self,
210 encoder: &mut fidl::encoding::Encoder<'_, D>,
211 offset: usize,
212 _depth: fidl::encoding::Depth,
213 ) -> fidl::Result<()> {
214 encoder.debug_check_bounds::<Self>(offset);
215 encoder.write_num(self.into_primitive(), offset);
216 Ok(())
217 }
218 }
219
220 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterestChangeError {
221 #[inline(always)]
222 fn new_empty() -> Self {
223 Self::CalledTwice
224 }
225
226 #[inline]
227 unsafe fn decode(
228 &mut self,
229 decoder: &mut fidl::encoding::Decoder<'_, D>,
230 offset: usize,
231 _depth: fidl::encoding::Depth,
232 ) -> fidl::Result<()> {
233 decoder.debug_check_bounds::<Self>(offset);
234 let prim = decoder.read_num::<u32>(offset);
235
236 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
237 Ok(())
238 }
239 }
240 unsafe impl fidl::encoding::TypeMarker for LogLevelFilter {
241 type Owned = Self;
242
243 #[inline(always)]
244 fn inline_align(_context: fidl::encoding::Context) -> usize {
245 std::mem::align_of::<i8>()
246 }
247
248 #[inline(always)]
249 fn inline_size(_context: fidl::encoding::Context) -> usize {
250 std::mem::size_of::<i8>()
251 }
252
253 #[inline(always)]
254 fn encode_is_copy() -> bool {
255 true
256 }
257
258 #[inline(always)]
259 fn decode_is_copy() -> bool {
260 false
261 }
262 }
263
264 impl fidl::encoding::ValueTypeMarker for LogLevelFilter {
265 type Borrowed<'a> = Self;
266 #[inline(always)]
267 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
268 *value
269 }
270 }
271
272 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LogLevelFilter {
273 #[inline]
274 unsafe fn encode(
275 self,
276 encoder: &mut fidl::encoding::Encoder<'_, D>,
277 offset: usize,
278 _depth: fidl::encoding::Depth,
279 ) -> fidl::Result<()> {
280 encoder.debug_check_bounds::<Self>(offset);
281 encoder.write_num(self.into_primitive(), offset);
282 Ok(())
283 }
284 }
285
286 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogLevelFilter {
287 #[inline(always)]
288 fn new_empty() -> Self {
289 Self::Trace
290 }
291
292 #[inline]
293 unsafe fn decode(
294 &mut self,
295 decoder: &mut fidl::encoding::Decoder<'_, D>,
296 offset: usize,
297 _depth: fidl::encoding::Depth,
298 ) -> fidl::Result<()> {
299 decoder.debug_check_bounds::<Self>(offset);
300 let prim = decoder.read_num::<i8>(offset);
301
302 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
303 Ok(())
304 }
305 }
306
307 impl fidl::encoding::ValueTypeMarker for LogFilterOptions {
308 type Borrowed<'a> = &'a Self;
309 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
310 value
311 }
312 }
313
314 unsafe impl fidl::encoding::TypeMarker for LogFilterOptions {
315 type Owned = Self;
316
317 #[inline(always)]
318 fn inline_align(_context: fidl::encoding::Context) -> usize {
319 8
320 }
321
322 #[inline(always)]
323 fn inline_size(_context: fidl::encoding::Context) -> usize {
324 56
325 }
326 }
327
328 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogFilterOptions, D>
329 for &LogFilterOptions
330 {
331 #[inline]
332 unsafe fn encode(
333 self,
334 encoder: &mut fidl::encoding::Encoder<'_, D>,
335 offset: usize,
336 _depth: fidl::encoding::Depth,
337 ) -> fidl::Result<()> {
338 encoder.debug_check_bounds::<LogFilterOptions>(offset);
339 fidl::encoding::Encode::<LogFilterOptions, D>::encode(
341 (
342 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_pid),
343 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
344 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_tid),
345 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
346 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.verbosity),
347 <LogLevelFilter as fidl::encoding::ValueTypeMarker>::borrow(&self.min_severity),
348 <fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
349 ),
350 encoder, offset, _depth
351 )
352 }
353 }
354 unsafe impl<
355 D: fidl::encoding::ResourceDialect,
356 T0: fidl::encoding::Encode<bool, D>,
357 T1: fidl::encoding::Encode<u64, D>,
358 T2: fidl::encoding::Encode<bool, D>,
359 T3: fidl::encoding::Encode<u64, D>,
360 T4: fidl::encoding::Encode<u8, D>,
361 T5: fidl::encoding::Encode<LogLevelFilter, D>,
362 T6: fidl::encoding::Encode<
363 fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
364 D,
365 >,
366 > fidl::encoding::Encode<LogFilterOptions, D> for (T0, T1, T2, T3, T4, T5, T6)
367 {
368 #[inline]
369 unsafe fn encode(
370 self,
371 encoder: &mut fidl::encoding::Encoder<'_, D>,
372 offset: usize,
373 depth: fidl::encoding::Depth,
374 ) -> fidl::Result<()> {
375 encoder.debug_check_bounds::<LogFilterOptions>(offset);
376 unsafe {
379 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
380 (ptr as *mut u64).write_unaligned(0);
381 }
382 unsafe {
383 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
384 (ptr as *mut u64).write_unaligned(0);
385 }
386 unsafe {
387 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
388 (ptr as *mut u64).write_unaligned(0);
389 }
390 self.0.encode(encoder, offset + 0, depth)?;
392 self.1.encode(encoder, offset + 8, depth)?;
393 self.2.encode(encoder, offset + 16, depth)?;
394 self.3.encode(encoder, offset + 24, depth)?;
395 self.4.encode(encoder, offset + 32, depth)?;
396 self.5.encode(encoder, offset + 33, depth)?;
397 self.6.encode(encoder, offset + 40, depth)?;
398 Ok(())
399 }
400 }
401
402 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogFilterOptions {
403 #[inline(always)]
404 fn new_empty() -> Self {
405 Self {
406 filter_by_pid: fidl::new_empty!(bool, D),
407 pid: fidl::new_empty!(u64, D),
408 filter_by_tid: fidl::new_empty!(bool, D),
409 tid: fidl::new_empty!(u64, D),
410 verbosity: fidl::new_empty!(u8, D),
411 min_severity: fidl::new_empty!(LogLevelFilter, D),
412 tags: fidl::new_empty!(
413 fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
414 D
415 ),
416 }
417 }
418
419 #[inline]
420 unsafe fn decode(
421 &mut self,
422 decoder: &mut fidl::encoding::Decoder<'_, D>,
423 offset: usize,
424 _depth: fidl::encoding::Depth,
425 ) -> fidl::Result<()> {
426 decoder.debug_check_bounds::<Self>(offset);
427 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
429 let padval = unsafe { (ptr as *const u64).read_unaligned() };
430 let mask = 0xffffffffffffff00u64;
431 let maskedval = padval & mask;
432 if maskedval != 0 {
433 return Err(fidl::Error::NonZeroPadding {
434 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
435 });
436 }
437 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
438 let padval = unsafe { (ptr as *const u64).read_unaligned() };
439 let mask = 0xffffffffffffff00u64;
440 let maskedval = padval & mask;
441 if maskedval != 0 {
442 return Err(fidl::Error::NonZeroPadding {
443 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
444 });
445 }
446 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
447 let padval = unsafe { (ptr as *const u64).read_unaligned() };
448 let mask = 0xffffffffffff0000u64;
449 let maskedval = padval & mask;
450 if maskedval != 0 {
451 return Err(fidl::Error::NonZeroPadding {
452 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
453 });
454 }
455 fidl::decode!(bool, D, &mut self.filter_by_pid, decoder, offset + 0, _depth)?;
456 fidl::decode!(u64, D, &mut self.pid, decoder, offset + 8, _depth)?;
457 fidl::decode!(bool, D, &mut self.filter_by_tid, decoder, offset + 16, _depth)?;
458 fidl::decode!(u64, D, &mut self.tid, decoder, offset + 24, _depth)?;
459 fidl::decode!(u8, D, &mut self.verbosity, decoder, offset + 32, _depth)?;
460 fidl::decode!(LogLevelFilter, D, &mut self.min_severity, decoder, offset + 33, _depth)?;
461 fidl::decode!(
462 fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
463 D,
464 &mut self.tags,
465 decoder,
466 offset + 40,
467 _depth
468 )?;
469 Ok(())
470 }
471 }
472
473 impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogManyRequest {
474 type Borrowed<'a> = &'a Self;
475 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
476 value
477 }
478 }
479
480 unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogManyRequest {
481 type Owned = Self;
482
483 #[inline(always)]
484 fn inline_align(_context: fidl::encoding::Context) -> usize {
485 8
486 }
487
488 #[inline(always)]
489 fn inline_size(_context: fidl::encoding::Context) -> usize {
490 16
491 }
492 }
493
494 unsafe impl<D: fidl::encoding::ResourceDialect>
495 fidl::encoding::Encode<LogListenerSafeLogManyRequest, D>
496 for &LogListenerSafeLogManyRequest
497 {
498 #[inline]
499 unsafe fn encode(
500 self,
501 encoder: &mut fidl::encoding::Encoder<'_, D>,
502 offset: usize,
503 _depth: fidl::encoding::Depth,
504 ) -> fidl::Result<()> {
505 encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
506 fidl::encoding::Encode::<LogListenerSafeLogManyRequest, D>::encode(
508 (
509 <fidl::encoding::UnboundedVector<LogMessage> as fidl::encoding::ValueTypeMarker>::borrow(&self.log),
510 ),
511 encoder, offset, _depth
512 )
513 }
514 }
515 unsafe impl<
516 D: fidl::encoding::ResourceDialect,
517 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LogMessage>, D>,
518 > fidl::encoding::Encode<LogListenerSafeLogManyRequest, D> for (T0,)
519 {
520 #[inline]
521 unsafe fn encode(
522 self,
523 encoder: &mut fidl::encoding::Encoder<'_, D>,
524 offset: usize,
525 depth: fidl::encoding::Depth,
526 ) -> fidl::Result<()> {
527 encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
528 self.0.encode(encoder, offset + 0, depth)?;
532 Ok(())
533 }
534 }
535
536 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
537 for LogListenerSafeLogManyRequest
538 {
539 #[inline(always)]
540 fn new_empty() -> Self {
541 Self { log: fidl::new_empty!(fidl::encoding::UnboundedVector<LogMessage>, D) }
542 }
543
544 #[inline]
545 unsafe fn decode(
546 &mut self,
547 decoder: &mut fidl::encoding::Decoder<'_, D>,
548 offset: usize,
549 _depth: fidl::encoding::Depth,
550 ) -> fidl::Result<()> {
551 decoder.debug_check_bounds::<Self>(offset);
552 fidl::decode!(
554 fidl::encoding::UnboundedVector<LogMessage>,
555 D,
556 &mut self.log,
557 decoder,
558 offset + 0,
559 _depth
560 )?;
561 Ok(())
562 }
563 }
564
565 impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogRequest {
566 type Borrowed<'a> = &'a Self;
567 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
568 value
569 }
570 }
571
572 unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogRequest {
573 type Owned = Self;
574
575 #[inline(always)]
576 fn inline_align(_context: fidl::encoding::Context) -> usize {
577 8
578 }
579
580 #[inline(always)]
581 fn inline_size(_context: fidl::encoding::Context) -> usize {
582 64
583 }
584 }
585
586 unsafe impl<D: fidl::encoding::ResourceDialect>
587 fidl::encoding::Encode<LogListenerSafeLogRequest, D> for &LogListenerSafeLogRequest
588 {
589 #[inline]
590 unsafe fn encode(
591 self,
592 encoder: &mut fidl::encoding::Encoder<'_, D>,
593 offset: usize,
594 _depth: fidl::encoding::Depth,
595 ) -> fidl::Result<()> {
596 encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
597 fidl::encoding::Encode::<LogListenerSafeLogRequest, D>::encode(
599 (<LogMessage as fidl::encoding::ValueTypeMarker>::borrow(&self.log),),
600 encoder,
601 offset,
602 _depth,
603 )
604 }
605 }
606 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LogMessage, D>>
607 fidl::encoding::Encode<LogListenerSafeLogRequest, D> for (T0,)
608 {
609 #[inline]
610 unsafe fn encode(
611 self,
612 encoder: &mut fidl::encoding::Encoder<'_, D>,
613 offset: usize,
614 depth: fidl::encoding::Depth,
615 ) -> fidl::Result<()> {
616 encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
617 self.0.encode(encoder, offset + 0, depth)?;
621 Ok(())
622 }
623 }
624
625 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
626 for LogListenerSafeLogRequest
627 {
628 #[inline(always)]
629 fn new_empty() -> Self {
630 Self { log: fidl::new_empty!(LogMessage, D) }
631 }
632
633 #[inline]
634 unsafe fn decode(
635 &mut self,
636 decoder: &mut fidl::encoding::Decoder<'_, D>,
637 offset: usize,
638 _depth: fidl::encoding::Depth,
639 ) -> fidl::Result<()> {
640 decoder.debug_check_bounds::<Self>(offset);
641 fidl::decode!(LogMessage, D, &mut self.log, decoder, offset + 0, _depth)?;
643 Ok(())
644 }
645 }
646
647 impl fidl::encoding::ValueTypeMarker for LogMessage {
648 type Borrowed<'a> = &'a Self;
649 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
650 value
651 }
652 }
653
654 unsafe impl fidl::encoding::TypeMarker for LogMessage {
655 type Owned = Self;
656
657 #[inline(always)]
658 fn inline_align(_context: fidl::encoding::Context) -> usize {
659 8
660 }
661
662 #[inline(always)]
663 fn inline_size(_context: fidl::encoding::Context) -> usize {
664 64
665 }
666 }
667
668 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogMessage, D>
669 for &LogMessage
670 {
671 #[inline]
672 unsafe fn encode(
673 self,
674 encoder: &mut fidl::encoding::Encoder<'_, D>,
675 offset: usize,
676 _depth: fidl::encoding::Depth,
677 ) -> fidl::Result<()> {
678 encoder.debug_check_bounds::<LogMessage>(offset);
679 fidl::encoding::Encode::<LogMessage, D>::encode(
681 (
682 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
683 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
684 <fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
685 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
686 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dropped_logs),
687 <fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
688 <fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(&self.msg),
689 ),
690 encoder, offset, _depth
691 )
692 }
693 }
694 unsafe impl<
695 D: fidl::encoding::ResourceDialect,
696 T0: fidl::encoding::Encode<u64, D>,
697 T1: fidl::encoding::Encode<u64, D>,
698 T2: fidl::encoding::Encode<fidl::BootInstant, D>,
699 T3: fidl::encoding::Encode<i32, D>,
700 T4: fidl::encoding::Encode<u32, D>,
701 T5: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>, D>,
702 T6: fidl::encoding::Encode<fidl::encoding::BoundedString<32768>, D>,
703 > fidl::encoding::Encode<LogMessage, D> for (T0, T1, T2, T3, T4, T5, T6)
704 {
705 #[inline]
706 unsafe fn encode(
707 self,
708 encoder: &mut fidl::encoding::Encoder<'_, D>,
709 offset: usize,
710 depth: fidl::encoding::Depth,
711 ) -> fidl::Result<()> {
712 encoder.debug_check_bounds::<LogMessage>(offset);
713 self.0.encode(encoder, offset + 0, depth)?;
717 self.1.encode(encoder, offset + 8, depth)?;
718 self.2.encode(encoder, offset + 16, depth)?;
719 self.3.encode(encoder, offset + 24, depth)?;
720 self.4.encode(encoder, offset + 28, depth)?;
721 self.5.encode(encoder, offset + 32, depth)?;
722 self.6.encode(encoder, offset + 48, depth)?;
723 Ok(())
724 }
725 }
726
727 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogMessage {
728 #[inline(always)]
729 fn new_empty() -> Self {
730 Self {
731 pid: fidl::new_empty!(u64, D),
732 tid: fidl::new_empty!(u64, D),
733 time: fidl::new_empty!(fidl::BootInstant, D),
734 severity: fidl::new_empty!(i32, D),
735 dropped_logs: fidl::new_empty!(u32, D),
736 tags: fidl::new_empty!(
737 fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
738 D
739 ),
740 msg: fidl::new_empty!(fidl::encoding::BoundedString<32768>, D),
741 }
742 }
743
744 #[inline]
745 unsafe fn decode(
746 &mut self,
747 decoder: &mut fidl::encoding::Decoder<'_, D>,
748 offset: usize,
749 _depth: fidl::encoding::Depth,
750 ) -> fidl::Result<()> {
751 decoder.debug_check_bounds::<Self>(offset);
752 fidl::decode!(u64, D, &mut self.pid, decoder, offset + 0, _depth)?;
754 fidl::decode!(u64, D, &mut self.tid, decoder, offset + 8, _depth)?;
755 fidl::decode!(fidl::BootInstant, D, &mut self.time, decoder, offset + 16, _depth)?;
756 fidl::decode!(i32, D, &mut self.severity, decoder, offset + 24, _depth)?;
757 fidl::decode!(u32, D, &mut self.dropped_logs, decoder, offset + 28, _depth)?;
758 fidl::decode!(
759 fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
760 D,
761 &mut self.tags,
762 decoder,
763 offset + 32,
764 _depth
765 )?;
766 fidl::decode!(
767 fidl::encoding::BoundedString<32768>,
768 D,
769 &mut self.msg,
770 decoder,
771 offset + 48,
772 _depth
773 )?;
774 Ok(())
775 }
776 }
777
778 impl fidl::encoding::ValueTypeMarker for LogSinkWaitForInterestChangeResponse {
779 type Borrowed<'a> = &'a Self;
780 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
781 value
782 }
783 }
784
785 unsafe impl fidl::encoding::TypeMarker for LogSinkWaitForInterestChangeResponse {
786 type Owned = Self;
787
788 #[inline(always)]
789 fn inline_align(_context: fidl::encoding::Context) -> usize {
790 8
791 }
792
793 #[inline(always)]
794 fn inline_size(_context: fidl::encoding::Context) -> usize {
795 16
796 }
797 }
798
799 unsafe impl<D: fidl::encoding::ResourceDialect>
800 fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, D>
801 for &LogSinkWaitForInterestChangeResponse
802 {
803 #[inline]
804 unsafe fn encode(
805 self,
806 encoder: &mut fidl::encoding::Encoder<'_, D>,
807 offset: usize,
808 _depth: fidl::encoding::Depth,
809 ) -> fidl::Result<()> {
810 encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
811 fidl::encoding::Encode::<LogSinkWaitForInterestChangeResponse, D>::encode(
813 (
814 <fidl_fuchsia_diagnostics_types::Interest as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
815 ),
816 encoder, offset, _depth
817 )
818 }
819 }
820 unsafe impl<
821 D: fidl::encoding::ResourceDialect,
822 T0: fidl::encoding::Encode<fidl_fuchsia_diagnostics_types::Interest, D>,
823 > fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, D> for (T0,)
824 {
825 #[inline]
826 unsafe fn encode(
827 self,
828 encoder: &mut fidl::encoding::Encoder<'_, D>,
829 offset: usize,
830 depth: fidl::encoding::Depth,
831 ) -> fidl::Result<()> {
832 encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
833 self.0.encode(encoder, offset + 0, depth)?;
837 Ok(())
838 }
839 }
840
841 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
842 for LogSinkWaitForInterestChangeResponse
843 {
844 #[inline(always)]
845 fn new_empty() -> Self {
846 Self { data: fidl::new_empty!(fidl_fuchsia_diagnostics_types::Interest, D) }
847 }
848
849 #[inline]
850 unsafe fn decode(
851 &mut self,
852 decoder: &mut fidl::encoding::Decoder<'_, D>,
853 offset: usize,
854 _depth: fidl::encoding::Depth,
855 ) -> fidl::Result<()> {
856 decoder.debug_check_bounds::<Self>(offset);
857 fidl::decode!(
859 fidl_fuchsia_diagnostics_types::Interest,
860 D,
861 &mut self.data,
862 decoder,
863 offset + 0,
864 _depth
865 )?;
866 Ok(())
867 }
868 }
869}