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