#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_HISTOGRAMS_PER_TYPE: u8 = 8;
pub const MAX_NOISE_FLOOR_SAMPLES: u8 = 255;
pub const MAX_RSSI_SAMPLES: u8 = 255;
pub const MAX_RX_RATE_INDEX_SAMPLES: u8 = 196;
pub const MAX_SNR_SAMPLES: u16 = 256;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum AntennaFreq {
Antenna2G = 1,
Antenna5G = 2,
}
impl AntennaFreq {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Antenna2G),
2 => Some(Self::Antenna5G),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum HistScope {
Station = 1,
PerAntenna = 2,
}
impl HistScope {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Station),
2 => Some(Self::PerAntenna),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AntennaId {
pub freq: AntennaFreq,
pub index: u8,
}
impl fidl::Persistable for AntennaId {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct HistBucket {
pub bucket_index: u16,
pub num_samples: u64,
}
impl fidl::Persistable for HistBucket {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct IfaceCounterStats {
pub rx_unicast_total: u64,
pub rx_unicast_drop: u64,
pub rx_multicast: u64,
pub tx_total: u64,
pub tx_drop: u64,
}
impl fidl::Persistable for IfaceCounterStats {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct IfaceHistogramStats {
pub noise_floor_histograms: Vec<NoiseFloorHistogram>,
pub rssi_histograms: Vec<RssiHistogram>,
pub rx_rate_index_histograms: Vec<RxRateIndexHistogram>,
pub snr_histograms: Vec<SnrHistogram>,
}
impl fidl::Persistable for IfaceHistogramStats {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NoiseFloorHistogram {
pub hist_scope: HistScope,
pub antenna_id: Option<Box<AntennaId>>,
pub noise_floor_samples: Vec<HistBucket>,
pub invalid_samples: u64,
}
impl fidl::Persistable for NoiseFloorHistogram {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RssiHistogram {
pub hist_scope: HistScope,
pub antenna_id: Option<Box<AntennaId>>,
pub rssi_samples: Vec<HistBucket>,
pub invalid_samples: u64,
}
impl fidl::Persistable for RssiHistogram {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RxRateIndexHistogram {
pub hist_scope: HistScope,
pub antenna_id: Option<Box<AntennaId>>,
pub rx_rate_index_samples: Vec<HistBucket>,
pub invalid_samples: u64,
}
impl fidl::Persistable for RxRateIndexHistogram {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SnrHistogram {
pub hist_scope: HistScope,
pub antenna_id: Option<Box<AntennaId>>,
pub snr_samples: Vec<HistBucket>,
pub invalid_samples: u64,
}
impl fidl::Persistable for SnrHistogram {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for AntennaFreq {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for AntennaFreq {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AntennaFreq {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AntennaFreq {
#[inline(always)]
fn new_empty() -> Self {
Self::Antenna2G
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for HistScope {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for HistScope {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for HistScope {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HistScope {
#[inline(always)]
fn new_empty() -> Self {
Self::Station
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AntennaId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AntennaId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AntennaId, D>
for &AntennaId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AntennaId>(offset);
fidl::encoding::Encode::<AntennaId, D>::encode(
(
<AntennaFreq as fidl::encoding::ValueTypeMarker>::borrow(&self.freq),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<AntennaFreq, D>,
T1: fidl::encoding::Encode<u8, D>,
> fidl::encoding::Encode<AntennaId, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AntennaId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AntennaId {
#[inline(always)]
fn new_empty() -> Self {
Self { freq: fidl::new_empty!(AntennaFreq, D), index: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(AntennaFreq, D, &mut self.freq, decoder, offset + 0, _depth)?;
fidl::decode!(u8, D, &mut self.index, decoder, offset + 1, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for HistBucket {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HistBucket {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HistBucket, D>
for &HistBucket
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HistBucket>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut HistBucket).write_unaligned((self as *const HistBucket).read());
let padding_ptr = buf_ptr.offset(0) as *mut u64;
let padding_mask = 0xffffffffffff0000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<HistBucket, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HistBucket>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HistBucket {
#[inline(always)]
fn new_empty() -> Self {
Self { bucket_index: fidl::new_empty!(u16, D), num_samples: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for IfaceCounterStats {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for IfaceCounterStats {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IfaceCounterStats, D>
for &IfaceCounterStats
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<IfaceCounterStats>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut IfaceCounterStats)
.write_unaligned((self as *const IfaceCounterStats).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<u64, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<IfaceCounterStats, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<IfaceCounterStats>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IfaceCounterStats {
#[inline(always)]
fn new_empty() -> Self {
Self {
rx_unicast_total: fidl::new_empty!(u64, D),
rx_unicast_drop: fidl::new_empty!(u64, D),
rx_multicast: fidl::new_empty!(u64, D),
tx_total: fidl::new_empty!(u64, D),
tx_drop: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 40);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for IfaceHistogramStats {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for IfaceHistogramStats {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IfaceHistogramStats, D>
for &IfaceHistogramStats
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<IfaceHistogramStats>(offset);
fidl::encoding::Encode::<IfaceHistogramStats, D>::encode(
(
<fidl::encoding::Vector<NoiseFloorHistogram, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.noise_floor_histograms),
<fidl::encoding::Vector<RssiHistogram, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_histograms),
<fidl::encoding::Vector<RxRateIndexHistogram, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_rate_index_histograms),
<fidl::encoding::Vector<SnrHistogram, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_histograms),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<NoiseFloorHistogram, 8>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<RssiHistogram, 8>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<RxRateIndexHistogram, 8>, D>,
T3: fidl::encoding::Encode<fidl::encoding::Vector<SnrHistogram, 8>, D>,
> fidl::encoding::Encode<IfaceHistogramStats, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<IfaceHistogramStats>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
self.3.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IfaceHistogramStats {
#[inline(always)]
fn new_empty() -> Self {
Self {
noise_floor_histograms: fidl::new_empty!(fidl::encoding::Vector<NoiseFloorHistogram, 8>, D),
rssi_histograms: fidl::new_empty!(fidl::encoding::Vector<RssiHistogram, 8>, D),
rx_rate_index_histograms: fidl::new_empty!(fidl::encoding::Vector<RxRateIndexHistogram, 8>, D),
snr_histograms: fidl::new_empty!(fidl::encoding::Vector<SnrHistogram, 8>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<NoiseFloorHistogram, 8>, D, &mut self.noise_floor_histograms, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<RssiHistogram, 8>, D, &mut self.rssi_histograms, decoder, offset + 16, _depth)?;
fidl::decode!(fidl::encoding::Vector<RxRateIndexHistogram, 8>, D, &mut self.rx_rate_index_histograms, decoder, offset + 32, _depth)?;
fidl::decode!(fidl::encoding::Vector<SnrHistogram, 8>, D, &mut self.snr_histograms, decoder, offset + 48, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NoiseFloorHistogram {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NoiseFloorHistogram {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NoiseFloorHistogram, D>
for &NoiseFloorHistogram
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NoiseFloorHistogram>(offset);
fidl::encoding::Encode::<NoiseFloorHistogram, D>::encode(
(
<HistScope as fidl::encoding::ValueTypeMarker>::borrow(&self.hist_scope),
<fidl::encoding::Boxed<AntennaId> as fidl::encoding::ValueTypeMarker>::borrow(&self.antenna_id),
<fidl::encoding::Vector<HistBucket, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.noise_floor_samples),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.invalid_samples),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<HistScope, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<AntennaId>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<HistBucket, 255>, D>,
T3: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<NoiseFloorHistogram, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NoiseFloorHistogram>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NoiseFloorHistogram {
#[inline(always)]
fn new_empty() -> Self {
Self {
hist_scope: fidl::new_empty!(HistScope, D),
antenna_id: fidl::new_empty!(fidl::encoding::Boxed<AntennaId>, D),
noise_floor_samples: fidl::new_empty!(fidl::encoding::Vector<HistBucket, 255>, D),
invalid_samples: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(HistScope, D, &mut self.hist_scope, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<AntennaId>,
D,
&mut self.antenna_id,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<HistBucket, 255>, D, &mut self.noise_floor_samples, decoder, offset + 16, _depth)?;
fidl::decode!(u64, D, &mut self.invalid_samples, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RssiHistogram {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RssiHistogram {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RssiHistogram, D>
for &RssiHistogram
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RssiHistogram>(offset);
fidl::encoding::Encode::<RssiHistogram, D>::encode(
(
<HistScope as fidl::encoding::ValueTypeMarker>::borrow(&self.hist_scope),
<fidl::encoding::Boxed<AntennaId> as fidl::encoding::ValueTypeMarker>::borrow(&self.antenna_id),
<fidl::encoding::Vector<HistBucket, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_samples),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.invalid_samples),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<HistScope, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<AntennaId>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<HistBucket, 255>, D>,
T3: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<RssiHistogram, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RssiHistogram>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RssiHistogram {
#[inline(always)]
fn new_empty() -> Self {
Self {
hist_scope: fidl::new_empty!(HistScope, D),
antenna_id: fidl::new_empty!(fidl::encoding::Boxed<AntennaId>, D),
rssi_samples: fidl::new_empty!(fidl::encoding::Vector<HistBucket, 255>, D),
invalid_samples: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(HistScope, D, &mut self.hist_scope, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<AntennaId>,
D,
&mut self.antenna_id,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<HistBucket, 255>, D, &mut self.rssi_samples, decoder, offset + 16, _depth)?;
fidl::decode!(u64, D, &mut self.invalid_samples, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RxRateIndexHistogram {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RxRateIndexHistogram {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RxRateIndexHistogram, D>
for &RxRateIndexHistogram
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RxRateIndexHistogram>(offset);
fidl::encoding::Encode::<RxRateIndexHistogram, D>::encode(
(
<HistScope as fidl::encoding::ValueTypeMarker>::borrow(&self.hist_scope),
<fidl::encoding::Boxed<AntennaId> as fidl::encoding::ValueTypeMarker>::borrow(&self.antenna_id),
<fidl::encoding::Vector<HistBucket, 196> as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_rate_index_samples),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.invalid_samples),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<HistScope, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<AntennaId>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<HistBucket, 196>, D>,
T3: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<RxRateIndexHistogram, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RxRateIndexHistogram>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RxRateIndexHistogram {
#[inline(always)]
fn new_empty() -> Self {
Self {
hist_scope: fidl::new_empty!(HistScope, D),
antenna_id: fidl::new_empty!(fidl::encoding::Boxed<AntennaId>, D),
rx_rate_index_samples: fidl::new_empty!(fidl::encoding::Vector<HistBucket, 196>, D),
invalid_samples: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(HistScope, D, &mut self.hist_scope, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<AntennaId>,
D,
&mut self.antenna_id,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<HistBucket, 196>, D, &mut self.rx_rate_index_samples, decoder, offset + 16, _depth)?;
fidl::decode!(u64, D, &mut self.invalid_samples, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SnrHistogram {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SnrHistogram {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SnrHistogram, D>
for &SnrHistogram
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SnrHistogram>(offset);
fidl::encoding::Encode::<SnrHistogram, D>::encode(
(
<HistScope as fidl::encoding::ValueTypeMarker>::borrow(&self.hist_scope),
<fidl::encoding::Boxed<AntennaId> as fidl::encoding::ValueTypeMarker>::borrow(&self.antenna_id),
<fidl::encoding::Vector<HistBucket, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_samples),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.invalid_samples),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<HistScope, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<AntennaId>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<HistBucket, 256>, D>,
T3: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<SnrHistogram, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SnrHistogram>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SnrHistogram {
#[inline(always)]
fn new_empty() -> Self {
Self {
hist_scope: fidl::new_empty!(HistScope, D),
antenna_id: fidl::new_empty!(fidl::encoding::Boxed<AntennaId>, D),
snr_samples: fidl::new_empty!(fidl::encoding::Vector<HistBucket, 256>, D),
invalid_samples: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(HistScope, D, &mut self.hist_scope, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<AntennaId>,
D,
&mut self.antenna_id,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<HistBucket, 256>, D, &mut self.snr_samples, decoder, offset + 16, _depth)?;
fidl::decode!(u64, D, &mut self.invalid_samples, decoder, offset + 32, _depth)?;
Ok(())
}
}
}