#![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 ALLOCATE_PARTITION_FLAG_INACTIVE: u32 = 1;
pub const MAX_SLICE_REQUESTS: u32 = 16;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeDestroyResponse {
pub status: i32,
}
impl fidl::Persistable for VolumeDestroyResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeExtendRequest {
pub start_slice: u64,
pub slice_count: u64,
}
impl fidl::Persistable for VolumeExtendRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeExtendResponse {
pub status: i32,
}
impl fidl::Persistable for VolumeExtendResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeGetVolumeInfoResponse {
pub status: i32,
pub manager: Option<Box<VolumeManagerInfo>>,
pub volume: Option<Box<VolumeInfo>>,
}
impl fidl::Persistable for VolumeGetVolumeInfoResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeInfo {
pub partition_slice_count: u64,
pub slice_limit: u64,
}
impl fidl::Persistable for VolumeInfo {}
#[derive(Clone, Debug, PartialEq)]
pub struct VolumeManagerActivateRequest {
pub old_guid: fidl_fuchsia_hardware_block_partition::Guid,
pub new_guid: fidl_fuchsia_hardware_block_partition::Guid,
}
impl fidl::Persistable for VolumeManagerActivateRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeManagerActivateResponse {
pub status: i32,
}
impl fidl::Persistable for VolumeManagerActivateResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct VolumeManagerAllocatePartitionRequest {
pub slice_count: u64,
pub type_: fidl_fuchsia_hardware_block_partition::Guid,
pub instance: fidl_fuchsia_hardware_block_partition::Guid,
pub name: String,
pub flags: u32,
}
impl fidl::Persistable for VolumeManagerAllocatePartitionRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeManagerAllocatePartitionResponse {
pub status: i32,
}
impl fidl::Persistable for VolumeManagerAllocatePartitionResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeManagerGetInfoResponse {
pub status: i32,
pub info: Option<Box<VolumeManagerInfo>>,
}
impl fidl::Persistable for VolumeManagerGetInfoResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct VolumeManagerGetPartitionLimitRequest {
pub guid: fidl_fuchsia_hardware_block_partition::Guid,
}
impl fidl::Persistable for VolumeManagerGetPartitionLimitRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeManagerGetPartitionLimitResponse {
pub status: i32,
pub slice_count: u64,
}
impl fidl::Persistable for VolumeManagerGetPartitionLimitResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeManagerInfo {
pub slice_size: u64,
pub slice_count: u64,
pub assigned_slice_count: u64,
pub maximum_slice_count: u64,
pub max_virtual_slice: u64,
}
impl fidl::Persistable for VolumeManagerInfo {}
#[derive(Clone, Debug, PartialEq)]
pub struct VolumeManagerSetPartitionLimitRequest {
pub guid: fidl_fuchsia_hardware_block_partition::Guid,
pub slice_count: u64,
}
impl fidl::Persistable for VolumeManagerSetPartitionLimitRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeManagerSetPartitionLimitResponse {
pub status: i32,
}
impl fidl::Persistable for VolumeManagerSetPartitionLimitResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct VolumeManagerSetPartitionNameRequest {
pub guid: fidl_fuchsia_hardware_block_partition::Guid,
pub name: String,
}
impl fidl::Persistable for VolumeManagerSetPartitionNameRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeQuerySlicesRequest {
pub start_slices: Vec<u64>,
}
impl fidl::Persistable for VolumeQuerySlicesRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeQuerySlicesResponse {
pub status: i32,
pub response: [VsliceRange; 16],
pub response_count: u64,
}
impl fidl::Persistable for VolumeQuerySlicesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeShrinkRequest {
pub start_slice: u64,
pub slice_count: u64,
}
impl fidl::Persistable for VolumeShrinkRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct VolumeShrinkResponse {
pub status: i32,
}
impl fidl::Persistable for VolumeShrinkResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VsliceRange {
pub allocated: bool,
pub count: u64,
}
impl fidl::Persistable for VsliceRange {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct VolumeMarker;
impl fidl::endpoints::ProtocolMarker for VolumeMarker {
type Proxy = VolumeProxy;
type RequestStream = VolumeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VolumeSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.hardware.block.volume.Volume";
}
impl fidl::endpoints::DiscoverableProtocolMarker for VolumeMarker {}
pub trait VolumeProxyInterface: Send + Sync {
type GetInfoResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_hardware_block::BlockGetInfoResult, fidl::Error>,
> + Send;
fn r#get_info(&self) -> Self::GetInfoResponseFut;
type GetStatsResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_hardware_block::BlockGetStatsResult, fidl::Error>,
> + Send;
fn r#get_stats(&self, clear: bool) -> Self::GetStatsResponseFut;
fn r#open_session(
&self,
session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
) -> Result<(), fidl::Error>;
type GetTypeGuidResponseFut: std::future::Future<
Output = Result<
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
fidl::Error,
>,
> + Send;
fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut;
type GetInstanceGuidResponseFut: std::future::Future<
Output = Result<
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
fidl::Error,
>,
> + Send;
fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut;
type GetNameResponseFut: std::future::Future<Output = Result<(i32, Option<String>), fidl::Error>>
+ Send;
fn r#get_name(&self) -> Self::GetNameResponseFut;
type GetMetadataResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
fidl::Error,
>,
> + Send;
fn r#get_metadata(&self) -> Self::GetMetadataResponseFut;
type QuerySlicesResponseFut: std::future::Future<Output = Result<(i32, [VsliceRange; 16], u64), fidl::Error>>
+ Send;
fn r#query_slices(&self, start_slices: &[u64]) -> Self::QuerySlicesResponseFut;
type GetVolumeInfoResponseFut: std::future::Future<
Output = Result<
(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
fidl::Error,
>,
> + Send;
fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut;
type ExtendResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#extend(&self, start_slice: u64, slice_count: u64) -> Self::ExtendResponseFut;
type ShrinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#shrink(&self, start_slice: u64, slice_count: u64) -> Self::ShrinkResponseFut;
type DestroyResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#destroy(&self) -> Self::DestroyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VolumeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VolumeSynchronousProxy {
type Proxy = VolumeProxy;
type Protocol = VolumeMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl VolumeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<VolumeEvent, fidl::Error> {
VolumeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_hardware_block::BlockGetInfoResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_hardware_block::BlockGetInfoResponse,
i32,
>>(
(),
0x79df1a5cdb6cc6a3,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.info))
}
pub fn r#get_stats(
&self,
mut clear: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_hardware_block::BlockGetStatsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_hardware_block::BlockGetStatsRequest,
fidl::encoding::ResultType<fidl_fuchsia_hardware_block::BlockGetStatsResponse, i32>,
>(
(clear,),
0x53d9542a778385ae,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.stats))
}
pub fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_block::BlockOpenSessionRequest>(
(session,),
0x7241c68d17614a31,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_type_guid(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_hardware_block_partition::PartitionGetTypeGuidResponse,
>(
(),
0x111843d737a9b847,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.guid))
}
pub fn r#get_instance_guid(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_hardware_block_partition::PartitionGetInstanceGuidResponse,
>(
(),
0x14a5a573b275d435,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.guid))
}
pub fn r#get_name(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<String>), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse,
>(
(),
0x7e3c6f0b0937fc02,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.name))
}
pub fn r#get_metadata(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult, fidl::Error>
{
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
i32,
>>(
(), 0x42d1464c96c3f3ff, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x))
}
pub fn r#query_slices(
&self,
mut start_slices: &[u64],
___deadline: zx::MonotonicInstant,
) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
let _response =
self.client.send_query::<VolumeQuerySlicesRequest, VolumeQuerySlicesResponse>(
(start_slices,),
0x589a96828a3e2aa1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.response, _response.response_count))
}
pub fn r#get_volume_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, VolumeGetVolumeInfoResponse>(
(),
0x60417b6cf9e34c80,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.manager, _response.volume))
}
pub fn r#extend(
&self,
mut start_slice: u64,
mut slice_count: u64,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<VolumeExtendRequest, VolumeExtendResponse>(
(start_slice, slice_count),
0xdddf872f5039d37,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#shrink(
&self,
mut start_slice: u64,
mut slice_count: u64,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<VolumeShrinkRequest, VolumeShrinkResponse>(
(start_slice, slice_count),
0x27ab5ed4f6fdcd29,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#destroy(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, VolumeDestroyResponse>(
(),
0x732bf4bea39b5e87,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct VolumeProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for VolumeProxy {
type Protocol = VolumeMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl VolumeProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VolumeEventStream {
VolumeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_info(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_block::BlockGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_info(self)
}
pub fn r#get_stats(
&self,
mut clear: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_block::BlockGetStatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_stats(self, clear)
}
pub fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
) -> Result<(), fidl::Error> {
VolumeProxyInterface::r#open_session(self, session)
}
pub fn r#get_type_guid(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_type_guid(self)
}
pub fn r#get_instance_guid(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_instance_guid(self)
}
pub fn r#get_name(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<String>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_name(self)
}
pub fn r#get_metadata(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_metadata(self)
}
pub fn r#query_slices(
&self,
mut start_slices: &[u64],
) -> fidl::client::QueryResponseFut<
(i32, [VsliceRange; 16], u64),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#query_slices(self, start_slices)
}
pub fn r#get_volume_info(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeProxyInterface::r#get_volume_info(self)
}
pub fn r#extend(
&self,
mut start_slice: u64,
mut slice_count: u64,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
VolumeProxyInterface::r#extend(self, start_slice, slice_count)
}
pub fn r#shrink(
&self,
mut start_slice: u64,
mut slice_count: u64,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
VolumeProxyInterface::r#shrink(self, start_slice, slice_count)
}
pub fn r#destroy(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
VolumeProxyInterface::r#destroy(self)
}
}
impl VolumeProxyInterface for VolumeProxy {
type GetInfoResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_block::BlockGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_hardware_block::BlockGetInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl_fuchsia_hardware_block::BlockGetInfoResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x79df1a5cdb6cc6a3,
>(_buf?)?;
Ok(_response.map(|x| x.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_hardware_block::BlockGetInfoResult,
>(
(),
0x79df1a5cdb6cc6a3,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetStatsResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_block::BlockGetStatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_stats(&self, mut clear: bool) -> Self::GetStatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_hardware_block::BlockGetStatsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl_fuchsia_hardware_block::BlockGetStatsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x53d9542a778385ae,
>(_buf?)?;
Ok(_response.map(|x| x.stats))
}
self.client.send_query_and_decode::<
fidl_fuchsia_hardware_block::BlockGetStatsRequest,
fidl_fuchsia_hardware_block::BlockGetStatsResult,
>(
(clear,),
0x53d9542a778385ae,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_block::BlockOpenSessionRequest>(
(session,),
0x7241c68d17614a31,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetTypeGuidResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_hardware_block_partition::PartitionGetTypeGuidResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x111843d737a9b847,
>(_buf?)?;
Ok((_response.status, _response.guid))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
>(
(),
0x111843d737a9b847,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetInstanceGuidResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>), fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_hardware_block_partition::PartitionGetInstanceGuidResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x14a5a573b275d435,
>(_buf?)?;
Ok((_response.status, _response.guid))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>),
>(
(),
0x14a5a573b275d435,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNameResponseFut = fidl::client::QueryResponseFut<
(i32, Option<String>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_name(&self) -> Self::GetNameResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<String>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7e3c6f0b0937fc02,
>(_buf?)?;
Ok((_response.status, _response.name))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<String>)>(
(),
0x7e3c6f0b0937fc02,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetMetadataResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_metadata(&self) -> Self::GetMetadataResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
i32,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x42d1464c96c3f3ff,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResult,
>(
(),
0x42d1464c96c3f3ff,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QuerySlicesResponseFut = fidl::client::QueryResponseFut<
(i32, [VsliceRange; 16], u64),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_slices(&self, mut start_slices: &[u64]) -> Self::QuerySlicesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeQuerySlicesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x589a96828a3e2aa1,
>(_buf?)?;
Ok((_response.status, _response.response, _response.response_count))
}
self.client
.send_query_and_decode::<VolumeQuerySlicesRequest, (i32, [VsliceRange; 16], u64)>(
(start_slices,),
0x589a96828a3e2aa1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetVolumeInfoResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
VolumeGetVolumeInfoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x60417b6cf9e34c80,
>(_buf?)?;
Ok((_response.status, _response.manager, _response.volume))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>),
>(
(),
0x60417b6cf9e34c80,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ExtendResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#extend(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ExtendResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeExtendResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xdddf872f5039d37,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<VolumeExtendRequest, i32>(
(start_slice, slice_count),
0xdddf872f5039d37,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ShrinkResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#shrink(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ShrinkResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeShrinkResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x27ab5ed4f6fdcd29,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<VolumeShrinkRequest, i32>(
(start_slice, slice_count),
0x27ab5ed4f6fdcd29,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DestroyResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#destroy(&self) -> Self::DestroyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeDestroyResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x732bf4bea39b5e87,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x732bf4bea39b5e87,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct VolumeEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for VolumeEventStream {}
impl futures::stream::FusedStream for VolumeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VolumeEventStream {
type Item = Result<VolumeEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(VolumeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VolumeEvent {}
impl VolumeEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<VolumeEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VolumeRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for VolumeRequestStream {}
impl futures::stream::FusedStream for VolumeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VolumeRequestStream {
type Protocol = VolumeMarker;
type ControlHandle = VolumeControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
VolumeControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for VolumeRequestStream {
type Item = Result<VolumeRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled VolumeRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x79df1a5cdb6cc6a3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetInfo {
responder: VolumeGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x53d9542a778385ae => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_hardware_block::BlockGetStatsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_block::BlockGetStatsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetStats {
clear: req.clear,
responder: VolumeGetStatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7241c68d17614a31 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_hardware_block::BlockOpenSessionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_block::BlockOpenSessionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::OpenSession { session: req.session, control_handle })
}
0x111843d737a9b847 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetTypeGuid {
responder: VolumeGetTypeGuidResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x14a5a573b275d435 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetInstanceGuid {
responder: VolumeGetInstanceGuidResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7e3c6f0b0937fc02 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetName {
responder: VolumeGetNameResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x42d1464c96c3f3ff => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetMetadata {
responder: VolumeGetMetadataResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x589a96828a3e2aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeQuerySlicesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeQuerySlicesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::QuerySlices {
start_slices: req.start_slices,
responder: VolumeQuerySlicesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x60417b6cf9e34c80 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::GetVolumeInfo {
responder: VolumeGetVolumeInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xdddf872f5039d37 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeExtendRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeExtendRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::Extend {
start_slice: req.start_slice,
slice_count: req.slice_count,
responder: VolumeExtendResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x27ab5ed4f6fdcd29 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeShrinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeShrinkRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::Shrink {
start_slice: req.start_slice,
slice_count: req.slice_count,
responder: VolumeShrinkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x732bf4bea39b5e87 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeControlHandle { inner: this.inner.clone() };
Ok(VolumeRequest::Destroy {
responder: VolumeDestroyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum VolumeRequest {
GetInfo { responder: VolumeGetInfoResponder },
GetStats { clear: bool, responder: VolumeGetStatsResponder },
OpenSession {
session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
control_handle: VolumeControlHandle,
},
GetTypeGuid { responder: VolumeGetTypeGuidResponder },
GetInstanceGuid { responder: VolumeGetInstanceGuidResponder },
GetName { responder: VolumeGetNameResponder },
GetMetadata { responder: VolumeGetMetadataResponder },
QuerySlices { start_slices: Vec<u64>, responder: VolumeQuerySlicesResponder },
GetVolumeInfo { responder: VolumeGetVolumeInfoResponder },
Extend { start_slice: u64, slice_count: u64, responder: VolumeExtendResponder },
Shrink { start_slice: u64, slice_count: u64, responder: VolumeShrinkResponder },
Destroy { responder: VolumeDestroyResponder },
}
impl VolumeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(VolumeGetInfoResponder)> {
if let VolumeRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_stats(self) -> Option<(bool, VolumeGetStatsResponder)> {
if let VolumeRequest::GetStats { clear, responder } = self {
Some((clear, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open_session(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
VolumeControlHandle,
)> {
if let VolumeRequest::OpenSession { session, control_handle } = self {
Some((session, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_type_guid(self) -> Option<(VolumeGetTypeGuidResponder)> {
if let VolumeRequest::GetTypeGuid { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_instance_guid(self) -> Option<(VolumeGetInstanceGuidResponder)> {
if let VolumeRequest::GetInstanceGuid { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_name(self) -> Option<(VolumeGetNameResponder)> {
if let VolumeRequest::GetName { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_metadata(self) -> Option<(VolumeGetMetadataResponder)> {
if let VolumeRequest::GetMetadata { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_slices(self) -> Option<(Vec<u64>, VolumeQuerySlicesResponder)> {
if let VolumeRequest::QuerySlices { start_slices, responder } = self {
Some((start_slices, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_volume_info(self) -> Option<(VolumeGetVolumeInfoResponder)> {
if let VolumeRequest::GetVolumeInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_extend(self) -> Option<(u64, u64, VolumeExtendResponder)> {
if let VolumeRequest::Extend { start_slice, slice_count, responder } = self {
Some((start_slice, slice_count, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_shrink(self) -> Option<(u64, u64, VolumeShrinkResponder)> {
if let VolumeRequest::Shrink { start_slice, slice_count, responder } = self {
Some((start_slice, slice_count, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_destroy(self) -> Option<(VolumeDestroyResponder)> {
if let VolumeRequest::Destroy { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VolumeRequest::GetInfo { .. } => "get_info",
VolumeRequest::GetStats { .. } => "get_stats",
VolumeRequest::OpenSession { .. } => "open_session",
VolumeRequest::GetTypeGuid { .. } => "get_type_guid",
VolumeRequest::GetInstanceGuid { .. } => "get_instance_guid",
VolumeRequest::GetName { .. } => "get_name",
VolumeRequest::GetMetadata { .. } => "get_metadata",
VolumeRequest::QuerySlices { .. } => "query_slices",
VolumeRequest::GetVolumeInfo { .. } => "get_volume_info",
VolumeRequest::Extend { .. } => "extend",
VolumeRequest::Shrink { .. } => "shrink",
VolumeRequest::Destroy { .. } => "destroy",
}
}
}
#[derive(Debug, Clone)]
pub struct VolumeControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for VolumeControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl VolumeControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetInfoResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetInfoResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetInfoResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_hardware_block::BlockInfo, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_hardware_block::BlockInfo, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_hardware_block::BlockInfo, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_hardware_block::BlockGetInfoResponse,
i32,
>>(
result.map(|info| (info,)),
self.tx_id,
0x79df1a5cdb6cc6a3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetStatsResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetStatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetStatsResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetStatsResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_hardware_block::BlockStats, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_hardware_block::BlockStats, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_hardware_block::BlockStats, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_hardware_block::BlockGetStatsResponse,
i32,
>>(
result.map(|stats| (stats,)),
self.tx_id,
0x53d9542a778385ae,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetTypeGuidResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetTypeGuidResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetTypeGuidResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetTypeGuidResponder {
pub fn send(
self,
mut status: i32,
mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, guid);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, guid);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl_fuchsia_hardware_block_partition::PartitionGetTypeGuidResponse>(
(status, guid),
self.tx_id,
0x111843d737a9b847,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetInstanceGuidResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetInstanceGuidResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetInstanceGuidResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetInstanceGuidResponder {
pub fn send(
self,
mut status: i32,
mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, guid);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, guid);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut guid: Option<&fidl_fuchsia_hardware_block_partition::Guid>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl_fuchsia_hardware_block_partition::PartitionGetInstanceGuidResponse>(
(status, guid),
self.tx_id,
0x14a5a573b275d435,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetNameResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetNameResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetNameResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetNameResponder {
pub fn send(self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, name);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut name: Option<&str>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, name);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32, mut name: Option<&str>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse>(
(status, name),
self.tx_id,
0x7e3c6f0b0937fc02,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetMetadataResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetMetadataResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetMetadataResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetMetadataResponder {
pub fn send(
self,
mut result: Result<
&fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
i32,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<
&fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
i32,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
&fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
i32,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_hardware_block_partition::PartitionGetMetadataResponse,
i32,
>>(
result,
self.tx_id,
0x42d1464c96c3f3ff,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeQuerySlicesResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeQuerySlicesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeQuerySlicesResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeQuerySlicesResponder {
pub fn send(
self,
mut status: i32,
mut response: &[VsliceRange; 16],
mut response_count: u64,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, response, response_count);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut response: &[VsliceRange; 16],
mut response_count: u64,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, response, response_count);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut response: &[VsliceRange; 16],
mut response_count: u64,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeQuerySlicesResponse>(
(status, response, response_count),
self.tx_id,
0x589a96828a3e2aa1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeGetVolumeInfoResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeGetVolumeInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeGetVolumeInfoResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeGetVolumeInfoResponder {
pub fn send(
self,
mut status: i32,
mut manager: Option<&VolumeManagerInfo>,
mut volume: Option<&VolumeInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, manager, volume);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut manager: Option<&VolumeManagerInfo>,
mut volume: Option<&VolumeInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, manager, volume);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut manager: Option<&VolumeManagerInfo>,
mut volume: Option<&VolumeInfo>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeGetVolumeInfoResponse>(
(status, manager, volume),
self.tx_id,
0x60417b6cf9e34c80,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeExtendResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeExtendResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeExtendResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeExtendResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeExtendResponse>(
(status,),
self.tx_id,
0xdddf872f5039d37,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeShrinkResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeShrinkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeShrinkResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeShrinkResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeShrinkResponse>(
(status,),
self.tx_id,
0x27ab5ed4f6fdcd29,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeDestroyResponder {
control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeDestroyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeDestroyResponder {
type ControlHandle = VolumeControlHandle;
fn control_handle(&self) -> &VolumeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeDestroyResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeDestroyResponse>(
(status,),
self.tx_id,
0x732bf4bea39b5e87,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct VolumeManagerMarker;
impl fidl::endpoints::ProtocolMarker for VolumeManagerMarker {
type Proxy = VolumeManagerProxy;
type RequestStream = VolumeManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VolumeManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) VolumeManager";
}
pub type VolumeManagerSetPartitionNameResult = Result<(), i32>;
pub trait VolumeManagerProxyInterface: Send + Sync {
type AllocatePartitionResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#allocate_partition(
&self,
slice_count: u64,
type_: &fidl_fuchsia_hardware_block_partition::Guid,
instance: &fidl_fuchsia_hardware_block_partition::Guid,
name: &str,
flags: u32,
) -> Self::AllocatePartitionResponseFut;
type GetInfoResponseFut: std::future::Future<Output = Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error>>
+ Send;
fn r#get_info(&self) -> Self::GetInfoResponseFut;
type ActivateResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#activate(
&self,
old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> Self::ActivateResponseFut;
type GetPartitionLimitResponseFut: std::future::Future<Output = Result<(i32, u64), fidl::Error>>
+ Send;
fn r#get_partition_limit(
&self,
guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> Self::GetPartitionLimitResponseFut;
type SetPartitionLimitResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_partition_limit(
&self,
guid: &fidl_fuchsia_hardware_block_partition::Guid,
slice_count: u64,
) -> Self::SetPartitionLimitResponseFut;
type SetPartitionNameResponseFut: std::future::Future<Output = Result<VolumeManagerSetPartitionNameResult, fidl::Error>>
+ Send;
fn r#set_partition_name(
&self,
guid: &fidl_fuchsia_hardware_block_partition::Guid,
name: &str,
) -> Self::SetPartitionNameResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VolumeManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VolumeManagerSynchronousProxy {
type Proxy = VolumeManagerProxy;
type Protocol = VolumeManagerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl VolumeManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<VolumeManagerEvent, fidl::Error> {
VolumeManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#allocate_partition(
&self,
mut slice_count: u64,
mut type_: &fidl_fuchsia_hardware_block_partition::Guid,
mut instance: &fidl_fuchsia_hardware_block_partition::Guid,
mut name: &str,
mut flags: u32,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
VolumeManagerAllocatePartitionRequest,
VolumeManagerAllocatePartitionResponse,
>(
(slice_count, type_, instance, name, flags,),
0x4e79f24ed059e394,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#get_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, VolumeManagerGetInfoResponse>(
(),
0x735b3548582b2c9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.info))
}
pub fn r#activate(
&self,
mut old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<VolumeManagerActivateRequest, VolumeManagerActivateResponse>(
(old_guid, new_guid),
0xc8cef57012874d0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#get_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, u64), fidl::Error> {
let _response = self.client.send_query::<
VolumeManagerGetPartitionLimitRequest,
VolumeManagerGetPartitionLimitResponse,
>(
(guid,),
0x6e32f6df9fa2a919,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.slice_count))
}
pub fn r#set_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut slice_count: u64,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
VolumeManagerSetPartitionLimitRequest,
VolumeManagerSetPartitionLimitResponse,
>(
(guid, slice_count,),
0x2e09076ef266fa35,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#set_partition_name(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut name: &str,
___deadline: zx::MonotonicInstant,
) -> Result<VolumeManagerSetPartitionNameResult, fidl::Error> {
let _response = self.client.send_query::<
VolumeManagerSetPartitionNameRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(guid, name,),
0x4539a9b95cba0397,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct VolumeManagerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for VolumeManagerProxy {
type Protocol = VolumeManagerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl VolumeManagerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VolumeManagerEventStream {
VolumeManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#allocate_partition(
&self,
mut slice_count: u64,
mut type_: &fidl_fuchsia_hardware_block_partition::Guid,
mut instance: &fidl_fuchsia_hardware_block_partition::Guid,
mut name: &str,
mut flags: u32,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
VolumeManagerProxyInterface::r#allocate_partition(
self,
slice_count,
type_,
instance,
name,
flags,
)
}
pub fn r#get_info(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<VolumeManagerInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeManagerProxyInterface::r#get_info(self)
}
pub fn r#activate(
&self,
mut old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
VolumeManagerProxyInterface::r#activate(self, old_guid, new_guid)
}
pub fn r#get_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> fidl::client::QueryResponseFut<(i32, u64), fidl::encoding::DefaultFuchsiaResourceDialect>
{
VolumeManagerProxyInterface::r#get_partition_limit(self, guid)
}
pub fn r#set_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut slice_count: u64,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
VolumeManagerProxyInterface::r#set_partition_limit(self, guid, slice_count)
}
pub fn r#set_partition_name(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut name: &str,
) -> fidl::client::QueryResponseFut<
VolumeManagerSetPartitionNameResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
VolumeManagerProxyInterface::r#set_partition_name(self, guid, name)
}
}
impl VolumeManagerProxyInterface for VolumeManagerProxy {
type AllocatePartitionResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#allocate_partition(
&self,
mut slice_count: u64,
mut type_: &fidl_fuchsia_hardware_block_partition::Guid,
mut instance: &fidl_fuchsia_hardware_block_partition::Guid,
mut name: &str,
mut flags: u32,
) -> Self::AllocatePartitionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerAllocatePartitionResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e79f24ed059e394,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<VolumeManagerAllocatePartitionRequest, i32>(
(slice_count, type_, instance, name, flags),
0x4e79f24ed059e394,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetInfoResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<VolumeManagerInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerGetInfoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x735b3548582b2c9,
>(_buf?)?;
Ok((_response.status, _response.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<VolumeManagerInfo>>),
>(
(),
0x735b3548582b2c9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ActivateResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#activate(
&self,
mut old_guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut new_guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> Self::ActivateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerActivateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xc8cef57012874d0,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<VolumeManagerActivateRequest, i32>(
(old_guid, new_guid),
0xc8cef57012874d0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPartitionLimitResponseFut =
fidl::client::QueryResponseFut<(i32, u64), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> Self::GetPartitionLimitResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, u64), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerGetPartitionLimitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6e32f6df9fa2a919,
>(_buf?)?;
Ok((_response.status, _response.slice_count))
}
self.client.send_query_and_decode::<VolumeManagerGetPartitionLimitRequest, (i32, u64)>(
(guid,),
0x6e32f6df9fa2a919,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetPartitionLimitResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut slice_count: u64,
) -> Self::SetPartitionLimitResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerSetPartitionLimitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2e09076ef266fa35,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<VolumeManagerSetPartitionLimitRequest, i32>(
(guid, slice_count),
0x2e09076ef266fa35,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetPartitionNameResponseFut = fidl::client::QueryResponseFut<
VolumeManagerSetPartitionNameResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_partition_name(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
mut name: &str,
) -> Self::SetPartitionNameResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<VolumeManagerSetPartitionNameResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4539a9b95cba0397,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
VolumeManagerSetPartitionNameRequest,
VolumeManagerSetPartitionNameResult,
>(
(guid, name,),
0x4539a9b95cba0397,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct VolumeManagerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for VolumeManagerEventStream {}
impl futures::stream::FusedStream for VolumeManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VolumeManagerEventStream {
type Item = Result<VolumeManagerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(VolumeManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VolumeManagerEvent {}
impl VolumeManagerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<VolumeManagerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VolumeManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for VolumeManagerRequestStream {}
impl futures::stream::FusedStream for VolumeManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VolumeManagerRequestStream {
type Protocol = VolumeManagerMarker;
type ControlHandle = VolumeManagerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
VolumeManagerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for VolumeManagerRequestStream {
type Item = Result<VolumeManagerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled VolumeManagerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x4e79f24ed059e394 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeManagerAllocatePartitionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerAllocatePartitionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeManagerControlHandle { inner: this.inner.clone() };
Ok(VolumeManagerRequest::AllocatePartition {
slice_count: req.slice_count,
type_: req.type_,
instance: req.instance,
name: req.name,
flags: req.flags,
responder: VolumeManagerAllocatePartitionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x735b3548582b2c9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeManagerControlHandle { inner: this.inner.clone() };
Ok(VolumeManagerRequest::GetInfo {
responder: VolumeManagerGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xc8cef57012874d0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeManagerActivateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerActivateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeManagerControlHandle { inner: this.inner.clone() };
Ok(VolumeManagerRequest::Activate {
old_guid: req.old_guid,
new_guid: req.new_guid,
responder: VolumeManagerActivateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6e32f6df9fa2a919 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeManagerGetPartitionLimitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerGetPartitionLimitRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeManagerControlHandle { inner: this.inner.clone() };
Ok(VolumeManagerRequest::GetPartitionLimit {
guid: req.guid,
responder: VolumeManagerGetPartitionLimitResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2e09076ef266fa35 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeManagerSetPartitionLimitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerSetPartitionLimitRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeManagerControlHandle { inner: this.inner.clone() };
Ok(VolumeManagerRequest::SetPartitionLimit {
guid: req.guid,
slice_count: req.slice_count,
responder: VolumeManagerSetPartitionLimitResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4539a9b95cba0397 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
VolumeManagerSetPartitionNameRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeManagerSetPartitionNameRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeManagerControlHandle { inner: this.inner.clone() };
Ok(VolumeManagerRequest::SetPartitionName {
guid: req.guid,
name: req.name,
responder: VolumeManagerSetPartitionNameResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<VolumeManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum VolumeManagerRequest {
AllocatePartition {
slice_count: u64,
type_: fidl_fuchsia_hardware_block_partition::Guid,
instance: fidl_fuchsia_hardware_block_partition::Guid,
name: String,
flags: u32,
responder: VolumeManagerAllocatePartitionResponder,
},
GetInfo { responder: VolumeManagerGetInfoResponder },
Activate {
old_guid: fidl_fuchsia_hardware_block_partition::Guid,
new_guid: fidl_fuchsia_hardware_block_partition::Guid,
responder: VolumeManagerActivateResponder,
},
GetPartitionLimit {
guid: fidl_fuchsia_hardware_block_partition::Guid,
responder: VolumeManagerGetPartitionLimitResponder,
},
SetPartitionLimit {
guid: fidl_fuchsia_hardware_block_partition::Guid,
slice_count: u64,
responder: VolumeManagerSetPartitionLimitResponder,
},
SetPartitionName {
guid: fidl_fuchsia_hardware_block_partition::Guid,
name: String,
responder: VolumeManagerSetPartitionNameResponder,
},
}
impl VolumeManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_allocate_partition(
self,
) -> Option<(
u64,
fidl_fuchsia_hardware_block_partition::Guid,
fidl_fuchsia_hardware_block_partition::Guid,
String,
u32,
VolumeManagerAllocatePartitionResponder,
)> {
if let VolumeManagerRequest::AllocatePartition {
slice_count,
type_,
instance,
name,
flags,
responder,
} = self
{
Some((slice_count, type_, instance, name, flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(VolumeManagerGetInfoResponder)> {
if let VolumeManagerRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_activate(
self,
) -> Option<(
fidl_fuchsia_hardware_block_partition::Guid,
fidl_fuchsia_hardware_block_partition::Guid,
VolumeManagerActivateResponder,
)> {
if let VolumeManagerRequest::Activate { old_guid, new_guid, responder } = self {
Some((old_guid, new_guid, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_partition_limit(
self,
) -> Option<(
fidl_fuchsia_hardware_block_partition::Guid,
VolumeManagerGetPartitionLimitResponder,
)> {
if let VolumeManagerRequest::GetPartitionLimit { guid, responder } = self {
Some((guid, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_partition_limit(
self,
) -> Option<(
fidl_fuchsia_hardware_block_partition::Guid,
u64,
VolumeManagerSetPartitionLimitResponder,
)> {
if let VolumeManagerRequest::SetPartitionLimit { guid, slice_count, responder } = self {
Some((guid, slice_count, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_partition_name(
self,
) -> Option<(
fidl_fuchsia_hardware_block_partition::Guid,
String,
VolumeManagerSetPartitionNameResponder,
)> {
if let VolumeManagerRequest::SetPartitionName { guid, name, responder } = self {
Some((guid, name, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VolumeManagerRequest::AllocatePartition { .. } => "allocate_partition",
VolumeManagerRequest::GetInfo { .. } => "get_info",
VolumeManagerRequest::Activate { .. } => "activate",
VolumeManagerRequest::GetPartitionLimit { .. } => "get_partition_limit",
VolumeManagerRequest::SetPartitionLimit { .. } => "set_partition_limit",
VolumeManagerRequest::SetPartitionName { .. } => "set_partition_name",
}
}
}
#[derive(Debug, Clone)]
pub struct VolumeManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for VolumeManagerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl VolumeManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeManagerAllocatePartitionResponder {
control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeManagerAllocatePartitionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeManagerAllocatePartitionResponder {
type ControlHandle = VolumeManagerControlHandle;
fn control_handle(&self) -> &VolumeManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeManagerAllocatePartitionResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeManagerAllocatePartitionResponse>(
(status,),
self.tx_id,
0x4e79f24ed059e394,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeManagerGetInfoResponder {
control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeManagerGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeManagerGetInfoResponder {
type ControlHandle = VolumeManagerControlHandle;
fn control_handle(&self) -> &VolumeManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeManagerGetInfoResponder {
pub fn send(
self,
mut status: i32,
mut info: Option<&VolumeManagerInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut info: Option<&VolumeManagerInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, info);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut info: Option<&VolumeManagerInfo>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeManagerGetInfoResponse>(
(status, info),
self.tx_id,
0x735b3548582b2c9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeManagerActivateResponder {
control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeManagerActivateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeManagerActivateResponder {
type ControlHandle = VolumeManagerControlHandle;
fn control_handle(&self) -> &VolumeManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeManagerActivateResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeManagerActivateResponse>(
(status,),
self.tx_id,
0xc8cef57012874d0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeManagerGetPartitionLimitResponder {
control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeManagerGetPartitionLimitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeManagerGetPartitionLimitResponder {
type ControlHandle = VolumeManagerControlHandle;
fn control_handle(&self) -> &VolumeManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeManagerGetPartitionLimitResponder {
pub fn send(self, mut status: i32, mut slice_count: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, slice_count);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut slice_count: u64,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, slice_count);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32, mut slice_count: u64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeManagerGetPartitionLimitResponse>(
(status, slice_count),
self.tx_id,
0x6e32f6df9fa2a919,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeManagerSetPartitionLimitResponder {
control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeManagerSetPartitionLimitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeManagerSetPartitionLimitResponder {
type ControlHandle = VolumeManagerControlHandle;
fn control_handle(&self) -> &VolumeManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeManagerSetPartitionLimitResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<VolumeManagerSetPartitionLimitResponse>(
(status,),
self.tx_id,
0x2e09076ef266fa35,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeManagerSetPartitionNameResponder {
control_handle: std::mem::ManuallyDrop<VolumeManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeManagerSetPartitionNameResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeManagerSetPartitionNameResponder {
type ControlHandle = VolumeManagerControlHandle;
fn control_handle(&self) -> &VolumeManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeManagerSetPartitionNameResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4539a9b95cba0397,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for ServiceMarker {
type Proxy = ServiceProxy;
type Request = ServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.block.volume.Service";
}
#[cfg(target_os = "fuchsia")]
pub enum ServiceRequest {
Volume(VolumeRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for ServiceRequest {
type Service = ServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"volume" => Self::Volume(
<VolumeRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
),
_ => panic!("no such member protocol name for service Service"),
}
}
fn member_names() -> &'static [&'static str] {
&["volume"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for ServiceProxy {
type Service = ServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl ServiceProxy {
pub fn connect_to_volume(&self) -> Result<VolumeProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<VolumeMarker>();
self.connect_channel_to_volume(server_end)?;
Ok(proxy)
}
pub fn connect_to_volume_sync(&self) -> Result<VolumeSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<VolumeMarker>();
self.connect_channel_to_volume(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_volume(
&self,
server_end: fidl::endpoints::ServerEnd<VolumeMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("volume", server_end.into_channel())
}
}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for VolumeDestroyResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeDestroyResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<VolumeDestroyResponse, D>
for &VolumeDestroyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeDestroyResponse)
.write_unaligned((self as *const VolumeDestroyResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<VolumeDestroyResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeDestroyResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeExtendRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeExtendRequest {
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
}
#[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<VolumeExtendRequest, D>
for &VolumeExtendRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeExtendRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeExtendRequest)
.write_unaligned((self as *const VolumeExtendRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VolumeExtendRequest, 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::<VolumeExtendRequest>(offset);
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 VolumeExtendRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { start_slice: fidl::new_empty!(u64, D), slice_count: 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, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeExtendResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeExtendResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<VolumeExtendResponse, D>
for &VolumeExtendResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeExtendResponse)
.write_unaligned((self as *const VolumeExtendResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<VolumeExtendResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeExtendResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeGetVolumeInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeGetVolumeInfoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeGetVolumeInfoResponse, D> for &VolumeGetVolumeInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(offset);
fidl::encoding::Encode::<VolumeGetVolumeInfoResponse, D>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.manager),
<fidl::encoding::Boxed<VolumeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeInfo>, D>,
> fidl::encoding::Encode<VolumeGetVolumeInfoResponse, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(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)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeGetVolumeInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32, D),
manager: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, D),
volume: fidl::new_empty!(fidl::encoding::Boxed<VolumeInfo>, 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 = 0xffffffff00000000u64;
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!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<VolumeManagerInfo>,
D,
&mut self.manager,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<VolumeInfo>,
D,
&mut self.volume,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeInfo {
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
}
#[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<VolumeInfo, D>
for &VolumeInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeInfo).write_unaligned((self as *const VolumeInfo).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VolumeInfo, 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::<VolumeInfo>(offset);
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 VolumeInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
partition_slice_count: fidl::new_empty!(u64, D),
slice_limit: 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, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeManagerActivateRequest, D> for &VolumeManagerActivateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
fidl::encoding::Encode::<VolumeManagerActivateRequest, D>::encode(
(
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.old_guid),
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.new_guid),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
> fidl::encoding::Encode<VolumeManagerActivateRequest, 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::<VolumeManagerActivateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerActivateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
old_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
new_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, 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_fuchsia_hardware_block_partition::Guid,
D,
&mut self.old_guid,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
D,
&mut self.new_guid,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerActivateResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<VolumeManagerActivateResponse, D>
for &VolumeManagerActivateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeManagerActivateResponse)
.write_unaligned((self as *const VolumeManagerActivateResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<VolumeManagerActivateResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerActivateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionRequest {
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<VolumeManagerAllocatePartitionRequest, D>
for &VolumeManagerAllocatePartitionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
fidl::encoding::Encode::<VolumeManagerAllocatePartitionRequest, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.instance),
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
T2: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
T4: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest, 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::<VolumeManagerAllocatePartitionRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(56);
(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 + 40, depth)?;
self.4.encode(encoder, offset + 56, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerAllocatePartitionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
slice_count: fidl::new_empty!(u64, D),
type_: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
instance: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
flags: fidl::new_empty!(u32, 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(56) };
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 + 56 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
D,
&mut self.type_,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
D,
&mut self.instance,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
D,
&mut self.name,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(u32, D, &mut self.flags, decoder, offset + 56, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerAllocatePartitionResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<VolumeManagerAllocatePartitionResponse, D>
for &VolumeManagerAllocatePartitionResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeManagerAllocatePartitionResponse).write_unaligned(
(self as *const VolumeManagerAllocatePartitionResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerAllocatePartitionResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerGetInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetInfoResponse {
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<VolumeManagerGetInfoResponse, D> for &VolumeManagerGetInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
fidl::encoding::Encode::<VolumeManagerGetInfoResponse, D>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Boxed<VolumeManagerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>, D>,
> fidl::encoding::Encode<VolumeManagerGetInfoResponse, 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::<VolumeManagerGetInfoResponse>(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 VolumeManagerGetInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32, D),
info: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>, 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 = 0xffffffff00000000u64;
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!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<VolumeManagerInfo>,
D,
&mut self.info,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D>
for &VolumeManagerGetPartitionLimitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
fidl::encoding::Encode::<VolumeManagerGetPartitionLimitRequest, D>::encode(
(
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
> fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerGetPartitionLimitRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, 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_fuchsia_hardware_block_partition::Guid,
D,
&mut self.guid,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerGetPartitionLimitResponse {
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<VolumeManagerGetPartitionLimitResponse, D>
for &VolumeManagerGetPartitionLimitResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeManagerGetPartitionLimitResponse).write_unaligned(
(self as *const VolumeManagerGetPartitionLimitResponse).read(),
);
let padding_ptr = buf_ptr.offset(0) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse, 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::<VolumeManagerGetPartitionLimitResponse>(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 VolumeManagerGetPartitionLimitResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D), slice_count: 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 = 0xffffffff00000000u64;
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 VolumeManagerInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerInfo {
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<VolumeManagerInfo, D>
for &VolumeManagerInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeManagerInfo)
.write_unaligned((self as *const VolumeManagerInfo).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<VolumeManagerInfo, 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::<VolumeManagerInfo>(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 VolumeManagerInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
slice_size: fidl::new_empty!(u64, D),
slice_count: fidl::new_empty!(u64, D),
assigned_slice_count: fidl::new_empty!(u64, D),
maximum_slice_count: fidl::new_empty!(u64, D),
max_virtual_slice: 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 VolumeManagerSetPartitionLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, D>
for &VolumeManagerSetPartitionLimitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
fidl::encoding::Encode::<VolumeManagerSetPartitionLimitRequest, D>::encode(
(
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.slice_count),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest, 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::<VolumeManagerSetPartitionLimitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerSetPartitionLimitRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
slice_count: 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);
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
D,
&mut self.guid,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u64, D, &mut self.slice_count, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionLimitResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<VolumeManagerSetPartitionLimitResponse, D>
for &VolumeManagerSetPartitionLimitResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeManagerSetPartitionLimitResponse).write_unaligned(
(self as *const VolumeManagerSetPartitionLimitResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerSetPartitionLimitResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionNameRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeManagerSetPartitionNameRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, D>
for &VolumeManagerSetPartitionNameRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
fidl::encoding::Encode::<VolumeManagerSetPartitionNameRequest, D>::encode(
(
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
> fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest, 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::<VolumeManagerSetPartitionNameRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeManagerSetPartitionNameRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid, D),
name: fidl::new_empty!(fidl::encoding::BoundedString<128>, 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_fuchsia_hardware_block_partition::Guid,
D,
&mut self.guid,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
D,
&mut self.name,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeQuerySlicesRequest {
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<VolumeQuerySlicesRequest, D> for &VolumeQuerySlicesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
fidl::encoding::Encode::<VolumeQuerySlicesRequest, D>::encode(
(<fidl::encoding::Vector<u64, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.start_slices,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u64, 16>, D>,
> fidl::encoding::Encode<VolumeQuerySlicesRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeQuerySlicesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { start_slices: fidl::new_empty!(fidl::encoding::Vector<u64, 16>, 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<u64, 16>, D, &mut self.start_slices, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeQuerySlicesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
272
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeQuerySlicesResponse, D> for &VolumeQuerySlicesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(offset);
fidl::encoding::Encode::<VolumeQuerySlicesResponse, D>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Array<VsliceRange, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.response_count),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<VsliceRange, 16>, D>,
T2: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VolumeQuerySlicesResponse, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(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 + 264, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeQuerySlicesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32, D),
response: fidl::new_empty!(fidl::encoding::Array<VsliceRange, 16>, D),
response_count: 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 = 0xffffffff00000000u64;
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!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Array<VsliceRange, 16>, D, &mut self.response, decoder, offset + 8, _depth)?;
fidl::decode!(u64, D, &mut self.response_count, decoder, offset + 264, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeShrinkRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeShrinkRequest {
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
}
#[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<VolumeShrinkRequest, D>
for &VolumeShrinkRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeShrinkRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeShrinkRequest)
.write_unaligned((self as *const VolumeShrinkRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VolumeShrinkRequest, 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::<VolumeShrinkRequest>(offset);
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 VolumeShrinkRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { start_slice: fidl::new_empty!(u64, D), slice_count: 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, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeShrinkResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeShrinkResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[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<VolumeShrinkResponse, D>
for &VolumeShrinkResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut VolumeShrinkResponse)
.write_unaligned((self as *const VolumeShrinkResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<VolumeShrinkResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VolumeShrinkResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, 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, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VsliceRange {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VsliceRange {
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<VsliceRange, D>
for &VsliceRange
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VsliceRange>(offset);
fidl::encoding::Encode::<VsliceRange, D>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allocated),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<VsliceRange, 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::<VsliceRange>(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 VsliceRange {
#[inline(always)]
fn new_empty() -> Self {
Self { allocated: fidl::new_empty!(bool, D), count: 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!(bool, D, &mut self.allocated, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.count, decoder, offset + 8, _depth)?;
Ok(())
}
}
}