#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::endpoints::{ControlHandle as _, Responder as _};
use fuchsia_zircon_status as zx_status;
use futures::future::{self, MaybeDone, TryFutureExt};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
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 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::MonotonicTime) -> Result<VolumeEvent, fidl::Error> {
VolumeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_info(
&self,
___deadline: zx::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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#query_slices(
&self,
mut start_slices: &[u64],
___deadline: zx::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime) -> 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,
}
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> {
VolumeProxyInterface::r#get_info(self)
}
pub fn r#get_stats(
&self,
mut clear: bool,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_hardware_block::BlockGetStatsResult> {
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>>,
)> {
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>>,
)> {
VolumeProxyInterface::r#get_instance_guid(self)
}
pub fn r#get_name(&self) -> fidl::client::QueryResponseFut<(i32, Option<String>)> {
VolumeProxyInterface::r#get_name(self)
}
pub fn r#query_slices(
&self,
mut start_slices: &[u64],
) -> fidl::client::QueryResponseFut<(i32, [VsliceRange; 16], u64)> {
VolumeProxyInterface::r#query_slices(self, start_slices)
}
pub fn r#get_volume_info(
&self,
) -> fidl::client::QueryResponseFut<(
i32,
Option<Box<VolumeManagerInfo>>,
Option<Box<VolumeInfo>>,
)> {
VolumeProxyInterface::r#get_volume_info(self)
}
pub fn r#extend(
&self,
mut start_slice: u64,
mut slice_count: u64,
) -> fidl::client::QueryResponseFut<i32> {
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> {
VolumeProxyInterface::r#shrink(self, start_slice, slice_count)
}
pub fn r#destroy(&self) -> fidl::client::QueryResponseFut<i32> {
VolumeProxyInterface::r#destroy(self)
}
}
impl VolumeProxyInterface for VolumeProxy {
type GetInfoResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_hardware_block::BlockGetInfoResult>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::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>,
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>;
fn r#get_stats(&self, mut clear: bool) -> Self::GetStatsResponseFut {
fn _decode(
mut _buf: Result<fidl::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>,
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>>,
)>;
fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut {
fn _decode(
mut _buf: Result<fidl::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,
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>>,
)>;
fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut {
fn _decode(
mut _buf: Result<fidl::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,
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>)>;
fn r#get_name(&self) -> Self::GetNameResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<String>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse,
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 QuerySlicesResponseFut = fidl::client::QueryResponseFut<(i32, [VsliceRange; 16], u64)>;
fn r#query_slices(&self, mut start_slices: &[u64]) -> Self::QuerySlicesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeQuerySlicesResponse,
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>>,
)>;
fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
VolumeGetVolumeInfoResponse,
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>;
fn r#extend(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ExtendResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeExtendResponse,
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>;
fn r#shrink(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ShrinkResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeShrinkResponse,
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>;
fn r#destroy(&self) -> Self::DestroyResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeDestroyResponse,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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,
},
})
}
0x589a96828a3e2aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(VolumeQuerySlicesRequest);
fidl::encoding::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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 },
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_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::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>,
}
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()
}
}
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 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 VolumeAndNodeMarker;
impl fidl::endpoints::ProtocolMarker for VolumeAndNodeMarker {
type Proxy = VolumeAndNodeProxy;
type RequestStream = VolumeAndNodeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VolumeAndNodeSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) VolumeAndNode";
}
pub trait VolumeAndNodeProxyInterface: 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 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;
fn r#clone(
&self,
flags: fidl_fuchsia_io::OpenFlags,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error>;
type GetAttrResponseFut: std::future::Future<Output = Result<(i32, fidl_fuchsia_io::NodeAttributes), fidl::Error>>
+ Send;
fn r#get_attr(&self) -> Self::GetAttrResponseFut;
type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_attr(
&self,
flags: fidl_fuchsia_io::NodeAttributeFlags,
attributes: &fidl_fuchsia_io::NodeAttributes,
) -> Self::SetAttrResponseFut;
type GetFlagsResponseFut: std::future::Future<Output = Result<(i32, fidl_fuchsia_io::OpenFlags), fidl::Error>>
+ Send;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
type SetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_flags(&self, flags: fidl_fuchsia_io::OpenFlags) -> Self::SetFlagsResponseFut;
type QueryFilesystemResponseFut: std::future::Future<
Output = Result<(i32, Option<Box<fidl_fuchsia_io::FilesystemInfo>>), fidl::Error>,
> + Send;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
type CloseResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
> + Send;
fn r#close(&self) -> Self::CloseResponseFut;
type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#query(&self) -> Self::QueryResponseFut;
fn r#reopen(
&self,
rights_request: &fidl_fuchsia_io::RightsRequest,
object_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error>;
type GetConnectionInfoResponseFut: std::future::Future<Output = Result<fidl_fuchsia_io::ConnectionInfo, fidl::Error>>
+ Send;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
type GetAttributesResponseFut: std::future::Future<Output = Result<fidl_fuchsia_io::Node2GetAttributesResult, fidl::Error>>
+ Send;
fn r#get_attributes(
&self,
query: fidl_fuchsia_io::NodeAttributesQuery,
) -> Self::GetAttributesResponseFut;
type UpdateAttributesResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_io::Node2UpdateAttributesResult, fidl::Error>,
> + Send;
fn r#update_attributes(
&self,
payload: &fidl_fuchsia_io::MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut;
type SyncResponseFut: std::future::Future<Output = Result<fidl_fuchsia_io::Node2SyncResult, fidl::Error>>
+ Send;
fn r#sync(&self) -> Self::SyncResponseFut;
fn r#list_extended_attributes(
&self,
iterator: fidl::endpoints::ServerEnd<fidl_fuchsia_io::ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error>;
type GetExtendedAttributeResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_io::Node2GetExtendedAttributeResult, fidl::Error>,
> + Send;
fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
type SetExtendedAttributeResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_io::Node2SetExtendedAttributeResult, fidl::Error>,
> + Send;
fn r#set_extended_attribute(
&self,
name: &[u8],
value: fidl_fuchsia_io::ExtendedAttributeValue,
mode: fidl_fuchsia_io::SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut;
type RemoveExtendedAttributeResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_io::Node2RemoveExtendedAttributeResult, fidl::Error>,
> + Send;
fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
fn r#connect_to_device_fidl(&self, server: fidl::Channel) -> Result<(), fidl::Error>;
fn r#connect_to_controller(
&self,
server: fidl::endpoints::ServerEnd<fidl_fuchsia_device::ControllerMarker>,
) -> Result<(), fidl::Error>;
type BindResponseFut: std::future::Future<Output = Result<fidl_fuchsia_device::ControllerBindResult, fidl::Error>>
+ Send;
fn r#bind(&self, driver: &str) -> Self::BindResponseFut;
type RebindResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_device::ControllerRebindResult, fidl::Error>,
> + Send;
fn r#rebind(&self, driver: &str) -> Self::RebindResponseFut;
type UnbindChildrenResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_device::ControllerUnbindChildrenResult, fidl::Error>,
> + Send;
fn r#unbind_children(&self) -> Self::UnbindChildrenResponseFut;
type ScheduleUnbindResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_device::ControllerScheduleUnbindResult, fidl::Error>,
> + Send;
fn r#schedule_unbind(&self) -> Self::ScheduleUnbindResponseFut;
type GetTopologicalPathResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_device::ControllerGetTopologicalPathResult, fidl::Error>,
> + Send;
fn r#get_topological_path(&self) -> Self::GetTopologicalPathResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VolumeAndNodeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VolumeAndNodeSynchronousProxy {
type Proxy = VolumeAndNodeProxy;
type Protocol = VolumeAndNodeMarker;
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 VolumeAndNodeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VolumeAndNodeMarker 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::MonotonicTime,
) -> Result<VolumeAndNodeEvent, fidl::Error> {
VolumeAndNodeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_info(
&self,
___deadline: zx::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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#query_slices(
&self,
mut start_slices: &[u64],
___deadline: zx::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, VolumeDestroyResponse>(
(),
0x732bf4bea39b5e87,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#clone(
&self,
mut flags: fidl_fuchsia_io::OpenFlags,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_io::Node1CloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_attr(
&self,
___deadline: zx::MonotonicTime,
) -> Result<(i32, fidl_fuchsia_io::NodeAttributes), fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl_fuchsia_io::Node1GetAttrResponse>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.attributes))
}
pub fn r#set_attr(
&self,
mut flags: fidl_fuchsia_io::NodeAttributeFlags,
mut attributes: &fidl_fuchsia_io::NodeAttributes,
___deadline: zx::MonotonicTime,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::Node1SetAttrRequest,
fidl_fuchsia_io::Node1SetAttrResponse,
>(
(flags, attributes,),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#get_flags(
&self,
___deadline: zx::MonotonicTime,
) -> Result<(i32, fidl_fuchsia_io::OpenFlags), fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl_fuchsia_io::Node1GetFlagsResponse>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.flags))
}
pub fn r#set_flags(
&self,
mut flags: fidl_fuchsia_io::OpenFlags,
___deadline: zx::MonotonicTime,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::Node1SetFlagsRequest,
fidl_fuchsia_io::Node1SetFlagsResponse,
>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#query_filesystem(
&self,
___deadline: zx::MonotonicTime,
) -> Result<(i32, Option<Box<fidl_fuchsia_io::FilesystemInfo>>), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_io::Node1QueryFilesystemResponse,
>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.info))
}
pub fn r#close(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query(&self, ___deadline: zx::MonotonicTime) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::QueryableQueryResponse,
>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#reopen(
&self,
mut rights_request: &fidl_fuchsia_io::RightsRequest,
mut object_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_io::Node2ReopenRequest>(
(rights_request, object_request),
0x6a849ef281d2baa1,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_connection_info(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::ConnectionInfo, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl_fuchsia_io::ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_attributes(
&self,
mut query: fidl_fuchsia_io::NodeAttributesQuery,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::Node2GetAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::Node2GetAttributesRequest,
fidl::encoding::ResultType<fidl_fuchsia_io::NodeAttributes2, i32>,
>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
pub fn r#update_attributes(
&self,
mut payload: &fidl_fuchsia_io::MutableNodeAttributes,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::Node2UpdateAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::MutableNodeAttributes,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#sync(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::Node2SyncResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<fidl_fuchsia_io::ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_io::Node2ListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::Node2GetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::Node2GetExtendedAttributeRequest,
fidl::encoding::ResultType<fidl_fuchsia_io::ExtendedAttributeValue, i32>,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: fidl_fuchsia_io::ExtendedAttributeValue,
mut mode: fidl_fuchsia_io::SetExtendedAttributeMode,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::Node2SetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::Node2SetExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_io::Node2RemoveExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_io::Node2RemoveExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#connect_to_device_fidl(&self, mut server: fidl::Channel) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_device::ControllerConnectToDeviceFidlRequest>(
(server,),
0x793c584be7211f0d,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#connect_to_controller(
&self,
mut server: fidl::endpoints::ServerEnd<fidl_fuchsia_device::ControllerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_device::ControllerConnectToControllerRequest>(
(server,),
0x66774decb0c7a0d0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#bind(
&self,
mut driver: &str,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_device::ControllerBindResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_device::ControllerBindRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(driver,),
0x3388f12801462769,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#rebind(
&self,
mut driver: &str,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_device::ControllerRebindResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_device::ControllerRebindRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(driver,),
0x384fb80cbc2782e2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#unbind_children(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_device::ControllerUnbindChildrenResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x31fae8d74db7a426,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#schedule_unbind(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_device::ControllerScheduleUnbindResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x6128ba9d76aff9c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_topological_path(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_device::ControllerGetTopologicalPathResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_device::ControllerGetTopologicalPathResponse,
i32,
>>(
(), 0x2689b37663e00788, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.path))
}
}
#[derive(Debug, Clone)]
pub struct VolumeAndNodeProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for VolumeAndNodeProxy {
type Protocol = VolumeAndNodeMarker;
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 VolumeAndNodeProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <VolumeAndNodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VolumeAndNodeEventStream {
VolumeAndNodeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_info(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_hardware_block::BlockGetInfoResult> {
VolumeAndNodeProxyInterface::r#get_info(self)
}
pub fn r#get_stats(
&self,
mut clear: bool,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_hardware_block::BlockGetStatsResult> {
VolumeAndNodeProxyInterface::r#get_stats(self, clear)
}
pub fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
) -> Result<(), fidl::Error> {
VolumeAndNodeProxyInterface::r#open_session(self, session)
}
pub fn r#get_type_guid(
&self,
) -> fidl::client::QueryResponseFut<(
i32,
Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>,
)> {
VolumeAndNodeProxyInterface::r#get_type_guid(self)
}
pub fn r#get_instance_guid(
&self,
) -> fidl::client::QueryResponseFut<(
i32,
Option<Box<fidl_fuchsia_hardware_block_partition::Guid>>,
)> {
VolumeAndNodeProxyInterface::r#get_instance_guid(self)
}
pub fn r#get_name(&self) -> fidl::client::QueryResponseFut<(i32, Option<String>)> {
VolumeAndNodeProxyInterface::r#get_name(self)
}
pub fn r#query_slices(
&self,
mut start_slices: &[u64],
) -> fidl::client::QueryResponseFut<(i32, [VsliceRange; 16], u64)> {
VolumeAndNodeProxyInterface::r#query_slices(self, start_slices)
}
pub fn r#get_volume_info(
&self,
) -> fidl::client::QueryResponseFut<(
i32,
Option<Box<VolumeManagerInfo>>,
Option<Box<VolumeInfo>>,
)> {
VolumeAndNodeProxyInterface::r#get_volume_info(self)
}
pub fn r#extend(
&self,
mut start_slice: u64,
mut slice_count: u64,
) -> fidl::client::QueryResponseFut<i32> {
VolumeAndNodeProxyInterface::r#extend(self, start_slice, slice_count)
}
pub fn r#shrink(
&self,
mut start_slice: u64,
mut slice_count: u64,
) -> fidl::client::QueryResponseFut<i32> {
VolumeAndNodeProxyInterface::r#shrink(self, start_slice, slice_count)
}
pub fn r#destroy(&self) -> fidl::client::QueryResponseFut<i32> {
VolumeAndNodeProxyInterface::r#destroy(self)
}
pub fn r#clone(
&self,
mut flags: fidl_fuchsia_io::OpenFlags,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
VolumeAndNodeProxyInterface::r#clone(self, flags, object)
}
pub fn r#get_attr(
&self,
) -> fidl::client::QueryResponseFut<(i32, fidl_fuchsia_io::NodeAttributes)> {
VolumeAndNodeProxyInterface::r#get_attr(self)
}
pub fn r#set_attr(
&self,
mut flags: fidl_fuchsia_io::NodeAttributeFlags,
mut attributes: &fidl_fuchsia_io::NodeAttributes,
) -> fidl::client::QueryResponseFut<i32> {
VolumeAndNodeProxyInterface::r#set_attr(self, flags, attributes)
}
pub fn r#get_flags(&self) -> fidl::client::QueryResponseFut<(i32, fidl_fuchsia_io::OpenFlags)> {
VolumeAndNodeProxyInterface::r#get_flags(self)
}
pub fn r#set_flags(
&self,
mut flags: fidl_fuchsia_io::OpenFlags,
) -> fidl::client::QueryResponseFut<i32> {
VolumeAndNodeProxyInterface::r#set_flags(self, flags)
}
pub fn r#query_filesystem(
&self,
) -> fidl::client::QueryResponseFut<(i32, Option<Box<fidl_fuchsia_io::FilesystemInfo>>)> {
VolumeAndNodeProxyInterface::r#query_filesystem(self)
}
pub fn r#close(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_unknown::CloseableCloseResult> {
VolumeAndNodeProxyInterface::r#close(self)
}
pub fn r#query(&self) -> fidl::client::QueryResponseFut<Vec<u8>> {
VolumeAndNodeProxyInterface::r#query(self)
}
pub fn r#reopen(
&self,
mut rights_request: &fidl_fuchsia_io::RightsRequest,
mut object_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
VolumeAndNodeProxyInterface::r#reopen(self, rights_request, object_request)
}
pub fn r#get_connection_info(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::ConnectionInfo> {
VolumeAndNodeProxyInterface::r#get_connection_info(self)
}
pub fn r#get_attributes(
&self,
mut query: fidl_fuchsia_io::NodeAttributesQuery,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2GetAttributesResult> {
VolumeAndNodeProxyInterface::r#get_attributes(self, query)
}
pub fn r#update_attributes(
&self,
mut payload: &fidl_fuchsia_io::MutableNodeAttributes,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2UpdateAttributesResult> {
VolumeAndNodeProxyInterface::r#update_attributes(self, payload)
}
pub fn r#sync(&self) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2SyncResult> {
VolumeAndNodeProxyInterface::r#sync(self)
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<fidl_fuchsia_io::ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
VolumeAndNodeProxyInterface::r#list_extended_attributes(self, iterator)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2GetExtendedAttributeResult> {
VolumeAndNodeProxyInterface::r#get_extended_attribute(self, name)
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: fidl_fuchsia_io::ExtendedAttributeValue,
mut mode: fidl_fuchsia_io::SetExtendedAttributeMode,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2SetExtendedAttributeResult> {
VolumeAndNodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2RemoveExtendedAttributeResult> {
VolumeAndNodeProxyInterface::r#remove_extended_attribute(self, name)
}
pub fn r#connect_to_device_fidl(&self, mut server: fidl::Channel) -> Result<(), fidl::Error> {
VolumeAndNodeProxyInterface::r#connect_to_device_fidl(self, server)
}
pub fn r#connect_to_controller(
&self,
mut server: fidl::endpoints::ServerEnd<fidl_fuchsia_device::ControllerMarker>,
) -> Result<(), fidl::Error> {
VolumeAndNodeProxyInterface::r#connect_to_controller(self, server)
}
pub fn r#bind(
&self,
mut driver: &str,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerBindResult> {
VolumeAndNodeProxyInterface::r#bind(self, driver)
}
pub fn r#rebind(
&self,
mut driver: &str,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerRebindResult> {
VolumeAndNodeProxyInterface::r#rebind(self, driver)
}
pub fn r#unbind_children(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerUnbindChildrenResult> {
VolumeAndNodeProxyInterface::r#unbind_children(self)
}
pub fn r#schedule_unbind(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerScheduleUnbindResult> {
VolumeAndNodeProxyInterface::r#schedule_unbind(self)
}
pub fn r#get_topological_path(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerGetTopologicalPathResult>
{
VolumeAndNodeProxyInterface::r#get_topological_path(self)
}
}
impl VolumeAndNodeProxyInterface for VolumeAndNodeProxy {
type GetInfoResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_hardware_block::BlockGetInfoResult>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::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>,
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>;
fn r#get_stats(&self, mut clear: bool) -> Self::GetStatsResponseFut {
fn _decode(
mut _buf: Result<fidl::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>,
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>>,
)>;
fn r#get_type_guid(&self) -> Self::GetTypeGuidResponseFut {
fn _decode(
mut _buf: Result<fidl::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,
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>>,
)>;
fn r#get_instance_guid(&self) -> Self::GetInstanceGuidResponseFut {
fn _decode(
mut _buf: Result<fidl::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,
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>)>;
fn r#get_name(&self) -> Self::GetNameResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<String>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_hardware_block_partition::PartitionGetNameResponse,
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 QuerySlicesResponseFut = fidl::client::QueryResponseFut<(i32, [VsliceRange; 16], u64)>;
fn r#query_slices(&self, mut start_slices: &[u64]) -> Self::QuerySlicesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, [VsliceRange; 16], u64), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeQuerySlicesResponse,
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>>,
)>;
fn r#get_volume_info(&self) -> Self::GetVolumeInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>, Option<Box<VolumeInfo>>), fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
VolumeGetVolumeInfoResponse,
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>;
fn r#extend(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ExtendResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeExtendResponse,
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>;
fn r#shrink(&self, mut start_slice: u64, mut slice_count: u64) -> Self::ShrinkResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeShrinkResponse,
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>;
fn r#destroy(&self) -> Self::DestroyResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeDestroyResponse,
0x732bf4bea39b5e87,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x732bf4bea39b5e87,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone(
&self,
mut flags: fidl_fuchsia_io::OpenFlags,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_io::Node1CloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetAttrResponseFut =
fidl::client::QueryResponseFut<(i32, fidl_fuchsia_io::NodeAttributes)>;
fn r#get_attr(&self) -> Self::GetAttrResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, fidl_fuchsia_io::NodeAttributes), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_io::Node1GetAttrResponse,
0x78985e216314dafd,
>(_buf?)?;
Ok((_response.s, _response.attributes))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, fidl_fuchsia_io::NodeAttributes),
>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAttrResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_attr(
&self,
mut flags: fidl_fuchsia_io::NodeAttributeFlags,
mut attributes: &fidl_fuchsia_io::NodeAttributes,
) -> Self::SetAttrResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_io::Node1SetAttrResponse,
0x4186c0f40d938f46,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<fidl_fuchsia_io::Node1SetAttrRequest, i32>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFlagsResponseFut = fidl::client::QueryResponseFut<(i32, fidl_fuchsia_io::OpenFlags)>;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, fidl_fuchsia_io::OpenFlags), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_io::Node1GetFlagsResponse,
0x5b88fffb8eda3aa1,
>(_buf?)?;
Ok((_response.s, _response.flags))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, fidl_fuchsia_io::OpenFlags),
>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetFlagsResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_flags(&self, mut flags: fidl_fuchsia_io::OpenFlags) -> Self::SetFlagsResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_io::Node1SetFlagsResponse,
0x5295b76c71fde733,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<fidl_fuchsia_io::Node1SetFlagsRequest, i32>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryFilesystemResponseFut =
fidl::client::QueryResponseFut<(i32, Option<Box<fidl_fuchsia_io::FilesystemInfo>>)>;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<fidl_fuchsia_io::FilesystemInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_io::Node1QueryFilesystemResponse,
0x6f344a1c6b0a0610,
>(_buf?)?;
Ok((_response.s, _response.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<fidl_fuchsia_io::FilesystemInfo>>),
>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CloseResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_unknown::CloseableCloseResult>;
fn r#close(&self) -> Self::CloseResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x5ac5d459ad7f657e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::CloseableCloseResult,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryResponseFut = fidl::client::QueryResponseFut<Vec<u8>>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_unknown::QueryableQueryResponse,
0x2658edee9decfc06,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#reopen(
&self,
mut rights_request: &fidl_fuchsia_io::RightsRequest,
mut object_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_io::Node2ReopenRequest>(
(rights_request, object_request),
0x6a849ef281d2baa1,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetConnectionInfoResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_io::ConnectionInfo>;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::ConnectionInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_io::ConnectionInfo,
0x584c377c7c0a6d0b,
>(_buf?)?;
Ok(_response)
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_io::ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAttributesResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2GetAttributesResult>;
fn r#get_attributes(
&self,
mut query: fidl_fuchsia_io::NodeAttributesQuery,
) -> Self::GetAttributesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::Node2GetAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl_fuchsia_io::NodeAttributes2, i32>,
0x3d4396a638ea053b,
>(_buf?)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
self.client.send_query_and_decode::<
fidl_fuchsia_io::Node2GetAttributesRequest,
fidl_fuchsia_io::Node2GetAttributesResult,
>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateAttributesResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2UpdateAttributesResult>;
fn r#update_attributes(
&self,
mut payload: &fidl_fuchsia_io::MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::Node2UpdateAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x3308c1da5a89bf08,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_io::MutableNodeAttributes,
fidl_fuchsia_io::Node2UpdateAttributesResult,
>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SyncResponseFut = fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2SyncResult>;
fn r#sync(&self) -> Self::SyncResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::Node2SyncResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x2c5c27ca0ab5dc49,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_io::Node2SyncResult,
>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<fidl_fuchsia_io::ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_io::Node2ListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetExtendedAttributeResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2GetExtendedAttributeResult>;
fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::Node2GetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl_fuchsia_io::ExtendedAttributeValue, i32>,
0x45ffa3ccfdeb76db,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_io::Node2GetExtendedAttributeRequest,
fidl_fuchsia_io::Node2GetExtendedAttributeResult,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetExtendedAttributeResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2SetExtendedAttributeResult>;
fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: fidl_fuchsia_io::ExtendedAttributeValue,
mut mode: fidl_fuchsia_io::SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::Node2SetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x4a951362f681f23c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_io::Node2SetExtendedAttributeRequest,
fidl_fuchsia_io::Node2SetExtendedAttributeResult,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveExtendedAttributeResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_io::Node2RemoveExtendedAttributeResult>;
fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> Self::RemoveExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_io::Node2RemoveExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x7a0b9f3a9bf9032d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_io::Node2RemoveExtendedAttributeRequest,
fidl_fuchsia_io::Node2RemoveExtendedAttributeResult,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#connect_to_device_fidl(&self, mut server: fidl::Channel) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_device::ControllerConnectToDeviceFidlRequest>(
(server,),
0x793c584be7211f0d,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#connect_to_controller(
&self,
mut server: fidl::endpoints::ServerEnd<fidl_fuchsia_device::ControllerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_device::ControllerConnectToControllerRequest>(
(server,),
0x66774decb0c7a0d0,
fidl::encoding::DynamicFlags::empty(),
)
}
type BindResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerBindResult>;
fn r#bind(&self, mut driver: &str) -> Self::BindResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_device::ControllerBindResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x3388f12801462769,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_device::ControllerBindRequest,
fidl_fuchsia_device::ControllerBindResult,
>(
(driver,),
0x3388f12801462769,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RebindResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerRebindResult>;
fn r#rebind(&self, mut driver: &str) -> Self::RebindResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_device::ControllerRebindResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x384fb80cbc2782e2,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_device::ControllerRebindRequest,
fidl_fuchsia_device::ControllerRebindResult,
>(
(driver,),
0x384fb80cbc2782e2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UnbindChildrenResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerUnbindChildrenResult>;
fn r#unbind_children(&self) -> Self::UnbindChildrenResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_device::ControllerUnbindChildrenResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x31fae8d74db7a426,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_device::ControllerUnbindChildrenResult,
>(
(),
0x31fae8d74db7a426,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ScheduleUnbindResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerScheduleUnbindResult>;
fn r#schedule_unbind(&self) -> Self::ScheduleUnbindResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_device::ControllerScheduleUnbindResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x6128ba9d76aff9c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_device::ControllerScheduleUnbindResult,
>(
(),
0x6128ba9d76aff9c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetTopologicalPathResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_device::ControllerGetTopologicalPathResult>;
fn r#get_topological_path(&self) -> Self::GetTopologicalPathResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_device::ControllerGetTopologicalPathResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_device::ControllerGetTopologicalPathResponse,
i32,
>,
0x2689b37663e00788,
>(_buf?)?;
Ok(_response.map(|x| x.path))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_device::ControllerGetTopologicalPathResult,
>(
(),
0x2689b37663e00788,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct VolumeAndNodeEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for VolumeAndNodeEventStream {}
impl futures::stream::FusedStream for VolumeAndNodeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VolumeAndNodeEventStream {
type Item = Result<VolumeAndNodeEvent, 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(VolumeAndNodeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VolumeAndNodeEvent {
OnOpen_ {
s: i32,
info: Option<Box<fidl_fuchsia_io::NodeInfoDeprecated>>,
},
OnRepresentation {
payload: fidl_fuchsia_io::Representation,
},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl VolumeAndNodeEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_open_(self) -> Option<(i32, Option<Box<fidl_fuchsia_io::NodeInfoDeprecated>>)> {
if let VolumeAndNodeEvent::OnOpen_ { s, info } = self {
Some((s, info))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_representation(self) -> Option<fidl_fuchsia_io::Representation> {
if let VolumeAndNodeEvent::OnRepresentation { payload } = self {
Some((payload))
} else {
None
}
}
fn decode(mut buf: fidl::MessageBufEtc) -> Result<VolumeAndNodeEvent, 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 {
0x7fc7bbb1dbfd1972 => {
let mut out = fidl::new_empty!(fidl_fuchsia_io::Node1OnOpenRequest);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::Node1OnOpenRequest>(
&tx_header,
_body_bytes,
_handles,
&mut out,
)?;
Ok((VolumeAndNodeEvent::OnOpen_ { s: out.s, info: out.info }))
}
0x5cb40567d80a510c => {
let mut out = fidl::new_empty!(fidl_fuchsia_io::Representation);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::Representation>(
&tx_header,
_body_bytes,
_handles,
&mut out,
)?;
Ok((VolumeAndNodeEvent::OnRepresentation { payload: out }))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(VolumeAndNodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <VolumeAndNodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VolumeAndNodeRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for VolumeAndNodeRequestStream {}
impl futures::stream::FusedStream for VolumeAndNodeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VolumeAndNodeRequestStream {
type Protocol = VolumeAndNodeMarker;
type ControlHandle = VolumeAndNodeControlHandle;
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 {
VolumeAndNodeControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for VolumeAndNodeRequestStream {
type Item = Result<VolumeAndNodeRequest, 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 VolumeAndNodeRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
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::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetInfo {
responder: VolumeAndNodeGetInfoResponder {
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::Decoder::decode_into::<
fidl_fuchsia_hardware_block::BlockGetStatsRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetStats {
clear: req.clear,
responder: VolumeAndNodeGetStatsResponder {
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::Decoder::decode_into::<
fidl_fuchsia_hardware_block::BlockOpenSessionRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::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::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetTypeGuid {
responder: VolumeAndNodeGetTypeGuidResponder {
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::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetInstanceGuid {
responder: VolumeAndNodeGetInstanceGuidResponder {
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::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetName {
responder: VolumeAndNodeGetNameResponder {
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::Decoder::decode_into::<VolumeQuerySlicesRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::QuerySlices {
start_slices: req.start_slices,
responder: VolumeAndNodeQuerySlicesResponder {
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::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetVolumeInfo {
responder: VolumeAndNodeGetVolumeInfoResponder {
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::Decoder::decode_into::<VolumeExtendRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Extend {
start_slice: req.start_slice,
slice_count: req.slice_count,
responder: VolumeAndNodeExtendResponder {
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::Decoder::decode_into::<VolumeShrinkRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Shrink {
start_slice: req.start_slice,
slice_count: req.slice_count,
responder: VolumeAndNodeShrinkResponder {
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::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Destroy {
responder: VolumeAndNodeDestroyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5a61678f293ce16f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_io::Node1CloneRequest);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::Node1CloneRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Clone {
flags: req.flags,
object: req.object,
control_handle,
})
}
0x78985e216314dafd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetAttr {
responder: VolumeAndNodeGetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4186c0f40d938f46 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_io::Node1SetAttrRequest);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::Node1SetAttrRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::SetAttr {
flags: req.flags,
attributes: req.attributes,
responder: VolumeAndNodeSetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b88fffb8eda3aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetFlags {
responder: VolumeAndNodeGetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5295b76c71fde733 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_io::Node1SetFlagsRequest);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::Node1SetFlagsRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::SetFlags {
flags: req.flags,
responder: VolumeAndNodeSetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6f344a1c6b0a0610 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::QueryFilesystem {
responder: VolumeAndNodeQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5ac5d459ad7f657e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Close {
responder: VolumeAndNodeCloseResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2658edee9decfc06 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Query {
responder: VolumeAndNodeQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6a849ef281d2baa1 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_io::Node2ReopenRequest);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::Node2ReopenRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Reopen {
rights_request: req.rights_request,
object_request: req.object_request,
control_handle,
})
}
0x584c377c7c0a6d0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetConnectionInfo {
responder: VolumeAndNodeGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3d4396a638ea053b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_io::Node2GetAttributesRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_io::Node2GetAttributesRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetAttributes {
query: req.query,
responder: VolumeAndNodeGetAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3308c1da5a89bf08 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_io::MutableNodeAttributes);
fidl::encoding::Decoder::decode_into::<fidl_fuchsia_io::MutableNodeAttributes>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::UpdateAttributes {
payload: req,
responder: VolumeAndNodeUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c5c27ca0ab5dc49 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Sync {
responder: VolumeAndNodeSyncResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4b61033de007fcd0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req =
fidl::new_empty!(fidl_fuchsia_io::Node2ListExtendedAttributesRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_io::Node2ListExtendedAttributesRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::ListExtendedAttributes {
iterator: req.iterator,
control_handle,
})
}
0x45ffa3ccfdeb76db => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req =
fidl::new_empty!(fidl_fuchsia_io::Node2GetExtendedAttributeRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_io::Node2GetExtendedAttributeRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetExtendedAttribute {
name: req.name,
responder: VolumeAndNodeGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a951362f681f23c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req =
fidl::new_empty!(fidl_fuchsia_io::Node2SetExtendedAttributeRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_io::Node2SetExtendedAttributeRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::SetExtendedAttribute {
name: req.name,
value: req.value,
mode: req.mode,
responder: VolumeAndNodeSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a0b9f3a9bf9032d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req =
fidl::new_empty!(fidl_fuchsia_io::Node2RemoveExtendedAttributeRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_io::Node2RemoveExtendedAttributeRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::RemoveExtendedAttribute {
name: req.name,
responder: VolumeAndNodeRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x793c584be7211f0d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req =
fidl::new_empty!(fidl_fuchsia_device::ControllerConnectToDeviceFidlRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_device::ControllerConnectToDeviceFidlRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::ConnectToDeviceFidl {
server: req.server,
control_handle,
})
}
0x66774decb0c7a0d0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req =
fidl::new_empty!(fidl_fuchsia_device::ControllerConnectToControllerRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_device::ControllerConnectToControllerRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::ConnectToController {
server: req.server,
control_handle,
})
}
0x3388f12801462769 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_device::ControllerBindRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_device::ControllerBindRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Bind {
driver: req.driver,
responder: VolumeAndNodeBindResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x384fb80cbc2782e2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_device::ControllerRebindRequest);
fidl::encoding::Decoder::decode_into::<
fidl_fuchsia_device::ControllerRebindRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::Rebind {
driver: req.driver,
responder: VolumeAndNodeRebindResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x31fae8d74db7a426 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::UnbindChildren {
responder: VolumeAndNodeUnbindChildrenResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6128ba9d76aff9c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::ScheduleUnbind {
responder: VolumeAndNodeScheduleUnbindResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2689b37663e00788 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = VolumeAndNodeControlHandle { inner: this.inner.clone() };
Ok(VolumeAndNodeRequest::GetTopologicalPath {
responder: VolumeAndNodeGetTopologicalPathResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(VolumeAndNodeRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: VolumeAndNodeControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(VolumeAndNodeRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: VolumeAndNodeControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<VolumeAndNodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum VolumeAndNodeRequest {
GetInfo {
responder: VolumeAndNodeGetInfoResponder,
},
GetStats {
clear: bool,
responder: VolumeAndNodeGetStatsResponder,
},
OpenSession {
session: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block::SessionMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetTypeGuid {
responder: VolumeAndNodeGetTypeGuidResponder,
},
GetInstanceGuid {
responder: VolumeAndNodeGetInstanceGuidResponder,
},
GetName {
responder: VolumeAndNodeGetNameResponder,
},
QuerySlices {
start_slices: Vec<u64>,
responder: VolumeAndNodeQuerySlicesResponder,
},
GetVolumeInfo {
responder: VolumeAndNodeGetVolumeInfoResponder,
},
Extend {
start_slice: u64,
slice_count: u64,
responder: VolumeAndNodeExtendResponder,
},
Shrink {
start_slice: u64,
slice_count: u64,
responder: VolumeAndNodeShrinkResponder,
},
Destroy {
responder: VolumeAndNodeDestroyResponder,
},
Clone {
flags: fidl_fuchsia_io::OpenFlags,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetAttr {
responder: VolumeAndNodeGetAttrResponder,
},
SetAttr {
flags: fidl_fuchsia_io::NodeAttributeFlags,
attributes: fidl_fuchsia_io::NodeAttributes,
responder: VolumeAndNodeSetAttrResponder,
},
GetFlags {
responder: VolumeAndNodeGetFlagsResponder,
},
SetFlags {
flags: fidl_fuchsia_io::OpenFlags,
responder: VolumeAndNodeSetFlagsResponder,
},
QueryFilesystem {
responder: VolumeAndNodeQueryFilesystemResponder,
},
Close {
responder: VolumeAndNodeCloseResponder,
},
Query {
responder: VolumeAndNodeQueryResponder,
},
Reopen {
rights_request: fidl_fuchsia_io::RightsRequest,
object_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetConnectionInfo {
responder: VolumeAndNodeGetConnectionInfoResponder,
},
GetAttributes {
query: fidl_fuchsia_io::NodeAttributesQuery,
responder: VolumeAndNodeGetAttributesResponder,
},
UpdateAttributes {
payload: fidl_fuchsia_io::MutableNodeAttributes,
responder: VolumeAndNodeUpdateAttributesResponder,
},
Sync {
responder: VolumeAndNodeSyncResponder,
},
ListExtendedAttributes {
iterator: fidl::endpoints::ServerEnd<fidl_fuchsia_io::ExtendedAttributeIteratorMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetExtendedAttribute {
name: Vec<u8>,
responder: VolumeAndNodeGetExtendedAttributeResponder,
},
SetExtendedAttribute {
name: Vec<u8>,
value: fidl_fuchsia_io::ExtendedAttributeValue,
mode: fidl_fuchsia_io::SetExtendedAttributeMode,
responder: VolumeAndNodeSetExtendedAttributeResponder,
},
RemoveExtendedAttribute {
name: Vec<u8>,
responder: VolumeAndNodeRemoveExtendedAttributeResponder,
},
ConnectToDeviceFidl {
server: fidl::Channel,
control_handle: VolumeAndNodeControlHandle,
},
ConnectToController {
server: fidl::endpoints::ServerEnd<fidl_fuchsia_device::ControllerMarker>,
control_handle: VolumeAndNodeControlHandle,
},
Bind {
driver: String,
responder: VolumeAndNodeBindResponder,
},
Rebind {
driver: String,
responder: VolumeAndNodeRebindResponder,
},
UnbindChildren {
responder: VolumeAndNodeUnbindChildrenResponder,
},
ScheduleUnbind {
responder: VolumeAndNodeScheduleUnbindResponder,
},
GetTopologicalPath {
responder: VolumeAndNodeGetTopologicalPathResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: VolumeAndNodeControlHandle,
method_type: fidl::MethodType,
},
}
impl VolumeAndNodeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(VolumeAndNodeGetInfoResponder)> {
if let VolumeAndNodeRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_stats(self) -> Option<(bool, VolumeAndNodeGetStatsResponder)> {
if let VolumeAndNodeRequest::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>,
VolumeAndNodeControlHandle,
)> {
if let VolumeAndNodeRequest::OpenSession { session, control_handle } = self {
Some((session, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_type_guid(self) -> Option<(VolumeAndNodeGetTypeGuidResponder)> {
if let VolumeAndNodeRequest::GetTypeGuid { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_instance_guid(self) -> Option<(VolumeAndNodeGetInstanceGuidResponder)> {
if let VolumeAndNodeRequest::GetInstanceGuid { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_name(self) -> Option<(VolumeAndNodeGetNameResponder)> {
if let VolumeAndNodeRequest::GetName { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_slices(self) -> Option<(Vec<u64>, VolumeAndNodeQuerySlicesResponder)> {
if let VolumeAndNodeRequest::QuerySlices { start_slices, responder } = self {
Some((start_slices, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_volume_info(self) -> Option<(VolumeAndNodeGetVolumeInfoResponder)> {
if let VolumeAndNodeRequest::GetVolumeInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_extend(self) -> Option<(u64, u64, VolumeAndNodeExtendResponder)> {
if let VolumeAndNodeRequest::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, VolumeAndNodeShrinkResponder)> {
if let VolumeAndNodeRequest::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<(VolumeAndNodeDestroyResponder)> {
if let VolumeAndNodeRequest::Destroy { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(
self,
) -> Option<(
fidl_fuchsia_io::OpenFlags,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
VolumeAndNodeControlHandle,
)> {
if let VolumeAndNodeRequest::Clone { flags, object, control_handle } = self {
Some((flags, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attr(self) -> Option<(VolumeAndNodeGetAttrResponder)> {
if let VolumeAndNodeRequest::GetAttr { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_attr(
self,
) -> Option<(
fidl_fuchsia_io::NodeAttributeFlags,
fidl_fuchsia_io::NodeAttributes,
VolumeAndNodeSetAttrResponder,
)> {
if let VolumeAndNodeRequest::SetAttr { flags, attributes, responder } = self {
Some((flags, attributes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_flags(self) -> Option<(VolumeAndNodeGetFlagsResponder)> {
if let VolumeAndNodeRequest::GetFlags { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_flags(
self,
) -> Option<(fidl_fuchsia_io::OpenFlags, VolumeAndNodeSetFlagsResponder)> {
if let VolumeAndNodeRequest::SetFlags { flags, responder } = self {
Some((flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_filesystem(self) -> Option<(VolumeAndNodeQueryFilesystemResponder)> {
if let VolumeAndNodeRequest::QueryFilesystem { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(VolumeAndNodeCloseResponder)> {
if let VolumeAndNodeRequest::Close { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(VolumeAndNodeQueryResponder)> {
if let VolumeAndNodeRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_reopen(
self,
) -> Option<(
fidl_fuchsia_io::RightsRequest,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
VolumeAndNodeControlHandle,
)> {
if let VolumeAndNodeRequest::Reopen { rights_request, object_request, control_handle } =
self
{
Some((rights_request, object_request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_connection_info(self) -> Option<(VolumeAndNodeGetConnectionInfoResponder)> {
if let VolumeAndNodeRequest::GetConnectionInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attributes(
self,
) -> Option<(fidl_fuchsia_io::NodeAttributesQuery, VolumeAndNodeGetAttributesResponder)> {
if let VolumeAndNodeRequest::GetAttributes { query, responder } = self {
Some((query, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_attributes(
self,
) -> Option<(fidl_fuchsia_io::MutableNodeAttributes, VolumeAndNodeUpdateAttributesResponder)>
{
if let VolumeAndNodeRequest::UpdateAttributes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_sync(self) -> Option<(VolumeAndNodeSyncResponder)> {
if let VolumeAndNodeRequest::Sync { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_extended_attributes(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_io::ExtendedAttributeIteratorMarker>,
VolumeAndNodeControlHandle,
)> {
if let VolumeAndNodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_extended_attribute(
self,
) -> Option<(Vec<u8>, VolumeAndNodeGetExtendedAttributeResponder)> {
if let VolumeAndNodeRequest::GetExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_extended_attribute(
self,
) -> Option<(
Vec<u8>,
fidl_fuchsia_io::ExtendedAttributeValue,
fidl_fuchsia_io::SetExtendedAttributeMode,
VolumeAndNodeSetExtendedAttributeResponder,
)> {
if let VolumeAndNodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
Some((name, value, mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_extended_attribute(
self,
) -> Option<(Vec<u8>, VolumeAndNodeRemoveExtendedAttributeResponder)> {
if let VolumeAndNodeRequest::RemoveExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_to_device_fidl(
self,
) -> Option<(fidl::Channel, VolumeAndNodeControlHandle)> {
if let VolumeAndNodeRequest::ConnectToDeviceFidl { server, control_handle } = self {
Some((server, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_to_controller(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_device::ControllerMarker>,
VolumeAndNodeControlHandle,
)> {
if let VolumeAndNodeRequest::ConnectToController { server, control_handle } = self {
Some((server, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_bind(self) -> Option<(String, VolumeAndNodeBindResponder)> {
if let VolumeAndNodeRequest::Bind { driver, responder } = self {
Some((driver, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_rebind(self) -> Option<(String, VolumeAndNodeRebindResponder)> {
if let VolumeAndNodeRequest::Rebind { driver, responder } = self {
Some((driver, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_unbind_children(self) -> Option<(VolumeAndNodeUnbindChildrenResponder)> {
if let VolumeAndNodeRequest::UnbindChildren { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_schedule_unbind(self) -> Option<(VolumeAndNodeScheduleUnbindResponder)> {
if let VolumeAndNodeRequest::ScheduleUnbind { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_topological_path(self) -> Option<(VolumeAndNodeGetTopologicalPathResponder)> {
if let VolumeAndNodeRequest::GetTopologicalPath { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VolumeAndNodeRequest::GetInfo { .. } => "get_info",
VolumeAndNodeRequest::GetStats { .. } => "get_stats",
VolumeAndNodeRequest::OpenSession { .. } => "open_session",
VolumeAndNodeRequest::GetTypeGuid { .. } => "get_type_guid",
VolumeAndNodeRequest::GetInstanceGuid { .. } => "get_instance_guid",
VolumeAndNodeRequest::GetName { .. } => "get_name",
VolumeAndNodeRequest::QuerySlices { .. } => "query_slices",
VolumeAndNodeRequest::GetVolumeInfo { .. } => "get_volume_info",
VolumeAndNodeRequest::Extend { .. } => "extend",
VolumeAndNodeRequest::Shrink { .. } => "shrink",
VolumeAndNodeRequest::Destroy { .. } => "destroy",
VolumeAndNodeRequest::Clone { .. } => "clone",
VolumeAndNodeRequest::GetAttr { .. } => "get_attr",
VolumeAndNodeRequest::SetAttr { .. } => "set_attr",
VolumeAndNodeRequest::GetFlags { .. } => "get_flags",
VolumeAndNodeRequest::SetFlags { .. } => "set_flags",
VolumeAndNodeRequest::QueryFilesystem { .. } => "query_filesystem",
VolumeAndNodeRequest::Close { .. } => "close",
VolumeAndNodeRequest::Query { .. } => "query",
VolumeAndNodeRequest::Reopen { .. } => "reopen",
VolumeAndNodeRequest::GetConnectionInfo { .. } => "get_connection_info",
VolumeAndNodeRequest::GetAttributes { .. } => "get_attributes",
VolumeAndNodeRequest::UpdateAttributes { .. } => "update_attributes",
VolumeAndNodeRequest::Sync { .. } => "sync",
VolumeAndNodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
VolumeAndNodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
VolumeAndNodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
VolumeAndNodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
VolumeAndNodeRequest::ConnectToDeviceFidl { .. } => "connect_to_device_fidl",
VolumeAndNodeRequest::ConnectToController { .. } => "connect_to_controller",
VolumeAndNodeRequest::Bind { .. } => "bind",
VolumeAndNodeRequest::Rebind { .. } => "rebind",
VolumeAndNodeRequest::UnbindChildren { .. } => "unbind_children",
VolumeAndNodeRequest::ScheduleUnbind { .. } => "schedule_unbind",
VolumeAndNodeRequest::GetTopologicalPath { .. } => "get_topological_path",
VolumeAndNodeRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
VolumeAndNodeRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct VolumeAndNodeControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for VolumeAndNodeControlHandle {
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()
}
}
impl VolumeAndNodeControlHandle {
pub fn send_on_open_(
&self,
mut s: i32,
mut info: Option<fidl_fuchsia_io::NodeInfoDeprecated>,
) -> Result<(), fidl::Error> {
self.inner.send::<fidl_fuchsia_io::Node1OnOpenRequest>(
(s, info.as_mut()),
0,
0x7fc7bbb1dbfd1972,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_representation(
&self,
mut payload: fidl_fuchsia_io::Representation,
) -> Result<(), fidl::Error> {
self.inner.send::<fidl_fuchsia_io::Representation>(
&mut payload,
0,
0x5cb40567d80a510c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetInfoResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetInfoResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetInfoResponder {
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 VolumeAndNodeGetStatsResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetStatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetStatsResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetStatsResponder {
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 VolumeAndNodeGetTypeGuidResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetTypeGuidResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetTypeGuidResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetTypeGuidResponder {
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 VolumeAndNodeGetInstanceGuidResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetInstanceGuidResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetInstanceGuidResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetInstanceGuidResponder {
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 VolumeAndNodeGetNameResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetNameResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetNameResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetNameResponder {
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 VolumeAndNodeQuerySlicesResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeQuerySlicesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeQuerySlicesResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeQuerySlicesResponder {
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 VolumeAndNodeGetVolumeInfoResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetVolumeInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetVolumeInfoResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetVolumeInfoResponder {
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 VolumeAndNodeExtendResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeExtendResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeExtendResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeExtendResponder {
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 VolumeAndNodeShrinkResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeShrinkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeShrinkResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeShrinkResponder {
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 VolumeAndNodeDestroyResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeDestroyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeDestroyResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeDestroyResponder {
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(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetAttrResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetAttrResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetAttrResponder {
pub fn send(
self,
mut s: i32,
mut attributes: &fidl_fuchsia_io::NodeAttributes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut attributes: &fidl_fuchsia_io::NodeAttributes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut s: i32,
mut attributes: &fidl_fuchsia_io::NodeAttributes,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_io::Node1GetAttrResponse>(
(s, attributes),
self.tx_id,
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeSetAttrResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeSetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeSetAttrResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeSetAttrResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_io::Node1SetAttrResponse>(
(s,),
self.tx_id,
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetFlagsResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetFlagsResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetFlagsResponder {
pub fn send(
self,
mut s: i32,
mut flags: fidl_fuchsia_io::OpenFlags,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut flags: fidl_fuchsia_io::OpenFlags,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut s: i32,
mut flags: fidl_fuchsia_io::OpenFlags,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_io::Node1GetFlagsResponse>(
(s, flags),
self.tx_id,
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeSetFlagsResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeSetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeSetFlagsResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeSetFlagsResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_io::Node1SetFlagsResponse>(
(s,),
self.tx_id,
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeQueryFilesystemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeQueryFilesystemResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeQueryFilesystemResponder {
pub fn send(
self,
mut s: i32,
mut info: Option<&fidl_fuchsia_io::FilesystemInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut info: Option<&fidl_fuchsia_io::FilesystemInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut s: i32,
mut info: Option<&fidl_fuchsia_io::FilesystemInfo>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_io::Node1QueryFilesystemResponse>(
(s, info),
self.tx_id,
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeCloseResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeCloseResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeCloseResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeCloseResponder {
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,
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeQueryResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeQueryResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeQueryResponder {
pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
(protocol,),
self.tx_id,
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetConnectionInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetConnectionInfoResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetConnectionInfoResponder {
pub fn send(self, mut payload: fidl_fuchsia_io::ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: fidl_fuchsia_io::ConnectionInfo,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: fidl_fuchsia_io::ConnectionInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_io::ConnectionInfo>(
&mut payload,
self.tx_id,
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetAttributesResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetAttributesResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetAttributesResponder {
pub fn send(
self,
mut result: Result<
(&fidl_fuchsia_io::MutableNodeAttributes, &fidl_fuchsia_io::ImmutableNodeAttributes),
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_io::MutableNodeAttributes, &fidl_fuchsia_io::ImmutableNodeAttributes),
i32,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
(&fidl_fuchsia_io::MutableNodeAttributes, &fidl_fuchsia_io::ImmutableNodeAttributes),
i32,
>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl_fuchsia_io::NodeAttributes2, i32>>(
result,
self.tx_id,
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeUpdateAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeUpdateAttributesResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeUpdateAttributesResponder {
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,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeSyncResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeSyncResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeSyncResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeSyncResponder {
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,
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetExtendedAttributeResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetExtendedAttributeResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_io::ExtendedAttributeValue, 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_io::ExtendedAttributeValue, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_io::ExtendedAttributeValue, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_io::ExtendedAttributeValue,
i32,
>>(
result.as_mut().map_err(|e| *e),
self.tx_id,
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeSetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeSetExtendedAttributeResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeSetExtendedAttributeResponder {
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,
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeRemoveExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeRemoveExtendedAttributeResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeRemoveExtendedAttributeResponder {
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,
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeBindResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeBindResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeBindResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeBindResponder {
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,
0x3388f12801462769,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeRebindResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeRebindResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeRebindResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeRebindResponder {
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,
0x384fb80cbc2782e2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeUnbindChildrenResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeUnbindChildrenResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeUnbindChildrenResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeUnbindChildrenResponder {
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,
0x31fae8d74db7a426,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeScheduleUnbindResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeScheduleUnbindResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeScheduleUnbindResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeScheduleUnbindResponder {
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,
0x6128ba9d76aff9c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct VolumeAndNodeGetTopologicalPathResponder {
control_handle: std::mem::ManuallyDrop<VolumeAndNodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for VolumeAndNodeGetTopologicalPathResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for VolumeAndNodeGetTopologicalPathResponder {
type ControlHandle = VolumeAndNodeControlHandle;
fn control_handle(&self) -> &VolumeAndNodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl VolumeAndNodeGetTopologicalPathResponder {
pub fn send(self, mut result: Result<&str, 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<&str, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&str, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_device::ControllerGetTopologicalPathResponse,
i32,
>>(
result.map(|path| (path,)),
self.tx_id,
0x2689b37663e00788,
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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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::MonotonicTime,
) -> 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,
}
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> {
VolumeManagerProxyInterface::r#allocate_partition(
self,
slice_count,
type_,
instance,
name,
flags,
)
}
pub fn r#get_info(
&self,
) -> fidl::client::QueryResponseFut<(i32, Option<Box<VolumeManagerInfo>>)> {
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> {
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)> {
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> {
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> {
VolumeManagerProxyInterface::r#set_partition_name(self, guid, name)
}
}
impl VolumeManagerProxyInterface for VolumeManagerProxy {
type AllocatePartitionResponseFut = fidl::client::QueryResponseFut<i32>;
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::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerAllocatePartitionResponse,
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>>)>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<VolumeManagerInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerGetInfoResponse,
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>;
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::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerActivateResponse,
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)>;
fn r#get_partition_limit(
&self,
mut guid: &fidl_fuchsia_hardware_block_partition::Guid,
) -> Self::GetPartitionLimitResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, u64), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerGetPartitionLimitResponse,
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>;
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::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
VolumeManagerSetPartitionLimitResponse,
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>;
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::MessageBufEtc, fidl::Error>,
) -> Result<VolumeManagerSetPartitionNameResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, 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(|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))))
}
}
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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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>,
}
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()
}
}
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(),
)
}
}
mod internal {
use super::*;
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeDestroyResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeDestroyResponse> for &VolumeDestroyResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<VolumeDestroyResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeDestroyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeDestroyResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeExtendRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeExtendRequest> for &VolumeExtendRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<VolumeExtendRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeExtendRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { start_slice: fidl::new_empty!(u64), slice_count: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeExtendResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeExtendResponse> for &VolumeExtendResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<VolumeExtendResponse> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeExtendResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeExtendResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeGetVolumeInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeGetVolumeInfoResponse> for &VolumeGetVolumeInfoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeGetVolumeInfoResponse>(offset);
fidl::encoding::Encode::<VolumeGetVolumeInfoResponse>::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<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>>,
T2: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeInfo>>,
> fidl::encoding::Encode<VolumeGetVolumeInfoResponse> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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 fidl::encoding::Decode<Self> for VolumeGetVolumeInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
manager: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>),
volume: fidl::new_empty!(fidl::encoding::Boxed<VolumeInfo>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<VolumeManagerInfo>,
&mut self.manager,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<VolumeInfo>,
&mut self.volume,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeInfo {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeInfo> for &VolumeInfo {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<VolumeInfo> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
partition_slice_count: fidl::new_empty!(u64),
slice_limit: fidl::new_empty!(u64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerActivateRequest> for &VolumeManagerActivateRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerActivateRequest>(offset);
fidl::encoding::Encode::<VolumeManagerActivateRequest>::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<
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>,
> fidl::encoding::Encode<VolumeManagerActivateRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerActivateRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
old_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid),
new_guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.old_guid,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.new_guid,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerActivateResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerActivateResponse>
for &VolumeManagerActivateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<VolumeManagerActivateResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerActivateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeManagerActivateResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest>
for &VolumeManagerAllocatePartitionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerAllocatePartitionRequest>(offset);
fidl::encoding::Encode::<VolumeManagerAllocatePartitionRequest>::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<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>,
T2: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>,
T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>>,
T4: fidl::encoding::Encode<u32>,
> fidl::encoding::Encode<VolumeManagerAllocatePartitionRequest> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerAllocatePartitionRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
slice_count: fidl::new_empty!(u64),
type_: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid),
instance: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid),
name: fidl::new_empty!(fidl::encoding::BoundedString<128>),
flags: fidl::new_empty!(u32),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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, &mut self.slice_count, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.type_,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.instance,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
&mut self.name,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(u32, &mut self.flags, decoder, offset + 56, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerAllocatePartitionResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse>
for &VolumeManagerAllocatePartitionResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<VolumeManagerAllocatePartitionResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerAllocatePartitionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeManagerAllocatePartitionResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerGetInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerGetInfoResponse> for &VolumeManagerGetInfoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetInfoResponse>(offset);
fidl::encoding::Encode::<VolumeManagerGetInfoResponse>::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<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<VolumeManagerInfo>>,
> fidl::encoding::Encode<VolumeManagerGetInfoResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerGetInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
info: fidl::new_empty!(fidl::encoding::Boxed<VolumeManagerInfo>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<VolumeManagerInfo>,
&mut self.info,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest>
for &VolumeManagerGetPartitionLimitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
fidl::encoding::Encode::<VolumeManagerGetPartitionLimitRequest>::encode(
(
<fidl_fuchsia_hardware_block_partition::Guid as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>>
fidl::encoding::Encode<VolumeManagerGetPartitionLimitRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerGetPartitionLimitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeManagerGetPartitionLimitRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.guid,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerGetPartitionLimitResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse>
for &VolumeManagerGetPartitionLimitResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<VolumeManagerGetPartitionLimitResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerGetPartitionLimitResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32), slice_count: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerInfo {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerInfo> for &VolumeManagerInfo {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<
T0: fidl::encoding::Encode<u64>,
T1: fidl::encoding::Encode<u64>,
T2: fidl::encoding::Encode<u64>,
T3: fidl::encoding::Encode<u64>,
T4: fidl::encoding::Encode<u64>,
> fidl::encoding::Encode<VolumeManagerInfo> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
slice_size: fidl::new_empty!(u64),
slice_count: fidl::new_empty!(u64),
assigned_slice_count: fidl::new_empty!(u64),
maximum_slice_count: fidl::new_empty!(u64),
max_virtual_slice: fidl::new_empty!(u64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest>
for &VolumeManagerSetPartitionLimitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitRequest>(offset);
fidl::encoding::Encode::<VolumeManagerSetPartitionLimitRequest>::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<
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>,
T1: fidl::encoding::Encode<u64>,
> fidl::encoding::Encode<VolumeManagerSetPartitionLimitRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerSetPartitionLimitRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid),
slice_count: fidl::new_empty!(u64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.guid,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u64, &mut self.slice_count, decoder, offset + 16, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionLimitResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse>
for &VolumeManagerSetPartitionLimitResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<VolumeManagerSetPartitionLimitResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionLimitResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeManagerSetPartitionLimitResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeManagerSetPartitionNameRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest>
for &VolumeManagerSetPartitionNameRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeManagerSetPartitionNameRequest>(offset);
fidl::encoding::Encode::<VolumeManagerSetPartitionNameRequest>::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<
T0: fidl::encoding::Encode<fidl_fuchsia_hardware_block_partition::Guid>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>>,
> fidl::encoding::Encode<VolumeManagerSetPartitionNameRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeManagerSetPartitionNameRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
guid: fidl::new_empty!(fidl_fuchsia_hardware_block_partition::Guid),
name: fidl::new_empty!(fidl::encoding::BoundedString<128>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_hardware_block_partition::Guid,
&mut self.guid,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<128>,
&mut self.name,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeQuerySlicesRequest> for &VolumeQuerySlicesRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
fidl::encoding::Encode::<VolumeQuerySlicesRequest>::encode(
(<fidl::encoding::Vector<u64, 16> as fidl::encoding::ValueTypeMarker>::borrow(
&self.start_slices,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Vector<u64, 16>>>
fidl::encoding::Encode<VolumeQuerySlicesRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeQuerySlicesRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { start_slices: fidl::new_empty!(fidl::encoding::Vector<u64, 16>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u64, 16>, &mut self.start_slices, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeQuerySlicesResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeQuerySlicesResponse> for &VolumeQuerySlicesResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeQuerySlicesResponse>(offset);
fidl::encoding::Encode::<VolumeQuerySlicesResponse>::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<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Array<VsliceRange, 16>>,
T2: fidl::encoding::Encode<u64>,
> fidl::encoding::Encode<VolumeQuerySlicesResponse> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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 fidl::encoding::Decode<Self> for VolumeQuerySlicesResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
response: fidl::new_empty!(fidl::encoding::Array<VsliceRange, 16>),
response_count: fidl::new_empty!(u64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Array<VsliceRange, 16>, &mut self.response, decoder, offset + 8, _depth)?;
fidl::decode!(u64, &mut self.response_count, decoder, offset + 264, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeShrinkRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeShrinkRequest> for &VolumeShrinkRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u64>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<VolumeShrinkRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VolumeShrinkRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { start_slice: fidl::new_empty!(u64), slice_count: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VolumeShrinkResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VolumeShrinkResponse> for &VolumeShrinkResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<VolumeShrinkResponse> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeShrinkResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for VolumeShrinkResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for VsliceRange {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<VsliceRange> for &VsliceRange {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VsliceRange>(offset);
fidl::encoding::Encode::<VsliceRange>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.allocated),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<bool>, T1: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<VsliceRange> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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 fidl::encoding::Decode<Self> for VsliceRange {
#[inline(always)]
fn new_empty() -> Self {
Self { allocated: fidl::new_empty!(bool), count: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
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, &mut self.allocated, decoder, offset + 0, _depth)?;
fidl::decode!(u64, &mut self.count, decoder, offset + 8, _depth)?;
Ok(())
}
}
}