Skip to main content

fidl_fuchsia_tracing_provider__common/
fidl_fuchsia_tracing_provider__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/// The maximum length of an alert name.
12pub const MAX_ALERT_NAME_LENGTH: u32 = 14;
13
14#[derive(Clone, Debug, PartialEq)]
15pub struct ProviderGetKnownCategoriesResponse {
16    pub categories: Vec<fidl_fuchsia_tracing__common::KnownCategory>,
17}
18
19impl fidl::Persistable for ProviderGetKnownCategoriesResponse {}
20
21#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct ProviderStartRequest {
23    pub options: StartOptions,
24}
25
26impl fidl::Persistable for ProviderStartRequest {}
27
28#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29#[repr(C)]
30pub struct ProviderV2NotifyBufferSavedRequest {
31    /// The "wrapped count", which is a count of the number of times
32    /// a buffer has filled.
33    pub wrapped_count: u32,
34    /// current offset in the durable buffer
35    pub durable_data_end: u64,
36}
37
38impl fidl::Persistable for ProviderV2NotifyBufferSavedRequest {}
39
40#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41pub struct ProviderV2OnAlertRequest {
42    pub name: String,
43}
44
45impl fidl::Persistable for ProviderV2OnAlertRequest {}
46
47#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48#[repr(C)]
49pub struct ProviderV2OnSaveBufferRequest {
50    /// The "wrapped count", which is a count of the number of times
51    /// a buffer has filled.
52    pub wrapped_count: u32,
53    /// current offset in the durable buffer
54    pub durable_data_end: u64,
55}
56
57impl fidl::Persistable for ProviderV2OnSaveBufferRequest {}
58
59#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct ProviderV2StartRequest {
61    pub options: StartOptions,
62}
63
64impl fidl::Persistable for ProviderV2StartRequest {}
65
66#[derive(Clone, Debug, PartialEq)]
67pub struct ProviderV2GetKnownCategoriesResponse {
68    pub categories: Vec<fidl_fuchsia_tracing__common::KnownCategory>,
69}
70
71impl fidl::Persistable for ProviderV2GetKnownCategoriesResponse {}
72
73#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
74pub struct RegistryRegisterProviderSynchronouslyResponse {
75    pub s: i32,
76    pub started: bool,
77}
78
79impl fidl::Persistable for RegistryRegisterProviderSynchronouslyResponse {}
80
81#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
82pub struct RegistryRegisterV2SynchronouslyResponse {
83    /// true if tracing has already started, which is a hint to the provider
84    /// to wait for the Start() message before continuing if it wishes to
85    /// not drop trace records before Start() is received.
86    pub started: bool,
87}
88
89impl fidl::Persistable for RegistryRegisterV2SynchronouslyResponse {}
90
91/// Additional options to control tracing at start.
92#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93pub struct StartOptions {
94    /// Whether and how to clear the buffer when starting data collection.
95    /// This allows, for example, multiple Start/Stop trace runs to be
96    /// collected in the same buffer.
97    pub buffer_disposition: fidl_fuchsia_tracing__common::BufferDisposition,
98    /// The trace categories to add to the initial set provided in
99    /// `ProviderConfig`.
100    pub additional_categories: Vec<String>,
101}
102
103impl fidl::Persistable for StartOptions {}
104
105pub mod provider_ordinals {
106    pub const INITIALIZE: u64 = 0x9e31667d7b180f7;
107    pub const START: u64 = 0x5bae2b60be66a815;
108    pub const STOP: u64 = 0x133df8ebb1897df0;
109    pub const TERMINATE: u64 = 0x6b5564032f2726b1;
110    pub const GET_KNOWN_CATEGORIES: u64 = 0x5f5b0ad77af3f886;
111}
112
113pub mod provider_v2_ordinals {
114    pub const INITIALIZE: u64 = 0x5402006f01edb9d1;
115    pub const START: u64 = 0x71f85bc863e60f17;
116    pub const STOP: u64 = 0x16df330a02562aa2;
117    pub const TERMINATE: u64 = 0x12a542af1614219f;
118    pub const GET_KNOWN_CATEGORIES: u64 = 0x24780beab3613747;
119    pub const ON_SAVE_BUFFER: u64 = 0x7d7c8f770a3c760d;
120    pub const ON_ALERT: u64 = 0x23ecc93ef5106a2;
121    pub const NOTIFY_BUFFER_SAVED: u64 = 0x6a0a63b2e2d0dfe1;
122    pub const FLUSH: u64 = 0x635c3e76e1de8d29;
123}
124
125pub mod registry_ordinals {
126    pub const REGISTER_PROVIDER: u64 = 0x75bcae3dfa08479c;
127    pub const REGISTER_PROVIDER_SYNCHRONOUSLY: u64 = 0x4835ed419a808f16;
128    pub const REGISTER_V2: u64 = 0x2edaed92cc184b34;
129    pub const REGISTER_V2_SYNCHRONOUSLY: u64 = 0x3da2ff760b018196;
130}
131
132mod internal {
133    use super::*;
134
135    impl fidl::encoding::ValueTypeMarker for ProviderGetKnownCategoriesResponse {
136        type Borrowed<'a> = &'a Self;
137        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
138            value
139        }
140    }
141
142    unsafe impl fidl::encoding::TypeMarker for ProviderGetKnownCategoriesResponse {
143        type Owned = Self;
144
145        #[inline(always)]
146        fn inline_align(_context: fidl::encoding::Context) -> usize {
147            8
148        }
149
150        #[inline(always)]
151        fn inline_size(_context: fidl::encoding::Context) -> usize {
152            16
153        }
154    }
155
156    unsafe impl<D: fidl::encoding::ResourceDialect>
157        fidl::encoding::Encode<ProviderGetKnownCategoriesResponse, D>
158        for &ProviderGetKnownCategoriesResponse
159    {
160        #[inline]
161        unsafe fn encode(
162            self,
163            encoder: &mut fidl::encoding::Encoder<'_, D>,
164            offset: usize,
165            _depth: fidl::encoding::Depth,
166        ) -> fidl::Result<()> {
167            encoder.debug_check_bounds::<ProviderGetKnownCategoriesResponse>(offset);
168            // Delegate to tuple encoding.
169            fidl::encoding::Encode::<ProviderGetKnownCategoriesResponse, D>::encode(
170                (
171                    <fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000> as fidl::encoding::ValueTypeMarker>::borrow(&self.categories),
172                ),
173                encoder, offset, _depth
174            )
175        }
176    }
177    unsafe impl<
178        D: fidl::encoding::ResourceDialect,
179        T0: fidl::encoding::Encode<
180                fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000>,
181                D,
182            >,
183    > fidl::encoding::Encode<ProviderGetKnownCategoriesResponse, D> for (T0,)
184    {
185        #[inline]
186        unsafe fn encode(
187            self,
188            encoder: &mut fidl::encoding::Encoder<'_, D>,
189            offset: usize,
190            depth: fidl::encoding::Depth,
191        ) -> fidl::Result<()> {
192            encoder.debug_check_bounds::<ProviderGetKnownCategoriesResponse>(offset);
193            // Zero out padding regions. There's no need to apply masks
194            // because the unmasked parts will be overwritten by fields.
195            // Write the fields.
196            self.0.encode(encoder, offset + 0, depth)?;
197            Ok(())
198        }
199    }
200
201    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
202        for ProviderGetKnownCategoriesResponse
203    {
204        #[inline(always)]
205        fn new_empty() -> Self {
206            Self {
207                categories: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000>, D),
208            }
209        }
210
211        #[inline]
212        unsafe fn decode(
213            &mut self,
214            decoder: &mut fidl::encoding::Decoder<'_, D>,
215            offset: usize,
216            _depth: fidl::encoding::Depth,
217        ) -> fidl::Result<()> {
218            decoder.debug_check_bounds::<Self>(offset);
219            // Verify that padding bytes are zero.
220            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000>, D, &mut self.categories, decoder, offset + 0, _depth)?;
221            Ok(())
222        }
223    }
224
225    impl fidl::encoding::ValueTypeMarker for ProviderStartRequest {
226        type Borrowed<'a> = &'a Self;
227        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
228            value
229        }
230    }
231
232    unsafe impl fidl::encoding::TypeMarker for ProviderStartRequest {
233        type Owned = Self;
234
235        #[inline(always)]
236        fn inline_align(_context: fidl::encoding::Context) -> usize {
237            8
238        }
239
240        #[inline(always)]
241        fn inline_size(_context: fidl::encoding::Context) -> usize {
242            24
243        }
244    }
245
246    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ProviderStartRequest, D>
247        for &ProviderStartRequest
248    {
249        #[inline]
250        unsafe fn encode(
251            self,
252            encoder: &mut fidl::encoding::Encoder<'_, D>,
253            offset: usize,
254            _depth: fidl::encoding::Depth,
255        ) -> fidl::Result<()> {
256            encoder.debug_check_bounds::<ProviderStartRequest>(offset);
257            // Delegate to tuple encoding.
258            fidl::encoding::Encode::<ProviderStartRequest, D>::encode(
259                (<StartOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
260                encoder,
261                offset,
262                _depth,
263            )
264        }
265    }
266    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StartOptions, D>>
267        fidl::encoding::Encode<ProviderStartRequest, D> for (T0,)
268    {
269        #[inline]
270        unsafe fn encode(
271            self,
272            encoder: &mut fidl::encoding::Encoder<'_, D>,
273            offset: usize,
274            depth: fidl::encoding::Depth,
275        ) -> fidl::Result<()> {
276            encoder.debug_check_bounds::<ProviderStartRequest>(offset);
277            // Zero out padding regions. There's no need to apply masks
278            // because the unmasked parts will be overwritten by fields.
279            // Write the fields.
280            self.0.encode(encoder, offset + 0, depth)?;
281            Ok(())
282        }
283    }
284
285    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProviderStartRequest {
286        #[inline(always)]
287        fn new_empty() -> Self {
288            Self { options: fidl::new_empty!(StartOptions, D) }
289        }
290
291        #[inline]
292        unsafe fn decode(
293            &mut self,
294            decoder: &mut fidl::encoding::Decoder<'_, D>,
295            offset: usize,
296            _depth: fidl::encoding::Depth,
297        ) -> fidl::Result<()> {
298            decoder.debug_check_bounds::<Self>(offset);
299            // Verify that padding bytes are zero.
300            fidl::decode!(StartOptions, D, &mut self.options, decoder, offset + 0, _depth)?;
301            Ok(())
302        }
303    }
304
305    impl fidl::encoding::ValueTypeMarker for ProviderV2NotifyBufferSavedRequest {
306        type Borrowed<'a> = &'a Self;
307        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
308            value
309        }
310    }
311
312    unsafe impl fidl::encoding::TypeMarker for ProviderV2NotifyBufferSavedRequest {
313        type Owned = Self;
314
315        #[inline(always)]
316        fn inline_align(_context: fidl::encoding::Context) -> usize {
317            8
318        }
319
320        #[inline(always)]
321        fn inline_size(_context: fidl::encoding::Context) -> usize {
322            16
323        }
324    }
325
326    unsafe impl<D: fidl::encoding::ResourceDialect>
327        fidl::encoding::Encode<ProviderV2NotifyBufferSavedRequest, D>
328        for &ProviderV2NotifyBufferSavedRequest
329    {
330        #[inline]
331        unsafe fn encode(
332            self,
333            encoder: &mut fidl::encoding::Encoder<'_, D>,
334            offset: usize,
335            _depth: fidl::encoding::Depth,
336        ) -> fidl::Result<()> {
337            encoder.debug_check_bounds::<ProviderV2NotifyBufferSavedRequest>(offset);
338            unsafe {
339                // Copy the object into the buffer.
340                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
341                (buf_ptr as *mut ProviderV2NotifyBufferSavedRequest)
342                    .write_unaligned((self as *const ProviderV2NotifyBufferSavedRequest).read());
343                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
344                // done second because the memcpy will write garbage to these bytes.
345                let padding_ptr = buf_ptr.offset(0) as *mut u64;
346                let padding_mask = 0xffffffff00000000u64;
347                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
348            }
349            Ok(())
350        }
351    }
352    unsafe impl<
353        D: fidl::encoding::ResourceDialect,
354        T0: fidl::encoding::Encode<u32, D>,
355        T1: fidl::encoding::Encode<u64, D>,
356    > fidl::encoding::Encode<ProviderV2NotifyBufferSavedRequest, D> for (T0, T1)
357    {
358        #[inline]
359        unsafe fn encode(
360            self,
361            encoder: &mut fidl::encoding::Encoder<'_, D>,
362            offset: usize,
363            depth: fidl::encoding::Depth,
364        ) -> fidl::Result<()> {
365            encoder.debug_check_bounds::<ProviderV2NotifyBufferSavedRequest>(offset);
366            // Zero out padding regions. There's no need to apply masks
367            // because the unmasked parts will be overwritten by fields.
368            unsafe {
369                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
370                (ptr as *mut u64).write_unaligned(0);
371            }
372            // Write the fields.
373            self.0.encode(encoder, offset + 0, depth)?;
374            self.1.encode(encoder, offset + 8, depth)?;
375            Ok(())
376        }
377    }
378
379    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
380        for ProviderV2NotifyBufferSavedRequest
381    {
382        #[inline(always)]
383        fn new_empty() -> Self {
384            Self {
385                wrapped_count: fidl::new_empty!(u32, D),
386                durable_data_end: fidl::new_empty!(u64, D),
387            }
388        }
389
390        #[inline]
391        unsafe fn decode(
392            &mut self,
393            decoder: &mut fidl::encoding::Decoder<'_, D>,
394            offset: usize,
395            _depth: fidl::encoding::Depth,
396        ) -> fidl::Result<()> {
397            decoder.debug_check_bounds::<Self>(offset);
398            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
399            // Verify that padding bytes are zero.
400            let ptr = unsafe { buf_ptr.offset(0) };
401            let padval = unsafe { (ptr as *const u64).read_unaligned() };
402            let mask = 0xffffffff00000000u64;
403            let maskedval = padval & mask;
404            if maskedval != 0 {
405                return Err(fidl::Error::NonZeroPadding {
406                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
407                });
408            }
409            // Copy from the buffer into the object.
410            unsafe {
411                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
412            }
413            Ok(())
414        }
415    }
416
417    impl fidl::encoding::ValueTypeMarker for ProviderV2OnAlertRequest {
418        type Borrowed<'a> = &'a Self;
419        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
420            value
421        }
422    }
423
424    unsafe impl fidl::encoding::TypeMarker for ProviderV2OnAlertRequest {
425        type Owned = Self;
426
427        #[inline(always)]
428        fn inline_align(_context: fidl::encoding::Context) -> usize {
429            8
430        }
431
432        #[inline(always)]
433        fn inline_size(_context: fidl::encoding::Context) -> usize {
434            16
435        }
436    }
437
438    unsafe impl<D: fidl::encoding::ResourceDialect>
439        fidl::encoding::Encode<ProviderV2OnAlertRequest, D> for &ProviderV2OnAlertRequest
440    {
441        #[inline]
442        unsafe fn encode(
443            self,
444            encoder: &mut fidl::encoding::Encoder<'_, D>,
445            offset: usize,
446            _depth: fidl::encoding::Depth,
447        ) -> fidl::Result<()> {
448            encoder.debug_check_bounds::<ProviderV2OnAlertRequest>(offset);
449            // Delegate to tuple encoding.
450            fidl::encoding::Encode::<ProviderV2OnAlertRequest, D>::encode(
451                (<fidl::encoding::BoundedString<14> as fidl::encoding::ValueTypeMarker>::borrow(
452                    &self.name,
453                ),),
454                encoder,
455                offset,
456                _depth,
457            )
458        }
459    }
460    unsafe impl<
461        D: fidl::encoding::ResourceDialect,
462        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<14>, D>,
463    > fidl::encoding::Encode<ProviderV2OnAlertRequest, D> for (T0,)
464    {
465        #[inline]
466        unsafe fn encode(
467            self,
468            encoder: &mut fidl::encoding::Encoder<'_, D>,
469            offset: usize,
470            depth: fidl::encoding::Depth,
471        ) -> fidl::Result<()> {
472            encoder.debug_check_bounds::<ProviderV2OnAlertRequest>(offset);
473            // Zero out padding regions. There's no need to apply masks
474            // because the unmasked parts will be overwritten by fields.
475            // Write the fields.
476            self.0.encode(encoder, offset + 0, depth)?;
477            Ok(())
478        }
479    }
480
481    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
482        for ProviderV2OnAlertRequest
483    {
484        #[inline(always)]
485        fn new_empty() -> Self {
486            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<14>, D) }
487        }
488
489        #[inline]
490        unsafe fn decode(
491            &mut self,
492            decoder: &mut fidl::encoding::Decoder<'_, D>,
493            offset: usize,
494            _depth: fidl::encoding::Depth,
495        ) -> fidl::Result<()> {
496            decoder.debug_check_bounds::<Self>(offset);
497            // Verify that padding bytes are zero.
498            fidl::decode!(
499                fidl::encoding::BoundedString<14>,
500                D,
501                &mut self.name,
502                decoder,
503                offset + 0,
504                _depth
505            )?;
506            Ok(())
507        }
508    }
509
510    impl fidl::encoding::ValueTypeMarker for ProviderV2OnSaveBufferRequest {
511        type Borrowed<'a> = &'a Self;
512        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
513            value
514        }
515    }
516
517    unsafe impl fidl::encoding::TypeMarker for ProviderV2OnSaveBufferRequest {
518        type Owned = Self;
519
520        #[inline(always)]
521        fn inline_align(_context: fidl::encoding::Context) -> usize {
522            8
523        }
524
525        #[inline(always)]
526        fn inline_size(_context: fidl::encoding::Context) -> usize {
527            16
528        }
529    }
530
531    unsafe impl<D: fidl::encoding::ResourceDialect>
532        fidl::encoding::Encode<ProviderV2OnSaveBufferRequest, D>
533        for &ProviderV2OnSaveBufferRequest
534    {
535        #[inline]
536        unsafe fn encode(
537            self,
538            encoder: &mut fidl::encoding::Encoder<'_, D>,
539            offset: usize,
540            _depth: fidl::encoding::Depth,
541        ) -> fidl::Result<()> {
542            encoder.debug_check_bounds::<ProviderV2OnSaveBufferRequest>(offset);
543            unsafe {
544                // Copy the object into the buffer.
545                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
546                (buf_ptr as *mut ProviderV2OnSaveBufferRequest)
547                    .write_unaligned((self as *const ProviderV2OnSaveBufferRequest).read());
548                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
549                // done second because the memcpy will write garbage to these bytes.
550                let padding_ptr = buf_ptr.offset(0) as *mut u64;
551                let padding_mask = 0xffffffff00000000u64;
552                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
553            }
554            Ok(())
555        }
556    }
557    unsafe impl<
558        D: fidl::encoding::ResourceDialect,
559        T0: fidl::encoding::Encode<u32, D>,
560        T1: fidl::encoding::Encode<u64, D>,
561    > fidl::encoding::Encode<ProviderV2OnSaveBufferRequest, D> for (T0, T1)
562    {
563        #[inline]
564        unsafe fn encode(
565            self,
566            encoder: &mut fidl::encoding::Encoder<'_, D>,
567            offset: usize,
568            depth: fidl::encoding::Depth,
569        ) -> fidl::Result<()> {
570            encoder.debug_check_bounds::<ProviderV2OnSaveBufferRequest>(offset);
571            // Zero out padding regions. There's no need to apply masks
572            // because the unmasked parts will be overwritten by fields.
573            unsafe {
574                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
575                (ptr as *mut u64).write_unaligned(0);
576            }
577            // Write the fields.
578            self.0.encode(encoder, offset + 0, depth)?;
579            self.1.encode(encoder, offset + 8, depth)?;
580            Ok(())
581        }
582    }
583
584    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
585        for ProviderV2OnSaveBufferRequest
586    {
587        #[inline(always)]
588        fn new_empty() -> Self {
589            Self {
590                wrapped_count: fidl::new_empty!(u32, D),
591                durable_data_end: fidl::new_empty!(u64, D),
592            }
593        }
594
595        #[inline]
596        unsafe fn decode(
597            &mut self,
598            decoder: &mut fidl::encoding::Decoder<'_, D>,
599            offset: usize,
600            _depth: fidl::encoding::Depth,
601        ) -> fidl::Result<()> {
602            decoder.debug_check_bounds::<Self>(offset);
603            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
604            // Verify that padding bytes are zero.
605            let ptr = unsafe { buf_ptr.offset(0) };
606            let padval = unsafe { (ptr as *const u64).read_unaligned() };
607            let mask = 0xffffffff00000000u64;
608            let maskedval = padval & mask;
609            if maskedval != 0 {
610                return Err(fidl::Error::NonZeroPadding {
611                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
612                });
613            }
614            // Copy from the buffer into the object.
615            unsafe {
616                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
617            }
618            Ok(())
619        }
620    }
621
622    impl fidl::encoding::ValueTypeMarker for ProviderV2StartRequest {
623        type Borrowed<'a> = &'a Self;
624        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
625            value
626        }
627    }
628
629    unsafe impl fidl::encoding::TypeMarker for ProviderV2StartRequest {
630        type Owned = Self;
631
632        #[inline(always)]
633        fn inline_align(_context: fidl::encoding::Context) -> usize {
634            8
635        }
636
637        #[inline(always)]
638        fn inline_size(_context: fidl::encoding::Context) -> usize {
639            24
640        }
641    }
642
643    unsafe impl<D: fidl::encoding::ResourceDialect>
644        fidl::encoding::Encode<ProviderV2StartRequest, D> for &ProviderV2StartRequest
645    {
646        #[inline]
647        unsafe fn encode(
648            self,
649            encoder: &mut fidl::encoding::Encoder<'_, D>,
650            offset: usize,
651            _depth: fidl::encoding::Depth,
652        ) -> fidl::Result<()> {
653            encoder.debug_check_bounds::<ProviderV2StartRequest>(offset);
654            // Delegate to tuple encoding.
655            fidl::encoding::Encode::<ProviderV2StartRequest, D>::encode(
656                (<StartOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
657                encoder,
658                offset,
659                _depth,
660            )
661        }
662    }
663    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StartOptions, D>>
664        fidl::encoding::Encode<ProviderV2StartRequest, D> for (T0,)
665    {
666        #[inline]
667        unsafe fn encode(
668            self,
669            encoder: &mut fidl::encoding::Encoder<'_, D>,
670            offset: usize,
671            depth: fidl::encoding::Depth,
672        ) -> fidl::Result<()> {
673            encoder.debug_check_bounds::<ProviderV2StartRequest>(offset);
674            // Zero out padding regions. There's no need to apply masks
675            // because the unmasked parts will be overwritten by fields.
676            // Write the fields.
677            self.0.encode(encoder, offset + 0, depth)?;
678            Ok(())
679        }
680    }
681
682    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
683        for ProviderV2StartRequest
684    {
685        #[inline(always)]
686        fn new_empty() -> Self {
687            Self { options: fidl::new_empty!(StartOptions, D) }
688        }
689
690        #[inline]
691        unsafe fn decode(
692            &mut self,
693            decoder: &mut fidl::encoding::Decoder<'_, D>,
694            offset: usize,
695            _depth: fidl::encoding::Depth,
696        ) -> fidl::Result<()> {
697            decoder.debug_check_bounds::<Self>(offset);
698            // Verify that padding bytes are zero.
699            fidl::decode!(StartOptions, D, &mut self.options, decoder, offset + 0, _depth)?;
700            Ok(())
701        }
702    }
703
704    impl fidl::encoding::ValueTypeMarker for ProviderV2GetKnownCategoriesResponse {
705        type Borrowed<'a> = &'a Self;
706        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
707            value
708        }
709    }
710
711    unsafe impl fidl::encoding::TypeMarker for ProviderV2GetKnownCategoriesResponse {
712        type Owned = Self;
713
714        #[inline(always)]
715        fn inline_align(_context: fidl::encoding::Context) -> usize {
716            8
717        }
718
719        #[inline(always)]
720        fn inline_size(_context: fidl::encoding::Context) -> usize {
721            16
722        }
723    }
724
725    unsafe impl<D: fidl::encoding::ResourceDialect>
726        fidl::encoding::Encode<ProviderV2GetKnownCategoriesResponse, D>
727        for &ProviderV2GetKnownCategoriesResponse
728    {
729        #[inline]
730        unsafe fn encode(
731            self,
732            encoder: &mut fidl::encoding::Encoder<'_, D>,
733            offset: usize,
734            _depth: fidl::encoding::Depth,
735        ) -> fidl::Result<()> {
736            encoder.debug_check_bounds::<ProviderV2GetKnownCategoriesResponse>(offset);
737            // Delegate to tuple encoding.
738            fidl::encoding::Encode::<ProviderV2GetKnownCategoriesResponse, D>::encode(
739                (
740                    <fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000> as fidl::encoding::ValueTypeMarker>::borrow(&self.categories),
741                ),
742                encoder, offset, _depth
743            )
744        }
745    }
746    unsafe impl<
747        D: fidl::encoding::ResourceDialect,
748        T0: fidl::encoding::Encode<
749                fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000>,
750                D,
751            >,
752    > fidl::encoding::Encode<ProviderV2GetKnownCategoriesResponse, D> for (T0,)
753    {
754        #[inline]
755        unsafe fn encode(
756            self,
757            encoder: &mut fidl::encoding::Encoder<'_, D>,
758            offset: usize,
759            depth: fidl::encoding::Depth,
760        ) -> fidl::Result<()> {
761            encoder.debug_check_bounds::<ProviderV2GetKnownCategoriesResponse>(offset);
762            // Zero out padding regions. There's no need to apply masks
763            // because the unmasked parts will be overwritten by fields.
764            // Write the fields.
765            self.0.encode(encoder, offset + 0, depth)?;
766            Ok(())
767        }
768    }
769
770    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
771        for ProviderV2GetKnownCategoriesResponse
772    {
773        #[inline(always)]
774        fn new_empty() -> Self {
775            Self {
776                categories: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000>, D),
777            }
778        }
779
780        #[inline]
781        unsafe fn decode(
782            &mut self,
783            decoder: &mut fidl::encoding::Decoder<'_, D>,
784            offset: usize,
785            _depth: fidl::encoding::Depth,
786        ) -> fidl::Result<()> {
787            decoder.debug_check_bounds::<Self>(offset);
788            // Verify that padding bytes are zero.
789            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_tracing__common::KnownCategory, 5000>, D, &mut self.categories, decoder, offset + 0, _depth)?;
790            Ok(())
791        }
792    }
793
794    impl fidl::encoding::ValueTypeMarker for RegistryRegisterProviderSynchronouslyResponse {
795        type Borrowed<'a> = &'a Self;
796        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
797            value
798        }
799    }
800
801    unsafe impl fidl::encoding::TypeMarker for RegistryRegisterProviderSynchronouslyResponse {
802        type Owned = Self;
803
804        #[inline(always)]
805        fn inline_align(_context: fidl::encoding::Context) -> usize {
806            4
807        }
808
809        #[inline(always)]
810        fn inline_size(_context: fidl::encoding::Context) -> usize {
811            8
812        }
813    }
814
815    unsafe impl<D: fidl::encoding::ResourceDialect>
816        fidl::encoding::Encode<RegistryRegisterProviderSynchronouslyResponse, D>
817        for &RegistryRegisterProviderSynchronouslyResponse
818    {
819        #[inline]
820        unsafe fn encode(
821            self,
822            encoder: &mut fidl::encoding::Encoder<'_, D>,
823            offset: usize,
824            _depth: fidl::encoding::Depth,
825        ) -> fidl::Result<()> {
826            encoder.debug_check_bounds::<RegistryRegisterProviderSynchronouslyResponse>(offset);
827            // Delegate to tuple encoding.
828            fidl::encoding::Encode::<RegistryRegisterProviderSynchronouslyResponse, D>::encode(
829                (
830                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
831                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.started),
832                ),
833                encoder,
834                offset,
835                _depth,
836            )
837        }
838    }
839    unsafe impl<
840        D: fidl::encoding::ResourceDialect,
841        T0: fidl::encoding::Encode<i32, D>,
842        T1: fidl::encoding::Encode<bool, D>,
843    > fidl::encoding::Encode<RegistryRegisterProviderSynchronouslyResponse, D> for (T0, T1)
844    {
845        #[inline]
846        unsafe fn encode(
847            self,
848            encoder: &mut fidl::encoding::Encoder<'_, D>,
849            offset: usize,
850            depth: fidl::encoding::Depth,
851        ) -> fidl::Result<()> {
852            encoder.debug_check_bounds::<RegistryRegisterProviderSynchronouslyResponse>(offset);
853            // Zero out padding regions. There's no need to apply masks
854            // because the unmasked parts will be overwritten by fields.
855            unsafe {
856                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
857                (ptr as *mut u32).write_unaligned(0);
858            }
859            // Write the fields.
860            self.0.encode(encoder, offset + 0, depth)?;
861            self.1.encode(encoder, offset + 4, depth)?;
862            Ok(())
863        }
864    }
865
866    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
867        for RegistryRegisterProviderSynchronouslyResponse
868    {
869        #[inline(always)]
870        fn new_empty() -> Self {
871            Self { s: fidl::new_empty!(i32, D), started: fidl::new_empty!(bool, D) }
872        }
873
874        #[inline]
875        unsafe fn decode(
876            &mut self,
877            decoder: &mut fidl::encoding::Decoder<'_, D>,
878            offset: usize,
879            _depth: fidl::encoding::Depth,
880        ) -> fidl::Result<()> {
881            decoder.debug_check_bounds::<Self>(offset);
882            // Verify that padding bytes are zero.
883            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
884            let padval = unsafe { (ptr as *const u32).read_unaligned() };
885            let mask = 0xffffff00u32;
886            let maskedval = padval & mask;
887            if maskedval != 0 {
888                return Err(fidl::Error::NonZeroPadding {
889                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
890                });
891            }
892            fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
893            fidl::decode!(bool, D, &mut self.started, decoder, offset + 4, _depth)?;
894            Ok(())
895        }
896    }
897
898    impl fidl::encoding::ValueTypeMarker for RegistryRegisterV2SynchronouslyResponse {
899        type Borrowed<'a> = &'a Self;
900        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
901            value
902        }
903    }
904
905    unsafe impl fidl::encoding::TypeMarker for RegistryRegisterV2SynchronouslyResponse {
906        type Owned = Self;
907
908        #[inline(always)]
909        fn inline_align(_context: fidl::encoding::Context) -> usize {
910            1
911        }
912
913        #[inline(always)]
914        fn inline_size(_context: fidl::encoding::Context) -> usize {
915            1
916        }
917    }
918
919    unsafe impl<D: fidl::encoding::ResourceDialect>
920        fidl::encoding::Encode<RegistryRegisterV2SynchronouslyResponse, D>
921        for &RegistryRegisterV2SynchronouslyResponse
922    {
923        #[inline]
924        unsafe fn encode(
925            self,
926            encoder: &mut fidl::encoding::Encoder<'_, D>,
927            offset: usize,
928            _depth: fidl::encoding::Depth,
929        ) -> fidl::Result<()> {
930            encoder.debug_check_bounds::<RegistryRegisterV2SynchronouslyResponse>(offset);
931            // Delegate to tuple encoding.
932            fidl::encoding::Encode::<RegistryRegisterV2SynchronouslyResponse, D>::encode(
933                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.started),),
934                encoder,
935                offset,
936                _depth,
937            )
938        }
939    }
940    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
941        fidl::encoding::Encode<RegistryRegisterV2SynchronouslyResponse, D> for (T0,)
942    {
943        #[inline]
944        unsafe fn encode(
945            self,
946            encoder: &mut fidl::encoding::Encoder<'_, D>,
947            offset: usize,
948            depth: fidl::encoding::Depth,
949        ) -> fidl::Result<()> {
950            encoder.debug_check_bounds::<RegistryRegisterV2SynchronouslyResponse>(offset);
951            // Zero out padding regions. There's no need to apply masks
952            // because the unmasked parts will be overwritten by fields.
953            // Write the fields.
954            self.0.encode(encoder, offset + 0, depth)?;
955            Ok(())
956        }
957    }
958
959    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
960        for RegistryRegisterV2SynchronouslyResponse
961    {
962        #[inline(always)]
963        fn new_empty() -> Self {
964            Self { started: fidl::new_empty!(bool, D) }
965        }
966
967        #[inline]
968        unsafe fn decode(
969            &mut self,
970            decoder: &mut fidl::encoding::Decoder<'_, D>,
971            offset: usize,
972            _depth: fidl::encoding::Depth,
973        ) -> fidl::Result<()> {
974            decoder.debug_check_bounds::<Self>(offset);
975            // Verify that padding bytes are zero.
976            fidl::decode!(bool, D, &mut self.started, decoder, offset + 0, _depth)?;
977            Ok(())
978        }
979    }
980
981    impl fidl::encoding::ValueTypeMarker for StartOptions {
982        type Borrowed<'a> = &'a Self;
983        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
984            value
985        }
986    }
987
988    unsafe impl fidl::encoding::TypeMarker for StartOptions {
989        type Owned = Self;
990
991        #[inline(always)]
992        fn inline_align(_context: fidl::encoding::Context) -> usize {
993            8
994        }
995
996        #[inline(always)]
997        fn inline_size(_context: fidl::encoding::Context) -> usize {
998            24
999        }
1000    }
1001
1002    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartOptions, D>
1003        for &StartOptions
1004    {
1005        #[inline]
1006        unsafe fn encode(
1007            self,
1008            encoder: &mut fidl::encoding::Encoder<'_, D>,
1009            offset: usize,
1010            _depth: fidl::encoding::Depth,
1011        ) -> fidl::Result<()> {
1012            encoder.debug_check_bounds::<StartOptions>(offset);
1013            // Delegate to tuple encoding.
1014            fidl::encoding::Encode::<StartOptions, D>::encode(
1015                (
1016                    <fidl_fuchsia_tracing__common::BufferDisposition as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_disposition),
1017                    <fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 5000> as fidl::encoding::ValueTypeMarker>::borrow(&self.additional_categories),
1018                ),
1019                encoder, offset, _depth
1020            )
1021        }
1022    }
1023    unsafe impl<
1024        D: fidl::encoding::ResourceDialect,
1025        T0: fidl::encoding::Encode<fidl_fuchsia_tracing__common::BufferDisposition, D>,
1026        T1: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 5000>, D>,
1027    > fidl::encoding::Encode<StartOptions, D> for (T0, T1)
1028    {
1029        #[inline]
1030        unsafe fn encode(
1031            self,
1032            encoder: &mut fidl::encoding::Encoder<'_, D>,
1033            offset: usize,
1034            depth: fidl::encoding::Depth,
1035        ) -> fidl::Result<()> {
1036            encoder.debug_check_bounds::<StartOptions>(offset);
1037            // Zero out padding regions. There's no need to apply masks
1038            // because the unmasked parts will be overwritten by fields.
1039            unsafe {
1040                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1041                (ptr as *mut u64).write_unaligned(0);
1042            }
1043            // Write the fields.
1044            self.0.encode(encoder, offset + 0, depth)?;
1045            self.1.encode(encoder, offset + 8, depth)?;
1046            Ok(())
1047        }
1048    }
1049
1050    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartOptions {
1051        #[inline(always)]
1052        fn new_empty() -> Self {
1053            Self {
1054                buffer_disposition: fidl::new_empty!(
1055                    fidl_fuchsia_tracing__common::BufferDisposition,
1056                    D
1057                ),
1058                additional_categories: fidl::new_empty!(
1059                    fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 5000>,
1060                    D
1061                ),
1062            }
1063        }
1064
1065        #[inline]
1066        unsafe fn decode(
1067            &mut self,
1068            decoder: &mut fidl::encoding::Decoder<'_, D>,
1069            offset: usize,
1070            _depth: fidl::encoding::Depth,
1071        ) -> fidl::Result<()> {
1072            decoder.debug_check_bounds::<Self>(offset);
1073            // Verify that padding bytes are zero.
1074            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1075            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1076            let mask = 0xffffffffffffff00u64;
1077            let maskedval = padval & mask;
1078            if maskedval != 0 {
1079                return Err(fidl::Error::NonZeroPadding {
1080                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1081                });
1082            }
1083            fidl::decode!(
1084                fidl_fuchsia_tracing__common::BufferDisposition,
1085                D,
1086                &mut self.buffer_disposition,
1087                decoder,
1088                offset + 0,
1089                _depth
1090            )?;
1091            fidl::decode!(
1092                fidl::encoding::Vector<fidl::encoding::BoundedString<100>, 5000>,
1093                D,
1094                &mut self.additional_categories,
1095                decoder,
1096                offset + 8,
1097                _depth
1098            )?;
1099            Ok(())
1100        }
1101    }
1102}