#![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;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Config {
pub back_off_time_between_pull_samples_sec: i64,
pub disable_delays: bool,
pub early_exit: bool,
pub first_sampling_delay_sec: i64,
pub has_real_time_clock: bool,
pub initial_frequency_ppm: u32,
pub max_frequency_error_ppm: u32,
pub monitor_time_source_url: String,
pub monitor_uses_pull: bool,
pub oscillator_error_std_dev_ppm: u32,
pub power_topology_integration_enabled: bool,
pub primary_time_source_url: String,
pub primary_uses_pull: bool,
pub serve_fuchsia_time_alarms: bool,
pub serve_test_protocols: bool,
pub utc_start_at_startup: bool,
pub utc_start_at_startup_when_invalid_rtc: bool,
}
impl fidl::Persistable for Config {}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for Config {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Config {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
96
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Config>(offset);
fidl::encoding::Encode::<Config, D>::encode(
(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.back_off_time_between_pull_samples_sec),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_delays),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.early_exit),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.first_sampling_delay_sec),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_real_time_clock),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.initial_frequency_ppm),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_frequency_error_ppm),
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_time_source_url),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_uses_pull),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.oscillator_error_std_dev_ppm),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.power_topology_integration_enabled),
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_time_source_url),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_uses_pull),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.serve_fuchsia_time_alarms),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.serve_test_protocols),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.utc_start_at_startup),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.utc_start_at_startup_when_invalid_rtc),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i64, D>,
T1: fidl::encoding::Encode<bool, D>,
T2: fidl::encoding::Encode<bool, D>,
T3: fidl::encoding::Encode<i64, D>,
T4: fidl::encoding::Encode<bool, D>,
T5: fidl::encoding::Encode<u32, D>,
T6: fidl::encoding::Encode<u32, D>,
T7: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T8: fidl::encoding::Encode<bool, D>,
T9: fidl::encoding::Encode<u32, D>,
T10: fidl::encoding::Encode<bool, D>,
T11: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T12: fidl::encoding::Encode<bool, D>,
T13: fidl::encoding::Encode<bool, D>,
T14: fidl::encoding::Encode<bool, D>,
T15: fidl::encoding::Encode<bool, D>,
T16: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<Config, D>
for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Config>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(88);
(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 + 9, depth)?;
self.3.encode(encoder, offset + 16, depth)?;
self.4.encode(encoder, offset + 24, depth)?;
self.5.encode(encoder, offset + 28, depth)?;
self.6.encode(encoder, offset + 32, depth)?;
self.7.encode(encoder, offset + 40, depth)?;
self.8.encode(encoder, offset + 56, depth)?;
self.9.encode(encoder, offset + 60, depth)?;
self.10.encode(encoder, offset + 64, depth)?;
self.11.encode(encoder, offset + 72, depth)?;
self.12.encode(encoder, offset + 88, depth)?;
self.13.encode(encoder, offset + 89, depth)?;
self.14.encode(encoder, offset + 90, depth)?;
self.15.encode(encoder, offset + 91, depth)?;
self.16.encode(encoder, offset + 92, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
#[inline(always)]
fn new_empty() -> Self {
Self {
back_off_time_between_pull_samples_sec: fidl::new_empty!(i64, D),
disable_delays: fidl::new_empty!(bool, D),
early_exit: fidl::new_empty!(bool, D),
first_sampling_delay_sec: fidl::new_empty!(i64, D),
has_real_time_clock: fidl::new_empty!(bool, D),
initial_frequency_ppm: fidl::new_empty!(u32, D),
max_frequency_error_ppm: fidl::new_empty!(u32, D),
monitor_time_source_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
monitor_uses_pull: fidl::new_empty!(bool, D),
oscillator_error_std_dev_ppm: fidl::new_empty!(u32, D),
power_topology_integration_enabled: fidl::new_empty!(bool, D),
primary_time_source_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
primary_uses_pull: fidl::new_empty!(bool, D),
serve_fuchsia_time_alarms: fidl::new_empty!(bool, D),
serve_test_protocols: fidl::new_empty!(bool, D),
utc_start_at_startup: fidl::new_empty!(bool, D),
utc_start_at_startup_when_invalid_rtc: fidl::new_empty!(bool, 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(8) };
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 + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(56) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
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 + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(88) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff0000000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 88 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
i64,
D,
&mut self.back_off_time_between_pull_samples_sec,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(bool, D, &mut self.disable_delays, decoder, offset + 8, _depth)?;
fidl::decode!(bool, D, &mut self.early_exit, decoder, offset + 9, _depth)?;
fidl::decode!(
i64,
D,
&mut self.first_sampling_delay_sec,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(bool, D, &mut self.has_real_time_clock, decoder, offset + 24, _depth)?;
fidl::decode!(u32, D, &mut self.initial_frequency_ppm, decoder, offset + 28, _depth)?;
fidl::decode!(u32, D, &mut self.max_frequency_error_ppm, decoder, offset + 32, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.monitor_time_source_url,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(bool, D, &mut self.monitor_uses_pull, decoder, offset + 56, _depth)?;
fidl::decode!(
u32,
D,
&mut self.oscillator_error_std_dev_ppm,
decoder,
offset + 60,
_depth
)?;
fidl::decode!(
bool,
D,
&mut self.power_topology_integration_enabled,
decoder,
offset + 64,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.primary_time_source_url,
decoder,
offset + 72,
_depth
)?;
fidl::decode!(bool, D, &mut self.primary_uses_pull, decoder, offset + 88, _depth)?;
fidl::decode!(
bool,
D,
&mut self.serve_fuchsia_time_alarms,
decoder,
offset + 89,
_depth
)?;
fidl::decode!(bool, D, &mut self.serve_test_protocols, decoder, offset + 90, _depth)?;
fidl::decode!(bool, D, &mut self.utc_start_at_startup, decoder, offset + 91, _depth)?;
fidl::decode!(
bool,
D,
&mut self.utc_start_at_startup_when_invalid_rtc,
decoder,
offset + 92,
_depth
)?;
Ok(())
}
}
}