fidl_fuchsia_logger__common/
fidl_fuchsia_logger__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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
11/// Default log level used to initialize loggers.
12pub const LOG_LEVEL_DEFAULT: LogLevelFilter = LogLevelFilter::Info;
13
14/// Maximum available log severity.
15pub const LOG_SEVERITY_MAX_STEP: u8 = 6;
16
17/// The interval between discrete log severity levels
18pub const LOG_SEVERITY_STEP_SIZE: u8 = 16;
19
20/// The interval between discrete log verbosity levels
21pub const LOG_VERBOSITY_STEP_SIZE: u8 = 1;
22
23/// Max byte size for message payload.
24pub const MAX_DATAGRAM_LEN_BYTES: u32 = 32768;
25
26/// Max log bytes per call to a listener.
27pub const MAX_LOG_MANY_SIZE_BYTES: u64 = 16384;
28
29/// Max number of tags that can be passed to filter by listener.
30pub const MAX_TAGS: u8 = 16;
31
32/// Max tags that will be attached to a LogMessage.
33pub const MAX_TAGS_PER_LOG_MESSAGE: u8 = 5;
34
35/// Max tag length that can be passed to filter by listener.
36pub 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    /// Incorrectly called WaitForInterestChange twice
42    /// without waiting for the first call to return.
43    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
61/// Log levels used with log related filtering.
62/// Filtering uses a heuristic based on a threshold of
63/// minimum severity level - with any log equal to or
64/// greater than the threshold being included in the
65/// printable logs.
66#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
67#[repr(i8)]
68pub enum LogLevelFilter {
69    Trace = 16,
70    Debug = 32,
71    Info = 48,
72    Warn = 64,
73    Error = 80,
74    Fatal = 96,
75    None = 127,
76}
77
78impl LogLevelFilter {
79    #[inline]
80    pub fn from_primitive(prim: i8) -> Option<Self> {
81        match prim {
82            16 => Some(Self::Trace),
83            32 => Some(Self::Debug),
84            48 => Some(Self::Info),
85            64 => Some(Self::Warn),
86            80 => Some(Self::Error),
87            96 => Some(Self::Fatal),
88            127 => Some(Self::None),
89            _ => None,
90        }
91    }
92
93    #[inline]
94    pub const fn into_primitive(self) -> i8 {
95        self as i8
96    }
97}
98
99#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100pub struct LogFilterOptions {
101    pub filter_by_pid: bool,
102    pub pid: u64,
103    pub filter_by_tid: bool,
104    pub tid: u64,
105    /// If more than zero, logs would be filtered based on verbosity and
106    /// `min_severity` would be ignored.
107    pub verbosity: u8,
108    /// Severity used as threshold to determine logging level.
109    pub min_severity: LogLevelFilter,
110    /// If non-empty, return all messages which contain at least one specified
111    /// tag.  If empty, messages will not be filtered by tag.
112    /// Passed tags should not be more than `MAX_TAG_LEN_BYTES` bytes in length
113    /// and max tags can be `MAX_TAGS`.
114    /// Listener would be discarded if the limit is not followed.
115    pub tags: Vec<String>,
116}
117
118impl fidl::Persistable for LogFilterOptions {}
119
120#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121pub struct LogListenerSafeLogManyRequest {
122    pub log: Vec<LogMessage>,
123}
124
125impl fidl::Persistable for LogListenerSafeLogManyRequest {}
126
127#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct LogListenerSafeLogRequest {
129    pub log: LogMessage,
130}
131
132impl fidl::Persistable for LogListenerSafeLogRequest {}
133
134#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct LogMessage {
136    pub pid: u64,
137    pub tid: u64,
138    /// [zx_clock_get_boot](https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get_boot.md)
139    pub time: fidl::BootInstant,
140    pub severity: i32,
141    /// See [wire_format.h](https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/ulib/syslog/include/lib/syslog/wire_format.h).
142    /// As messages can be served out of order, this should only be logged if more than
143    /// last count.
144    pub dropped_logs: u32,
145    pub tags: Vec<String>,
146    pub msg: String,
147}
148
149impl fidl::Persistable for LogMessage {}
150
151#[derive(Clone, Debug, PartialEq)]
152pub struct LogSinkWaitForInterestChangeResponse {
153    pub data: fidl_fuchsia_diagnostics_types__common::Interest,
154}
155
156impl fidl::Persistable for LogSinkWaitForInterestChangeResponse {}
157
158pub mod log_ordinals {
159    pub const LISTEN_SAFE: u64 = 0x4e523b04952a61b1;
160}
161
162pub mod log_listener_safe_ordinals {
163    pub const LOG: u64 = 0x51a39de355d5bd0a;
164    pub const LOG_MANY: u64 = 0x1f056431bcd626a;
165    pub const DONE: u64 = 0x34986151fcb584b8;
166}
167
168pub mod log_sink_ordinals {
169    pub const ON_INIT: u64 = 0x61e0ad0e16df6aba;
170    pub const WAIT_FOR_INTEREST_CHANGE: u64 = 0x1dad20560c197242;
171    pub const CONNECT_STRUCTURED: u64 = 0x635424b504b2a74c;
172}
173
174mod internal {
175    use super::*;
176    unsafe impl fidl::encoding::TypeMarker for InterestChangeError {
177        type Owned = Self;
178
179        #[inline(always)]
180        fn inline_align(_context: fidl::encoding::Context) -> usize {
181            std::mem::align_of::<u32>()
182        }
183
184        #[inline(always)]
185        fn inline_size(_context: fidl::encoding::Context) -> usize {
186            std::mem::size_of::<u32>()
187        }
188
189        #[inline(always)]
190        fn encode_is_copy() -> bool {
191            true
192        }
193
194        #[inline(always)]
195        fn decode_is_copy() -> bool {
196            false
197        }
198    }
199
200    impl fidl::encoding::ValueTypeMarker for InterestChangeError {
201        type Borrowed<'a> = Self;
202        #[inline(always)]
203        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
204            *value
205        }
206    }
207
208    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
209        for InterestChangeError
210    {
211        #[inline]
212        unsafe fn encode(
213            self,
214            encoder: &mut fidl::encoding::Encoder<'_, D>,
215            offset: usize,
216            _depth: fidl::encoding::Depth,
217        ) -> fidl::Result<()> {
218            encoder.debug_check_bounds::<Self>(offset);
219            encoder.write_num(self.into_primitive(), offset);
220            Ok(())
221        }
222    }
223
224    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterestChangeError {
225        #[inline(always)]
226        fn new_empty() -> Self {
227            Self::CalledTwice
228        }
229
230        #[inline]
231        unsafe fn decode(
232            &mut self,
233            decoder: &mut fidl::encoding::Decoder<'_, D>,
234            offset: usize,
235            _depth: fidl::encoding::Depth,
236        ) -> fidl::Result<()> {
237            decoder.debug_check_bounds::<Self>(offset);
238            let prim = decoder.read_num::<u32>(offset);
239
240            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
241            Ok(())
242        }
243    }
244    unsafe impl fidl::encoding::TypeMarker for LogLevelFilter {
245        type Owned = Self;
246
247        #[inline(always)]
248        fn inline_align(_context: fidl::encoding::Context) -> usize {
249            std::mem::align_of::<i8>()
250        }
251
252        #[inline(always)]
253        fn inline_size(_context: fidl::encoding::Context) -> usize {
254            std::mem::size_of::<i8>()
255        }
256
257        #[inline(always)]
258        fn encode_is_copy() -> bool {
259            true
260        }
261
262        #[inline(always)]
263        fn decode_is_copy() -> bool {
264            false
265        }
266    }
267
268    impl fidl::encoding::ValueTypeMarker for LogLevelFilter {
269        type Borrowed<'a> = Self;
270        #[inline(always)]
271        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
272            *value
273        }
274    }
275
276    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LogLevelFilter {
277        #[inline]
278        unsafe fn encode(
279            self,
280            encoder: &mut fidl::encoding::Encoder<'_, D>,
281            offset: usize,
282            _depth: fidl::encoding::Depth,
283        ) -> fidl::Result<()> {
284            encoder.debug_check_bounds::<Self>(offset);
285            encoder.write_num(self.into_primitive(), offset);
286            Ok(())
287        }
288    }
289
290    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogLevelFilter {
291        #[inline(always)]
292        fn new_empty() -> Self {
293            Self::Trace
294        }
295
296        #[inline]
297        unsafe fn decode(
298            &mut self,
299            decoder: &mut fidl::encoding::Decoder<'_, D>,
300            offset: usize,
301            _depth: fidl::encoding::Depth,
302        ) -> fidl::Result<()> {
303            decoder.debug_check_bounds::<Self>(offset);
304            let prim = decoder.read_num::<i8>(offset);
305
306            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
307            Ok(())
308        }
309    }
310
311    impl fidl::encoding::ValueTypeMarker for LogFilterOptions {
312        type Borrowed<'a> = &'a Self;
313        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
314            value
315        }
316    }
317
318    unsafe impl fidl::encoding::TypeMarker for LogFilterOptions {
319        type Owned = Self;
320
321        #[inline(always)]
322        fn inline_align(_context: fidl::encoding::Context) -> usize {
323            8
324        }
325
326        #[inline(always)]
327        fn inline_size(_context: fidl::encoding::Context) -> usize {
328            56
329        }
330    }
331
332    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogFilterOptions, D>
333        for &LogFilterOptions
334    {
335        #[inline]
336        unsafe fn encode(
337            self,
338            encoder: &mut fidl::encoding::Encoder<'_, D>,
339            offset: usize,
340            _depth: fidl::encoding::Depth,
341        ) -> fidl::Result<()> {
342            encoder.debug_check_bounds::<LogFilterOptions>(offset);
343            // Delegate to tuple encoding.
344            fidl::encoding::Encode::<LogFilterOptions, D>::encode(
345                (
346                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_pid),
347                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
348                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_tid),
349                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
350                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.verbosity),
351                    <LogLevelFilter as fidl::encoding::ValueTypeMarker>::borrow(&self.min_severity),
352                    <fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
353                ),
354                encoder, offset, _depth
355            )
356        }
357    }
358    unsafe impl<
359        D: fidl::encoding::ResourceDialect,
360        T0: fidl::encoding::Encode<bool, D>,
361        T1: fidl::encoding::Encode<u64, D>,
362        T2: fidl::encoding::Encode<bool, D>,
363        T3: fidl::encoding::Encode<u64, D>,
364        T4: fidl::encoding::Encode<u8, D>,
365        T5: fidl::encoding::Encode<LogLevelFilter, D>,
366        T6: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>, D>,
367    > fidl::encoding::Encode<LogFilterOptions, D> for (T0, T1, T2, T3, T4, T5, T6)
368    {
369        #[inline]
370        unsafe fn encode(
371            self,
372            encoder: &mut fidl::encoding::Encoder<'_, D>,
373            offset: usize,
374            depth: fidl::encoding::Depth,
375        ) -> fidl::Result<()> {
376            encoder.debug_check_bounds::<LogFilterOptions>(offset);
377            // Zero out padding regions. There's no need to apply masks
378            // because the unmasked parts will be overwritten by fields.
379            unsafe {
380                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
381                (ptr as *mut u64).write_unaligned(0);
382            }
383            unsafe {
384                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
385                (ptr as *mut u64).write_unaligned(0);
386            }
387            unsafe {
388                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
389                (ptr as *mut u64).write_unaligned(0);
390            }
391            // Write the fields.
392            self.0.encode(encoder, offset + 0, depth)?;
393            self.1.encode(encoder, offset + 8, depth)?;
394            self.2.encode(encoder, offset + 16, depth)?;
395            self.3.encode(encoder, offset + 24, depth)?;
396            self.4.encode(encoder, offset + 32, depth)?;
397            self.5.encode(encoder, offset + 33, depth)?;
398            self.6.encode(encoder, offset + 40, depth)?;
399            Ok(())
400        }
401    }
402
403    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogFilterOptions {
404        #[inline(always)]
405        fn new_empty() -> Self {
406            Self {
407                filter_by_pid: fidl::new_empty!(bool, D),
408                pid: fidl::new_empty!(u64, D),
409                filter_by_tid: fidl::new_empty!(bool, D),
410                tid: fidl::new_empty!(u64, D),
411                verbosity: fidl::new_empty!(u8, D),
412                min_severity: fidl::new_empty!(LogLevelFilter, D),
413                tags: fidl::new_empty!(
414                    fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
415                    D
416                ),
417            }
418        }
419
420        #[inline]
421        unsafe fn decode(
422            &mut self,
423            decoder: &mut fidl::encoding::Decoder<'_, D>,
424            offset: usize,
425            _depth: fidl::encoding::Depth,
426        ) -> fidl::Result<()> {
427            decoder.debug_check_bounds::<Self>(offset);
428            // Verify that padding bytes are zero.
429            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
430            let padval = unsafe { (ptr as *const u64).read_unaligned() };
431            let mask = 0xffffffffffffff00u64;
432            let maskedval = padval & mask;
433            if maskedval != 0 {
434                return Err(fidl::Error::NonZeroPadding {
435                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
436                });
437            }
438            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
439            let padval = unsafe { (ptr as *const u64).read_unaligned() };
440            let mask = 0xffffffffffffff00u64;
441            let maskedval = padval & mask;
442            if maskedval != 0 {
443                return Err(fidl::Error::NonZeroPadding {
444                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
445                });
446            }
447            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
448            let padval = unsafe { (ptr as *const u64).read_unaligned() };
449            let mask = 0xffffffffffff0000u64;
450            let maskedval = padval & mask;
451            if maskedval != 0 {
452                return Err(fidl::Error::NonZeroPadding {
453                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
454                });
455            }
456            fidl::decode!(bool, D, &mut self.filter_by_pid, decoder, offset + 0, _depth)?;
457            fidl::decode!(u64, D, &mut self.pid, decoder, offset + 8, _depth)?;
458            fidl::decode!(bool, D, &mut self.filter_by_tid, decoder, offset + 16, _depth)?;
459            fidl::decode!(u64, D, &mut self.tid, decoder, offset + 24, _depth)?;
460            fidl::decode!(u8, D, &mut self.verbosity, decoder, offset + 32, _depth)?;
461            fidl::decode!(LogLevelFilter, D, &mut self.min_severity, decoder, offset + 33, _depth)?;
462            fidl::decode!(
463                fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
464                D,
465                &mut self.tags,
466                decoder,
467                offset + 40,
468                _depth
469            )?;
470            Ok(())
471        }
472    }
473
474    impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogManyRequest {
475        type Borrowed<'a> = &'a Self;
476        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
477            value
478        }
479    }
480
481    unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogManyRequest {
482        type Owned = Self;
483
484        #[inline(always)]
485        fn inline_align(_context: fidl::encoding::Context) -> usize {
486            8
487        }
488
489        #[inline(always)]
490        fn inline_size(_context: fidl::encoding::Context) -> usize {
491            16
492        }
493    }
494
495    unsafe impl<D: fidl::encoding::ResourceDialect>
496        fidl::encoding::Encode<LogListenerSafeLogManyRequest, D>
497        for &LogListenerSafeLogManyRequest
498    {
499        #[inline]
500        unsafe fn encode(
501            self,
502            encoder: &mut fidl::encoding::Encoder<'_, D>,
503            offset: usize,
504            _depth: fidl::encoding::Depth,
505        ) -> fidl::Result<()> {
506            encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
507            // Delegate to tuple encoding.
508            fidl::encoding::Encode::<LogListenerSafeLogManyRequest, D>::encode(
509                (
510                    <fidl::encoding::UnboundedVector<LogMessage> as fidl::encoding::ValueTypeMarker>::borrow(&self.log),
511                ),
512                encoder, offset, _depth
513            )
514        }
515    }
516    unsafe impl<
517        D: fidl::encoding::ResourceDialect,
518        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LogMessage>, D>,
519    > fidl::encoding::Encode<LogListenerSafeLogManyRequest, D> for (T0,)
520    {
521        #[inline]
522        unsafe fn encode(
523            self,
524            encoder: &mut fidl::encoding::Encoder<'_, D>,
525            offset: usize,
526            depth: fidl::encoding::Depth,
527        ) -> fidl::Result<()> {
528            encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
529            // Zero out padding regions. There's no need to apply masks
530            // because the unmasked parts will be overwritten by fields.
531            // Write the fields.
532            self.0.encode(encoder, offset + 0, depth)?;
533            Ok(())
534        }
535    }
536
537    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
538        for LogListenerSafeLogManyRequest
539    {
540        #[inline(always)]
541        fn new_empty() -> Self {
542            Self { log: fidl::new_empty!(fidl::encoding::UnboundedVector<LogMessage>, D) }
543        }
544
545        #[inline]
546        unsafe fn decode(
547            &mut self,
548            decoder: &mut fidl::encoding::Decoder<'_, D>,
549            offset: usize,
550            _depth: fidl::encoding::Depth,
551        ) -> fidl::Result<()> {
552            decoder.debug_check_bounds::<Self>(offset);
553            // Verify that padding bytes are zero.
554            fidl::decode!(
555                fidl::encoding::UnboundedVector<LogMessage>,
556                D,
557                &mut self.log,
558                decoder,
559                offset + 0,
560                _depth
561            )?;
562            Ok(())
563        }
564    }
565
566    impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogRequest {
567        type Borrowed<'a> = &'a Self;
568        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
569            value
570        }
571    }
572
573    unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogRequest {
574        type Owned = Self;
575
576        #[inline(always)]
577        fn inline_align(_context: fidl::encoding::Context) -> usize {
578            8
579        }
580
581        #[inline(always)]
582        fn inline_size(_context: fidl::encoding::Context) -> usize {
583            64
584        }
585    }
586
587    unsafe impl<D: fidl::encoding::ResourceDialect>
588        fidl::encoding::Encode<LogListenerSafeLogRequest, D> for &LogListenerSafeLogRequest
589    {
590        #[inline]
591        unsafe fn encode(
592            self,
593            encoder: &mut fidl::encoding::Encoder<'_, D>,
594            offset: usize,
595            _depth: fidl::encoding::Depth,
596        ) -> fidl::Result<()> {
597            encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
598            // Delegate to tuple encoding.
599            fidl::encoding::Encode::<LogListenerSafeLogRequest, D>::encode(
600                (<LogMessage as fidl::encoding::ValueTypeMarker>::borrow(&self.log),),
601                encoder,
602                offset,
603                _depth,
604            )
605        }
606    }
607    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LogMessage, D>>
608        fidl::encoding::Encode<LogListenerSafeLogRequest, D> for (T0,)
609    {
610        #[inline]
611        unsafe fn encode(
612            self,
613            encoder: &mut fidl::encoding::Encoder<'_, D>,
614            offset: usize,
615            depth: fidl::encoding::Depth,
616        ) -> fidl::Result<()> {
617            encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
618            // Zero out padding regions. There's no need to apply masks
619            // because the unmasked parts will be overwritten by fields.
620            // Write the fields.
621            self.0.encode(encoder, offset + 0, depth)?;
622            Ok(())
623        }
624    }
625
626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
627        for LogListenerSafeLogRequest
628    {
629        #[inline(always)]
630        fn new_empty() -> Self {
631            Self { log: fidl::new_empty!(LogMessage, D) }
632        }
633
634        #[inline]
635        unsafe fn decode(
636            &mut self,
637            decoder: &mut fidl::encoding::Decoder<'_, D>,
638            offset: usize,
639            _depth: fidl::encoding::Depth,
640        ) -> fidl::Result<()> {
641            decoder.debug_check_bounds::<Self>(offset);
642            // Verify that padding bytes are zero.
643            fidl::decode!(LogMessage, D, &mut self.log, decoder, offset + 0, _depth)?;
644            Ok(())
645        }
646    }
647
648    impl fidl::encoding::ValueTypeMarker for LogMessage {
649        type Borrowed<'a> = &'a Self;
650        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
651            value
652        }
653    }
654
655    unsafe impl fidl::encoding::TypeMarker for LogMessage {
656        type Owned = Self;
657
658        #[inline(always)]
659        fn inline_align(_context: fidl::encoding::Context) -> usize {
660            8
661        }
662
663        #[inline(always)]
664        fn inline_size(_context: fidl::encoding::Context) -> usize {
665            64
666        }
667    }
668
669    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogMessage, D>
670        for &LogMessage
671    {
672        #[inline]
673        unsafe fn encode(
674            self,
675            encoder: &mut fidl::encoding::Encoder<'_, D>,
676            offset: usize,
677            _depth: fidl::encoding::Depth,
678        ) -> fidl::Result<()> {
679            encoder.debug_check_bounds::<LogMessage>(offset);
680            // Delegate to tuple encoding.
681            fidl::encoding::Encode::<LogMessage, D>::encode(
682                (
683                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
684                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
685                    <fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
686                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
687                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dropped_logs),
688                    <fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
689                    <fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(&self.msg),
690                ),
691                encoder, offset, _depth
692            )
693        }
694    }
695    unsafe impl<
696        D: fidl::encoding::ResourceDialect,
697        T0: fidl::encoding::Encode<u64, D>,
698        T1: fidl::encoding::Encode<u64, D>,
699        T2: fidl::encoding::Encode<fidl::BootInstant, D>,
700        T3: fidl::encoding::Encode<i32, D>,
701        T4: fidl::encoding::Encode<u32, D>,
702        T5: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>, D>,
703        T6: fidl::encoding::Encode<fidl::encoding::BoundedString<32768>, D>,
704    > fidl::encoding::Encode<LogMessage, D> for (T0, T1, T2, T3, T4, T5, T6)
705    {
706        #[inline]
707        unsafe fn encode(
708            self,
709            encoder: &mut fidl::encoding::Encoder<'_, D>,
710            offset: usize,
711            depth: fidl::encoding::Depth,
712        ) -> fidl::Result<()> {
713            encoder.debug_check_bounds::<LogMessage>(offset);
714            // Zero out padding regions. There's no need to apply masks
715            // because the unmasked parts will be overwritten by fields.
716            // Write the fields.
717            self.0.encode(encoder, offset + 0, depth)?;
718            self.1.encode(encoder, offset + 8, depth)?;
719            self.2.encode(encoder, offset + 16, depth)?;
720            self.3.encode(encoder, offset + 24, depth)?;
721            self.4.encode(encoder, offset + 28, depth)?;
722            self.5.encode(encoder, offset + 32, depth)?;
723            self.6.encode(encoder, offset + 48, depth)?;
724            Ok(())
725        }
726    }
727
728    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogMessage {
729        #[inline(always)]
730        fn new_empty() -> Self {
731            Self {
732                pid: fidl::new_empty!(u64, D),
733                tid: fidl::new_empty!(u64, D),
734                time: fidl::new_empty!(fidl::BootInstant, D),
735                severity: fidl::new_empty!(i32, D),
736                dropped_logs: fidl::new_empty!(u32, D),
737                tags: fidl::new_empty!(
738                    fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
739                    D
740                ),
741                msg: fidl::new_empty!(fidl::encoding::BoundedString<32768>, D),
742            }
743        }
744
745        #[inline]
746        unsafe fn decode(
747            &mut self,
748            decoder: &mut fidl::encoding::Decoder<'_, D>,
749            offset: usize,
750            _depth: fidl::encoding::Depth,
751        ) -> fidl::Result<()> {
752            decoder.debug_check_bounds::<Self>(offset);
753            // Verify that padding bytes are zero.
754            fidl::decode!(u64, D, &mut self.pid, decoder, offset + 0, _depth)?;
755            fidl::decode!(u64, D, &mut self.tid, decoder, offset + 8, _depth)?;
756            fidl::decode!(fidl::BootInstant, D, &mut self.time, decoder, offset + 16, _depth)?;
757            fidl::decode!(i32, D, &mut self.severity, decoder, offset + 24, _depth)?;
758            fidl::decode!(u32, D, &mut self.dropped_logs, decoder, offset + 28, _depth)?;
759            fidl::decode!(
760                fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
761                D,
762                &mut self.tags,
763                decoder,
764                offset + 32,
765                _depth
766            )?;
767            fidl::decode!(
768                fidl::encoding::BoundedString<32768>,
769                D,
770                &mut self.msg,
771                decoder,
772                offset + 48,
773                _depth
774            )?;
775            Ok(())
776        }
777    }
778
779    impl fidl::encoding::ValueTypeMarker for LogSinkWaitForInterestChangeResponse {
780        type Borrowed<'a> = &'a Self;
781        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
782            value
783        }
784    }
785
786    unsafe impl fidl::encoding::TypeMarker for LogSinkWaitForInterestChangeResponse {
787        type Owned = Self;
788
789        #[inline(always)]
790        fn inline_align(_context: fidl::encoding::Context) -> usize {
791            8
792        }
793
794        #[inline(always)]
795        fn inline_size(_context: fidl::encoding::Context) -> usize {
796            16
797        }
798    }
799
800    unsafe impl<D: fidl::encoding::ResourceDialect>
801        fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, D>
802        for &LogSinkWaitForInterestChangeResponse
803    {
804        #[inline]
805        unsafe fn encode(
806            self,
807            encoder: &mut fidl::encoding::Encoder<'_, D>,
808            offset: usize,
809            _depth: fidl::encoding::Depth,
810        ) -> fidl::Result<()> {
811            encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
812            // Delegate to tuple encoding.
813            fidl::encoding::Encode::<LogSinkWaitForInterestChangeResponse, D>::encode(
814                (
815                    <fidl_fuchsia_diagnostics_types__common::Interest as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
816                ),
817                encoder, offset, _depth
818            )
819        }
820    }
821    unsafe impl<
822        D: fidl::encoding::ResourceDialect,
823        T0: fidl::encoding::Encode<fidl_fuchsia_diagnostics_types__common::Interest, D>,
824    > fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, D> for (T0,)
825    {
826        #[inline]
827        unsafe fn encode(
828            self,
829            encoder: &mut fidl::encoding::Encoder<'_, D>,
830            offset: usize,
831            depth: fidl::encoding::Depth,
832        ) -> fidl::Result<()> {
833            encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
834            // Zero out padding regions. There's no need to apply masks
835            // because the unmasked parts will be overwritten by fields.
836            // Write the fields.
837            self.0.encode(encoder, offset + 0, depth)?;
838            Ok(())
839        }
840    }
841
842    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
843        for LogSinkWaitForInterestChangeResponse
844    {
845        #[inline(always)]
846        fn new_empty() -> Self {
847            Self { data: fidl::new_empty!(fidl_fuchsia_diagnostics_types__common::Interest, D) }
848        }
849
850        #[inline]
851        unsafe fn decode(
852            &mut self,
853            decoder: &mut fidl::encoding::Decoder<'_, D>,
854            offset: usize,
855            _depth: fidl::encoding::Depth,
856        ) -> fidl::Result<()> {
857            decoder.debug_check_bounds::<Self>(offset);
858            // Verify that padding bytes are zero.
859            fidl::decode!(
860                fidl_fuchsia_diagnostics_types__common::Interest,
861                D,
862                &mut self.data,
863                decoder,
864                offset + 0,
865                _depth
866            )?;
867            Ok(())
868        }
869    }
870}