#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
pub const MAX_FIRMWARE_TYPE_LENGTH: u32 = 256;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Asset {
Kernel = 1,
VerifiedBootMetadata = 2,
}
impl Asset {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Kernel),
2 => Some(Self::VerifiedBootMetadata),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Configuration {
A = 1,
B = 2,
Recovery = 3,
}
impl Configuration {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::A),
2 => Some(Self::B),
3 => Some(Self::Recovery),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ConfigurationStatus {
Healthy = 1,
Pending = 2,
Unbootable = 3,
}
impl ConfigurationStatus {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Healthy),
2 => Some(Self::Pending),
3 => Some(Self::Unbootable),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BootManagerFlushResponse {
pub status: i32,
}
impl fidl::Persistable for BootManagerFlushResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerQueryConfigurationStatusRequest {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerQueryConfigurationStatusRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerSetConfigurationActiveRequest {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerSetConfigurationActiveRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BootManagerSetConfigurationActiveResponse {
pub status: i32,
}
impl fidl::Persistable for BootManagerSetConfigurationActiveResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerSetConfigurationHealthyRequest {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerSetConfigurationHealthyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BootManagerSetConfigurationHealthyResponse {
pub status: i32,
}
impl fidl::Persistable for BootManagerSetConfigurationHealthyResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerSetConfigurationUnbootableRequest {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerSetConfigurationUnbootableRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BootManagerSetConfigurationUnbootableResponse {
pub status: i32,
}
impl fidl::Persistable for BootManagerSetConfigurationUnbootableResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerQueryActiveConfigurationResponse {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerQueryActiveConfigurationResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerQueryConfigurationLastSetActiveResponse {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerQueryConfigurationLastSetActiveResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerQueryConfigurationStatusResponse {
pub status: ConfigurationStatus,
}
impl fidl::Persistable for BootManagerQueryConfigurationStatusResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootManagerQueryCurrentConfigurationResponse {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerQueryCurrentConfigurationResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DataSinkFlushResponse {
pub status: i32,
}
impl fidl::Persistable for DataSinkFlushResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DataSinkReadAssetRequest {
pub configuration: Configuration,
pub asset: Asset,
}
impl fidl::Persistable for DataSinkReadAssetRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DataSinkReadFirmwareRequest {
pub configuration: Configuration,
pub type_: String,
}
impl fidl::Standalone for DataSinkReadFirmwareRequest {}
#[derive(Debug, PartialEq)]
pub struct DataSinkWriteAssetRequest {
pub configuration: Configuration,
pub asset: Asset,
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for DataSinkWriteAssetRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DataSinkWriteAssetResponse {
pub status: i32,
}
impl fidl::Persistable for DataSinkWriteAssetResponse {}
#[derive(Debug, PartialEq)]
pub struct DataSinkWriteFirmwareRequest {
pub configuration: Configuration,
pub type_: String,
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for DataSinkWriteFirmwareRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DataSinkWriteFirmwareResponse {
pub result: WriteFirmwareResult,
}
impl fidl::Persistable for DataSinkWriteFirmwareResponse {}
#[derive(Debug, PartialEq)]
pub struct DataSinkWriteOpaqueVolumeRequest {
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for DataSinkWriteOpaqueVolumeRequest {}
#[derive(Debug, PartialEq)]
pub struct DataSinkWriteSparseVolumeRequest {
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for DataSinkWriteSparseVolumeRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DataSinkWriteVolumesRequest {
pub payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
}
impl fidl::Standalone for DataSinkWriteVolumesRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DataSinkWriteVolumesResponse {
pub status: i32,
}
impl fidl::Persistable for DataSinkWriteVolumesResponse {}
#[derive(Debug, PartialEq)]
pub struct DataSinkReadAssetResponse {
pub asset: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for DataSinkReadAssetResponse {}
#[derive(Debug, PartialEq)]
pub struct DataSinkReadFirmwareResponse {
pub firmware: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for DataSinkReadFirmwareResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DynamicDataSinkInitializePartitionTablesResponse {
pub status: i32,
}
impl fidl::Persistable for DynamicDataSinkInitializePartitionTablesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DynamicDataSinkWipePartitionTablesResponse {
pub status: i32,
}
impl fidl::Persistable for DynamicDataSinkWipePartitionTablesResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverFindBootManagerRequest {
pub boot_manager: fidl::endpoints::ServerEnd<BootManagerMarker>,
}
impl fidl::Standalone for PaverFindBootManagerRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverFindDataSinkRequest {
pub data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
}
impl fidl::Standalone for PaverFindDataSinkRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverFindSysconfigRequest {
pub sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
}
impl fidl::Standalone for PaverFindSysconfigRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverUseBlockDeviceRequest {
pub block_device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
pub block_controller: fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
pub data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
}
impl fidl::Standalone for PaverUseBlockDeviceRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PayloadStreamReadDataResponse {
pub result: ReadResult,
}
impl fidl::Persistable for PayloadStreamReadDataResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PayloadStreamRegisterVmoRequest {
pub vmo: fidl::Vmo,
}
impl fidl::Standalone for PayloadStreamRegisterVmoRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct PayloadStreamRegisterVmoResponse {
pub status: i32,
}
impl fidl::Persistable for PayloadStreamRegisterVmoResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ReadInfo {
pub offset: u64,
pub size: u64,
}
impl fidl::Persistable for ReadInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SysconfigFlushResponse {
pub status: i32,
}
impl fidl::Persistable for SysconfigFlushResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SysconfigWipeResponse {
pub status: i32,
}
impl fidl::Persistable for SysconfigWipeResponse {}
#[derive(Debug, PartialEq)]
pub struct SysconfigWriteRequest {
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for SysconfigWriteRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SysconfigWriteResponse {
pub status: i32,
}
impl fidl::Persistable for SysconfigWriteResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SysconfigGetPartitionSizeResponse {
pub size: u64,
}
impl fidl::Persistable for SysconfigGetPartitionSizeResponse {}
#[derive(Debug, PartialEq)]
pub struct SysconfigReadResponse {
pub data: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone for SysconfigReadResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ReadResult {
Err(i32),
Eof(bool),
Info(ReadInfo),
}
impl ReadResult {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Err(_) => 1,
Self::Eof(_) => 2,
Self::Info(_) => 3,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for ReadResult {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum WriteFirmwareResult {
Status(i32),
Unsupported(bool),
}
impl WriteFirmwareResult {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Status(_) => 1,
Self::Unsupported(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for WriteFirmwareResult {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BootManagerMarker;
impl fidl::endpoints::ProtocolMarker for BootManagerMarker {
type Proxy = BootManagerProxy;
type RequestStream = BootManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BootManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) BootManager";
}
pub type BootManagerQueryCurrentConfigurationResult = Result<Configuration, i32>;
pub type BootManagerQueryActiveConfigurationResult = Result<Configuration, i32>;
pub type BootManagerQueryConfigurationLastSetActiveResult = Result<Configuration, i32>;
pub type BootManagerQueryConfigurationStatusResult = Result<ConfigurationStatus, i32>;
pub type BootManagerSetOneShotRecoveryResult = Result<(), i32>;
pub trait BootManagerProxyInterface: Send + Sync {
type QueryCurrentConfigurationResponseFut: std::future::Future<
Output = Result<BootManagerQueryCurrentConfigurationResult, fidl::Error>,
> + Send;
fn r#query_current_configuration(&self) -> Self::QueryCurrentConfigurationResponseFut;
type QueryActiveConfigurationResponseFut: std::future::Future<Output = Result<BootManagerQueryActiveConfigurationResult, fidl::Error>>
+ Send;
fn r#query_active_configuration(&self) -> Self::QueryActiveConfigurationResponseFut;
type QueryConfigurationLastSetActiveResponseFut: std::future::Future<
Output = Result<BootManagerQueryConfigurationLastSetActiveResult, fidl::Error>,
> + Send;
fn r#query_configuration_last_set_active(
&self,
) -> Self::QueryConfigurationLastSetActiveResponseFut;
type QueryConfigurationStatusResponseFut: std::future::Future<Output = Result<BootManagerQueryConfigurationStatusResult, fidl::Error>>
+ Send;
fn r#query_configuration_status(
&self,
configuration: Configuration,
) -> Self::QueryConfigurationStatusResponseFut;
type SetConfigurationActiveResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#set_configuration_active(
&self,
configuration: Configuration,
) -> Self::SetConfigurationActiveResponseFut;
type SetConfigurationUnbootableResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#set_configuration_unbootable(
&self,
configuration: Configuration,
) -> Self::SetConfigurationUnbootableResponseFut;
type SetConfigurationHealthyResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#set_configuration_healthy(
&self,
configuration: Configuration,
) -> Self::SetConfigurationHealthyResponseFut;
type SetOneShotRecoveryResponseFut: std::future::Future<Output = Result<BootManagerSetOneShotRecoveryResult, fidl::Error>>
+ Send;
fn r#set_one_shot_recovery(&self) -> Self::SetOneShotRecoveryResponseFut;
type FlushResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#flush(&self) -> Self::FlushResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BootManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BootManagerSynchronousProxy {
type Proxy = BootManagerProxy;
type Protocol = BootManagerMarker;
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 BootManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BootManagerMarker 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::Time) -> Result<BootManagerEvent, fidl::Error> {
BootManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#query_current_configuration(
&self,
___deadline: zx::Time,
) -> Result<BootManagerQueryCurrentConfigurationResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
BootManagerQueryCurrentConfigurationResponse,
i32,
>>(
(),
0xc213298cbc9c371,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.configuration))
}
pub fn r#query_active_configuration(
&self,
___deadline: zx::Time,
) -> Result<BootManagerQueryActiveConfigurationResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
BootManagerQueryActiveConfigurationResponse,
i32,
>>(
(),
0x71d52acdf59947a4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.configuration))
}
pub fn r#query_configuration_last_set_active(
&self,
___deadline: zx::Time,
) -> Result<BootManagerQueryConfigurationLastSetActiveResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
BootManagerQueryConfigurationLastSetActiveResponse,
i32,
>>(
(),
0x6bcad87311b3345,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.configuration))
}
pub fn r#query_configuration_status(
&self,
mut configuration: Configuration,
___deadline: zx::Time,
) -> Result<BootManagerQueryConfigurationStatusResult, fidl::Error> {
let _response = self.client.send_query::<
BootManagerQueryConfigurationStatusRequest,
fidl::encoding::ResultType<BootManagerQueryConfigurationStatusResponse, i32>,
>(
(configuration,),
0x40822ca9ca68b19a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.status))
}
pub fn r#set_configuration_active(
&self,
mut configuration: Configuration,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
BootManagerSetConfigurationActiveRequest,
BootManagerSetConfigurationActiveResponse,
>(
(configuration,),
0x14c64074f81f9a7f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#set_configuration_unbootable(
&self,
mut configuration: Configuration,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
BootManagerSetConfigurationUnbootableRequest,
BootManagerSetConfigurationUnbootableResponse,
>(
(configuration,),
0x6f8716bf306d197f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#set_configuration_healthy(
&self,
mut configuration: Configuration,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
BootManagerSetConfigurationHealthyRequest,
BootManagerSetConfigurationHealthyResponse,
>(
(configuration,),
0x5dfe31714c8ec4be,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#set_one_shot_recovery(
&self,
___deadline: zx::Time,
) -> Result<BootManagerSetOneShotRecoveryResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x7a5af0a28354f24d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#flush(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, BootManagerFlushResponse>(
(),
0x2f29ec2322d62d3e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct BootManagerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for BootManagerProxy {
type Protocol = BootManagerMarker;
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 BootManagerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <BootManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BootManagerEventStream {
BootManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#query_current_configuration(
&self,
) -> fidl::client::QueryResponseFut<BootManagerQueryCurrentConfigurationResult> {
BootManagerProxyInterface::r#query_current_configuration(self)
}
pub fn r#query_active_configuration(
&self,
) -> fidl::client::QueryResponseFut<BootManagerQueryActiveConfigurationResult> {
BootManagerProxyInterface::r#query_active_configuration(self)
}
pub fn r#query_configuration_last_set_active(
&self,
) -> fidl::client::QueryResponseFut<BootManagerQueryConfigurationLastSetActiveResult> {
BootManagerProxyInterface::r#query_configuration_last_set_active(self)
}
pub fn r#query_configuration_status(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<BootManagerQueryConfigurationStatusResult> {
BootManagerProxyInterface::r#query_configuration_status(self, configuration)
}
pub fn r#set_configuration_active(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<i32> {
BootManagerProxyInterface::r#set_configuration_active(self, configuration)
}
pub fn r#set_configuration_unbootable(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<i32> {
BootManagerProxyInterface::r#set_configuration_unbootable(self, configuration)
}
pub fn r#set_configuration_healthy(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<i32> {
BootManagerProxyInterface::r#set_configuration_healthy(self, configuration)
}
pub fn r#set_one_shot_recovery(
&self,
) -> fidl::client::QueryResponseFut<BootManagerSetOneShotRecoveryResult> {
BootManagerProxyInterface::r#set_one_shot_recovery(self)
}
pub fn r#flush(&self) -> fidl::client::QueryResponseFut<i32> {
BootManagerProxyInterface::r#flush(self)
}
}
impl BootManagerProxyInterface for BootManagerProxy {
type QueryCurrentConfigurationResponseFut =
fidl::client::QueryResponseFut<BootManagerQueryCurrentConfigurationResult>;
fn r#query_current_configuration(&self) -> Self::QueryCurrentConfigurationResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryCurrentConfigurationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryCurrentConfigurationResponse, i32>,
0xc213298cbc9c371,
>(_buf?)?;
Ok(_response.map(|x| x.configuration))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
BootManagerQueryCurrentConfigurationResult,
>(
(),
0xc213298cbc9c371,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryActiveConfigurationResponseFut =
fidl::client::QueryResponseFut<BootManagerQueryActiveConfigurationResult>;
fn r#query_active_configuration(&self) -> Self::QueryActiveConfigurationResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryActiveConfigurationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryActiveConfigurationResponse, i32>,
0x71d52acdf59947a4,
>(_buf?)?;
Ok(_response.map(|x| x.configuration))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
BootManagerQueryActiveConfigurationResult,
>(
(),
0x71d52acdf59947a4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryConfigurationLastSetActiveResponseFut =
fidl::client::QueryResponseFut<BootManagerQueryConfigurationLastSetActiveResult>;
fn r#query_configuration_last_set_active(
&self,
) -> Self::QueryConfigurationLastSetActiveResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryConfigurationLastSetActiveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryConfigurationLastSetActiveResponse, i32>,
0x6bcad87311b3345,
>(_buf?)?;
Ok(_response.map(|x| x.configuration))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
BootManagerQueryConfigurationLastSetActiveResult,
>(
(),
0x6bcad87311b3345,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryConfigurationStatusResponseFut =
fidl::client::QueryResponseFut<BootManagerQueryConfigurationStatusResult>;
fn r#query_configuration_status(
&self,
mut configuration: Configuration,
) -> Self::QueryConfigurationStatusResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryConfigurationStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryConfigurationStatusResponse, i32>,
0x40822ca9ca68b19a,
>(_buf?)?;
Ok(_response.map(|x| x.status))
}
self.client.send_query_and_decode::<
BootManagerQueryConfigurationStatusRequest,
BootManagerQueryConfigurationStatusResult,
>(
(configuration,),
0x40822ca9ca68b19a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetConfigurationActiveResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_configuration_active(
&self,
mut configuration: Configuration,
) -> Self::SetConfigurationActiveResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerSetConfigurationActiveResponse,
0x14c64074f81f9a7f,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<BootManagerSetConfigurationActiveRequest, i32>(
(configuration,),
0x14c64074f81f9a7f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetConfigurationUnbootableResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_configuration_unbootable(
&self,
mut configuration: Configuration,
) -> Self::SetConfigurationUnbootableResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerSetConfigurationUnbootableResponse,
0x6f8716bf306d197f,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<BootManagerSetConfigurationUnbootableRequest, i32>(
(configuration,),
0x6f8716bf306d197f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetConfigurationHealthyResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_configuration_healthy(
&self,
mut configuration: Configuration,
) -> Self::SetConfigurationHealthyResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerSetConfigurationHealthyResponse,
0x5dfe31714c8ec4be,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<BootManagerSetConfigurationHealthyRequest, i32>(
(configuration,),
0x5dfe31714c8ec4be,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetOneShotRecoveryResponseFut =
fidl::client::QueryResponseFut<BootManagerSetOneShotRecoveryResult>;
fn r#set_one_shot_recovery(&self) -> Self::SetOneShotRecoveryResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerSetOneShotRecoveryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x7a5af0a28354f24d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
BootManagerSetOneShotRecoveryResult,
>(
(),
0x7a5af0a28354f24d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type FlushResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerFlushResponse,
0x2f29ec2322d62d3e,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x2f29ec2322d62d3e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BootManagerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for BootManagerEventStream {}
impl futures::stream::FusedStream for BootManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BootManagerEventStream {
type Item = Result<BootManagerEvent, 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(BootManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BootManagerEvent {}
impl BootManagerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<BootManagerEvent, 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: <BootManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BootManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for BootManagerRequestStream {}
impl futures::stream::FusedStream for BootManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BootManagerRequestStream {
type Protocol = BootManagerMarker;
type ControlHandle = BootManagerControlHandle;
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 {
BootManagerControlHandle { 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 BootManagerRequestStream {
type Item = Result<BootManagerRequest, 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 BootManagerRequestStream 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 {
0xc213298cbc9c371 => {
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 = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::QueryCurrentConfiguration {
responder: BootManagerQueryCurrentConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x71d52acdf59947a4 => {
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 = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::QueryActiveConfiguration {
responder: BootManagerQueryActiveConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6bcad87311b3345 => {
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 = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::QueryConfigurationLastSetActive {
responder: BootManagerQueryConfigurationLastSetActiveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x40822ca9ca68b19a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(BootManagerQueryConfigurationStatusRequest);
fidl::encoding::Decoder::decode_into::<
BootManagerQueryConfigurationStatusRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::QueryConfigurationStatus {
configuration: req.configuration,
responder: BootManagerQueryConfigurationStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x14c64074f81f9a7f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(BootManagerSetConfigurationActiveRequest);
fidl::encoding::Decoder::decode_into::<BootManagerSetConfigurationActiveRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::SetConfigurationActive {
configuration: req.configuration,
responder: BootManagerSetConfigurationActiveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6f8716bf306d197f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(BootManagerSetConfigurationUnbootableRequest);
fidl::encoding::Decoder::decode_into::<
BootManagerSetConfigurationUnbootableRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::SetConfigurationUnbootable {
configuration: req.configuration,
responder: BootManagerSetConfigurationUnbootableResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5dfe31714c8ec4be => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(BootManagerSetConfigurationHealthyRequest);
fidl::encoding::Decoder::decode_into::<
BootManagerSetConfigurationHealthyRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::SetConfigurationHealthy {
configuration: req.configuration,
responder: BootManagerSetConfigurationHealthyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a5af0a28354f24d => {
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 = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::SetOneShotRecovery {
responder: BootManagerSetOneShotRecoveryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2f29ec2322d62d3e => {
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 = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::Flush {
responder: BootManagerFlushResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BootManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum BootManagerRequest {
QueryCurrentConfiguration { responder: BootManagerQueryCurrentConfigurationResponder },
QueryActiveConfiguration { responder: BootManagerQueryActiveConfigurationResponder },
QueryConfigurationLastSetActive {
responder: BootManagerQueryConfigurationLastSetActiveResponder,
},
QueryConfigurationStatus {
configuration: Configuration,
responder: BootManagerQueryConfigurationStatusResponder,
},
SetConfigurationActive {
configuration: Configuration,
responder: BootManagerSetConfigurationActiveResponder,
},
SetConfigurationUnbootable {
configuration: Configuration,
responder: BootManagerSetConfigurationUnbootableResponder,
},
SetConfigurationHealthy {
configuration: Configuration,
responder: BootManagerSetConfigurationHealthyResponder,
},
SetOneShotRecovery { responder: BootManagerSetOneShotRecoveryResponder },
Flush { responder: BootManagerFlushResponder },
}
impl BootManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_query_current_configuration(
self,
) -> Option<(BootManagerQueryCurrentConfigurationResponder)> {
if let BootManagerRequest::QueryCurrentConfiguration { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_active_configuration(
self,
) -> Option<(BootManagerQueryActiveConfigurationResponder)> {
if let BootManagerRequest::QueryActiveConfiguration { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_configuration_last_set_active(
self,
) -> Option<(BootManagerQueryConfigurationLastSetActiveResponder)> {
if let BootManagerRequest::QueryConfigurationLastSetActive { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_configuration_status(
self,
) -> Option<(Configuration, BootManagerQueryConfigurationStatusResponder)> {
if let BootManagerRequest::QueryConfigurationStatus { configuration, responder } = self {
Some((configuration, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_configuration_active(
self,
) -> Option<(Configuration, BootManagerSetConfigurationActiveResponder)> {
if let BootManagerRequest::SetConfigurationActive { configuration, responder } = self {
Some((configuration, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_configuration_unbootable(
self,
) -> Option<(Configuration, BootManagerSetConfigurationUnbootableResponder)> {
if let BootManagerRequest::SetConfigurationUnbootable { configuration, responder } = self {
Some((configuration, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_configuration_healthy(
self,
) -> Option<(Configuration, BootManagerSetConfigurationHealthyResponder)> {
if let BootManagerRequest::SetConfigurationHealthy { configuration, responder } = self {
Some((configuration, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_one_shot_recovery(self) -> Option<(BootManagerSetOneShotRecoveryResponder)> {
if let BootManagerRequest::SetOneShotRecovery { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flush(self) -> Option<(BootManagerFlushResponder)> {
if let BootManagerRequest::Flush { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BootManagerRequest::QueryCurrentConfiguration { .. } => "query_current_configuration",
BootManagerRequest::QueryActiveConfiguration { .. } => "query_active_configuration",
BootManagerRequest::QueryConfigurationLastSetActive { .. } => {
"query_configuration_last_set_active"
}
BootManagerRequest::QueryConfigurationStatus { .. } => "query_configuration_status",
BootManagerRequest::SetConfigurationActive { .. } => "set_configuration_active",
BootManagerRequest::SetConfigurationUnbootable { .. } => "set_configuration_unbootable",
BootManagerRequest::SetConfigurationHealthy { .. } => "set_configuration_healthy",
BootManagerRequest::SetOneShotRecovery { .. } => "set_one_shot_recovery",
BootManagerRequest::Flush { .. } => "flush",
}
}
}
#[derive(Debug, Clone)]
pub struct BootManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for BootManagerControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl BootManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerQueryCurrentConfigurationResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerQueryCurrentConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerQueryCurrentConfigurationResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerQueryCurrentConfigurationResponder {
pub fn send(self, mut result: Result<Configuration, 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<Configuration, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Configuration, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BootManagerQueryCurrentConfigurationResponse,
i32,
>>(
result.map(|configuration| (configuration,)),
self.tx_id,
0xc213298cbc9c371,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerQueryActiveConfigurationResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerQueryActiveConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerQueryActiveConfigurationResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerQueryActiveConfigurationResponder {
pub fn send(self, mut result: Result<Configuration, 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<Configuration, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Configuration, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BootManagerQueryActiveConfigurationResponse,
i32,
>>(
result.map(|configuration| (configuration,)),
self.tx_id,
0x71d52acdf59947a4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerQueryConfigurationLastSetActiveResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerQueryConfigurationLastSetActiveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerQueryConfigurationLastSetActiveResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerQueryConfigurationLastSetActiveResponder {
pub fn send(self, mut result: Result<Configuration, 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<Configuration, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Configuration, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BootManagerQueryConfigurationLastSetActiveResponse,
i32,
>>(
result.map(|configuration| (configuration,)),
self.tx_id,
0x6bcad87311b3345,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerQueryConfigurationStatusResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerQueryConfigurationStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerQueryConfigurationStatusResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerQueryConfigurationStatusResponder {
pub fn send(self, mut result: Result<ConfigurationStatus, 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<ConfigurationStatus, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<ConfigurationStatus, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BootManagerQueryConfigurationStatusResponse,
i32,
>>(
result.map(|status| (status,)),
self.tx_id,
0x40822ca9ca68b19a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerSetConfigurationActiveResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerSetConfigurationActiveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerSetConfigurationActiveResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerSetConfigurationActiveResponder {
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::<BootManagerSetConfigurationActiveResponse>(
(status,),
self.tx_id,
0x14c64074f81f9a7f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerSetConfigurationUnbootableResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerSetConfigurationUnbootableResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerSetConfigurationUnbootableResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerSetConfigurationUnbootableResponder {
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::<BootManagerSetConfigurationUnbootableResponse>(
(status,),
self.tx_id,
0x6f8716bf306d197f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerSetConfigurationHealthyResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerSetConfigurationHealthyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerSetConfigurationHealthyResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerSetConfigurationHealthyResponder {
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::<BootManagerSetConfigurationHealthyResponse>(
(status,),
self.tx_id,
0x5dfe31714c8ec4be,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerSetOneShotRecoveryResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerSetOneShotRecoveryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerSetOneShotRecoveryResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerSetOneShotRecoveryResponder {
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,
0x7a5af0a28354f24d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootManagerFlushResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerFlushResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerFlushResponder {
type ControlHandle = BootManagerControlHandle;
fn control_handle(&self) -> &BootManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootManagerFlushResponder {
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::<BootManagerFlushResponse>(
(status,),
self.tx_id,
0x2f29ec2322d62d3e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DataSinkMarker;
impl fidl::endpoints::ProtocolMarker for DataSinkMarker {
type Proxy = DataSinkProxy;
type RequestStream = DataSinkRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DataSinkSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DataSink";
}
pub type DataSinkReadAssetResult = Result<fidl_fuchsia_mem::Buffer, i32>;
pub type DataSinkReadFirmwareResult = Result<fidl_fuchsia_mem::Buffer, i32>;
pub type DataSinkWriteOpaqueVolumeResult = Result<(), i32>;
pub type DataSinkWriteSparseVolumeResult = Result<(), i32>;
pub trait DataSinkProxyInterface: Send + Sync {
type ReadAssetResponseFut: std::future::Future<Output = Result<DataSinkReadAssetResult, fidl::Error>>
+ Send;
fn r#read_asset(
&self,
configuration: Configuration,
asset: Asset,
) -> Self::ReadAssetResponseFut;
type WriteAssetResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#write_asset(
&self,
configuration: Configuration,
asset: Asset,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteAssetResponseFut;
type WriteFirmwareResponseFut: std::future::Future<Output = Result<WriteFirmwareResult, fidl::Error>>
+ Send;
fn r#write_firmware(
&self,
configuration: Configuration,
type_: &str,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteFirmwareResponseFut;
type ReadFirmwareResponseFut: std::future::Future<Output = Result<DataSinkReadFirmwareResult, fidl::Error>>
+ Send;
fn r#read_firmware(
&self,
configuration: Configuration,
type_: &str,
) -> Self::ReadFirmwareResponseFut;
type WriteVolumesResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#write_volumes(
&self,
payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> Self::WriteVolumesResponseFut;
type WriteOpaqueVolumeResponseFut: std::future::Future<Output = Result<DataSinkWriteOpaqueVolumeResult, fidl::Error>>
+ Send;
fn r#write_opaque_volume(
&self,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteOpaqueVolumeResponseFut;
type WriteSparseVolumeResponseFut: std::future::Future<Output = Result<DataSinkWriteSparseVolumeResult, fidl::Error>>
+ Send;
fn r#write_sparse_volume(
&self,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteSparseVolumeResponseFut;
type FlushResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#flush(&self) -> Self::FlushResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DataSinkSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DataSinkSynchronousProxy {
type Proxy = DataSinkProxy;
type Protocol = DataSinkMarker;
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 DataSinkSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DataSinkMarker 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::Time) -> Result<DataSinkEvent, fidl::Error> {
DataSinkEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
___deadline: zx::Time,
) -> Result<DataSinkReadAssetResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkReadAssetRequest,
fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>,
>(
(configuration, asset,),
0x125a23e561007898,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.asset))
}
pub fn r#write_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<DataSinkWriteAssetRequest, DataSinkWriteAssetResponse>(
(configuration, asset, &mut payload),
0x516839ce76c4d0a9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#write_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<WriteFirmwareResult, fidl::Error> {
let _response =
self.client.send_query::<DataSinkWriteFirmwareRequest, DataSinkWriteFirmwareResponse>(
(configuration, type_, &mut payload),
0x514b93454ac0be97,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
pub fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
___deadline: zx::Time,
) -> Result<DataSinkReadFirmwareResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkReadFirmwareRequest,
fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>,
>(
(configuration, type_,),
0xcb67f9830cae9c3,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.firmware))
}
pub fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<DataSinkWriteVolumesRequest, DataSinkWriteVolumesResponse>(
(payload,),
0x5ee32c861d0259df,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<DataSinkWriteOpaqueVolumeResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkWriteOpaqueVolumeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(&mut payload,),
0x4884b6ebaf660d79,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<DataSinkWriteSparseVolumeResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkWriteSparseVolumeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(&mut payload,),
0x340f5370c5b1e026,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#flush(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DataSinkFlushResponse>(
(),
0x3b59d3e2338e3139,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct DataSinkProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DataSinkProxy {
type Protocol = DataSinkMarker;
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 DataSinkProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <DataSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DataSinkEventStream {
DataSinkEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
) -> fidl::client::QueryResponseFut<DataSinkReadAssetResult> {
DataSinkProxyInterface::r#read_asset(self, configuration, asset)
}
pub fn r#write_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<i32> {
DataSinkProxyInterface::r#write_asset(self, configuration, asset, payload)
}
pub fn r#write_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<WriteFirmwareResult> {
DataSinkProxyInterface::r#write_firmware(self, configuration, type_, payload)
}
pub fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> fidl::client::QueryResponseFut<DataSinkReadFirmwareResult> {
DataSinkProxyInterface::r#read_firmware(self, configuration, type_)
}
pub fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> fidl::client::QueryResponseFut<i32> {
DataSinkProxyInterface::r#write_volumes(self, payload)
}
pub fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<DataSinkWriteOpaqueVolumeResult> {
DataSinkProxyInterface::r#write_opaque_volume(self, payload)
}
pub fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<DataSinkWriteSparseVolumeResult> {
DataSinkProxyInterface::r#write_sparse_volume(self, payload)
}
pub fn r#flush(&self) -> fidl::client::QueryResponseFut<i32> {
DataSinkProxyInterface::r#flush(self)
}
}
impl DataSinkProxyInterface for DataSinkProxy {
type ReadAssetResponseFut = fidl::client::QueryResponseFut<DataSinkReadAssetResult>;
fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
) -> Self::ReadAssetResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadAssetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>,
0x125a23e561007898,
>(_buf?)?;
Ok(_response.map(|x| x.asset))
}
self.client.send_query_and_decode::<DataSinkReadAssetRequest, DataSinkReadAssetResult>(
(configuration, asset),
0x125a23e561007898,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteAssetResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#write_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteAssetResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteAssetResponse,
0x516839ce76c4d0a9,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DataSinkWriteAssetRequest, i32>(
(configuration, asset, &mut payload),
0x516839ce76c4d0a9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteFirmwareResponseFut = fidl::client::QueryResponseFut<WriteFirmwareResult>;
fn r#write_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteFirmwareResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<WriteFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteFirmwareResponse,
0x514b93454ac0be97,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<DataSinkWriteFirmwareRequest, WriteFirmwareResult>(
(configuration, type_, &mut payload),
0x514b93454ac0be97,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadFirmwareResponseFut = fidl::client::QueryResponseFut<DataSinkReadFirmwareResult>;
fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> Self::ReadFirmwareResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>,
0xcb67f9830cae9c3,
>(_buf?)?;
Ok(_response.map(|x| x.firmware))
}
self.client
.send_query_and_decode::<DataSinkReadFirmwareRequest, DataSinkReadFirmwareResult>(
(configuration, type_),
0xcb67f9830cae9c3,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteVolumesResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> Self::WriteVolumesResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteVolumesResponse,
0x5ee32c861d0259df,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DataSinkWriteVolumesRequest, i32>(
(payload,),
0x5ee32c861d0259df,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteOpaqueVolumeResponseFut =
fidl::client::QueryResponseFut<DataSinkWriteOpaqueVolumeResult>;
fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteOpaqueVolumeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteOpaqueVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x4884b6ebaf660d79,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DataSinkWriteOpaqueVolumeRequest,
DataSinkWriteOpaqueVolumeResult,
>(
(&mut payload,),
0x4884b6ebaf660d79,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteSparseVolumeResponseFut =
fidl::client::QueryResponseFut<DataSinkWriteSparseVolumeResult>;
fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteSparseVolumeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteSparseVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x340f5370c5b1e026,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DataSinkWriteSparseVolumeRequest,
DataSinkWriteSparseVolumeResult,
>(
(&mut payload,),
0x340f5370c5b1e026,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type FlushResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkFlushResponse,
0x3b59d3e2338e3139,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x3b59d3e2338e3139,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DataSinkEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DataSinkEventStream {}
impl futures::stream::FusedStream for DataSinkEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DataSinkEventStream {
type Item = Result<DataSinkEvent, 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(DataSinkEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DataSinkEvent {}
impl DataSinkEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DataSinkEvent, 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: <DataSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DataSinkRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DataSinkRequestStream {}
impl futures::stream::FusedStream for DataSinkRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DataSinkRequestStream {
type Protocol = DataSinkMarker;
type ControlHandle = DataSinkControlHandle;
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 {
DataSinkControlHandle { 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 DataSinkRequestStream {
type Item = Result<DataSinkRequest, 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 DataSinkRequestStream 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 {
0x125a23e561007898 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkReadAssetRequest);
fidl::encoding::Decoder::decode_into::<DataSinkReadAssetRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::ReadAsset {
configuration: req.configuration,
asset: req.asset,
responder: DataSinkReadAssetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x516839ce76c4d0a9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteAssetRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteAssetRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::WriteAsset {
configuration: req.configuration,
asset: req.asset,
payload: req.payload,
responder: DataSinkWriteAssetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x514b93454ac0be97 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteFirmwareRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteFirmwareRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::WriteFirmware {
configuration: req.configuration,
type_: req.type_,
payload: req.payload,
responder: DataSinkWriteFirmwareResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xcb67f9830cae9c3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkReadFirmwareRequest);
fidl::encoding::Decoder::decode_into::<DataSinkReadFirmwareRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::ReadFirmware {
configuration: req.configuration,
type_: req.type_,
responder: DataSinkReadFirmwareResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5ee32c861d0259df => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteVolumesRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteVolumesRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::WriteVolumes {
payload: req.payload,
responder: DataSinkWriteVolumesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4884b6ebaf660d79 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteOpaqueVolumeRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteOpaqueVolumeRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::WriteOpaqueVolume {
payload: req.payload,
responder: DataSinkWriteOpaqueVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x340f5370c5b1e026 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteSparseVolumeRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteSparseVolumeRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::WriteSparseVolume {
payload: req.payload,
responder: DataSinkWriteSparseVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3b59d3e2338e3139 => {
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 = DataSinkControlHandle { inner: this.inner.clone() };
Ok(DataSinkRequest::Flush {
responder: DataSinkFlushResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DataSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DataSinkRequest {
ReadAsset { configuration: Configuration, asset: Asset, responder: DataSinkReadAssetResponder },
WriteAsset {
configuration: Configuration,
asset: Asset,
payload: fidl_fuchsia_mem::Buffer,
responder: DataSinkWriteAssetResponder,
},
WriteFirmware {
configuration: Configuration,
type_: String,
payload: fidl_fuchsia_mem::Buffer,
responder: DataSinkWriteFirmwareResponder,
},
ReadFirmware {
configuration: Configuration,
type_: String,
responder: DataSinkReadFirmwareResponder,
},
WriteVolumes {
payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
responder: DataSinkWriteVolumesResponder,
},
WriteOpaqueVolume {
payload: fidl_fuchsia_mem::Buffer,
responder: DataSinkWriteOpaqueVolumeResponder,
},
WriteSparseVolume {
payload: fidl_fuchsia_mem::Buffer,
responder: DataSinkWriteSparseVolumeResponder,
},
Flush { responder: DataSinkFlushResponder },
}
impl DataSinkRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_read_asset(self) -> Option<(Configuration, Asset, DataSinkReadAssetResponder)> {
if let DataSinkRequest::ReadAsset { configuration, asset, responder } = self {
Some((configuration, asset, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_asset(
self,
) -> Option<(Configuration, Asset, fidl_fuchsia_mem::Buffer, DataSinkWriteAssetResponder)> {
if let DataSinkRequest::WriteAsset { configuration, asset, payload, responder } = self {
Some((configuration, asset, payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_firmware(
self,
) -> Option<(Configuration, String, fidl_fuchsia_mem::Buffer, DataSinkWriteFirmwareResponder)>
{
if let DataSinkRequest::WriteFirmware { configuration, type_, payload, responder } = self {
Some((configuration, type_, payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_firmware(
self,
) -> Option<(Configuration, String, DataSinkReadFirmwareResponder)> {
if let DataSinkRequest::ReadFirmware { configuration, type_, responder } = self {
Some((configuration, type_, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_volumes(
self,
) -> Option<(fidl::endpoints::ClientEnd<PayloadStreamMarker>, DataSinkWriteVolumesResponder)>
{
if let DataSinkRequest::WriteVolumes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_opaque_volume(
self,
) -> Option<(fidl_fuchsia_mem::Buffer, DataSinkWriteOpaqueVolumeResponder)> {
if let DataSinkRequest::WriteOpaqueVolume { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_sparse_volume(
self,
) -> Option<(fidl_fuchsia_mem::Buffer, DataSinkWriteSparseVolumeResponder)> {
if let DataSinkRequest::WriteSparseVolume { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flush(self) -> Option<(DataSinkFlushResponder)> {
if let DataSinkRequest::Flush { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DataSinkRequest::ReadAsset { .. } => "read_asset",
DataSinkRequest::WriteAsset { .. } => "write_asset",
DataSinkRequest::WriteFirmware { .. } => "write_firmware",
DataSinkRequest::ReadFirmware { .. } => "read_firmware",
DataSinkRequest::WriteVolumes { .. } => "write_volumes",
DataSinkRequest::WriteOpaqueVolume { .. } => "write_opaque_volume",
DataSinkRequest::WriteSparseVolume { .. } => "write_sparse_volume",
DataSinkRequest::Flush { .. } => "flush",
}
}
}
#[derive(Debug, Clone)]
pub struct DataSinkControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DataSinkControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl DataSinkControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkReadAssetResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkReadAssetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkReadAssetResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkReadAssetResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_mem::Buffer, 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_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>>(
result.as_mut().map_err(|e| *e).map(|asset| (asset,)),
self.tx_id,
0x125a23e561007898,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkWriteAssetResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkWriteAssetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkWriteAssetResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkWriteAssetResponder {
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::<DataSinkWriteAssetResponse>(
(status,),
self.tx_id,
0x516839ce76c4d0a9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkWriteFirmwareResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkWriteFirmwareResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkWriteFirmwareResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkWriteFirmwareResponder {
pub fn send(self, mut result: &WriteFirmwareResult) -> 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: &WriteFirmwareResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: &WriteFirmwareResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DataSinkWriteFirmwareResponse>(
(result,),
self.tx_id,
0x514b93454ac0be97,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkReadFirmwareResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkReadFirmwareResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkReadFirmwareResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkReadFirmwareResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_mem::Buffer, 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_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>>(
result.as_mut().map_err(|e| *e).map(|firmware| (firmware,)),
self.tx_id,
0xcb67f9830cae9c3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkWriteVolumesResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkWriteVolumesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkWriteVolumesResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkWriteVolumesResponder {
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::<DataSinkWriteVolumesResponse>(
(status,),
self.tx_id,
0x5ee32c861d0259df,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkWriteOpaqueVolumeResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkWriteOpaqueVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkWriteOpaqueVolumeResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkWriteOpaqueVolumeResponder {
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,
0x4884b6ebaf660d79,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkWriteSparseVolumeResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkWriteSparseVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkWriteSparseVolumeResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkWriteSparseVolumeResponder {
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,
0x340f5370c5b1e026,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataSinkFlushResponder {
control_handle: std::mem::ManuallyDrop<DataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataSinkFlushResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataSinkFlushResponder {
type ControlHandle = DataSinkControlHandle;
fn control_handle(&self) -> &DataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataSinkFlushResponder {
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::<DataSinkFlushResponse>(
(status,),
self.tx_id,
0x3b59d3e2338e3139,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DynamicDataSinkMarker;
impl fidl::endpoints::ProtocolMarker for DynamicDataSinkMarker {
type Proxy = DynamicDataSinkProxy;
type RequestStream = DynamicDataSinkRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DynamicDataSinkSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DynamicDataSink";
}
pub trait DynamicDataSinkProxyInterface: Send + Sync {
type ReadAssetResponseFut: std::future::Future<Output = Result<DataSinkReadAssetResult, fidl::Error>>
+ Send;
fn r#read_asset(
&self,
configuration: Configuration,
asset: Asset,
) -> Self::ReadAssetResponseFut;
type WriteAssetResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#write_asset(
&self,
configuration: Configuration,
asset: Asset,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteAssetResponseFut;
type WriteFirmwareResponseFut: std::future::Future<Output = Result<WriteFirmwareResult, fidl::Error>>
+ Send;
fn r#write_firmware(
&self,
configuration: Configuration,
type_: &str,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteFirmwareResponseFut;
type ReadFirmwareResponseFut: std::future::Future<Output = Result<DataSinkReadFirmwareResult, fidl::Error>>
+ Send;
fn r#read_firmware(
&self,
configuration: Configuration,
type_: &str,
) -> Self::ReadFirmwareResponseFut;
type WriteVolumesResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#write_volumes(
&self,
payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> Self::WriteVolumesResponseFut;
type WriteOpaqueVolumeResponseFut: std::future::Future<Output = Result<DataSinkWriteOpaqueVolumeResult, fidl::Error>>
+ Send;
fn r#write_opaque_volume(
&self,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteOpaqueVolumeResponseFut;
type WriteSparseVolumeResponseFut: std::future::Future<Output = Result<DataSinkWriteSparseVolumeResult, fidl::Error>>
+ Send;
fn r#write_sparse_volume(
&self,
payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteSparseVolumeResponseFut;
type FlushResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#flush(&self) -> Self::FlushResponseFut;
type InitializePartitionTablesResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#initialize_partition_tables(&self) -> Self::InitializePartitionTablesResponseFut;
type WipePartitionTablesResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#wipe_partition_tables(&self) -> Self::WipePartitionTablesResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DynamicDataSinkSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DynamicDataSinkSynchronousProxy {
type Proxy = DynamicDataSinkProxy;
type Protocol = DynamicDataSinkMarker;
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 DynamicDataSinkSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DynamicDataSinkMarker 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::Time) -> Result<DynamicDataSinkEvent, fidl::Error> {
DynamicDataSinkEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
___deadline: zx::Time,
) -> Result<DataSinkReadAssetResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkReadAssetRequest,
fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>,
>(
(configuration, asset,),
0x125a23e561007898,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.asset))
}
pub fn r#write_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<DataSinkWriteAssetRequest, DataSinkWriteAssetResponse>(
(configuration, asset, &mut payload),
0x516839ce76c4d0a9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#write_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<WriteFirmwareResult, fidl::Error> {
let _response =
self.client.send_query::<DataSinkWriteFirmwareRequest, DataSinkWriteFirmwareResponse>(
(configuration, type_, &mut payload),
0x514b93454ac0be97,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
pub fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
___deadline: zx::Time,
) -> Result<DataSinkReadFirmwareResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkReadFirmwareRequest,
fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>,
>(
(configuration, type_,),
0xcb67f9830cae9c3,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.firmware))
}
pub fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<DataSinkWriteVolumesRequest, DataSinkWriteVolumesResponse>(
(payload,),
0x5ee32c861d0259df,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<DataSinkWriteOpaqueVolumeResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkWriteOpaqueVolumeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(&mut payload,),
0x4884b6ebaf660d79,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<DataSinkWriteSparseVolumeResult, fidl::Error> {
let _response = self.client.send_query::<
DataSinkWriteSparseVolumeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(&mut payload,),
0x340f5370c5b1e026,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#flush(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DataSinkFlushResponse>(
(),
0x3b59d3e2338e3139,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#initialize_partition_tables(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
DynamicDataSinkInitializePartitionTablesResponse,
>(
(),
0x4c798b3813ea9f7e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#wipe_partition_tables(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DynamicDataSinkWipePartitionTablesResponse>(
(),
0x797c0ebeedaf2cc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct DynamicDataSinkProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DynamicDataSinkProxy {
type Protocol = DynamicDataSinkMarker;
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 DynamicDataSinkProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <DynamicDataSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DynamicDataSinkEventStream {
DynamicDataSinkEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
) -> fidl::client::QueryResponseFut<DataSinkReadAssetResult> {
DynamicDataSinkProxyInterface::r#read_asset(self, configuration, asset)
}
pub fn r#write_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<i32> {
DynamicDataSinkProxyInterface::r#write_asset(self, configuration, asset, payload)
}
pub fn r#write_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<WriteFirmwareResult> {
DynamicDataSinkProxyInterface::r#write_firmware(self, configuration, type_, payload)
}
pub fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> fidl::client::QueryResponseFut<DataSinkReadFirmwareResult> {
DynamicDataSinkProxyInterface::r#read_firmware(self, configuration, type_)
}
pub fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> fidl::client::QueryResponseFut<i32> {
DynamicDataSinkProxyInterface::r#write_volumes(self, payload)
}
pub fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<DataSinkWriteOpaqueVolumeResult> {
DynamicDataSinkProxyInterface::r#write_opaque_volume(self, payload)
}
pub fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<DataSinkWriteSparseVolumeResult> {
DynamicDataSinkProxyInterface::r#write_sparse_volume(self, payload)
}
pub fn r#flush(&self) -> fidl::client::QueryResponseFut<i32> {
DynamicDataSinkProxyInterface::r#flush(self)
}
pub fn r#initialize_partition_tables(&self) -> fidl::client::QueryResponseFut<i32> {
DynamicDataSinkProxyInterface::r#initialize_partition_tables(self)
}
pub fn r#wipe_partition_tables(&self) -> fidl::client::QueryResponseFut<i32> {
DynamicDataSinkProxyInterface::r#wipe_partition_tables(self)
}
}
impl DynamicDataSinkProxyInterface for DynamicDataSinkProxy {
type ReadAssetResponseFut = fidl::client::QueryResponseFut<DataSinkReadAssetResult>;
fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
) -> Self::ReadAssetResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadAssetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>,
0x125a23e561007898,
>(_buf?)?;
Ok(_response.map(|x| x.asset))
}
self.client.send_query_and_decode::<DataSinkReadAssetRequest, DataSinkReadAssetResult>(
(configuration, asset),
0x125a23e561007898,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteAssetResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#write_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteAssetResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteAssetResponse,
0x516839ce76c4d0a9,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DataSinkWriteAssetRequest, i32>(
(configuration, asset, &mut payload),
0x516839ce76c4d0a9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteFirmwareResponseFut = fidl::client::QueryResponseFut<WriteFirmwareResult>;
fn r#write_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteFirmwareResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<WriteFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteFirmwareResponse,
0x514b93454ac0be97,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<DataSinkWriteFirmwareRequest, WriteFirmwareResult>(
(configuration, type_, &mut payload),
0x514b93454ac0be97,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadFirmwareResponseFut = fidl::client::QueryResponseFut<DataSinkReadFirmwareResult>;
fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> Self::ReadFirmwareResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>,
0xcb67f9830cae9c3,
>(_buf?)?;
Ok(_response.map(|x| x.firmware))
}
self.client
.send_query_and_decode::<DataSinkReadFirmwareRequest, DataSinkReadFirmwareResult>(
(configuration, type_),
0xcb67f9830cae9c3,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteVolumesResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> Self::WriteVolumesResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteVolumesResponse,
0x5ee32c861d0259df,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DataSinkWriteVolumesRequest, i32>(
(payload,),
0x5ee32c861d0259df,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteOpaqueVolumeResponseFut =
fidl::client::QueryResponseFut<DataSinkWriteOpaqueVolumeResult>;
fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteOpaqueVolumeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteOpaqueVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x4884b6ebaf660d79,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DataSinkWriteOpaqueVolumeRequest,
DataSinkWriteOpaqueVolumeResult,
>(
(&mut payload,),
0x4884b6ebaf660d79,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteSparseVolumeResponseFut =
fidl::client::QueryResponseFut<DataSinkWriteSparseVolumeResult>;
fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteSparseVolumeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteSparseVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x340f5370c5b1e026,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DataSinkWriteSparseVolumeRequest,
DataSinkWriteSparseVolumeResult,
>(
(&mut payload,),
0x340f5370c5b1e026,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type FlushResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkFlushResponse,
0x3b59d3e2338e3139,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x3b59d3e2338e3139,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type InitializePartitionTablesResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#initialize_partition_tables(&self) -> Self::InitializePartitionTablesResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DynamicDataSinkInitializePartitionTablesResponse,
0x4c798b3813ea9f7e,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x4c798b3813ea9f7e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WipePartitionTablesResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#wipe_partition_tables(&self) -> Self::WipePartitionTablesResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DynamicDataSinkWipePartitionTablesResponse,
0x797c0ebeedaf2cc,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x797c0ebeedaf2cc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DynamicDataSinkEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DynamicDataSinkEventStream {}
impl futures::stream::FusedStream for DynamicDataSinkEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DynamicDataSinkEventStream {
type Item = Result<DynamicDataSinkEvent, 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(DynamicDataSinkEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DynamicDataSinkEvent {}
impl DynamicDataSinkEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DynamicDataSinkEvent, 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:
<DynamicDataSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DynamicDataSinkRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DynamicDataSinkRequestStream {}
impl futures::stream::FusedStream for DynamicDataSinkRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DynamicDataSinkRequestStream {
type Protocol = DynamicDataSinkMarker;
type ControlHandle = DynamicDataSinkControlHandle;
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 {
DynamicDataSinkControlHandle { 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 DynamicDataSinkRequestStream {
type Item = Result<DynamicDataSinkRequest, 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 DynamicDataSinkRequestStream 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 {
0x125a23e561007898 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkReadAssetRequest);
fidl::encoding::Decoder::decode_into::<DataSinkReadAssetRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::ReadAsset {
configuration: req.configuration,
asset: req.asset,
responder: DynamicDataSinkReadAssetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x516839ce76c4d0a9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteAssetRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteAssetRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::WriteAsset {
configuration: req.configuration,
asset: req.asset,
payload: req.payload,
responder: DynamicDataSinkWriteAssetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x514b93454ac0be97 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteFirmwareRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteFirmwareRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::WriteFirmware {
configuration: req.configuration,
type_: req.type_,
payload: req.payload,
responder: DynamicDataSinkWriteFirmwareResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xcb67f9830cae9c3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkReadFirmwareRequest);
fidl::encoding::Decoder::decode_into::<DataSinkReadFirmwareRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::ReadFirmware {
configuration: req.configuration,
type_: req.type_,
responder: DynamicDataSinkReadFirmwareResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5ee32c861d0259df => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteVolumesRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteVolumesRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::WriteVolumes {
payload: req.payload,
responder: DynamicDataSinkWriteVolumesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4884b6ebaf660d79 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteOpaqueVolumeRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteOpaqueVolumeRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::WriteOpaqueVolume {
payload: req.payload,
responder: DynamicDataSinkWriteOpaqueVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x340f5370c5b1e026 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DataSinkWriteSparseVolumeRequest);
fidl::encoding::Decoder::decode_into::<DataSinkWriteSparseVolumeRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::WriteSparseVolume {
payload: req.payload,
responder: DynamicDataSinkWriteSparseVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3b59d3e2338e3139 => {
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 = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::Flush {
responder: DynamicDataSinkFlushResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c798b3813ea9f7e => {
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 = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::InitializePartitionTables {
responder: DynamicDataSinkInitializePartitionTablesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x797c0ebeedaf2cc => {
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 = DynamicDataSinkControlHandle { inner: this.inner.clone() };
Ok(DynamicDataSinkRequest::WipePartitionTables {
responder: DynamicDataSinkWipePartitionTablesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DynamicDataSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DynamicDataSinkRequest {
ReadAsset {
configuration: Configuration,
asset: Asset,
responder: DynamicDataSinkReadAssetResponder,
},
WriteAsset {
configuration: Configuration,
asset: Asset,
payload: fidl_fuchsia_mem::Buffer,
responder: DynamicDataSinkWriteAssetResponder,
},
WriteFirmware {
configuration: Configuration,
type_: String,
payload: fidl_fuchsia_mem::Buffer,
responder: DynamicDataSinkWriteFirmwareResponder,
},
ReadFirmware {
configuration: Configuration,
type_: String,
responder: DynamicDataSinkReadFirmwareResponder,
},
WriteVolumes {
payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
responder: DynamicDataSinkWriteVolumesResponder,
},
WriteOpaqueVolume {
payload: fidl_fuchsia_mem::Buffer,
responder: DynamicDataSinkWriteOpaqueVolumeResponder,
},
WriteSparseVolume {
payload: fidl_fuchsia_mem::Buffer,
responder: DynamicDataSinkWriteSparseVolumeResponder,
},
Flush { responder: DynamicDataSinkFlushResponder },
InitializePartitionTables { responder: DynamicDataSinkInitializePartitionTablesResponder },
WipePartitionTables { responder: DynamicDataSinkWipePartitionTablesResponder },
}
impl DynamicDataSinkRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_read_asset(
self,
) -> Option<(Configuration, Asset, DynamicDataSinkReadAssetResponder)> {
if let DynamicDataSinkRequest::ReadAsset { configuration, asset, responder } = self {
Some((configuration, asset, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_asset(
self,
) -> Option<(Configuration, Asset, fidl_fuchsia_mem::Buffer, DynamicDataSinkWriteAssetResponder)>
{
if let DynamicDataSinkRequest::WriteAsset { configuration, asset, payload, responder } =
self
{
Some((configuration, asset, payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_firmware(
self,
) -> Option<(
Configuration,
String,
fidl_fuchsia_mem::Buffer,
DynamicDataSinkWriteFirmwareResponder,
)> {
if let DynamicDataSinkRequest::WriteFirmware { configuration, type_, payload, responder } =
self
{
Some((configuration, type_, payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_firmware(
self,
) -> Option<(Configuration, String, DynamicDataSinkReadFirmwareResponder)> {
if let DynamicDataSinkRequest::ReadFirmware { configuration, type_, responder } = self {
Some((configuration, type_, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_volumes(
self,
) -> Option<(
fidl::endpoints::ClientEnd<PayloadStreamMarker>,
DynamicDataSinkWriteVolumesResponder,
)> {
if let DynamicDataSinkRequest::WriteVolumes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_opaque_volume(
self,
) -> Option<(fidl_fuchsia_mem::Buffer, DynamicDataSinkWriteOpaqueVolumeResponder)> {
if let DynamicDataSinkRequest::WriteOpaqueVolume { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_sparse_volume(
self,
) -> Option<(fidl_fuchsia_mem::Buffer, DynamicDataSinkWriteSparseVolumeResponder)> {
if let DynamicDataSinkRequest::WriteSparseVolume { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flush(self) -> Option<(DynamicDataSinkFlushResponder)> {
if let DynamicDataSinkRequest::Flush { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_initialize_partition_tables(
self,
) -> Option<(DynamicDataSinkInitializePartitionTablesResponder)> {
if let DynamicDataSinkRequest::InitializePartitionTables { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wipe_partition_tables(
self,
) -> Option<(DynamicDataSinkWipePartitionTablesResponder)> {
if let DynamicDataSinkRequest::WipePartitionTables { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DynamicDataSinkRequest::ReadAsset { .. } => "read_asset",
DynamicDataSinkRequest::WriteAsset { .. } => "write_asset",
DynamicDataSinkRequest::WriteFirmware { .. } => "write_firmware",
DynamicDataSinkRequest::ReadFirmware { .. } => "read_firmware",
DynamicDataSinkRequest::WriteVolumes { .. } => "write_volumes",
DynamicDataSinkRequest::WriteOpaqueVolume { .. } => "write_opaque_volume",
DynamicDataSinkRequest::WriteSparseVolume { .. } => "write_sparse_volume",
DynamicDataSinkRequest::Flush { .. } => "flush",
DynamicDataSinkRequest::InitializePartitionTables { .. } => {
"initialize_partition_tables"
}
DynamicDataSinkRequest::WipePartitionTables { .. } => "wipe_partition_tables",
}
}
}
#[derive(Debug, Clone)]
pub struct DynamicDataSinkControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DynamicDataSinkControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl DynamicDataSinkControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkReadAssetResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkReadAssetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkReadAssetResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkReadAssetResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_mem::Buffer, 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_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>>(
result.as_mut().map_err(|e| *e).map(|asset| (asset,)),
self.tx_id,
0x125a23e561007898,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkWriteAssetResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkWriteAssetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkWriteAssetResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkWriteAssetResponder {
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::<DataSinkWriteAssetResponse>(
(status,),
self.tx_id,
0x516839ce76c4d0a9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkWriteFirmwareResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkWriteFirmwareResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkWriteFirmwareResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkWriteFirmwareResponder {
pub fn send(self, mut result: &WriteFirmwareResult) -> 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: &WriteFirmwareResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: &WriteFirmwareResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DataSinkWriteFirmwareResponse>(
(result,),
self.tx_id,
0x514b93454ac0be97,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkReadFirmwareResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkReadFirmwareResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkReadFirmwareResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkReadFirmwareResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_mem::Buffer, 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_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>>(
result.as_mut().map_err(|e| *e).map(|firmware| (firmware,)),
self.tx_id,
0xcb67f9830cae9c3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkWriteVolumesResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkWriteVolumesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkWriteVolumesResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkWriteVolumesResponder {
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::<DataSinkWriteVolumesResponse>(
(status,),
self.tx_id,
0x5ee32c861d0259df,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkWriteOpaqueVolumeResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkWriteOpaqueVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkWriteOpaqueVolumeResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkWriteOpaqueVolumeResponder {
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,
0x4884b6ebaf660d79,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkWriteSparseVolumeResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkWriteSparseVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkWriteSparseVolumeResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkWriteSparseVolumeResponder {
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,
0x340f5370c5b1e026,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkFlushResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkFlushResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkFlushResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkFlushResponder {
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::<DataSinkFlushResponse>(
(status,),
self.tx_id,
0x3b59d3e2338e3139,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkInitializePartitionTablesResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkInitializePartitionTablesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkInitializePartitionTablesResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkInitializePartitionTablesResponder {
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::<DynamicDataSinkInitializePartitionTablesResponse>(
(status,),
self.tx_id,
0x4c798b3813ea9f7e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DynamicDataSinkWipePartitionTablesResponder {
control_handle: std::mem::ManuallyDrop<DynamicDataSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DynamicDataSinkWipePartitionTablesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DynamicDataSinkWipePartitionTablesResponder {
type ControlHandle = DynamicDataSinkControlHandle;
fn control_handle(&self) -> &DynamicDataSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DynamicDataSinkWipePartitionTablesResponder {
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::<DynamicDataSinkWipePartitionTablesResponse>(
(status,),
self.tx_id,
0x797c0ebeedaf2cc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PaverMarker;
impl fidl::endpoints::ProtocolMarker for PaverMarker {
type Proxy = PaverProxy;
type RequestStream = PaverRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PaverSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.paver.Paver";
}
impl fidl::endpoints::DiscoverableProtocolMarker for PaverMarker {}
pub trait PaverProxyInterface: Send + Sync {
fn r#find_data_sink(
&self,
data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
) -> Result<(), fidl::Error>;
fn r#use_block_device(
&self,
block_device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
block_controller: fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error>;
fn r#find_boot_manager(
&self,
boot_manager: fidl::endpoints::ServerEnd<BootManagerMarker>,
) -> Result<(), fidl::Error>;
fn r#find_sysconfig(
&self,
sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PaverSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PaverSynchronousProxy {
type Proxy = PaverProxy;
type Protocol = PaverMarker;
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 PaverSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PaverMarker 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::Time) -> Result<PaverEvent, fidl::Error> {
PaverEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#find_data_sink(
&self,
mut data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindDataSinkRequest>(
(data_sink,),
0x710a34c6f9c8a0e9,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#use_block_device(
&self,
mut block_device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
mut block_controller: fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
mut data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverUseBlockDeviceRequest>(
(block_device, block_controller, data_sink),
0x7dbe727cfb90bed5,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#find_boot_manager(
&self,
mut boot_manager: fidl::endpoints::ServerEnd<BootManagerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindBootManagerRequest>(
(boot_manager,),
0x5d500b0633102443,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#find_sysconfig(
&self,
mut sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindSysconfigRequest>(
(sysconfig,),
0x542cdb5be9b5c02d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct PaverProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for PaverProxy {
type Protocol = PaverMarker;
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 PaverProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <PaverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PaverEventStream {
PaverEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#find_data_sink(
&self,
mut data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
) -> Result<(), fidl::Error> {
PaverProxyInterface::r#find_data_sink(self, data_sink)
}
pub fn r#use_block_device(
&self,
mut block_device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
mut block_controller: fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
mut data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error> {
PaverProxyInterface::r#use_block_device(self, block_device, block_controller, data_sink)
}
pub fn r#find_boot_manager(
&self,
mut boot_manager: fidl::endpoints::ServerEnd<BootManagerMarker>,
) -> Result<(), fidl::Error> {
PaverProxyInterface::r#find_boot_manager(self, boot_manager)
}
pub fn r#find_sysconfig(
&self,
mut sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
) -> Result<(), fidl::Error> {
PaverProxyInterface::r#find_sysconfig(self, sysconfig)
}
}
impl PaverProxyInterface for PaverProxy {
fn r#find_data_sink(
&self,
mut data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindDataSinkRequest>(
(data_sink,),
0x710a34c6f9c8a0e9,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#use_block_device(
&self,
mut block_device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
mut block_controller: fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
mut data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverUseBlockDeviceRequest>(
(block_device, block_controller, data_sink),
0x7dbe727cfb90bed5,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#find_boot_manager(
&self,
mut boot_manager: fidl::endpoints::ServerEnd<BootManagerMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindBootManagerRequest>(
(boot_manager,),
0x5d500b0633102443,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#find_sysconfig(
&self,
mut sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindSysconfigRequest>(
(sysconfig,),
0x542cdb5be9b5c02d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct PaverEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for PaverEventStream {}
impl futures::stream::FusedStream for PaverEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PaverEventStream {
type Item = Result<PaverEvent, 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(PaverEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PaverEvent {}
impl PaverEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<PaverEvent, 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: <PaverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PaverRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for PaverRequestStream {}
impl futures::stream::FusedStream for PaverRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PaverRequestStream {
type Protocol = PaverMarker;
type ControlHandle = PaverControlHandle;
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 {
PaverControlHandle { 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 PaverRequestStream {
type Item = Result<PaverRequest, 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 PaverRequestStream 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 {
0x710a34c6f9c8a0e9 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PaverFindDataSinkRequest);
fidl::encoding::Decoder::decode_into::<PaverFindDataSinkRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PaverControlHandle { inner: this.inner.clone() };
Ok(PaverRequest::FindDataSink { data_sink: req.data_sink, control_handle })
}
0x7dbe727cfb90bed5 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PaverUseBlockDeviceRequest);
fidl::encoding::Decoder::decode_into::<PaverUseBlockDeviceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PaverControlHandle { inner: this.inner.clone() };
Ok(PaverRequest::UseBlockDevice {
block_device: req.block_device,
block_controller: req.block_controller,
data_sink: req.data_sink,
control_handle,
})
}
0x5d500b0633102443 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PaverFindBootManagerRequest);
fidl::encoding::Decoder::decode_into::<PaverFindBootManagerRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PaverControlHandle { inner: this.inner.clone() };
Ok(PaverRequest::FindBootManager {
boot_manager: req.boot_manager,
control_handle,
})
}
0x542cdb5be9b5c02d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PaverFindSysconfigRequest);
fidl::encoding::Decoder::decode_into::<PaverFindSysconfigRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PaverControlHandle { inner: this.inner.clone() };
Ok(PaverRequest::FindSysconfig { sysconfig: req.sysconfig, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <PaverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum PaverRequest {
FindDataSink {
data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
control_handle: PaverControlHandle,
},
UseBlockDevice {
block_device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
block_controller: fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
control_handle: PaverControlHandle,
},
FindBootManager {
boot_manager: fidl::endpoints::ServerEnd<BootManagerMarker>,
control_handle: PaverControlHandle,
},
FindSysconfig {
sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
control_handle: PaverControlHandle,
},
}
impl PaverRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_find_data_sink(
self,
) -> Option<(fidl::endpoints::ServerEnd<DataSinkMarker>, PaverControlHandle)> {
if let PaverRequest::FindDataSink { data_sink, control_handle } = self {
Some((data_sink, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_use_block_device(
self,
) -> Option<(
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_block::BlockMarker>,
fidl::endpoints::ClientEnd<fidl_fuchsia_device::ControllerMarker>,
fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
PaverControlHandle,
)> {
if let PaverRequest::UseBlockDevice {
block_device,
block_controller,
data_sink,
control_handle,
} = self
{
Some((block_device, block_controller, data_sink, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_find_boot_manager(
self,
) -> Option<(fidl::endpoints::ServerEnd<BootManagerMarker>, PaverControlHandle)> {
if let PaverRequest::FindBootManager { boot_manager, control_handle } = self {
Some((boot_manager, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_find_sysconfig(
self,
) -> Option<(fidl::endpoints::ServerEnd<SysconfigMarker>, PaverControlHandle)> {
if let PaverRequest::FindSysconfig { sysconfig, control_handle } = self {
Some((sysconfig, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PaverRequest::FindDataSink { .. } => "find_data_sink",
PaverRequest::UseBlockDevice { .. } => "use_block_device",
PaverRequest::FindBootManager { .. } => "find_boot_manager",
PaverRequest::FindSysconfig { .. } => "find_sysconfig",
}
}
}
#[derive(Debug, Clone)]
pub struct PaverControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for PaverControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl PaverControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PayloadStreamMarker;
impl fidl::endpoints::ProtocolMarker for PayloadStreamMarker {
type Proxy = PayloadStreamProxy;
type RequestStream = PayloadStreamRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PayloadStreamSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) PayloadStream";
}
pub trait PayloadStreamProxyInterface: Send + Sync {
type RegisterVmoResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#register_vmo(&self, vmo: fidl::Vmo) -> Self::RegisterVmoResponseFut;
type ReadDataResponseFut: std::future::Future<Output = Result<ReadResult, fidl::Error>> + Send;
fn r#read_data(&self) -> Self::ReadDataResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PayloadStreamSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PayloadStreamSynchronousProxy {
type Proxy = PayloadStreamProxy;
type Protocol = PayloadStreamMarker;
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 PayloadStreamSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PayloadStreamMarker 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::Time) -> Result<PayloadStreamEvent, fidl::Error> {
PayloadStreamEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#register_vmo(
&self,
mut vmo: fidl::Vmo,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response = self
.client
.send_query::<PayloadStreamRegisterVmoRequest, PayloadStreamRegisterVmoResponse>(
(vmo,),
0x388d7fe44bcb4c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#read_data(&self, ___deadline: zx::Time) -> Result<ReadResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, PayloadStreamReadDataResponse>(
(),
0x2ccde55366318afa,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
}
#[derive(Debug, Clone)]
pub struct PayloadStreamProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for PayloadStreamProxy {
type Protocol = PayloadStreamMarker;
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 PayloadStreamProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <PayloadStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PayloadStreamEventStream {
PayloadStreamEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#register_vmo(&self, mut vmo: fidl::Vmo) -> fidl::client::QueryResponseFut<i32> {
PayloadStreamProxyInterface::r#register_vmo(self, vmo)
}
pub fn r#read_data(&self) -> fidl::client::QueryResponseFut<ReadResult> {
PayloadStreamProxyInterface::r#read_data(self)
}
}
impl PayloadStreamProxyInterface for PayloadStreamProxy {
type RegisterVmoResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#register_vmo(&self, mut vmo: fidl::Vmo) -> Self::RegisterVmoResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PayloadStreamRegisterVmoResponse,
0x388d7fe44bcb4c,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<PayloadStreamRegisterVmoRequest, i32>(
(vmo,),
0x388d7fe44bcb4c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadDataResponseFut = fidl::client::QueryResponseFut<ReadResult>;
fn r#read_data(&self) -> Self::ReadDataResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ReadResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PayloadStreamReadDataResponse,
0x2ccde55366318afa,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ReadResult>(
(),
0x2ccde55366318afa,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct PayloadStreamEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for PayloadStreamEventStream {}
impl futures::stream::FusedStream for PayloadStreamEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PayloadStreamEventStream {
type Item = Result<PayloadStreamEvent, 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(PayloadStreamEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PayloadStreamEvent {}
impl PayloadStreamEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<PayloadStreamEvent, 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: <PayloadStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PayloadStreamRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for PayloadStreamRequestStream {}
impl futures::stream::FusedStream for PayloadStreamRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PayloadStreamRequestStream {
type Protocol = PayloadStreamMarker;
type ControlHandle = PayloadStreamControlHandle;
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 {
PayloadStreamControlHandle { 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 PayloadStreamRequestStream {
type Item = Result<PayloadStreamRequest, 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 PayloadStreamRequestStream 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 {
0x388d7fe44bcb4c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(PayloadStreamRegisterVmoRequest);
fidl::encoding::Decoder::decode_into::<PayloadStreamRegisterVmoRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PayloadStreamControlHandle { inner: this.inner.clone() };
Ok(PayloadStreamRequest::RegisterVmo {
vmo: req.vmo,
responder: PayloadStreamRegisterVmoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2ccde55366318afa => {
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 = PayloadStreamControlHandle { inner: this.inner.clone() };
Ok(PayloadStreamRequest::ReadData {
responder: PayloadStreamReadDataResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PayloadStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum PayloadStreamRequest {
RegisterVmo { vmo: fidl::Vmo, responder: PayloadStreamRegisterVmoResponder },
ReadData { responder: PayloadStreamReadDataResponder },
}
impl PayloadStreamRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_register_vmo(self) -> Option<(fidl::Vmo, PayloadStreamRegisterVmoResponder)> {
if let PayloadStreamRequest::RegisterVmo { vmo, responder } = self {
Some((vmo, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_data(self) -> Option<(PayloadStreamReadDataResponder)> {
if let PayloadStreamRequest::ReadData { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PayloadStreamRequest::RegisterVmo { .. } => "register_vmo",
PayloadStreamRequest::ReadData { .. } => "read_data",
}
}
}
#[derive(Debug, Clone)]
pub struct PayloadStreamControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for PayloadStreamControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl PayloadStreamControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PayloadStreamRegisterVmoResponder {
control_handle: std::mem::ManuallyDrop<PayloadStreamControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PayloadStreamRegisterVmoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PayloadStreamRegisterVmoResponder {
type ControlHandle = PayloadStreamControlHandle;
fn control_handle(&self) -> &PayloadStreamControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PayloadStreamRegisterVmoResponder {
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::<PayloadStreamRegisterVmoResponse>(
(status,),
self.tx_id,
0x388d7fe44bcb4c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PayloadStreamReadDataResponder {
control_handle: std::mem::ManuallyDrop<PayloadStreamControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PayloadStreamReadDataResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PayloadStreamReadDataResponder {
type ControlHandle = PayloadStreamControlHandle;
fn control_handle(&self) -> &PayloadStreamControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PayloadStreamReadDataResponder {
pub fn send(self, mut result: &ReadResult) -> 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: &ReadResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: &ReadResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<PayloadStreamReadDataResponse>(
(result,),
self.tx_id,
0x2ccde55366318afa,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SysconfigMarker;
impl fidl::endpoints::ProtocolMarker for SysconfigMarker {
type Proxy = SysconfigProxy;
type RequestStream = SysconfigRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SysconfigSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Sysconfig";
}
pub type SysconfigReadResult = Result<fidl_fuchsia_mem::Buffer, i32>;
pub type SysconfigGetPartitionSizeResult = Result<u64, i32>;
pub trait SysconfigProxyInterface: Send + Sync {
type ReadResponseFut: std::future::Future<Output = Result<SysconfigReadResult, fidl::Error>>
+ Send;
fn r#read(&self) -> Self::ReadResponseFut;
type WriteResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#write(&self, payload: fidl_fuchsia_mem::Buffer) -> Self::WriteResponseFut;
type GetPartitionSizeResponseFut: std::future::Future<Output = Result<SysconfigGetPartitionSizeResult, fidl::Error>>
+ Send;
fn r#get_partition_size(&self) -> Self::GetPartitionSizeResponseFut;
type FlushResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#flush(&self) -> Self::FlushResponseFut;
type WipeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#wipe(&self) -> Self::WipeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SysconfigSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SysconfigSynchronousProxy {
type Proxy = SysconfigProxy;
type Protocol = SysconfigMarker;
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 SysconfigSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SysconfigMarker 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::Time) -> Result<SysconfigEvent, fidl::Error> {
SysconfigEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#read(&self, ___deadline: zx::Time) -> Result<SysconfigReadResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<SysconfigReadResponse, i32>,
>(
(),
0x350c317c53c226fc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.data))
}
pub fn r#write(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<SysconfigWriteRequest, SysconfigWriteResponse>(
(&mut payload,),
0x393786c114caf171,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#get_partition_size(
&self,
___deadline: zx::Time,
) -> Result<SysconfigGetPartitionSizeResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<SysconfigGetPartitionSizeResponse, i32>,
>(
(),
0x2570c58b74fb8957,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.size))
}
pub fn r#flush(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, SysconfigFlushResponse>(
(),
0xc6c1bb233d003c6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#wipe(&self, ___deadline: zx::Time) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, SysconfigWipeResponse>(
(),
0x34a634965ebfb702,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct SysconfigProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for SysconfigProxy {
type Protocol = SysconfigMarker;
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 SysconfigProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <SysconfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SysconfigEventStream {
SysconfigEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#read(&self) -> fidl::client::QueryResponseFut<SysconfigReadResult> {
SysconfigProxyInterface::r#read(self)
}
pub fn r#write(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<i32> {
SysconfigProxyInterface::r#write(self, payload)
}
pub fn r#get_partition_size(
&self,
) -> fidl::client::QueryResponseFut<SysconfigGetPartitionSizeResult> {
SysconfigProxyInterface::r#get_partition_size(self)
}
pub fn r#flush(&self) -> fidl::client::QueryResponseFut<i32> {
SysconfigProxyInterface::r#flush(self)
}
pub fn r#wipe(&self) -> fidl::client::QueryResponseFut<i32> {
SysconfigProxyInterface::r#wipe(self)
}
}
impl SysconfigProxyInterface for SysconfigProxy {
type ReadResponseFut = fidl::client::QueryResponseFut<SysconfigReadResult>;
fn r#read(&self) -> Self::ReadResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<SysconfigReadResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SysconfigReadResponse, i32>,
0x350c317c53c226fc,
>(_buf?)?;
Ok(_response.map(|x| x.data))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SysconfigReadResult>(
(),
0x350c317c53c226fc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#write(&self, mut payload: fidl_fuchsia_mem::Buffer) -> Self::WriteResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SysconfigWriteResponse,
0x393786c114caf171,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<SysconfigWriteRequest, i32>(
(&mut payload,),
0x393786c114caf171,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPartitionSizeResponseFut =
fidl::client::QueryResponseFut<SysconfigGetPartitionSizeResult>;
fn r#get_partition_size(&self) -> Self::GetPartitionSizeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<SysconfigGetPartitionSizeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SysconfigGetPartitionSizeResponse, i32>,
0x2570c58b74fb8957,
>(_buf?)?;
Ok(_response.map(|x| x.size))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, SysconfigGetPartitionSizeResult>(
(),
0x2570c58b74fb8957,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type FlushResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SysconfigFlushResponse,
0xc6c1bb233d003c6,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0xc6c1bb233d003c6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WipeResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#wipe(&self) -> Self::WipeResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SysconfigWipeResponse,
0x34a634965ebfb702,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x34a634965ebfb702,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct SysconfigEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for SysconfigEventStream {}
impl futures::stream::FusedStream for SysconfigEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SysconfigEventStream {
type Item = Result<SysconfigEvent, 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(SysconfigEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SysconfigEvent {}
impl SysconfigEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<SysconfigEvent, 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: <SysconfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SysconfigRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for SysconfigRequestStream {}
impl futures::stream::FusedStream for SysconfigRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SysconfigRequestStream {
type Protocol = SysconfigMarker;
type ControlHandle = SysconfigControlHandle;
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 {
SysconfigControlHandle { 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 SysconfigRequestStream {
type Item = Result<SysconfigRequest, 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 SysconfigRequestStream 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 {
0x350c317c53c226fc => {
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 = SysconfigControlHandle { inner: this.inner.clone() };
Ok(SysconfigRequest::Read {
responder: SysconfigReadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x393786c114caf171 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(SysconfigWriteRequest);
fidl::encoding::Decoder::decode_into::<SysconfigWriteRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = SysconfigControlHandle { inner: this.inner.clone() };
Ok(SysconfigRequest::Write {
payload: req.payload,
responder: SysconfigWriteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2570c58b74fb8957 => {
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 = SysconfigControlHandle { inner: this.inner.clone() };
Ok(SysconfigRequest::GetPartitionSize {
responder: SysconfigGetPartitionSizeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xc6c1bb233d003c6 => {
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 = SysconfigControlHandle { inner: this.inner.clone() };
Ok(SysconfigRequest::Flush {
responder: SysconfigFlushResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x34a634965ebfb702 => {
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 = SysconfigControlHandle { inner: this.inner.clone() };
Ok(SysconfigRequest::Wipe {
responder: SysconfigWipeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <SysconfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum SysconfigRequest {
Read { responder: SysconfigReadResponder },
Write { payload: fidl_fuchsia_mem::Buffer, responder: SysconfigWriteResponder },
GetPartitionSize { responder: SysconfigGetPartitionSizeResponder },
Flush { responder: SysconfigFlushResponder },
Wipe { responder: SysconfigWipeResponder },
}
impl SysconfigRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_read(self) -> Option<(SysconfigReadResponder)> {
if let SysconfigRequest::Read { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write(self) -> Option<(fidl_fuchsia_mem::Buffer, SysconfigWriteResponder)> {
if let SysconfigRequest::Write { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_partition_size(self) -> Option<(SysconfigGetPartitionSizeResponder)> {
if let SysconfigRequest::GetPartitionSize { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_flush(self) -> Option<(SysconfigFlushResponder)> {
if let SysconfigRequest::Flush { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wipe(self) -> Option<(SysconfigWipeResponder)> {
if let SysconfigRequest::Wipe { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SysconfigRequest::Read { .. } => "read",
SysconfigRequest::Write { .. } => "write",
SysconfigRequest::GetPartitionSize { .. } => "get_partition_size",
SysconfigRequest::Flush { .. } => "flush",
SysconfigRequest::Wipe { .. } => "wipe",
}
}
}
#[derive(Debug, Clone)]
pub struct SysconfigControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for SysconfigControlHandle {
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<'a>(&'a self) -> fidl::OnSignals<'a> {
self.inner.channel().on_closed()
}
}
impl SysconfigControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SysconfigReadResponder {
control_handle: std::mem::ManuallyDrop<SysconfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SysconfigReadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SysconfigReadResponder {
type ControlHandle = SysconfigControlHandle;
fn control_handle(&self) -> &SysconfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SysconfigReadResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_mem::Buffer, 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_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_mem::Buffer, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<SysconfigReadResponse, i32>>(
result.as_mut().map_err(|e| *e).map(|data| (data,)),
self.tx_id,
0x350c317c53c226fc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SysconfigWriteResponder {
control_handle: std::mem::ManuallyDrop<SysconfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SysconfigWriteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SysconfigWriteResponder {
type ControlHandle = SysconfigControlHandle;
fn control_handle(&self) -> &SysconfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SysconfigWriteResponder {
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::<SysconfigWriteResponse>(
(status,),
self.tx_id,
0x393786c114caf171,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SysconfigGetPartitionSizeResponder {
control_handle: std::mem::ManuallyDrop<SysconfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SysconfigGetPartitionSizeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SysconfigGetPartitionSizeResponder {
type ControlHandle = SysconfigControlHandle;
fn control_handle(&self) -> &SysconfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SysconfigGetPartitionSizeResponder {
pub fn send(self, mut result: Result<u64, 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<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<SysconfigGetPartitionSizeResponse, i32>>(
result.map(|size| (size,)),
self.tx_id,
0x2570c58b74fb8957,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SysconfigFlushResponder {
control_handle: std::mem::ManuallyDrop<SysconfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SysconfigFlushResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SysconfigFlushResponder {
type ControlHandle = SysconfigControlHandle;
fn control_handle(&self) -> &SysconfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SysconfigFlushResponder {
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::<SysconfigFlushResponse>(
(status,),
self.tx_id,
0xc6c1bb233d003c6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SysconfigWipeResponder {
control_handle: std::mem::ManuallyDrop<SysconfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SysconfigWipeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SysconfigWipeResponder {
type ControlHandle = SysconfigControlHandle;
fn control_handle(&self) -> &SysconfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SysconfigWipeResponder {
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::<SysconfigWipeResponse>(
(status,),
self.tx_id,
0x34a634965ebfb702,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Asset {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for Asset {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for Asset {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Asset {
#[inline(always)]
fn new_empty() -> Self {
Self::Kernel
}
#[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 prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Configuration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for Configuration {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for Configuration {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Configuration {
#[inline(always)]
fn new_empty() -> Self {
Self::A
}
#[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 prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ConfigurationStatus {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ConfigurationStatus {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for ConfigurationStatus {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ConfigurationStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::Healthy
}
#[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 prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerFlushResponse {
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 BootManagerFlushResponse {
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<BootManagerFlushResponse> for &BootManagerFlushResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BootManagerFlushResponse)
.write_unaligned((self as *const BootManagerFlushResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<BootManagerFlushResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerFlushResponse {
#[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 BootManagerQueryConfigurationStatusRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusRequest {
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<BootManagerQueryConfigurationStatusRequest>
for &BootManagerQueryConfigurationStatusRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
fidl::encoding::Encode::<BootManagerQueryConfigurationStatusRequest>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerQueryConfigurationStatusRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationActiveRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveRequest {
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<BootManagerSetConfigurationActiveRequest>
for &BootManagerSetConfigurationActiveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
fidl::encoding::Encode::<BootManagerSetConfigurationActiveRequest>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerSetConfigurationActiveRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationActiveResponse {
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 BootManagerSetConfigurationActiveResponse {
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<BootManagerSetConfigurationActiveResponse>
for &BootManagerSetConfigurationActiveResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BootManagerSetConfigurationActiveResponse).write_unaligned(
(self as *const BootManagerSetConfigurationActiveResponse).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerSetConfigurationActiveResponse {
#[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 BootManagerSetConfigurationHealthyRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyRequest {
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<BootManagerSetConfigurationHealthyRequest>
for &BootManagerSetConfigurationHealthyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
fidl::encoding::Encode::<BootManagerSetConfigurationHealthyRequest>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerSetConfigurationHealthyRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationHealthyResponse {
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 BootManagerSetConfigurationHealthyResponse {
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<BootManagerSetConfigurationHealthyResponse>
for &BootManagerSetConfigurationHealthyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BootManagerSetConfigurationHealthyResponse).write_unaligned(
(self as *const BootManagerSetConfigurationHealthyResponse).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerSetConfigurationHealthyResponse {
#[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 BootManagerSetConfigurationUnbootableRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableRequest {
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<BootManagerSetConfigurationUnbootableRequest>
for &BootManagerSetConfigurationUnbootableRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
fidl::encoding::Encode::<BootManagerSetConfigurationUnbootableRequest>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerSetConfigurationUnbootableRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerSetConfigurationUnbootableResponse {
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 BootManagerSetConfigurationUnbootableResponse {
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<BootManagerSetConfigurationUnbootableResponse>
for &BootManagerSetConfigurationUnbootableResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BootManagerSetConfigurationUnbootableResponse).write_unaligned(
(self as *const BootManagerSetConfigurationUnbootableResponse).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerSetConfigurationUnbootableResponse {
#[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 BootManagerQueryActiveConfigurationResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryActiveConfigurationResponse {
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<BootManagerQueryActiveConfigurationResponse>
for &BootManagerQueryActiveConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryActiveConfigurationResponse>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerQueryActiveConfigurationResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
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<BootManagerQueryConfigurationLastSetActiveResponse>
for &BootManagerQueryConfigurationLastSetActiveResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryConfigurationLastSetActiveResponse>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerQueryConfigurationLastSetActiveResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerQueryConfigurationStatusResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusResponse {
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<BootManagerQueryConfigurationStatusResponse>
for &BootManagerQueryConfigurationStatusResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryConfigurationStatusResponse>::encode(
(<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<ConfigurationStatus>>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerQueryConfigurationStatusResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(ConfigurationStatus) }
}
#[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!(ConfigurationStatus, &mut self.status, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BootManagerQueryCurrentConfigurationResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryCurrentConfigurationResponse {
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<BootManagerQueryCurrentConfigurationResponse>
for &BootManagerQueryCurrentConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryCurrentConfigurationResponse>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>>
fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootManagerQueryCurrentConfigurationResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkFlushResponse {
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 DataSinkFlushResponse {
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<DataSinkFlushResponse> for &DataSinkFlushResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DataSinkFlushResponse)
.write_unaligned((self as *const DataSinkFlushResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<DataSinkFlushResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkFlushResponse {
#[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 DataSinkReadAssetRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for DataSinkReadAssetRequest {
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<DataSinkReadAssetRequest> for &DataSinkReadAssetRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
fidl::encoding::Encode::<DataSinkReadAssetRequest>::encode(
(
<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
<Asset as fidl::encoding::ValueTypeMarker>::borrow(&self.asset),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Configuration>, T1: fidl::encoding::Encode<Asset>>
fidl::encoding::Encode<DataSinkReadAssetRequest> 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::<DataSinkReadAssetRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkReadAssetRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration), asset: fidl::new_empty!(Asset) }
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
fidl::decode!(Asset, &mut self.asset, decoder, offset + 4, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkReadFirmwareRequest {
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::ResourceTypeMarker for DataSinkReadFirmwareRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkReadFirmwareRequest>
for &mut DataSinkReadFirmwareRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadFirmwareRequest>(offset);
fidl::encoding::Encode::<DataSinkReadFirmwareRequest>::encode(
(
<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
&self.type_,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<Configuration>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<256>>,
> fidl::encoding::Encode<DataSinkReadFirmwareRequest> 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::<DataSinkReadFirmwareRequest>(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 DataSinkReadFirmwareRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(Configuration),
type_: fidl::new_empty!(fidl::encoding::BoundedString<256>),
}
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<256>,
&mut self.type_,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteAssetRequest {
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::ResourceTypeMarker for DataSinkWriteAssetRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkWriteAssetRequest> for &mut DataSinkWriteAssetRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteAssetRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteAssetRequest>::encode(
(
<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
<Asset as fidl::encoding::ValueTypeMarker>::borrow(&self.asset),
<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<Configuration>,
T1: fidl::encoding::Encode<Asset>,
T2: fidl::encoding::Encode<fidl_fuchsia_mem::Buffer>,
> fidl::encoding::Encode<DataSinkWriteAssetRequest> 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::<DataSinkWriteAssetRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteAssetRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(Configuration),
asset: fidl::new_empty!(Asset),
payload: fidl::new_empty!(fidl_fuchsia_mem::Buffer),
}
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
fidl::decode!(Asset, &mut self.asset, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl_fuchsia_mem::Buffer,
&mut self.payload,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteAssetResponse {
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 DataSinkWriteAssetResponse {
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<DataSinkWriteAssetResponse> for &DataSinkWriteAssetResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DataSinkWriteAssetResponse)
.write_unaligned((self as *const DataSinkWriteAssetResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<DataSinkWriteAssetResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteAssetResponse {
#[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 DataSinkWriteFirmwareRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for DataSinkWriteFirmwareRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkWriteFirmwareRequest>
for &mut DataSinkWriteFirmwareRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteFirmwareRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteFirmwareRequest>::encode(
(
<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<Configuration>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<256>>,
T2: fidl::encoding::Encode<fidl_fuchsia_mem::Buffer>,
> fidl::encoding::Encode<DataSinkWriteFirmwareRequest> 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::<DataSinkWriteFirmwareRequest>(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 + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteFirmwareRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(Configuration),
type_: fidl::new_empty!(fidl::encoding::BoundedString<256>),
payload: fidl::new_empty!(fidl_fuchsia_mem::Buffer),
}
}
#[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!(Configuration, &mut self.configuration, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<256>,
&mut self.type_,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_mem::Buffer,
&mut self.payload,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteFirmwareResponse {
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 DataSinkWriteFirmwareResponse {
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<DataSinkWriteFirmwareResponse>
for &DataSinkWriteFirmwareResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
fidl::encoding::Encode::<DataSinkWriteFirmwareResponse>::encode(
(<WriteFirmwareResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<WriteFirmwareResult>>
fidl::encoding::Encode<DataSinkWriteFirmwareResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteFirmwareResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(WriteFirmwareResult) }
}
#[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!(WriteFirmwareResult, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteOpaqueVolumeRequest {
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::ResourceTypeMarker for DataSinkWriteOpaqueVolumeRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkWriteOpaqueVolumeRequest>
for &mut DataSinkWriteOpaqueVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteOpaqueVolumeRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteOpaqueVolumeRequest>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.payload,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_mem::Buffer>>
fidl::encoding::Encode<DataSinkWriteOpaqueVolumeRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteOpaqueVolumeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteOpaqueVolumeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { payload: fidl::new_empty!(fidl_fuchsia_mem::Buffer) }
}
#[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_mem::Buffer,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteSparseVolumeRequest {
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::ResourceTypeMarker for DataSinkWriteSparseVolumeRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkWriteSparseVolumeRequest>
for &mut DataSinkWriteSparseVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteSparseVolumeRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteSparseVolumeRequest>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.payload,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_mem::Buffer>>
fidl::encoding::Encode<DataSinkWriteSparseVolumeRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteSparseVolumeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteSparseVolumeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { payload: fidl::new_empty!(fidl_fuchsia_mem::Buffer) }
}
#[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_mem::Buffer,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteVolumesRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for DataSinkWriteVolumesRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkWriteVolumesRequest>
for &mut DataSinkWriteVolumesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteVolumesRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteVolumesRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<PayloadStreamMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<PayloadStreamMarker>>,
>,
> fidl::encoding::Encode<DataSinkWriteVolumesRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteVolumesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteVolumesRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<PayloadStreamMarker>>
),
}
}
#[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::Endpoint<fidl::endpoints::ClientEnd<PayloadStreamMarker>>,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DataSinkWriteVolumesResponse {
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 DataSinkWriteVolumesResponse {
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<DataSinkWriteVolumesResponse> for &DataSinkWriteVolumesResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteVolumesResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DataSinkWriteVolumesResponse)
.write_unaligned((self as *const DataSinkWriteVolumesResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<DataSinkWriteVolumesResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteVolumesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DataSinkWriteVolumesResponse {
#[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 DataSinkReadAssetResponse {
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::ResourceTypeMarker for DataSinkReadAssetResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DataSinkReadAssetResponse> for &mut DataSinkReadAssetResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadAssetResponse>(offset);