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