#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AddIfaceRequest {
pub phy_id: u16,
pub assigned_iface_id: u16,
pub iface: fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_mlme::MlmeMarker>,
pub generic_sme: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::GenericSmeMarker>,
}
impl fidl::Standalone for AddIfaceRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AddIfaceResponse {
pub iface_id: u16,
}
impl fidl::Persistable for AddIfaceResponse {}
#[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)]
pub struct CreateIfaceRequest {
pub phy_id: u16,
pub role: fidl_fuchsia_wlan_common::WlanMacRole,
pub sta_addr: [u8; 6],
}
impl fidl::Persistable for CreateIfaceRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CreateIfaceResponse {
pub iface_id: u16,
}
impl fidl::Persistable for CreateIfaceResponse {}
#[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)]
pub struct DeviceMonitorCreateIfaceRequest {
pub req: CreateIfaceRequest,
}
impl fidl::Persistable for DeviceMonitorCreateIfaceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceMonitorCreateIfaceResponse {
pub status: i32,
pub resp: Option<Box<CreateIfaceResponse>>,
}
impl fidl::Persistable for DeviceMonitorCreateIfaceResponse {}
#[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 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 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 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 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 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(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceServiceAddIfaceRequest {
pub req: AddIfaceRequest,
}
impl fidl::Standalone for DeviceServiceAddIfaceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceServiceAddIfaceResponse {
pub status: i32,
pub iface_id: Option<Box<AddIfaceResponse>>,
}
impl fidl::Persistable for DeviceServiceAddIfaceResponse {}
#[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, 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 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<(i32, Option<Box<CreateIfaceResponse>>), fidl::Error>>
+ Send;
fn r#create_iface(&self, req: &CreateIfaceRequest) -> 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::Time) -> Result<DeviceMonitorEvent, fidl::Error> {
DeviceMonitorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#list_phys(&self, ___deadline: zx::Time) -> 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::Time) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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 req: &CreateIfaceRequest,
___deadline: zx::Time,
) -> Result<(i32, Option<Box<CreateIfaceResponse>>), fidl::Error> {
let _response = self
.client
.send_query::<DeviceMonitorCreateIfaceRequest, DeviceMonitorCreateIfaceResponse>(
(req,),
0x1e1d30c24c0ec144,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.resp))
}
pub fn r#query_iface(
&self,
mut iface_id: u16,
___deadline: zx::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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::Time,
) -> 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,
}
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>> {
DeviceMonitorProxyInterface::r#list_phys(self)
}
pub fn r#list_ifaces(&self) -> fidl::client::QueryResponseFut<Vec<u16>> {
DeviceMonitorProxyInterface::r#list_ifaces(self)
}
pub fn r#get_dev_path(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<Option<String>> {
DeviceMonitorProxyInterface::r#get_dev_path(self, phy_id)
}
pub fn r#get_supported_mac_roles(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<DeviceMonitorGetSupportedMacRolesResult> {
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> {
DeviceMonitorProxyInterface::r#get_country(self, phy_id)
}
pub fn r#set_country(
&self,
mut req: &SetCountryRequest,
) -> fidl::client::QueryResponseFut<i32> {
DeviceMonitorProxyInterface::r#set_country(self, req)
}
pub fn r#clear_country(
&self,
mut req: &ClearCountryRequest,
) -> fidl::client::QueryResponseFut<i32> {
DeviceMonitorProxyInterface::r#clear_country(self, req)
}
pub fn r#set_power_save_mode(
&self,
mut req: &SetPowerSaveModeRequest,
) -> fidl::client::QueryResponseFut<i32> {
DeviceMonitorProxyInterface::r#set_power_save_mode(self, req)
}
pub fn r#get_power_save_mode(
&self,
mut phy_id: u16,
) -> fidl::client::QueryResponseFut<DeviceMonitorGetPowerSaveModeResult> {
DeviceMonitorProxyInterface::r#get_power_save_mode(self, phy_id)
}
pub fn r#create_iface(
&self,
mut req: &CreateIfaceRequest,
) -> fidl::client::QueryResponseFut<(i32, Option<Box<CreateIfaceResponse>>)> {
DeviceMonitorProxyInterface::r#create_iface(self, req)
}
pub fn r#query_iface(
&self,
mut iface_id: u16,
) -> fidl::client::QueryResponseFut<DeviceMonitorQueryIfaceResult> {
DeviceMonitorProxyInterface::r#query_iface(self, iface_id)
}
pub fn r#destroy_iface(
&self,
mut req: &DestroyIfaceRequest,
) -> fidl::client::QueryResponseFut<i32> {
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> {
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> {
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> {
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> {
DeviceMonitorProxyInterface::r#get_feature_support(self, iface_id, feature_support_server)
}
}
impl DeviceMonitorProxyInterface for DeviceMonitorProxy {
type ListPhysResponseFut = fidl::client::QueryResponseFut<Vec<u16>>;
fn r#list_phys(&self) -> Self::ListPhysResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u16>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorListPhysResponse,
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>>;
fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u16>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorListIfacesResponse,
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>>;
fn r#get_dev_path(&self, mut phy_id: u16) -> Self::GetDevPathResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Option<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorGetDevPathResponse,
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>;
fn r#get_supported_mac_roles(&self, mut phy_id: u16) -> Self::GetSupportedMacRolesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
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>;
fn r#get_country(&self, mut phy_id: u16) -> Self::GetCountryResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
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>;
fn r#set_country(&self, mut req: &SetCountryRequest) -> Self::SetCountryResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorSetCountryResponse,
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>;
fn r#clear_country(&self, mut req: &ClearCountryRequest) -> Self::ClearCountryResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorClearCountryResponse,
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>;
fn r#set_power_save_mode(
&self,
mut req: &SetPowerSaveModeRequest,
) -> Self::SetPowerSaveModeResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorSetPowerSaveModeResponse,
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>;
fn r#get_power_save_mode(&self, mut phy_id: u16) -> Self::GetPowerSaveModeResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
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<(i32, Option<Box<CreateIfaceResponse>>)>;
fn r#create_iface(&self, mut req: &CreateIfaceRequest) -> Self::CreateIfaceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<CreateIfaceResponse>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorCreateIfaceResponse,
0x1e1d30c24c0ec144,
>(_buf?)?;
Ok((_response.status, _response.resp))
}
self.client.send_query_and_decode::<
DeviceMonitorCreateIfaceRequest,
(i32, Option<Box<CreateIfaceResponse>>),
>(
(req,),
0x1e1d30c24c0ec144,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryIfaceResponseFut = fidl::client::QueryResponseFut<DeviceMonitorQueryIfaceResult>;
fn r#query_iface(&self, mut iface_id: u16) -> Self::QueryIfaceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
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>;
fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceMonitorDestroyIfaceResponse,
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>;
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::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
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::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
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::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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>;
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::MessageBufEtc, fidl::Error>,
) -> Result<DeviceMonitorGetFeatureSupportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
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,
}
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::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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(|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(e))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3a08518874196aab => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = 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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::decode_into::<DeviceMonitorCreateIfaceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceMonitorControlHandle { inner: this.inner.clone() };
Ok(DeviceMonitorRequest::CreateIface {
req: req.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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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 {
req: CreateIfaceRequest,
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<(CreateIfaceRequest, DeviceMonitorCreateIfaceResponder)> {
if let DeviceMonitorRequest::CreateIface { req, responder } = self {
Some((req, 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>,
}
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()
}
}
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 status: i32,
mut resp: Option<&CreateIfaceResponse>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, resp);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut resp: Option<&CreateIfaceResponse>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, resp);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut resp: Option<&CreateIfaceResponse>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceMonitorCreateIfaceResponse>(
(status, resp),
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 DeviceServiceMarker;
impl fidl::endpoints::ProtocolMarker for DeviceServiceMarker {
type Proxy = DeviceServiceProxy;
type RequestStream = DeviceServiceRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceServiceSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.wlan.device.service.DeviceService";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DeviceServiceMarker {}
pub trait DeviceServiceProxyInterface: Send + Sync {
type AddIfaceResponseFut: std::future::Future<Output = Result<(i32, Option<Box<AddIfaceResponse>>), fidl::Error>>
+ Send;
fn r#add_iface(&self, req: AddIfaceRequest) -> Self::AddIfaceResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceServiceSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceServiceSynchronousProxy {
type Proxy = DeviceServiceProxy;
type Protocol = DeviceServiceMarker;
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 DeviceServiceSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceServiceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(&self, deadline: zx::Time) -> Result<DeviceServiceEvent, fidl::Error> {
DeviceServiceEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#add_iface(
&self,
mut req: AddIfaceRequest,
___deadline: zx::Time,
) -> Result<(i32, Option<Box<AddIfaceResponse>>), fidl::Error> {
let _response =
self.client.send_query::<DeviceServiceAddIfaceRequest, DeviceServiceAddIfaceResponse>(
(&mut req,),
0x21f009ef858b35e7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.iface_id))
}
}
#[derive(Debug, Clone)]
pub struct DeviceServiceProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DeviceServiceProxy {
type Protocol = DeviceServiceMarker;
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 DeviceServiceProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceServiceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceServiceEventStream {
DeviceServiceEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#add_iface(
&self,
mut req: AddIfaceRequest,
) -> fidl::client::QueryResponseFut<(i32, Option<Box<AddIfaceResponse>>)> {
DeviceServiceProxyInterface::r#add_iface(self, req)
}
}
impl DeviceServiceProxyInterface for DeviceServiceProxy {
type AddIfaceResponseFut = fidl::client::QueryResponseFut<(i32, Option<Box<AddIfaceResponse>>)>;
fn r#add_iface(&self, mut req: AddIfaceRequest) -> Self::AddIfaceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<AddIfaceResponse>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceServiceAddIfaceResponse,
0x21f009ef858b35e7,
>(_buf?)?;
Ok((_response.status, _response.iface_id))
}
self.client.send_query_and_decode::<
DeviceServiceAddIfaceRequest,
(i32, Option<Box<AddIfaceResponse>>),
>(
(&mut req,),
0x21f009ef858b35e7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DeviceServiceEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DeviceServiceEventStream {}
impl futures::stream::FusedStream for DeviceServiceEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceServiceEventStream {
type Item = Result<DeviceServiceEvent, 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(DeviceServiceEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceServiceEvent {}
impl DeviceServiceEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DeviceServiceEvent, 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: <DeviceServiceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceServiceRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceServiceRequestStream {}
impl futures::stream::FusedStream for DeviceServiceRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceServiceRequestStream {
type Protocol = DeviceServiceMarker;
type ControlHandle = DeviceServiceControlHandle;
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 {
DeviceServiceControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for DeviceServiceRequestStream {
type Item = Result<DeviceServiceRequest, 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 DeviceServiceRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(e))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x21f009ef858b35e7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DeviceServiceAddIfaceRequest);
fidl::encoding::Decoder::decode_into::<DeviceServiceAddIfaceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceServiceControlHandle { inner: this.inner.clone() };
Ok(DeviceServiceRequest::AddIface {
req: req.req,
responder: DeviceServiceAddIfaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceServiceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DeviceServiceRequest {
AddIface { req: AddIfaceRequest, responder: DeviceServiceAddIfaceResponder },
}
impl DeviceServiceRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_add_iface(self) -> Option<(AddIfaceRequest, DeviceServiceAddIfaceResponder)> {
if let DeviceServiceRequest::AddIface { req, responder } = self {
Some((req, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceServiceRequest::AddIface { .. } => "add_iface",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceServiceControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DeviceServiceControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
}
impl DeviceServiceControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceServiceAddIfaceResponder {
control_handle: std::mem::ManuallyDrop<DeviceServiceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceServiceAddIfaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceServiceAddIfaceResponder {
type ControlHandle = DeviceServiceControlHandle;
fn control_handle(&self) -> &DeviceServiceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceServiceAddIfaceResponder {
pub fn send(
self,
mut status: i32,
mut iface_id: Option<&AddIfaceResponse>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, iface_id);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut iface_id: Option<&AddIfaceResponse>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, iface_id);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut iface_id: Option<&AddIfaceResponse>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceServiceAddIfaceResponse>(
(status, iface_id),
self.tx_id,
0x21f009ef858b35e7,
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::Time) -> Result<DeviceWatcherEvent, fidl::Error> {
DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct DeviceWatcherProxy {
client: fidl::client::Client,
}
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,
}
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::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::Decoder::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::Decoder::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::Decoder::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::Decoder::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>,
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>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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(|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(e))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
_ => 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>,
}
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()
}
}
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 AddIfaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
impl fidl::encoding::ResourceTypeMarker for AddIfaceRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<AddIfaceRequest> for &mut AddIfaceRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddIfaceRequest>(offset);
fidl::encoding::Encode::<AddIfaceRequest>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.assigned_iface_id),
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_mlme::MlmeMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iface
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::GenericSmeMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.generic_sme
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u16>,
T1: fidl::encoding::Encode<u16>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_mlme::MlmeMarker>,
>,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::GenericSmeMarker>,
>,
>,
> fidl::encoding::Encode<AddIfaceRequest> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 2, depth)?;
self.2.encode(encoder, offset + 4, depth)?;
self.3.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for AddIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
phy_id: fidl::new_empty!(u16),
assigned_iface_id: fidl::new_empty!(u16),
iface: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_mlme::MlmeMarker>,
>
),
generic_sme: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::GenericSmeMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u16, &mut self.phy_id, decoder, offset + 0, _depth)?;
fidl::decode!(u16, &mut self.assigned_iface_id, decoder, offset + 2, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_wlan_mlme::MlmeMarker>,
>,
&mut self.iface,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::GenericSmeMarker>,
>,
&mut self.generic_sme,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for AddIfaceResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for AddIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<AddIfaceResponse> for &AddIfaceResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddIfaceResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AddIfaceResponse)
.write_unaligned((self as *const AddIfaceResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u16>> fidl::encoding::Encode<AddIfaceResponse> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for AddIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for ClearCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ClearCountryRequest> for &ClearCountryRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>> fidl::encoding::Encode<ClearCountryRequest> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClearCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ClearCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for CreateIfaceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for CreateIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CreateIfaceRequest> for &CreateIfaceRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
fidl::encoding::Encode::<CreateIfaceRequest>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_id),
<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u16>,
T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanMacRole>,
T2: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>>,
> fidl::encoding::Encode<CreateIfaceRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(12);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CreateIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
phy_id: fidl::new_empty!(u16),
role: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole),
sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const 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,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(12) };
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 + 12 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u16, &mut self.phy_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::WlanMacRole,
&mut self.role,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(fidl::encoding::Array<u8, 6>, &mut self.sta_addr, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for CreateIfaceResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for CreateIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CreateIfaceResponse> for &CreateIfaceResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateIfaceResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CreateIfaceResponse)
.write_unaligned((self as *const CreateIfaceResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u16>> fidl::encoding::Encode<CreateIfaceResponse> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CreateIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DestroyIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DestroyIfaceRequest> for &DestroyIfaceRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>> fidl::encoding::Encode<DestroyIfaceRequest> for (T0,) {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DestroyIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DestroyIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorClearCountryRequest>
for &DeviceMonitorClearCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<ClearCountryRequest>>
fidl::encoding::Encode<DeviceMonitorClearCountryRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorClearCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorClearCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(ClearCountryRequest) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorClearCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorClearCountryResponse>
for &DeviceMonitorClearCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<DeviceMonitorClearCountryResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorClearCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorClearCountryResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceMonitorCreateIfaceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorCreateIfaceRequest>
for &DeviceMonitorCreateIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorCreateIfaceRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorCreateIfaceRequest>::encode(
(<CreateIfaceRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<CreateIfaceRequest>>
fidl::encoding::Encode<DeviceMonitorCreateIfaceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorCreateIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorCreateIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(CreateIfaceRequest) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(CreateIfaceRequest, &mut self.req, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorCreateIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorCreateIfaceResponse>
for &DeviceMonitorCreateIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorCreateIfaceResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorCreateIfaceResponse>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Boxed<CreateIfaceResponse> as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<CreateIfaceResponse>>,
> fidl::encoding::Encode<DeviceMonitorCreateIfaceResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorCreateIfaceResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorCreateIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
resp: fidl::new_empty!(fidl::encoding::Boxed<CreateIfaceResponse>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(i32, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<CreateIfaceResponse>,
&mut self.resp,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest>
for &DeviceMonitorDestroyIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<DestroyIfaceRequest>>
fidl::encoding::Encode<DeviceMonitorDestroyIfaceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorDestroyIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(DestroyIfaceRequest) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorDestroyIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse>
for &DeviceMonitorDestroyIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<DeviceMonitorDestroyIfaceResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorDestroyIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorDestroyIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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
}
}
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::Encode<DeviceMonitorGetApSmeRequest>
for &mut DeviceMonitorGetApSmeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorGetApSmeRequest>::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>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
>,
>,
> fidl::encoding::Encode<DeviceMonitorGetApSmeRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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> for DeviceMonitorGetApSmeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16),
sme_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const 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, &mut self.iface_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
>,
&mut self.sme_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
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
}
}
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::Encode<DeviceMonitorGetClientSmeRequest>
for &mut DeviceMonitorGetClientSmeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorGetClientSmeRequest>::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>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
>,
>,
> fidl::encoding::Encode<DeviceMonitorGetClientSmeRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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> for DeviceMonitorGetClientSmeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16),
sme_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const 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, &mut self.iface_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
>,
&mut self.sme_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetCountryRequest>
for &DeviceMonitorGetCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceMonitorGetCountryRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetDevPathRequest>
for &DeviceMonitorGetDevPathRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceMonitorGetDevPathRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetDevPathRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetDevPathRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetDevPathResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetDevPathResponse>
for &DeviceMonitorGetDevPathResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorGetDevPathResponse>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.dev_path),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>>>
fidl::encoding::Encode<DeviceMonitorGetDevPathResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetDevPathResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetDevPathResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
dev_path: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
&mut self.dev_path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
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::Encode<DeviceMonitorGetFeatureSupportRequest>
for &mut DeviceMonitorGetFeatureSupportRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetFeatureSupportRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorGetFeatureSupportRequest>::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>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
>,
>,
> fidl::encoding::Encode<DeviceMonitorGetFeatureSupportRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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> for DeviceMonitorGetFeatureSupportRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16),
feature_support_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const 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, &mut self.iface_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::FeatureSupportMarker>,
>,
&mut self.feature_support_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest>
for &DeviceMonitorGetPowerSaveModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetPowerSaveModeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
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::Encode<DeviceMonitorGetSmeTelemetryRequest>
for &mut DeviceMonitorGetSmeTelemetryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorGetSmeTelemetryRequest>::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>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
>,
>,
> fidl::encoding::Encode<DeviceMonitorGetSmeTelemetryRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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> for DeviceMonitorGetSmeTelemetryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
iface_id: fidl::new_empty!(u16),
telemetry_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const 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, &mut self.iface_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
>,
&mut self.telemetry_server,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest>
for &DeviceMonitorGetSupportedMacRolesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetSupportedMacRolesRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorListIfacesResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorListIfacesResponse>
for &DeviceMonitorListIfacesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorListIfacesResponse>::encode(
(
<fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_list),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>>>
fidl::encoding::Encode<DeviceMonitorListIfacesResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorListIfacesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorListIfacesResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u16>,
&mut self.iface_list,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorListPhysResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorListPhysResponse>
for &DeviceMonitorListPhysResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorListPhysResponse>::encode(
(
<fidl::encoding::UnboundedVector<u16> as fidl::encoding::ValueTypeMarker>::borrow(&self.phy_list),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u16>>>
fidl::encoding::Encode<DeviceMonitorListPhysResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorListPhysResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorListPhysResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_list: fidl::new_empty!(fidl::encoding::UnboundedVector<u16>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u16>,
&mut self.phy_list,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest>
for &DeviceMonitorQueryIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceMonitorQueryIfaceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorQueryIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorQueryIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorSetCountryRequest>
for &DeviceMonitorSetCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<SetCountryRequest>>
fidl::encoding::Encode<DeviceMonitorSetCountryRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorSetCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(SetCountryRequest) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorSetCountryResponse>
for &DeviceMonitorSetCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<DeviceMonitorSetCountryResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorSetCountryResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest>
for &DeviceMonitorSetPowerSaveModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorSetPowerSaveModeRequest>::encode(
(<SetPowerSaveModeRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<SetPowerSaveModeRequest>>
fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorSetPowerSaveModeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(SetPowerSaveModeRequest) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(SetPowerSaveModeRequest, &mut self.req, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorSetPowerSaveModeResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse>
for &DeviceMonitorSetPowerSaveModeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<DeviceMonitorSetPowerSaveModeResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorSetPowerSaveModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorSetPowerSaveModeResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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
}
}
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::Encode<DeviceMonitorWatchDevicesRequest>
for &mut DeviceMonitorWatchDevicesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
fidl::encoding::Encode::<DeviceMonitorWatchDevicesRequest>::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::Encode<DeviceMonitorWatchDevicesRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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> for DeviceMonitorWatchDevicesRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
watcher: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
&mut self.watcher,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetCountryResponse>
for &DeviceMonitorGetCountryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<GetCountryResponse>>
fidl::encoding::Encode<DeviceMonitorGetCountryResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetCountryResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(GetCountryResponse) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetPowerSaveModeResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse>
for &DeviceMonitorGetPowerSaveModeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorGetPowerSaveModeResponse>::encode(
(<GetPowerSaveModeResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<GetPowerSaveModeResponse>>
fidl::encoding::Encode<DeviceMonitorGetPowerSaveModeResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetPowerSaveModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetPowerSaveModeResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(GetPowerSaveModeResponse) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(GetPowerSaveModeResponse, &mut self.resp, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorGetSupportedMacRolesResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse>
for &DeviceMonitorGetSupportedMacRolesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorGetSupportedMacRolesResponse>::encode(
(
<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_mac_roles),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>,
>,
> fidl::encoding::Encode<DeviceMonitorGetSupportedMacRolesResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorGetSupportedMacRolesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorGetSupportedMacRolesResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
supported_mac_roles: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanMacRole, 16>, &mut self.supported_mac_roles, decoder, offset + 0, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceMonitorQueryIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse>
for &DeviceMonitorQueryIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
fidl::encoding::Encode::<DeviceMonitorQueryIfaceResponse>::encode(
(<QueryIfaceResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<QueryIfaceResponse>>
fidl::encoding::Encode<DeviceMonitorQueryIfaceResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceMonitorQueryIfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceMonitorQueryIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { resp: fidl::new_empty!(QueryIfaceResponse) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(QueryIfaceResponse, &mut self.resp, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceServiceAddIfaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceServiceAddIfaceRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceServiceAddIfaceRequest>
for &mut DeviceServiceAddIfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceServiceAddIfaceRequest>(offset);
fidl::encoding::Encode::<DeviceServiceAddIfaceRequest>::encode(
(<AddIfaceRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.req,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<AddIfaceRequest>>
fidl::encoding::Encode<DeviceServiceAddIfaceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceServiceAddIfaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceServiceAddIfaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { req: fidl::new_empty!(AddIfaceRequest) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(AddIfaceRequest, &mut self.req, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceServiceAddIfaceResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
impl fidl::encoding::ValueTypeMarker for DeviceServiceAddIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceServiceAddIfaceResponse>
for &DeviceServiceAddIfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceServiceAddIfaceResponse>(offset);
fidl::encoding::Encode::<DeviceServiceAddIfaceResponse>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Boxed<AddIfaceResponse> as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<AddIfaceResponse>>,
> fidl::encoding::Encode<DeviceServiceAddIfaceResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceServiceAddIfaceResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceServiceAddIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
iface_id: fidl::new_empty!(fidl::encoding::Boxed<AddIfaceResponse>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(i32, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<AddIfaceResponse>,
&mut self.iface_id,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceAddedRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest>
for &DeviceWatcherOnIfaceAddedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceWatcherOnIfaceAddedRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnIfaceAddedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceWatcherOnIfaceAddedRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnIfaceRemovedRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest>
for &DeviceWatcherOnIfaceRemovedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceWatcherOnIfaceRemovedRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnIfaceRemovedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceWatcherOnIfaceRemovedRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { iface_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyAddedRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest>
for &DeviceWatcherOnPhyAddedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceWatcherOnPhyAddedRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnPhyAddedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceWatcherOnPhyAddedRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceWatcherOnPhyRemovedRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest>
for &DeviceWatcherOnPhyRemovedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<u16>>
fidl::encoding::Encode<DeviceWatcherOnPhyRemovedRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceWatcherOnPhyRemovedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceWatcherOnPhyRemovedRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { phy_id: fidl::new_empty!(u16) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for GetCountryResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<GetCountryResponse> for &GetCountryResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>>>
fidl::encoding::Encode<GetCountryResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetCountryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for GetCountryResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for GetPowerSaveModeResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<GetPowerSaveModeResponse> for &GetPowerSaveModeResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
fidl::encoding::Encode::<GetPowerSaveModeResponse>::encode(
(
<fidl_fuchsia_wlan_common::PowerSaveType as fidl::encoding::ValueTypeMarker>::borrow(&self.ps_mode),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::PowerSaveType>>
fidl::encoding::Encode<GetPowerSaveModeResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GetPowerSaveModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for GetPowerSaveModeResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common::PowerSaveType) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_wlan_common::PowerSaveType,
&mut self.ps_mode,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for QueryIfaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<QueryIfaceResponse> for &QueryIfaceResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<QueryIfaceResponse>(offset);
fidl::encoding::Encode::<QueryIfaceResponse>::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<
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanMacRole>,
T1: fidl::encoding::Encode<u16>,
T2: fidl::encoding::Encode<u16>,
T3: fidl::encoding::Encode<u16>,
T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>>,
> fidl::encoding::Encode<QueryIfaceResponse> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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 fidl::encoding::Decode<Self> for QueryIfaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
role: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole),
id: fidl::new_empty!(u16),
phy_id: fidl::new_empty!(u16),
phy_assigned_id: fidl::new_empty!(u16),
sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_wlan_common::WlanMacRole,
&mut self.role,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u16, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(u16, &mut self.phy_id, decoder, offset + 6, _depth)?;
fidl::decode!(u16, &mut self.phy_assigned_id, decoder, offset + 8, _depth)?;
fidl::decode!(fidl::encoding::Array<u8, 6>, &mut self.sta_addr, decoder, offset + 10, _depth)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for SetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<SetCountryRequest> for &SetCountryRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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<
T0: fidl::encoding::Encode<u16>,
T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>>,
> fidl::encoding::Encode<SetCountryRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 2, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for SetCountryRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
phy_id: fidl::new_empty!(u16),
alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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
}
}
impl fidl::encoding::ValueTypeMarker for SetPowerSaveModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<SetPowerSaveModeRequest> for &SetPowerSaveModeRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetPowerSaveModeRequest>(offset);
fidl::encoding::Encode::<SetPowerSaveModeRequest>::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<
T0: fidl::encoding::Encode<u16>,
T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::PowerSaveType>,
> fidl::encoding::Encode<SetPowerSaveModeRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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 fidl::encoding::Decode<Self> for SetPowerSaveModeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
phy_id: fidl::new_empty!(u16),
ps_mode: fidl::new_empty!(fidl_fuchsia_wlan_common::PowerSaveType),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const 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, &mut self.phy_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::PowerSaveType,
&mut self.ps_mode,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for GetIfaceCounterStatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<GetIfaceCounterStatsResponse> for &GetIfaceCounterStatsResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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>(
<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>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl fidl::encoding::Decode<Self> for GetIfaceCounterStatsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceCounterStats))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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
));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceCounterStatsResponse::Stats(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_wlan_stats::IfaceCounterStats,
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));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceCounterStatsResponse::ErrorStatus(ref mut val) = self {
fidl::decode!(i32, 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(())
}
}
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
}
}
impl fidl::encoding::ValueTypeMarker for GetIfaceHistogramStatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<GetIfaceHistogramStatsResponse>
for &GetIfaceHistogramStatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
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>(
<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>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl fidl::encoding::Decode<Self> for GetIfaceHistogramStatsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self::Stats(fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceHistogramStats))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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
));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceHistogramStatsResponse::Stats(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_wlan_stats::IfaceHistogramStats,
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));
}
#[allow(irrefutable_let_patterns)]
if let GetIfaceHistogramStatsResponse::ErrorStatus(ref mut val) = self {
fidl::decode!(i32, 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(())
}
}
}