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 const MAX_CONNECT_MATCHES: u16 = 5;
12
13pub const MAX_NUM_MATCHES: u16 = 250;
14
15pub const NODE_NAME_MAX: u32 = 255;
16
17#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
19pub enum CompatibilityState {
20 Error,
22 Absent,
24 Supported,
26 Unknown,
28 Unsupported,
30 #[doc(hidden)]
31 __SourceBreaking { unknown_ordinal: u32 },
32}
33
34#[macro_export]
36macro_rules! CompatibilityStateUnknown {
37 () => {
38 _
39 };
40}
41
42impl CompatibilityState {
43 #[inline]
44 pub fn from_primitive(prim: u32) -> Option<Self> {
45 match prim {
46 0 => Some(Self::Error),
47 1 => Some(Self::Absent),
48 2 => Some(Self::Supported),
49 3 => Some(Self::Unknown),
50 4 => Some(Self::Unsupported),
51 _ => None,
52 }
53 }
54
55 #[inline]
56 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
57 match prim {
58 0 => Self::Error,
59 1 => Self::Absent,
60 2 => Self::Supported,
61 3 => Self::Unknown,
62 4 => Self::Unsupported,
63 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
64 }
65 }
66
67 #[inline]
68 pub fn unknown() -> Self {
69 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
70 }
71
72 #[inline]
73 pub const fn into_primitive(self) -> u32 {
74 match self {
75 Self::Error => 0,
76 Self::Absent => 1,
77 Self::Supported => 2,
78 Self::Unknown => 3,
79 Self::Unsupported => 4,
80 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
81 }
82 }
83
84 #[inline]
85 pub fn is_unknown(&self) -> bool {
86 match self {
87 Self::__SourceBreaking { unknown_ordinal: _ } => true,
88 _ => false,
89 }
90 }
91}
92
93#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
94pub enum ConnectCapabilityError {
95 InvalidMoniker,
96 NoMatchingCapabilities,
97 NoMatchingComponent,
98 CapabilityConnectFailed,
99 #[doc(hidden)]
100 __SourceBreaking {
101 unknown_ordinal: u32,
102 },
103}
104
105#[macro_export]
107macro_rules! ConnectCapabilityErrorUnknown {
108 () => {
109 _
110 };
111}
112
113impl ConnectCapabilityError {
114 #[inline]
115 pub fn from_primitive(prim: u32) -> Option<Self> {
116 match prim {
117 1 => Some(Self::InvalidMoniker),
118 2 => Some(Self::NoMatchingCapabilities),
119 3 => Some(Self::NoMatchingComponent),
120 4 => Some(Self::CapabilityConnectFailed),
121 _ => None,
122 }
123 }
124
125 #[inline]
126 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
127 match prim {
128 1 => Self::InvalidMoniker,
129 2 => Self::NoMatchingCapabilities,
130 3 => Self::NoMatchingComponent,
131 4 => Self::CapabilityConnectFailed,
132 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
133 }
134 }
135
136 #[inline]
137 pub fn unknown() -> Self {
138 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
139 }
140
141 #[inline]
142 pub const fn into_primitive(self) -> u32 {
143 match self {
144 Self::InvalidMoniker => 1,
145 Self::NoMatchingCapabilities => 2,
146 Self::NoMatchingComponent => 3,
147 Self::CapabilityConnectFailed => 4,
148 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
149 }
150 }
151
152 #[inline]
153 pub fn is_unknown(&self) -> bool {
154 match self {
155 Self::__SourceBreaking { unknown_ordinal: _ } => true,
156 _ => false,
157 }
158 }
159}
160
161#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
162pub enum IdentifyHostError {
163 ListInterfacesFailed,
164 GetDeviceNameFailed,
165 ProxyConnectionFailed,
166 #[doc(hidden)]
167 __SourceBreaking {
168 unknown_ordinal: u32,
169 },
170}
171
172#[macro_export]
174macro_rules! IdentifyHostErrorUnknown {
175 () => {
176 _
177 };
178}
179
180impl IdentifyHostError {
181 #[inline]
182 pub fn from_primitive(prim: u32) -> Option<Self> {
183 match prim {
184 1 => Some(Self::ListInterfacesFailed),
185 2 => Some(Self::GetDeviceNameFailed),
186 3 => Some(Self::ProxyConnectionFailed),
187 _ => None,
188 }
189 }
190
191 #[inline]
192 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
193 match prim {
194 1 => Self::ListInterfacesFailed,
195 2 => Self::GetDeviceNameFailed,
196 3 => Self::ProxyConnectionFailed,
197 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
198 }
199 }
200
201 #[inline]
202 pub fn unknown() -> Self {
203 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
204 }
205
206 #[inline]
207 pub const fn into_primitive(self) -> u32 {
208 match self {
209 Self::ListInterfacesFailed => 1,
210 Self::GetDeviceNameFailed => 2,
211 Self::ProxyConnectionFailed => 3,
212 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
213 }
214 }
215
216 #[inline]
217 pub fn is_unknown(&self) -> bool {
218 match self {
219 Self::__SourceBreaking { unknown_ordinal: _ } => true,
220 _ => false,
221 }
222 }
223}
224
225#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
226pub enum TunnelError {
227 ConnectFailed,
228 SocketFailed,
229 CallbackError,
230 #[doc(hidden)]
231 __SourceBreaking {
232 unknown_ordinal: u32,
233 },
234}
235
236#[macro_export]
238macro_rules! TunnelErrorUnknown {
239 () => {
240 _
241 };
242}
243
244impl TunnelError {
245 #[inline]
246 pub fn from_primitive(prim: u32) -> Option<Self> {
247 match prim {
248 1 => Some(Self::ConnectFailed),
249 2 => Some(Self::SocketFailed),
250 3 => Some(Self::CallbackError),
251 _ => None,
252 }
253 }
254
255 #[inline]
256 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
257 match prim {
258 1 => Self::ConnectFailed,
259 2 => Self::SocketFailed,
260 3 => Self::CallbackError,
261 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
262 }
263 }
264
265 #[inline]
266 pub fn unknown() -> Self {
267 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
268 }
269
270 #[inline]
271 pub const fn into_primitive(self) -> u32 {
272 match self {
273 Self::ConnectFailed => 1,
274 Self::SocketFailed => 2,
275 Self::CallbackError => 3,
276 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
277 }
278 }
279
280 #[inline]
281 pub fn is_unknown(&self) -> bool {
282 match self {
283 Self::__SourceBreaking { unknown_ordinal: _ } => true,
284 _ => false,
285 }
286 }
287}
288
289#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
291pub struct CompatibilityInfo {
292 pub state: CompatibilityState,
294 pub platform_abi: u64,
296 pub message: String,
298}
299
300impl fidl::Persistable for CompatibilityInfo {}
301
302#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
303pub struct RemoteControlEchoStringRequest {
304 pub value: String,
305}
306
307impl fidl::Persistable for RemoteControlEchoStringRequest {}
308
309#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
310pub struct RemoteControlEchoStringResponse {
311 pub response: String,
312}
313
314impl fidl::Persistable for RemoteControlEchoStringResponse {}
315
316#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
317#[repr(C)]
318pub struct RemoteControlGetBootTimeResponse {
319 pub time: fidl::BootInstant,
320}
321
322impl fidl::Persistable for RemoteControlGetBootTimeResponse {}
323
324#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
325#[repr(C)]
326pub struct RemoteControlGetTimeResponse {
327 pub time: fidl::MonotonicInstant,
328}
329
330impl fidl::Persistable for RemoteControlGetTimeResponse {}
331
332#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
333pub struct RemoteControlLogMessageRequest {
334 pub tag: String,
335 pub message: String,
336 pub severity: fidl_fuchsia_diagnostics_types::Severity,
337}
338
339impl fidl::Persistable for RemoteControlLogMessageRequest {}
340
341#[derive(Clone, Debug, PartialEq)]
342pub struct RemoteControlIdentifyHostResponse {
343 pub response: IdentifyHostResponse,
344}
345
346impl fidl::Persistable for RemoteControlIdentifyHostResponse {}
347
348#[derive(Clone, Debug, Default, PartialEq)]
349pub struct IdentifyHostResponse {
350 pub nodename: Option<String>,
351 pub boot_timestamp_nanos: Option<u64>,
352 pub serial_number: Option<String>,
353 pub ids: Option<Vec<u64>>,
354 pub product_config: Option<String>,
355 pub board_config: Option<String>,
356 pub addresses: Option<Vec<fidl_fuchsia_net::Subnet>>,
357 pub boot_id: Option<u64>,
358 #[doc(hidden)]
359 pub __source_breaking: fidl::marker::SourceBreaking,
360}
361
362impl fidl::Persistable for IdentifyHostResponse {}
363
364mod internal {
365 use super::*;
366 unsafe impl fidl::encoding::TypeMarker for CompatibilityState {
367 type Owned = Self;
368
369 #[inline(always)]
370 fn inline_align(_context: fidl::encoding::Context) -> usize {
371 std::mem::align_of::<u32>()
372 }
373
374 #[inline(always)]
375 fn inline_size(_context: fidl::encoding::Context) -> usize {
376 std::mem::size_of::<u32>()
377 }
378
379 #[inline(always)]
380 fn encode_is_copy() -> bool {
381 false
382 }
383
384 #[inline(always)]
385 fn decode_is_copy() -> bool {
386 false
387 }
388 }
389
390 impl fidl::encoding::ValueTypeMarker for CompatibilityState {
391 type Borrowed<'a> = Self;
392 #[inline(always)]
393 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
394 *value
395 }
396 }
397
398 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
399 for CompatibilityState
400 {
401 #[inline]
402 unsafe fn encode(
403 self,
404 encoder: &mut fidl::encoding::Encoder<'_, D>,
405 offset: usize,
406 _depth: fidl::encoding::Depth,
407 ) -> fidl::Result<()> {
408 encoder.debug_check_bounds::<Self>(offset);
409 encoder.write_num(self.into_primitive(), offset);
410 Ok(())
411 }
412 }
413
414 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompatibilityState {
415 #[inline(always)]
416 fn new_empty() -> Self {
417 Self::unknown()
418 }
419
420 #[inline]
421 unsafe fn decode(
422 &mut self,
423 decoder: &mut fidl::encoding::Decoder<'_, D>,
424 offset: usize,
425 _depth: fidl::encoding::Depth,
426 ) -> fidl::Result<()> {
427 decoder.debug_check_bounds::<Self>(offset);
428 let prim = decoder.read_num::<u32>(offset);
429
430 *self = Self::from_primitive_allow_unknown(prim);
431 Ok(())
432 }
433 }
434 unsafe impl fidl::encoding::TypeMarker for ConnectCapabilityError {
435 type Owned = Self;
436
437 #[inline(always)]
438 fn inline_align(_context: fidl::encoding::Context) -> usize {
439 std::mem::align_of::<u32>()
440 }
441
442 #[inline(always)]
443 fn inline_size(_context: fidl::encoding::Context) -> usize {
444 std::mem::size_of::<u32>()
445 }
446
447 #[inline(always)]
448 fn encode_is_copy() -> bool {
449 false
450 }
451
452 #[inline(always)]
453 fn decode_is_copy() -> bool {
454 false
455 }
456 }
457
458 impl fidl::encoding::ValueTypeMarker for ConnectCapabilityError {
459 type Borrowed<'a> = Self;
460 #[inline(always)]
461 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
462 *value
463 }
464 }
465
466 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
467 for ConnectCapabilityError
468 {
469 #[inline]
470 unsafe fn encode(
471 self,
472 encoder: &mut fidl::encoding::Encoder<'_, D>,
473 offset: usize,
474 _depth: fidl::encoding::Depth,
475 ) -> fidl::Result<()> {
476 encoder.debug_check_bounds::<Self>(offset);
477 encoder.write_num(self.into_primitive(), offset);
478 Ok(())
479 }
480 }
481
482 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
483 for ConnectCapabilityError
484 {
485 #[inline(always)]
486 fn new_empty() -> Self {
487 Self::unknown()
488 }
489
490 #[inline]
491 unsafe fn decode(
492 &mut self,
493 decoder: &mut fidl::encoding::Decoder<'_, D>,
494 offset: usize,
495 _depth: fidl::encoding::Depth,
496 ) -> fidl::Result<()> {
497 decoder.debug_check_bounds::<Self>(offset);
498 let prim = decoder.read_num::<u32>(offset);
499
500 *self = Self::from_primitive_allow_unknown(prim);
501 Ok(())
502 }
503 }
504 unsafe impl fidl::encoding::TypeMarker for IdentifyHostError {
505 type Owned = Self;
506
507 #[inline(always)]
508 fn inline_align(_context: fidl::encoding::Context) -> usize {
509 std::mem::align_of::<u32>()
510 }
511
512 #[inline(always)]
513 fn inline_size(_context: fidl::encoding::Context) -> usize {
514 std::mem::size_of::<u32>()
515 }
516
517 #[inline(always)]
518 fn encode_is_copy() -> bool {
519 false
520 }
521
522 #[inline(always)]
523 fn decode_is_copy() -> bool {
524 false
525 }
526 }
527
528 impl fidl::encoding::ValueTypeMarker for IdentifyHostError {
529 type Borrowed<'a> = Self;
530 #[inline(always)]
531 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
532 *value
533 }
534 }
535
536 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
537 for IdentifyHostError
538 {
539 #[inline]
540 unsafe fn encode(
541 self,
542 encoder: &mut fidl::encoding::Encoder<'_, D>,
543 offset: usize,
544 _depth: fidl::encoding::Depth,
545 ) -> fidl::Result<()> {
546 encoder.debug_check_bounds::<Self>(offset);
547 encoder.write_num(self.into_primitive(), offset);
548 Ok(())
549 }
550 }
551
552 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IdentifyHostError {
553 #[inline(always)]
554 fn new_empty() -> Self {
555 Self::unknown()
556 }
557
558 #[inline]
559 unsafe fn decode(
560 &mut self,
561 decoder: &mut fidl::encoding::Decoder<'_, D>,
562 offset: usize,
563 _depth: fidl::encoding::Depth,
564 ) -> fidl::Result<()> {
565 decoder.debug_check_bounds::<Self>(offset);
566 let prim = decoder.read_num::<u32>(offset);
567
568 *self = Self::from_primitive_allow_unknown(prim);
569 Ok(())
570 }
571 }
572 unsafe impl fidl::encoding::TypeMarker for TunnelError {
573 type Owned = Self;
574
575 #[inline(always)]
576 fn inline_align(_context: fidl::encoding::Context) -> usize {
577 std::mem::align_of::<u32>()
578 }
579
580 #[inline(always)]
581 fn inline_size(_context: fidl::encoding::Context) -> usize {
582 std::mem::size_of::<u32>()
583 }
584
585 #[inline(always)]
586 fn encode_is_copy() -> bool {
587 false
588 }
589
590 #[inline(always)]
591 fn decode_is_copy() -> bool {
592 false
593 }
594 }
595
596 impl fidl::encoding::ValueTypeMarker for TunnelError {
597 type Borrowed<'a> = Self;
598 #[inline(always)]
599 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
600 *value
601 }
602 }
603
604 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TunnelError {
605 #[inline]
606 unsafe fn encode(
607 self,
608 encoder: &mut fidl::encoding::Encoder<'_, D>,
609 offset: usize,
610 _depth: fidl::encoding::Depth,
611 ) -> fidl::Result<()> {
612 encoder.debug_check_bounds::<Self>(offset);
613 encoder.write_num(self.into_primitive(), offset);
614 Ok(())
615 }
616 }
617
618 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TunnelError {
619 #[inline(always)]
620 fn new_empty() -> Self {
621 Self::unknown()
622 }
623
624 #[inline]
625 unsafe fn decode(
626 &mut self,
627 decoder: &mut fidl::encoding::Decoder<'_, D>,
628 offset: usize,
629 _depth: fidl::encoding::Depth,
630 ) -> fidl::Result<()> {
631 decoder.debug_check_bounds::<Self>(offset);
632 let prim = decoder.read_num::<u32>(offset);
633
634 *self = Self::from_primitive_allow_unknown(prim);
635 Ok(())
636 }
637 }
638
639 impl fidl::encoding::ValueTypeMarker for CompatibilityInfo {
640 type Borrowed<'a> = &'a Self;
641 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
642 value
643 }
644 }
645
646 unsafe impl fidl::encoding::TypeMarker for CompatibilityInfo {
647 type Owned = Self;
648
649 #[inline(always)]
650 fn inline_align(_context: fidl::encoding::Context) -> usize {
651 8
652 }
653
654 #[inline(always)]
655 fn inline_size(_context: fidl::encoding::Context) -> usize {
656 32
657 }
658 }
659
660 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompatibilityInfo, D>
661 for &CompatibilityInfo
662 {
663 #[inline]
664 unsafe fn encode(
665 self,
666 encoder: &mut fidl::encoding::Encoder<'_, D>,
667 offset: usize,
668 _depth: fidl::encoding::Depth,
669 ) -> fidl::Result<()> {
670 encoder.debug_check_bounds::<CompatibilityInfo>(offset);
671 fidl::encoding::Encode::<CompatibilityInfo, D>::encode(
673 (
674 <CompatibilityState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
675 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.platform_abi),
676 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
677 &self.message,
678 ),
679 ),
680 encoder,
681 offset,
682 _depth,
683 )
684 }
685 }
686 unsafe impl<
687 D: fidl::encoding::ResourceDialect,
688 T0: fidl::encoding::Encode<CompatibilityState, D>,
689 T1: fidl::encoding::Encode<u64, D>,
690 T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
691 > fidl::encoding::Encode<CompatibilityInfo, D> for (T0, T1, T2)
692 {
693 #[inline]
694 unsafe fn encode(
695 self,
696 encoder: &mut fidl::encoding::Encoder<'_, D>,
697 offset: usize,
698 depth: fidl::encoding::Depth,
699 ) -> fidl::Result<()> {
700 encoder.debug_check_bounds::<CompatibilityInfo>(offset);
701 unsafe {
704 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
705 (ptr as *mut u64).write_unaligned(0);
706 }
707 self.0.encode(encoder, offset + 0, depth)?;
709 self.1.encode(encoder, offset + 8, depth)?;
710 self.2.encode(encoder, offset + 16, depth)?;
711 Ok(())
712 }
713 }
714
715 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompatibilityInfo {
716 #[inline(always)]
717 fn new_empty() -> Self {
718 Self {
719 state: fidl::new_empty!(CompatibilityState, D),
720 platform_abi: fidl::new_empty!(u64, D),
721 message: fidl::new_empty!(fidl::encoding::UnboundedString, D),
722 }
723 }
724
725 #[inline]
726 unsafe fn decode(
727 &mut self,
728 decoder: &mut fidl::encoding::Decoder<'_, D>,
729 offset: usize,
730 _depth: fidl::encoding::Depth,
731 ) -> fidl::Result<()> {
732 decoder.debug_check_bounds::<Self>(offset);
733 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
735 let padval = unsafe { (ptr as *const u64).read_unaligned() };
736 let mask = 0xffffffff00000000u64;
737 let maskedval = padval & mask;
738 if maskedval != 0 {
739 return Err(fidl::Error::NonZeroPadding {
740 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
741 });
742 }
743 fidl::decode!(CompatibilityState, D, &mut self.state, decoder, offset + 0, _depth)?;
744 fidl::decode!(u64, D, &mut self.platform_abi, decoder, offset + 8, _depth)?;
745 fidl::decode!(
746 fidl::encoding::UnboundedString,
747 D,
748 &mut self.message,
749 decoder,
750 offset + 16,
751 _depth
752 )?;
753 Ok(())
754 }
755 }
756
757 impl fidl::encoding::ValueTypeMarker for RemoteControlEchoStringRequest {
758 type Borrowed<'a> = &'a Self;
759 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
760 value
761 }
762 }
763
764 unsafe impl fidl::encoding::TypeMarker for RemoteControlEchoStringRequest {
765 type Owned = Self;
766
767 #[inline(always)]
768 fn inline_align(_context: fidl::encoding::Context) -> usize {
769 8
770 }
771
772 #[inline(always)]
773 fn inline_size(_context: fidl::encoding::Context) -> usize {
774 16
775 }
776 }
777
778 unsafe impl<D: fidl::encoding::ResourceDialect>
779 fidl::encoding::Encode<RemoteControlEchoStringRequest, D>
780 for &RemoteControlEchoStringRequest
781 {
782 #[inline]
783 unsafe fn encode(
784 self,
785 encoder: &mut fidl::encoding::Encoder<'_, D>,
786 offset: usize,
787 _depth: fidl::encoding::Depth,
788 ) -> fidl::Result<()> {
789 encoder.debug_check_bounds::<RemoteControlEchoStringRequest>(offset);
790 fidl::encoding::Encode::<RemoteControlEchoStringRequest, D>::encode(
792 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
793 &self.value,
794 ),),
795 encoder,
796 offset,
797 _depth,
798 )
799 }
800 }
801 unsafe impl<
802 D: fidl::encoding::ResourceDialect,
803 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
804 > fidl::encoding::Encode<RemoteControlEchoStringRequest, D> for (T0,)
805 {
806 #[inline]
807 unsafe fn encode(
808 self,
809 encoder: &mut fidl::encoding::Encoder<'_, D>,
810 offset: usize,
811 depth: fidl::encoding::Depth,
812 ) -> fidl::Result<()> {
813 encoder.debug_check_bounds::<RemoteControlEchoStringRequest>(offset);
814 self.0.encode(encoder, offset + 0, depth)?;
818 Ok(())
819 }
820 }
821
822 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
823 for RemoteControlEchoStringRequest
824 {
825 #[inline(always)]
826 fn new_empty() -> Self {
827 Self { value: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
828 }
829
830 #[inline]
831 unsafe fn decode(
832 &mut self,
833 decoder: &mut fidl::encoding::Decoder<'_, D>,
834 offset: usize,
835 _depth: fidl::encoding::Depth,
836 ) -> fidl::Result<()> {
837 decoder.debug_check_bounds::<Self>(offset);
838 fidl::decode!(
840 fidl::encoding::BoundedString<255>,
841 D,
842 &mut self.value,
843 decoder,
844 offset + 0,
845 _depth
846 )?;
847 Ok(())
848 }
849 }
850
851 impl fidl::encoding::ValueTypeMarker for RemoteControlEchoStringResponse {
852 type Borrowed<'a> = &'a Self;
853 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
854 value
855 }
856 }
857
858 unsafe impl fidl::encoding::TypeMarker for RemoteControlEchoStringResponse {
859 type Owned = Self;
860
861 #[inline(always)]
862 fn inline_align(_context: fidl::encoding::Context) -> usize {
863 8
864 }
865
866 #[inline(always)]
867 fn inline_size(_context: fidl::encoding::Context) -> usize {
868 16
869 }
870 }
871
872 unsafe impl<D: fidl::encoding::ResourceDialect>
873 fidl::encoding::Encode<RemoteControlEchoStringResponse, D>
874 for &RemoteControlEchoStringResponse
875 {
876 #[inline]
877 unsafe fn encode(
878 self,
879 encoder: &mut fidl::encoding::Encoder<'_, D>,
880 offset: usize,
881 _depth: fidl::encoding::Depth,
882 ) -> fidl::Result<()> {
883 encoder.debug_check_bounds::<RemoteControlEchoStringResponse>(offset);
884 fidl::encoding::Encode::<RemoteControlEchoStringResponse, D>::encode(
886 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
887 &self.response,
888 ),),
889 encoder,
890 offset,
891 _depth,
892 )
893 }
894 }
895 unsafe impl<
896 D: fidl::encoding::ResourceDialect,
897 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
898 > fidl::encoding::Encode<RemoteControlEchoStringResponse, D> for (T0,)
899 {
900 #[inline]
901 unsafe fn encode(
902 self,
903 encoder: &mut fidl::encoding::Encoder<'_, D>,
904 offset: usize,
905 depth: fidl::encoding::Depth,
906 ) -> fidl::Result<()> {
907 encoder.debug_check_bounds::<RemoteControlEchoStringResponse>(offset);
908 self.0.encode(encoder, offset + 0, depth)?;
912 Ok(())
913 }
914 }
915
916 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
917 for RemoteControlEchoStringResponse
918 {
919 #[inline(always)]
920 fn new_empty() -> Self {
921 Self { response: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
922 }
923
924 #[inline]
925 unsafe fn decode(
926 &mut self,
927 decoder: &mut fidl::encoding::Decoder<'_, D>,
928 offset: usize,
929 _depth: fidl::encoding::Depth,
930 ) -> fidl::Result<()> {
931 decoder.debug_check_bounds::<Self>(offset);
932 fidl::decode!(
934 fidl::encoding::BoundedString<255>,
935 D,
936 &mut self.response,
937 decoder,
938 offset + 0,
939 _depth
940 )?;
941 Ok(())
942 }
943 }
944
945 impl fidl::encoding::ValueTypeMarker for RemoteControlGetBootTimeResponse {
946 type Borrowed<'a> = &'a Self;
947 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
948 value
949 }
950 }
951
952 unsafe impl fidl::encoding::TypeMarker for RemoteControlGetBootTimeResponse {
953 type Owned = Self;
954
955 #[inline(always)]
956 fn inline_align(_context: fidl::encoding::Context) -> usize {
957 8
958 }
959
960 #[inline(always)]
961 fn inline_size(_context: fidl::encoding::Context) -> usize {
962 8
963 }
964 #[inline(always)]
965 fn encode_is_copy() -> bool {
966 true
967 }
968
969 #[inline(always)]
970 fn decode_is_copy() -> bool {
971 true
972 }
973 }
974
975 unsafe impl<D: fidl::encoding::ResourceDialect>
976 fidl::encoding::Encode<RemoteControlGetBootTimeResponse, D>
977 for &RemoteControlGetBootTimeResponse
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::<RemoteControlGetBootTimeResponse>(offset);
987 unsafe {
988 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
990 (buf_ptr as *mut RemoteControlGetBootTimeResponse)
991 .write_unaligned((self as *const RemoteControlGetBootTimeResponse).read());
992 }
995 Ok(())
996 }
997 }
998 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<fidl::BootInstant, D>>
999 fidl::encoding::Encode<RemoteControlGetBootTimeResponse, D> for (T0,)
1000 {
1001 #[inline]
1002 unsafe fn encode(
1003 self,
1004 encoder: &mut fidl::encoding::Encoder<'_, D>,
1005 offset: usize,
1006 depth: fidl::encoding::Depth,
1007 ) -> fidl::Result<()> {
1008 encoder.debug_check_bounds::<RemoteControlGetBootTimeResponse>(offset);
1009 self.0.encode(encoder, offset + 0, depth)?;
1013 Ok(())
1014 }
1015 }
1016
1017 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1018 for RemoteControlGetBootTimeResponse
1019 {
1020 #[inline(always)]
1021 fn new_empty() -> Self {
1022 Self { time: fidl::new_empty!(fidl::BootInstant, 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 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1034 unsafe {
1037 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1038 }
1039 Ok(())
1040 }
1041 }
1042
1043 impl fidl::encoding::ValueTypeMarker for RemoteControlGetTimeResponse {
1044 type Borrowed<'a> = &'a Self;
1045 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1046 value
1047 }
1048 }
1049
1050 unsafe impl fidl::encoding::TypeMarker for RemoteControlGetTimeResponse {
1051 type Owned = Self;
1052
1053 #[inline(always)]
1054 fn inline_align(_context: fidl::encoding::Context) -> usize {
1055 8
1056 }
1057
1058 #[inline(always)]
1059 fn inline_size(_context: fidl::encoding::Context) -> usize {
1060 8
1061 }
1062 #[inline(always)]
1063 fn encode_is_copy() -> bool {
1064 true
1065 }
1066
1067 #[inline(always)]
1068 fn decode_is_copy() -> bool {
1069 true
1070 }
1071 }
1072
1073 unsafe impl<D: fidl::encoding::ResourceDialect>
1074 fidl::encoding::Encode<RemoteControlGetTimeResponse, D> for &RemoteControlGetTimeResponse
1075 {
1076 #[inline]
1077 unsafe fn encode(
1078 self,
1079 encoder: &mut fidl::encoding::Encoder<'_, D>,
1080 offset: usize,
1081 _depth: fidl::encoding::Depth,
1082 ) -> fidl::Result<()> {
1083 encoder.debug_check_bounds::<RemoteControlGetTimeResponse>(offset);
1084 unsafe {
1085 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1087 (buf_ptr as *mut RemoteControlGetTimeResponse)
1088 .write_unaligned((self as *const RemoteControlGetTimeResponse).read());
1089 }
1092 Ok(())
1093 }
1094 }
1095 unsafe impl<
1096 D: fidl::encoding::ResourceDialect,
1097 T0: fidl::encoding::Encode<fidl::MonotonicInstant, D>,
1098 > fidl::encoding::Encode<RemoteControlGetTimeResponse, D> for (T0,)
1099 {
1100 #[inline]
1101 unsafe fn encode(
1102 self,
1103 encoder: &mut fidl::encoding::Encoder<'_, D>,
1104 offset: usize,
1105 depth: fidl::encoding::Depth,
1106 ) -> fidl::Result<()> {
1107 encoder.debug_check_bounds::<RemoteControlGetTimeResponse>(offset);
1108 self.0.encode(encoder, offset + 0, depth)?;
1112 Ok(())
1113 }
1114 }
1115
1116 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1117 for RemoteControlGetTimeResponse
1118 {
1119 #[inline(always)]
1120 fn new_empty() -> Self {
1121 Self { time: fidl::new_empty!(fidl::MonotonicInstant, D) }
1122 }
1123
1124 #[inline]
1125 unsafe fn decode(
1126 &mut self,
1127 decoder: &mut fidl::encoding::Decoder<'_, D>,
1128 offset: usize,
1129 _depth: fidl::encoding::Depth,
1130 ) -> fidl::Result<()> {
1131 decoder.debug_check_bounds::<Self>(offset);
1132 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1133 unsafe {
1136 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1137 }
1138 Ok(())
1139 }
1140 }
1141
1142 impl fidl::encoding::ValueTypeMarker for RemoteControlLogMessageRequest {
1143 type Borrowed<'a> = &'a Self;
1144 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1145 value
1146 }
1147 }
1148
1149 unsafe impl fidl::encoding::TypeMarker for RemoteControlLogMessageRequest {
1150 type Owned = Self;
1151
1152 #[inline(always)]
1153 fn inline_align(_context: fidl::encoding::Context) -> usize {
1154 8
1155 }
1156
1157 #[inline(always)]
1158 fn inline_size(_context: fidl::encoding::Context) -> usize {
1159 40
1160 }
1161 }
1162
1163 unsafe impl<D: fidl::encoding::ResourceDialect>
1164 fidl::encoding::Encode<RemoteControlLogMessageRequest, D>
1165 for &RemoteControlLogMessageRequest
1166 {
1167 #[inline]
1168 unsafe fn encode(
1169 self,
1170 encoder: &mut fidl::encoding::Encoder<'_, D>,
1171 offset: usize,
1172 _depth: fidl::encoding::Depth,
1173 ) -> fidl::Result<()> {
1174 encoder.debug_check_bounds::<RemoteControlLogMessageRequest>(offset);
1175 fidl::encoding::Encode::<RemoteControlLogMessageRequest, D>::encode(
1177 (
1178 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.tag),
1179 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.message),
1180 <fidl_fuchsia_diagnostics_types::Severity as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
1181 ),
1182 encoder, offset, _depth
1183 )
1184 }
1185 }
1186 unsafe impl<
1187 D: fidl::encoding::ResourceDialect,
1188 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1189 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1190 T2: fidl::encoding::Encode<fidl_fuchsia_diagnostics_types::Severity, D>,
1191 > fidl::encoding::Encode<RemoteControlLogMessageRequest, D> for (T0, T1, T2)
1192 {
1193 #[inline]
1194 unsafe fn encode(
1195 self,
1196 encoder: &mut fidl::encoding::Encoder<'_, D>,
1197 offset: usize,
1198 depth: fidl::encoding::Depth,
1199 ) -> fidl::Result<()> {
1200 encoder.debug_check_bounds::<RemoteControlLogMessageRequest>(offset);
1201 unsafe {
1204 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
1205 (ptr as *mut u64).write_unaligned(0);
1206 }
1207 self.0.encode(encoder, offset + 0, depth)?;
1209 self.1.encode(encoder, offset + 16, depth)?;
1210 self.2.encode(encoder, offset + 32, depth)?;
1211 Ok(())
1212 }
1213 }
1214
1215 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1216 for RemoteControlLogMessageRequest
1217 {
1218 #[inline(always)]
1219 fn new_empty() -> Self {
1220 Self {
1221 tag: fidl::new_empty!(fidl::encoding::UnboundedString, D),
1222 message: fidl::new_empty!(fidl::encoding::UnboundedString, D),
1223 severity: fidl::new_empty!(fidl_fuchsia_diagnostics_types::Severity, D),
1224 }
1225 }
1226
1227 #[inline]
1228 unsafe fn decode(
1229 &mut self,
1230 decoder: &mut fidl::encoding::Decoder<'_, D>,
1231 offset: usize,
1232 _depth: fidl::encoding::Depth,
1233 ) -> fidl::Result<()> {
1234 decoder.debug_check_bounds::<Self>(offset);
1235 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
1237 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1238 let mask = 0xffffffffffffff00u64;
1239 let maskedval = padval & mask;
1240 if maskedval != 0 {
1241 return Err(fidl::Error::NonZeroPadding {
1242 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
1243 });
1244 }
1245 fidl::decode!(
1246 fidl::encoding::UnboundedString,
1247 D,
1248 &mut self.tag,
1249 decoder,
1250 offset + 0,
1251 _depth
1252 )?;
1253 fidl::decode!(
1254 fidl::encoding::UnboundedString,
1255 D,
1256 &mut self.message,
1257 decoder,
1258 offset + 16,
1259 _depth
1260 )?;
1261 fidl::decode!(
1262 fidl_fuchsia_diagnostics_types::Severity,
1263 D,
1264 &mut self.severity,
1265 decoder,
1266 offset + 32,
1267 _depth
1268 )?;
1269 Ok(())
1270 }
1271 }
1272
1273 impl fidl::encoding::ValueTypeMarker for RemoteControlIdentifyHostResponse {
1274 type Borrowed<'a> = &'a Self;
1275 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1276 value
1277 }
1278 }
1279
1280 unsafe impl fidl::encoding::TypeMarker for RemoteControlIdentifyHostResponse {
1281 type Owned = Self;
1282
1283 #[inline(always)]
1284 fn inline_align(_context: fidl::encoding::Context) -> usize {
1285 8
1286 }
1287
1288 #[inline(always)]
1289 fn inline_size(_context: fidl::encoding::Context) -> usize {
1290 16
1291 }
1292 }
1293
1294 unsafe impl<D: fidl::encoding::ResourceDialect>
1295 fidl::encoding::Encode<RemoteControlIdentifyHostResponse, D>
1296 for &RemoteControlIdentifyHostResponse
1297 {
1298 #[inline]
1299 unsafe fn encode(
1300 self,
1301 encoder: &mut fidl::encoding::Encoder<'_, D>,
1302 offset: usize,
1303 _depth: fidl::encoding::Depth,
1304 ) -> fidl::Result<()> {
1305 encoder.debug_check_bounds::<RemoteControlIdentifyHostResponse>(offset);
1306 fidl::encoding::Encode::<RemoteControlIdentifyHostResponse, D>::encode(
1308 (<IdentifyHostResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1309 encoder,
1310 offset,
1311 _depth,
1312 )
1313 }
1314 }
1315 unsafe impl<
1316 D: fidl::encoding::ResourceDialect,
1317 T0: fidl::encoding::Encode<IdentifyHostResponse, D>,
1318 > fidl::encoding::Encode<RemoteControlIdentifyHostResponse, D> for (T0,)
1319 {
1320 #[inline]
1321 unsafe fn encode(
1322 self,
1323 encoder: &mut fidl::encoding::Encoder<'_, D>,
1324 offset: usize,
1325 depth: fidl::encoding::Depth,
1326 ) -> fidl::Result<()> {
1327 encoder.debug_check_bounds::<RemoteControlIdentifyHostResponse>(offset);
1328 self.0.encode(encoder, offset + 0, depth)?;
1332 Ok(())
1333 }
1334 }
1335
1336 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1337 for RemoteControlIdentifyHostResponse
1338 {
1339 #[inline(always)]
1340 fn new_empty() -> Self {
1341 Self { response: fidl::new_empty!(IdentifyHostResponse, D) }
1342 }
1343
1344 #[inline]
1345 unsafe fn decode(
1346 &mut self,
1347 decoder: &mut fidl::encoding::Decoder<'_, D>,
1348 offset: usize,
1349 _depth: fidl::encoding::Depth,
1350 ) -> fidl::Result<()> {
1351 decoder.debug_check_bounds::<Self>(offset);
1352 fidl::decode!(
1354 IdentifyHostResponse,
1355 D,
1356 &mut self.response,
1357 decoder,
1358 offset + 0,
1359 _depth
1360 )?;
1361 Ok(())
1362 }
1363 }
1364
1365 impl IdentifyHostResponse {
1366 #[inline(always)]
1367 fn max_ordinal_present(&self) -> u64 {
1368 if let Some(_) = self.boot_id {
1369 return 9;
1370 }
1371 if let Some(_) = self.addresses {
1372 return 8;
1373 }
1374 if let Some(_) = self.board_config {
1375 return 7;
1376 }
1377 if let Some(_) = self.product_config {
1378 return 6;
1379 }
1380 if let Some(_) = self.ids {
1381 return 5;
1382 }
1383 if let Some(_) = self.serial_number {
1384 return 4;
1385 }
1386 if let Some(_) = self.boot_timestamp_nanos {
1387 return 3;
1388 }
1389 if let Some(_) = self.nodename {
1390 return 2;
1391 }
1392 0
1393 }
1394 }
1395
1396 impl fidl::encoding::ValueTypeMarker for IdentifyHostResponse {
1397 type Borrowed<'a> = &'a Self;
1398 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1399 value
1400 }
1401 }
1402
1403 unsafe impl fidl::encoding::TypeMarker for IdentifyHostResponse {
1404 type Owned = Self;
1405
1406 #[inline(always)]
1407 fn inline_align(_context: fidl::encoding::Context) -> usize {
1408 8
1409 }
1410
1411 #[inline(always)]
1412 fn inline_size(_context: fidl::encoding::Context) -> usize {
1413 16
1414 }
1415 }
1416
1417 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IdentifyHostResponse, D>
1418 for &IdentifyHostResponse
1419 {
1420 unsafe fn encode(
1421 self,
1422 encoder: &mut fidl::encoding::Encoder<'_, D>,
1423 offset: usize,
1424 mut depth: fidl::encoding::Depth,
1425 ) -> fidl::Result<()> {
1426 encoder.debug_check_bounds::<IdentifyHostResponse>(offset);
1427 let max_ordinal: u64 = self.max_ordinal_present();
1429 encoder.write_num(max_ordinal, offset);
1430 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1431 if max_ordinal == 0 {
1433 return Ok(());
1434 }
1435 depth.increment()?;
1436 let envelope_size = 8;
1437 let bytes_len = max_ordinal as usize * envelope_size;
1438 #[allow(unused_variables)]
1439 let offset = encoder.out_of_line_offset(bytes_len);
1440 let mut _prev_end_offset: usize = 0;
1441 if 2 > max_ordinal {
1442 return Ok(());
1443 }
1444
1445 let cur_offset: usize = (2 - 1) * envelope_size;
1448
1449 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1451
1452 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
1457 self.nodename.as_ref().map(
1458 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
1459 ),
1460 encoder,
1461 offset + cur_offset,
1462 depth,
1463 )?;
1464
1465 _prev_end_offset = cur_offset + envelope_size;
1466 if 3 > max_ordinal {
1467 return Ok(());
1468 }
1469
1470 let cur_offset: usize = (3 - 1) * envelope_size;
1473
1474 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1476
1477 fidl::encoding::encode_in_envelope_optional::<u64, D>(
1482 self.boot_timestamp_nanos
1483 .as_ref()
1484 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1485 encoder,
1486 offset + cur_offset,
1487 depth,
1488 )?;
1489
1490 _prev_end_offset = cur_offset + envelope_size;
1491 if 4 > max_ordinal {
1492 return Ok(());
1493 }
1494
1495 let cur_offset: usize = (4 - 1) * envelope_size;
1498
1499 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1501
1502 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
1507 self.serial_number.as_ref().map(
1508 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
1509 ),
1510 encoder,
1511 offset + cur_offset,
1512 depth,
1513 )?;
1514
1515 _prev_end_offset = cur_offset + envelope_size;
1516 if 5 > max_ordinal {
1517 return Ok(());
1518 }
1519
1520 let cur_offset: usize = (5 - 1) * envelope_size;
1523
1524 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1526
1527 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u64>, D>(
1532 self.ids.as_ref().map(<fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow),
1533 encoder, offset + cur_offset, depth
1534 )?;
1535
1536 _prev_end_offset = cur_offset + envelope_size;
1537 if 6 > max_ordinal {
1538 return Ok(());
1539 }
1540
1541 let cur_offset: usize = (6 - 1) * envelope_size;
1544
1545 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1547
1548 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
1553 self.product_config.as_ref().map(
1554 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
1555 ),
1556 encoder,
1557 offset + cur_offset,
1558 depth,
1559 )?;
1560
1561 _prev_end_offset = cur_offset + envelope_size;
1562 if 7 > max_ordinal {
1563 return Ok(());
1564 }
1565
1566 let cur_offset: usize = (7 - 1) * envelope_size;
1569
1570 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1572
1573 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
1578 self.board_config.as_ref().map(
1579 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
1580 ),
1581 encoder,
1582 offset + cur_offset,
1583 depth,
1584 )?;
1585
1586 _prev_end_offset = cur_offset + envelope_size;
1587 if 8 > max_ordinal {
1588 return Ok(());
1589 }
1590
1591 let cur_offset: usize = (8 - 1) * envelope_size;
1594
1595 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1597
1598 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>, D>(
1603 self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
1604 encoder, offset + cur_offset, depth
1605 )?;
1606
1607 _prev_end_offset = cur_offset + envelope_size;
1608 if 9 > max_ordinal {
1609 return Ok(());
1610 }
1611
1612 let cur_offset: usize = (9 - 1) * envelope_size;
1615
1616 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1618
1619 fidl::encoding::encode_in_envelope_optional::<u64, D>(
1624 self.boot_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1625 encoder,
1626 offset + cur_offset,
1627 depth,
1628 )?;
1629
1630 _prev_end_offset = cur_offset + envelope_size;
1631
1632 Ok(())
1633 }
1634 }
1635
1636 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IdentifyHostResponse {
1637 #[inline(always)]
1638 fn new_empty() -> Self {
1639 Self::default()
1640 }
1641
1642 unsafe fn decode(
1643 &mut self,
1644 decoder: &mut fidl::encoding::Decoder<'_, D>,
1645 offset: usize,
1646 mut depth: fidl::encoding::Depth,
1647 ) -> fidl::Result<()> {
1648 decoder.debug_check_bounds::<Self>(offset);
1649 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1650 None => return Err(fidl::Error::NotNullable),
1651 Some(len) => len,
1652 };
1653 if len == 0 {
1655 return Ok(());
1656 };
1657 depth.increment()?;
1658 let envelope_size = 8;
1659 let bytes_len = len * envelope_size;
1660 let offset = decoder.out_of_line_offset(bytes_len)?;
1661 let mut _next_ordinal_to_read = 0;
1663 let mut next_offset = offset;
1664 let end_offset = offset + bytes_len;
1665 _next_ordinal_to_read += 1;
1666 if next_offset >= end_offset {
1667 return Ok(());
1668 }
1669
1670 while _next_ordinal_to_read < 2 {
1672 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1673 _next_ordinal_to_read += 1;
1674 next_offset += envelope_size;
1675 }
1676
1677 let next_out_of_line = decoder.next_out_of_line();
1678 let handles_before = decoder.remaining_handles();
1679 if let Some((inlined, num_bytes, num_handles)) =
1680 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1681 {
1682 let member_inline_size =
1683 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
1684 decoder.context,
1685 );
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
1699 .nodename
1700 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
1701 fidl::decode!(
1702 fidl::encoding::BoundedString<255>,
1703 D,
1704 val_ref,
1705 decoder,
1706 inner_offset,
1707 inner_depth
1708 )?;
1709 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1710 {
1711 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1712 }
1713 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1714 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1715 }
1716 }
1717
1718 next_offset += envelope_size;
1719 _next_ordinal_to_read += 1;
1720 if next_offset >= end_offset {
1721 return Ok(());
1722 }
1723
1724 while _next_ordinal_to_read < 3 {
1726 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1727 _next_ordinal_to_read += 1;
1728 next_offset += envelope_size;
1729 }
1730
1731 let next_out_of_line = decoder.next_out_of_line();
1732 let handles_before = decoder.remaining_handles();
1733 if let Some((inlined, num_bytes, num_handles)) =
1734 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1735 {
1736 let member_inline_size =
1737 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1738 if inlined != (member_inline_size <= 4) {
1739 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1740 }
1741 let inner_offset;
1742 let mut inner_depth = depth.clone();
1743 if inlined {
1744 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1745 inner_offset = next_offset;
1746 } else {
1747 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1748 inner_depth.increment()?;
1749 }
1750 let val_ref =
1751 self.boot_timestamp_nanos.get_or_insert_with(|| fidl::new_empty!(u64, D));
1752 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1753 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1754 {
1755 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1756 }
1757 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1758 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1759 }
1760 }
1761
1762 next_offset += envelope_size;
1763 _next_ordinal_to_read += 1;
1764 if next_offset >= end_offset {
1765 return Ok(());
1766 }
1767
1768 while _next_ordinal_to_read < 4 {
1770 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1771 _next_ordinal_to_read += 1;
1772 next_offset += envelope_size;
1773 }
1774
1775 let next_out_of_line = decoder.next_out_of_line();
1776 let handles_before = decoder.remaining_handles();
1777 if let Some((inlined, num_bytes, num_handles)) =
1778 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1779 {
1780 let member_inline_size =
1781 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
1782 decoder.context,
1783 );
1784 if inlined != (member_inline_size <= 4) {
1785 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1786 }
1787 let inner_offset;
1788 let mut inner_depth = depth.clone();
1789 if inlined {
1790 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1791 inner_offset = next_offset;
1792 } else {
1793 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1794 inner_depth.increment()?;
1795 }
1796 let val_ref = self
1797 .serial_number
1798 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
1799 fidl::decode!(
1800 fidl::encoding::BoundedString<255>,
1801 D,
1802 val_ref,
1803 decoder,
1804 inner_offset,
1805 inner_depth
1806 )?;
1807 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1808 {
1809 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1810 }
1811 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1812 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1813 }
1814 }
1815
1816 next_offset += envelope_size;
1817 _next_ordinal_to_read += 1;
1818 if next_offset >= end_offset {
1819 return Ok(());
1820 }
1821
1822 while _next_ordinal_to_read < 5 {
1824 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1825 _next_ordinal_to_read += 1;
1826 next_offset += envelope_size;
1827 }
1828
1829 let next_out_of_line = decoder.next_out_of_line();
1830 let handles_before = decoder.remaining_handles();
1831 if let Some((inlined, num_bytes, num_handles)) =
1832 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1833 {
1834 let member_inline_size = <fidl::encoding::UnboundedVector<u64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1835 if inlined != (member_inline_size <= 4) {
1836 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1837 }
1838 let inner_offset;
1839 let mut inner_depth = depth.clone();
1840 if inlined {
1841 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1842 inner_offset = next_offset;
1843 } else {
1844 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1845 inner_depth.increment()?;
1846 }
1847 let val_ref = self.ids.get_or_insert_with(|| {
1848 fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D)
1849 });
1850 fidl::decode!(
1851 fidl::encoding::UnboundedVector<u64>,
1852 D,
1853 val_ref,
1854 decoder,
1855 inner_offset,
1856 inner_depth
1857 )?;
1858 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1859 {
1860 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1861 }
1862 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1863 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1864 }
1865 }
1866
1867 next_offset += envelope_size;
1868 _next_ordinal_to_read += 1;
1869 if next_offset >= end_offset {
1870 return Ok(());
1871 }
1872
1873 while _next_ordinal_to_read < 6 {
1875 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1876 _next_ordinal_to_read += 1;
1877 next_offset += envelope_size;
1878 }
1879
1880 let next_out_of_line = decoder.next_out_of_line();
1881 let handles_before = decoder.remaining_handles();
1882 if let Some((inlined, num_bytes, num_handles)) =
1883 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1884 {
1885 let member_inline_size =
1886 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
1887 decoder.context,
1888 );
1889 if inlined != (member_inline_size <= 4) {
1890 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1891 }
1892 let inner_offset;
1893 let mut inner_depth = depth.clone();
1894 if inlined {
1895 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1896 inner_offset = next_offset;
1897 } else {
1898 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1899 inner_depth.increment()?;
1900 }
1901 let val_ref = self
1902 .product_config
1903 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
1904 fidl::decode!(
1905 fidl::encoding::BoundedString<100>,
1906 D,
1907 val_ref,
1908 decoder,
1909 inner_offset,
1910 inner_depth
1911 )?;
1912 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1913 {
1914 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1915 }
1916 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1917 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1918 }
1919 }
1920
1921 next_offset += envelope_size;
1922 _next_ordinal_to_read += 1;
1923 if next_offset >= end_offset {
1924 return Ok(());
1925 }
1926
1927 while _next_ordinal_to_read < 7 {
1929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1930 _next_ordinal_to_read += 1;
1931 next_offset += envelope_size;
1932 }
1933
1934 let next_out_of_line = decoder.next_out_of_line();
1935 let handles_before = decoder.remaining_handles();
1936 if let Some((inlined, num_bytes, num_handles)) =
1937 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1938 {
1939 let member_inline_size =
1940 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
1941 decoder.context,
1942 );
1943 if inlined != (member_inline_size <= 4) {
1944 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1945 }
1946 let inner_offset;
1947 let mut inner_depth = depth.clone();
1948 if inlined {
1949 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1950 inner_offset = next_offset;
1951 } else {
1952 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1953 inner_depth.increment()?;
1954 }
1955 let val_ref = self
1956 .board_config
1957 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
1958 fidl::decode!(
1959 fidl::encoding::BoundedString<100>,
1960 D,
1961 val_ref,
1962 decoder,
1963 inner_offset,
1964 inner_depth
1965 )?;
1966 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1967 {
1968 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1969 }
1970 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1971 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1972 }
1973 }
1974
1975 next_offset += envelope_size;
1976 _next_ordinal_to_read += 1;
1977 if next_offset >= end_offset {
1978 return Ok(());
1979 }
1980
1981 while _next_ordinal_to_read < 8 {
1983 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1984 _next_ordinal_to_read += 1;
1985 next_offset += envelope_size;
1986 }
1987
1988 let next_out_of_line = decoder.next_out_of_line();
1989 let handles_before = decoder.remaining_handles();
1990 if let Some((inlined, num_bytes, num_handles)) =
1991 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1992 {
1993 let member_inline_size = <fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1994 if inlined != (member_inline_size <= 4) {
1995 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1996 }
1997 let inner_offset;
1998 let mut inner_depth = depth.clone();
1999 if inlined {
2000 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2001 inner_offset = next_offset;
2002 } else {
2003 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2004 inner_depth.increment()?;
2005 }
2006 let val_ref = self.addresses.get_or_insert_with(|| {
2007 fidl::new_empty!(fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>, D)
2008 });
2009 fidl::decode!(
2010 fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>,
2011 D,
2012 val_ref,
2013 decoder,
2014 inner_offset,
2015 inner_depth
2016 )?;
2017 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2018 {
2019 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2020 }
2021 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2022 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2023 }
2024 }
2025
2026 next_offset += envelope_size;
2027 _next_ordinal_to_read += 1;
2028 if next_offset >= end_offset {
2029 return Ok(());
2030 }
2031
2032 while _next_ordinal_to_read < 9 {
2034 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2035 _next_ordinal_to_read += 1;
2036 next_offset += envelope_size;
2037 }
2038
2039 let next_out_of_line = decoder.next_out_of_line();
2040 let handles_before = decoder.remaining_handles();
2041 if let Some((inlined, num_bytes, num_handles)) =
2042 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2043 {
2044 let member_inline_size =
2045 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2046 if inlined != (member_inline_size <= 4) {
2047 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2048 }
2049 let inner_offset;
2050 let mut inner_depth = depth.clone();
2051 if inlined {
2052 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2053 inner_offset = next_offset;
2054 } else {
2055 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2056 inner_depth.increment()?;
2057 }
2058 let val_ref = self.boot_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
2059 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2060 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2061 {
2062 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2063 }
2064 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2065 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2066 }
2067 }
2068
2069 next_offset += envelope_size;
2070
2071 while next_offset < end_offset {
2073 _next_ordinal_to_read += 1;
2074 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2075 next_offset += envelope_size;
2076 }
2077
2078 Ok(())
2079 }
2080 }
2081}