#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_FIRMWARE_TYPE_LENGTH: u32 = 256;
pub const MAX_PENDING_BOOT_ATTEMPTS: u8 = 7;
#[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(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum UnbootableReason {
None,
NoMoreTries,
OsRequested,
VerificationFailure,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! UnbootableReasonUnknown {
() => {
_
};
}
impl UnbootableReason {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::None),
1 => Some(Self::NoMoreTries),
2 => Some(Self::OsRequested),
3 => Some(Self::VerificationFailure),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
0 => Self::None,
1 => Self::NoMoreTries,
2 => Self::OsRequested,
3 => Self::VerificationFailure,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::None => 0,
Self::NoMoreTries => 1,
Self::OsRequested => 2,
Self::VerificationFailure => 3,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => 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 BootManagerQueryConfigurationStatusAndBootAttemptsRequest {
pub configuration: Configuration,
}
impl fidl::Persistable for BootManagerQueryConfigurationStatusAndBootAttemptsRequest {}
#[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<fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkReadFirmwareRequest
{
}
#[derive(Debug, PartialEq)]
pub struct DataSinkWriteAssetRequest {
pub configuration: Configuration,
pub asset: Asset,
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> 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<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteOpaqueVolumeRequest
{
}
#[derive(Debug, PartialEq)]
pub struct DataSinkWriteSparseVolumeRequest {
pub payload: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteSparseVolumeRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DataSinkWriteVolumesRequest {
pub payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect> for DataSinkReadAssetResponse {}
#[derive(Debug, PartialEq)]
pub struct DataSinkReadFirmwareResponse {
pub firmware: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
for PaverFindBootManagerRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverFindDataSinkRequest {
pub data_sink: fidl::endpoints::ServerEnd<DataSinkMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PaverFindDataSinkRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverFindPartitionTableManagerRequest {
pub data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PaverFindPartitionTableManagerRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PaverFindSysconfigRequest {
pub sysconfig: fidl::endpoints::ServerEnd<SysconfigMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PaverFindSysconfigRequest {}
#[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<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect> 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<fidl::encoding::DefaultFuchsiaResourceDialect> for SysconfigReadResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct BootManagerQueryConfigurationStatusAndBootAttemptsResponse {
pub status: Option<ConfigurationStatus>,
pub boot_attempts: Option<u8>,
pub unbootable_reason: Option<UnbootableReason>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for BootManagerQueryConfigurationStatusAndBootAttemptsResponse {}
#[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 BootManagerQueryConfigurationStatusAndBootAttemptsResult =
Result<BootManagerQueryConfigurationStatusAndBootAttemptsResponse, 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 QueryConfigurationStatusAndBootAttemptsResponseFut: std::future::Future<
Output = Result<BootManagerQueryConfigurationStatusAndBootAttemptsResult, fidl::Error>,
> + Send;
fn r#query_configuration_status_and_boot_attempts(
&self,
configuration: Configuration,
) -> Self::QueryConfigurationStatusAndBootAttemptsResponseFut;
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::MonotonicInstant,
) -> Result<BootManagerEvent, fidl::Error> {
BootManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#query_current_configuration(
&self,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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#query_configuration_status_and_boot_attempts(
&self,
mut configuration: Configuration,
___deadline: zx::MonotonicInstant,
) -> Result<BootManagerQueryConfigurationStatusAndBootAttemptsResult, fidl::Error> {
let _response = self.client.send_query::<
BootManagerQueryConfigurationStatusAndBootAttemptsRequest,
fidl::encoding::ResultType<BootManagerQueryConfigurationStatusAndBootAttemptsResponse, i32>,
>(
(configuration,),
0x27f851d5809cfb3d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_configuration_active(
&self,
mut configuration: Configuration,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BootManagerProxyInterface::r#query_current_configuration(self)
}
pub fn r#query_active_configuration(
&self,
) -> fidl::client::QueryResponseFut<
BootManagerQueryActiveConfigurationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BootManagerProxyInterface::r#query_active_configuration(self)
}
pub fn r#query_configuration_last_set_active(
&self,
) -> fidl::client::QueryResponseFut<
BootManagerQueryConfigurationLastSetActiveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BootManagerProxyInterface::r#query_configuration_last_set_active(self)
}
pub fn r#query_configuration_status(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<
BootManagerQueryConfigurationStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BootManagerProxyInterface::r#query_configuration_status(self, configuration)
}
pub fn r#query_configuration_status_and_boot_attempts(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<
BootManagerQueryConfigurationStatusAndBootAttemptsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BootManagerProxyInterface::r#query_configuration_status_and_boot_attempts(
self,
configuration,
)
}
pub fn r#set_configuration_active(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
BootManagerProxyInterface::r#set_configuration_active(self, configuration)
}
pub fn r#set_configuration_unbootable(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
BootManagerProxyInterface::r#set_configuration_unbootable(self, configuration)
}
pub fn r#set_configuration_healthy(
&self,
mut configuration: Configuration,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
BootManagerProxyInterface::r#set_configuration_healthy(self, configuration)
}
pub fn r#set_one_shot_recovery(
&self,
) -> fidl::client::QueryResponseFut<
BootManagerSetOneShotRecoveryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BootManagerProxyInterface::r#set_one_shot_recovery(self)
}
pub fn r#flush(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
BootManagerProxyInterface::r#flush(self)
}
}
impl BootManagerProxyInterface for BootManagerProxy {
type QueryCurrentConfigurationResponseFut = fidl::client::QueryResponseFut<
BootManagerQueryCurrentConfigurationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_current_configuration(&self) -> Self::QueryCurrentConfigurationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryCurrentConfigurationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryCurrentConfigurationResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_active_configuration(&self) -> Self::QueryActiveConfigurationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryActiveConfigurationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryActiveConfigurationResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_configuration_last_set_active(
&self,
) -> Self::QueryConfigurationLastSetActiveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryConfigurationLastSetActiveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryConfigurationLastSetActiveResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_configuration_status(
&self,
mut configuration: Configuration,
) -> Self::QueryConfigurationStatusResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryConfigurationStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<BootManagerQueryConfigurationStatusResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x40822ca9ca68b19a,
>(_buf?)?;
Ok(_response.map(|x| x.status))
}
self.client.send_query_and_decode::<
BootManagerQueryConfigurationStatusRequest,
BootManagerQueryConfigurationStatusResult,
>(
(configuration,),
0x40822ca9ca68b19a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryConfigurationStatusAndBootAttemptsResponseFut = fidl::client::QueryResponseFut<
BootManagerQueryConfigurationStatusAndBootAttemptsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_configuration_status_and_boot_attempts(
&self,
mut configuration: Configuration,
) -> Self::QueryConfigurationStatusAndBootAttemptsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerQueryConfigurationStatusAndBootAttemptsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
BootManagerQueryConfigurationStatusAndBootAttemptsResponse,
i32,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x27f851d5809cfb3d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
BootManagerQueryConfigurationStatusAndBootAttemptsRequest,
BootManagerQueryConfigurationStatusAndBootAttemptsResult,
>(
(configuration,),
0x27f851d5809cfb3d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetConfigurationActiveResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_configuration_active(
&self,
mut configuration: Configuration,
) -> Self::SetConfigurationActiveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerSetConfigurationActiveResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_configuration_unbootable(
&self,
mut configuration: Configuration,
) -> Self::SetConfigurationUnbootableResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerSetConfigurationUnbootableResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_configuration_healthy(
&self,
mut configuration: Configuration,
) -> Self::SetConfigurationHealthyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerSetConfigurationHealthyResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_one_shot_recovery(&self) -> Self::SetOneShotRecoveryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BootManagerSetOneShotRecoveryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BootManagerFlushResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0xc213298cbc9c371 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = 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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
})
}
0x27f851d5809cfb3d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BootManagerQueryConfigurationStatusAndBootAttemptsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BootManagerControlHandle { inner: this.inner.clone() };
Ok(BootManagerRequest::QueryConfigurationStatusAndBootAttempts {
configuration: req.configuration,
responder:
BootManagerQueryConfigurationStatusAndBootAttemptsResponder {
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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
QueryConfigurationStatusAndBootAttempts {
configuration: Configuration,
responder: BootManagerQueryConfigurationStatusAndBootAttemptsResponder,
},
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_query_configuration_status_and_boot_attempts(
self,
) -> Option<(Configuration, BootManagerQueryConfigurationStatusAndBootAttemptsResponder)> {
if let BootManagerRequest::QueryConfigurationStatusAndBootAttempts {
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::QueryConfigurationStatusAndBootAttempts { .. } => {
"query_configuration_status_and_boot_attempts"
}
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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 BootManagerQueryConfigurationStatusAndBootAttemptsResponder {
control_handle: std::mem::ManuallyDrop<BootManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootManagerQueryConfigurationStatusAndBootAttemptsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootManagerQueryConfigurationStatusAndBootAttemptsResponder {
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 BootManagerQueryConfigurationStatusAndBootAttemptsResponder {
pub fn send(
self,
mut result: Result<&BootManagerQueryConfigurationStatusAndBootAttemptsResponse, 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<&BootManagerQueryConfigurationStatusAndBootAttemptsResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&BootManagerQueryConfigurationStatusAndBootAttemptsResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BootManagerQueryConfigurationStatusAndBootAttemptsResponse,
i32,
>>(
result,
self.tx_id,
0x27f851d5809cfb3d,
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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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, fidl::encoding::DefaultFuchsiaResourceDialect> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DataSinkProxyInterface::r#write_firmware(self, configuration, type_, payload)
}
pub fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> fidl::client::QueryResponseFut<
DataSinkReadFirmwareResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DataSinkProxyInterface::r#read_firmware(self, configuration, type_)
}
pub fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DataSinkProxyInterface::r#write_volumes(self, payload)
}
pub fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<
DataSinkWriteOpaqueVolumeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DataSinkProxyInterface::r#write_opaque_volume(self, payload)
}
pub fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<
DataSinkWriteSparseVolumeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DataSinkProxyInterface::r#write_sparse_volume(self, payload)
}
pub fn r#flush(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DataSinkProxyInterface::r#flush(self)
}
}
impl DataSinkProxyInterface for DataSinkProxy {
type ReadAssetResponseFut = fidl::client::QueryResponseFut<
DataSinkReadAssetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
) -> Self::ReadAssetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadAssetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteAssetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WriteFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteFirmwareResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> Self::ReadFirmwareResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> Self::WriteVolumesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteVolumesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteOpaqueVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteOpaqueVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteSparseVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteSparseVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkFlushResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x125a23e561007898 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DataSinkReadAssetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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, fidl::encoding::DefaultFuchsiaResourceDialect> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DynamicDataSinkProxyInterface::r#write_firmware(self, configuration, type_, payload)
}
pub fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> fidl::client::QueryResponseFut<
DataSinkReadFirmwareResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DynamicDataSinkProxyInterface::r#read_firmware(self, configuration, type_)
}
pub fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DynamicDataSinkProxyInterface::r#write_volumes(self, payload)
}
pub fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<
DataSinkWriteOpaqueVolumeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DynamicDataSinkProxyInterface::r#write_opaque_volume(self, payload)
}
pub fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<
DataSinkWriteSparseVolumeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DynamicDataSinkProxyInterface::r#write_sparse_volume(self, payload)
}
pub fn r#flush(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DynamicDataSinkProxyInterface::r#flush(self)
}
pub fn r#initialize_partition_tables(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DynamicDataSinkProxyInterface::r#initialize_partition_tables(self)
}
pub fn r#wipe_partition_tables(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DynamicDataSinkProxyInterface::r#wipe_partition_tables(self)
}
}
impl DynamicDataSinkProxyInterface for DynamicDataSinkProxy {
type ReadAssetResponseFut = fidl::client::QueryResponseFut<
DataSinkReadAssetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read_asset(
&self,
mut configuration: Configuration,
mut asset: Asset,
) -> Self::ReadAssetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadAssetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadAssetResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteAssetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WriteFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteFirmwareResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read_firmware(
&self,
mut configuration: Configuration,
mut type_: &str,
) -> Self::ReadFirmwareResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkReadFirmwareResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DataSinkReadFirmwareResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#write_volumes(
&self,
mut payload: fidl::endpoints::ClientEnd<PayloadStreamMarker>,
) -> Self::WriteVolumesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkWriteVolumesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write_opaque_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteOpaqueVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteOpaqueVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write_sparse_volume(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> Self::WriteSparseVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataSinkWriteSparseVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DataSinkFlushResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#initialize_partition_tables(&self) -> Self::InitializePartitionTablesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DynamicDataSinkInitializePartitionTablesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wipe_partition_tables(&self) -> Self::WipePartitionTablesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DynamicDataSinkWipePartitionTablesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x125a23e561007898 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DataSinkReadAssetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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#find_partition_table_manager(
&self,
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::MonotonicInstant,
) -> 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#find_partition_table_manager(
&self,
mut data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindPartitionTableManagerRequest>(
(data_sink,),
0x10991ecc6fb9f47b,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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#find_partition_table_manager(
&self,
mut data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error> {
PaverProxyInterface::r#find_partition_table_manager(self, 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#find_partition_table_manager(
&self,
mut data_sink: fidl::endpoints::ServerEnd<DynamicDataSinkMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PaverFindPartitionTableManagerRequest>(
(data_sink,),
0x10991ecc6fb9f47b,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x710a34c6f9c8a0e9 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
PaverFindDataSinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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 })
}
0x10991ecc6fb9f47b => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
PaverFindPartitionTableManagerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PaverFindPartitionTableManagerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PaverControlHandle { inner: this.inner.clone() };
Ok(PaverRequest::FindPartitionTableManager {
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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
FindPartitionTableManager {
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_find_partition_table_manager(
self,
) -> Option<(fidl::endpoints::ServerEnd<DynamicDataSinkMarker>, PaverControlHandle)> {
if let PaverRequest::FindPartitionTableManager { data_sink, control_handle } = self {
Some((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::FindPartitionTableManager { .. } => "find_partition_table_manager",
PaverRequest::FindBootManager { .. } => "find_boot_manager",
PaverRequest::FindSysconfig { .. } => "find_sysconfig",
}
}
}
#[derive(Debug, Clone)]
pub struct PaverControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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::MonotonicInstant,
) -> Result<PayloadStreamEvent, fidl::Error> {
PayloadStreamEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#register_vmo(
&self,
mut vmo: fidl::Vmo,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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, fidl::encoding::DefaultFuchsiaResourceDialect> {
PayloadStreamProxyInterface::r#register_vmo(self, vmo)
}
pub fn r#read_data(
&self,
) -> fidl::client::QueryResponseFut<ReadResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
PayloadStreamProxyInterface::r#read_data(self)
}
}
impl PayloadStreamProxyInterface for PayloadStreamProxy {
type RegisterVmoResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#register_vmo(&self, mut vmo: fidl::Vmo) -> Self::RegisterVmoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PayloadStreamRegisterVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#read_data(&self) -> Self::ReadDataResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ReadResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PayloadStreamReadDataResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x388d7fe44bcb4c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PayloadStreamRegisterVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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::MonotonicInstant,
) -> Result<SysconfigEvent, fidl::Error> {
SysconfigEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#read(
&self,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant) -> 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::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SysconfigProxyInterface::r#read(self)
}
pub fn r#write(
&self,
mut payload: fidl_fuchsia_mem::Buffer,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
SysconfigProxyInterface::r#write(self, payload)
}
pub fn r#get_partition_size(
&self,
) -> fidl::client::QueryResponseFut<
SysconfigGetPartitionSizeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SysconfigProxyInterface::r#get_partition_size(self)
}
pub fn r#flush(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
SysconfigProxyInterface::r#flush(self)
}
pub fn r#wipe(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
SysconfigProxyInterface::r#wipe(self)
}
}
impl SysconfigProxyInterface for SysconfigProxy {
type ReadResponseFut = fidl::client::QueryResponseFut<
SysconfigReadResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read(&self) -> Self::ReadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SysconfigReadResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SysconfigReadResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#write(&self, mut payload: fidl_fuchsia_mem::Buffer) -> Self::WriteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SysconfigWriteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_partition_size(&self) -> Self::GetPartitionSizeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SysconfigGetPartitionSizeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SysconfigGetPartitionSizeResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#flush(&self) -> Self::FlushResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SysconfigFlushResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wipe(&self) -> Self::WipeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SysconfigWipeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x350c317c53c226fc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = 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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Asset {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Asset {
#[inline(always)]
fn new_empty() -> Self {
Self::Kernel
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let 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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Configuration {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
#[inline(always)]
fn new_empty() -> Self {
Self::A
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let 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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ConfigurationStatus
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigurationStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::Healthy
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for UnbootableReason {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for UnbootableReason {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for UnbootableReason
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnbootableReason {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerFlushResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerFlushResponse, D> for &BootManagerFlushResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<BootManagerFlushResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerFlushResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerFlushResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusAndBootAttemptsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker
for BootManagerQueryConfigurationStatusAndBootAttemptsRequest
{
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>
for &BootManagerQueryConfigurationStatusAndBootAttemptsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(
offset,
);
fidl::encoding::Encode::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>::encode(
(
<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
),
encoder, offset, _depth
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsRequest, D>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsRequest>(
offset,
);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryConfigurationStatusAndBootAttemptsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest, D>
for &BootManagerQueryConfigurationStatusRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
fidl::encoding::Encode::<BootManagerQueryConfigurationStatusRequest, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryConfigurationStatusRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest, D>
for &BootManagerSetConfigurationActiveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
fidl::encoding::Encode::<BootManagerSetConfigurationActiveRequest, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerSetConfigurationActiveRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerSetConfigurationActiveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationActiveResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse, D>
for &BootManagerSetConfigurationActiveResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<BootManagerSetConfigurationActiveResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationActiveResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerSetConfigurationActiveResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest, D>
for &BootManagerSetConfigurationHealthyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
fidl::encoding::Encode::<BootManagerSetConfigurationHealthyRequest, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerSetConfigurationHealthyRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerSetConfigurationHealthyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationHealthyResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse, D>
for &BootManagerSetConfigurationHealthyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<BootManagerSetConfigurationHealthyResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationHealthyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerSetConfigurationHealthyResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest, D>
for &BootManagerSetConfigurationUnbootableRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
fidl::encoding::Encode::<BootManagerSetConfigurationUnbootableRequest, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerSetConfigurationUnbootableRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerSetConfigurationUnbootableRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerSetConfigurationUnbootableResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse, D>
for &BootManagerSetConfigurationUnbootableResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<BootManagerSetConfigurationUnbootableResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerSetConfigurationUnbootableResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerSetConfigurationUnbootableResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryActiveConfigurationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse, D>
for &BootManagerQueryActiveConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryActiveConfigurationResponse, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerQueryActiveConfigurationResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryActiveConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryActiveConfigurationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationLastSetActiveResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse, D>
for &BootManagerQueryConfigurationLastSetActiveResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryConfigurationLastSetActiveResponse, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerQueryConfigurationLastSetActiveResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationLastSetActiveResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryConfigurationLastSetActiveResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryConfigurationStatusResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse, D>
for &BootManagerQueryConfigurationStatusResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryConfigurationStatusResponse, D>::encode(
(<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ConfigurationStatus, D>,
> fidl::encoding::Encode<BootManagerQueryConfigurationStatusResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryConfigurationStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryConfigurationStatusResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(ConfigurationStatus, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ConfigurationStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BootManagerQueryCurrentConfigurationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse, D>
for &BootManagerQueryCurrentConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
fidl::encoding::Encode::<BootManagerQueryCurrentConfigurationResponse, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<BootManagerQueryCurrentConfigurationResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BootManagerQueryCurrentConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryCurrentConfigurationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { configuration: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DataSinkFlushResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DataSinkFlushResponse, D>
for &DataSinkFlushResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DataSinkFlushResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkFlushResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataSinkFlushResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DataSinkReadAssetRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DataSinkReadAssetRequest, D> for &DataSinkReadAssetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
fidl::encoding::Encode::<DataSinkReadAssetRequest, D>::encode(
(
<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.configuration),
<Asset as fidl::encoding::ValueTypeMarker>::borrow(&self.asset),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Configuration, D>,
T1: fidl::encoding::Encode<Asset, D>,
> fidl::encoding::Encode<DataSinkReadAssetRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadAssetRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DataSinkReadAssetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(Configuration, D),
asset: fidl::new_empty!(Asset, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.configuration, decoder, offset + 0, _depth)?;
fidl::decode!(Asset, D, &mut self.asset, decoder, offset + 4, _depth)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkReadFirmwareRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkReadFirmwareRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadFirmwareRequest>(offset);
fidl::encoding::Encode::<
DataSinkReadFirmwareRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::BoundedString<256>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkReadFirmwareRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkReadFirmwareRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(
Configuration,
fidl::encoding::DefaultFuchsiaResourceDialect
),
type_: fidl::new_empty!(
fidl::encoding::BoundedString<256>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.configuration,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<256>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.type_,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkWriteAssetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkWriteAssetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteAssetRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteAssetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<Asset, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkWriteAssetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteAssetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(
Configuration,
fidl::encoding::DefaultFuchsiaResourceDialect
),
asset: fidl::new_empty!(Asset, fidl::encoding::DefaultFuchsiaResourceDialect),
payload: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
Configuration,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.configuration,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Asset,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.asset,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DataSinkWriteAssetResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DataSinkWriteAssetResponse, D> for &DataSinkWriteAssetResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DataSinkWriteAssetResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteAssetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DataSinkWriteAssetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkWriteFirmwareRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkWriteFirmwareRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteFirmwareRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteFirmwareRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::BoundedString<256>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkWriteFirmwareRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteFirmwareRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
configuration: fidl::new_empty!(
Configuration,
fidl::encoding::DefaultFuchsiaResourceDialect
),
type_: fidl::new_empty!(
fidl::encoding::BoundedString<256>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
payload: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.configuration,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<256>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.type_,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DataSinkWriteFirmwareResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DataSinkWriteFirmwareResponse, D>
for &DataSinkWriteFirmwareResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
fidl::encoding::Encode::<DataSinkWriteFirmwareResponse, D>::encode(
(<WriteFirmwareResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<WriteFirmwareResult, D>,
> fidl::encoding::Encode<DataSinkWriteFirmwareResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteFirmwareResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DataSinkWriteFirmwareResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(WriteFirmwareResult, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(WriteFirmwareResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkWriteOpaqueVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkWriteOpaqueVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteOpaqueVolumeRequest>(offset);
fidl::encoding::Encode::<
DataSinkWriteOpaqueVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkWriteOpaqueVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteOpaqueVolumeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkWriteSparseVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkWriteSparseVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteSparseVolumeRequest>(offset);
fidl::encoding::Encode::<
DataSinkWriteSparseVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkWriteSparseVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteSparseVolumeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkWriteVolumesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkWriteVolumesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteVolumesRequest>(offset);
fidl::encoding::Encode::<DataSinkWriteVolumesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkWriteVolumesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkWriteVolumesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<PayloadStreamMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<PayloadStreamMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DataSinkWriteVolumesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DataSinkWriteVolumesResponse, D> for &DataSinkWriteVolumesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DataSinkWriteVolumesResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkWriteVolumesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DataSinkWriteVolumesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::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::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
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkReadAssetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkReadAssetResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadAssetResponse>(offset);
fidl::encoding::Encode::<
DataSinkReadAssetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.asset,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkReadAssetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadAssetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkReadAssetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
asset: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.asset,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DataSinkReadFirmwareResponse {
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::TypeMarker for DataSinkReadFirmwareResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
DataSinkReadFirmwareResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataSinkReadFirmwareResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadFirmwareResponse>(offset);
fidl::encoding::Encode::<
DataSinkReadFirmwareResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.firmware,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DataSinkReadFirmwareResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DataSinkReadFirmwareResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataSinkReadFirmwareResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
firmware: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.firmware,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DynamicDataSinkInitializePartitionTablesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DynamicDataSinkInitializePartitionTablesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DynamicDataSinkInitializePartitionTablesResponse, D>
for &DynamicDataSinkInitializePartitionTablesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DynamicDataSinkInitializePartitionTablesResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DynamicDataSinkInitializePartitionTablesResponse).write_unaligned(
(self as *const DynamicDataSinkInitializePartitionTablesResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DynamicDataSinkInitializePartitionTablesResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DynamicDataSinkInitializePartitionTablesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DynamicDataSinkInitializePartitionTablesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DynamicDataSinkWipePartitionTablesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DynamicDataSinkWipePartitionTablesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DynamicDataSinkWipePartitionTablesResponse, D>
for &DynamicDataSinkWipePartitionTablesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DynamicDataSinkWipePartitionTablesResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DynamicDataSinkWipePartitionTablesResponse).write_unaligned(
(self as *const DynamicDataSinkWipePartitionTablesResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DynamicDataSinkWipePartitionTablesResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DynamicDataSinkWipePartitionTablesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DynamicDataSinkWipePartitionTablesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PaverFindBootManagerRequest {
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::TypeMarker for PaverFindBootManagerRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
PaverFindBootManagerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PaverFindBootManagerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindBootManagerRequest>(offset);
fidl::encoding::Encode::<PaverFindBootManagerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BootManagerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.boot_manager),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BootManagerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PaverFindBootManagerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindBootManagerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PaverFindBootManagerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
boot_manager: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BootManagerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BootManagerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.boot_manager,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PaverFindDataSinkRequest {
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::TypeMarker for PaverFindDataSinkRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
PaverFindDataSinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PaverFindDataSinkRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindDataSinkRequest>(offset);
fidl::encoding::Encode::<PaverFindDataSinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DataSinkMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data_sink),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DataSinkMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PaverFindDataSinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindDataSinkRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PaverFindDataSinkRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
data_sink: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DataSinkMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DataSinkMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.data_sink,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PaverFindPartitionTableManagerRequest {
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::TypeMarker for PaverFindPartitionTableManagerRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
PaverFindPartitionTableManagerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PaverFindPartitionTableManagerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindPartitionTableManagerRequest>(offset);
fidl::encoding::Encode::<PaverFindPartitionTableManagerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DynamicDataSinkMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data_sink),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DynamicDataSinkMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PaverFindPartitionTableManagerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindPartitionTableManagerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PaverFindPartitionTableManagerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
data_sink: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DynamicDataSinkMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DynamicDataSinkMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.data_sink,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PaverFindSysconfigRequest {
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::TypeMarker for PaverFindSysconfigRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
PaverFindSysconfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PaverFindSysconfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindSysconfigRequest>(offset);
fidl::encoding::Encode::<PaverFindSysconfigRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SysconfigMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.sysconfig),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SysconfigMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PaverFindSysconfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PaverFindSysconfigRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PaverFindSysconfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
sysconfig: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SysconfigMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SysconfigMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.sysconfig,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PayloadStreamReadDataResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PayloadStreamReadDataResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PayloadStreamReadDataResponse, D>
for &PayloadStreamReadDataResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PayloadStreamReadDataResponse>(offset);
fidl::encoding::Encode::<PayloadStreamReadDataResponse, D>::encode(
(<ReadResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ReadResult, D>>
fidl::encoding::Encode<PayloadStreamReadDataResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PayloadStreamReadDataResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PayloadStreamReadDataResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(ReadResult, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ReadResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PayloadStreamRegisterVmoRequest {
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::TypeMarker for PayloadStreamRegisterVmoRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
PayloadStreamRegisterVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PayloadStreamRegisterVmoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PayloadStreamRegisterVmoRequest>(offset);
fidl::encoding::Encode::<
PayloadStreamRegisterVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vmo
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PayloadStreamRegisterVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PayloadStreamRegisterVmoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PayloadStreamRegisterVmoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PayloadStreamRegisterVmoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PayloadStreamRegisterVmoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PayloadStreamRegisterVmoResponse, D>
for &PayloadStreamRegisterVmoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PayloadStreamRegisterVmoResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut PayloadStreamRegisterVmoResponse)
.write_unaligned((self as *const PayloadStreamRegisterVmoResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<PayloadStreamRegisterVmoResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PayloadStreamRegisterVmoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PayloadStreamRegisterVmoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ReadInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ReadInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadInfo, D> for &ReadInfo {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ReadInfo).write_unaligned((self as *const ReadInfo).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<ReadInfo, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadInfo {
#[inline(always)]
fn new_empty() -> Self {
Self { offset: fidl::new_empty!(u64, D), size: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SysconfigFlushResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SysconfigFlushResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SysconfigFlushResponse, D> for &SysconfigFlushResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigFlushResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SysconfigFlushResponse)
.write_unaligned((self as *const SysconfigFlushResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<SysconfigFlushResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigFlushResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SysconfigFlushResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SysconfigWipeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SysconfigWipeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SysconfigWipeResponse, D>
for &SysconfigWipeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigWipeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SysconfigWipeResponse)
.write_unaligned((self as *const SysconfigWipeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<SysconfigWipeResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigWipeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SysconfigWipeResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SysconfigWriteRequest {
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::TypeMarker for SysconfigWriteRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<SysconfigWriteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut SysconfigWriteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigWriteRequest>(offset);
fidl::encoding::Encode::<
SysconfigWriteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<SysconfigWriteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigWriteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SysconfigWriteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SysconfigWriteResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SysconfigWriteResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SysconfigWriteResponse, D> for &SysconfigWriteResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigWriteResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SysconfigWriteResponse)
.write_unaligned((self as *const SysconfigWriteResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<SysconfigWriteResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigWriteResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SysconfigWriteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SysconfigGetPartitionSizeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SysconfigGetPartitionSizeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SysconfigGetPartitionSizeResponse, D>
for &SysconfigGetPartitionSizeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigGetPartitionSizeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SysconfigGetPartitionSizeResponse)
.write_unaligned((self as *const SysconfigGetPartitionSizeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<SysconfigGetPartitionSizeResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigGetPartitionSizeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SysconfigGetPartitionSizeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { size: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SysconfigReadResponse {
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::TypeMarker for SysconfigReadResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<SysconfigReadResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut SysconfigReadResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigReadResponse>(offset);
fidl::encoding::Encode::<
SysconfigReadResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<SysconfigReadResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SysconfigReadResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SysconfigReadResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
data: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.data,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl BootManagerQueryConfigurationStatusAndBootAttemptsResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.unbootable_reason {
return 3;
}
if let Some(_) = self.boot_attempts {
return 2;
}
if let Some(_) = self.status {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker
for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
{
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker
for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
{
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BootManagerQueryConfigurationStatusAndBootAttemptsResponse, D>
for &BootManagerQueryConfigurationStatusAndBootAttemptsResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<BootManagerQueryConfigurationStatusAndBootAttemptsResponse>(
offset,
);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<ConfigurationStatus, D>(
self.status
.as_ref()
.map(<ConfigurationStatus as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.boot_attempts.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<UnbootableReason, D>(
self.unbootable_reason
.as_ref()
.map(<UnbootableReason as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BootManagerQueryConfigurationStatusAndBootAttemptsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<ConfigurationStatus as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.status.get_or_insert_with(|| fidl::new_empty!(ConfigurationStatus, D));
fidl::decode!(ConfigurationStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.boot_attempts.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<UnbootableReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.unbootable_reason
.get_or_insert_with(|| fidl::new_empty!(UnbootableReason, D));
fidl::decode!(UnbootableReason, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ReadResult {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ReadResult {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadResult, D>
for &ReadResult
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadResult>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ReadResult::Err(ref val) => fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ReadResult::Eof(ref val) => fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
ReadResult::Info(ref val) => fidl::encoding::encode_in_envelope::<ReadInfo, D>(
<ReadInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadResult {
#[inline(always)]
fn new_empty() -> Self {
Self::Err(fidl::new_empty!(i32, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <ReadInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ReadResult::Err(_) = self {
} else {
*self = ReadResult::Err(fidl::new_empty!(i32, D));
}
#[allow(irrefutable_let_patterns)]
if let ReadResult::Err(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ReadResult::Eof(_) = self {
} else {
*self = ReadResult::Eof(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let ReadResult::Eof(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let ReadResult::Info(_) = self {
} else {
*self = ReadResult::Info(fidl::new_empty!(ReadInfo, D));
}
#[allow(irrefutable_let_patterns)]
if let ReadResult::Info(ref mut val) = self {
fidl::decode!(ReadInfo, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WriteFirmwareResult {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WriteFirmwareResult {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WriteFirmwareResult, D>
for &WriteFirmwareResult
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WriteFirmwareResult>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
WriteFirmwareResult::Status(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
WriteFirmwareResult::Unsupported(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WriteFirmwareResult {
#[inline(always)]
fn new_empty() -> Self {
Self::Status(fidl::new_empty!(i32, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let WriteFirmwareResult::Status(_) = self {
} else {
*self = WriteFirmwareResult::Status(fidl::new_empty!(i32, D));
}
#[allow(irrefutable_let_patterns)]
if let WriteFirmwareResult::Status(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let WriteFirmwareResult::Unsupported(_) = self {
} else {
*self = WriteFirmwareResult::Unsupported(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let WriteFirmwareResult::Unsupported(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}