#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Clone, Debug, PartialEq)]
pub struct JoinBssArgs {
pub wlan_softmac_id: u16,
pub config: fidl_fuchsia_wlan_common::JoinBssRequest,
}
impl fidl::Persistable for JoinBssArgs {}
#[derive(Clone, Debug, PartialEq)]
pub struct SetChannelArgs {
pub wlan_softmac_id: u16,
pub channel: fidl_fuchsia_wlan_common::WlanChannel,
}
impl fidl::Persistable for SetChannelArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SetCountryArgs {
pub alpha2: [u8; 2],
}
impl fidl::Persistable for SetCountryArgs {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SetKeyArgs {
pub wlan_softmac_id: u16,
pub config: WlanKeyConfig,
}
impl fidl::Persistable for SetKeyArgs {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct StartScanArgs {
pub wlan_softmac_id: u16,
pub scan_id: u64,
}
impl fidl::Persistable for StartScanArgs {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TxArgs {
pub wlan_softmac_id: u16,
pub packet: WlanTxPacket,
}
impl fidl::Persistable for TxArgs {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlanKeyConfig {
pub protection: u8,
pub cipher_oui: [u8; 3],
pub cipher_type: u8,
pub key_type: u8,
pub peer_addr: [u8; 6],
pub key_idx: u8,
pub key: Vec<u8>,
}
impl fidl::Persistable for WlanKeyConfig {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlanRxInfo {
pub rx_flags: u32,
pub valid_fields: u32,
pub phy: fidl_fuchsia_wlan_common::WlanPhyType,
pub data_rate: u32,
pub channel: fidl_fuchsia_wlan_common::WlanChannel,
pub mcs: u8,
pub rssi_dbm: i8,
pub snr_dbh: i16,
}
impl fidl::Persistable for WlanRxInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlanTxInfo {
pub tx_flags: u32,
pub valid_fields: u32,
pub tx_vector_idx: u16,
pub phy: fidl_fuchsia_wlan_common::WlanPhyType,
pub cbw: u8,
pub mcs: u8,
}
impl fidl::Persistable for WlanTxInfo {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlanTxPacket {
pub data: Vec<u8>,
pub info: WlanTxInfo,
}
impl fidl::Persistable for WlanTxPacket {}
#[derive(Debug, PartialEq)]
pub struct WlantapCtlCreatePhyRequest {
pub config: WlantapPhyConfig,
pub proxy: fidl::endpoints::ServerEnd<WlantapPhyMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for WlantapCtlCreatePhyRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WlantapCtlCreatePhyResponse {
pub status: i32,
}
impl fidl::Persistable for WlantapCtlCreatePhyResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlantapPhyConfig {
pub sta_addr: [u8; 6],
pub mac_role: fidl_fuchsia_wlan_common::WlanMacRole,
pub supported_phys: Vec<fidl_fuchsia_wlan_common::WlanPhyType>,
pub hardware_capability: u32,
pub bands: Vec<fidl_fuchsia_wlan_device::BandInfo>,
pub name: String,
pub quiet: bool,
pub discovery_support: fidl_fuchsia_wlan_common::DiscoverySupport,
pub mac_sublayer_support: fidl_fuchsia_wlan_common::MacSublayerSupport,
pub security_support: fidl_fuchsia_wlan_common::SecuritySupport,
pub spectrum_management_support: fidl_fuchsia_wlan_common::SpectrumManagementSupport,
}
impl fidl::Persistable for WlantapPhyConfig {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlantapPhyJoinBssRequest {
pub args: JoinBssArgs,
}
impl fidl::Persistable for WlantapPhyJoinBssRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlantapPhyReportTxResultRequest {
pub txr: fidl_fuchsia_wlan_common::WlanTxResult,
}
impl fidl::Persistable for WlantapPhyReportTxResultRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlantapPhyRxRequest {
pub data: Vec<u8>,
pub info: WlanRxInfo,
}
impl fidl::Persistable for WlantapPhyRxRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WlantapPhyScanCompleteRequest {
pub scan_id: u64,
pub status: i32,
}
impl fidl::Persistable for WlantapPhyScanCompleteRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct WlantapPhySetChannelRequest {
pub args: SetChannelArgs,
}
impl fidl::Persistable for WlantapPhySetChannelRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WlantapPhySetCountryRequest {
pub args: SetCountryArgs,
}
impl fidl::Persistable for WlantapPhySetCountryRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlantapPhySetKeyRequest {
pub args: SetKeyArgs,
}
impl fidl::Persistable for WlantapPhySetKeyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WlantapPhyStartScanRequest {
pub args: StartScanArgs,
}
impl fidl::Persistable for WlantapPhyStartScanRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WlantapPhyTxRequest {
pub args: TxArgs,
}
impl fidl::Persistable for WlantapPhyTxRequest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlantapCtlMarker;
impl fidl::endpoints::ProtocolMarker for WlantapCtlMarker {
type Proxy = WlantapCtlProxy;
type RequestStream = WlantapCtlRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlantapCtlSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlantapCtl";
}
pub trait WlantapCtlProxyInterface: Send + Sync {
type CreatePhyResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#create_phy(
&self,
config: &WlantapPhyConfig,
proxy: fidl::endpoints::ServerEnd<WlantapPhyMarker>,
) -> Self::CreatePhyResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlantapCtlSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlantapCtlSynchronousProxy {
type Proxy = WlantapCtlProxy;
type Protocol = WlantapCtlMarker;
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 WlantapCtlSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WlantapCtlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<WlantapCtlEvent, fidl::Error> {
WlantapCtlEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create_phy(
&self,
mut config: &WlantapPhyConfig,
mut proxy: fidl::endpoints::ServerEnd<WlantapPhyMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<WlantapCtlCreatePhyRequest, WlantapCtlCreatePhyResponse>(
(config, proxy),
0x50273d8f10ceb35d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct WlantapCtlProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlantapCtlProxy {
type Protocol = WlantapCtlMarker;
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 WlantapCtlProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WlantapCtlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlantapCtlEventStream {
WlantapCtlEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create_phy(
&self,
mut config: &WlantapPhyConfig,
mut proxy: fidl::endpoints::ServerEnd<WlantapPhyMarker>,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
WlantapCtlProxyInterface::r#create_phy(self, config, proxy)
}
}
impl WlantapCtlProxyInterface for WlantapCtlProxy {
type CreatePhyResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#create_phy(
&self,
mut config: &WlantapPhyConfig,
mut proxy: fidl::endpoints::ServerEnd<WlantapPhyMarker>,
) -> Self::CreatePhyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
WlantapCtlCreatePhyResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x50273d8f10ceb35d,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<WlantapCtlCreatePhyRequest, i32>(
(config, proxy),
0x50273d8f10ceb35d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WlantapCtlEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlantapCtlEventStream {}
impl futures::stream::FusedStream for WlantapCtlEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlantapCtlEventStream {
type Item = Result<WlantapCtlEvent, 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(WlantapCtlEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlantapCtlEvent {}
impl WlantapCtlEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlantapCtlEvent, 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: <WlantapCtlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlantapCtlRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlantapCtlRequestStream {}
impl futures::stream::FusedStream for WlantapCtlRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlantapCtlRequestStream {
type Protocol = WlantapCtlMarker;
type ControlHandle = WlantapCtlControlHandle;
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 {
WlantapCtlControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for WlantapCtlRequestStream {
type Item = Result<WlantapCtlRequest, 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 WlantapCtlRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x50273d8f10ceb35d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WlantapCtlCreatePhyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapCtlCreatePhyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlantapCtlControlHandle { inner: this.inner.clone() };
Ok(WlantapCtlRequest::CreatePhy {
config: req.config,
proxy: req.proxy,
responder: WlantapCtlCreatePhyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WlantapCtlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlantapCtlRequest {
CreatePhy {
config: WlantapPhyConfig,
proxy: fidl::endpoints::ServerEnd<WlantapPhyMarker>,
responder: WlantapCtlCreatePhyResponder,
},
}
impl WlantapCtlRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_phy(
self,
) -> Option<(
WlantapPhyConfig,
fidl::endpoints::ServerEnd<WlantapPhyMarker>,
WlantapCtlCreatePhyResponder,
)> {
if let WlantapCtlRequest::CreatePhy { config, proxy, responder } = self {
Some((config, proxy, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlantapCtlRequest::CreatePhy { .. } => "create_phy",
}
}
}
#[derive(Debug, Clone)]
pub struct WlantapCtlControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlantapCtlControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl WlantapCtlControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlantapCtlCreatePhyResponder {
control_handle: std::mem::ManuallyDrop<WlantapCtlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlantapCtlCreatePhyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlantapCtlCreatePhyResponder {
type ControlHandle = WlantapCtlControlHandle;
fn control_handle(&self) -> &WlantapCtlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlantapCtlCreatePhyResponder {
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::<WlantapCtlCreatePhyResponse>(
(status,),
self.tx_id,
0x50273d8f10ceb35d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WlantapPhyMarker;
impl fidl::endpoints::ProtocolMarker for WlantapPhyMarker {
type Proxy = WlantapPhyProxy;
type RequestStream = WlantapPhyRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WlantapPhySynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) WlantapPhy";
}
pub trait WlantapPhyProxyInterface: Send + Sync {
type ShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#shutdown(&self) -> Self::ShutdownResponseFut;
fn r#rx(&self, data: &[u8], info: &WlanRxInfo) -> Result<(), fidl::Error>;
fn r#report_tx_result(
&self,
txr: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Result<(), fidl::Error>;
fn r#scan_complete(&self, scan_id: u64, status: i32) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WlantapPhySynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WlantapPhySynchronousProxy {
type Proxy = WlantapPhyProxy;
type Protocol = WlantapPhyMarker;
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 WlantapPhySynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WlantapPhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<WlantapPhyEvent, fidl::Error> {
WlantapPhyEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#shutdown(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x1df8087c49fa9a5e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#rx(&self, mut data: &[u8], mut info: &WlanRxInfo) -> Result<(), fidl::Error> {
self.client.send::<WlantapPhyRxRequest>(
(data, info),
0x165a656419ab3b41,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#report_tx_result(
&self,
mut txr: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Result<(), fidl::Error> {
self.client.send::<WlantapPhyReportTxResultRequest>(
(txr,),
0x2c27ed678c1e7eb4,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#scan_complete(&self, mut scan_id: u64, mut status: i32) -> Result<(), fidl::Error> {
self.client.send::<WlantapPhyScanCompleteRequest>(
(scan_id, status),
0x61a579015cff7674,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct WlantapPhyProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WlantapPhyProxy {
type Protocol = WlantapPhyMarker;
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 WlantapPhyProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WlantapPhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WlantapPhyEventStream {
WlantapPhyEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#shutdown(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
WlantapPhyProxyInterface::r#shutdown(self)
}
pub fn r#rx(&self, mut data: &[u8], mut info: &WlanRxInfo) -> Result<(), fidl::Error> {
WlantapPhyProxyInterface::r#rx(self, data, info)
}
pub fn r#report_tx_result(
&self,
mut txr: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Result<(), fidl::Error> {
WlantapPhyProxyInterface::r#report_tx_result(self, txr)
}
pub fn r#scan_complete(&self, mut scan_id: u64, mut status: i32) -> Result<(), fidl::Error> {
WlantapPhyProxyInterface::r#scan_complete(self, scan_id, status)
}
}
impl WlantapPhyProxyInterface for WlantapPhyProxy {
type ShutdownResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#shutdown(&self) -> Self::ShutdownResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1df8087c49fa9a5e,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x1df8087c49fa9a5e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#rx(&self, mut data: &[u8], mut info: &WlanRxInfo) -> Result<(), fidl::Error> {
self.client.send::<WlantapPhyRxRequest>(
(data, info),
0x165a656419ab3b41,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#report_tx_result(
&self,
mut txr: &fidl_fuchsia_wlan_common::WlanTxResult,
) -> Result<(), fidl::Error> {
self.client.send::<WlantapPhyReportTxResultRequest>(
(txr,),
0x2c27ed678c1e7eb4,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#scan_complete(&self, mut scan_id: u64, mut status: i32) -> Result<(), fidl::Error> {
self.client.send::<WlantapPhyScanCompleteRequest>(
(scan_id, status),
0x61a579015cff7674,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct WlantapPhyEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WlantapPhyEventStream {}
impl futures::stream::FusedStream for WlantapPhyEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WlantapPhyEventStream {
type Item = Result<WlantapPhyEvent, 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(WlantapPhyEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WlantapPhyEvent {
Tx { args: TxArgs },
WlanSoftmacStart {},
SetChannel { args: SetChannelArgs },
JoinBss { args: JoinBssArgs },
StartScan { args: StartScanArgs },
SetKey { args: SetKeyArgs },
SetCountry { args: SetCountryArgs },
}
impl WlantapPhyEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_tx(self) -> Option<TxArgs> {
if let WlantapPhyEvent::Tx { args } = self {
Some((args))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wlan_softmac_start(self) -> Option<()> {
if let WlantapPhyEvent::WlanSoftmacStart {} = self {
Some(())
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_channel(self) -> Option<SetChannelArgs> {
if let WlantapPhyEvent::SetChannel { args } = self {
Some((args))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_join_bss(self) -> Option<JoinBssArgs> {
if let WlantapPhyEvent::JoinBss { args } = self {
Some((args))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_scan(self) -> Option<StartScanArgs> {
if let WlantapPhyEvent::StartScan { args } = self {
Some((args))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_key(self) -> Option<SetKeyArgs> {
if let WlantapPhyEvent::SetKey { args } = self {
Some((args))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_country(self) -> Option<SetCountryArgs> {
if let WlantapPhyEvent::SetCountry { args } = self {
Some((args))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WlantapPhyEvent, 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 {
0x3ccc6c207280b569 => {
let mut out = fidl::new_empty!(
WlantapPhyTxRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhyTxRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::Tx { args: out.args }))
}
0x328bcae20dec2b88 => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::WlanSoftmacStart {}))
}
0x60eb9a607f96a948 => {
let mut out = fidl::new_empty!(
WlantapPhySetChannelRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhySetChannelRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::SetChannel { args: out.args }))
}
0xef930e871dbf2f9 => {
let mut out = fidl::new_empty!(
WlantapPhyJoinBssRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhyJoinBssRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::JoinBss { args: out.args }))
}
0x75ed87321e05cdbb => {
let mut out = fidl::new_empty!(
WlantapPhyStartScanRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhyStartScanRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::StartScan { args: out.args }))
}
0xff7bf591b026267 => {
let mut out = fidl::new_empty!(
WlantapPhySetKeyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhySetKeyRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::SetKey { args: out.args }))
}
0x4cd2f84e3ccfcd14 => {
let mut out = fidl::new_empty!(
WlantapPhySetCountryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhySetCountryRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((WlantapPhyEvent::SetCountry { args: out.args }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <WlantapPhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WlantapPhyRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WlantapPhyRequestStream {}
impl futures::stream::FusedStream for WlantapPhyRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WlantapPhyRequestStream {
type Protocol = WlantapPhyMarker;
type ControlHandle = WlantapPhyControlHandle;
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 {
WlantapPhyControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for WlantapPhyRequestStream {
type Item = Result<WlantapPhyRequest, 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 WlantapPhyRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x1df8087c49fa9a5e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlantapPhyControlHandle { inner: this.inner.clone() };
Ok(WlantapPhyRequest::Shutdown {
responder: WlantapPhyShutdownResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x165a656419ab3b41 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
WlantapPhyRxRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhyRxRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlantapPhyControlHandle { inner: this.inner.clone() };
Ok(WlantapPhyRequest::Rx { data: req.data, info: req.info, control_handle })
}
0x2c27ed678c1e7eb4 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
WlantapPhyReportTxResultRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhyReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlantapPhyControlHandle { inner: this.inner.clone() };
Ok(WlantapPhyRequest::ReportTxResult { txr: req.txr, control_handle })
}
0x61a579015cff7674 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
WlantapPhyScanCompleteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlantapPhyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WlantapPhyControlHandle { inner: this.inner.clone() };
Ok(WlantapPhyRequest::ScanComplete {
scan_id: req.scan_id,
status: req.status,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WlantapPhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WlantapPhyRequest {
Shutdown {
responder: WlantapPhyShutdownResponder,
},
Rx {
data: Vec<u8>,
info: WlanRxInfo,
control_handle: WlantapPhyControlHandle,
},
ReportTxResult {
txr: fidl_fuchsia_wlan_common::WlanTxResult,
control_handle: WlantapPhyControlHandle,
},
ScanComplete {
scan_id: u64,
status: i32,
control_handle: WlantapPhyControlHandle,
},
}
impl WlantapPhyRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_shutdown(self) -> Option<(WlantapPhyShutdownResponder)> {
if let WlantapPhyRequest::Shutdown { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_rx(self) -> Option<(Vec<u8>, WlanRxInfo, WlantapPhyControlHandle)> {
if let WlantapPhyRequest::Rx { data, info, control_handle } = self {
Some((data, info, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_report_tx_result(
self,
) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlantapPhyControlHandle)> {
if let WlantapPhyRequest::ReportTxResult { txr, control_handle } = self {
Some((txr, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_scan_complete(self) -> Option<(u64, i32, WlantapPhyControlHandle)> {
if let WlantapPhyRequest::ScanComplete { scan_id, status, control_handle } = self {
Some((scan_id, status, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WlantapPhyRequest::Shutdown { .. } => "shutdown",
WlantapPhyRequest::Rx { .. } => "rx",
WlantapPhyRequest::ReportTxResult { .. } => "report_tx_result",
WlantapPhyRequest::ScanComplete { .. } => "scan_complete",
}
}
}
#[derive(Debug, Clone)]
pub struct WlantapPhyControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WlantapPhyControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl WlantapPhyControlHandle {
pub fn send_tx(&self, mut args: &TxArgs) -> Result<(), fidl::Error> {
self.inner.send::<WlantapPhyTxRequest>(
(args,),
0,
0x3ccc6c207280b569,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_wlan_softmac_start(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x328bcae20dec2b88,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_set_channel(&self, mut args: &SetChannelArgs) -> Result<(), fidl::Error> {
self.inner.send::<WlantapPhySetChannelRequest>(
(args,),
0,
0x60eb9a607f96a948,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_join_bss(&self, mut args: &JoinBssArgs) -> Result<(), fidl::Error> {
self.inner.send::<WlantapPhyJoinBssRequest>(
(args,),
0,
0xef930e871dbf2f9,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_start_scan(&self, mut args: &StartScanArgs) -> Result<(), fidl::Error> {
self.inner.send::<WlantapPhyStartScanRequest>(
(args,),
0,
0x75ed87321e05cdbb,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_set_key(&self, mut args: &SetKeyArgs) -> Result<(), fidl::Error> {
self.inner.send::<WlantapPhySetKeyRequest>(
(args,),
0,
0xff7bf591b026267,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_set_country(&self, mut args: &SetCountryArgs) -> Result<(), fidl::Error> {
self.inner.send::<WlantapPhySetCountryRequest>(
(args,),
0,
0x4cd2f84e3ccfcd14,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WlantapPhyShutdownResponder {
control_handle: std::mem::ManuallyDrop<WlantapPhyControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WlantapPhyShutdownResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WlantapPhyShutdownResponder {
type ControlHandle = WlantapPhyControlHandle;
fn control_handle(&self) -> &WlantapPhyControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WlantapPhyShutdownResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x1df8087c49fa9a5e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for JoinBssArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for JoinBssArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JoinBssArgs, D>
for &JoinBssArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<JoinBssArgs>(offset);
fidl::encoding::Encode::<JoinBssArgs, D>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
<fidl_fuchsia_wlan_common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::JoinBssRequest, D>,
> fidl::encoding::Encode<JoinBssArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<JoinBssArgs>(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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JoinBssArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
wlan_softmac_id: fidl::new_empty!(u16, D),
config: fidl::new_empty!(fidl_fuchsia_wlan_common::JoinBssRequest, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::JoinBssRequest,
D,
&mut self.config,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetChannelArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetChannelArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetChannelArgs, D>
for &SetChannelArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetChannelArgs>(offset);
fidl::encoding::Encode::<SetChannelArgs, D>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
<fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanChannel, D>,
> fidl::encoding::Encode<SetChannelArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetChannelArgs>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetChannelArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
wlan_softmac_id: fidl::new_empty!(u16, D),
channel: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffff0000u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::WlanChannel,
D,
&mut self.channel,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetCountryArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetCountryArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryArgs, D>
for &SetCountryArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCountryArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SetCountryArgs)
.write_unaligned((self as *const SetCountryArgs).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
> fidl::encoding::Encode<SetCountryArgs, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetCountryArgs>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SetKeyArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SetKeyArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetKeyArgs, D>
for &SetKeyArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetKeyArgs>(offset);
fidl::encoding::Encode::<SetKeyArgs, D>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
<WlanKeyConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<WlanKeyConfig, D>,
> fidl::encoding::Encode<SetKeyArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SetKeyArgs>(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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetKeyArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
wlan_softmac_id: fidl::new_empty!(u16, D),
config: fidl::new_empty!(WlanKeyConfig, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
fidl::decode!(WlanKeyConfig, D, &mut self.config, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StartScanArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StartScanArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartScanArgs, D>
for &StartScanArgs
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StartScanArgs>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut StartScanArgs)
.write_unaligned((self as *const StartScanArgs).read());
let padding_ptr = buf_ptr.offset(0) as *mut u64;
let padding_mask = 0xffffffffffff0000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<StartScanArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StartScanArgs>(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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartScanArgs {
#[inline(always)]
fn new_empty() -> Self {
Self { wlan_softmac_id: fidl::new_empty!(u16, D), scan_id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TxArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TxArgs {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TxArgs, D> for &TxArgs {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TxArgs>(offset);
fidl::encoding::Encode::<TxArgs, D>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow(&self.packet),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<WlanTxPacket, D>,
> fidl::encoding::Encode<TxArgs, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TxArgs>(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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxArgs {
#[inline(always)]
fn new_empty() -> Self {
Self {
wlan_softmac_id: fidl::new_empty!(u16, D),
packet: fidl::new_empty!(WlanTxPacket, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
fidl::decode!(WlanTxPacket, D, &mut self.packet, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanKeyConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanKeyConfig {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfig, D>
for &WlanKeyConfig
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanKeyConfig>(offset);
fidl::encoding::Encode::<WlanKeyConfig, D>::encode(
(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.protection),
<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow(
&self.cipher_oui,
),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.cipher_type),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.key_type),
<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(
&self.peer_addr,
),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.key_idx),
<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u8, D>,
T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 3>, D>,
T2: fidl::encoding::Encode<u8, D>,
T3: fidl::encoding::Encode<u8, D>,
T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
T5: fidl::encoding::Encode<u8, D>,
T6: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
> fidl::encoding::Encode<WlanKeyConfig, D> for (T0, T1, T2, T3, T4, T5, T6)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanKeyConfig>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
self.2.encode(encoder, offset + 4, depth)?;
self.3.encode(encoder, offset + 5, depth)?;
self.4.encode(encoder, offset + 6, depth)?;
self.5.encode(encoder, offset + 12, depth)?;
self.6.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfig {
#[inline(always)]
fn new_empty() -> Self {
Self {
protection: fidl::new_empty!(u8, D),
cipher_oui: fidl::new_empty!(fidl::encoding::Array<u8, 3>, D),
cipher_type: fidl::new_empty!(u8, D),
key_type: fidl::new_empty!(u8, D),
peer_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
key_idx: fidl::new_empty!(u8, D),
key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff0000000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u8, D, &mut self.protection, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Array<u8, 3>, D, &mut self.cipher_oui, decoder, offset + 1, _depth)?;
fidl::decode!(u8, D, &mut self.cipher_type, decoder, offset + 4, _depth)?;
fidl::decode!(u8, D, &mut self.key_type, decoder, offset + 5, _depth)?;
fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.peer_addr, decoder, offset + 6, _depth)?;
fidl::decode!(u8, D, &mut self.key_idx, decoder, offset + 12, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
for &WlanRxInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanRxInfo>(offset);
fidl::encoding::Encode::<WlanRxInfo, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
<fidl_fuchsia_wlan_common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
<fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
<i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
<i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanPhyType, D>,
T3: fidl::encoding::Encode<u32, D>,
T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanChannel, D>,
T5: fidl::encoding::Encode<u8, D>,
T6: fidl::encoding::Encode<i8, D>,
T7: fidl::encoding::Encode<i16, D>,
> fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanRxInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 12, depth)?;
self.4.encode(encoder, offset + 16, depth)?;
self.5.encode(encoder, offset + 28, depth)?;
self.6.encode(encoder, offset + 29, depth)?;
self.7.encode(encoder, offset + 30, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
rx_flags: fidl::new_empty!(u32, D),
valid_fields: fidl::new_empty!(u32, D),
phy: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanPhyType, D),
data_rate: fidl::new_empty!(u32, D),
channel: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D),
mcs: fidl::new_empty!(u8, D),
rssi_dbm: fidl::new_empty!(i8, D),
snr_dbh: fidl::new_empty!(i16, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::WlanPhyType,
D,
&mut self.phy,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::WlanChannel,
D,
&mut self.channel,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
20
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
for &WlanTxInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanTxInfo>(offset);
fidl::encoding::Encode::<WlanTxInfo, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
<fidl_fuchsia_wlan_common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.cbw),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<u16, D>,
T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanPhyType, D>,
T4: fidl::encoding::Encode<u8, D>,
T5: fidl::encoding::Encode<u8, D>,
> fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanTxInfo>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u32).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(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)?;
self.3.encode(encoder, offset + 12, depth)?;
self.4.encode(encoder, offset + 16, depth)?;
self.5.encode(encoder, offset + 17, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
tx_flags: fidl::new_empty!(u32, D),
valid_fields: fidl::new_empty!(u32, D),
tx_vector_idx: fidl::new_empty!(u16, D),
phy: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanPhyType, D),
cbw: fidl::new_empty!(u8, D),
mcs: fidl::new_empty!(u8, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
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 + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
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 + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::WlanPhyType,
D,
&mut self.phy,
decoder,
offset + 12,
_depth
)?;
fidl::decode!(u8, D, &mut self.cbw, decoder, offset + 16, _depth)?;
fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 17, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
for &WlanTxPacket
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanTxPacket>(offset);
fidl::encoding::Encode::<WlanTxPacket, D>::encode(
(
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
T1: fidl::encoding::Encode<WlanTxInfo, D>,
> fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlanTxPacket>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
#[inline(always)]
fn new_empty() -> Self {
Self {
data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
info: fidl::new_empty!(WlanTxInfo, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.data,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for WlantapCtlCreatePhyRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapCtlCreatePhyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
96
}
}
unsafe impl
fidl::encoding::Encode<
WlantapCtlCreatePhyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut WlantapCtlCreatePhyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapCtlCreatePhyRequest>(offset);
fidl::encoding::Encode::<WlantapCtlCreatePhyRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<WlantapPhyConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WlantapPhyMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.proxy),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<WlantapPhyConfig, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WlantapPhyMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
WlantapCtlCreatePhyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapCtlCreatePhyRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(88);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 88, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for WlantapCtlCreatePhyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
config: fidl::new_empty!(
WlantapPhyConfig,
fidl::encoding::DefaultFuchsiaResourceDialect
),
proxy: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WlantapPhyMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(88) };
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 + 88 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
WlantapPhyConfig,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.config,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WlantapPhyMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.proxy,
decoder,
offset + 88,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapCtlCreatePhyResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapCtlCreatePhyResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapCtlCreatePhyResponse, D> for &WlantapCtlCreatePhyResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapCtlCreatePhyResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WlantapCtlCreatePhyResponse)
.write_unaligned((self as *const WlantapCtlCreatePhyResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<WlantapCtlCreatePhyResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapCtlCreatePhyResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapCtlCreatePhyResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyConfig {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
88
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyConfig, D>
for &WlantapPhyConfig
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyConfig>(offset);
fidl::encoding::Encode::<WlantapPhyConfig, D>::encode(
(
<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_role),
<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_phys),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.hardware_capability),
<fidl::encoding::Vector<fidl_fuchsia_wlan_device::BandInfo, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bands),
<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.quiet),
<fidl_fuchsia_wlan_common::DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.discovery_support),
<fidl_fuchsia_wlan_common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_sublayer_support),
<fidl_fuchsia_wlan_common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.security_support),
<fidl_fuchsia_wlan_common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.spectrum_management_support),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanMacRole, D>,
T2: fidl::encoding::Encode<
fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>,
D,
>,
T3: fidl::encoding::Encode<u32, D>,
T4: fidl::encoding::Encode<
fidl::encoding::Vector<fidl_fuchsia_wlan_device::BandInfo, 8>,
D,
>,
T5: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
T6: fidl::encoding::Encode<bool, D>,
T7: fidl::encoding::Encode<fidl_fuchsia_wlan_common::DiscoverySupport, D>,
T8: fidl::encoding::Encode<fidl_fuchsia_wlan_common::MacSublayerSupport, D>,
T9: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SecuritySupport, D>,
T10: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SpectrumManagementSupport, D>,
> fidl::encoding::Encode<WlantapPhyConfig, D>
for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyConfig>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 32, depth)?;
self.4.encode(encoder, offset + 40, depth)?;
self.5.encode(encoder, offset + 56, depth)?;
self.6.encode(encoder, offset + 72, depth)?;
self.7.encode(encoder, offset + 73, depth)?;
self.8.encode(encoder, offset + 76, depth)?;
self.9.encode(encoder, offset + 81, depth)?;
self.10.encode(encoder, offset + 84, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyConfig {
#[inline(always)]
fn new_empty() -> Self {
Self {
sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
mac_role: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D),
supported_phys: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D),
hardware_capability: fidl::new_empty!(u32, D),
bands: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_device::BandInfo, 8>, D),
name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
quiet: fidl::new_empty!(bool, D),
discovery_support: fidl::new_empty!(fidl_fuchsia_wlan_common::DiscoverySupport, D),
mac_sublayer_support: fidl::new_empty!(
fidl_fuchsia_wlan_common::MacSublayerSupport,
D
),
security_support: fidl::new_empty!(fidl_fuchsia_wlan_common::SecuritySupport, D),
spectrum_management_support: fidl::new_empty!(
fidl_fuchsia_wlan_common::SpectrumManagementSupport,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffff000000000000u64;
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(8) };
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 + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
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 + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff0000000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::WlanMacRole,
D,
&mut self.mac_role,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D, &mut self.supported_phys, decoder, offset + 16, _depth)?;
fidl::decode!(u32, D, &mut self.hardware_capability, decoder, offset + 32, _depth)?;
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_device::BandInfo, 8>, D, &mut self.bands, decoder, offset + 40, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<32>,
D,
&mut self.name,
decoder,
offset + 56,
_depth
)?;
fidl::decode!(bool, D, &mut self.quiet, decoder, offset + 72, _depth)?;
fidl::decode!(
fidl_fuchsia_wlan_common::DiscoverySupport,
D,
&mut self.discovery_support,
decoder,
offset + 73,
_depth
)?;
fidl::decode!(
fidl_fuchsia_wlan_common::MacSublayerSupport,
D,
&mut self.mac_sublayer_support,
decoder,
offset + 76,
_depth
)?;
fidl::decode!(
fidl_fuchsia_wlan_common::SecuritySupport,
D,
&mut self.security_support,
decoder,
offset + 81,
_depth
)?;
fidl::decode!(
fidl_fuchsia_wlan_common::SpectrumManagementSupport,
D,
&mut self.spectrum_management_support,
decoder,
offset + 84,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyJoinBssRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyJoinBssRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for &WlantapPhyJoinBssRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
fidl::encoding::Encode::<WlantapPhyJoinBssRequest, D>::encode(
(<JoinBssArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<JoinBssArgs, D>>
fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhyJoinBssRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(JoinBssArgs, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(JoinBssArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyReportTxResultRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyReportTxResultRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D>
for &WlantapPhyReportTxResultRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
fidl::encoding::Encode::<WlantapPhyReportTxResultRequest, D>::encode(
(
<fidl_fuchsia_wlan_common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.txr),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanTxResult, D>,
> fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhyReportTxResultRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { txr: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanTxResult, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_wlan_common::WlanTxResult,
D,
&mut self.txr,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyRxRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyRxRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyRxRequest, D>
for &WlantapPhyRxRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
fidl::encoding::Encode::<WlantapPhyRxRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
T1: fidl::encoding::Encode<WlanRxInfo, D>,
> fidl::encoding::Encode<WlantapPhyRxRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyRxRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
info: fidl::new_empty!(WlanRxInfo, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.data,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyScanCompleteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyScanCompleteRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D>
for &WlantapPhyScanCompleteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WlantapPhyScanCompleteRequest)
.write_unaligned((self as *const WlantapPhyScanCompleteRequest).read());
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<i32, D>,
> fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhyScanCompleteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { scan_id: fidl::new_empty!(u64, D), status: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(8) };
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 + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhySetChannelRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhySetChannelRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for &WlantapPhySetChannelRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
fidl::encoding::Encode::<WlantapPhySetChannelRequest, D>::encode(
(<SetChannelArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetChannelArgs, D>>
fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhySetChannelRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(SetChannelArgs, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(SetChannelArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhySetCountryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhySetCountryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for &WlantapPhySetCountryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WlantapPhySetCountryRequest)
.write_unaligned((self as *const WlantapPhySetCountryRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetCountryArgs, D>>
fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhySetCountryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(SetCountryArgs, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhySetKeyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhySetKeyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for &WlantapPhySetKeyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
fidl::encoding::Encode::<WlantapPhySetKeyRequest, D>::encode(
(<SetKeyArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetKeyArgs, D>>
fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhySetKeyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(SetKeyArgs, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(SetKeyArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyStartScanRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyStartScanRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for &WlantapPhyStartScanRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WlantapPhyStartScanRequest)
.write_unaligned((self as *const WlantapPhyStartScanRequest).read());
let padding_ptr = buf_ptr.offset(0) as *mut u64;
let padding_mask = 0xffffffffffff0000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StartScanArgs, D>>
fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for WlantapPhyStartScanRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(StartScanArgs, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WlantapPhyTxRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WlantapPhyTxRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyTxRequest, D>
for &WlantapPhyTxRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
fidl::encoding::Encode::<WlantapPhyTxRequest, D>::encode(
(<TxArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TxArgs, D>>
fidl::encoding::Encode<WlantapPhyTxRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyTxRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(TxArgs, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(TxArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
Ok(())
}
}
}