fidl_fuchsia_diagnostics_crasher_common/
fidl_fuchsia_diagnostics_crasher_common.rs1#![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_MESSAGE_LEN: u32 = 256;
14
15#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16pub struct CrasherCrashRequest {
17 pub message: String,
18}
19
20impl fidl::Persistable for CrasherCrashRequest {}
21
22mod internal {
23 use super::*;
24
25 impl fidl::encoding::ValueTypeMarker for CrasherCrashRequest {
26 type Borrowed<'a> = &'a Self;
27 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
28 value
29 }
30 }
31
32 unsafe impl fidl::encoding::TypeMarker for CrasherCrashRequest {
33 type Owned = Self;
34
35 #[inline(always)]
36 fn inline_align(_context: fidl::encoding::Context) -> usize {
37 8
38 }
39
40 #[inline(always)]
41 fn inline_size(_context: fidl::encoding::Context) -> usize {
42 16
43 }
44 }
45
46 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CrasherCrashRequest, D>
47 for &CrasherCrashRequest
48 {
49 #[inline]
50 unsafe fn encode(
51 self,
52 encoder: &mut fidl::encoding::Encoder<'_, D>,
53 offset: usize,
54 _depth: fidl::encoding::Depth,
55 ) -> fidl::Result<()> {
56 encoder.debug_check_bounds::<CrasherCrashRequest>(offset);
57 fidl::encoding::Encode::<CrasherCrashRequest, D>::encode(
59 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
60 &self.message,
61 ),),
62 encoder,
63 offset,
64 _depth,
65 )
66 }
67 }
68 unsafe impl<
69 D: fidl::encoding::ResourceDialect,
70 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
71 > fidl::encoding::Encode<CrasherCrashRequest, D> for (T0,)
72 {
73 #[inline]
74 unsafe fn encode(
75 self,
76 encoder: &mut fidl::encoding::Encoder<'_, D>,
77 offset: usize,
78 depth: fidl::encoding::Depth,
79 ) -> fidl::Result<()> {
80 encoder.debug_check_bounds::<CrasherCrashRequest>(offset);
81 self.0.encode(encoder, offset + 0, depth)?;
85 Ok(())
86 }
87 }
88
89 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CrasherCrashRequest {
90 #[inline(always)]
91 fn new_empty() -> Self {
92 Self { message: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
93 }
94
95 #[inline]
96 unsafe fn decode(
97 &mut self,
98 decoder: &mut fidl::encoding::Decoder<'_, D>,
99 offset: usize,
100 _depth: fidl::encoding::Depth,
101 ) -> fidl::Result<()> {
102 decoder.debug_check_bounds::<Self>(offset);
103 fidl::decode!(
105 fidl::encoding::BoundedString<256>,
106 D,
107 &mut self.message,
108 decoder,
109 offset + 0,
110 _depth
111 )?;
112 Ok(())
113 }
114 }
115}