1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type LogMessage = String;
12
13#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14pub enum ExitStatus {
15 Any,
17 Crash,
19 Clean,
21 #[doc(hidden)]
22 __SourceBreaking { unknown_ordinal: u32 },
23}
24
25#[macro_export]
27macro_rules! ExitStatusUnknown {
28 () => {
29 _
30 };
31}
32
33impl ExitStatus {
34 #[inline]
35 pub fn from_primitive(prim: u32) -> Option<Self> {
36 match prim {
37 0 => Some(Self::Any),
38 1 => Some(Self::Crash),
39 2 => Some(Self::Clean),
40 _ => None,
41 }
42 }
43
44 #[inline]
45 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
46 match prim {
47 0 => Self::Any,
48 1 => Self::Crash,
49 2 => Self::Clean,
50 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
51 }
52 }
53
54 #[inline]
55 pub fn unknown() -> Self {
56 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
57 }
58
59 #[inline]
60 pub const fn into_primitive(self) -> u32 {
61 match self {
62 Self::Any => 0,
63 Self::Crash => 1,
64 Self::Clean => 2,
65 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
66 }
67 }
68
69 #[inline]
70 pub fn is_unknown(&self) -> bool {
71 match self {
72 Self::__SourceBreaking { unknown_ordinal: _ } => true,
73 _ => false,
74 }
75 }
76}
77
78#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct InspectWriterRecordIntRequest {
80 pub key: String,
81 pub value: i64,
84}
85
86impl fidl::Persistable for InspectWriterRecordIntRequest {}
87
88#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
89pub struct InspectWriterRecordLazyValuesRequest {
90 pub key: String,
91}
92
93impl fidl::Persistable for InspectWriterRecordLazyValuesRequest {}
94
95#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
96pub struct InspectWriterRecordStringRequest {
97 pub key: String,
98 pub value: String,
99}
100
101impl fidl::Persistable for InspectWriterRecordStringRequest {}
102
103#[derive(Clone, Debug, PartialEq)]
104pub struct LazyInspectPuppetCommitRequest {
105 pub options: CommitOptions,
106}
107
108impl fidl::Persistable for LazyInspectPuppetCommitRequest {}
109
110#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111pub struct LogPuppetEprintlnRequest {
112 pub message: String,
113}
114
115impl fidl::Persistable for LogPuppetEprintlnRequest {}
116
117#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
118pub struct LogPuppetPrintlnRequest {
119 pub message: String,
120}
121
122impl fidl::Persistable for LogPuppetPrintlnRequest {}
123
124#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct PuppetCrashRequest {
126 pub message: String,
127}
128
129impl fidl::Persistable for PuppetCrashRequest {}
130
131#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
132pub struct PuppetRecordLazyValuesRequest {
133 pub key: String,
134}
135
136impl fidl::Persistable for PuppetRecordLazyValuesRequest {}
137
138#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct StopWatcherWatchComponentRequest {
140 pub moniker: String,
141 pub expected_exit: ExitStatus,
142}
143
144impl fidl::Persistable for StopWatcherWatchComponentRequest {}
145
146#[derive(Clone, Debug, Default, PartialEq)]
148pub struct ArchivistConfig {
149 pub enable_klog: Option<bool>,
152 pub logs_max_cached_original_bytes: Option<u64>,
154 pub pipelines_path: Option<String>,
156 pub initial_interests: Option<Vec<ComponentInitialInterest>>,
158 #[doc(hidden)]
159 pub __source_breaking: fidl::marker::SourceBreaking,
160}
161
162impl fidl::Persistable for ArchivistConfig {}
163
164#[derive(Clone, Debug, Default, PartialEq)]
165pub struct CommitOptions {
166 pub hang: Option<bool>,
168 #[doc(hidden)]
169 pub __source_breaking: fidl::marker::SourceBreaking,
170}
171
172impl fidl::Persistable for CommitOptions {}
173
174#[derive(Clone, Debug, Default, PartialEq)]
175pub struct ComponentInitialInterest {
176 pub moniker: Option<String>,
178 pub log_severity: Option<fidl_fuchsia_diagnostics_types__common::Severity>,
179 #[doc(hidden)]
180 pub __source_breaking: fidl::marker::SourceBreaking,
181}
182
183impl fidl::Persistable for ComponentInitialInterest {}
184
185#[derive(Clone, Debug, Default, PartialEq)]
186pub struct InspectPuppetCreateInspectorRequest {
187 pub name: Option<String>,
188 #[doc(hidden)]
189 pub __source_breaking: fidl::marker::SourceBreaking,
190}
191
192impl fidl::Persistable for InspectPuppetCreateInspectorRequest {}
193
194#[derive(Clone, Debug, Default, PartialEq)]
195pub struct InspectWriterEscrowAndExitRequest {
196 pub name: Option<String>,
197 #[doc(hidden)]
198 pub __source_breaking: fidl::marker::SourceBreaking,
199}
200
201impl fidl::Persistable for InspectWriterEscrowAndExitRequest {}
202
203#[derive(Clone, Debug, Default, PartialEq)]
204pub struct LogPuppetLogRequest {
205 pub message: Option<String>,
208 pub severity: Option<fidl_fuchsia_diagnostics_types__common::Severity>,
211 pub time: Option<i64>,
214 #[doc(hidden)]
215 pub __source_breaking: fidl::marker::SourceBreaking,
216}
217
218impl fidl::Persistable for LogPuppetLogRequest {}
219
220#[derive(Clone, Debug, Default, PartialEq)]
221pub struct LogPuppetWaitForInterestChangeResponse {
222 pub severity: Option<fidl_fuchsia_diagnostics_types__common::Severity>,
224 #[doc(hidden)]
225 pub __source_breaking: fidl::marker::SourceBreaking,
226}
227
228impl fidl::Persistable for LogPuppetWaitForInterestChangeResponse {}
229
230#[derive(Clone, Debug, Default, PartialEq)]
231pub struct PuppetDecl {
232 pub name: Option<String>,
234 #[doc(hidden)]
235 pub __source_breaking: fidl::marker::SourceBreaking,
236}
237
238impl fidl::Persistable for PuppetDecl {}
239
240#[derive(Clone, Debug, Default, PartialEq)]
242pub struct RealmOptions {
243 pub realm_name: Option<String>,
246 pub puppets: Option<Vec<PuppetDecl>>,
252 pub archivist_config: Option<ArchivistConfig>,
254 #[doc(hidden)]
255 pub __source_breaking: fidl::marker::SourceBreaking,
256}
257
258impl fidl::Persistable for RealmOptions {}
259
260pub mod inspect_puppet_ordinals {
261 pub const CREATE_INSPECTOR: u64 = 0x2c0f807d7d159bb;
262}
263
264pub mod inspect_writer_ordinals {
265 pub const SET_HEALTH_OK: u64 = 0xe7510549d99075e;
266 pub const RECORD_STRING: u64 = 0x195be230721d712b;
267 pub const RECORD_INT: u64 = 0xa2c6cbf0df0949;
268 pub const EMIT_EXAMPLE_INSPECT_DATA: u64 = 0x228ae4647773fd94;
269 pub const ESCROW_AND_EXIT: u64 = 0x60e24adbd0e588ff;
270 pub const RECORD_LAZY_VALUES: u64 = 0xc637cf5d48e9063;
271}
272
273pub mod lazy_inspect_puppet_ordinals {
274 pub const SET_HEALTH_OK: u64 = 0xe7510549d99075e;
275 pub const RECORD_STRING: u64 = 0x195be230721d712b;
276 pub const RECORD_INT: u64 = 0xa2c6cbf0df0949;
277 pub const EMIT_EXAMPLE_INSPECT_DATA: u64 = 0x228ae4647773fd94;
278 pub const ESCROW_AND_EXIT: u64 = 0x60e24adbd0e588ff;
279 pub const RECORD_LAZY_VALUES: u64 = 0xc637cf5d48e9063;
280 pub const COMMIT: u64 = 0x79524e5e00cbf03f;
281}
282
283pub mod log_puppet_ordinals {
284 pub const PRINTLN: u64 = 0x6584cb93e1978da0;
285 pub const EPRINTLN: u64 = 0x770e4524f6b093ef;
286 pub const LOG: u64 = 0x34d3dd4225e79a8b;
287 pub const WAIT_FOR_INTEREST_CHANGE: u64 = 0x3645d3ad544bc546;
288}
289
290pub mod puppet_ordinals {
291 pub const CREATE_INSPECTOR: u64 = 0x2c0f807d7d159bb;
292 pub const PRINTLN: u64 = 0x6584cb93e1978da0;
293 pub const EPRINTLN: u64 = 0x770e4524f6b093ef;
294 pub const LOG: u64 = 0x34d3dd4225e79a8b;
295 pub const WAIT_FOR_INTEREST_CHANGE: u64 = 0x3645d3ad544bc546;
296 pub const RECORD_LAZY_VALUES: u64 = 0x339951b623dc9d7d;
297 pub const CRASH: u64 = 0x2aeef488fb79c9db;
298}
299
300pub mod realm_factory_ordinals {
301 pub const CREATE_REALM: u64 = 0x176832ac7263ab99;
302}
303
304pub mod stop_waiter_ordinals {
305 pub const WAIT: u64 = 0x12d62812fe8aa263;
306}
307
308pub mod stop_watcher_ordinals {
309 pub const WATCH_COMPONENT: u64 = 0x844f88ddd954e8e;
310}
311
312mod internal {
313 use super::*;
314 unsafe impl fidl::encoding::TypeMarker for ExitStatus {
315 type Owned = Self;
316
317 #[inline(always)]
318 fn inline_align(_context: fidl::encoding::Context) -> usize {
319 std::mem::align_of::<u32>()
320 }
321
322 #[inline(always)]
323 fn inline_size(_context: fidl::encoding::Context) -> usize {
324 std::mem::size_of::<u32>()
325 }
326
327 #[inline(always)]
328 fn encode_is_copy() -> bool {
329 false
330 }
331
332 #[inline(always)]
333 fn decode_is_copy() -> bool {
334 false
335 }
336 }
337
338 impl fidl::encoding::ValueTypeMarker for ExitStatus {
339 type Borrowed<'a> = Self;
340 #[inline(always)]
341 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
342 *value
343 }
344 }
345
346 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ExitStatus {
347 #[inline]
348 unsafe fn encode(
349 self,
350 encoder: &mut fidl::encoding::Encoder<'_, D>,
351 offset: usize,
352 _depth: fidl::encoding::Depth,
353 ) -> fidl::Result<()> {
354 encoder.debug_check_bounds::<Self>(offset);
355 encoder.write_num(self.into_primitive(), offset);
356 Ok(())
357 }
358 }
359
360 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExitStatus {
361 #[inline(always)]
362 fn new_empty() -> Self {
363 Self::unknown()
364 }
365
366 #[inline]
367 unsafe fn decode(
368 &mut self,
369 decoder: &mut fidl::encoding::Decoder<'_, D>,
370 offset: usize,
371 _depth: fidl::encoding::Depth,
372 ) -> fidl::Result<()> {
373 decoder.debug_check_bounds::<Self>(offset);
374 let prim = decoder.read_num::<u32>(offset);
375
376 *self = Self::from_primitive_allow_unknown(prim);
377 Ok(())
378 }
379 }
380
381 impl fidl::encoding::ValueTypeMarker for InspectWriterRecordIntRequest {
382 type Borrowed<'a> = &'a Self;
383 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
384 value
385 }
386 }
387
388 unsafe impl fidl::encoding::TypeMarker for InspectWriterRecordIntRequest {
389 type Owned = Self;
390
391 #[inline(always)]
392 fn inline_align(_context: fidl::encoding::Context) -> usize {
393 8
394 }
395
396 #[inline(always)]
397 fn inline_size(_context: fidl::encoding::Context) -> usize {
398 24
399 }
400 }
401
402 unsafe impl<D: fidl::encoding::ResourceDialect>
403 fidl::encoding::Encode<InspectWriterRecordIntRequest, D>
404 for &InspectWriterRecordIntRequest
405 {
406 #[inline]
407 unsafe fn encode(
408 self,
409 encoder: &mut fidl::encoding::Encoder<'_, D>,
410 offset: usize,
411 _depth: fidl::encoding::Depth,
412 ) -> fidl::Result<()> {
413 encoder.debug_check_bounds::<InspectWriterRecordIntRequest>(offset);
414 fidl::encoding::Encode::<InspectWriterRecordIntRequest, D>::encode(
416 (
417 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
418 &self.key,
419 ),
420 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
421 ),
422 encoder,
423 offset,
424 _depth,
425 )
426 }
427 }
428 unsafe impl<
429 D: fidl::encoding::ResourceDialect,
430 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
431 T1: fidl::encoding::Encode<i64, D>,
432 > fidl::encoding::Encode<InspectWriterRecordIntRequest, D> for (T0, T1)
433 {
434 #[inline]
435 unsafe fn encode(
436 self,
437 encoder: &mut fidl::encoding::Encoder<'_, D>,
438 offset: usize,
439 depth: fidl::encoding::Depth,
440 ) -> fidl::Result<()> {
441 encoder.debug_check_bounds::<InspectWriterRecordIntRequest>(offset);
442 self.0.encode(encoder, offset + 0, depth)?;
446 self.1.encode(encoder, offset + 16, depth)?;
447 Ok(())
448 }
449 }
450
451 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
452 for InspectWriterRecordIntRequest
453 {
454 #[inline(always)]
455 fn new_empty() -> Self {
456 Self {
457 key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
458 value: fidl::new_empty!(i64, D),
459 }
460 }
461
462 #[inline]
463 unsafe fn decode(
464 &mut self,
465 decoder: &mut fidl::encoding::Decoder<'_, D>,
466 offset: usize,
467 _depth: fidl::encoding::Depth,
468 ) -> fidl::Result<()> {
469 decoder.debug_check_bounds::<Self>(offset);
470 fidl::decode!(
472 fidl::encoding::UnboundedString,
473 D,
474 &mut self.key,
475 decoder,
476 offset + 0,
477 _depth
478 )?;
479 fidl::decode!(i64, D, &mut self.value, decoder, offset + 16, _depth)?;
480 Ok(())
481 }
482 }
483
484 impl fidl::encoding::ValueTypeMarker for InspectWriterRecordLazyValuesRequest {
485 type Borrowed<'a> = &'a Self;
486 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
487 value
488 }
489 }
490
491 unsafe impl fidl::encoding::TypeMarker for InspectWriterRecordLazyValuesRequest {
492 type Owned = Self;
493
494 #[inline(always)]
495 fn inline_align(_context: fidl::encoding::Context) -> usize {
496 8
497 }
498
499 #[inline(always)]
500 fn inline_size(_context: fidl::encoding::Context) -> usize {
501 16
502 }
503 }
504
505 unsafe impl<D: fidl::encoding::ResourceDialect>
506 fidl::encoding::Encode<InspectWriterRecordLazyValuesRequest, D>
507 for &InspectWriterRecordLazyValuesRequest
508 {
509 #[inline]
510 unsafe fn encode(
511 self,
512 encoder: &mut fidl::encoding::Encoder<'_, D>,
513 offset: usize,
514 _depth: fidl::encoding::Depth,
515 ) -> fidl::Result<()> {
516 encoder.debug_check_bounds::<InspectWriterRecordLazyValuesRequest>(offset);
517 fidl::encoding::Encode::<InspectWriterRecordLazyValuesRequest, D>::encode(
519 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
520 &self.key,
521 ),),
522 encoder,
523 offset,
524 _depth,
525 )
526 }
527 }
528 unsafe impl<
529 D: fidl::encoding::ResourceDialect,
530 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
531 > fidl::encoding::Encode<InspectWriterRecordLazyValuesRequest, D> for (T0,)
532 {
533 #[inline]
534 unsafe fn encode(
535 self,
536 encoder: &mut fidl::encoding::Encoder<'_, D>,
537 offset: usize,
538 depth: fidl::encoding::Depth,
539 ) -> fidl::Result<()> {
540 encoder.debug_check_bounds::<InspectWriterRecordLazyValuesRequest>(offset);
541 self.0.encode(encoder, offset + 0, depth)?;
545 Ok(())
546 }
547 }
548
549 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
550 for InspectWriterRecordLazyValuesRequest
551 {
552 #[inline(always)]
553 fn new_empty() -> Self {
554 Self { key: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
555 }
556
557 #[inline]
558 unsafe fn decode(
559 &mut self,
560 decoder: &mut fidl::encoding::Decoder<'_, D>,
561 offset: usize,
562 _depth: fidl::encoding::Depth,
563 ) -> fidl::Result<()> {
564 decoder.debug_check_bounds::<Self>(offset);
565 fidl::decode!(
567 fidl::encoding::UnboundedString,
568 D,
569 &mut self.key,
570 decoder,
571 offset + 0,
572 _depth
573 )?;
574 Ok(())
575 }
576 }
577
578 impl fidl::encoding::ValueTypeMarker for InspectWriterRecordStringRequest {
579 type Borrowed<'a> = &'a Self;
580 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
581 value
582 }
583 }
584
585 unsafe impl fidl::encoding::TypeMarker for InspectWriterRecordStringRequest {
586 type Owned = Self;
587
588 #[inline(always)]
589 fn inline_align(_context: fidl::encoding::Context) -> usize {
590 8
591 }
592
593 #[inline(always)]
594 fn inline_size(_context: fidl::encoding::Context) -> usize {
595 32
596 }
597 }
598
599 unsafe impl<D: fidl::encoding::ResourceDialect>
600 fidl::encoding::Encode<InspectWriterRecordStringRequest, D>
601 for &InspectWriterRecordStringRequest
602 {
603 #[inline]
604 unsafe fn encode(
605 self,
606 encoder: &mut fidl::encoding::Encoder<'_, D>,
607 offset: usize,
608 _depth: fidl::encoding::Depth,
609 ) -> fidl::Result<()> {
610 encoder.debug_check_bounds::<InspectWriterRecordStringRequest>(offset);
611 fidl::encoding::Encode::<InspectWriterRecordStringRequest, D>::encode(
613 (
614 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
615 &self.key,
616 ),
617 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
618 &self.value,
619 ),
620 ),
621 encoder,
622 offset,
623 _depth,
624 )
625 }
626 }
627 unsafe impl<
628 D: fidl::encoding::ResourceDialect,
629 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
630 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
631 > fidl::encoding::Encode<InspectWriterRecordStringRequest, D> for (T0, T1)
632 {
633 #[inline]
634 unsafe fn encode(
635 self,
636 encoder: &mut fidl::encoding::Encoder<'_, D>,
637 offset: usize,
638 depth: fidl::encoding::Depth,
639 ) -> fidl::Result<()> {
640 encoder.debug_check_bounds::<InspectWriterRecordStringRequest>(offset);
641 self.0.encode(encoder, offset + 0, depth)?;
645 self.1.encode(encoder, offset + 16, depth)?;
646 Ok(())
647 }
648 }
649
650 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
651 for InspectWriterRecordStringRequest
652 {
653 #[inline(always)]
654 fn new_empty() -> Self {
655 Self {
656 key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
657 value: fidl::new_empty!(fidl::encoding::UnboundedString, D),
658 }
659 }
660
661 #[inline]
662 unsafe fn decode(
663 &mut self,
664 decoder: &mut fidl::encoding::Decoder<'_, D>,
665 offset: usize,
666 _depth: fidl::encoding::Depth,
667 ) -> fidl::Result<()> {
668 decoder.debug_check_bounds::<Self>(offset);
669 fidl::decode!(
671 fidl::encoding::UnboundedString,
672 D,
673 &mut self.key,
674 decoder,
675 offset + 0,
676 _depth
677 )?;
678 fidl::decode!(
679 fidl::encoding::UnboundedString,
680 D,
681 &mut self.value,
682 decoder,
683 offset + 16,
684 _depth
685 )?;
686 Ok(())
687 }
688 }
689
690 impl fidl::encoding::ValueTypeMarker for LazyInspectPuppetCommitRequest {
691 type Borrowed<'a> = &'a Self;
692 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
693 value
694 }
695 }
696
697 unsafe impl fidl::encoding::TypeMarker for LazyInspectPuppetCommitRequest {
698 type Owned = Self;
699
700 #[inline(always)]
701 fn inline_align(_context: fidl::encoding::Context) -> usize {
702 8
703 }
704
705 #[inline(always)]
706 fn inline_size(_context: fidl::encoding::Context) -> usize {
707 16
708 }
709 }
710
711 unsafe impl<D: fidl::encoding::ResourceDialect>
712 fidl::encoding::Encode<LazyInspectPuppetCommitRequest, D>
713 for &LazyInspectPuppetCommitRequest
714 {
715 #[inline]
716 unsafe fn encode(
717 self,
718 encoder: &mut fidl::encoding::Encoder<'_, D>,
719 offset: usize,
720 _depth: fidl::encoding::Depth,
721 ) -> fidl::Result<()> {
722 encoder.debug_check_bounds::<LazyInspectPuppetCommitRequest>(offset);
723 fidl::encoding::Encode::<LazyInspectPuppetCommitRequest, D>::encode(
725 (<CommitOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
726 encoder,
727 offset,
728 _depth,
729 )
730 }
731 }
732 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CommitOptions, D>>
733 fidl::encoding::Encode<LazyInspectPuppetCommitRequest, D> for (T0,)
734 {
735 #[inline]
736 unsafe fn encode(
737 self,
738 encoder: &mut fidl::encoding::Encoder<'_, D>,
739 offset: usize,
740 depth: fidl::encoding::Depth,
741 ) -> fidl::Result<()> {
742 encoder.debug_check_bounds::<LazyInspectPuppetCommitRequest>(offset);
743 self.0.encode(encoder, offset + 0, depth)?;
747 Ok(())
748 }
749 }
750
751 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
752 for LazyInspectPuppetCommitRequest
753 {
754 #[inline(always)]
755 fn new_empty() -> Self {
756 Self { options: fidl::new_empty!(CommitOptions, D) }
757 }
758
759 #[inline]
760 unsafe fn decode(
761 &mut self,
762 decoder: &mut fidl::encoding::Decoder<'_, D>,
763 offset: usize,
764 _depth: fidl::encoding::Depth,
765 ) -> fidl::Result<()> {
766 decoder.debug_check_bounds::<Self>(offset);
767 fidl::decode!(CommitOptions, D, &mut self.options, decoder, offset + 0, _depth)?;
769 Ok(())
770 }
771 }
772
773 impl fidl::encoding::ValueTypeMarker for LogPuppetEprintlnRequest {
774 type Borrowed<'a> = &'a Self;
775 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
776 value
777 }
778 }
779
780 unsafe impl fidl::encoding::TypeMarker for LogPuppetEprintlnRequest {
781 type Owned = Self;
782
783 #[inline(always)]
784 fn inline_align(_context: fidl::encoding::Context) -> usize {
785 8
786 }
787
788 #[inline(always)]
789 fn inline_size(_context: fidl::encoding::Context) -> usize {
790 16
791 }
792 }
793
794 unsafe impl<D: fidl::encoding::ResourceDialect>
795 fidl::encoding::Encode<LogPuppetEprintlnRequest, D> for &LogPuppetEprintlnRequest
796 {
797 #[inline]
798 unsafe fn encode(
799 self,
800 encoder: &mut fidl::encoding::Encoder<'_, D>,
801 offset: usize,
802 _depth: fidl::encoding::Depth,
803 ) -> fidl::Result<()> {
804 encoder.debug_check_bounds::<LogPuppetEprintlnRequest>(offset);
805 fidl::encoding::Encode::<LogPuppetEprintlnRequest, D>::encode(
807 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
808 &self.message,
809 ),),
810 encoder,
811 offset,
812 _depth,
813 )
814 }
815 }
816 unsafe impl<
817 D: fidl::encoding::ResourceDialect,
818 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
819 > fidl::encoding::Encode<LogPuppetEprintlnRequest, D> for (T0,)
820 {
821 #[inline]
822 unsafe fn encode(
823 self,
824 encoder: &mut fidl::encoding::Encoder<'_, D>,
825 offset: usize,
826 depth: fidl::encoding::Depth,
827 ) -> fidl::Result<()> {
828 encoder.debug_check_bounds::<LogPuppetEprintlnRequest>(offset);
829 self.0.encode(encoder, offset + 0, depth)?;
833 Ok(())
834 }
835 }
836
837 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
838 for LogPuppetEprintlnRequest
839 {
840 #[inline(always)]
841 fn new_empty() -> Self {
842 Self { message: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
843 }
844
845 #[inline]
846 unsafe fn decode(
847 &mut self,
848 decoder: &mut fidl::encoding::Decoder<'_, D>,
849 offset: usize,
850 _depth: fidl::encoding::Depth,
851 ) -> fidl::Result<()> {
852 decoder.debug_check_bounds::<Self>(offset);
853 fidl::decode!(
855 fidl::encoding::UnboundedString,
856 D,
857 &mut self.message,
858 decoder,
859 offset + 0,
860 _depth
861 )?;
862 Ok(())
863 }
864 }
865
866 impl fidl::encoding::ValueTypeMarker for LogPuppetPrintlnRequest {
867 type Borrowed<'a> = &'a Self;
868 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
869 value
870 }
871 }
872
873 unsafe impl fidl::encoding::TypeMarker for LogPuppetPrintlnRequest {
874 type Owned = Self;
875
876 #[inline(always)]
877 fn inline_align(_context: fidl::encoding::Context) -> usize {
878 8
879 }
880
881 #[inline(always)]
882 fn inline_size(_context: fidl::encoding::Context) -> usize {
883 16
884 }
885 }
886
887 unsafe impl<D: fidl::encoding::ResourceDialect>
888 fidl::encoding::Encode<LogPuppetPrintlnRequest, D> for &LogPuppetPrintlnRequest
889 {
890 #[inline]
891 unsafe fn encode(
892 self,
893 encoder: &mut fidl::encoding::Encoder<'_, D>,
894 offset: usize,
895 _depth: fidl::encoding::Depth,
896 ) -> fidl::Result<()> {
897 encoder.debug_check_bounds::<LogPuppetPrintlnRequest>(offset);
898 fidl::encoding::Encode::<LogPuppetPrintlnRequest, D>::encode(
900 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
901 &self.message,
902 ),),
903 encoder,
904 offset,
905 _depth,
906 )
907 }
908 }
909 unsafe impl<
910 D: fidl::encoding::ResourceDialect,
911 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
912 > fidl::encoding::Encode<LogPuppetPrintlnRequest, D> for (T0,)
913 {
914 #[inline]
915 unsafe fn encode(
916 self,
917 encoder: &mut fidl::encoding::Encoder<'_, D>,
918 offset: usize,
919 depth: fidl::encoding::Depth,
920 ) -> fidl::Result<()> {
921 encoder.debug_check_bounds::<LogPuppetPrintlnRequest>(offset);
922 self.0.encode(encoder, offset + 0, depth)?;
926 Ok(())
927 }
928 }
929
930 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
931 for LogPuppetPrintlnRequest
932 {
933 #[inline(always)]
934 fn new_empty() -> Self {
935 Self { message: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
936 }
937
938 #[inline]
939 unsafe fn decode(
940 &mut self,
941 decoder: &mut fidl::encoding::Decoder<'_, D>,
942 offset: usize,
943 _depth: fidl::encoding::Depth,
944 ) -> fidl::Result<()> {
945 decoder.debug_check_bounds::<Self>(offset);
946 fidl::decode!(
948 fidl::encoding::UnboundedString,
949 D,
950 &mut self.message,
951 decoder,
952 offset + 0,
953 _depth
954 )?;
955 Ok(())
956 }
957 }
958
959 impl fidl::encoding::ValueTypeMarker for PuppetCrashRequest {
960 type Borrowed<'a> = &'a Self;
961 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
962 value
963 }
964 }
965
966 unsafe impl fidl::encoding::TypeMarker for PuppetCrashRequest {
967 type Owned = Self;
968
969 #[inline(always)]
970 fn inline_align(_context: fidl::encoding::Context) -> usize {
971 8
972 }
973
974 #[inline(always)]
975 fn inline_size(_context: fidl::encoding::Context) -> usize {
976 16
977 }
978 }
979
980 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PuppetCrashRequest, D>
981 for &PuppetCrashRequest
982 {
983 #[inline]
984 unsafe fn encode(
985 self,
986 encoder: &mut fidl::encoding::Encoder<'_, D>,
987 offset: usize,
988 _depth: fidl::encoding::Depth,
989 ) -> fidl::Result<()> {
990 encoder.debug_check_bounds::<PuppetCrashRequest>(offset);
991 fidl::encoding::Encode::<PuppetCrashRequest, D>::encode(
993 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
994 &self.message,
995 ),),
996 encoder,
997 offset,
998 _depth,
999 )
1000 }
1001 }
1002 unsafe impl<
1003 D: fidl::encoding::ResourceDialect,
1004 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1005 > fidl::encoding::Encode<PuppetCrashRequest, D> for (T0,)
1006 {
1007 #[inline]
1008 unsafe fn encode(
1009 self,
1010 encoder: &mut fidl::encoding::Encoder<'_, D>,
1011 offset: usize,
1012 depth: fidl::encoding::Depth,
1013 ) -> fidl::Result<()> {
1014 encoder.debug_check_bounds::<PuppetCrashRequest>(offset);
1015 self.0.encode(encoder, offset + 0, depth)?;
1019 Ok(())
1020 }
1021 }
1022
1023 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetCrashRequest {
1024 #[inline(always)]
1025 fn new_empty() -> Self {
1026 Self { message: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1027 }
1028
1029 #[inline]
1030 unsafe fn decode(
1031 &mut self,
1032 decoder: &mut fidl::encoding::Decoder<'_, D>,
1033 offset: usize,
1034 _depth: fidl::encoding::Depth,
1035 ) -> fidl::Result<()> {
1036 decoder.debug_check_bounds::<Self>(offset);
1037 fidl::decode!(
1039 fidl::encoding::UnboundedString,
1040 D,
1041 &mut self.message,
1042 decoder,
1043 offset + 0,
1044 _depth
1045 )?;
1046 Ok(())
1047 }
1048 }
1049
1050 impl fidl::encoding::ValueTypeMarker for PuppetRecordLazyValuesRequest {
1051 type Borrowed<'a> = &'a Self;
1052 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1053 value
1054 }
1055 }
1056
1057 unsafe impl fidl::encoding::TypeMarker for PuppetRecordLazyValuesRequest {
1058 type Owned = Self;
1059
1060 #[inline(always)]
1061 fn inline_align(_context: fidl::encoding::Context) -> usize {
1062 8
1063 }
1064
1065 #[inline(always)]
1066 fn inline_size(_context: fidl::encoding::Context) -> usize {
1067 16
1068 }
1069 }
1070
1071 unsafe impl<D: fidl::encoding::ResourceDialect>
1072 fidl::encoding::Encode<PuppetRecordLazyValuesRequest, D>
1073 for &PuppetRecordLazyValuesRequest
1074 {
1075 #[inline]
1076 unsafe fn encode(
1077 self,
1078 encoder: &mut fidl::encoding::Encoder<'_, D>,
1079 offset: usize,
1080 _depth: fidl::encoding::Depth,
1081 ) -> fidl::Result<()> {
1082 encoder.debug_check_bounds::<PuppetRecordLazyValuesRequest>(offset);
1083 fidl::encoding::Encode::<PuppetRecordLazyValuesRequest, D>::encode(
1085 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1086 &self.key,
1087 ),),
1088 encoder,
1089 offset,
1090 _depth,
1091 )
1092 }
1093 }
1094 unsafe impl<
1095 D: fidl::encoding::ResourceDialect,
1096 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1097 > fidl::encoding::Encode<PuppetRecordLazyValuesRequest, D> for (T0,)
1098 {
1099 #[inline]
1100 unsafe fn encode(
1101 self,
1102 encoder: &mut fidl::encoding::Encoder<'_, D>,
1103 offset: usize,
1104 depth: fidl::encoding::Depth,
1105 ) -> fidl::Result<()> {
1106 encoder.debug_check_bounds::<PuppetRecordLazyValuesRequest>(offset);
1107 self.0.encode(encoder, offset + 0, depth)?;
1111 Ok(())
1112 }
1113 }
1114
1115 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1116 for PuppetRecordLazyValuesRequest
1117 {
1118 #[inline(always)]
1119 fn new_empty() -> Self {
1120 Self { key: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1121 }
1122
1123 #[inline]
1124 unsafe fn decode(
1125 &mut self,
1126 decoder: &mut fidl::encoding::Decoder<'_, D>,
1127 offset: usize,
1128 _depth: fidl::encoding::Depth,
1129 ) -> fidl::Result<()> {
1130 decoder.debug_check_bounds::<Self>(offset);
1131 fidl::decode!(
1133 fidl::encoding::UnboundedString,
1134 D,
1135 &mut self.key,
1136 decoder,
1137 offset + 0,
1138 _depth
1139 )?;
1140 Ok(())
1141 }
1142 }
1143
1144 impl fidl::encoding::ValueTypeMarker for StopWatcherWatchComponentRequest {
1145 type Borrowed<'a> = &'a Self;
1146 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1147 value
1148 }
1149 }
1150
1151 unsafe impl fidl::encoding::TypeMarker for StopWatcherWatchComponentRequest {
1152 type Owned = Self;
1153
1154 #[inline(always)]
1155 fn inline_align(_context: fidl::encoding::Context) -> usize {
1156 8
1157 }
1158
1159 #[inline(always)]
1160 fn inline_size(_context: fidl::encoding::Context) -> usize {
1161 24
1162 }
1163 }
1164
1165 unsafe impl<D: fidl::encoding::ResourceDialect>
1166 fidl::encoding::Encode<StopWatcherWatchComponentRequest, D>
1167 for &StopWatcherWatchComponentRequest
1168 {
1169 #[inline]
1170 unsafe fn encode(
1171 self,
1172 encoder: &mut fidl::encoding::Encoder<'_, D>,
1173 offset: usize,
1174 _depth: fidl::encoding::Depth,
1175 ) -> fidl::Result<()> {
1176 encoder.debug_check_bounds::<StopWatcherWatchComponentRequest>(offset);
1177 fidl::encoding::Encode::<StopWatcherWatchComponentRequest, D>::encode(
1179 (
1180 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1181 <ExitStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.expected_exit),
1182 ),
1183 encoder, offset, _depth
1184 )
1185 }
1186 }
1187 unsafe impl<
1188 D: fidl::encoding::ResourceDialect,
1189 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
1190 T1: fidl::encoding::Encode<ExitStatus, D>,
1191 > fidl::encoding::Encode<StopWatcherWatchComponentRequest, D> for (T0, T1)
1192 {
1193 #[inline]
1194 unsafe fn encode(
1195 self,
1196 encoder: &mut fidl::encoding::Encoder<'_, D>,
1197 offset: usize,
1198 depth: fidl::encoding::Depth,
1199 ) -> fidl::Result<()> {
1200 encoder.debug_check_bounds::<StopWatcherWatchComponentRequest>(offset);
1201 unsafe {
1204 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1205 (ptr as *mut u64).write_unaligned(0);
1206 }
1207 self.0.encode(encoder, offset + 0, depth)?;
1209 self.1.encode(encoder, offset + 16, depth)?;
1210 Ok(())
1211 }
1212 }
1213
1214 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1215 for StopWatcherWatchComponentRequest
1216 {
1217 #[inline(always)]
1218 fn new_empty() -> Self {
1219 Self {
1220 moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
1221 expected_exit: fidl::new_empty!(ExitStatus, D),
1222 }
1223 }
1224
1225 #[inline]
1226 unsafe fn decode(
1227 &mut self,
1228 decoder: &mut fidl::encoding::Decoder<'_, D>,
1229 offset: usize,
1230 _depth: fidl::encoding::Depth,
1231 ) -> fidl::Result<()> {
1232 decoder.debug_check_bounds::<Self>(offset);
1233 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1235 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1236 let mask = 0xffffffff00000000u64;
1237 let maskedval = padval & mask;
1238 if maskedval != 0 {
1239 return Err(fidl::Error::NonZeroPadding {
1240 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1241 });
1242 }
1243 fidl::decode!(
1244 fidl::encoding::BoundedString<4096>,
1245 D,
1246 &mut self.moniker,
1247 decoder,
1248 offset + 0,
1249 _depth
1250 )?;
1251 fidl::decode!(ExitStatus, D, &mut self.expected_exit, decoder, offset + 16, _depth)?;
1252 Ok(())
1253 }
1254 }
1255
1256 impl ArchivistConfig {
1257 #[inline(always)]
1258 fn max_ordinal_present(&self) -> u64 {
1259 if let Some(_) = self.initial_interests {
1260 return 4;
1261 }
1262 if let Some(_) = self.pipelines_path {
1263 return 3;
1264 }
1265 if let Some(_) = self.logs_max_cached_original_bytes {
1266 return 2;
1267 }
1268 if let Some(_) = self.enable_klog {
1269 return 1;
1270 }
1271 0
1272 }
1273 }
1274
1275 impl fidl::encoding::ValueTypeMarker for ArchivistConfig {
1276 type Borrowed<'a> = &'a Self;
1277 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1278 value
1279 }
1280 }
1281
1282 unsafe impl fidl::encoding::TypeMarker for ArchivistConfig {
1283 type Owned = Self;
1284
1285 #[inline(always)]
1286 fn inline_align(_context: fidl::encoding::Context) -> usize {
1287 8
1288 }
1289
1290 #[inline(always)]
1291 fn inline_size(_context: fidl::encoding::Context) -> usize {
1292 16
1293 }
1294 }
1295
1296 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ArchivistConfig, D>
1297 for &ArchivistConfig
1298 {
1299 unsafe fn encode(
1300 self,
1301 encoder: &mut fidl::encoding::Encoder<'_, D>,
1302 offset: usize,
1303 mut depth: fidl::encoding::Depth,
1304 ) -> fidl::Result<()> {
1305 encoder.debug_check_bounds::<ArchivistConfig>(offset);
1306 let max_ordinal: u64 = self.max_ordinal_present();
1308 encoder.write_num(max_ordinal, offset);
1309 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1310 if max_ordinal == 0 {
1312 return Ok(());
1313 }
1314 depth.increment()?;
1315 let envelope_size = 8;
1316 let bytes_len = max_ordinal as usize * envelope_size;
1317 #[allow(unused_variables)]
1318 let offset = encoder.out_of_line_offset(bytes_len);
1319 let mut _prev_end_offset: usize = 0;
1320 if 1 > max_ordinal {
1321 return Ok(());
1322 }
1323
1324 let cur_offset: usize = (1 - 1) * envelope_size;
1327
1328 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1330
1331 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1336 self.enable_klog.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1337 encoder,
1338 offset + cur_offset,
1339 depth,
1340 )?;
1341
1342 _prev_end_offset = cur_offset + envelope_size;
1343 if 2 > max_ordinal {
1344 return Ok(());
1345 }
1346
1347 let cur_offset: usize = (2 - 1) * envelope_size;
1350
1351 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1353
1354 fidl::encoding::encode_in_envelope_optional::<u64, D>(
1359 self.logs_max_cached_original_bytes
1360 .as_ref()
1361 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1362 encoder,
1363 offset + cur_offset,
1364 depth,
1365 )?;
1366
1367 _prev_end_offset = cur_offset + envelope_size;
1368 if 3 > max_ordinal {
1369 return Ok(());
1370 }
1371
1372 let cur_offset: usize = (3 - 1) * envelope_size;
1375
1376 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1378
1379 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<256>, D>(
1384 self.pipelines_path.as_ref().map(
1385 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow,
1386 ),
1387 encoder,
1388 offset + cur_offset,
1389 depth,
1390 )?;
1391
1392 _prev_end_offset = cur_offset + envelope_size;
1393 if 4 > max_ordinal {
1394 return Ok(());
1395 }
1396
1397 let cur_offset: usize = (4 - 1) * envelope_size;
1400
1401 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1403
1404 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<ComponentInitialInterest>, D>(
1409 self.initial_interests.as_ref().map(<fidl::encoding::UnboundedVector<ComponentInitialInterest> as fidl::encoding::ValueTypeMarker>::borrow),
1410 encoder, offset + cur_offset, depth
1411 )?;
1412
1413 _prev_end_offset = cur_offset + envelope_size;
1414
1415 Ok(())
1416 }
1417 }
1418
1419 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ArchivistConfig {
1420 #[inline(always)]
1421 fn new_empty() -> Self {
1422 Self::default()
1423 }
1424
1425 unsafe fn decode(
1426 &mut self,
1427 decoder: &mut fidl::encoding::Decoder<'_, D>,
1428 offset: usize,
1429 mut depth: fidl::encoding::Depth,
1430 ) -> fidl::Result<()> {
1431 decoder.debug_check_bounds::<Self>(offset);
1432 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1433 None => return Err(fidl::Error::NotNullable),
1434 Some(len) => len,
1435 };
1436 if len == 0 {
1438 return Ok(());
1439 };
1440 depth.increment()?;
1441 let envelope_size = 8;
1442 let bytes_len = len * envelope_size;
1443 let offset = decoder.out_of_line_offset(bytes_len)?;
1444 let mut _next_ordinal_to_read = 0;
1446 let mut next_offset = offset;
1447 let end_offset = offset + bytes_len;
1448 _next_ordinal_to_read += 1;
1449 if next_offset >= end_offset {
1450 return Ok(());
1451 }
1452
1453 while _next_ordinal_to_read < 1 {
1455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1456 _next_ordinal_to_read += 1;
1457 next_offset += envelope_size;
1458 }
1459
1460 let next_out_of_line = decoder.next_out_of_line();
1461 let handles_before = decoder.remaining_handles();
1462 if let Some((inlined, num_bytes, num_handles)) =
1463 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1464 {
1465 let member_inline_size =
1466 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1467 if inlined != (member_inline_size <= 4) {
1468 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1469 }
1470 let inner_offset;
1471 let mut inner_depth = depth.clone();
1472 if inlined {
1473 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1474 inner_offset = next_offset;
1475 } else {
1476 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1477 inner_depth.increment()?;
1478 }
1479 let val_ref = self.enable_klog.get_or_insert_with(|| fidl::new_empty!(bool, D));
1480 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1481 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1482 {
1483 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1484 }
1485 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1486 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1487 }
1488 }
1489
1490 next_offset += envelope_size;
1491 _next_ordinal_to_read += 1;
1492 if next_offset >= end_offset {
1493 return Ok(());
1494 }
1495
1496 while _next_ordinal_to_read < 2 {
1498 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1499 _next_ordinal_to_read += 1;
1500 next_offset += envelope_size;
1501 }
1502
1503 let next_out_of_line = decoder.next_out_of_line();
1504 let handles_before = decoder.remaining_handles();
1505 if let Some((inlined, num_bytes, num_handles)) =
1506 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1507 {
1508 let member_inline_size =
1509 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1510 if inlined != (member_inline_size <= 4) {
1511 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1512 }
1513 let inner_offset;
1514 let mut inner_depth = depth.clone();
1515 if inlined {
1516 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1517 inner_offset = next_offset;
1518 } else {
1519 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1520 inner_depth.increment()?;
1521 }
1522 let val_ref = self
1523 .logs_max_cached_original_bytes
1524 .get_or_insert_with(|| fidl::new_empty!(u64, D));
1525 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1526 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1527 {
1528 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1529 }
1530 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1531 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1532 }
1533 }
1534
1535 next_offset += envelope_size;
1536 _next_ordinal_to_read += 1;
1537 if next_offset >= end_offset {
1538 return Ok(());
1539 }
1540
1541 while _next_ordinal_to_read < 3 {
1543 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1544 _next_ordinal_to_read += 1;
1545 next_offset += envelope_size;
1546 }
1547
1548 let next_out_of_line = decoder.next_out_of_line();
1549 let handles_before = decoder.remaining_handles();
1550 if let Some((inlined, num_bytes, num_handles)) =
1551 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1552 {
1553 let member_inline_size =
1554 <fidl::encoding::BoundedString<256> as fidl::encoding::TypeMarker>::inline_size(
1555 decoder.context,
1556 );
1557 if inlined != (member_inline_size <= 4) {
1558 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1559 }
1560 let inner_offset;
1561 let mut inner_depth = depth.clone();
1562 if inlined {
1563 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1564 inner_offset = next_offset;
1565 } else {
1566 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1567 inner_depth.increment()?;
1568 }
1569 let val_ref = self
1570 .pipelines_path
1571 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
1572 fidl::decode!(
1573 fidl::encoding::BoundedString<256>,
1574 D,
1575 val_ref,
1576 decoder,
1577 inner_offset,
1578 inner_depth
1579 )?;
1580 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1581 {
1582 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1583 }
1584 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1585 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1586 }
1587 }
1588
1589 next_offset += envelope_size;
1590 _next_ordinal_to_read += 1;
1591 if next_offset >= end_offset {
1592 return Ok(());
1593 }
1594
1595 while _next_ordinal_to_read < 4 {
1597 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1598 _next_ordinal_to_read += 1;
1599 next_offset += envelope_size;
1600 }
1601
1602 let next_out_of_line = decoder.next_out_of_line();
1603 let handles_before = decoder.remaining_handles();
1604 if let Some((inlined, num_bytes, num_handles)) =
1605 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1606 {
1607 let member_inline_size = <fidl::encoding::UnboundedVector<ComponentInitialInterest> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1608 if inlined != (member_inline_size <= 4) {
1609 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1610 }
1611 let inner_offset;
1612 let mut inner_depth = depth.clone();
1613 if inlined {
1614 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1615 inner_offset = next_offset;
1616 } else {
1617 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1618 inner_depth.increment()?;
1619 }
1620 let val_ref = self.initial_interests.get_or_insert_with(|| {
1621 fidl::new_empty!(fidl::encoding::UnboundedVector<ComponentInitialInterest>, D)
1622 });
1623 fidl::decode!(
1624 fidl::encoding::UnboundedVector<ComponentInitialInterest>,
1625 D,
1626 val_ref,
1627 decoder,
1628 inner_offset,
1629 inner_depth
1630 )?;
1631 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1632 {
1633 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1634 }
1635 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1636 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1637 }
1638 }
1639
1640 next_offset += envelope_size;
1641
1642 while next_offset < end_offset {
1644 _next_ordinal_to_read += 1;
1645 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1646 next_offset += envelope_size;
1647 }
1648
1649 Ok(())
1650 }
1651 }
1652
1653 impl CommitOptions {
1654 #[inline(always)]
1655 fn max_ordinal_present(&self) -> u64 {
1656 if let Some(_) = self.hang {
1657 return 1;
1658 }
1659 0
1660 }
1661 }
1662
1663 impl fidl::encoding::ValueTypeMarker for CommitOptions {
1664 type Borrowed<'a> = &'a Self;
1665 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1666 value
1667 }
1668 }
1669
1670 unsafe impl fidl::encoding::TypeMarker for CommitOptions {
1671 type Owned = Self;
1672
1673 #[inline(always)]
1674 fn inline_align(_context: fidl::encoding::Context) -> usize {
1675 8
1676 }
1677
1678 #[inline(always)]
1679 fn inline_size(_context: fidl::encoding::Context) -> usize {
1680 16
1681 }
1682 }
1683
1684 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CommitOptions, D>
1685 for &CommitOptions
1686 {
1687 unsafe fn encode(
1688 self,
1689 encoder: &mut fidl::encoding::Encoder<'_, D>,
1690 offset: usize,
1691 mut depth: fidl::encoding::Depth,
1692 ) -> fidl::Result<()> {
1693 encoder.debug_check_bounds::<CommitOptions>(offset);
1694 let max_ordinal: u64 = self.max_ordinal_present();
1696 encoder.write_num(max_ordinal, offset);
1697 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1698 if max_ordinal == 0 {
1700 return Ok(());
1701 }
1702 depth.increment()?;
1703 let envelope_size = 8;
1704 let bytes_len = max_ordinal as usize * envelope_size;
1705 #[allow(unused_variables)]
1706 let offset = encoder.out_of_line_offset(bytes_len);
1707 let mut _prev_end_offset: usize = 0;
1708 if 1 > max_ordinal {
1709 return Ok(());
1710 }
1711
1712 let cur_offset: usize = (1 - 1) * envelope_size;
1715
1716 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1718
1719 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1724 self.hang.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1725 encoder,
1726 offset + cur_offset,
1727 depth,
1728 )?;
1729
1730 _prev_end_offset = cur_offset + envelope_size;
1731
1732 Ok(())
1733 }
1734 }
1735
1736 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CommitOptions {
1737 #[inline(always)]
1738 fn new_empty() -> Self {
1739 Self::default()
1740 }
1741
1742 unsafe fn decode(
1743 &mut self,
1744 decoder: &mut fidl::encoding::Decoder<'_, D>,
1745 offset: usize,
1746 mut depth: fidl::encoding::Depth,
1747 ) -> fidl::Result<()> {
1748 decoder.debug_check_bounds::<Self>(offset);
1749 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1750 None => return Err(fidl::Error::NotNullable),
1751 Some(len) => len,
1752 };
1753 if len == 0 {
1755 return Ok(());
1756 };
1757 depth.increment()?;
1758 let envelope_size = 8;
1759 let bytes_len = len * envelope_size;
1760 let offset = decoder.out_of_line_offset(bytes_len)?;
1761 let mut _next_ordinal_to_read = 0;
1763 let mut next_offset = offset;
1764 let end_offset = offset + bytes_len;
1765 _next_ordinal_to_read += 1;
1766 if next_offset >= end_offset {
1767 return Ok(());
1768 }
1769
1770 while _next_ordinal_to_read < 1 {
1772 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1773 _next_ordinal_to_read += 1;
1774 next_offset += envelope_size;
1775 }
1776
1777 let next_out_of_line = decoder.next_out_of_line();
1778 let handles_before = decoder.remaining_handles();
1779 if let Some((inlined, num_bytes, num_handles)) =
1780 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1781 {
1782 let member_inline_size =
1783 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1784 if inlined != (member_inline_size <= 4) {
1785 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1786 }
1787 let inner_offset;
1788 let mut inner_depth = depth.clone();
1789 if inlined {
1790 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1791 inner_offset = next_offset;
1792 } else {
1793 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1794 inner_depth.increment()?;
1795 }
1796 let val_ref = self.hang.get_or_insert_with(|| fidl::new_empty!(bool, D));
1797 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1798 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1799 {
1800 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1801 }
1802 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1803 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1804 }
1805 }
1806
1807 next_offset += envelope_size;
1808
1809 while next_offset < end_offset {
1811 _next_ordinal_to_read += 1;
1812 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1813 next_offset += envelope_size;
1814 }
1815
1816 Ok(())
1817 }
1818 }
1819
1820 impl ComponentInitialInterest {
1821 #[inline(always)]
1822 fn max_ordinal_present(&self) -> u64 {
1823 if let Some(_) = self.log_severity {
1824 return 2;
1825 }
1826 if let Some(_) = self.moniker {
1827 return 1;
1828 }
1829 0
1830 }
1831 }
1832
1833 impl fidl::encoding::ValueTypeMarker for ComponentInitialInterest {
1834 type Borrowed<'a> = &'a Self;
1835 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1836 value
1837 }
1838 }
1839
1840 unsafe impl fidl::encoding::TypeMarker for ComponentInitialInterest {
1841 type Owned = Self;
1842
1843 #[inline(always)]
1844 fn inline_align(_context: fidl::encoding::Context) -> usize {
1845 8
1846 }
1847
1848 #[inline(always)]
1849 fn inline_size(_context: fidl::encoding::Context) -> usize {
1850 16
1851 }
1852 }
1853
1854 unsafe impl<D: fidl::encoding::ResourceDialect>
1855 fidl::encoding::Encode<ComponentInitialInterest, D> for &ComponentInitialInterest
1856 {
1857 unsafe fn encode(
1858 self,
1859 encoder: &mut fidl::encoding::Encoder<'_, D>,
1860 offset: usize,
1861 mut depth: fidl::encoding::Depth,
1862 ) -> fidl::Result<()> {
1863 encoder.debug_check_bounds::<ComponentInitialInterest>(offset);
1864 let max_ordinal: u64 = self.max_ordinal_present();
1866 encoder.write_num(max_ordinal, offset);
1867 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1868 if max_ordinal == 0 {
1870 return Ok(());
1871 }
1872 depth.increment()?;
1873 let envelope_size = 8;
1874 let bytes_len = max_ordinal as usize * envelope_size;
1875 #[allow(unused_variables)]
1876 let offset = encoder.out_of_line_offset(bytes_len);
1877 let mut _prev_end_offset: usize = 0;
1878 if 1 > max_ordinal {
1879 return Ok(());
1880 }
1881
1882 let cur_offset: usize = (1 - 1) * envelope_size;
1885
1886 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1888
1889 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
1894 self.moniker.as_ref().map(
1895 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
1896 ),
1897 encoder,
1898 offset + cur_offset,
1899 depth,
1900 )?;
1901
1902 _prev_end_offset = cur_offset + envelope_size;
1903 if 2 > max_ordinal {
1904 return Ok(());
1905 }
1906
1907 let cur_offset: usize = (2 - 1) * envelope_size;
1910
1911 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1913
1914 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_diagnostics_types__common::Severity, D>(
1919 self.log_severity.as_ref().map(<fidl_fuchsia_diagnostics_types__common::Severity as fidl::encoding::ValueTypeMarker>::borrow),
1920 encoder, offset + cur_offset, depth
1921 )?;
1922
1923 _prev_end_offset = cur_offset + envelope_size;
1924
1925 Ok(())
1926 }
1927 }
1928
1929 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1930 for ComponentInitialInterest
1931 {
1932 #[inline(always)]
1933 fn new_empty() -> Self {
1934 Self::default()
1935 }
1936
1937 unsafe fn decode(
1938 &mut self,
1939 decoder: &mut fidl::encoding::Decoder<'_, D>,
1940 offset: usize,
1941 mut depth: fidl::encoding::Depth,
1942 ) -> fidl::Result<()> {
1943 decoder.debug_check_bounds::<Self>(offset);
1944 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1945 None => return Err(fidl::Error::NotNullable),
1946 Some(len) => len,
1947 };
1948 if len == 0 {
1950 return Ok(());
1951 };
1952 depth.increment()?;
1953 let envelope_size = 8;
1954 let bytes_len = len * envelope_size;
1955 let offset = decoder.out_of_line_offset(bytes_len)?;
1956 let mut _next_ordinal_to_read = 0;
1958 let mut next_offset = offset;
1959 let end_offset = offset + bytes_len;
1960 _next_ordinal_to_read += 1;
1961 if next_offset >= end_offset {
1962 return Ok(());
1963 }
1964
1965 while _next_ordinal_to_read < 1 {
1967 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1968 _next_ordinal_to_read += 1;
1969 next_offset += envelope_size;
1970 }
1971
1972 let next_out_of_line = decoder.next_out_of_line();
1973 let handles_before = decoder.remaining_handles();
1974 if let Some((inlined, num_bytes, num_handles)) =
1975 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1976 {
1977 let member_inline_size =
1978 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
1979 decoder.context,
1980 );
1981 if inlined != (member_inline_size <= 4) {
1982 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1983 }
1984 let inner_offset;
1985 let mut inner_depth = depth.clone();
1986 if inlined {
1987 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1988 inner_offset = next_offset;
1989 } else {
1990 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1991 inner_depth.increment()?;
1992 }
1993 let val_ref = self
1994 .moniker
1995 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
1996 fidl::decode!(
1997 fidl::encoding::UnboundedString,
1998 D,
1999 val_ref,
2000 decoder,
2001 inner_offset,
2002 inner_depth
2003 )?;
2004 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2005 {
2006 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2007 }
2008 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2009 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2010 }
2011 }
2012
2013 next_offset += envelope_size;
2014 _next_ordinal_to_read += 1;
2015 if next_offset >= end_offset {
2016 return Ok(());
2017 }
2018
2019 while _next_ordinal_to_read < 2 {
2021 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2022 _next_ordinal_to_read += 1;
2023 next_offset += envelope_size;
2024 }
2025
2026 let next_out_of_line = decoder.next_out_of_line();
2027 let handles_before = decoder.remaining_handles();
2028 if let Some((inlined, num_bytes, num_handles)) =
2029 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2030 {
2031 let member_inline_size = <fidl_fuchsia_diagnostics_types__common::Severity as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2032 if inlined != (member_inline_size <= 4) {
2033 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2034 }
2035 let inner_offset;
2036 let mut inner_depth = depth.clone();
2037 if inlined {
2038 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2039 inner_offset = next_offset;
2040 } else {
2041 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2042 inner_depth.increment()?;
2043 }
2044 let val_ref = self.log_severity.get_or_insert_with(|| {
2045 fidl::new_empty!(fidl_fuchsia_diagnostics_types__common::Severity, D)
2046 });
2047 fidl::decode!(
2048 fidl_fuchsia_diagnostics_types__common::Severity,
2049 D,
2050 val_ref,
2051 decoder,
2052 inner_offset,
2053 inner_depth
2054 )?;
2055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2056 {
2057 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2058 }
2059 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2060 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2061 }
2062 }
2063
2064 next_offset += envelope_size;
2065
2066 while next_offset < end_offset {
2068 _next_ordinal_to_read += 1;
2069 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2070 next_offset += envelope_size;
2071 }
2072
2073 Ok(())
2074 }
2075 }
2076
2077 impl InspectPuppetCreateInspectorRequest {
2078 #[inline(always)]
2079 fn max_ordinal_present(&self) -> u64 {
2080 if let Some(_) = self.name {
2081 return 1;
2082 }
2083 0
2084 }
2085 }
2086
2087 impl fidl::encoding::ValueTypeMarker for InspectPuppetCreateInspectorRequest {
2088 type Borrowed<'a> = &'a Self;
2089 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2090 value
2091 }
2092 }
2093
2094 unsafe impl fidl::encoding::TypeMarker for InspectPuppetCreateInspectorRequest {
2095 type Owned = Self;
2096
2097 #[inline(always)]
2098 fn inline_align(_context: fidl::encoding::Context) -> usize {
2099 8
2100 }
2101
2102 #[inline(always)]
2103 fn inline_size(_context: fidl::encoding::Context) -> usize {
2104 16
2105 }
2106 }
2107
2108 unsafe impl<D: fidl::encoding::ResourceDialect>
2109 fidl::encoding::Encode<InspectPuppetCreateInspectorRequest, D>
2110 for &InspectPuppetCreateInspectorRequest
2111 {
2112 unsafe fn encode(
2113 self,
2114 encoder: &mut fidl::encoding::Encoder<'_, D>,
2115 offset: usize,
2116 mut depth: fidl::encoding::Depth,
2117 ) -> fidl::Result<()> {
2118 encoder.debug_check_bounds::<InspectPuppetCreateInspectorRequest>(offset);
2119 let max_ordinal: u64 = self.max_ordinal_present();
2121 encoder.write_num(max_ordinal, offset);
2122 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2123 if max_ordinal == 0 {
2125 return Ok(());
2126 }
2127 depth.increment()?;
2128 let envelope_size = 8;
2129 let bytes_len = max_ordinal as usize * envelope_size;
2130 #[allow(unused_variables)]
2131 let offset = encoder.out_of_line_offset(bytes_len);
2132 let mut _prev_end_offset: usize = 0;
2133 if 1 > max_ordinal {
2134 return Ok(());
2135 }
2136
2137 let cur_offset: usize = (1 - 1) * envelope_size;
2140
2141 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2143
2144 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
2149 self.name.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
2150 encoder, offset + cur_offset, depth
2151 )?;
2152
2153 _prev_end_offset = cur_offset + envelope_size;
2154
2155 Ok(())
2156 }
2157 }
2158
2159 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2160 for InspectPuppetCreateInspectorRequest
2161 {
2162 #[inline(always)]
2163 fn new_empty() -> Self {
2164 Self::default()
2165 }
2166
2167 unsafe fn decode(
2168 &mut self,
2169 decoder: &mut fidl::encoding::Decoder<'_, D>,
2170 offset: usize,
2171 mut depth: fidl::encoding::Depth,
2172 ) -> fidl::Result<()> {
2173 decoder.debug_check_bounds::<Self>(offset);
2174 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2175 None => return Err(fidl::Error::NotNullable),
2176 Some(len) => len,
2177 };
2178 if len == 0 {
2180 return Ok(());
2181 };
2182 depth.increment()?;
2183 let envelope_size = 8;
2184 let bytes_len = len * envelope_size;
2185 let offset = decoder.out_of_line_offset(bytes_len)?;
2186 let mut _next_ordinal_to_read = 0;
2188 let mut next_offset = offset;
2189 let end_offset = offset + bytes_len;
2190 _next_ordinal_to_read += 1;
2191 if next_offset >= end_offset {
2192 return Ok(());
2193 }
2194
2195 while _next_ordinal_to_read < 1 {
2197 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2198 _next_ordinal_to_read += 1;
2199 next_offset += envelope_size;
2200 }
2201
2202 let next_out_of_line = decoder.next_out_of_line();
2203 let handles_before = decoder.remaining_handles();
2204 if let Some((inlined, num_bytes, num_handles)) =
2205 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2206 {
2207 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2208 if inlined != (member_inline_size <= 4) {
2209 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2210 }
2211 let inner_offset;
2212 let mut inner_depth = depth.clone();
2213 if inlined {
2214 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2215 inner_offset = next_offset;
2216 } else {
2217 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2218 inner_depth.increment()?;
2219 }
2220 let val_ref = self.name.get_or_insert_with(|| {
2221 fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2222 });
2223 fidl::decode!(
2224 fidl::encoding::BoundedString<4096>,
2225 D,
2226 val_ref,
2227 decoder,
2228 inner_offset,
2229 inner_depth
2230 )?;
2231 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2232 {
2233 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2234 }
2235 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2236 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2237 }
2238 }
2239
2240 next_offset += envelope_size;
2241
2242 while next_offset < end_offset {
2244 _next_ordinal_to_read += 1;
2245 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2246 next_offset += envelope_size;
2247 }
2248
2249 Ok(())
2250 }
2251 }
2252
2253 impl InspectWriterEscrowAndExitRequest {
2254 #[inline(always)]
2255 fn max_ordinal_present(&self) -> u64 {
2256 if let Some(_) = self.name {
2257 return 1;
2258 }
2259 0
2260 }
2261 }
2262
2263 impl fidl::encoding::ValueTypeMarker for InspectWriterEscrowAndExitRequest {
2264 type Borrowed<'a> = &'a Self;
2265 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2266 value
2267 }
2268 }
2269
2270 unsafe impl fidl::encoding::TypeMarker for InspectWriterEscrowAndExitRequest {
2271 type Owned = Self;
2272
2273 #[inline(always)]
2274 fn inline_align(_context: fidl::encoding::Context) -> usize {
2275 8
2276 }
2277
2278 #[inline(always)]
2279 fn inline_size(_context: fidl::encoding::Context) -> usize {
2280 16
2281 }
2282 }
2283
2284 unsafe impl<D: fidl::encoding::ResourceDialect>
2285 fidl::encoding::Encode<InspectWriterEscrowAndExitRequest, D>
2286 for &InspectWriterEscrowAndExitRequest
2287 {
2288 unsafe fn encode(
2289 self,
2290 encoder: &mut fidl::encoding::Encoder<'_, D>,
2291 offset: usize,
2292 mut depth: fidl::encoding::Depth,
2293 ) -> fidl::Result<()> {
2294 encoder.debug_check_bounds::<InspectWriterEscrowAndExitRequest>(offset);
2295 let max_ordinal: u64 = self.max_ordinal_present();
2297 encoder.write_num(max_ordinal, offset);
2298 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2299 if max_ordinal == 0 {
2301 return Ok(());
2302 }
2303 depth.increment()?;
2304 let envelope_size = 8;
2305 let bytes_len = max_ordinal as usize * envelope_size;
2306 #[allow(unused_variables)]
2307 let offset = encoder.out_of_line_offset(bytes_len);
2308 let mut _prev_end_offset: usize = 0;
2309 if 1 > max_ordinal {
2310 return Ok(());
2311 }
2312
2313 let cur_offset: usize = (1 - 1) * envelope_size;
2316
2317 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2319
2320 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
2325 self.name.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
2326 encoder, offset + cur_offset, depth
2327 )?;
2328
2329 _prev_end_offset = cur_offset + envelope_size;
2330
2331 Ok(())
2332 }
2333 }
2334
2335 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2336 for InspectWriterEscrowAndExitRequest
2337 {
2338 #[inline(always)]
2339 fn new_empty() -> Self {
2340 Self::default()
2341 }
2342
2343 unsafe fn decode(
2344 &mut self,
2345 decoder: &mut fidl::encoding::Decoder<'_, D>,
2346 offset: usize,
2347 mut depth: fidl::encoding::Depth,
2348 ) -> fidl::Result<()> {
2349 decoder.debug_check_bounds::<Self>(offset);
2350 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2351 None => return Err(fidl::Error::NotNullable),
2352 Some(len) => len,
2353 };
2354 if len == 0 {
2356 return Ok(());
2357 };
2358 depth.increment()?;
2359 let envelope_size = 8;
2360 let bytes_len = len * envelope_size;
2361 let offset = decoder.out_of_line_offset(bytes_len)?;
2362 let mut _next_ordinal_to_read = 0;
2364 let mut next_offset = offset;
2365 let end_offset = offset + bytes_len;
2366 _next_ordinal_to_read += 1;
2367 if next_offset >= end_offset {
2368 return Ok(());
2369 }
2370
2371 while _next_ordinal_to_read < 1 {
2373 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2374 _next_ordinal_to_read += 1;
2375 next_offset += envelope_size;
2376 }
2377
2378 let next_out_of_line = decoder.next_out_of_line();
2379 let handles_before = decoder.remaining_handles();
2380 if let Some((inlined, num_bytes, num_handles)) =
2381 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2382 {
2383 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2384 if inlined != (member_inline_size <= 4) {
2385 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2386 }
2387 let inner_offset;
2388 let mut inner_depth = depth.clone();
2389 if inlined {
2390 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2391 inner_offset = next_offset;
2392 } else {
2393 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2394 inner_depth.increment()?;
2395 }
2396 let val_ref = self.name.get_or_insert_with(|| {
2397 fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2398 });
2399 fidl::decode!(
2400 fidl::encoding::BoundedString<4096>,
2401 D,
2402 val_ref,
2403 decoder,
2404 inner_offset,
2405 inner_depth
2406 )?;
2407 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2408 {
2409 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2410 }
2411 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2412 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2413 }
2414 }
2415
2416 next_offset += envelope_size;
2417
2418 while next_offset < end_offset {
2420 _next_ordinal_to_read += 1;
2421 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2422 next_offset += envelope_size;
2423 }
2424
2425 Ok(())
2426 }
2427 }
2428
2429 impl LogPuppetLogRequest {
2430 #[inline(always)]
2431 fn max_ordinal_present(&self) -> u64 {
2432 if let Some(_) = self.time {
2433 return 3;
2434 }
2435 if let Some(_) = self.severity {
2436 return 2;
2437 }
2438 if let Some(_) = self.message {
2439 return 1;
2440 }
2441 0
2442 }
2443 }
2444
2445 impl fidl::encoding::ValueTypeMarker for LogPuppetLogRequest {
2446 type Borrowed<'a> = &'a Self;
2447 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2448 value
2449 }
2450 }
2451
2452 unsafe impl fidl::encoding::TypeMarker for LogPuppetLogRequest {
2453 type Owned = Self;
2454
2455 #[inline(always)]
2456 fn inline_align(_context: fidl::encoding::Context) -> usize {
2457 8
2458 }
2459
2460 #[inline(always)]
2461 fn inline_size(_context: fidl::encoding::Context) -> usize {
2462 16
2463 }
2464 }
2465
2466 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogPuppetLogRequest, D>
2467 for &LogPuppetLogRequest
2468 {
2469 unsafe fn encode(
2470 self,
2471 encoder: &mut fidl::encoding::Encoder<'_, D>,
2472 offset: usize,
2473 mut depth: fidl::encoding::Depth,
2474 ) -> fidl::Result<()> {
2475 encoder.debug_check_bounds::<LogPuppetLogRequest>(offset);
2476 let max_ordinal: u64 = self.max_ordinal_present();
2478 encoder.write_num(max_ordinal, offset);
2479 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2480 if max_ordinal == 0 {
2482 return Ok(());
2483 }
2484 depth.increment()?;
2485 let envelope_size = 8;
2486 let bytes_len = max_ordinal as usize * envelope_size;
2487 #[allow(unused_variables)]
2488 let offset = encoder.out_of_line_offset(bytes_len);
2489 let mut _prev_end_offset: usize = 0;
2490 if 1 > max_ordinal {
2491 return Ok(());
2492 }
2493
2494 let cur_offset: usize = (1 - 1) * envelope_size;
2497
2498 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2500
2501 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2506 self.message.as_ref().map(
2507 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2508 ),
2509 encoder,
2510 offset + cur_offset,
2511 depth,
2512 )?;
2513
2514 _prev_end_offset = cur_offset + envelope_size;
2515 if 2 > max_ordinal {
2516 return Ok(());
2517 }
2518
2519 let cur_offset: usize = (2 - 1) * envelope_size;
2522
2523 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2525
2526 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_diagnostics_types__common::Severity, D>(
2531 self.severity.as_ref().map(<fidl_fuchsia_diagnostics_types__common::Severity as fidl::encoding::ValueTypeMarker>::borrow),
2532 encoder, offset + cur_offset, depth
2533 )?;
2534
2535 _prev_end_offset = cur_offset + envelope_size;
2536 if 3 > max_ordinal {
2537 return Ok(());
2538 }
2539
2540 let cur_offset: usize = (3 - 1) * envelope_size;
2543
2544 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2546
2547 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2552 self.time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2553 encoder,
2554 offset + cur_offset,
2555 depth,
2556 )?;
2557
2558 _prev_end_offset = cur_offset + envelope_size;
2559
2560 Ok(())
2561 }
2562 }
2563
2564 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogPuppetLogRequest {
2565 #[inline(always)]
2566 fn new_empty() -> Self {
2567 Self::default()
2568 }
2569
2570 unsafe fn decode(
2571 &mut self,
2572 decoder: &mut fidl::encoding::Decoder<'_, D>,
2573 offset: usize,
2574 mut depth: fidl::encoding::Depth,
2575 ) -> fidl::Result<()> {
2576 decoder.debug_check_bounds::<Self>(offset);
2577 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2578 None => return Err(fidl::Error::NotNullable),
2579 Some(len) => len,
2580 };
2581 if len == 0 {
2583 return Ok(());
2584 };
2585 depth.increment()?;
2586 let envelope_size = 8;
2587 let bytes_len = len * envelope_size;
2588 let offset = decoder.out_of_line_offset(bytes_len)?;
2589 let mut _next_ordinal_to_read = 0;
2591 let mut next_offset = offset;
2592 let end_offset = offset + bytes_len;
2593 _next_ordinal_to_read += 1;
2594 if next_offset >= end_offset {
2595 return Ok(());
2596 }
2597
2598 while _next_ordinal_to_read < 1 {
2600 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2601 _next_ordinal_to_read += 1;
2602 next_offset += envelope_size;
2603 }
2604
2605 let next_out_of_line = decoder.next_out_of_line();
2606 let handles_before = decoder.remaining_handles();
2607 if let Some((inlined, num_bytes, num_handles)) =
2608 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2609 {
2610 let member_inline_size =
2611 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2612 decoder.context,
2613 );
2614 if inlined != (member_inline_size <= 4) {
2615 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2616 }
2617 let inner_offset;
2618 let mut inner_depth = depth.clone();
2619 if inlined {
2620 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2621 inner_offset = next_offset;
2622 } else {
2623 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2624 inner_depth.increment()?;
2625 }
2626 let val_ref = self
2627 .message
2628 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2629 fidl::decode!(
2630 fidl::encoding::UnboundedString,
2631 D,
2632 val_ref,
2633 decoder,
2634 inner_offset,
2635 inner_depth
2636 )?;
2637 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2638 {
2639 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2640 }
2641 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2642 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2643 }
2644 }
2645
2646 next_offset += envelope_size;
2647 _next_ordinal_to_read += 1;
2648 if next_offset >= end_offset {
2649 return Ok(());
2650 }
2651
2652 while _next_ordinal_to_read < 2 {
2654 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2655 _next_ordinal_to_read += 1;
2656 next_offset += envelope_size;
2657 }
2658
2659 let next_out_of_line = decoder.next_out_of_line();
2660 let handles_before = decoder.remaining_handles();
2661 if let Some((inlined, num_bytes, num_handles)) =
2662 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2663 {
2664 let member_inline_size = <fidl_fuchsia_diagnostics_types__common::Severity as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2665 if inlined != (member_inline_size <= 4) {
2666 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2667 }
2668 let inner_offset;
2669 let mut inner_depth = depth.clone();
2670 if inlined {
2671 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2672 inner_offset = next_offset;
2673 } else {
2674 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2675 inner_depth.increment()?;
2676 }
2677 let val_ref = self.severity.get_or_insert_with(|| {
2678 fidl::new_empty!(fidl_fuchsia_diagnostics_types__common::Severity, D)
2679 });
2680 fidl::decode!(
2681 fidl_fuchsia_diagnostics_types__common::Severity,
2682 D,
2683 val_ref,
2684 decoder,
2685 inner_offset,
2686 inner_depth
2687 )?;
2688 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2689 {
2690 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2691 }
2692 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2693 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2694 }
2695 }
2696
2697 next_offset += envelope_size;
2698 _next_ordinal_to_read += 1;
2699 if next_offset >= end_offset {
2700 return Ok(());
2701 }
2702
2703 while _next_ordinal_to_read < 3 {
2705 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2706 _next_ordinal_to_read += 1;
2707 next_offset += envelope_size;
2708 }
2709
2710 let next_out_of_line = decoder.next_out_of_line();
2711 let handles_before = decoder.remaining_handles();
2712 if let Some((inlined, num_bytes, num_handles)) =
2713 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2714 {
2715 let member_inline_size =
2716 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2717 if inlined != (member_inline_size <= 4) {
2718 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2719 }
2720 let inner_offset;
2721 let mut inner_depth = depth.clone();
2722 if inlined {
2723 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2724 inner_offset = next_offset;
2725 } else {
2726 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2727 inner_depth.increment()?;
2728 }
2729 let val_ref = self.time.get_or_insert_with(|| fidl::new_empty!(i64, D));
2730 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2731 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2732 {
2733 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2734 }
2735 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2736 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2737 }
2738 }
2739
2740 next_offset += envelope_size;
2741
2742 while next_offset < end_offset {
2744 _next_ordinal_to_read += 1;
2745 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2746 next_offset += envelope_size;
2747 }
2748
2749 Ok(())
2750 }
2751 }
2752
2753 impl LogPuppetWaitForInterestChangeResponse {
2754 #[inline(always)]
2755 fn max_ordinal_present(&self) -> u64 {
2756 if let Some(_) = self.severity {
2757 return 1;
2758 }
2759 0
2760 }
2761 }
2762
2763 impl fidl::encoding::ValueTypeMarker for LogPuppetWaitForInterestChangeResponse {
2764 type Borrowed<'a> = &'a Self;
2765 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2766 value
2767 }
2768 }
2769
2770 unsafe impl fidl::encoding::TypeMarker for LogPuppetWaitForInterestChangeResponse {
2771 type Owned = Self;
2772
2773 #[inline(always)]
2774 fn inline_align(_context: fidl::encoding::Context) -> usize {
2775 8
2776 }
2777
2778 #[inline(always)]
2779 fn inline_size(_context: fidl::encoding::Context) -> usize {
2780 16
2781 }
2782 }
2783
2784 unsafe impl<D: fidl::encoding::ResourceDialect>
2785 fidl::encoding::Encode<LogPuppetWaitForInterestChangeResponse, D>
2786 for &LogPuppetWaitForInterestChangeResponse
2787 {
2788 unsafe fn encode(
2789 self,
2790 encoder: &mut fidl::encoding::Encoder<'_, D>,
2791 offset: usize,
2792 mut depth: fidl::encoding::Depth,
2793 ) -> fidl::Result<()> {
2794 encoder.debug_check_bounds::<LogPuppetWaitForInterestChangeResponse>(offset);
2795 let max_ordinal: u64 = self.max_ordinal_present();
2797 encoder.write_num(max_ordinal, offset);
2798 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2799 if max_ordinal == 0 {
2801 return Ok(());
2802 }
2803 depth.increment()?;
2804 let envelope_size = 8;
2805 let bytes_len = max_ordinal as usize * envelope_size;
2806 #[allow(unused_variables)]
2807 let offset = encoder.out_of_line_offset(bytes_len);
2808 let mut _prev_end_offset: usize = 0;
2809 if 1 > max_ordinal {
2810 return Ok(());
2811 }
2812
2813 let cur_offset: usize = (1 - 1) * envelope_size;
2816
2817 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2819
2820 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_diagnostics_types__common::Severity, D>(
2825 self.severity.as_ref().map(<fidl_fuchsia_diagnostics_types__common::Severity as fidl::encoding::ValueTypeMarker>::borrow),
2826 encoder, offset + cur_offset, depth
2827 )?;
2828
2829 _prev_end_offset = cur_offset + envelope_size;
2830
2831 Ok(())
2832 }
2833 }
2834
2835 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2836 for LogPuppetWaitForInterestChangeResponse
2837 {
2838 #[inline(always)]
2839 fn new_empty() -> Self {
2840 Self::default()
2841 }
2842
2843 unsafe fn decode(
2844 &mut self,
2845 decoder: &mut fidl::encoding::Decoder<'_, D>,
2846 offset: usize,
2847 mut depth: fidl::encoding::Depth,
2848 ) -> fidl::Result<()> {
2849 decoder.debug_check_bounds::<Self>(offset);
2850 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2851 None => return Err(fidl::Error::NotNullable),
2852 Some(len) => len,
2853 };
2854 if len == 0 {
2856 return Ok(());
2857 };
2858 depth.increment()?;
2859 let envelope_size = 8;
2860 let bytes_len = len * envelope_size;
2861 let offset = decoder.out_of_line_offset(bytes_len)?;
2862 let mut _next_ordinal_to_read = 0;
2864 let mut next_offset = offset;
2865 let end_offset = offset + bytes_len;
2866 _next_ordinal_to_read += 1;
2867 if next_offset >= end_offset {
2868 return Ok(());
2869 }
2870
2871 while _next_ordinal_to_read < 1 {
2873 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2874 _next_ordinal_to_read += 1;
2875 next_offset += envelope_size;
2876 }
2877
2878 let next_out_of_line = decoder.next_out_of_line();
2879 let handles_before = decoder.remaining_handles();
2880 if let Some((inlined, num_bytes, num_handles)) =
2881 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2882 {
2883 let member_inline_size = <fidl_fuchsia_diagnostics_types__common::Severity as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2884 if inlined != (member_inline_size <= 4) {
2885 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2886 }
2887 let inner_offset;
2888 let mut inner_depth = depth.clone();
2889 if inlined {
2890 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2891 inner_offset = next_offset;
2892 } else {
2893 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2894 inner_depth.increment()?;
2895 }
2896 let val_ref = self.severity.get_or_insert_with(|| {
2897 fidl::new_empty!(fidl_fuchsia_diagnostics_types__common::Severity, D)
2898 });
2899 fidl::decode!(
2900 fidl_fuchsia_diagnostics_types__common::Severity,
2901 D,
2902 val_ref,
2903 decoder,
2904 inner_offset,
2905 inner_depth
2906 )?;
2907 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2908 {
2909 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2910 }
2911 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2912 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2913 }
2914 }
2915
2916 next_offset += envelope_size;
2917
2918 while next_offset < end_offset {
2920 _next_ordinal_to_read += 1;
2921 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2922 next_offset += envelope_size;
2923 }
2924
2925 Ok(())
2926 }
2927 }
2928
2929 impl PuppetDecl {
2930 #[inline(always)]
2931 fn max_ordinal_present(&self) -> u64 {
2932 if let Some(_) = self.name {
2933 return 1;
2934 }
2935 0
2936 }
2937 }
2938
2939 impl fidl::encoding::ValueTypeMarker for PuppetDecl {
2940 type Borrowed<'a> = &'a Self;
2941 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2942 value
2943 }
2944 }
2945
2946 unsafe impl fidl::encoding::TypeMarker for PuppetDecl {
2947 type Owned = Self;
2948
2949 #[inline(always)]
2950 fn inline_align(_context: fidl::encoding::Context) -> usize {
2951 8
2952 }
2953
2954 #[inline(always)]
2955 fn inline_size(_context: fidl::encoding::Context) -> usize {
2956 16
2957 }
2958 }
2959
2960 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PuppetDecl, D>
2961 for &PuppetDecl
2962 {
2963 unsafe fn encode(
2964 self,
2965 encoder: &mut fidl::encoding::Encoder<'_, D>,
2966 offset: usize,
2967 mut depth: fidl::encoding::Depth,
2968 ) -> fidl::Result<()> {
2969 encoder.debug_check_bounds::<PuppetDecl>(offset);
2970 let max_ordinal: u64 = self.max_ordinal_present();
2972 encoder.write_num(max_ordinal, offset);
2973 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2974 if max_ordinal == 0 {
2976 return Ok(());
2977 }
2978 depth.increment()?;
2979 let envelope_size = 8;
2980 let bytes_len = max_ordinal as usize * envelope_size;
2981 #[allow(unused_variables)]
2982 let offset = encoder.out_of_line_offset(bytes_len);
2983 let mut _prev_end_offset: usize = 0;
2984 if 1 > max_ordinal {
2985 return Ok(());
2986 }
2987
2988 let cur_offset: usize = (1 - 1) * envelope_size;
2991
2992 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2994
2995 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
3000 self.name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
3001 encoder, offset + cur_offset, depth
3002 )?;
3003
3004 _prev_end_offset = cur_offset + envelope_size;
3005
3006 Ok(())
3007 }
3008 }
3009
3010 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetDecl {
3011 #[inline(always)]
3012 fn new_empty() -> Self {
3013 Self::default()
3014 }
3015
3016 unsafe fn decode(
3017 &mut self,
3018 decoder: &mut fidl::encoding::Decoder<'_, D>,
3019 offset: usize,
3020 mut depth: fidl::encoding::Depth,
3021 ) -> fidl::Result<()> {
3022 decoder.debug_check_bounds::<Self>(offset);
3023 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3024 None => return Err(fidl::Error::NotNullable),
3025 Some(len) => len,
3026 };
3027 if len == 0 {
3029 return Ok(());
3030 };
3031 depth.increment()?;
3032 let envelope_size = 8;
3033 let bytes_len = len * envelope_size;
3034 let offset = decoder.out_of_line_offset(bytes_len)?;
3035 let mut _next_ordinal_to_read = 0;
3037 let mut next_offset = offset;
3038 let end_offset = offset + bytes_len;
3039 _next_ordinal_to_read += 1;
3040 if next_offset >= end_offset {
3041 return Ok(());
3042 }
3043
3044 while _next_ordinal_to_read < 1 {
3046 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3047 _next_ordinal_to_read += 1;
3048 next_offset += envelope_size;
3049 }
3050
3051 let next_out_of_line = decoder.next_out_of_line();
3052 let handles_before = decoder.remaining_handles();
3053 if let Some((inlined, num_bytes, num_handles)) =
3054 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3055 {
3056 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3057 if inlined != (member_inline_size <= 4) {
3058 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3059 }
3060 let inner_offset;
3061 let mut inner_depth = depth.clone();
3062 if inlined {
3063 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3064 inner_offset = next_offset;
3065 } else {
3066 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3067 inner_depth.increment()?;
3068 }
3069 let val_ref = self.name.get_or_insert_with(|| {
3070 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
3071 });
3072 fidl::decode!(
3073 fidl::encoding::BoundedString<1024>,
3074 D,
3075 val_ref,
3076 decoder,
3077 inner_offset,
3078 inner_depth
3079 )?;
3080 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3081 {
3082 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3083 }
3084 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3085 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3086 }
3087 }
3088
3089 next_offset += envelope_size;
3090
3091 while next_offset < end_offset {
3093 _next_ordinal_to_read += 1;
3094 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3095 next_offset += envelope_size;
3096 }
3097
3098 Ok(())
3099 }
3100 }
3101
3102 impl RealmOptions {
3103 #[inline(always)]
3104 fn max_ordinal_present(&self) -> u64 {
3105 if let Some(_) = self.archivist_config {
3106 return 3;
3107 }
3108 if let Some(_) = self.puppets {
3109 return 2;
3110 }
3111 if let Some(_) = self.realm_name {
3112 return 1;
3113 }
3114 0
3115 }
3116 }
3117
3118 impl fidl::encoding::ValueTypeMarker for RealmOptions {
3119 type Borrowed<'a> = &'a Self;
3120 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3121 value
3122 }
3123 }
3124
3125 unsafe impl fidl::encoding::TypeMarker for RealmOptions {
3126 type Owned = Self;
3127
3128 #[inline(always)]
3129 fn inline_align(_context: fidl::encoding::Context) -> usize {
3130 8
3131 }
3132
3133 #[inline(always)]
3134 fn inline_size(_context: fidl::encoding::Context) -> usize {
3135 16
3136 }
3137 }
3138
3139 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RealmOptions, D>
3140 for &RealmOptions
3141 {
3142 unsafe fn encode(
3143 self,
3144 encoder: &mut fidl::encoding::Encoder<'_, D>,
3145 offset: usize,
3146 mut depth: fidl::encoding::Depth,
3147 ) -> fidl::Result<()> {
3148 encoder.debug_check_bounds::<RealmOptions>(offset);
3149 let max_ordinal: u64 = self.max_ordinal_present();
3151 encoder.write_num(max_ordinal, offset);
3152 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3153 if max_ordinal == 0 {
3155 return Ok(());
3156 }
3157 depth.increment()?;
3158 let envelope_size = 8;
3159 let bytes_len = max_ordinal as usize * envelope_size;
3160 #[allow(unused_variables)]
3161 let offset = encoder.out_of_line_offset(bytes_len);
3162 let mut _prev_end_offset: usize = 0;
3163 if 1 > max_ordinal {
3164 return Ok(());
3165 }
3166
3167 let cur_offset: usize = (1 - 1) * envelope_size;
3170
3171 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3173
3174 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
3179 self.realm_name.as_ref().map(
3180 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
3181 ),
3182 encoder,
3183 offset + cur_offset,
3184 depth,
3185 )?;
3186
3187 _prev_end_offset = cur_offset + envelope_size;
3188 if 2 > max_ordinal {
3189 return Ok(());
3190 }
3191
3192 let cur_offset: usize = (2 - 1) * envelope_size;
3195
3196 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3198
3199 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<PuppetDecl>, D>(
3204 self.puppets.as_ref().map(<fidl::encoding::UnboundedVector<PuppetDecl> as fidl::encoding::ValueTypeMarker>::borrow),
3205 encoder, offset + cur_offset, depth
3206 )?;
3207
3208 _prev_end_offset = cur_offset + envelope_size;
3209 if 3 > max_ordinal {
3210 return Ok(());
3211 }
3212
3213 let cur_offset: usize = (3 - 1) * envelope_size;
3216
3217 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3219
3220 fidl::encoding::encode_in_envelope_optional::<ArchivistConfig, D>(
3225 self.archivist_config
3226 .as_ref()
3227 .map(<ArchivistConfig as fidl::encoding::ValueTypeMarker>::borrow),
3228 encoder,
3229 offset + cur_offset,
3230 depth,
3231 )?;
3232
3233 _prev_end_offset = cur_offset + envelope_size;
3234
3235 Ok(())
3236 }
3237 }
3238
3239 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RealmOptions {
3240 #[inline(always)]
3241 fn new_empty() -> Self {
3242 Self::default()
3243 }
3244
3245 unsafe fn decode(
3246 &mut self,
3247 decoder: &mut fidl::encoding::Decoder<'_, D>,
3248 offset: usize,
3249 mut depth: fidl::encoding::Depth,
3250 ) -> fidl::Result<()> {
3251 decoder.debug_check_bounds::<Self>(offset);
3252 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3253 None => return Err(fidl::Error::NotNullable),
3254 Some(len) => len,
3255 };
3256 if len == 0 {
3258 return Ok(());
3259 };
3260 depth.increment()?;
3261 let envelope_size = 8;
3262 let bytes_len = len * envelope_size;
3263 let offset = decoder.out_of_line_offset(bytes_len)?;
3264 let mut _next_ordinal_to_read = 0;
3266 let mut next_offset = offset;
3267 let end_offset = offset + bytes_len;
3268 _next_ordinal_to_read += 1;
3269 if next_offset >= end_offset {
3270 return Ok(());
3271 }
3272
3273 while _next_ordinal_to_read < 1 {
3275 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3276 _next_ordinal_to_read += 1;
3277 next_offset += envelope_size;
3278 }
3279
3280 let next_out_of_line = decoder.next_out_of_line();
3281 let handles_before = decoder.remaining_handles();
3282 if let Some((inlined, num_bytes, num_handles)) =
3283 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3284 {
3285 let member_inline_size =
3286 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
3287 decoder.context,
3288 );
3289 if inlined != (member_inline_size <= 4) {
3290 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3291 }
3292 let inner_offset;
3293 let mut inner_depth = depth.clone();
3294 if inlined {
3295 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3296 inner_offset = next_offset;
3297 } else {
3298 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3299 inner_depth.increment()?;
3300 }
3301 let val_ref = self
3302 .realm_name
3303 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
3304 fidl::decode!(
3305 fidl::encoding::BoundedString<255>,
3306 D,
3307 val_ref,
3308 decoder,
3309 inner_offset,
3310 inner_depth
3311 )?;
3312 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3313 {
3314 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3315 }
3316 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3317 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3318 }
3319 }
3320
3321 next_offset += envelope_size;
3322 _next_ordinal_to_read += 1;
3323 if next_offset >= end_offset {
3324 return Ok(());
3325 }
3326
3327 while _next_ordinal_to_read < 2 {
3329 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3330 _next_ordinal_to_read += 1;
3331 next_offset += envelope_size;
3332 }
3333
3334 let next_out_of_line = decoder.next_out_of_line();
3335 let handles_before = decoder.remaining_handles();
3336 if let Some((inlined, num_bytes, num_handles)) =
3337 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3338 {
3339 let member_inline_size = <fidl::encoding::UnboundedVector<PuppetDecl> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3340 if inlined != (member_inline_size <= 4) {
3341 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3342 }
3343 let inner_offset;
3344 let mut inner_depth = depth.clone();
3345 if inlined {
3346 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3347 inner_offset = next_offset;
3348 } else {
3349 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3350 inner_depth.increment()?;
3351 }
3352 let val_ref = self.puppets.get_or_insert_with(|| {
3353 fidl::new_empty!(fidl::encoding::UnboundedVector<PuppetDecl>, D)
3354 });
3355 fidl::decode!(
3356 fidl::encoding::UnboundedVector<PuppetDecl>,
3357 D,
3358 val_ref,
3359 decoder,
3360 inner_offset,
3361 inner_depth
3362 )?;
3363 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3364 {
3365 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3366 }
3367 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3368 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3369 }
3370 }
3371
3372 next_offset += envelope_size;
3373 _next_ordinal_to_read += 1;
3374 if next_offset >= end_offset {
3375 return Ok(());
3376 }
3377
3378 while _next_ordinal_to_read < 3 {
3380 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3381 _next_ordinal_to_read += 1;
3382 next_offset += envelope_size;
3383 }
3384
3385 let next_out_of_line = decoder.next_out_of_line();
3386 let handles_before = decoder.remaining_handles();
3387 if let Some((inlined, num_bytes, num_handles)) =
3388 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3389 {
3390 let member_inline_size =
3391 <ArchivistConfig as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3392 if inlined != (member_inline_size <= 4) {
3393 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3394 }
3395 let inner_offset;
3396 let mut inner_depth = depth.clone();
3397 if inlined {
3398 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3399 inner_offset = next_offset;
3400 } else {
3401 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3402 inner_depth.increment()?;
3403 }
3404 let val_ref = self
3405 .archivist_config
3406 .get_or_insert_with(|| fidl::new_empty!(ArchivistConfig, D));
3407 fidl::decode!(ArchivistConfig, D, val_ref, decoder, inner_offset, inner_depth)?;
3408 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3409 {
3410 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3411 }
3412 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3413 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3414 }
3415 }
3416
3417 next_offset += envelope_size;
3418
3419 while next_offset < end_offset {
3421 _next_ordinal_to_read += 1;
3422 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3423 next_offset += envelope_size;
3424 }
3425
3426 Ok(())
3427 }
3428 }
3429}