#![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;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum DeviceMonitorError {
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! DeviceMonitorErrorUnknown {
() => {
_
};
}
impl DeviceMonitorError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
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::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
}
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ClearCountryRequest {
pub phy_id: u16,
}
impl fidl::Persistable for ClearCountryRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DestroyIfaceRequest {
pub iface_id: u16,
}
impl fidl::Persistable for DestroyIfaceRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorClearCountryRequest {
pub req: ClearCountryRequest,
}
impl fidl::Persistable for DeviceMonitorClearCountryRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorClearCountryResponse {
pub status: i32,
}
impl fidl::Persistable for DeviceMonitorClearCountryResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorDestroyIfaceRequest {
pub req: DestroyIfaceRequest,
}
impl fidl::Persistable for DeviceMonitorDestroyIfaceRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorDestroyIfaceResponse {
pub status: i32,
}
impl fidl::Persistable for DeviceMonitorDestroyIfaceResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetApSmeRequest {
pub iface_id: u16,
pub sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetApSmeRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetClientSmeRequest {
pub iface_id: u16,
pub sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetClientSmeRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorGetCountryRequest {
pub phy_id: u16,
}
impl fidl::Persistable for DeviceMonitorGetCountryRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorGetDevPathRequest {
pub phy_id: u16,
}
impl fidl::Persistable for DeviceMonitorGetDevPathRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetDevPathResponse {
pub dev_path: Option<String>,
}
impl fidl::Persistable for DeviceMonitorGetDevPathResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetFeatureSupportRequest {
pub iface_id: u16,
pub feature_support_server:
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetFeatureSupportRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorGetPowerSaveModeRequest {
pub phy_id: u16,
}
impl fidl::Persistable for DeviceMonitorGetPowerSaveModeRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetSmeTelemetryRequest {
pub iface_id: u16,
pub telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetSmeTelemetryRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorGetSupportedMacRolesRequest {
pub phy_id: u16,
}
impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorListIfacesResponse {
pub iface_list: Vec<u16>,
}
impl fidl::Persistable for DeviceMonitorListIfacesResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorListPhysResponse {
pub phy_list: Vec<u16>,
}
impl fidl::Persistable for DeviceMonitorListPhysResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorQueryIfaceRequest {
pub iface_id: u16,
}
impl fidl::Persistable for DeviceMonitorQueryIfaceRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorSetCountryRequest {
pub req: SetCountryRequest,
}
impl fidl::Persistable for DeviceMonitorSetCountryRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorSetCountryResponse {
pub status: i32,
}
impl fidl::Persistable for DeviceMonitorSetCountryResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorSetPowerSaveModeRequest {
pub req: SetPowerSaveModeRequest,
}
impl fidl::Persistable for DeviceMonitorSetPowerSaveModeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorSetPowerSaveModeResponse {
pub status: i32,
}
impl fidl::Persistable for DeviceMonitorSetPowerSaveModeResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorWatchDevicesRequest {
pub watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorWatchDevicesRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceMonitorGetCountryResponse {
pub resp: GetCountryResponse,
}
impl fidl::Persistable for DeviceMonitorGetCountryResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetPowerSaveModeResponse {
pub resp: GetPowerSaveModeResponse,
}
impl fidl::Persistable for DeviceMonitorGetPowerSaveModeResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorGetSupportedMacRolesResponse {
pub supported_mac_roles: Vec<fidl_fuchsia_wlan_common::WlanMacRole>,
}
impl fidl::Persistable for DeviceMonitorGetSupportedMacRolesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorQueryIfaceResponse {
pub resp: QueryIfaceResponse,
}
impl fidl::Persistable for DeviceMonitorQueryIfaceResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceWatcherOnIfaceAddedRequest {
pub iface_id: u16,
}
impl fidl::Persistable for DeviceWatcherOnIfaceAddedRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceWatcherOnIfaceRemovedRequest {
pub iface_id: u16,
}
impl fidl::Persistable for DeviceWatcherOnIfaceRemovedRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceWatcherOnPhyAddedRequest {
pub phy_id: u16,
}
impl fidl::Persistable for DeviceWatcherOnPhyAddedRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceWatcherOnPhyRemovedRequest {
pub phy_id: u16,
}
impl fidl::Persistable for DeviceWatcherOnPhyRemovedRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct GetCountryResponse {
pub alpha2: [u8; 2],
}
impl fidl::Persistable for GetCountryResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct GetPowerSaveModeResponse {
pub ps_mode: fidl_fuchsia_wlan_common::PowerSaveType,
}
impl fidl::Persistable for GetPowerSaveModeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct QueryIfaceResponse {
pub role: fidl_fuchsia_wlan_common::WlanMacRole,
pub id: u16,
pub phy_id: u16,
pub phy_assigned_id: u16,
pub sta_addr: [u8; 6],
}
impl fidl::Persistable for QueryIfaceResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetCountryRequest {
pub phy_id: u16,
pub alpha2: [u8; 2],
}
impl fidl::Persistable for SetCountryRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetPowerSaveModeRequest {
pub phy_id: u16,
pub ps_mode: fidl_fuchsia_wlan_common::PowerSaveType,
}
impl fidl::Persistable for SetPowerSaveModeRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DeviceMonitorCreateIfaceRequest {
pub phy_id: Option<u16>,
pub role: Option<fidl_fuchsia_wlan_common::WlanMacRole>,
pub sta_address: Option<[u8; 6]>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DeviceMonitorCreateIfaceRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DeviceMonitorCreateIfaceResponse {
pub iface_id: Option<u16>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DeviceMonitorCreateIfaceResponse {}
#[derive(Clone, Debug, PartialEq)]
pub enum GetIfaceCounterStatsResponse {
Stats(fidl_fuchsia_wlan_stats::IfaceCounterStats),
ErrorStatus(i32),
}
impl GetIfaceCounterStatsResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Stats(_) => 1,
Self::ErrorStatus(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for GetIfaceCounterStatsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub enum GetIfaceHistogramStatsResponse {
Stats(fidl_fuchsia_wlan_stats::IfaceHistogramStats),
ErrorStatus(i32),
}
impl GetIfaceHistogramStatsResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Stats(_) => 1,
Self::ErrorStatus(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for GetIfaceHistogramStatsResponse {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceMonitorMarker;
impl fidl::endpoints::ProtocolMarker for DeviceMonitorMarker {
type Proxy = DeviceMonitorProxy;
type RequestStream = DeviceMonitorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceMonitorSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.wlan.device.service.DeviceMonitor";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DeviceMonitorMarker {}
pub type DeviceMonitorGetSupportedMacRolesResult =
Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
pub type DeviceMonitorGetCountryResult = Result<GetCountryResponse, i32>;
pub type DeviceMonitorGetPowerSaveModeResult = Result<GetPowerSaveModeResponse, i32>;
pub type DeviceMonitorCreateIfaceResult =
Result<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>;
pub type DeviceMonitorQueryIfaceResult = Result<QueryIfaceResponse, i32>;
pub type DeviceMonitorGetClientSmeResult = Result<(), i32>;
pub type DeviceMonitorGetApSmeResult = Result<(), i32>;
pub type DeviceMonitorGetSmeTelemetryResult = Result<(), i32>;
pub type DeviceMonitorGetFeatureSupportResult = Result<(), i32>;
pub trait DeviceMonitorProxyInterface: Send + Sync {
type ListPhysResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
fn r#list_phys(&self) -> Self::ListPhysResponseFut;
type ListIfacesResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut;
type GetDevPathResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
+ Send;
fn r#get_dev_path(&self, phy_id: u16) -> Self::GetDevPathResponseFut;
type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error>>
+ Send;
fn r#get_supported_mac_roles(&self, phy_id: u16) -> Self::GetSupportedMacRolesResponseFut;
fn r#watch_devices(
&self,
watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
) -> Result<(), fidl::Error>;
type GetCountryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetCountryResult, fidl::Error>>
+ Send;
fn r#get_country(&self, phy_id: u16) -> Self::GetCountryResponseFut;
type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_country(&self, req: &SetCountryRequest) -> Self::SetCountryResponseFut;
type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#clear_country(&self, req: &ClearCountryRequest) -> Self::ClearCountryResponseFut;
type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_power_save_mode(
&self,
req: &SetPowerSaveModeRequest,
) -> Self::SetPowerSaveModeResponseFut;
type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error>>
+ Send;
fn r#get_power_save_mode(&self, phy_id: u16) -> Self::GetPowerSaveModeResponseFut;
type CreateIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorCreateIfaceResult, fidl::Error>>
+ Send;
fn r#create_iface(
&self,
payload: &DeviceMonitorCreateIfaceRequest,
) -> Self::CreateIfaceResponseFut;
type QueryIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorQueryIfaceResult, fidl::Error>>
+ Send;
fn r#query_iface(&self, iface_id: u16) -> Self::QueryIfaceResponseFut;
type DestroyIfaceResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
type GetClientSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetClientSmeResult, fidl::Error>>
+ Send;
fn r#get_client_sme(
&self,
iface_id: u16,
sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
) -> Self::GetClientSmeResponseFut;
type GetApSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetApSmeResult, fidl::Error>>
+ Send;
fn r#get_ap_sme(
&self,
iface_id: u16,
sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
) -> Self::GetApSmeResponseFut;
type GetSmeTelemetryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error>>
+ Send;
fn r#get_sme_telemetry(
&self,
iface_id: u16,
telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
) -> Self::GetSmeTelemetryResponseFut;
type GetFeatureSupportResponseFut: std::future::Future<Output = Result<DeviceMonitorGetFeatureSupportResult, fidl::Error>>
+ Send;
fn r#get_feature_support(
&self,
iface_id: u16,
feature_support_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_wlan_sme::FeatureSupportMarker,
>,
) -> Self::GetFeatureSupportResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceMonitorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceMonitorSynchronousProxy {
type Proxy = DeviceMonitorProxy;
type Protocol = DeviceMonitorMarker;
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 DeviceMonitorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceMonitorMarker 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<DeviceMonitorEvent, fidl::Error> {
DeviceMonitorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#list_phys(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u16>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListPhysResponse>(
(),
0x3a08518874196aab,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.phy_list)
}
pub fn r#list_ifaces(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<u16>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListIfacesResponse>(
(),
0x129e758fb8e0b113,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.iface_list)
}
pub fn r#get_dev_path(
&self,
mut phy_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<Option<String>, fidl::Error> {
let _response = self
.client
.send_query::<DeviceMonitorGetDevPathRequest, DeviceMonitorGetDevPathResponse>(
(phy_id,),
0x4aa489b57113bccf,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.dev_path)
}
pub fn r#get_supported_mac_roles(
&self,
mut phy_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetSupportedMacRolesRequest,
fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
>(
(phy_id,),
0x172b3d2eabd5a14e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.supported_mac_roles))
}
pub fn r#watch_devices(
&self,
mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceMonitorWatchDevicesRequest>(
(watcher,),
0x4615941e67e31b8e,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_country(
&self,
mut phy_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetCountryRequest,
fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
>(
(phy_id,),
0x6f1040bd81bde90e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#set_country(
&self,
mut req: &SetCountryRequest,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self
.client
.send_query::<DeviceMonitorSetCountryRequest, DeviceMonitorSetCountryResponse>(
(req,),
0xdaa7b77a5a6e71b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#clear_country(
&self,
mut req: &ClearCountryRequest,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self
.client
.send_query::<DeviceMonitorClearCountryRequest, DeviceMonitorClearCountryResponse>(
(req,),
0x66714d61103120e9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#set_power_save_mode(
&self,
mut req: &SetPowerSaveModeRequest,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorSetPowerSaveModeRequest,
DeviceMonitorSetPowerSaveModeResponse,
>(
(req,),
0x62202b4d360533bc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#get_power_save_mode(
&self,
mut phy_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetPowerSaveModeRequest,
fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
>(
(phy_id,),
0x14304d406ada8693,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#create_iface(
&self,
mut payload: &DeviceMonitorCreateIfaceRequest,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
let _response =
self.client.send_query::<DeviceMonitorCreateIfaceRequest, fidl::encoding::ResultType<
DeviceMonitorCreateIfaceResponse,
DeviceMonitorError,
>>(
payload,
0x1e1d30c24c0ec144,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query_iface(
&self,
mut iface_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorQueryIfaceRequest,
fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
>(
(iface_id,),
0x1a48c4a2b86259ef,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resp))
}
pub fn r#destroy_iface(
&self,
mut req: &DestroyIfaceRequest,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self
.client
.send_query::<DeviceMonitorDestroyIfaceRequest, DeviceMonitorDestroyIfaceResponse>(
(req,),
0x4c77982c1616a3b0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#get_client_sme(
&self,
mut iface_id: u16,
mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetClientSmeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(iface_id, sme_server,),
0x1b056c379ca98273,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_ap_sme(
&self,
mut iface_id: u16,
mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetApSmeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(iface_id, sme_server,),
0x754de680c4318c52,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_sme_telemetry(
&self,
mut iface_id: u16,
mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetSmeTelemetryRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(iface_id, telemetry_server,),
0x1baf42b003f7452a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_feature_support(
&self,
mut iface_id: u16,
mut feature_support_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_wlan_sme::FeatureSupportMarker,
>,
___deadline: zx::MonotonicInstant,
) -> Result<DeviceMonitorGetFeatureSupportResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceMonitorGetFeatureSupportRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(iface_id, feature_support_server,),
0x5700db2b35762366,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DeviceMonitorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DeviceMonitorProxy {
type Protocol = DeviceMonitorMarker;
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 DeviceMonitorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceMonitorEventStream {
DeviceMonitorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#list_phys(
&self,
) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DeviceMonitorProxyInterface::r#list_phys(self)
}
pub fn r#list_ifaces(
&self,
) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DeviceMonitorProxyInterface::r#list_ifaces(self)
}
pub fn r#get_dev_path(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DeviceMonitorProxyInterface::r#get_dev_path(self, phy_id)
}
pub fn r#get_supported_mac_roles(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetSupportedMacRolesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_supported_mac_roles(self, phy_id)
}
pub fn r#watch_devices(
&self,
mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
) -> Result<(), fidl::Error> {
DeviceMonitorProxyInterface::r#watch_devices(self, watcher)
}
pub fn r#get_country(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetCountryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_country(self, phy_id)
}
pub fn r#set_country(
&self,
mut req: &SetCountryRequest,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DeviceMonitorProxyInterface::r#set_country(self, req)
}
pub fn r#clear_country(
&self,
mut req: &ClearCountryRequest,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DeviceMonitorProxyInterface::r#clear_country(self, req)
}
pub fn r#set_power_save_mode(
&self,
mut req: &SetPowerSaveModeRequest,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DeviceMonitorProxyInterface::r#set_power_save_mode(self, req)
}
pub fn r#get_power_save_mode(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetPowerSaveModeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_power_save_mode(self, phy_id)
}
pub fn r#create_iface(
&self,
mut payload: &DeviceMonitorCreateIfaceRequest,
) -> fidl::client::QueryResponseFut<
DeviceMonitorCreateIfaceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#create_iface(self, payload)
}
pub fn r#query_iface(
&self,
mut iface_id: u16,
) -> fidl::client::QueryResponseFut<
DeviceMonitorQueryIfaceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#query_iface(self, iface_id)
}
pub fn r#destroy_iface(
&self,
mut req: &DestroyIfaceRequest,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DeviceMonitorProxyInterface::r#destroy_iface(self, req)
}
pub fn r#get_client_sme(
&self,
mut iface_id: u16,
mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetClientSmeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_client_sme(self, iface_id, sme_server)
}
pub fn r#get_ap_sme(
&self,
mut iface_id: u16,
mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetApSmeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_ap_sme(self, iface_id, sme_server)
}
pub fn r#get_sme_telemetry(
&self,
mut iface_id: u16,
mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetSmeTelemetryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_sme_telemetry(self, iface_id, telemetry_server)
}
pub fn r#get_feature_support(
&self,
mut iface_id: u16,
mut feature_support_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_wlan_sme::FeatureSupportMarker,
>,
) -> fidl::client::QueryResponseFut<
DeviceMonitorGetFeatureSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DeviceMonitorProxyInterface::r#get_feature_support(self, iface_id, feature_support_server)
}
}
impl DeviceMonitorProxyInterface for DeviceMonitorProxy {
type ListPhysResponseFut =
fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#list_phys(&self) -> Self::ListPhysResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u16>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorListPhysResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3a08518874196aab,
>(_buf?)?;
Ok(_response.phy_list)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
(),
0x3a08518874196aab,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ListIfacesResponseFut =
fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u16>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorListIfacesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x129e758fb8e0b113,
>(_buf?)?;
Ok(_response.iface_list)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
(),
0x129e758fb8e0b113,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDevPathResponseFut = fidl::client::QueryResponseFut<
Option<String>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_dev_path(&self, mut phy_id: u16) -> Self::GetDevPathResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Option<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorGetDevPathResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4aa489b57113bccf,
>(_buf?)?;
Ok(_response.dev_path)
}
self.client.send_query_and_decode::<DeviceMonitorGetDevPathRequest, Option<String>>(
(phy_id,),
0x4aa489b57113bccf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetSupportedMacRolesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_supported_mac_roles(&self, mut phy_id: u16) -> Self::GetSupportedMacRolesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x172b3d2eabd5a14e,
>(_buf?)?;
Ok(_response.map(|x| x.supported_mac_roles))
}
self.client.send_query_and_decode::<
DeviceMonitorGetSupportedMacRolesRequest,
DeviceMonitorGetSupportedMacRolesResult,
>(
(phy_id,),
0x172b3d2eabd5a14e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#watch_devices(
&self,
mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceMonitorWatchDevicesRequest>(
(watcher,),
0x4615941e67e31b8e,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetCountryResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetCountryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_country(&self, mut phy_id: u16) -> Self::GetCountryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f1040bd81bde90e,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client
.send_query_and_decode::<DeviceMonitorGetCountryRequest, DeviceMonitorGetCountryResult>(
(phy_id,),
0x6f1040bd81bde90e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetCountryResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_country(&self, mut req: &SetCountryRequest) -> Self::SetCountryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorSetCountryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xdaa7b77a5a6e71b,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DeviceMonitorSetCountryRequest, i32>(
(req,),
0xdaa7b77a5a6e71b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ClearCountryResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#clear_country(&self, mut req: &ClearCountryRequest) -> Self::ClearCountryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorClearCountryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x66714d61103120e9,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DeviceMonitorClearCountryRequest, i32>(
(req,),
0x66714d61103120e9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetPowerSaveModeResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_power_save_mode(
&self,
mut req: &SetPowerSaveModeRequest,
) -> Self::SetPowerSaveModeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorSetPowerSaveModeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x62202b4d360533bc,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DeviceMonitorSetPowerSaveModeRequest, i32>(
(req,),
0x62202b4d360533bc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetPowerSaveModeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_power_save_mode(&self, mut phy_id: u16) -> Self::GetPowerSaveModeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x14304d406ada8693,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client.send_query_and_decode::<
DeviceMonitorGetPowerSaveModeRequest,
DeviceMonitorGetPowerSaveModeResult,
>(
(phy_id,),
0x14304d406ada8693,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorCreateIfaceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_iface(
&self,
mut payload: &DeviceMonitorCreateIfaceRequest,
) -> Self::CreateIfaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1e1d30c24c0ec144,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DeviceMonitorCreateIfaceRequest,
DeviceMonitorCreateIfaceResult,
>(
payload,
0x1e1d30c24c0ec144,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryIfaceResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorQueryIfaceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_iface(&self, mut iface_id: u16) -> Self::QueryIfaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1a48c4a2b86259ef,
>(_buf?)?;
Ok(_response.map(|x| x.resp))
}
self.client
.send_query_and_decode::<DeviceMonitorQueryIfaceRequest, DeviceMonitorQueryIfaceResult>(
(iface_id,),
0x1a48c4a2b86259ef,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DestroyIfaceResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorDestroyIfaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c77982c1616a3b0,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DeviceMonitorDestroyIfaceRequest, i32>(
(req,),
0x4c77982c1616a3b0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetClientSmeResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetClientSmeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_client_sme(
&self,
mut iface_id: u16,
mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
) -> Self::GetClientSmeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1b056c379ca98273,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DeviceMonitorGetClientSmeRequest,
DeviceMonitorGetClientSmeResult,
>(
(iface_id, sme_server,),
0x1b056c379ca98273,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetApSmeResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetApSmeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_ap_sme(
&self,
mut iface_id: u16,
mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
) -> Self::GetApSmeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x754de680c4318c52,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<DeviceMonitorGetApSmeRequest, DeviceMonitorGetApSmeResult>(
(iface_id, sme_server),
0x754de680c4318c52,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetSmeTelemetryResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetSmeTelemetryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_sme_telemetry(
&self,
mut iface_id: u16,
mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
) -> Self::GetSmeTelemetryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1baf42b003f7452a,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DeviceMonitorGetSmeTelemetryRequest,
DeviceMonitorGetSmeTelemetryResult,
>(
(iface_id, telemetry_server,),
0x1baf42b003f7452a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFeatureSupportResponseFut = fidl::client::QueryResponseFut<
DeviceMonitorGetFeatureSupportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_feature_support(
&self,
mut iface_id: u16,
mut feature_support_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_wlan_sme::FeatureSupportMarker,
>,
) -> Self::GetFeatureSupportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetFeatureSupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5700db2b35762366,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DeviceMonitorGetFeatureSupportRequest,
DeviceMonitorGetFeatureSupportResult,
>(
(iface_id, feature_support_server,),
0x5700db2b35762366,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DeviceMonitorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DeviceMonitorEventStream {}
impl futures::stream::FusedStream for DeviceMonitorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceMonitorEventStream {
type Item = Result<DeviceMonitorEvent, 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(DeviceMonitorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceMonitorEvent {}
impl DeviceMonitorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DeviceMonitorEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceMonitorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceMonitorRequestStream {}
impl futures::stream::FusedStream for DeviceMonitorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceMonitorRequestStream {
type Protocol = DeviceMonitorMarker;
type ControlHandle = DeviceMonitorControlHandle;
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 {
DeviceMonitorControlHandle { 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 DeviceMonitorRequestStream {
type Item = Result<DeviceMonitorRequest, 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 DeviceMonitorRequestStream 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 {
0x3a08518874196aab => {
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 =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::ListPhys {
responder: DeviceMonitorListPhysResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x129e758fb8e0b113 => {
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 =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::ListIfaces {
responder: DeviceMonitorListIfacesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4aa489b57113bccf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetDevPathRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetDevPathRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetDevPath {
phy_id: req.phy_id,
responder: DeviceMonitorGetDevPathResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x172b3d2eabd5a14e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetSupportedMacRolesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSupportedMacRolesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetSupportedMacRoles {
phy_id: req.phy_id,
responder: DeviceMonitorGetSupportedMacRolesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4615941e67e31b8e => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorWatchDevicesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorWatchDevicesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::WatchDevices {
watcher: req.watcher,
control_handle,
})
}
0x6f1040bd81bde90e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetCountryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetCountry {
phy_id: req.phy_id,
responder: DeviceMonitorGetCountryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xdaa7b77a5a6e71b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorSetCountryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::SetCountry {
req: req.req,
responder: DeviceMonitorSetCountryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x66714d61103120e9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorClearCountryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorClearCountryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::ClearCountry {
req: req.req,
responder: DeviceMonitorClearCountryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x62202b4d360533bc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorSetPowerSaveModeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::SetPowerSaveMode {
req: req.req,
responder: DeviceMonitorSetPowerSaveModeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x14304d406ada8693 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetPowerSaveModeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetPowerSaveMode {
phy_id: req.phy_id,
responder: DeviceMonitorGetPowerSaveModeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1e1d30c24c0ec144 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorCreateIfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::CreateIface {
payload: req,
responder: DeviceMonitorCreateIfaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1a48c4a2b86259ef => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorQueryIfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorQueryIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::QueryIface {
iface_id: req.iface_id,
responder: DeviceMonitorQueryIfaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c77982c1616a3b0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorDestroyIfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::DestroyIface {
req: req.req,
responder: DeviceMonitorDestroyIfaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1b056c379ca98273 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetClientSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetClientSmeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetClientSme {
iface_id: req.iface_id,
sme_server: req.sme_server,
responder: DeviceMonitorGetClientSmeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x754de680c4318c52 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetApSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetApSmeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetApSme {
iface_id: req.iface_id,
sme_server: req.sme_server,
responder: DeviceMonitorGetApSmeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1baf42b003f7452a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetSmeTelemetryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSmeTelemetryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetSmeTelemetry {
iface_id: req.iface_id,
telemetry_server: req.telemetry_server,
responder: DeviceMonitorGetSmeTelemetryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5700db2b35762366 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DeviceMonitorGetFeatureSupportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetFeatureSupportRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::GetFeatureSupport {
iface_id: req.iface_id,
feature_support_server: req.feature_support_server,
responder: DeviceMonitorGetFeatureSupportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DeviceMonitorRequest {
ListPhys {
responder: DeviceMonitorListPhysResponder,
},
ListIfaces {
responder: DeviceMonitorListIfacesResponder,
},
GetDevPath {
phy_id: u16,
responder: DeviceMonitorGetDevPathResponder,
},
GetSupportedMacRoles {
phy_id: u16,
responder: DeviceMonitorGetSupportedMacRolesResponder,
},
WatchDevices {
watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
control_handle: DeviceMonitorControlHandle,
},
GetCountry {
phy_id: u16,
responder: DeviceMonitorGetCountryResponder,
},
SetCountry {
req: SetCountryRequest,
responder: DeviceMonitorSetCountryResponder,
},
ClearCountry {
req: ClearCountryRequest,
responder: DeviceMonitorClearCountryResponder,
},
SetPowerSaveMode {
req: SetPowerSaveModeRequest,
responder: DeviceMonitorSetPowerSaveModeResponder,
},
GetPowerSaveMode {
phy_id: u16,
responder: DeviceMonitorGetPowerSaveModeResponder,
},
CreateIface {
payload: DeviceMonitorCreateIfaceRequest,
responder: DeviceMonitorCreateIfaceResponder,
},
QueryIface {
iface_id: u16,
responder: DeviceMonitorQueryIfaceResponder,
},
DestroyIface {
req: DestroyIfaceRequest,
responder: DeviceMonitorDestroyIfaceResponder,
},
GetClientSme {
iface_id: u16,
sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
responder: DeviceMonitorGetClientSmeResponder,
},
GetApSme {
iface_id: u16,
sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
responder: DeviceMonitorGetApSmeResponder,
},
GetSmeTelemetry {
iface_id: u16,
telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
responder: DeviceMonitorGetSmeTelemetryResponder,
},
GetFeatureSupport {
iface_id: u16,
feature_support_server:
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
responder: DeviceMonitorGetFeatureSupportResponder,
},
}
impl DeviceMonitorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_list_phys(self) -> Option<(DeviceMonitorListPhysResponder)> {
if let DeviceMonitorRequest::ListPhys { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_ifaces(self) -> Option<(DeviceMonitorListIfacesResponder)> {
if let DeviceMonitorRequest::ListIfaces { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_dev_path(self) -> Option<(u16, DeviceMonitorGetDevPathResponder)> {
if let DeviceMonitorRequest::GetDevPath { phy_id, responder } = self {
Some((phy_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_supported_mac_roles(
self,
) -> Option<(u16, DeviceMonitorGetSupportedMacRolesResponder)> {
if let DeviceMonitorRequest::GetSupportedMacRoles { phy_id, responder } = self {
Some((phy_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_devices(
self,
) -> Option<(fidl::endpoints::ServerEnd<DeviceWatcherMarker>, DeviceMonitorControlHandle)> {
if let DeviceMonitorRequest::WatchDevices { watcher, control_handle } = self {
Some((watcher, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_country(self) -> Option<(u16, DeviceMonitorGetCountryResponder)> {
if let DeviceMonitorRequest::GetCountry { phy_id, responder } = self {
Some((phy_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_country(self) -> Option<(SetCountryRequest, DeviceMonitorSetCountryResponder)> {
if let DeviceMonitorRequest::SetCountry { req, responder } = self {
Some((req, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clear_country(
self,
) -> Option<(ClearCountryRequest, DeviceMonitorClearCountryResponder)> {
if let DeviceMonitorRequest::ClearCountry { req, responder } = self {
Some((req, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_power_save_mode(
self,
) -> Option<(SetPowerSaveModeRequest, DeviceMonitorSetPowerSaveModeResponder)> {
if let DeviceMonitorRequest::SetPowerSaveMode { req, responder } = self {
Some((req, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_power_save_mode(self) -> Option<(u16, DeviceMonitorGetPowerSaveModeResponder)> {
if let DeviceMonitorRequest::GetPowerSaveMode { phy_id, responder } = self {
Some((phy_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_iface(
self,
) -> Option<(DeviceMonitorCreateIfaceRequest, DeviceMonitorCreateIfaceResponder)> {
if let DeviceMonitorRequest::CreateIface { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_iface(self) -> Option<(u16, DeviceMonitorQueryIfaceResponder)> {
if let DeviceMonitorRequest::QueryIface { iface_id, responder } = self {
Some((iface_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_destroy_iface(
self,
) -> Option<(DestroyIfaceRequest, DeviceMonitorDestroyIfaceResponder)> {
if let DeviceMonitorRequest::DestroyIface { req, responder } = self {
Some((req, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_client_sme(
self,
) -> Option<(
u16,
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
DeviceMonitorGetClientSmeResponder,
)> {
if let DeviceMonitorRequest::GetClientSme { iface_id, sme_server, responder } = self {
Some((iface_id, sme_server, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_ap_sme(
self,
) -> Option<(
u16,
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
DeviceMonitorGetApSmeResponder,
)> {
if let DeviceMonitorRequest::GetApSme { iface_id, sme_server, responder } = self {
Some((iface_id, sme_server, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_sme_telemetry(
self,
) -> Option<(
u16,
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
DeviceMonitorGetSmeTelemetryResponder,
)> {
if let DeviceMonitorRequest::GetSmeTelemetry { iface_id, telemetry_server, responder } =
self
{
Some((iface_id, telemetry_server, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_feature_support(
self,
) -> Option<(
u16,
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
DeviceMonitorGetFeatureSupportResponder,
)> {
if let DeviceMonitorRequest::GetFeatureSupport {
iface_id,
feature_support_server,
responder,
} = self
{
Some((iface_id, feature_support_server, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceMonitorRequest::ListPhys { .. } => "list_phys",
DeviceMonitorRequest::ListIfaces { .. } => "list_ifaces",
DeviceMonitorRequest::GetDevPath { .. } => "get_dev_path",
DeviceMonitorRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
DeviceMonitorRequest::WatchDevices { .. } => "watch_devices",
DeviceMonitorRequest::GetCountry { .. } => "get_country",
DeviceMonitorRequest::SetCountry { .. } => "set_country",
DeviceMonitorRequest::ClearCountry { .. } => "clear_country",
DeviceMonitorRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
DeviceMonitorRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
DeviceMonitorRequest::CreateIface { .. } => "create_iface",
DeviceMonitorRequest::QueryIface { .. } => "query_iface",
DeviceMonitorRequest::DestroyIface { .. } => "destroy_iface",
DeviceMonitorRequest::GetClientSme { .. } => "get_client_sme",
DeviceMonitorRequest::GetApSme { .. } => "get_ap_sme",
DeviceMonitorRequest::GetSmeTelemetry { .. } => "get_sme_telemetry",
DeviceMonitorRequest::GetFeatureSupport { .. } => "get_feature_support",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceMonitorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DeviceMonitorControlHandle {
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 DeviceMonitorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorListPhysResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorListPhysResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorListPhysResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorListPhysResponder {
pub fn send(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
let _result = self.send_raw(phy_list);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
let _result = self.send_raw(phy_list);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorListPhysResponse>(
(phy_list,),
self.tx_id,
0x3a08518874196aab,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorListIfacesResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorListIfacesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorListIfacesResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorListIfacesResponder {
pub fn send(self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
let _result = self.send_raw(iface_list);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
let _result = self.send_raw(iface_list);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorListIfacesResponse>(
(iface_list,),
self.tx_id,
0x129e758fb8e0b113,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetDevPathResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetDevPathResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetDevPathResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetDevPathResponder {
pub fn send(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(dev_path);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(dev_path);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorGetDevPathResponse>(
(dev_path,),
self.tx_id,
0x4aa489b57113bccf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetSupportedMacRolesResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetSupportedMacRolesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetSupportedMacRolesResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetSupportedMacRolesResponder {
pub fn send(
self,
mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DeviceMonitorGetSupportedMacRolesResponse,
i32,
>>(
result.map(|supported_mac_roles| (supported_mac_roles,)),
self.tx_id,
0x172b3d2eabd5a14e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetCountryResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetCountryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetCountryResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetCountryResponder {
pub fn send(self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&GetCountryResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>>(
result.map(|resp| (resp,)),
self.tx_id,
0x6f1040bd81bde90e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorSetCountryResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorSetCountryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorSetCountryResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorSetCountryResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorSetCountryResponse>(
(status,),
self.tx_id,
0xdaa7b77a5a6e71b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorClearCountryResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorClearCountryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorClearCountryResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorClearCountryResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorClearCountryResponse>(
(status,),
self.tx_id,
0x66714d61103120e9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorSetPowerSaveModeResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorSetPowerSaveModeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorSetPowerSaveModeResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorSetPowerSaveModeResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorSetPowerSaveModeResponse>(
(status,),
self.tx_id,
0x62202b4d360533bc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetPowerSaveModeResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetPowerSaveModeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetPowerSaveModeResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetPowerSaveModeResponder {
pub fn send(
self,
mut result: Result<&GetPowerSaveModeResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&GetPowerSaveModeResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&GetPowerSaveModeResponse, i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DeviceMonitorGetPowerSaveModeResponse,
i32,
>>(
result.map(|resp| (resp,)),
self.tx_id,
0x14304d406ada8693,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorCreateIfaceResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorCreateIfaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorCreateIfaceResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorCreateIfaceResponder {
pub fn send(
self,
mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
) -> 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<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DeviceMonitorCreateIfaceResponse,
DeviceMonitorError,
>>(
result,
self.tx_id,
0x1e1d30c24c0ec144,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorQueryIfaceResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorQueryIfaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorQueryIfaceResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorQueryIfaceResponder {
pub fn send(self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&QueryIfaceResponse, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>>(
result.map(|resp| (resp,)),
self.tx_id,
0x1a48c4a2b86259ef,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorDestroyIfaceResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorDestroyIfaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorDestroyIfaceResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorDestroyIfaceResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorDestroyIfaceResponse>(
(status,),
self.tx_id,
0x4c77982c1616a3b0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetClientSmeResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetClientSmeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetClientSmeResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetClientSmeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x1b056c379ca98273,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetApSmeResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetApSmeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetApSmeResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetApSmeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x754de680c4318c52,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetSmeTelemetryResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetSmeTelemetryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetSmeTelemetryResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetSmeTelemetryResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x1baf42b003f7452a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceMonitorGetFeatureSupportResponder {
control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceMonitorGetFeatureSupportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceMonitorGetFeatureSupportResponder {
type ControlHandle = DeviceMonitorControlHandle;
fn control_handle(&self) -> &DeviceMonitorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceMonitorGetFeatureSupportResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5700db2b35762366,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceWatcherMarker;
impl fidl::endpoints::ProtocolMarker for DeviceWatcherMarker {
type Proxy = DeviceWatcherProxy;
type RequestStream = DeviceWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DeviceWatcher";
}
pub trait DeviceWatcherProxyInterface: Send + Sync {}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceWatcherSynchronousProxy {
type Proxy = DeviceWatcherProxy;
type Protocol = DeviceWatcherMarker;
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 DeviceWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceWatcherMarker 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<DeviceWatcherEvent, fidl::Error> {
DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct DeviceWatcherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DeviceWatcherProxy {
type Protocol = DeviceWatcherMarker;
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 DeviceWatcherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceWatcherEventStream {
DeviceWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
}
impl DeviceWatcherProxyInterface for DeviceWatcherProxy {}
pub struct DeviceWatcherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DeviceWatcherEventStream {}
impl futures::stream::FusedStream for DeviceWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceWatcherEventStream {
type Item = Result<DeviceWatcherEvent, 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(DeviceWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceWatcherEvent {
OnPhyAdded { phy_id: u16 },
OnPhyRemoved { phy_id: u16 },
OnIfaceAdded { iface_id: u16 },
OnIfaceRemoved { iface_id: u16 },
}
impl DeviceWatcherEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_phy_added(self) -> Option<u16> {
if let DeviceWatcherEvent::OnPhyAdded { phy_id } = self {
Some((phy_id))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_phy_removed(self) -> Option<u16> {
if let DeviceWatcherEvent::OnPhyRemoved { phy_id } = self {
Some((phy_id))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_iface_added(self) -> Option<u16> {
if let DeviceWatcherEvent::OnIfaceAdded { iface_id } = self {
Some((iface_id))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_iface_removed(self) -> Option<u16> {
if let DeviceWatcherEvent::OnIfaceRemoved { iface_id } = self {
Some((iface_id))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DeviceWatcherEvent, 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 {
0x771c58e0bd059f86 => {
let mut out = fidl::new_empty!(
DeviceWatcherOnPhyAddedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DeviceWatcherEvent::OnPhyAdded { phy_id: out.phy_id }))
}
0x4ad72b96ccb7cff6 => {
let mut out = fidl::new_empty!(
DeviceWatcherOnPhyRemovedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DeviceWatcherEvent::OnPhyRemoved { phy_id: out.phy_id }))
}
0x6ee685e4aa1f31d8 => {
let mut out = fidl::new_empty!(
DeviceWatcherOnIfaceAddedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DeviceWatcherEvent::OnIfaceAdded { iface_id: out.iface_id }))
}
0x3b771b1fce38c291 => {
let mut out = fidl::new_empty!(
DeviceWatcherOnIfaceRemovedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DeviceWatcherEvent::OnIfaceRemoved { iface_id: out.iface_id }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceWatcherRequestStream {}
impl futures::stream::FusedStream for DeviceWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceWatcherRequestStream {
type Protocol = DeviceWatcherMarker;
type ControlHandle = DeviceWatcherControlHandle;
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 {
DeviceWatcherControlHandle { 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 DeviceWatcherRequestStream {
type Item = Result<DeviceWatcherRequest, 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 DeviceWatcherRequestStream 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 {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DeviceWatcherRequest {}
impl DeviceWatcherRequest {
pub fn method_name(&self) -> &'static str {
match *self {}
}
}
#[derive(Debug, Clone)]
pub struct DeviceWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DeviceWatcherControlHandle {
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 DeviceWatcherControlHandle {
pub fn send_on_phy_added(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
self.inner.send::<DeviceWatcherOnPhyAddedRequest>(
(phy_id,),
0,
0x771c58e0bd059f86,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_phy_removed(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
self.inner.send::<DeviceWatcherOnPhyRemovedRequest>(
(phy_id,),
0,
0x4ad72b96ccb7cff6,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_iface_added(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
self.inner.send::<DeviceWatcherOnIfaceAddedRequest>(
(iface_id,),
0,
0x6ee685e4aa1f31d8,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_iface_removed(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
self.inner.send::<DeviceWatcherOnIfaceRemovedRequest>(
(iface_id,),
0,
0x3b771b1fce38c291,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorError {
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 DeviceMonitorError {
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 DeviceMonitorError
{
#[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 DeviceMonitorError {
#[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 ClearCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClearCountryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<ClearCountryRequest, D>
for &ClearCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClearCountryRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ClearCountryRequest)
.write_unaligned((self as *const ClearCountryRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<ClearCountryRequest, 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::<ClearCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClearCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DestroyIfaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DestroyIfaceRequest, D>
for &DestroyIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DestroyIfaceRequest)
.write_unaligned((self as *const DestroyIfaceRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DestroyIfaceRequest, 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::<DestroyIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorClearCountryRequest, D>
for &DeviceMonitorClearCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorClearCountryRequest)
.write_unaligned((self as *const DeviceMonitorClearCountryRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<ClearCountryRequest, D>,
> fidl::encoding::Encode<DeviceMonitorClearCountryRequest, 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::<DeviceMonitorClearCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorClearCountryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(ClearCountryRequest, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorClearCountryResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorClearCountryResponse, D>
for &DeviceMonitorClearCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorClearCountryResponse)
.write_unaligned((self as *const DeviceMonitorClearCountryResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DeviceMonitorClearCountryResponse, 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::<DeviceMonitorClearCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorClearCountryResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorDestroyIfaceRequest, D>
for &DeviceMonitorDestroyIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorDestroyIfaceRequest)
.write_unaligned((self as *const DeviceMonitorDestroyIfaceRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<DestroyIfaceRequest, D>,
> fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest, 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::<DeviceMonitorDestroyIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorDestroyIfaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(DestroyIfaceRequest, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorDestroyIfaceResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, D>
for &DeviceMonitorDestroyIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorDestroyIfaceResponse)
.write_unaligned((self as *const DeviceMonitorDestroyIfaceResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse, 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::<DeviceMonitorDestroyIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorDestroyIfaceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetApSmeRequest {
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 DeviceMonitorGetApSmeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
DeviceMonitorGetApSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceMonitorGetApSmeRequest
{
#[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::<DeviceMonitorGetApSmeRequest>(offset);
fidl::encoding::Encode::<
DeviceMonitorGetApSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.sme_server
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceMonitorGetApSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetApSmeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
sme_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffff0000u32;
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!(
u16,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.sme_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetClientSmeRequest {
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 DeviceMonitorGetClientSmeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
DeviceMonitorGetClientSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceMonitorGetClientSmeRequest
{
#[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::<DeviceMonitorGetClientSmeRequest>(offset);
fidl::encoding::Encode::<
DeviceMonitorGetClientSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.sme_server
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceMonitorGetClientSmeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetClientSmeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
sme_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffff0000u32;
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!(
u16,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.sme_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorGetCountryRequest, D>
for &DeviceMonitorGetCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorGetCountryRequest)
.write_unaligned((self as *const DeviceMonitorGetCountryRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceMonitorGetCountryRequest, 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::<DeviceMonitorGetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetCountryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorGetDevPathRequest, D>
for &DeviceMonitorGetDevPathRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorGetDevPathRequest)
.write_unaligned((self as *const DeviceMonitorGetDevPathRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceMonitorGetDevPathRequest, 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::<DeviceMonitorGetDevPathRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetDevPathRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetDevPathResponse {
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<DeviceMonitorGetDevPathResponse, D>
for &DeviceMonitorGetDevPathResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorGetDevPathResponse, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.dev_path),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
> fidl::encoding::Encode<DeviceMonitorGetDevPathResponse, 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::<DeviceMonitorGetDevPathResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetDevPathResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
dev_path: fidl::new_empty!(
fidl::encoding::Optional<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);
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
D,
&mut self.dev_path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetFeatureSupportRequest {
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 DeviceMonitorGetFeatureSupportRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
DeviceMonitorGetFeatureSupportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceMonitorGetFeatureSupportRequest
{
#[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::<DeviceMonitorGetFeatureSupportRequest>(offset);
fidl::encoding::Encode::<
DeviceMonitorGetFeatureSupportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.feature_support_server,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceMonitorGetFeatureSupportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetFeatureSupportRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetFeatureSupportRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
feature_support_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffff0000u32;
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!(
u16,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.feature_support_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorGetPowerSaveModeRequest, D>
for &DeviceMonitorGetPowerSaveModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorGetPowerSaveModeRequest)
.write_unaligned((self as *const DeviceMonitorGetPowerSaveModeRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest, 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::<DeviceMonitorGetPowerSaveModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetPowerSaveModeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetSmeTelemetryRequest {
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 DeviceMonitorGetSmeTelemetryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
DeviceMonitorGetSmeTelemetryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceMonitorGetSmeTelemetryRequest
{
#[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::<DeviceMonitorGetSmeTelemetryRequest>(offset);
fidl::encoding::Encode::<
DeviceMonitorGetSmeTelemetryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.telemetry_server,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceMonitorGetSmeTelemetryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorGetSmeTelemetryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
telemetry_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffff0000u32;
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!(
u16,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.telemetry_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorGetSupportedMacRolesRequest, D>
for &DeviceMonitorGetSupportedMacRolesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorGetSupportedMacRolesRequest).write_unaligned(
(self as *const DeviceMonitorGetSupportedMacRolesRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest, 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::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetSupportedMacRolesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorListIfacesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListIfacesResponse {
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<DeviceMonitorListIfacesResponse, D>
for &DeviceMonitorListIfacesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorListIfacesResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_list),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
> fidl::encoding::Encode<DeviceMonitorListIfacesResponse, 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::<DeviceMonitorListIfacesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorListIfacesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { iface_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, 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::UnboundedVector<u16>,
D,
&mut self.iface_list,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorListPhysResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorListPhysResponse {
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<DeviceMonitorListPhysResponse, D>
for &DeviceMonitorListPhysResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorListPhysResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_list),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>, D>,
> fidl::encoding::Encode<DeviceMonitorListPhysResponse, 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::<DeviceMonitorListPhysResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorListPhysResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>, 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::UnboundedVector<u16>,
D,
&mut self.phy_list,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorQueryIfaceRequest, D>
for &DeviceMonitorQueryIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorQueryIfaceRequest)
.write_unaligned((self as *const DeviceMonitorQueryIfaceRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest, 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::<DeviceMonitorQueryIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorQueryIfaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorSetCountryRequest, D>
for &DeviceMonitorSetCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorSetCountryRequest)
.write_unaligned((self as *const DeviceMonitorSetCountryRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetCountryRequest, D>>
fidl::encoding::Encode<DeviceMonitorSetCountryRequest, 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::<DeviceMonitorSetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorSetCountryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(SetCountryRequest, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetCountryResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorSetCountryResponse, D>
for &DeviceMonitorSetCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorSetCountryResponse)
.write_unaligned((self as *const DeviceMonitorSetCountryResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DeviceMonitorSetCountryResponse, 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::<DeviceMonitorSetCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorSetCountryResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, D>
for &DeviceMonitorSetPowerSaveModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorSetPowerSaveModeRequest, D>::encode(
(<SetPowerSaveModeRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<SetPowerSaveModeRequest, D>,
> fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest, 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::<DeviceMonitorSetPowerSaveModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorSetPowerSaveModeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(SetPowerSaveModeRequest, 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!(SetPowerSaveModeRequest, D, &mut self.req, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorSetPowerSaveModeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, D>
for &DeviceMonitorSetPowerSaveModeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorSetPowerSaveModeResponse)
.write_unaligned((self as *const DeviceMonitorSetPowerSaveModeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse, 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::<DeviceMonitorSetPowerSaveModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorSetPowerSaveModeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceMonitorWatchDevicesRequest {
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 DeviceMonitorWatchDevicesRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
DeviceMonitorWatchDevicesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceMonitorWatchDevicesRequest
{
#[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::<DeviceMonitorWatchDevicesRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorWatchDevicesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DeviceMonitorWatchDevicesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceMonitorWatchDevicesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
watcher: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.watcher,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetCountryResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceMonitorGetCountryResponse, D>
for &DeviceMonitorGetCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceMonitorGetCountryResponse)
.write_unaligned((self as *const DeviceMonitorGetCountryResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GetCountryResponse, D>>
fidl::encoding::Encode<DeviceMonitorGetCountryResponse, 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::<DeviceMonitorGetCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetCountryResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(GetCountryResponse, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetPowerSaveModeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, D>
for &DeviceMonitorGetPowerSaveModeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorGetPowerSaveModeResponse, D>::encode(
(<GetPowerSaveModeResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<GetPowerSaveModeResponse, D>,
> fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse, 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::<DeviceMonitorGetPowerSaveModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetPowerSaveModeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(GetPowerSaveModeResponse, 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!(
GetPowerSaveModeResponse,
D,
&mut self.resp,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
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<DeviceMonitorGetSupportedMacRolesResponse, D>
for &DeviceMonitorGetSupportedMacRolesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorGetSupportedMacRolesResponse, D>::encode(
(
<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>,
D,
>,
> fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse, 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::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorGetSupportedMacRolesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>, D, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorQueryIfaceResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, D>
for &DeviceMonitorQueryIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorQueryIfaceResponse, D>::encode(
(<QueryIfaceResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<QueryIfaceResponse, D>>
fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse, 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::<DeviceMonitorQueryIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceMonitorQueryIfaceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(QueryIfaceResponse, 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!(QueryIfaceResponse, D, &mut self.resp, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceAddedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceAddedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceWatcherOnIfaceAddedRequest, D>
for &DeviceWatcherOnIfaceAddedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceWatcherOnIfaceAddedRequest)
.write_unaligned((self as *const DeviceWatcherOnIfaceAddedRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest, 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::<DeviceWatcherOnIfaceAddedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatcherOnIfaceAddedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceRemovedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnIfaceRemovedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceWatcherOnIfaceRemovedRequest, D>
for &DeviceWatcherOnIfaceRemovedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceWatcherOnIfaceRemovedRequest)
.write_unaligned((self as *const DeviceWatcherOnIfaceRemovedRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest, 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::<DeviceWatcherOnIfaceRemovedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatcherOnIfaceRemovedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyAddedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyAddedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceWatcherOnPhyAddedRequest, D>
for &DeviceWatcherOnPhyAddedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceWatcherOnPhyAddedRequest)
.write_unaligned((self as *const DeviceWatcherOnPhyAddedRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest, 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::<DeviceWatcherOnPhyAddedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatcherOnPhyAddedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyRemovedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceWatcherOnPhyRemovedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<DeviceWatcherOnPhyRemovedRequest, D>
for &DeviceWatcherOnPhyRemovedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceWatcherOnPhyRemovedRequest)
.write_unaligned((self as *const DeviceWatcherOnPhyRemovedRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest, 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::<DeviceWatcherOnPhyRemovedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DeviceWatcherOnPhyRemovedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GetCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GetCountryResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[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<GetCountryResponse, D>
for &GetCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetCountryResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut GetCountryResponse)
.write_unaligned((self as *const GetCountryResponse).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
> fidl::encoding::Encode<GetCountryResponse, 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::<GetCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetCountryResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, 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, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GetPowerSaveModeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GetPowerSaveModeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<GetPowerSaveModeResponse, D> for &GetPowerSaveModeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
fidl::encoding::Encode::<GetPowerSaveModeResponse, D>::encode(
(
<fidl_fuchsia_wlan_common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::PowerSaveType, D>,
> fidl::encoding::Encode<GetPowerSaveModeResponse, 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::<GetPowerSaveModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GetPowerSaveModeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common::PowerSaveType, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_wlan_common::PowerSaveType,
D,
&mut self.ps_mode,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for QueryIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for QueryIfaceResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<QueryIfaceResponse, D>
for &QueryIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
fidl::encoding::Encode::<QueryIfaceResponse, D>::encode(
(
<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_assigned_id),
<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanMacRole, D>,
T1: fidl::encoding::Encode<u16, D>,
T2: fidl::encoding::Encode<u16, D>,
T3: fidl::encoding::Encode<u16, D>,
T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
> fidl::encoding::Encode<QueryIfaceResponse, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 6, depth)?;
self.3.encode(encoder, offset + 8, depth)?;
self.4.encode(encoder, offset + 10, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for QueryIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
role: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D),
id: fidl::new_empty!(u16, D),
phy_id: fidl::new_empty!(u16, D),
phy_assigned_id: fidl::new_empty!(u16, D),
sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_wlan_common::WlanMacRole,
D,
&mut self.role,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u16, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(u16, D, &mut self.phy_id, decoder, offset + 6, _depth)?;
fidl::decode!(u16, D, &mut self.phy_assigned_id, decoder, offset + 8, _depth)?;
fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 10, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCountryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryRequest, D>
for &SetCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCountryRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetCountryRequest)
.write_unaligned((self as *const SetCountryRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
> fidl::encoding::Encode<SetCountryRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 2, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
phy_id: fidl::new_empty!(u16, D),
alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetPowerSaveModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetPowerSaveModeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SetPowerSaveModeRequest, D> for &SetPowerSaveModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
fidl::encoding::Encode::<SetPowerSaveModeRequest, D>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
<fidl_fuchsia_wlan_common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::PowerSaveType, D>,
> fidl::encoding::Encode<SetPowerSaveModeRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetPowerSaveModeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
phy_id: fidl::new_empty!(u16, D),
ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common::PowerSaveType, 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 u32).read_unaligned() };
let mask = 0xffff0000u32;
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!(u16, D, &mut self.phy_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::PowerSaveType,
D,
&mut self.ps_mode,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl DeviceMonitorCreateIfaceRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.sta_address {
return 3;
}
if let Some(_) = self.role {
return 2;
}
if let Some(_) = self.phy_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceRequest {
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<DeviceMonitorCreateIfaceRequest, D>
for &DeviceMonitorCreateIfaceRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorCreateIfaceRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.phy_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanMacRole, D>(
self.role.as_ref().map(<fidl_fuchsia_wlan_common::WlanMacRole 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::<fidl::encoding::Array<u8, 6>, D>(
self.sta_address
.as_ref()
.map(<fidl::encoding::Array<u8, 6> 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 DeviceMonitorCreateIfaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 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.phy_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_wlan_common::WlanMacRole 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.role.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D)
});
fidl::decode!(
fidl_fuchsia_wlan_common::WlanMacRole,
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 =
<fidl::encoding::Array<u8, 6> 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
.sta_address
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl DeviceMonitorCreateIfaceResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.iface_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceResponse {
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<DeviceMonitorCreateIfaceResponse, D>
for &DeviceMonitorCreateIfaceResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorCreateIfaceResponse>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.iface_id.as_ref().map(<u16 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 DeviceMonitorCreateIfaceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 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.iface_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GetIfaceCounterStatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GetIfaceCounterStatsResponse {
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<GetIfaceCounterStatsResponse, D> for &GetIfaceCounterStatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetIfaceCounterStatsResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
GetIfaceCounterStatsResponse::Stats(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_wlan_stats::IfaceCounterStats, D>(
<fidl_fuchsia_wlan_stats::IfaceCounterStats as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
GetIfaceCounterStatsResponse::ErrorStatus(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GetIfaceCounterStatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceCounterStats, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl_fuchsia_wlan_stats::IfaceCounterStats as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let GetIfaceCounterStatsResponse::Stats(_) = self {
} else {
*self = GetIfaceCounterStatsResponse::Stats(fidl::new_empty!(
fidl_fuchsia_wlan_stats::IfaceCounterStats,
D
));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceCounterStatsResponse::Stats(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_wlan_stats::IfaceCounterStats,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let GetIfaceCounterStatsResponse::ErrorStatus(_) = self {
} else {
*self = GetIfaceCounterStatsResponse::ErrorStatus(fidl::new_empty!(i32, D));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceCounterStatsResponse::ErrorStatus(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GetIfaceHistogramStatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GetIfaceHistogramStatsResponse {
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<GetIfaceHistogramStatsResponse, D>
for &GetIfaceHistogramStatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetIfaceHistogramStatsResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
GetIfaceHistogramStatsResponse::Stats(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_wlan_stats::IfaceHistogramStats, D>(
<fidl_fuchsia_wlan_stats::IfaceHistogramStats as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
GetIfaceHistogramStatsResponse::ErrorStatus(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GetIfaceHistogramStatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceHistogramStats, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl_fuchsia_wlan_stats::IfaceHistogramStats as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let GetIfaceHistogramStatsResponse::Stats(_) = self {
} else {
*self = GetIfaceHistogramStatsResponse::Stats(fidl::new_empty!(
fidl_fuchsia_wlan_stats::IfaceHistogramStats,
D
));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceHistogramStatsResponse::Stats(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_wlan_stats::IfaceHistogramStats,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let GetIfaceHistogramStatsResponse::ErrorStatus(_) = self {
} else {
*self =
GetIfaceHistogramStatsResponse::ErrorStatus(fidl::new_empty!(i32, D));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceHistogramStatsResponse::ErrorStatus(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}