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