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