fidl_fuchsia_memory_debug_common/
fidl_fuchsia_memory_debug_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
11#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct MemoryPressureSignalRequest {
13 pub level: fidl_fuchsia_memorypressure_common::Level,
14}
15
16impl fidl::Persistable for MemoryPressureSignalRequest {}
17
18pub mod memory_pressure_ordinals {
19 pub const SIGNAL: u64 = 0x7eaa45c1812124d4;
20}
21
22mod internal {
23 use super::*;
24
25 impl fidl::encoding::ValueTypeMarker for MemoryPressureSignalRequest {
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 MemoryPressureSignalRequest {
33 type Owned = Self;
34
35 #[inline(always)]
36 fn inline_align(_context: fidl::encoding::Context) -> usize {
37 4
38 }
39
40 #[inline(always)]
41 fn inline_size(_context: fidl::encoding::Context) -> usize {
42 4
43 }
44 }
45
46 unsafe impl<D: fidl::encoding::ResourceDialect>
47 fidl::encoding::Encode<MemoryPressureSignalRequest, D> for &MemoryPressureSignalRequest
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::<MemoryPressureSignalRequest>(offset);
57 fidl::encoding::Encode::<MemoryPressureSignalRequest, D>::encode(
59 (
60 <fidl_fuchsia_memorypressure_common::Level as fidl::encoding::ValueTypeMarker>::borrow(&self.level),
61 ),
62 encoder, offset, _depth
63 )
64 }
65 }
66 unsafe impl<
67 D: fidl::encoding::ResourceDialect,
68 T0: fidl::encoding::Encode<fidl_fuchsia_memorypressure_common::Level, D>,
69 > fidl::encoding::Encode<MemoryPressureSignalRequest, D> for (T0,)
70 {
71 #[inline]
72 unsafe fn encode(
73 self,
74 encoder: &mut fidl::encoding::Encoder<'_, D>,
75 offset: usize,
76 depth: fidl::encoding::Depth,
77 ) -> fidl::Result<()> {
78 encoder.debug_check_bounds::<MemoryPressureSignalRequest>(offset);
79 self.0.encode(encoder, offset + 0, depth)?;
83 Ok(())
84 }
85 }
86
87 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
88 for MemoryPressureSignalRequest
89 {
90 #[inline(always)]
91 fn new_empty() -> Self {
92 Self { level: fidl::new_empty!(fidl_fuchsia_memorypressure_common::Level, 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_fuchsia_memorypressure_common::Level,
106 D,
107 &mut self.level,
108 decoder,
109 offset + 0,
110 _depth
111 )?;
112 Ok(())
113 }
114 }
115}