#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Config {
pub addend: u8,
pub augend: u8,
pub do_in_process: bool,
}
impl fidl::Persistable for Config {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Config {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
3
}
}
impl fidl::encoding::ValueTypeMarker for Config {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<Config> for &Config {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Config>(offset);
fidl::encoding::Encode::<Config>::encode(
(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.addend),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.augend),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.do_in_process),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u8>,
T1: fidl::encoding::Encode<u8>,
T2: fidl::encoding::Encode<bool>,
> fidl::encoding::Encode<Config> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Config>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
self.2.encode(encoder, offset + 2, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Config {
#[inline(always)]
fn new_empty() -> Self {
Self {
addend: fidl::new_empty!(u8),
augend: fidl::new_empty!(u8),
do_in_process: fidl::new_empty!(bool),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u8, &mut self.addend, decoder, offset + 0, _depth)?;
fidl::decode!(u8, &mut self.augend, decoder, offset + 1, _depth)?;
fidl::decode!(bool, &mut self.do_in_process, decoder, offset + 2, _depth)?;
Ok(())
}
}
}