#![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_CONNECT_MATCHES: u16 = 5;
pub const MAX_NUM_MATCHES: u16 = 250;
pub const NODE_NAME_MAX: u32 = 255;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum CompatibilityState {
Error,
Absent,
Supported,
Unknown,
Unsupported,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! CompatibilityStateUnknown {
() => {
_
};
}
impl CompatibilityState {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Error),
1 => Some(Self::Absent),
2 => Some(Self::Supported),
3 => Some(Self::Unknown),
4 => Some(Self::Unsupported),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
0 => Self::Error,
1 => Self::Absent,
2 => Self::Supported,
3 => Self::Unknown,
4 => Self::Unsupported,
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::Error => 0,
Self::Absent => 1,
Self::Supported => 2,
Self::Unknown => 3,
Self::Unsupported => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ConnectCapabilityError {
InvalidMoniker,
NoMatchingCapabilities,
NoMatchingComponent,
CapabilityConnectFailed,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! ConnectCapabilityErrorUnknown {
() => {
_
};
}
impl ConnectCapabilityError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InvalidMoniker),
2 => Some(Self::NoMatchingCapabilities),
3 => Some(Self::NoMatchingComponent),
4 => Some(Self::CapabilityConnectFailed),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InvalidMoniker,
2 => Self::NoMatchingCapabilities,
3 => Self::NoMatchingComponent,
4 => Self::CapabilityConnectFailed,
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::InvalidMoniker => 1,
Self::NoMatchingCapabilities => 2,
Self::NoMatchingComponent => 3,
Self::CapabilityConnectFailed => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum IdentifyHostError {
ListInterfacesFailed,
GetDeviceNameFailed,
ProxyConnectionFailed,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! IdentifyHostErrorUnknown {
() => {
_
};
}
impl IdentifyHostError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::ListInterfacesFailed),
2 => Some(Self::GetDeviceNameFailed),
3 => Some(Self::ProxyConnectionFailed),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::ListInterfacesFailed,
2 => Self::GetDeviceNameFailed,
3 => Self::ProxyConnectionFailed,
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::ListInterfacesFailed => 1,
Self::GetDeviceNameFailed => 2,
Self::ProxyConnectionFailed => 3,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum TunnelError {
ConnectFailed,
SocketFailed,
CallbackError,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! TunnelErrorUnknown {
() => {
_
};
}
impl TunnelError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::ConnectFailed),
2 => Some(Self::SocketFailed),
3 => Some(Self::CallbackError),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::ConnectFailed,
2 => Self::SocketFailed,
3 => Self::CallbackError,
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::ConnectFailed => 1,
Self::SocketFailed => 2,
Self::CallbackError => 3,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CompatibilityInfo {
pub state: CompatibilityState,
pub platform_abi: u64,
pub message: String,
}
impl fidl::Persistable for CompatibilityInfo {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RemoteControlConnectCapabilityRequest {
pub moniker: String,
pub capability_set: fidl_fuchsia_sys2::OpenDirType,
pub capability_name: String,
pub server_channel: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for RemoteControlConnectCapabilityRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RemoteControlDeprecatedOpenCapabilityRequest {
pub moniker: String,
pub capability_set: fidl_fuchsia_sys2::OpenDirType,
pub capability_name: String,
pub server_channel: fidl::Channel,
pub flags: fidl_fuchsia_io::OpenFlags,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for RemoteControlDeprecatedOpenCapabilityRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RemoteControlEchoStringRequest {
pub value: String,
}
impl fidl::Persistable for RemoteControlEchoStringRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RemoteControlEchoStringResponse {
pub response: String,
}
impl fidl::Persistable for RemoteControlEchoStringResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RemoteControlGetBootTimeResponse {
pub time: fidl::BootInstant,
}
impl fidl::Persistable for RemoteControlGetBootTimeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RemoteControlGetTimeResponse {
pub time: fidl::MonotonicInstant,
}
impl fidl::Persistable for RemoteControlGetTimeResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RemoteControlLogMessageRequest {
pub tag: String,
pub message: String,
pub severity: fidl_fuchsia_diagnostics::Severity,
}
impl fidl::Persistable for RemoteControlLogMessageRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct RemoteControlIdentifyHostResponse {
pub response: IdentifyHostResponse,
}
impl fidl::Persistable for RemoteControlIdentifyHostResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct IdentifyHostResponse {
pub nodename: Option<String>,
pub boot_timestamp_nanos: Option<u64>,
pub serial_number: Option<String>,
pub ids: Option<Vec<u64>>,
pub product_config: Option<String>,
pub board_config: Option<String>,
pub addresses: Option<Vec<fidl_fuchsia_net::Subnet>>,
pub boot_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for IdentifyHostResponse {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RemoteControlMarker;
impl fidl::endpoints::ProtocolMarker for RemoteControlMarker {
type Proxy = RemoteControlProxy;
type RequestStream = RemoteControlRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RemoteControlSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.developer.remotecontrol.RemoteControl";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RemoteControlMarker {}
pub type RemoteControlIdentifyHostResult = Result<IdentifyHostResponse, IdentifyHostError>;
pub type RemoteControlConnectCapabilityResult = Result<(), ConnectCapabilityError>;
pub type RemoteControlDeprecatedOpenCapabilityResult = Result<(), ConnectCapabilityError>;
pub trait RemoteControlProxyInterface: Send + Sync {
type EchoStringResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
fn r#echo_string(&self, value: &str) -> Self::EchoStringResponseFut;
type LogMessageResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#log_message(
&self,
tag: &str,
message: &str,
severity: fidl_fuchsia_diagnostics::Severity,
) -> Self::LogMessageResponseFut;
type IdentifyHostResponseFut: std::future::Future<Output = Result<RemoteControlIdentifyHostResult, fidl::Error>>
+ Send;
fn r#identify_host(&self) -> Self::IdentifyHostResponseFut;
type ConnectCapabilityResponseFut: std::future::Future<Output = Result<RemoteControlConnectCapabilityResult, fidl::Error>>
+ Send;
fn r#connect_capability(
&self,
moniker: &str,
capability_set: fidl_fuchsia_sys2::OpenDirType,
capability_name: &str,
server_channel: fidl::Channel,
) -> Self::ConnectCapabilityResponseFut;
type GetTimeResponseFut: std::future::Future<Output = Result<fidl::MonotonicInstant, fidl::Error>>
+ Send;
fn r#get_time(&self) -> Self::GetTimeResponseFut;
type GetBootTimeResponseFut: std::future::Future<Output = Result<fidl::BootInstant, fidl::Error>>
+ Send;
fn r#get_boot_time(&self) -> Self::GetBootTimeResponseFut;
type DeprecatedOpenCapabilityResponseFut: std::future::Future<
Output = Result<RemoteControlDeprecatedOpenCapabilityResult, fidl::Error>,
> + Send;
fn r#deprecated_open_capability(
&self,
moniker: &str,
capability_set: fidl_fuchsia_sys2::OpenDirType,
capability_name: &str,
server_channel: fidl::Channel,
flags: fidl_fuchsia_io::OpenFlags,
) -> Self::DeprecatedOpenCapabilityResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RemoteControlSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RemoteControlSynchronousProxy {
type Proxy = RemoteControlProxy;
type Protocol = RemoteControlMarker;
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 RemoteControlSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RemoteControlMarker 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<RemoteControlEvent, fidl::Error> {
RemoteControlEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#echo_string(
&self,
mut value: &str,
___deadline: zx::MonotonicInstant,
) -> Result<String, fidl::Error> {
let _response = self
.client
.send_query::<RemoteControlEchoStringRequest, RemoteControlEchoStringResponse>(
(value,),
0x2bbec7ca8a72e82b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.response)
}
pub fn r#log_message(
&self,
mut tag: &str,
mut message: &str,
mut severity: fidl_fuchsia_diagnostics::Severity,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self
.client
.send_query::<RemoteControlLogMessageRequest, fidl::encoding::EmptyPayload>(
(tag, message, severity),
0x3da84acd5bbf3926,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#identify_host(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<RemoteControlIdentifyHostResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
RemoteControlIdentifyHostResponse,
IdentifyHostError,
>>(
(), 0x6035e1ab368deee1, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
)?
.into_result::<RemoteControlMarker>("identify_host")?;
Ok(_response.map(|x| x.response))
}
pub fn r#connect_capability(
&self,
mut moniker: &str,
mut capability_set: fidl_fuchsia_sys2::OpenDirType,
mut capability_name: &str,
mut server_channel: fidl::Channel,
___deadline: zx::MonotonicInstant,
) -> Result<RemoteControlConnectCapabilityResult, fidl::Error> {
let _response = self.client.send_query::<
RemoteControlConnectCapabilityRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConnectCapabilityError>,
>(
(moniker, capability_set, capability_name, server_channel,),
0x3ae7a7c874dceceb,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<RemoteControlMarker>("connect_capability")?;
Ok(_response.map(|x| x))
}
pub fn r#get_time(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::MonotonicInstant, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, RemoteControlGetTimeResponse>(
(),
0x3588f31e9067748d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.time)
}
pub fn r#get_boot_time(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::BootInstant, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, RemoteControlGetBootTimeResponse>(
(),
0x55706f013cd79ebd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.time)
}
pub fn r#deprecated_open_capability(
&self,
mut moniker: &str,
mut capability_set: fidl_fuchsia_sys2::OpenDirType,
mut capability_name: &str,
mut server_channel: fidl::Channel,
mut flags: fidl_fuchsia_io::OpenFlags,
___deadline: zx::MonotonicInstant,
) -> Result<RemoteControlDeprecatedOpenCapabilityResult, fidl::Error> {
let _response = self.client.send_query::<
RemoteControlDeprecatedOpenCapabilityRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConnectCapabilityError>,
>(
(moniker, capability_set, capability_name, server_channel, flags,),
0x51b5801f3e27e431,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<RemoteControlMarker>("deprecated_open_capability")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct RemoteControlProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RemoteControlProxy {
type Protocol = RemoteControlMarker;
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 RemoteControlProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RemoteControlEventStream {
RemoteControlEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#echo_string(
&self,
mut value: &str,
) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
RemoteControlProxyInterface::r#echo_string(self, value)
}
pub fn r#log_message(
&self,
mut tag: &str,
mut message: &str,
mut severity: fidl_fuchsia_diagnostics::Severity,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RemoteControlProxyInterface::r#log_message(self, tag, message, severity)
}
pub fn r#identify_host(
&self,
) -> fidl::client::QueryResponseFut<
RemoteControlIdentifyHostResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RemoteControlProxyInterface::r#identify_host(self)
}
pub fn r#connect_capability(
&self,
mut moniker: &str,
mut capability_set: fidl_fuchsia_sys2::OpenDirType,
mut capability_name: &str,
mut server_channel: fidl::Channel,
) -> fidl::client::QueryResponseFut<
RemoteControlConnectCapabilityResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RemoteControlProxyInterface::r#connect_capability(
self,
moniker,
capability_set,
capability_name,
server_channel,
)
}
pub fn r#get_time(
&self,
) -> fidl::client::QueryResponseFut<
fidl::MonotonicInstant,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RemoteControlProxyInterface::r#get_time(self)
}
pub fn r#get_boot_time(
&self,
) -> fidl::client::QueryResponseFut<
fidl::BootInstant,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RemoteControlProxyInterface::r#get_boot_time(self)
}
pub fn r#deprecated_open_capability(
&self,
mut moniker: &str,
mut capability_set: fidl_fuchsia_sys2::OpenDirType,
mut capability_name: &str,
mut server_channel: fidl::Channel,
mut flags: fidl_fuchsia_io::OpenFlags,
) -> fidl::client::QueryResponseFut<
RemoteControlDeprecatedOpenCapabilityResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RemoteControlProxyInterface::r#deprecated_open_capability(
self,
moniker,
capability_set,
capability_name,
server_channel,
flags,
)
}
}
impl RemoteControlProxyInterface for RemoteControlProxy {
type EchoStringResponseFut =
fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#echo_string(&self, mut value: &str) -> Self::EchoStringResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<String, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RemoteControlEchoStringResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2bbec7ca8a72e82b,
>(_buf?)?;
Ok(_response.response)
}
self.client.send_query_and_decode::<RemoteControlEchoStringRequest, String>(
(value,),
0x2bbec7ca8a72e82b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type LogMessageResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#log_message(
&self,
mut tag: &str,
mut message: &str,
mut severity: fidl_fuchsia_diagnostics::Severity,
) -> Self::LogMessageResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3da84acd5bbf3926,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<RemoteControlLogMessageRequest, ()>(
(tag, message, severity),
0x3da84acd5bbf3926,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type IdentifyHostResponseFut = fidl::client::QueryResponseFut<
RemoteControlIdentifyHostResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#identify_host(&self) -> Self::IdentifyHostResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RemoteControlIdentifyHostResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
RemoteControlIdentifyHostResponse,
IdentifyHostError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6035e1ab368deee1,
>(_buf?)?
.into_result::<RemoteControlMarker>("identify_host")?;
Ok(_response.map(|x| x.response))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, RemoteControlIdentifyHostResult>(
(),
0x6035e1ab368deee1,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ConnectCapabilityResponseFut = fidl::client::QueryResponseFut<
RemoteControlConnectCapabilityResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#connect_capability(
&self,
mut moniker: &str,
mut capability_set: fidl_fuchsia_sys2::OpenDirType,
mut capability_name: &str,
mut server_channel: fidl::Channel,
) -> Self::ConnectCapabilityResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RemoteControlConnectCapabilityResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConnectCapabilityError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3ae7a7c874dceceb,
>(_buf?)?
.into_result::<RemoteControlMarker>("connect_capability")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
RemoteControlConnectCapabilityRequest,
RemoteControlConnectCapabilityResult,
>(
(moniker, capability_set, capability_name, server_channel,),
0x3ae7a7c874dceceb,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type GetTimeResponseFut = fidl::client::QueryResponseFut<
fidl::MonotonicInstant,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_time(&self) -> Self::GetTimeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::MonotonicInstant, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RemoteControlGetTimeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3588f31e9067748d,
>(_buf?)?;
Ok(_response.time)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::MonotonicInstant>(
(),
0x3588f31e9067748d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBootTimeResponseFut = fidl::client::QueryResponseFut<
fidl::BootInstant,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_boot_time(&self) -> Self::GetBootTimeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::BootInstant, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RemoteControlGetBootTimeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x55706f013cd79ebd,
>(_buf?)?;
Ok(_response.time)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::BootInstant>(
(),
0x55706f013cd79ebd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DeprecatedOpenCapabilityResponseFut = fidl::client::QueryResponseFut<
RemoteControlDeprecatedOpenCapabilityResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#deprecated_open_capability(
&self,
mut moniker: &str,
mut capability_set: fidl_fuchsia_sys2::OpenDirType,
mut capability_name: &str,
mut server_channel: fidl::Channel,
mut flags: fidl_fuchsia_io::OpenFlags,
) -> Self::DeprecatedOpenCapabilityResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RemoteControlDeprecatedOpenCapabilityResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConnectCapabilityError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x51b5801f3e27e431,
>(_buf?)?
.into_result::<RemoteControlMarker>("deprecated_open_capability")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
RemoteControlDeprecatedOpenCapabilityRequest,
RemoteControlDeprecatedOpenCapabilityResult,
>(
(moniker, capability_set, capability_name, server_channel, flags,),
0x51b5801f3e27e431,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct RemoteControlEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RemoteControlEventStream {}
impl futures::stream::FusedStream for RemoteControlEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RemoteControlEventStream {
type Item = Result<RemoteControlEvent, 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(RemoteControlEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RemoteControlEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl RemoteControlEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RemoteControlEvent, 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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(RemoteControlEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RemoteControlRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RemoteControlRequestStream {}
impl futures::stream::FusedStream for RemoteControlRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RemoteControlRequestStream {
type Protocol = RemoteControlMarker;
type ControlHandle = RemoteControlControlHandle;
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 {
RemoteControlControlHandle { 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 RemoteControlRequestStream {
type Item = Result<RemoteControlRequest, 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 RemoteControlRequestStream 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 {
0x2bbec7ca8a72e82b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RemoteControlEchoStringRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlEchoStringRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::EchoString {
value: req.value,
responder: RemoteControlEchoStringResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3da84acd5bbf3926 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RemoteControlLogMessageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlLogMessageRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::LogMessage {
tag: req.tag,
message: req.message,
severity: req.severity,
responder: RemoteControlLogMessageResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6035e1ab368deee1 => {
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 =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::IdentifyHost {
responder: RemoteControlIdentifyHostResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3ae7a7c874dceceb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RemoteControlConnectCapabilityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlConnectCapabilityRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::ConnectCapability {
moniker: req.moniker,
capability_set: req.capability_set,
capability_name: req.capability_name,
server_channel: req.server_channel,
responder: RemoteControlConnectCapabilityResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3588f31e9067748d => {
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 =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::GetTime {
responder: RemoteControlGetTimeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x55706f013cd79ebd => {
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 =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::GetBootTime {
responder: RemoteControlGetBootTimeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x51b5801f3e27e431 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RemoteControlDeprecatedOpenCapabilityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlDeprecatedOpenCapabilityRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RemoteControlControlHandle { inner: this.inner.clone() };
Ok(RemoteControlRequest::DeprecatedOpenCapability {
moniker: req.moniker,
capability_set: req.capability_set,
capability_name: req.capability_name,
server_channel: req.server_channel,
flags: req.flags,
responder: RemoteControlDeprecatedOpenCapabilityResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(RemoteControlRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: RemoteControlControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(RemoteControlRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: RemoteControlControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RemoteControlRequest {
EchoString {
value: String,
responder: RemoteControlEchoStringResponder,
},
LogMessage {
tag: String,
message: String,
severity: fidl_fuchsia_diagnostics::Severity,
responder: RemoteControlLogMessageResponder,
},
IdentifyHost {
responder: RemoteControlIdentifyHostResponder,
},
ConnectCapability {
moniker: String,
capability_set: fidl_fuchsia_sys2::OpenDirType,
capability_name: String,
server_channel: fidl::Channel,
responder: RemoteControlConnectCapabilityResponder,
},
GetTime {
responder: RemoteControlGetTimeResponder,
},
GetBootTime {
responder: RemoteControlGetBootTimeResponder,
},
DeprecatedOpenCapability {
moniker: String,
capability_set: fidl_fuchsia_sys2::OpenDirType,
capability_name: String,
server_channel: fidl::Channel,
flags: fidl_fuchsia_io::OpenFlags,
responder: RemoteControlDeprecatedOpenCapabilityResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: RemoteControlControlHandle,
method_type: fidl::MethodType,
},
}
impl RemoteControlRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_echo_string(self) -> Option<(String, RemoteControlEchoStringResponder)> {
if let RemoteControlRequest::EchoString { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_log_message(
self,
) -> Option<(
String,
String,
fidl_fuchsia_diagnostics::Severity,
RemoteControlLogMessageResponder,
)> {
if let RemoteControlRequest::LogMessage { tag, message, severity, responder } = self {
Some((tag, message, severity, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_identify_host(self) -> Option<(RemoteControlIdentifyHostResponder)> {
if let RemoteControlRequest::IdentifyHost { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_capability(
self,
) -> Option<(
String,
fidl_fuchsia_sys2::OpenDirType,
String,
fidl::Channel,
RemoteControlConnectCapabilityResponder,
)> {
if let RemoteControlRequest::ConnectCapability {
moniker,
capability_set,
capability_name,
server_channel,
responder,
} = self
{
Some((moniker, capability_set, capability_name, server_channel, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_time(self) -> Option<(RemoteControlGetTimeResponder)> {
if let RemoteControlRequest::GetTime { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_boot_time(self) -> Option<(RemoteControlGetBootTimeResponder)> {
if let RemoteControlRequest::GetBootTime { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_deprecated_open_capability(
self,
) -> Option<(
String,
fidl_fuchsia_sys2::OpenDirType,
String,
fidl::Channel,
fidl_fuchsia_io::OpenFlags,
RemoteControlDeprecatedOpenCapabilityResponder,
)> {
if let RemoteControlRequest::DeprecatedOpenCapability {
moniker,
capability_set,
capability_name,
server_channel,
flags,
responder,
} = self
{
Some((moniker, capability_set, capability_name, server_channel, flags, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RemoteControlRequest::EchoString { .. } => "echo_string",
RemoteControlRequest::LogMessage { .. } => "log_message",
RemoteControlRequest::IdentifyHost { .. } => "identify_host",
RemoteControlRequest::ConnectCapability { .. } => "connect_capability",
RemoteControlRequest::GetTime { .. } => "get_time",
RemoteControlRequest::GetBootTime { .. } => "get_boot_time",
RemoteControlRequest::DeprecatedOpenCapability { .. } => "deprecated_open_capability",
RemoteControlRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
RemoteControlRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct RemoteControlControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RemoteControlControlHandle {
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 RemoteControlControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlEchoStringResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlEchoStringResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlEchoStringResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlEchoStringResponder {
pub fn send(self, mut response: &str) -> Result<(), fidl::Error> {
let _result = self.send_raw(response);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut response: &str) -> Result<(), fidl::Error> {
let _result = self.send_raw(response);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut response: &str) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RemoteControlEchoStringResponse>(
(response,),
self.tx_id,
0x2bbec7ca8a72e82b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlLogMessageResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlLogMessageResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlLogMessageResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlLogMessageResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x3da84acd5bbf3926,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlIdentifyHostResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlIdentifyHostResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlIdentifyHostResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlIdentifyHostResponder {
pub fn send(
self,
mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
) -> 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<&IdentifyHostResponse, IdentifyHostError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
RemoteControlIdentifyHostResponse,
IdentifyHostError,
>>(
fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
self.tx_id,
0x6035e1ab368deee1,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlConnectCapabilityResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlConnectCapabilityResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlConnectCapabilityResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlConnectCapabilityResponder {
pub fn send(self, mut result: Result<(), ConnectCapabilityError>) -> 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<(), ConnectCapabilityError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConnectCapabilityError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x3ae7a7c874dceceb,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlGetTimeResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlGetTimeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlGetTimeResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlGetTimeResponder {
pub fn send(self, mut time: fidl::MonotonicInstant) -> Result<(), fidl::Error> {
let _result = self.send_raw(time);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut time: fidl::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(time);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut time: fidl::MonotonicInstant) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RemoteControlGetTimeResponse>(
(time,),
self.tx_id,
0x3588f31e9067748d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlGetBootTimeResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlGetBootTimeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlGetBootTimeResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlGetBootTimeResponder {
pub fn send(self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
let _result = self.send_raw(time);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
let _result = self.send_raw(time);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RemoteControlGetBootTimeResponse>(
(time,),
self.tx_id,
0x55706f013cd79ebd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RemoteControlDeprecatedOpenCapabilityResponder {
control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RemoteControlDeprecatedOpenCapabilityResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RemoteControlDeprecatedOpenCapabilityResponder {
type ControlHandle = RemoteControlControlHandle;
fn control_handle(&self) -> &RemoteControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RemoteControlDeprecatedOpenCapabilityResponder {
pub fn send(self, mut result: Result<(), ConnectCapabilityError>) -> 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<(), ConnectCapabilityError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConnectCapabilityError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x51b5801f3e27e431,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for CompatibilityState {
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 CompatibilityState {
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 CompatibilityState
{
#[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 CompatibilityState {
#[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(())
}
}
unsafe impl fidl::encoding::TypeMarker for ConnectCapabilityError {
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 ConnectCapabilityError {
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 ConnectCapabilityError
{
#[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 ConnectCapabilityError
{
#[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(())
}
}
unsafe impl fidl::encoding::TypeMarker for IdentifyHostError {
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 IdentifyHostError {
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 IdentifyHostError
{
#[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 IdentifyHostError {
#[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(())
}
}
unsafe impl fidl::encoding::TypeMarker for TunnelError {
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 TunnelError {
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 TunnelError {
#[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 TunnelError {
#[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 CompatibilityInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompatibilityInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CompatibilityInfo, D>
for &CompatibilityInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompatibilityInfo>(offset);
fidl::encoding::Encode::<CompatibilityInfo, D>::encode(
(
<CompatibilityState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.platform_abi),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.message,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<CompatibilityState, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<CompatibilityInfo, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompatibilityInfo>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompatibilityInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
state: fidl::new_empty!(CompatibilityState, D),
platform_abi: fidl::new_empty!(u64, D),
message: fidl::new_empty!(fidl::encoding::UnboundedString, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(CompatibilityState, D, &mut self.state, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.platform_abi, decoder, offset + 8, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.message,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RemoteControlConnectCapabilityRequest {
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 RemoteControlConnectCapabilityRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl
fidl::encoding::Encode<
RemoteControlConnectCapabilityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RemoteControlConnectCapabilityRequest
{
#[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::<RemoteControlConnectCapabilityRequest>(offset);
fidl::encoding::Encode::<RemoteControlConnectCapabilityRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl_fuchsia_sys2::OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_set),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_name),
<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_channel),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_sys2::OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RemoteControlConnectCapabilityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3)
{
#[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::<RemoteControlConnectCapabilityRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RemoteControlConnectCapabilityRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
capability_set: fidl::new_empty!(
fidl_fuchsia_sys2::OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
capability_name: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
server_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
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 + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_sys2::OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.capability_set,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.capability_name,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_channel, decoder, offset + 40, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RemoteControlDeprecatedOpenCapabilityRequest {
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 RemoteControlDeprecatedOpenCapabilityRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl
fidl::encoding::Encode<
RemoteControlDeprecatedOpenCapabilityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RemoteControlDeprecatedOpenCapabilityRequest
{
#[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::<RemoteControlDeprecatedOpenCapabilityRequest>(offset);
fidl::encoding::Encode::<RemoteControlDeprecatedOpenCapabilityRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl_fuchsia_sys2::OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_set),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_name),
<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_channel),
<fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_sys2::OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T4: fidl::encoding::Encode<
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RemoteControlDeprecatedOpenCapabilityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3, T4)
{
#[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::<RemoteControlDeprecatedOpenCapabilityRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
self.4.encode(encoder, offset + 44, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RemoteControlDeprecatedOpenCapabilityRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
capability_set: fidl::new_empty!(
fidl_fuchsia_sys2::OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
capability_name: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
server_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
flags: fidl::new_empty!(
fidl_fuchsia_io::OpenFlags,
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(16) };
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 + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_sys2::OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.capability_set,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.capability_name,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_channel, decoder, offset + 40, _depth)?;
fidl::decode!(
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.flags,
decoder,
offset + 44,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RemoteControlEchoStringRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoteControlEchoStringRequest {
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<RemoteControlEchoStringRequest, D>
for &RemoteControlEchoStringRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlEchoStringRequest>(offset);
fidl::encoding::Encode::<RemoteControlEchoStringRequest, D>::encode(
(<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.value,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
> fidl::encoding::Encode<RemoteControlEchoStringRequest, 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::<RemoteControlEchoStringRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RemoteControlEchoStringRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.value,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RemoteControlEchoStringResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoteControlEchoStringResponse {
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<RemoteControlEchoStringResponse, D>
for &RemoteControlEchoStringResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlEchoStringResponse>(offset);
fidl::encoding::Encode::<RemoteControlEchoStringResponse, D>::encode(
(<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.response,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
> fidl::encoding::Encode<RemoteControlEchoStringResponse, 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::<RemoteControlEchoStringResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RemoteControlEchoStringResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { response: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.response,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RemoteControlGetBootTimeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoteControlGetBootTimeResponse {
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<RemoteControlGetBootTimeResponse, D>
for &RemoteControlGetBootTimeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlGetBootTimeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RemoteControlGetBootTimeResponse)
.write_unaligned((self as *const RemoteControlGetBootTimeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<fidl::BootInstant, D>>
fidl::encoding::Encode<RemoteControlGetBootTimeResponse, 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::<RemoteControlGetBootTimeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RemoteControlGetBootTimeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { time: fidl::new_empty!(fidl::BootInstant, 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::ValueTypeMarker for RemoteControlGetTimeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoteControlGetTimeResponse {
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<RemoteControlGetTimeResponse, D> for &RemoteControlGetTimeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlGetTimeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RemoteControlGetTimeResponse)
.write_unaligned((self as *const RemoteControlGetTimeResponse).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::MonotonicInstant, D>,
> fidl::encoding::Encode<RemoteControlGetTimeResponse, 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::<RemoteControlGetTimeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RemoteControlGetTimeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { time: fidl::new_empty!(fidl::MonotonicInstant, 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::ValueTypeMarker for RemoteControlLogMessageRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoteControlLogMessageRequest {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RemoteControlLogMessageRequest, D>
for &RemoteControlLogMessageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlLogMessageRequest>(offset);
fidl::encoding::Encode::<RemoteControlLogMessageRequest, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.tag,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.message,
),
<fidl_fuchsia_diagnostics::Severity as fidl::encoding::ValueTypeMarker>::borrow(
&self.severity,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T2: fidl::encoding::Encode<fidl_fuchsia_diagnostics::Severity, D>,
> fidl::encoding::Encode<RemoteControlLogMessageRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlLogMessageRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RemoteControlLogMessageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
tag: fidl::new_empty!(fidl::encoding::UnboundedString, D),
message: fidl::new_empty!(fidl::encoding::UnboundedString, D),
severity: fidl::new_empty!(fidl_fuchsia_diagnostics::Severity, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.tag,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.message,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl_fuchsia_diagnostics::Severity,
D,
&mut self.severity,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RemoteControlIdentifyHostResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RemoteControlIdentifyHostResponse {
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<RemoteControlIdentifyHostResponse, D>
for &RemoteControlIdentifyHostResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RemoteControlIdentifyHostResponse>(offset);
fidl::encoding::Encode::<RemoteControlIdentifyHostResponse, D>::encode(
(<IdentifyHostResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<IdentifyHostResponse, D>,
> fidl::encoding::Encode<RemoteControlIdentifyHostResponse, 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::<RemoteControlIdentifyHostResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RemoteControlIdentifyHostResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { response: fidl::new_empty!(IdentifyHostResponse, 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!(
IdentifyHostResponse,
D,
&mut self.response,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl IdentifyHostResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.boot_id {
return 9;
}
if let Some(_) = self.addresses {
return 8;
}
if let Some(_) = self.board_config {
return 7;
}
if let Some(_) = self.product_config {
return 6;
}
if let Some(_) = self.ids {
return 5;
}
if let Some(_) = self.serial_number {
return 4;
}
if let Some(_) = self.boot_timestamp_nanos {
return 3;
}
if let Some(_) = self.nodename {
return 2;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for IdentifyHostResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for IdentifyHostResponse {
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<IdentifyHostResponse, D>
for &IdentifyHostResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<IdentifyHostResponse>(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 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::<fidl::encoding::BoundedString<255>, D>(
self.nodename.as_ref().map(
<fidl::encoding::BoundedString<255> 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::<u64, D>(
self.boot_timestamp_nanos
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
self.serial_number.as_ref().map(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u64>, D>(
self.ids.as_ref().map(<fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
self.product_config.as_ref().map(
<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
self.board_config.as_ref().map(
<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>, D>(
self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.boot_id.as_ref().map(<u64 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 IdentifyHostResponse {
#[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 < 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 =
<fidl::encoding::BoundedString<255> 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
.nodename
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
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 =
<u64 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_timestamp_nanos.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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 < 4 {
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 =
<fidl::encoding::BoundedString<255> 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
.serial_number
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
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 < 5 {
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 = <fidl::encoding::UnboundedVector<u64> 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.ids.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<u64>,
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 < 6 {
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 =
<fidl::encoding::BoundedString<100> 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
.product_config
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
fidl::decode!(
fidl::encoding::BoundedString<100>,
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 < 7 {
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 =
<fidl::encoding::BoundedString<100> 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
.board_config
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
fidl::decode!(
fidl::encoding::BoundedString<100>,
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 < 8 {
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 = <fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet> 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.addresses.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_net::Subnet>,
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 < 9 {
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 =
<u64 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_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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(())
}
}
}