#![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 blobfs: bool,
pub blobfs_cache_eviction_policy: String,
pub blobfs_initial_inodes: u64,
pub blobfs_max_bytes: u64,
pub blobfs_use_deprecated_padded_format: bool,
pub blobfs_write_compression_algorithm: String,
pub bootpart: bool,
pub check_filesystems: bool,
pub data: bool,
pub data_filesystem_format: String,
pub data_max_bytes: u64,
pub disable_automount: bool,
pub disable_block_watcher: bool,
pub factory: bool,
pub format_data_on_corruption: bool,
pub fvm: bool,
pub fvm_slice_size: u64,
pub fxfs_blob: bool,
pub fxfs_crypt_url: String,
pub gpt: bool,
pub gpt_all: bool,
pub mbr: bool,
pub nand: bool,
pub netboot: bool,
pub no_zxcrypt: bool,
pub ramdisk_image: bool,
pub storage_host: bool,
pub use_disk_migration: 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 {
152
}
}
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(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.blobfs),
<fidl::encoding::BoundedString<20> as fidl::encoding::ValueTypeMarker>::borrow(
&self.blobfs_cache_eviction_policy,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blobfs_initial_inodes),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blobfs_max_bytes),
<bool as fidl::encoding::ValueTypeMarker>::borrow(
&self.blobfs_use_deprecated_padded_format,
),
<fidl::encoding::BoundedString<20> as fidl::encoding::ValueTypeMarker>::borrow(
&self.blobfs_write_compression_algorithm,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.bootpart),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.check_filesystems),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data_filesystem_format,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_max_bytes),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_automount),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.disable_block_watcher),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.factory),
<bool as fidl::encoding::ValueTypeMarker>::borrow(
&self.format_data_on_corruption,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.fvm),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.fvm_slice_size),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.fxfs_blob),
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.fxfs_crypt_url,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.gpt),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.gpt_all),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.mbr),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.nand),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.netboot),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.no_zxcrypt),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.ramdisk_image),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.storage_host),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.use_disk_migration),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<20>, D>,
T2: fidl::encoding::Encode<u64, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<bool, D>,
T5: fidl::encoding::Encode<fidl::encoding::BoundedString<20>, D>,
T6: fidl::encoding::Encode<bool, D>,
T7: fidl::encoding::Encode<bool, D>,
T8: fidl::encoding::Encode<bool, D>,
T9: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
T10: fidl::encoding::Encode<u64, D>,
T11: fidl::encoding::Encode<bool, 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<u64, D>,
T17: fidl::encoding::Encode<bool, D>,
T18: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
T19: fidl::encoding::Encode<bool, D>,
T20: fidl::encoding::Encode<bool, D>,
T21: fidl::encoding::Encode<bool, D>,
T22: fidl::encoding::Encode<bool, D>,
T23: fidl::encoding::Encode<bool, D>,
T24: fidl::encoding::Encode<bool, D>,
T25: fidl::encoding::Encode<bool, D>,
T26: fidl::encoding::Encode<bool, D>,
T27: 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,
T17,
T18,
T19,
T20,
T21,
T22,
T23,
T24,
T25,
T26,
T27,
)
{
#[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(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(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(96);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(112);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(144);
(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 + 24, depth)?;
self.3.encode(encoder, offset + 32, depth)?;
self.4.encode(encoder, offset + 40, depth)?;
self.5.encode(encoder, offset + 48, depth)?;
self.6.encode(encoder, offset + 64, depth)?;
self.7.encode(encoder, offset + 65, depth)?;
self.8.encode(encoder, offset + 66, depth)?;
self.9.encode(encoder, offset + 72, depth)?;
self.10.encode(encoder, offset + 88, depth)?;
self.11.encode(encoder, offset + 96, depth)?;
self.12.encode(encoder, offset + 97, depth)?;
self.13.encode(encoder, offset + 98, depth)?;
self.14.encode(encoder, offset + 99, depth)?;
self.15.encode(encoder, offset + 100, depth)?;
self.16.encode(encoder, offset + 104, depth)?;
self.17.encode(encoder, offset + 112, depth)?;
self.18.encode(encoder, offset + 120, depth)?;
self.19.encode(encoder, offset + 136, depth)?;
self.20.encode(encoder, offset + 137, depth)?;
self.21.encode(encoder, offset + 138, depth)?;
self.22.encode(encoder, offset + 139, depth)?;
self.23.encode(encoder, offset + 140, depth)?;
self.24.encode(encoder, offset + 141, depth)?;
self.25.encode(encoder, offset + 142, depth)?;
self.26.encode(encoder, offset + 143, depth)?;
self.27.encode(encoder, offset + 144, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
#[inline(always)]
fn new_empty() -> Self {
Self {
blobfs: fidl::new_empty!(bool, D),
blobfs_cache_eviction_policy: fidl::new_empty!(
fidl::encoding::BoundedString<20>,
D
),
blobfs_initial_inodes: fidl::new_empty!(u64, D),
blobfs_max_bytes: fidl::new_empty!(u64, D),
blobfs_use_deprecated_padded_format: fidl::new_empty!(bool, D),
blobfs_write_compression_algorithm: fidl::new_empty!(
fidl::encoding::BoundedString<20>,
D
),
bootpart: fidl::new_empty!(bool, D),
check_filesystems: fidl::new_empty!(bool, D),
data: fidl::new_empty!(bool, D),
data_filesystem_format: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
data_max_bytes: fidl::new_empty!(u64, D),
disable_automount: fidl::new_empty!(bool, D),
disable_block_watcher: fidl::new_empty!(bool, D),
factory: fidl::new_empty!(bool, D),
format_data_on_corruption: fidl::new_empty!(bool, D),
fvm: fidl::new_empty!(bool, D),
fvm_slice_size: fidl::new_empty!(u64, D),
fxfs_blob: fidl::new_empty!(bool, D),
fxfs_crypt_url: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
gpt: fidl::new_empty!(bool, D),
gpt_all: fidl::new_empty!(bool, D),
mbr: fidl::new_empty!(bool, D),
nand: fidl::new_empty!(bool, D),
netboot: fidl::new_empty!(bool, D),
no_zxcrypt: fidl::new_empty!(bool, D),
ramdisk_image: fidl::new_empty!(bool, D),
storage_host: fidl::new_empty!(bool, D),
use_disk_migration: 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(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,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
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 + 40 + ((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 = 0xffffffffff000000u64;
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(96) };
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 + 96 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(112) };
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 + 112 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(144) };
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 + 144 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(bool, D, &mut self.blobfs, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<20>,
D,
&mut self.blobfs_cache_eviction_policy,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(u64, D, &mut self.blobfs_initial_inodes, decoder, offset + 24, _depth)?;
fidl::decode!(u64, D, &mut self.blobfs_max_bytes, decoder, offset + 32, _depth)?;
fidl::decode!(
bool,
D,
&mut self.blobfs_use_deprecated_padded_format,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<20>,
D,
&mut self.blobfs_write_compression_algorithm,
decoder,
offset + 48,
_depth
)?;
fidl::decode!(bool, D, &mut self.bootpart, decoder, offset + 64, _depth)?;
fidl::decode!(bool, D, &mut self.check_filesystems, decoder, offset + 65, _depth)?;
fidl::decode!(bool, D, &mut self.data, decoder, offset + 66, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<64>,
D,
&mut self.data_filesystem_format,
decoder,
offset + 72,
_depth
)?;
fidl::decode!(u64, D, &mut self.data_max_bytes, decoder, offset + 88, _depth)?;
fidl::decode!(bool, D, &mut self.disable_automount, decoder, offset + 96, _depth)?;
fidl::decode!(bool, D, &mut self.disable_block_watcher, decoder, offset + 97, _depth)?;
fidl::decode!(bool, D, &mut self.factory, decoder, offset + 98, _depth)?;
fidl::decode!(
bool,
D,
&mut self.format_data_on_corruption,
decoder,
offset + 99,
_depth
)?;
fidl::decode!(bool, D, &mut self.fvm, decoder, offset + 100, _depth)?;
fidl::decode!(u64, D, &mut self.fvm_slice_size, decoder, offset + 104, _depth)?;
fidl::decode!(bool, D, &mut self.fxfs_blob, decoder, offset + 112, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<64>,
D,
&mut self.fxfs_crypt_url,
decoder,
offset + 120,
_depth
)?;
fidl::decode!(bool, D, &mut self.gpt, decoder, offset + 136, _depth)?;
fidl::decode!(bool, D, &mut self.gpt_all, decoder, offset + 137, _depth)?;
fidl::decode!(bool, D, &mut self.mbr, decoder, offset + 138, _depth)?;
fidl::decode!(bool, D, &mut self.nand, decoder, offset + 139, _depth)?;
fidl::decode!(bool, D, &mut self.netboot, decoder, offset + 140, _depth)?;
fidl::decode!(bool, D, &mut self.no_zxcrypt, decoder, offset + 141, _depth)?;
fidl::decode!(bool, D, &mut self.ramdisk_image, decoder, offset + 142, _depth)?;
fidl::decode!(bool, D, &mut self.storage_host, decoder, offset + 143, _depth)?;
fidl::decode!(bool, D, &mut self.use_disk_migration, decoder, offset + 144, _depth)?;
Ok(())
}
}
}