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    pub const DUMP_LOGS_SAFE: u64 = 0x14e39f9cada72519;
161    pub const LISTEN_SAFE_WITH_SELECTORS: u64 = 0x1b365178771a007e;
162}
163
164pub mod log_listener_safe_ordinals {
165    pub const LOG: u64 = 0x51a39de355d5bd0a;
166    pub const LOG_MANY: u64 = 0x1f056431bcd626a;
167    pub const DONE: u64 = 0x34986151fcb584b8;
168}
169
170pub mod log_sink_ordinals {
171    pub const CONNECT: u64 = 0x64cc4b58ae95c61b;
172    pub const WAIT_FOR_INTEREST_CHANGE: u64 = 0x1dad20560c197242;
173    pub const CONNECT_STRUCTURED: u64 = 0x635424b504b2a74c;
174}
175
176mod internal {
177    use super::*;
178    unsafe impl fidl::encoding::TypeMarker for InterestChangeError {
179        type Owned = Self;
180
181        #[inline(always)]
182        fn inline_align(_context: fidl::encoding::Context) -> usize {
183            std::mem::align_of::<u32>()
184        }
185
186        #[inline(always)]
187        fn inline_size(_context: fidl::encoding::Context) -> usize {
188            std::mem::size_of::<u32>()
189        }
190
191        #[inline(always)]
192        fn encode_is_copy() -> bool {
193            true
194        }
195
196        #[inline(always)]
197        fn decode_is_copy() -> bool {
198            false
199        }
200    }
201
202    impl fidl::encoding::ValueTypeMarker for InterestChangeError {
203        type Borrowed<'a> = Self;
204        #[inline(always)]
205        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
206            *value
207        }
208    }
209
210    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
211        for InterestChangeError
212    {
213        #[inline]
214        unsafe fn encode(
215            self,
216            encoder: &mut fidl::encoding::Encoder<'_, D>,
217            offset: usize,
218            _depth: fidl::encoding::Depth,
219        ) -> fidl::Result<()> {
220            encoder.debug_check_bounds::<Self>(offset);
221            encoder.write_num(self.into_primitive(), offset);
222            Ok(())
223        }
224    }
225
226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterestChangeError {
227        #[inline(always)]
228        fn new_empty() -> Self {
229            Self::CalledTwice
230        }
231
232        #[inline]
233        unsafe fn decode(
234            &mut self,
235            decoder: &mut fidl::encoding::Decoder<'_, D>,
236            offset: usize,
237            _depth: fidl::encoding::Depth,
238        ) -> fidl::Result<()> {
239            decoder.debug_check_bounds::<Self>(offset);
240            let prim = decoder.read_num::<u32>(offset);
241
242            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
243            Ok(())
244        }
245    }
246    unsafe impl fidl::encoding::TypeMarker for LogLevelFilter {
247        type Owned = Self;
248
249        #[inline(always)]
250        fn inline_align(_context: fidl::encoding::Context) -> usize {
251            std::mem::align_of::<i8>()
252        }
253
254        #[inline(always)]
255        fn inline_size(_context: fidl::encoding::Context) -> usize {
256            std::mem::size_of::<i8>()
257        }
258
259        #[inline(always)]
260        fn encode_is_copy() -> bool {
261            true
262        }
263
264        #[inline(always)]
265        fn decode_is_copy() -> bool {
266            false
267        }
268    }
269
270    impl fidl::encoding::ValueTypeMarker for LogLevelFilter {
271        type Borrowed<'a> = Self;
272        #[inline(always)]
273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
274            *value
275        }
276    }
277
278    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LogLevelFilter {
279        #[inline]
280        unsafe fn encode(
281            self,
282            encoder: &mut fidl::encoding::Encoder<'_, D>,
283            offset: usize,
284            _depth: fidl::encoding::Depth,
285        ) -> fidl::Result<()> {
286            encoder.debug_check_bounds::<Self>(offset);
287            encoder.write_num(self.into_primitive(), offset);
288            Ok(())
289        }
290    }
291
292    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogLevelFilter {
293        #[inline(always)]
294        fn new_empty() -> Self {
295            Self::Trace
296        }
297
298        #[inline]
299        unsafe fn decode(
300            &mut self,
301            decoder: &mut fidl::encoding::Decoder<'_, D>,
302            offset: usize,
303            _depth: fidl::encoding::Depth,
304        ) -> fidl::Result<()> {
305            decoder.debug_check_bounds::<Self>(offset);
306            let prim = decoder.read_num::<i8>(offset);
307
308            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
309            Ok(())
310        }
311    }
312
313    impl fidl::encoding::ValueTypeMarker for LogFilterOptions {
314        type Borrowed<'a> = &'a Self;
315        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
316            value
317        }
318    }
319
320    unsafe impl fidl::encoding::TypeMarker for LogFilterOptions {
321        type Owned = Self;
322
323        #[inline(always)]
324        fn inline_align(_context: fidl::encoding::Context) -> usize {
325            8
326        }
327
328        #[inline(always)]
329        fn inline_size(_context: fidl::encoding::Context) -> usize {
330            56
331        }
332    }
333
334    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogFilterOptions, D>
335        for &LogFilterOptions
336    {
337        #[inline]
338        unsafe fn encode(
339            self,
340            encoder: &mut fidl::encoding::Encoder<'_, D>,
341            offset: usize,
342            _depth: fidl::encoding::Depth,
343        ) -> fidl::Result<()> {
344            encoder.debug_check_bounds::<LogFilterOptions>(offset);
345            // Delegate to tuple encoding.
346            fidl::encoding::Encode::<LogFilterOptions, D>::encode(
347                (
348                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_pid),
349                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
350                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_tid),
351                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
352                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.verbosity),
353                    <LogLevelFilter as fidl::encoding::ValueTypeMarker>::borrow(&self.min_severity),
354                    <fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
355                ),
356                encoder, offset, _depth
357            )
358        }
359    }
360    unsafe impl<
361            D: fidl::encoding::ResourceDialect,
362            T0: fidl::encoding::Encode<bool, D>,
363            T1: fidl::encoding::Encode<u64, D>,
364            T2: fidl::encoding::Encode<bool, D>,
365            T3: fidl::encoding::Encode<u64, D>,
366            T4: fidl::encoding::Encode<u8, D>,
367            T5: fidl::encoding::Encode<LogLevelFilter, D>,
368            T6: fidl::encoding::Encode<
369                fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
370                D,
371            >,
372        > fidl::encoding::Encode<LogFilterOptions, D> for (T0, T1, T2, T3, T4, T5, T6)
373    {
374        #[inline]
375        unsafe fn encode(
376            self,
377            encoder: &mut fidl::encoding::Encoder<'_, D>,
378            offset: usize,
379            depth: fidl::encoding::Depth,
380        ) -> fidl::Result<()> {
381            encoder.debug_check_bounds::<LogFilterOptions>(offset);
382            // Zero out padding regions. There's no need to apply masks
383            // because the unmasked parts will be overwritten by fields.
384            unsafe {
385                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
386                (ptr as *mut u64).write_unaligned(0);
387            }
388            unsafe {
389                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
390                (ptr as *mut u64).write_unaligned(0);
391            }
392            unsafe {
393                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
394                (ptr as *mut u64).write_unaligned(0);
395            }
396            // Write the fields.
397            self.0.encode(encoder, offset + 0, depth)?;
398            self.1.encode(encoder, offset + 8, depth)?;
399            self.2.encode(encoder, offset + 16, depth)?;
400            self.3.encode(encoder, offset + 24, depth)?;
401            self.4.encode(encoder, offset + 32, depth)?;
402            self.5.encode(encoder, offset + 33, depth)?;
403            self.6.encode(encoder, offset + 40, depth)?;
404            Ok(())
405        }
406    }
407
408    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogFilterOptions {
409        #[inline(always)]
410        fn new_empty() -> Self {
411            Self {
412                filter_by_pid: fidl::new_empty!(bool, D),
413                pid: fidl::new_empty!(u64, D),
414                filter_by_tid: fidl::new_empty!(bool, D),
415                tid: fidl::new_empty!(u64, D),
416                verbosity: fidl::new_empty!(u8, D),
417                min_severity: fidl::new_empty!(LogLevelFilter, D),
418                tags: fidl::new_empty!(
419                    fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
420                    D
421                ),
422            }
423        }
424
425        #[inline]
426        unsafe fn decode(
427            &mut self,
428            decoder: &mut fidl::encoding::Decoder<'_, D>,
429            offset: usize,
430            _depth: fidl::encoding::Depth,
431        ) -> fidl::Result<()> {
432            decoder.debug_check_bounds::<Self>(offset);
433            // Verify that padding bytes are zero.
434            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
435            let padval = unsafe { (ptr as *const u64).read_unaligned() };
436            let mask = 0xffffffffffffff00u64;
437            let maskedval = padval & mask;
438            if maskedval != 0 {
439                return Err(fidl::Error::NonZeroPadding {
440                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
441                });
442            }
443            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
444            let padval = unsafe { (ptr as *const u64).read_unaligned() };
445            let mask = 0xffffffffffffff00u64;
446            let maskedval = padval & mask;
447            if maskedval != 0 {
448                return Err(fidl::Error::NonZeroPadding {
449                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
450                });
451            }
452            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
453            let padval = unsafe { (ptr as *const u64).read_unaligned() };
454            let mask = 0xffffffffffff0000u64;
455            let maskedval = padval & mask;
456            if maskedval != 0 {
457                return Err(fidl::Error::NonZeroPadding {
458                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
459                });
460            }
461            fidl::decode!(bool, D, &mut self.filter_by_pid, decoder, offset + 0, _depth)?;
462            fidl::decode!(u64, D, &mut self.pid, decoder, offset + 8, _depth)?;
463            fidl::decode!(bool, D, &mut self.filter_by_tid, decoder, offset + 16, _depth)?;
464            fidl::decode!(u64, D, &mut self.tid, decoder, offset + 24, _depth)?;
465            fidl::decode!(u8, D, &mut self.verbosity, decoder, offset + 32, _depth)?;
466            fidl::decode!(LogLevelFilter, D, &mut self.min_severity, decoder, offset + 33, _depth)?;
467            fidl::decode!(
468                fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
469                D,
470                &mut self.tags,
471                decoder,
472                offset + 40,
473                _depth
474            )?;
475            Ok(())
476        }
477    }
478
479    impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogManyRequest {
480        type Borrowed<'a> = &'a Self;
481        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
482            value
483        }
484    }
485
486    unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogManyRequest {
487        type Owned = Self;
488
489        #[inline(always)]
490        fn inline_align(_context: fidl::encoding::Context) -> usize {
491            8
492        }
493
494        #[inline(always)]
495        fn inline_size(_context: fidl::encoding::Context) -> usize {
496            16
497        }
498    }
499
500    unsafe impl<D: fidl::encoding::ResourceDialect>
501        fidl::encoding::Encode<LogListenerSafeLogManyRequest, D>
502        for &LogListenerSafeLogManyRequest
503    {
504        #[inline]
505        unsafe fn encode(
506            self,
507            encoder: &mut fidl::encoding::Encoder<'_, D>,
508            offset: usize,
509            _depth: fidl::encoding::Depth,
510        ) -> fidl::Result<()> {
511            encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
512            // Delegate to tuple encoding.
513            fidl::encoding::Encode::<LogListenerSafeLogManyRequest, D>::encode(
514                (
515                    <fidl::encoding::UnboundedVector<LogMessage> as fidl::encoding::ValueTypeMarker>::borrow(&self.log),
516                ),
517                encoder, offset, _depth
518            )
519        }
520    }
521    unsafe impl<
522            D: fidl::encoding::ResourceDialect,
523            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LogMessage>, D>,
524        > fidl::encoding::Encode<LogListenerSafeLogManyRequest, D> for (T0,)
525    {
526        #[inline]
527        unsafe fn encode(
528            self,
529            encoder: &mut fidl::encoding::Encoder<'_, D>,
530            offset: usize,
531            depth: fidl::encoding::Depth,
532        ) -> fidl::Result<()> {
533            encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
534            // Zero out padding regions. There's no need to apply masks
535            // because the unmasked parts will be overwritten by fields.
536            // Write the fields.
537            self.0.encode(encoder, offset + 0, depth)?;
538            Ok(())
539        }
540    }
541
542    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
543        for LogListenerSafeLogManyRequest
544    {
545        #[inline(always)]
546        fn new_empty() -> Self {
547            Self { log: fidl::new_empty!(fidl::encoding::UnboundedVector<LogMessage>, D) }
548        }
549
550        #[inline]
551        unsafe fn decode(
552            &mut self,
553            decoder: &mut fidl::encoding::Decoder<'_, D>,
554            offset: usize,
555            _depth: fidl::encoding::Depth,
556        ) -> fidl::Result<()> {
557            decoder.debug_check_bounds::<Self>(offset);
558            // Verify that padding bytes are zero.
559            fidl::decode!(
560                fidl::encoding::UnboundedVector<LogMessage>,
561                D,
562                &mut self.log,
563                decoder,
564                offset + 0,
565                _depth
566            )?;
567            Ok(())
568        }
569    }
570
571    impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogRequest {
572        type Borrowed<'a> = &'a Self;
573        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
574            value
575        }
576    }
577
578    unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogRequest {
579        type Owned = Self;
580
581        #[inline(always)]
582        fn inline_align(_context: fidl::encoding::Context) -> usize {
583            8
584        }
585
586        #[inline(always)]
587        fn inline_size(_context: fidl::encoding::Context) -> usize {
588            64
589        }
590    }
591
592    unsafe impl<D: fidl::encoding::ResourceDialect>
593        fidl::encoding::Encode<LogListenerSafeLogRequest, D> for &LogListenerSafeLogRequest
594    {
595        #[inline]
596        unsafe fn encode(
597            self,
598            encoder: &mut fidl::encoding::Encoder<'_, D>,
599            offset: usize,
600            _depth: fidl::encoding::Depth,
601        ) -> fidl::Result<()> {
602            encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
603            // Delegate to tuple encoding.
604            fidl::encoding::Encode::<LogListenerSafeLogRequest, D>::encode(
605                (<LogMessage as fidl::encoding::ValueTypeMarker>::borrow(&self.log),),
606                encoder,
607                offset,
608                _depth,
609            )
610        }
611    }
612    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LogMessage, D>>
613        fidl::encoding::Encode<LogListenerSafeLogRequest, D> for (T0,)
614    {
615        #[inline]
616        unsafe fn encode(
617            self,
618            encoder: &mut fidl::encoding::Encoder<'_, D>,
619            offset: usize,
620            depth: fidl::encoding::Depth,
621        ) -> fidl::Result<()> {
622            encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
623            // Zero out padding regions. There's no need to apply masks
624            // because the unmasked parts will be overwritten by fields.
625            // Write the fields.
626            self.0.encode(encoder, offset + 0, depth)?;
627            Ok(())
628        }
629    }
630
631    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
632        for LogListenerSafeLogRequest
633    {
634        #[inline(always)]
635        fn new_empty() -> Self {
636            Self { log: fidl::new_empty!(LogMessage, D) }
637        }
638
639        #[inline]
640        unsafe fn decode(
641            &mut self,
642            decoder: &mut fidl::encoding::Decoder<'_, D>,
643            offset: usize,
644            _depth: fidl::encoding::Depth,
645        ) -> fidl::Result<()> {
646            decoder.debug_check_bounds::<Self>(offset);
647            // Verify that padding bytes are zero.
648            fidl::decode!(LogMessage, D, &mut self.log, decoder, offset + 0, _depth)?;
649            Ok(())
650        }
651    }
652
653    impl fidl::encoding::ValueTypeMarker for LogMessage {
654        type Borrowed<'a> = &'a Self;
655        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
656            value
657        }
658    }
659
660    unsafe impl fidl::encoding::TypeMarker for LogMessage {
661        type Owned = Self;
662
663        #[inline(always)]
664        fn inline_align(_context: fidl::encoding::Context) -> usize {
665            8
666        }
667
668        #[inline(always)]
669        fn inline_size(_context: fidl::encoding::Context) -> usize {
670            64
671        }
672    }
673
674    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogMessage, D>
675        for &LogMessage
676    {
677        #[inline]
678        unsafe fn encode(
679            self,
680            encoder: &mut fidl::encoding::Encoder<'_, D>,
681            offset: usize,
682            _depth: fidl::encoding::Depth,
683        ) -> fidl::Result<()> {
684            encoder.debug_check_bounds::<LogMessage>(offset);
685            // Delegate to tuple encoding.
686            fidl::encoding::Encode::<LogMessage, D>::encode(
687                (
688                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
689                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
690                    <fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
691                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
692                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dropped_logs),
693                    <fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
694                    <fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(&self.msg),
695                ),
696                encoder, offset, _depth
697            )
698        }
699    }
700    unsafe impl<
701            D: fidl::encoding::ResourceDialect,
702            T0: fidl::encoding::Encode<u64, D>,
703            T1: fidl::encoding::Encode<u64, D>,
704            T2: fidl::encoding::Encode<fidl::BootInstant, D>,
705            T3: fidl::encoding::Encode<i32, D>,
706            T4: fidl::encoding::Encode<u32, D>,
707            T5: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>, D>,
708            T6: fidl::encoding::Encode<fidl::encoding::BoundedString<32768>, D>,
709        > fidl::encoding::Encode<LogMessage, D> for (T0, T1, T2, T3, T4, T5, T6)
710    {
711        #[inline]
712        unsafe fn encode(
713            self,
714            encoder: &mut fidl::encoding::Encoder<'_, D>,
715            offset: usize,
716            depth: fidl::encoding::Depth,
717        ) -> fidl::Result<()> {
718            encoder.debug_check_bounds::<LogMessage>(offset);
719            // Zero out padding regions. There's no need to apply masks
720            // because the unmasked parts will be overwritten by fields.
721            // Write the fields.
722            self.0.encode(encoder, offset + 0, depth)?;
723            self.1.encode(encoder, offset + 8, depth)?;
724            self.2.encode(encoder, offset + 16, depth)?;
725            self.3.encode(encoder, offset + 24, depth)?;
726            self.4.encode(encoder, offset + 28, depth)?;
727            self.5.encode(encoder, offset + 32, depth)?;
728            self.6.encode(encoder, offset + 48, depth)?;
729            Ok(())
730        }
731    }
732
733    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogMessage {
734        #[inline(always)]
735        fn new_empty() -> Self {
736            Self {
737                pid: fidl::new_empty!(u64, D),
738                tid: fidl::new_empty!(u64, D),
739                time: fidl::new_empty!(fidl::BootInstant, D),
740                severity: fidl::new_empty!(i32, D),
741                dropped_logs: fidl::new_empty!(u32, D),
742                tags: fidl::new_empty!(
743                    fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
744                    D
745                ),
746                msg: fidl::new_empty!(fidl::encoding::BoundedString<32768>, D),
747            }
748        }
749
750        #[inline]
751        unsafe fn decode(
752            &mut self,
753            decoder: &mut fidl::encoding::Decoder<'_, D>,
754            offset: usize,
755            _depth: fidl::encoding::Depth,
756        ) -> fidl::Result<()> {
757            decoder.debug_check_bounds::<Self>(offset);
758            // Verify that padding bytes are zero.
759            fidl::decode!(u64, D, &mut self.pid, decoder, offset + 0, _depth)?;
760            fidl::decode!(u64, D, &mut self.tid, decoder, offset + 8, _depth)?;
761            fidl::decode!(fidl::BootInstant, D, &mut self.time, decoder, offset + 16, _depth)?;
762            fidl::decode!(i32, D, &mut self.severity, decoder, offset + 24, _depth)?;
763            fidl::decode!(u32, D, &mut self.dropped_logs, decoder, offset + 28, _depth)?;
764            fidl::decode!(
765                fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
766                D,
767                &mut self.tags,
768                decoder,
769                offset + 32,
770                _depth
771            )?;
772            fidl::decode!(
773                fidl::encoding::BoundedString<32768>,
774                D,
775                &mut self.msg,
776                decoder,
777                offset + 48,
778                _depth
779            )?;
780            Ok(())
781        }
782    }
783
784    impl fidl::encoding::ValueTypeMarker for LogSinkWaitForInterestChangeResponse {
785        type Borrowed<'a> = &'a Self;
786        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
787            value
788        }
789    }
790
791    unsafe impl fidl::encoding::TypeMarker for LogSinkWaitForInterestChangeResponse {
792        type Owned = Self;
793
794        #[inline(always)]
795        fn inline_align(_context: fidl::encoding::Context) -> usize {
796            8
797        }
798
799        #[inline(always)]
800        fn inline_size(_context: fidl::encoding::Context) -> usize {
801            16
802        }
803    }
804
805    unsafe impl<D: fidl::encoding::ResourceDialect>
806        fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, D>
807        for &LogSinkWaitForInterestChangeResponse
808    {
809        #[inline]
810        unsafe fn encode(
811            self,
812            encoder: &mut fidl::encoding::Encoder<'_, D>,
813            offset: usize,
814            _depth: fidl::encoding::Depth,
815        ) -> fidl::Result<()> {
816            encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
817            // Delegate to tuple encoding.
818            fidl::encoding::Encode::<LogSinkWaitForInterestChangeResponse, D>::encode(
819                (
820                    <fidl_fuchsia_diagnostics_types__common::Interest as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
821                ),
822                encoder, offset, _depth
823            )
824        }
825    }
826    unsafe impl<
827            D: fidl::encoding::ResourceDialect,
828            T0: fidl::encoding::Encode<fidl_fuchsia_diagnostics_types__common::Interest, D>,
829        > fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, D> for (T0,)
830    {
831        #[inline]
832        unsafe fn encode(
833            self,
834            encoder: &mut fidl::encoding::Encoder<'_, D>,
835            offset: usize,
836            depth: fidl::encoding::Depth,
837        ) -> fidl::Result<()> {
838            encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
839            // Zero out padding regions. There's no need to apply masks
840            // because the unmasked parts will be overwritten by fields.
841            // Write the fields.
842            self.0.encode(encoder, offset + 0, depth)?;
843            Ok(())
844        }
845    }
846
847    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
848        for LogSinkWaitForInterestChangeResponse
849    {
850        #[inline(always)]
851        fn new_empty() -> Self {
852            Self { data: fidl::new_empty!(fidl_fuchsia_diagnostics_types__common::Interest, D) }
853        }
854
855        #[inline]
856        unsafe fn decode(
857            &mut self,
858            decoder: &mut fidl::encoding::Decoder<'_, D>,
859            offset: usize,
860            _depth: fidl::encoding::Depth,
861        ) -> fidl::Result<()> {
862            decoder.debug_check_bounds::<Self>(offset);
863            // Verify that padding bytes are zero.
864            fidl::decode!(
865                fidl_fuchsia_diagnostics_types__common::Interest,
866                D,
867                &mut self.data,
868                decoder,
869                offset + 0,
870                _depth
871            )?;
872            Ok(())
873        }
874    }
875}